text:
dbhost=$1
dbuser=$2
dbpwd=$3
path=./base_data/usage_data
path1=./data_after_upgrade
rm -rf $path1
mkdir $path1

mysql -u $dbuser -p$dbpwd -h $dbhost -e "show tables from cloud_usage" > $path1/usage_tables_upgrade

# to check if number of tables and table name differs

diff $path/usage_tables $path1/usage_tables_upgrade > usage_table_difference
if [ -s usage_table_difference ]
then
        echo "usage table differs between fresh and upgraded install "
        cat usage_table_difference
        # do something as file has data
else
        echo "usage tables  are identicals between fresh and upgraded install "
        rm -rf usage_tables_difference
        # do something as file is empty

fi

for tablename in `cat $path1/usage_tables_upgrade`
do
        if [ $tablename != 'Tables_in_cloud_usage' ]
        then
                mysql -u $dbuser -p$dbpwd -h $dbhost -e "describe cloud_usage.$tablename" > $path1/upgradedschema
                cat $path/$tablename >  $tablename.diff
                cat $path1/upgradedschema >> $tablename.diff
                sort $tablename.diff > $tablename.sort
                uniq -u $tablename.sort > $tablename.uniq

                if [ -s $tablename.uniq ]
                then
                        echo $tablename  "table schema is different."
                        cat $path1/upgradedschema > usage_$tablename
                        rm -rf $tablename.diff $tablename.sort

                        # do something as file has data
                else

                        rm -rf $tablename.diff $tablename.sort $tablename.uniq
                fi

        fi
done

rm -rf $path1


text:
using Autodesk.AutoCAD.DatabaseServices;

namespace XCOM.Commands.XCommand
{
    public class ProtectDrawing : XCOMActionBase
    {
        public override string Name => "Dosya Koruması";
        public override int Order => 300000;
        public override string HelpText => Properties.Resources.ProtectDrawing;

        public override void Run(string filename, Database db)
        {
            using (Transaction tr = db.TransactionManager.StartTransaction())
            {
                try
                {
                    // Get all items in this space
                    BlockTableRecord btrModel = (BlockTableRecord)tr.GetObject(SymbolUtilityServices.GetBlockModelSpaceId(db), OpenMode.ForWrite);
                    ObjectIdCollection items = new ObjectIdCollection();
                    foreach (ObjectId id in btrModel)
                    {
                        items.Add(id);
                    }

                    if (items.Count > 0)
                    {
                        // Create the unexlodable anon block
                        BlockTableRecord btrProtected = new BlockTableRecord();
                        btrProtected.Name = "*U";
                        btrProtected.Explodable = false;

                        // Add the new block to the block table
                        BlockTable bt = (BlockTable)tr.GetObject(db.BlockTableId, OpenMode.ForWrite);
                        ObjectId btrId = bt.Add(btrProtected);
                        tr.AddNewlyCreatedDBObject(btrProtected, true);

                        // Add all entities in this space to the anon block
                        btrProtected.AssumeOwnershipOf(items);

                        // Add the block reference to this space
                        BlockReference br = new BlockReference(Autodesk.AutoCAD.Geometry.Point3d.Origin, btrId);
                        btrModel.AppendEntity(br);
                        tr.AddNewlyCreatedDBObject(br, true);
                    }
                }
                catch (System.Exception ex)
                {
                    OnError(ex);
                }

                tr.Commit();
            }
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
import {Injectable}    from '@angular/core';
import {Headers, Http} from '@angular/http';
import {Char} from './char';
import {Product} from './product';
import {RequestService} from '../services/request/request.service';
import {CONFIG} from '../app.config';

@Injectable()
export class CharService {

  constructor(private http:Http, private requestService:RequestService) {
  }

  getChars():Promise<Char[]> {
    let url = CONFIG.apiMychars;
    let headers = this.requestService.getAuthHeaders();
    return this.http.get(url, {headers: headers})
      .toPromise()
      .then(response => response.json())
      .catch(this.handleError);
  }

  getChar(id:number) {
    return this.getChars()
      .then(chars => chars.filter(char => char.id === id)[0]);
  }

  getProducts():Promise<any> {
    let url = CONFIG.apiPayShop;
    let headers = this.requestService.getAuthHeaders();
    return this.http.get(url, {headers: headers})
      .toPromise()
      .then(response => response.json())
      .catch(this.handleError);
  }

  byItem(id:number, charId:number, count:number = 1) {
    let url = CONFIG.apiBuyitem;
    let headers = this.requestService.getAuthHeaders();
    let item = {'id': id, 'charId': charId, 'count': count};
    return this.http
      .post(url, JSON.stringify(item), {headers: headers})
      .toPromise()
      .then(res => res.json())
      .catch(this.handleError);
  }

  private handleError(error:any) {
    let errMsg = 'An error occurred. ';
    let messages = error.json();
    errMsg += (error.message) ? error.message : error.status ? `${error.status} - ${error.statusText}` : 'Server error';
    if (messages) {
      errMsg += ' ' + JSON.stringify(messages);
    }
    console.error('An error occurred', error);
    return Promise.reject(errMsg);
  }

}


text:
package seedu.ezdo.testutil;

import seedu.ezdo.model.tag.UniqueTagList;
import seedu.ezdo.model.todo.Name;
import seedu.ezdo.model.todo.Priority;
import seedu.ezdo.model.todo.ReadOnlyTask;
import seedu.ezdo.model.todo.Recur;
import seedu.ezdo.model.todo.TaskDate;

/**
 * A mutable task object. For testing only.
 */
public class TestTask implements ReadOnlyTask {

    private static final String PREFIX_PRIORITY = "p/";
    private static final String PREFIX_STARTDATE = "s/";
    private static final String PREFIX_DUEDATE = "d/";

    private Name name;
    private TaskDate startDate;
    private TaskDate dueDate;
    private Priority priority;
    private Recur recur;
    private boolean done;
    private boolean hasStarted;
    private UniqueTagList tags;

    public TestTask() {
        tags = new UniqueTagList();
    }

    /**
     * Creates a copy of {@code taskToCopy}.
     */
    public TestTask(TestTask taskToCopy) {
        this.name = taskToCopy.getName();
        this.priority = taskToCopy.getPriority();
        this.startDate = taskToCopy.getStartDate();
        this.dueDate = taskToCopy.getDueDate();
        this.recur = taskToCopy.getRecur();
        this.done = taskToCopy.getDone();
        this.tags = taskToCopy.getTags();
    }

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

    public boolean getDone() {
        return this.done;
    }

    public boolean getStarted() {
        return this.hasStarted;
    }

    public void setStartDate(TaskDate startDate) {
        this.startDate = startDate;
    }

    public void setDueDate(TaskDate dueDate) {
        this.dueDate = dueDate;
    }

    public void setPriority(Priority priority) {
        this.priority = priority;
    }

    public void setDone() {
        this.done = true;
    }

    public void setRecur(Recur recur) {
        this.recur = recur;
    }

    public void setTags(UniqueTagList tags) {
        this.tags = tags;
    }

    @Override
    public Name getName() {
        return name;
    }

    @Override
    public Priority getPriority() {
        return priority;
    }

    @Override
    public TaskDate getStartDate() {
        return startDate;
    }

    @Override
    public TaskDate getDueDate() {
        return dueDate;
    }

    @Override
    public Recur getRecur() {
        return recur;
    }

    @Override
    public UniqueTagList getTags() {
        return tags;
    }

    @Override
    public String toString() {
        return getAsText();
    }

    //@@author A0138907W
    /**
     * Constructs an add command for the test task.
     * @param usesShortCommand Specifies if the long or short version of the command should be used. ("add" or "a")
     * @return This is the add command that will add the test task.
     */
    public String getAddCommand(boolean usesShortCommand) {
        StringBuilder sb = new StringBuilder();
        if (usesShortCommand) {
            sb.append("a " + this.getName().fullName + " ");
        } else {
            sb.append("add " + this.getName().fullName + " ");
        }
        sb.append(PREFIX_STARTDATE + this.getStartDate().value + " ");
        sb.append(PREFIX_DUEDATE + this.getDueDate().value + " ");
        sb.append(PREFIX_PRIORITY + this.getPriority().value + " ");
        this.getTags().asObservableList().stream().forEach(s -> sb.append("t/" + s.tagName + " "));
        return sb.toString();
    }
}


text:
require 'active_record'
require 'timecop'

ENV['RAILS_ENV'] = 'test'

if %w[yes true 1].include?(ENV['COVERAGE'])
  require 'simplecov'
  require 'simplecov-console'
  require 'simplecov_json_formatter'

  SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
    [
      SimpleCov::Formatter::HTMLFormatter,
      SimpleCov::Formatter::JSONFormatter,
      SimpleCov::Formatter::Console
    ]
  )

  SimpleCov.start 'test_frameworks' do
    enable_coverage :branch
  end
end

ActiveRecord::Base.establish_connection adapter: 'sqlite3', database: ':memory:'
ActiveRecord::Migration.verbose = false
RSpec::Mocks.configuration.allow_message_expectations_on_nil = true

require_relative './dummy/config/environment'
require_relative './support/controller_helpers'
require_relative './support/user_model'

require 'rspec/rails'

RSpec.configure do |config|
  config.color = true
  config.include ControllerHelpers

  config.expect_with :rspec do |expectations|
    expectations.max_formatted_output_length = 1_000_000
    expectations.include_chain_clauses_in_custom_matcher_descriptions = true
  end

  config.mock_with :rspec do |mocks|
    mocks.verify_partial_doubles = true
  end

  config.before(:suite) do
    ActiveRecord::MigrationContext.new(File.expand_path('../db/migrate', __dir__),
                                       ActiveRecord::SchemaMigration).migrate(nil)
  end
end


text:
package co.adun.mvnejb3jpa.web.model;

import java.util.List;

import co.adun.mvnejb3jpa.persistence.entity.LtSubjectTravel;
import co.adun.mvnejb3jpa.persistence.entity.LtSubjectTravelSource;
import co.adun.mvnejb3jpa.web.model.PageModel;

public class TravelInformationModel implements PageModel {

	LtSubjectTravel ltSubjectTravel;
    DateValueModel travelDate;
    List<LtSubjectTravelSource> sources;

	public LtSubjectTravel getLtSubjectTravel() {
		return ltSubjectTravel;
	}

	public void setLtSubjectTravel(LtSubjectTravel ltSubjectTravel) {
		this.ltSubjectTravel = ltSubjectTravel;
	}

	public List<LtSubjectTravelSource> getSources() {
		return sources;
	}

	public void setSources(List<LtSubjectTravelSource> sources) {
		this.sources = sources;
	}

	public DateValueModel getTravelDate() {
		return travelDate;
	}

	public void setTravelDate(DateValueModel travelDate) {
		this.travelDate = travelDate;
	}

}


text:
This sample illustrates how to use [Moq](https://github.com/Moq/moq4/) to create a unit test that mocks the response from a ConfigurationClient method. For more examples of mocking, see the [Azure.Data.AppConfiguration.Tests](../tests/ConfigurationMockTests.cs) project.

## Define method that uses `ConfigurationClient`

To show the usage of mocks, define a method that will be tested with mocked objects. For more details about this sample method, see "[Update a Configuration If Unchanged](Sample6_UpdateSettingIfUnchanged.md)" sample.

```C# Snippet:AzConfigSample7_MethodToTest
private static async Task<int> UpdateAvailableVmsAsync(ConfigurationClient client, int releasedVMs, CancellationToken cancellationToken)
{
    while (!cancellationToken.IsCancellationRequested)
    {
        ConfigurationSetting setting = await client.GetConfigurationSettingAsync("available_vms", cancellationToken: cancellationToken);
        var availableVmsCount = int.Parse(setting.Value);
        setting.Value = (availableVmsCount + releasedVMs).ToString();

        try
        {
            ConfigurationSetting updatedSetting = await client.SetConfigurationSettingAsync(setting, onlyIfUnchanged: true, cancellationToken);
            return int.Parse(updatedSetting.Value);
        }
        catch (RequestFailedException e) when (e.Status == 412)
        {
        }
    }

    cancellationToken.ThrowIfCancellationRequested();
    return 0;
}
```

## Create and setup mocks

For this test, create a mock for the `ConfigurationClient` and `Response`.

```C# Snippet:AzConfigSample7_CreateMocks
var mockResponse = new Mock<Response>();
var mockClient = new Mock<ConfigurationClient>();
```

Then, set up the client methods that will be executed when `GetConfigurationSettingAsync` and `SetConfigurationSettingAsync` are called on the mock client.

```C# Snippet:AzConfigSample7_SetupMocks
Response<ConfigurationSetting> response = Response.FromValue(ConfigurationModelFactory.ConfigurationSetting("available_vms", "10"), mockResponse.Object);
mockClient.Setup(c => c.GetConfigurationSettingAsync("available_vms", It.IsAny<string>(), It.IsAny<CancellationToken>()))
    .Returns(Task.FromResult(response));
mockClient.Setup(c => c.SetConfigurationSettingAsync(It.IsAny<ConfigurationSetting>(), true, It.IsAny<CancellationToken>()))
    .Returns((ConfigurationSetting cs, bool onlyIfUnchanged, CancellationToken ct) => Task.FromResult(Response.FromValue(cs, new Mock<Response>().Object)));
```

## Use mocks

Now to validate `ReleaseVmsAsync` without making a network call use `ConfigurationClient` mock.

```C# Snippet:AzConfigSample7_UseMocks
ConfigurationClient client = mockClient.Object;
int availableVms = await UpdateAvailableVmsAsync(client, 2, default);
Assert.AreEqual(12, availableVms);
```


text:
export default class BaseModel {
    public id:number;
}

export class SubModelA extends BaseModel {
    public name:string;
}

export class SubModelB extends BaseModel {
    public mail:string;
    public password:string;
}


text:
<?php

namespace SocketProgrammingHandbook;

require_once __DIR__.'/reactor.php';

$main = function () {
    $port = @$_SERVER['PORT'] ?: 1337;
    $server = @stream_socket_server("tcp://127.0.0.1:$port", $errno, $errstr);

    if (false === $server) {
        // Write error message to STDERR and exit, just like UNIX programs usually do
        fprintf(STDERR, "Error connecting to socket: %d %s\n", $errno, $errstr);
        exit(1);
    }

    stream_set_blocking($server, 0);

    printf("Listening on port %d\n", $port);

    $loop = new StreamSelectLoop();

    $loop->addReadStream($server, function ($server) use ($loop) {
        $conn = @stream_socket_accept($server);

        if (!is_resource($conn)) {
            return;
        }

        $loop->addWriteStream($conn, function ($conn) use ($loop) {
            $content = "
Hello World
";
            $length = strlen($content);

            fwrite($conn, "HTTP/1.1 200 OK\r\n");
            fwrite($conn, "Content-Type: text/html\r\n");
            fwrite($conn, "Content-Length: $length\r\n");
            fwrite($conn, "\r\n");
            fwrite($conn, $content);
            fclose($conn);
            $loop->removeStream($conn);
        });
    });

    $loop->run();
};

if (__FILE__ === realpath($argv[0])) {
    $main();
}


text:
package info.gianlucacosta.arcontes.algorithms;

/**
 * Listener whose methods are called during the whole execution of an algorithm
 */
public interface AlgorithmListener {

    /**
     * Called at the end of the init() method, if it is going to return true
     * (that is, if the algorithm is going to continue)
     */
    void onInited();

    /**
     * Called at the beginning of an algorithm step, just after the step index
     * has been increased and the related metainfo has been stored
     *
     * @param step the current step index
     */
    void onStepStarted(int step);

    /**
     * Called immediately after a step has been performed, before processing its
     * result for flow control
     *
     * @param step        the current step index
     * @param stepOutcome the outcome of the step
     */
    void onStepCompleted(int step, AlgorithmStepOutcome stepOutcome);

    /**
     * The last step before the end of an algorithm manually interrupted by the
     * user.
     */
    void onInterrupted();

    /**
     * The last step before the end of an algorithm that completed successfully.
     * It is called after the finalization phase.
     */
    void onFinished();

}


text:
package net.andreinc.jbvext.annotations.str.validators;

import net.andreinc.jbvext.annotations.str.Blank;
import org.apache.commons.lang3.StringUtils;

import java.util.function.Function;

public class BlankValidator extends GenericStringValidator<Blank> {
    @Override
    public Function<String, Boolean> condition() {
        return StringUtils::isBlank;
    }
}


text:
@interface PKDefinitionPhaseVisitor ()
@end

@implementation PKDefinitionPhaseVisitor

- (void)dealloc {
    self.assembler = nil;
    self.preassembler = nil;
    self.tokenKinds = nil;
    self.defaultDefNameTab = nil;
    [super dealloc];
}

- (NSString *)defaultDefNameForStringValue:(NSString *)strVal {
    NSString *defName = _defaultDefNameTab[strVal];
    // not sure if we want this
    if (!defName) {
        NSArray *comps = [strVal componentsSeparatedByCharactersInSet:[[NSCharacterSet alphanumericCharacterSet] invertedSet]];
        defName = [comps componentsJoinedByString:@"_"];
        if ([defName length]) {
            _defaultDefNameTab[strVal] = strVal;
        } else {
            defName = nil;
        }
    }
    // end
    if (!defName) {
        defName = [@(_fallbackDefNameCounter++) stringValue];
        _defaultDefNameTab[strVal] = defName;
    }
    return defName;
}

- (void)visitRoot:(PKRootNode *)node {
    NSParameterAssert(node);
    NSAssert(self.symbolTable, @"");

    if (_collectTokenKinds) {
        [PEGTokenKindDescriptor clearCache];
        self.tokenKinds = [NSMutableDictionary dictionary];
        self.fallbackDefNameCounter = 1;
        self.defaultDefNameTab = [[@{
            @"~": @"TILDE",
            @"`": @"BACKTICK",
            @"!": @"BANG",
            @"@": @"AT",
            @"#": @"POUND",
            @"$": @"DOLLAR",
            @"%": @"PERCENT",
            @"^": @"CARET",
            @"^=": @"XOR_EQUALS",
            @"&": @"AMPERSAND",
            @"&=": @"AND_EQUALS",
            @"&&": @"DOUBLE_AMPERSAND",
            @"*": @"STAR",
            @"*=": @"TIMES_EQUALS",
            @"(": @"OPEN_PAREN",
            @")": @"CLOSE_PAREN",
            @"-": @"MINUS",
            @"--": @"MINUS_MINUS",
            @"-=": @"MINUS_EQUALS",
            @"_": @"UNDERSCORE",
            @"+": @"PLUS",
            @"++": @"PLUS_PLUS",
            @"+=": @"PLUS_EQUALS",
            @"=": @"EQUALS",
            @"==": @"DOUBLE_EQUALS",
            @"===": @"TRIPLE_EQUALS",
            @":=": @"ASSIGN",
            @"!=": @"NE",
            @"!==": @"DOUBLE_NE",
            @"<>": @"NOT_EQUAL",
            @"{": @"OPEN_CURLY",
            @"}": @"CLOSE_CURLY",
            @"[": @"OPEN_BRACKET",
            @"]": @"CLOSE_BRACKET",
            @"|": @"PIPE",
            @"|=": @"OR_EQUALS",
            @"||": @"DOUBLE_PIPE",
            @"\\": @"BACK_SLASH",
            @"\\=": @"DIV_EQUALS",
            @"/": @"FORWARD_SLASH",
            @"//": @"DOUBLE_SLASH",
            @":": @"COLON",
            @"::": @"DOUBLE_COLON",
            @";": @"SEMI_COLON",
            @"\"": @"QUOTE",
            @"'": @"APOSTROPHE",
            @"<": @"LT",
            @">": @"GT",
            @"<=": @"LE",
            @"=<": @"EL",
            @">=": @"GE",
            @"=>": @"HASH_ROCKET",
            @"->": @"RIGHT_ARROW",
            @"<-": @"LEFT_ARROW",
            @",": @"COMMA",
            @".": @"DOT",
            @"..": @"DOT_DOT",
            @"?": @"QUESTION",
            @"true": @"TRUE",
            @"false": @"FALSE",
            @"TRUE": @"TRUE_UPPER",
            @"FALSE": @"FALSE_UPPER",
            @"yes": @"YES",
            @"no": @"NO",
            @"YES": @"YES_UPPER",
            @"NO": @"NO_UPPER",
            @"or": @"OR",
            @"and": @"AND",
            @"not": @"NOT",
            @"xor": @"XOR",
            @"OR": @"OR_UPPER",
            @"AND": @"AND_UPPER",
            @"NOT": @"NOT_UPPER",
            @"XOR": @"XOR_UPPER",
            @"NULL": @"NULL_UPPER",
            @"null": @"NULL",
            @"Nil": @"NIL_TITLE",
            @"nil": @"NIL",
            @"id": @"ID",
            @"new": @"NEW",
            @"delete": @"DELETE",
            @"undefined": @"UNDEFINED",
            @"var": @"VAR",
            @"function": @"FUNCTION",
            @"instanceof": @"INSTANCEOF",
            @"typeof": @"TYPEOF",
            @"def": @"DEF",
            @"if": @"IF",
            @"else": @"ELSE",
            @"elif": @"ELIF",
            @"elseif": @"ELSEIF",
            @"return": @"RETURN",
            @"case": @"CASE",
            @"break": @"BREAK",
            @"switch": @"SWITCH",
            @"default": @"DEFAULT",
            @"while": @"WHILE",
            @"do": @"DO",
            @"for": @"FOR",
            @"in": @"IN",
            @"static": @"STATIC",
            @"extern": @"EXTERN",
            @"inline": @"INLINE",
            @"auto": @"AUTO",
            @"struct": @"STRUCT",
            @"class": @"CLASS",
            @"extends": @"EXTENDS",
            @"self": @"SELF",
            @"super": @"SUPER",
            @"this": @"THIS",
            @"void": @"VOID",
            @"int": @"INT",
            @"unsigned": @"UNSIGNED",
            @"long": @"LONG",
            @"short": @"SHORT",
            @"BOOL": @"BOOL_UPPER",
            @"bool": @"BOOL",
            @"float": @"FLOAT",
            @"double": @"DOUBLE",
            @"goto": @"GOTO",
            @"try": @"TRY",
            @"catch": @"CATCH",
            @"finally": @"FINALLY",
            @"throw": @"THROW",
            @"throws": @"THROWS",
            @"assert": @"ASSERT",
            @"start": @"START",

            @"EOF" : @"EOF_TITLE",
            @"Word" : @"WORD_TITLE",
            @"LowercaseWord" : @"UPPERCASEWORD_TITLE",
            @"UppercaseWord" : @"LOWERCASEWORD_TITLE",
            @"Number" : @"NUMBER_TITLE",
            @"QuotedString" : @"QUOTEDSTRING_TITLE",
            @"Symbol" : @"SYMBOL_TITLE",
            @"Comment" : @"COMMENT_TITLE",
            @"Empty" : @"EMPTY_TITLE",
            @"Any" : @"ANY_TITLE",
            @"S" : @"S_TITLE",
            @"URL" : @"URL_TITLE",
            @"Email" : @"EMAIL_TITLE",
            @"Digit" : @"DIGIT_TITLE",
            @"Letter" : @"LETTER_TITLE",
            @"Char" : @"CHAR_TITLE",
            @"SpecificChar": @"SPECIFICCHAR_TITLE",
        } mutableCopy] autorelease];
    }

    [self recurse:node];

    if (_collectTokenKinds) {
        node.tokenKinds = [[[_tokenKinds allValues] mutableCopy] autorelease];
        self.tokenKinds = nil;
    }

    self.symbolTable = nil;
}

- (void)visitDefinition:(PKDefinitionNode *)node {
    //NSLog(@"%s %@", __PRETTY_FUNCTION__, node);

    // find only child node (which represents this parser's type)
    NSAssert(1 == [node.children count], @"");
    PKBaseNode *child = node.children[0];

    // create parser
    Class parserCls = [child parserClass];
    PKCompositeParser *cp = [[[parserCls alloc] init] autorelease];

    // set name
    NSString *name = node.token.stringValue;
    cp.name = name;

    // set assembler callback
    if (_assembler || _preassembler) {
        NSString *cbname = node.callbackName;
        [self setAssemblerForParser:cp callbackName:cbname];
    }

    // define in symbol table
    if (![self.symbolTable count]) {
        self.symbolTable[@"$$"] = name;
    }
    self.symbolTable[name] = cp;

    for (PKBaseNode *child in node.children) {
        if (_collectTokenKinds) {
            child.defName = name;
        }
        [child visit:self];
    }
}

- (void)visitReference:(PKReferenceNode *)node {
    //NSLog(@"%s %@", __PRETTY_FUNCTION__, node);

}

- (void)visitComposite:(PKCompositeNode *)node {
    //NSLog(@"%s %@", __PRETTY_FUNCTION__, node);

    [self recurse:node];
}

- (void)visitCollection:(PKCollectionNode *)node {
    //NSLog(@"%s %@", __PRETTY_FUNCTION__, node);

    [self recurse:node];
}

- (void)visitAlternation:(PKAlternationNode *)node {
    //NSLog(@"%s %@", __PRETTY_FUNCTION__, node);

    NSAssert(2 == [node.children count], @"");

    BOOL simplify = NO;

    do {
        PKBaseNode *lhs = node.children[0];
        simplify = PKNodeTypeAlternation == lhs.type;

        // nested Alts should always be on the lhs. never on rhs.
        NSAssert(PKNodeTypeAlternation != [(PKBaseNode *)node.children[1] type], @"");

        if (simplify) {
            [node replaceChild:lhs withChildren:lhs.children];
        }
    } while (simplify);

    [self recurse:node];
}

- (void)visitOptional:(PKOptionalNode *)node {
    //NSLog(@"%s %@", __PRETTY_FUNCTION__, node);

    [self recurse:node];
}

- (void)visitMultiple:(PKMultipleNode *)node {
    //NSLog(@"%s %@", __PRETTY_FUNCTION__, node);

    [self recurse:node];
}

- (void)visitConstant:(PKConstantNode *)node {
    //NSLog(@"%s %@", __PRETTY_FUNCTION__, node);

    if (_collectTokenKinds) {
        NSAssert(_tokenKinds, @"");

        NSString *name = node.token.stringValue;
        name = [NSString stringWithFormat:@"TOKEN_KIND_BUILTIN_%@", [name uppercaseString]];
        NSAssert([name length], @"");

        PEGTokenKindDescriptor *kind = [PEGTokenKindDescriptor descriptorWithStringValue:name name:name]; // yes, use name for both

        //_tokenKinds[name] = kind; do not add constants here.
        node.tokenKind = kind;
    }

}

- (void)visitLiteral:(PKLiteralNode *)node {
    //NSLog(@"%s %@", __PRETTY_FUNCTION__, node);

    if (_collectTokenKinds) {
        NSAssert(_tokenKinds, @"");

        NSString *strVal = [node.token.stringValue stringByTrimmingQuotes];

        NSString *name = nil;

        PEGTokenKindDescriptor *desc = _tokenKinds[strVal];
        if (desc) {
            name = desc.name;
        }
        if (!name) {
            NSString *defName = node.defName;
            if (!defName) {
                defName = [self defaultDefNameForStringValue:strVal];
            }
            name = [NSString stringWithFormat:@"TOKEN_KIND_%@", [defName uppercaseString]];
        }

        NSAssert([name length], @"");
        PEGTokenKindDescriptor *kind = [PEGTokenKindDescriptor descriptorWithStringValue:strVal name:name];

        _tokenKinds[strVal] = kind;
        node.tokenKind = kind;
    }
}

- (void)visitDelimited:(PKDelimitedNode *)node {
    //NSLog(@"%s %@", __PRETTY_FUNCTION__, node);

    if (_collectTokenKinds) {
        NSAssert(_tokenKinds, @"");

        NSString *strVal = [NSString stringWithFormat:@"%@,%@", node.startMarker, node.endMarker];

        NSString *name = nil;

        PEGTokenKindDescriptor *desc = _tokenKinds[strVal];
        if (desc) {
            name = desc.name;
        }
        if (!name) {
            NSString *defName = node.defName;
            if (!defName) {
                defName = [self defaultDefNameForStringValue:strVal];
            }
            name = [NSString stringWithFormat:@"TOKEN_KIND_%@", [defName uppercaseString]];
        }

        NSAssert([name length], @"");
        PEGTokenKindDescriptor *kind = [PEGTokenKindDescriptor descriptorWithStringValue:strVal name:name];

        _tokenKinds[strVal] = kind;
        node.tokenKind = kind;
    }
}

- (void)visitPattern:(PKPatternNode *)node {
    //NSLog(@"%s %@", __PRETTY_FUNCTION__, node);

}

- (void)visitAction:(PKActionNode *)node {
    NSLog(@"%s %@", __PRETTY_FUNCTION__, node);

}

#pragma mark -
#pragma mark Assemblers

- (void)setAssemblerForParser:(PKCompositeParser *)p callbackName:(NSString *)callbackName {
    NSString *parserName = p.name;
    NSString *selName = callbackName;

    BOOL setOnAll = (_assemblerSettingBehavior == PKParserFactoryAssemblerSettingBehaviorAll);

    if (setOnAll) {
        // continue
    } else {
        BOOL setOnExplicit = (_assemblerSettingBehavior == PKParserFactoryAssemblerSettingBehaviorExplicit);
        if (setOnExplicit && selName) {
            // continue
        } else {
            BOOL isTerminal = [p isKindOfClass:[PKTerminal class]];
            if (!isTerminal && !setOnExplicit) return;

            BOOL setOnTerminals = (_assemblerSettingBehavior == PKParserFactoryAssemblerSettingBehaviorTerminals);
            if (setOnTerminals && isTerminal) {
                // continue
            } else {
                return;
            }
        }
    }

    if (!selName) {
        selName = [self defaultAssemblerSelectorNameForParserName:parserName];
    }

    if (selName) {
        SEL sel = NSSelectorFromString(selName);
        if (_assembler && [_assembler respondsToSelector:sel]) {
            [p setAssembler:_assembler selector:sel];
        }
        if (_preassembler && [_preassembler respondsToSelector:sel]) {
            NSString *selName = [self defaultPreassemblerSelectorNameForParserName:parserName];
            [p setPreassembler:_preassembler selector:NSSelectorFromString(selName)];
        }
    }
}

- (NSString *)defaultAssemblerSelectorNameForParserName:(NSString *)parserName {
    return [self defaultAssemblerSelectorNameForParserName:parserName pre:NO];
}

- (NSString *)defaultPreassemblerSelectorNameForParserName:(NSString *)parserName {
    return [self defaultAssemblerSelectorNameForParserName:parserName pre:YES];
}

- (NSString *)defaultAssemblerSelectorNameForParserName:(NSString *)parserName pre:(BOOL)isPre {
    NSString *prefix = nil;
    if ([parserName hasPrefix:@"@"]) {
        return nil;
    } else {
        prefix = isPre ? @"parser:willMatch" :  @"parser:didMatch";
    }
    return [NSString stringWithFormat:@"%@%C%@:", prefix, (unichar)toupper([parserName characterAtIndex:0]), [parserName substringFromIndex:1]];
}

@end


text:
/* ------------------------------------------------------------------
 * Copyright (C) 1998-2009 PacketVideo
 *
 * 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.
 * -------------------------------------------------------------------
 */
/*

 Filename: calc_auto_corr.h
 Funtions:

------------------------------------------------------------------------------
 REVISION HISTORY

 Who:                                   Date: MM/DD/YYYY
 Description:
------------------------------------------------------------------------------

 ----------------------------------------------------------------------------
; CONTINUE ONLY IF NOT ALREADY DEFINED
----------------------------------------------------------------------------*/
#ifndef CALC_AUTO_CORR_H
#define CALC_AUTO_CORR_H

/*----------------------------------------------------------------------------
; INCLUDES
----------------------------------------------------------------------------*/
#include "pv_audio_type_defs.h"

/*----------------------------------------------------------------------------
; MACROS
; Define module specific macros here
----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------
; DEFINES
; Include all pre-processor statements here.
----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------
; EXTERNAL VARIABLES REFERENCES
; Declare variables used in this module but defined elsewhere
----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------
; SIMPLE TYPEDEF'S
----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------
; ENUMERATED TYPEDEF'S
----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------
; STRUCTURES TYPEDEF'S
----------------------------------------------------------------------------*/

struct ACORR_COEFS
{
    Int32  r11r;
    Int32  r01r;
    Int32  r02r;
    Int32  r12r;
    Int32  r22r;
#ifdef HQ_SBR
    Int32  r01i;
    Int32  r02i;
    Int32  r12i;
#endif
    Int32  det;
};

/*----------------------------------------------------------------------------
; GLOBAL FUNCTION DEFINITIONS
; Function Prototype declaration
----------------------------------------------------------------------------*/

#ifdef __cplusplus
extern "C"
{
#endif

    void calc_auto_corr_LC(struct ACORR_COEFS *ac,
    Int32  realBuf[][32],
    Int32  bd,
    Int32  len);

#ifdef HQ_SBR

    void calc_auto_corr(struct ACORR_COEFS *ac,
                        Int32  realBuf[][32],
                        Int32  imagBuf[][32],
                        Int32  bd,
                        Int32  len);

#endif

#ifdef __cplusplus
}
#endif

/*----------------------------------------------------------------------------
; END
----------------------------------------------------------------------------*/
#endif


text:
"""
Contains base types, solvers and experiment runners for the graph constrained
group testing problem. Base types are defined in :mod:`base_types`. Contains
base types for and sample implementation of file format for manipulation of
graph constrainedd group testing problem instances,
"""

__version__ = "0.0.1"


text:
using System;
using System.Collections.Generic;
using System.Linq;
using IBeaconRef.Data;
using IBeaconRef.EventHub;

namespace IBeaconRef.Simulator
{
    class Store
    {
        Department[] m_departments = new Department[Constants.NUMBER_OF_DEPARTMENTS];

        public Store()
        {
            for (int i=0; i<Constants.NUMBER_OF_DEPARTMENTS; i++)
            {
                m_departments[i] = new Department(i);
            }
        }

        public void SendCustomerToDepartment(Customer customer, int department)
        {
            if (department >= 0)
            {
                m_departments[department].CustomerEnters(customer);
            }
        }

        public void ProcessDeliveries()
        {
            List<Customer> enRoute = new List<Customer>();

            // deliver the customers waiting their articles
            for (int i = 0; i < Constants.NUMBER_OF_DEPARTMENTS; i++)
            {
                Customer comingOutofLine = m_departments[i].ProcessQueue();

                if (comingOutofLine != null)
                {
                    enRoute.Add(comingOutofLine);
                    EventHubHelper.GetInstance().SendLeaveDepartment(comingOutofLine, m_departments[i]);
                }
            }

            // send the customers to the next station
            for (int i = 0; i < enRoute.Count(); i++)
            {
                Customer customer = enRoute.ElementAt(i);
                SendCustomerToDepartment( customer, customer.NextArticleInList());
            }

        }

        public void Print()
        {
            // go through all departments and print the number of customers in line
            for (int i = 0; i < Constants.NUMBER_OF_DEPARTMENTS; i++)
            {
                Console.WriteLine("Department " + i + ":" + m_departments[i].ToString());
            }
        }

        public void PrintMap()
        {
            for (int i = 0; i < Constants.NUMBER_OF_DEPARTMENTS; i++)
            {
                Console.WriteLine("Department " + i + " customers:");
                m_departments[i].PrintWaitingLine();
            }
        }

        public int GetWaitingCustomers()
        {
            int ret = 0;
            for (int i = 0; i < Constants.NUMBER_OF_DEPARTMENTS; i++)
            {
                ret += m_departments[i].GetNumberWaiting();
            }

            return ret;
        }
    }
}


text:
(function() {
'use strict';

if (window.require) {
    require('./core_mixins');
}

angular.module('fireh_angular_table')

    .directive('fhTableFieldSelect', [
        '$compile',
        '$templateRequest',
        'FhTableDefinition',
        'FhTableDefinitionMixin',
        'FhTableListResourceControllerMixin',
        'FhSelectedItemsMixin',
        'FhTranscludeChildElementsMixin',
        'FhCustomEventHandlersMixin',
        'FhMiddlewaresMixin',
        'FhEventHandlersMixin',
        'FhElementIdMixin',
        function(
            $compile,
            $templateRequest,
            TableDefinition,
            TableDefinitionMixin,
            ListResourceControllerMixin,
            SelectedItemsMixin,
            TranscludeChildElementsMixin,
            CustomEventHandlersMixin,
            MiddlewaresMixin,
            EventHandlersMixin,
            ElementIdMixin) {

        var myDirective = {
            restrict: 'A',
            scope: true,
            transclude: true
        };

        myDirective.controller = function($scope, $element, $attrs) {
            var cleanupCallbacks = [];

            $scope.data = {};

            /* There are two FhTableDefinitions and two FhTableRows.
             *
             * The first one (higher level) is about the table row being edited,
             * and the second one (this) is about selection widget for one of
             * the row's field.
             *
             * Henceforth, parentFhtable or row-being-edited will refer to the
             * first one, and selection-widget will refer to the second.
             */

            //// element attributes

            var name = $attrs.fhpName || $attrs.fhTableFieldSelect;
            var pageSize = $attrs.fhpSize;
            var orderBy = $attrs.fhpOrderBy;
            var orderDir = $attrs.fhpOrderDir || 'asc';
            var filterBy = $attrs.fhpFilterBy;
            var multipleSelection = $attrs.fhpSingleSelection === void(0);
            var elementId = ElementIdMixin($attrs, 'fh-table-field-select-');

            TableDefinitionMixin($scope, $attrs);

            //// scope variables

            // we are going to have our own fhtable, store parent fhtable in
            // different variable
            var parentFhtable = $scope.parentFhtable = $scope.fhtable;

            // our own fhtable
            var fhtable = $scope.fhtable = new TableDefinition(
                    parentFhtable.fieldDefinition[name]);

            if (_.isEmpty(fhtable.services)) {
                fhtable.services = parentFhtable.services;
            }

            ListResourceControllerMixin($scope, {}, cleanupCallbacks);
            SelectedItemsMixin($scope, {multipleSelection: multipleSelection},
                    cleanupCallbacks);

            $scope.name = name;
            $scope.elementId = elementId;
            $scope.popupElementId = elementId + '-popup';

            if (pageSize) { $scope.dataParams.pageSize = pageSize; }
            if (orderBy) { $scope.dataParams.orderBy = [[orderBy, orderDir]]; }
            if (filterBy)
            {
                $scope.$parent.$watch(filterBy, function(filter)
                {
                    $scope.dataParams.filterBy = filter;
                    fhtable.trigger('resetItems');
                });
            }

            // update selectedItems
            if ($scope.draft && $scope.draft[name]) {
                $scope.data.selectedItems = [$scope.draft[name]];
            }

            //// scope functions

            function getEventOptions() {
                return {
                    // we use dynamic form-id of parent element
                    formId: $scope.formId
                };
            }

            $scope.showModal = function showModal() {
                jQuery(document.getElementById($scope.popupElementId))
                        .modal('show');
            };

            //// events

            fhtable.on('ajaxRequestStarted', function() {
                parentFhtable.trigger('ajaxRequestStarted');

            }, cleanupCallbacks);

            fhtable.on('ajaxRequestFinished', function() {
                parentFhtable.trigger('ajaxRequestFinished');

            }, cleanupCallbacks);

            parentFhtable.on('draftUpdated', function(event, draft, item,
                    options) {

                if (options.formId !== $scope.formId) { return; }
                fhtable.trigger('itemSelected', draft[name], getEventOptions());

            }, cleanupCallbacks);

            var actionEvents = {};

            actionEvents.deselectItem = function(event, item, options) {
                parentFhtable.trigger('draftUnsetField', $scope.original, name,
                        item, getEventOptions());
            };

            actionEvents.selectItem = function(event, item, options) {
                parentFhtable.trigger('draftSetField', $scope.original, name,
                        item, getEventOptions());
            };

            CustomEventHandlersMixin(actionEvents, $attrs, fhtable);
            MiddlewaresMixin(actionEvents, $attrs, fhtable);

            EventHandlersMixin(
                actionEvents,
                {
                    scope: $scope,
                    fhtable: fhtable,
                    optionsGetter: getEventOptions
                },
                cleanupCallbacks);

            parentFhtable.trigger('addEditableField', name, getEventOptions());

            //// cleanup

            $scope.$on('$destroy', function() {
                _.forEach(cleanupCallbacks, function(fn) { fn(); });
                fhtable.destroy();
            });
        };

        myDirective.link = function(scope, el, attrs, ctrl, transclude) {
            //// element attributes

            var templateUrl = attrs.fhpTemplateUrl;

            var templateHtml =
                '

 ' +

                '<button type="button" class="btn btn-default" ' +
                '    data-ng-click="showModal()" ' +
                '    id="{{ elementId }}"> ' +

                '   ' +

                '   ' +

                '   ' +
                '</button> ' +

                '

 ' +

                '
 ' +

                '

 ' +
                '
';

            function printHtml(htmlStr) {
                // get directive content and insert into template
                transclude(scope, function(clone, scope) {
                    el.html(htmlStr);
                    TranscludeChildElementsMixin(el, clone);
                    $compile(el.contents())(scope);
                });
            }

            if (templateUrl) {
                $templateRequest(templateUrl).then(printHtml);
            } else {
                printHtml(templateHtml);
            }

            scope.fhtable.trigger('fetchItems', {initialFetchItems: true});
        };

        return myDirective;
    }])
;
}());


text:
#ifndef TENSORFLOW_C_EAGER_TAPE_H_
#define TENSORFLOW_C_EAGER_TAPE_H_

// Language-agnostic gradient tape. Does not perform backpropagation, just
// maintains the data structures required to do so.

#include <unordered_map>
#include <vector>
#include "tensorflow/core/framework/tensor_shape.h"
#include "tensorflow/core/framework/types.h"
#include "tensorflow/core/lib/gtl/array_slice.h"
#include "tensorflow/core/platform/types.h"

namespace tensorflow {
namespace eager {

// Information about a tensor.
struct TapeTensor {
  int64 id;  // Expected to be unique in the lifetime of this process.
  DataType dtype;
  TensorShape shape;
};

// Represents an entry in the tape.
struct OpTapeEntry {
  string op_type;
  std::vector<TapeTensor> output_tensor_info;
  std::vector<int64> input_tensor_id;

  // TODO(apassos) consider narrowing down this interface.
  void* backward_function;

  // Should be called before deleting the backward function. TODO(apassos) use
  // unique_ptrs to ensure this happens.
  std::function<void()> backward_function_deleter;
};

// Map from tensor_id to internally-defined operation-id of the operation which
// produced this tensor. A value of -1 means that the tensor was directly
// watched and not the result of any operation in the tape.
using TensorTape = std::unordered_map<int64, int64>;

// Map from operation-id to tape entry.
using OpTape = std::unordered_map<int64, OpTapeEntry>;

// Traces the execution of operations, doing eager garbage collection, and
// exporting a full trace so other code can do backpropagation. Not thread-safe.
class GradientTape {
 public:
  GradientTape() {}

  bool ShouldRecord(gtl::ArraySlice<int64> tensor_ids);

  void Watch(int64 tensor_id);

  void RecordOperation(const string& op_type,
                       gtl::ArraySlice<TapeTensor> output_tensors,
                       gtl::ArraySlice<int64> input_tensor_id,
                       void* backward_function,
                       const std::function<void()>& backward_function_deleter);

  void DeleteTrace(int64 tensor_id);

  // Note: it is only valid to call Export once per tape, and after calling
  // export the tape is no longer valid (i.e. calls to ShouldRecord, Watch,
  // Record, and Delete have undefined behavior).
  std::pair<TensorTape, OpTape> Export();

 private:
  TensorTape tensor_tape_;
  OpTape op_tape_;
  int64 next_op_id_{0};

  // Map from tensor id to number of remaining usages (i.e. how many entries in
  // the tape refer to it); to aid in tape garbage collection.
  std::unordered_map<int64, int64> tensor_usage_;
};

}  // namespace eager
}  // namespace tensorflow

#endif  // TENSORFLOW_C_EAGER_TAPE_H_


text:
frost-ci
========

.. image:: https://travis-ci.org/nickfrostatx/frost.svg?branch=master
    :target: https://travis-ci.org/nickfrostatx/frost

.. image:: https://coveralls.io/repos/github/nickfrostatx/frost/badge.svg?branch=master
    :target: https://coveralls.io/github/nickfrostatx/frost?branch=master

.. image:: https://img.shields.io/badge/license-MIT-blue.svg
    :target: https://raw.githubusercontent.com/nickfrostatx/frost/master/LICENSE

Totally not a Travis clone.

This is a continuous integration server. Naturally, it also tests itself:

.. image:: https://frost-ci.xyz/nickfrostatx/frost.svg
    :target: https://frost-ci.xyz/nickfrostatx/frost

Installation
------------

.. code-block:: bash

    $ pip install frost

Usage
-----

TODO


text:
"use strict";

var chai = require('chai');

var json2json = require('../index');

var case_0 = require('./test_cases/case-override-0');

var expect = chai.expect;

describe('content', function () {
    var override = {
        people: [],
        external: function (template, input) {
            var templateValue = template.external;
            var external = this.run(templateValue, input);
            if (external !== null) {
                this.people.push(external);
                return this.people.length - 1;
            } else {
                return null;
            }
        }
    };

    var engine = json2json.instance(override, ['external']);

    it('case-coverride-0: basic', function () {
        var actual = engine.run(case_0.template, case_0.input);
        expect(actual).to.deep.equal(case_0.expected);
        expect(override.people).to.have.length(2);
        expect(override.people).to.deep.equal([{
            lastName: 'DOE',
            firstName: 'JOE'
        }, {
            lastName: 'DOE',
            firstName: 'JANE'
        }]);
    });
});


text:
import {Component} from "@angular/core";
@Component({
    selector: "statistics",
    templateUrl: "statistics.component.html"
})
export class StatisticsComponent{

}


text:
[![Godoc][godoc-image]][godoc-url]
[![Report][report-image]][report-url]
[![Tests][tests-image]][tests-url]
[![Coverage][coverage-image]][coverage-url]
[![Sponsor][sponsor-image]][sponsor-url]

This library provides direct access to the Anime Notifier database. It is not an API client.

## Style

Please take a look at the [style guidelines](https://github.com/akyoto/quality/blob/master/STYLE.md) if you'd like to make a pull request.

## Sponsors

| [![Cedric Fung](https://avatars3.githubusercontent.com/u/2269238?s=70&v=4)](https://github.com/cedricfung) | [![Scott Rayapoullé](https://avatars3.githubusercontent.com/u/11772084?s=70&v=4)](https://github.com/soulcramer) | [![Eduard Urbach](https://avatars3.githubusercontent.com/u/438936?s=70&v=4)](https://twitter.com/eduardurbach) |
| --- | --- | --- |
| [Cedric Fung](https://github.com/cedricfung) | [Scott Rayapoullé](https://github.com/soulcramer) | [Eduard Urbach](https://eduardurbach.com) |

Want to see [your own name here?](https://github.com/users/akyoto/sponsorship)

[godoc-image]: https://godoc.org/github.com/animenotifier/arn?status.svg
[godoc-url]: https://godoc.org/github.com/animenotifier/arn
[report-image]: https://goreportcard.com/badge/github.com/animenotifier/arn
[report-url]: https://goreportcard.com/report/github.com/animenotifier/arn
[tests-image]: https://cloud.drone.io/api/badges/animenotifier/arn/status.svg
[tests-url]: https://cloud.drone.io/animenotifier/arn
[coverage-image]: https://codecov.io/gh/animenotifier/arn/graph/badge.svg
[coverage-url]: https://codecov.io/gh/animenotifier/arn
[sponsor-image]: https://img.shields.io/badge/github-donate-green.svg
[sponsor-url]: https://github.com/users/akyoto/sponsorship


text:
## Miért Ne Használjuk az `eval`-t

Az `eval` (evil) funkció egy stringbe ágyazott JavaScript kódot futtat a
lokális scopeon belül.

    var foo = 1;
    function test() {
        var foo = 2;
        eval('foo = 3');
        return foo;
    }
    test(); // 3
    foo; // 1

Viszont az `eval` csak akkor viselkedik így, hogyha expliciten hívjuk meg
*és* a meghívott funkció neve valóban `eval`.

    var foo = 1;
    function test() {
        var foo = 2;
        var bar = eval;
        bar('foo = 3');
        return foo;
    }
    test(); // 2
    foo; // 3

Az `eval` használata kerülendő. A "felhasználása" az esetek 99.9%-ban
**mellőzhető**.

### Az `eval` ezer arca

A `setTimeout` és `setInterval` nevű [timeout függvények](#other.timeouts) is
tudnak úgy működni, hogy első paraméterükként egy stringbe ágyazott kódot várnak.
Ez a string **mindig** a globális hatókörben lesz végrehajtva, mivel az `eval`t
így nem direktben hívjuk meg.

### Biztonsági problémák

Az `eval` azért is veszélyes, mert **bármilyen** JS kódot végrehajt, amit odaadunk
neki. Éppen ezért **sose** használjuk olyan kódok végrehajtására amiknek az eredete
nem megbízható/ismeretlen.

### Összegzésül

Soha ne használjunk `eval`t. Bármilyen kód működése, teljesítménye, ill. biztonsága
megkérdőjelezhető amely használja ezt a nyelvi elemet. Semmilyen megoldás
használata **nem ajánlott** amely első sorban `eval`ra épül. Ekkor egy *jobb
megoldás* szükségeltetik, amely nem függ az `eval`tól.


text:
import React from 'react';
import {Card, makeStyles} from '@material-ui/core';
import RadioGroup from '@material-ui/core/RadioGroup';
import FormControlLabel from '@material-ui/core/FormControlLabel';
import Radio from '@material-ui/core/Radio';
import IntlMessages from '../../../../@crema/utility/IntlMessages';
import Box from '@material-ui/core/Box';
import {Fonts} from 'shared/constants/AppEnums';
import {FormatList} from '../../../../types/models/Widgets';
import {CremaTheme} from '../../../../types/AppContextPropsType';

interface FormatsProps {
  data: FormatList[];
}

const Formats: React.FC<FormatsProps> = ({data}) => {
  const useStyles = makeStyles((theme: CremaTheme) => ({
    radioLabelGroup: {
      display: 'flex',
      flexDirection: 'row',
      flexWrap: 'wrap',
      alignItems: 'center',
      marginLeft: '-25px',
      marginRight: '-15px',
    },

    radioLabel: {
      width: '50%',
      display: 'flex',
      alignItems: 'center',
      paddingLeft: '15px',
      paddingRight: '15px',
      marginLeft: 0,
      marginRight: 0,
      marginBottom: 2,

      '& .MuiTypography-body1': {
        fontSize: 18,
        fontFamily: `${Fonts.LIGHT} !important`,
        color: '#A8A8A8',
        marginLeft: 10,
        marginBottom: 6,
        [theme.breakpoints.up('xl')]: {
          fontSize: 20,
        },
      },
    },
  }));

  const classes = useStyles();

  return (
    <Box py={{xs: 5, sm: 5, xl: 5}} px={{xs: 6, sm: 6, xl: 6}} height='1' clone>
      <Card>
        <Box
          component='h3'
          mb={5}
          fontFamily={Fonts.LIGHT}
          fontSize={{xs: 18, sm: 20, xl: 22}}>
          <IntlMessages id='dashboard.formats' />
        </Box>

        <RadioGroup className={classes.radioLabelGroup}>
          {data.map((item) => {
            return (
              <FormControlLabel
                key={item.id}
                value={item.name}
                control={<Radio />}
                label={item.name}
                className={classes.radioLabel}
              />
            );
          })}
        </RadioGroup>
      </Card>
    </Box>
  );
};

export default Formats;


text:
package spet.sbwo.server;

import org.eclipse.jetty.servlet.FilterHolder;
import org.eclipse.jetty.servlet.ServletContextHandler;

import javax.servlet.DispatcherType;
import javax.servlet.Filter;
import java.util.EnumSet;

/**
 * Handler which can hold a servlet filter.
 *
 * @author Serban Petrescu
 */
public class FilterHandlerBuilder implements IServletHandlerBuilder {
    private String path;
    private Filter filter;
    private EnumSet<DispatcherType> dispatches;

    FilterHandlerBuilder() {
        this.dispatches = EnumSet.of(DispatcherType.REQUEST);
    }

    /**
     * Sets the path specification for the holder.
     */
    public FilterHandlerBuilder path(String path) {
        this.path = path;
        return this;
    }

    /**
     * Sets the underlying filter.
     */
    public FilterHandlerBuilder filter(Filter filter) {
        this.filter = filter;
        return this;
    }

    /**
     * Sets the dispatcher type(s) to be used for the filter.
     */
    public FilterHandlerBuilder dispatches(EnumSet<DispatcherType> dispatches) {
        this.dispatches = dispatches;
        return this;
    }

    @Override
    public void build(ServletContextHandler root) {
        FilterHolder holder = new FilterHolder(this.filter);
        root.addFilter(holder, this.path, dispatches);
    }

}


text:
#ifndef _CMIME_INTERNAL_H
#define _CMIME_INTERNAL_H

#ifdef __cplusplus
extern "C" {
#endif

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

#include "cmime_list.h"
#include "cmime_message.h"
#include "cmime_header.h"

#define PART_CONTENT_TYPE_PATTERN "Content-Type:"
#define PART_CONTENT_DISPOSITION_PATTERN "Content-Disposition:"
#define PART_CONTENT_TRANSFER_ENCODING_PATTERN "Content-Transfer-Encoding:"
#define PART_CONTENT_ID_PATTERN "Content-ID:"

#define MIMETYPE_DEFAULT "application/octet-stream"
#define MIMETYPE_TEXT_PLAIN "text/plain"

#define LINE_LENGTH 72

#define FROM_HEADER "From"

/** crlf */
#define CRLF "\r\n"
#define DCRLF "\r\n\r\n"
#define LF "\n"
#define CR "\r"

typedef struct {
    CMimeBoundaryType_T type;
    char *marker;
    size_t len;
} _BoundaryInfo_T;

void _cmime_internal_header_destroy(void *data);

char *_cmime_internal_determine_linebreak_from_file(const char *s);
char *_cmime_internal_determine_linebreak(const char *s);

void _cmime_internal_set_linked_header_value(CMimeList_T *l, const char *key, const char *value);
char *_cmime_internal_get_linked_header_value(CMimeList_T *l, const char *key);
CMimeHeader_T *_cmime_internal_get_linked_header(CMimeList_T *l, const char *key);
void _cmime_internal_parts_destroy(void *data);
_BoundaryInfo_T *_cmime_internal_get_boundary_info(CMimeStringList_T *boundaries, char *s, char *newline);

#ifdef __cplusplus
}
#endif

#endif /* _CMIME_INTERNAL_H */


text:
import logging

logger = logging.getLogger(__name__)

uri = "/mga/user_registry/groups"
requires_modules = ["mga", "federation"]
requires_version = None

def get_all(isamAppliance, check_mode=False, force=False):
    """
    Retrieving a list of all current groups in the registry
    """
    return isamAppliance.invoke_get("Retrieving a list of all current groups in the registry",
                                    "{0}/v1".format(uri),
                                    requires_modules=requires_modules, requires_version=requires_version)

def get(isamAppliance, id, check_mode=False, force=False):
    """
    Retrieving details for a particular group in the registry
    """
    return isamAppliance.invoke_get("Retrieving details for a particular group in the registry",
                                    "{0}/{1}/v1".format(uri, id),
                                    requires_modules=requires_modules, requires_version=requires_version)

def add(isamAppliance, id, users=None, check_mode=False, force=False):
    """
    Creating a new group in the registry
    """
    if force is True or _check_group(isamAppliance, id) is False:
        if check_mode is True:
            return isamAppliance.create_return_object(changed=True)
        else:
            json_data = {
                "id": id,
                "users": users
            }
            return isamAppliance.invoke_post(
                "Creating a new group in the registry",
                "{0}/v1".format(uri), json_data,
                requires_modules=requires_modules, requires_version="10.0.1")

    return isamAppliance.create_return_object()

def delete(isamAppliance, group_name, check_mode=False, force=False):
    """
    Deleting a group from the registry
    """
    if force is True or _check_group(isamAppliance, group_name) is True:
        if check_mode is True:
            return isamAppliance.create_return_object(changed=True)
        else:
            return isamAppliance.invoke_delete(
                "Deleting a group from the registry",
                "{0}/{1}/v1".format(uri, group_name),
                requires_modules=requires_modules, requires_version="10.0.1")

    return isamAppliance.create_return_object()

def add_user(isamAppliance, user_name, id, check_mode=False, force=False):
    """
    Adding a user to a group in the registry
    """
    if force is True or _check(isamAppliance, user_name, id) is False:
        if check_mode is True:
            return isamAppliance.create_return_object(changed=True)
        else:
            return isamAppliance.invoke_post(
                "Adding a user to a group in the registry",
                "/mga/user_registry/users/{0}/groups/v1".format(user_name),
                {
                    'id': id
                },
                requires_modules=requires_modules, requires_version=requires_version)

    return isamAppliance.create_return_object()

def delete_user(isamAppliance, user_name, id, check_mode=False, force=False):
    """
    Removing a user from a group in the registry
    """
    if force is True or _check(isamAppliance, user_name, id) is True:
        if check_mode is True:
            return isamAppliance.create_return_object(changed=True)
        else:
            return isamAppliance.invoke_delete(
                "Removing a user from a group in the registry",
                "/mga/user_registry/users/{0}/groups/{1}/v1".format(user_name, id),
                requires_modules=requires_modules, requires_version=requires_version)

    return isamAppliance.create_return_object()

def _check(isamAppliance, user_name, id):
    """
    Check if user already exists
    """
    ret_obj = get_all(isamAppliance)

    for grp in ret_obj['data']:
        if grp['id'] == id:
            ret_obj = get(isamAppliance, id)
            for usr in ret_obj['data']['users']:
                if usr['id'] == user_name:
                    return True

    return False

def _check_group(isamAppliance, id):
    """
    Check if group already exists
    :param isamAppliance:
    :param id:
    :return:
    """

    ret_obj = get_all(isamAppliance)

    for obj in ret_obj['data']:
        if obj['id'] == id:
            return True

    return False

def compare(isamAppliance1, isamAppliance2):
    """
    Compare groups between two appliances
    """
    ret_obj1 = get_all(isamAppliance1)
    ret_obj2 = get_all(isamAppliance2)

    for obj in ret_obj1['data']:
        user = get(isamAppliance1, obj['id'])
        obj['users'] = user['data']['users']
    for obj in ret_obj2['data']:
        user = get(isamAppliance2, obj['id'])
        obj['users'] = user['data']['users']

    import ibmsecurity.utilities.tools
    return ibmsecurity.utilities.tools.json_compare(ret_obj1, ret_obj2, deleted_keys=[''])


text:
package com.puppycrawl.tools.checkstyle.checks.naming;

import static com.puppycrawl.tools.checkstyle.checks.naming.AbstractClassNameCheck.ILLEGAL_ABSTRACT_CLASS_NAME;
import static com.puppycrawl.tools.checkstyle.checks.naming.AbstractClassNameCheck.NO_ABSTRACT_CLASS_MODIFIER;

import java.io.File;

import org.junit.Assert;
import org.junit.Test;

import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
import com.puppycrawl.tools.checkstyle.api.TokenTypes;

public class AbstractClassNameCheckTest extends BaseCheckTestSupport {
    @Test
    public void testIllegalAbstractClassName() throws Exception {
        final DefaultConfiguration checkConfig =
            createCheckConfig(AbstractClassNameCheck.class);
        checkConfig.addAttribute("ignoreName", "false");
        checkConfig.addAttribute("ignoreModifier", "true");

        final String pattern = "^Abstract.+$";

        final String[] expected = {
            "3:1: " + getCheckMessage(ILLEGAL_ABSTRACT_CLASS_NAME, "InputAbstractClassName", pattern),
            "6:1: " + getCheckMessage(ILLEGAL_ABSTRACT_CLASS_NAME, "NonAbstractClassName", pattern),
            "10:5: " + getCheckMessage(ILLEGAL_ABSTRACT_CLASS_NAME, "NonAbstractInnerClass", pattern),
        };

        verify(checkConfig, getPath("naming" + File.separator + "InputAbstractClassName.java"), expected);
    }

    @Test
    public void testIllegalClassType() throws Exception {
        final DefaultConfiguration checkConfig = createCheckConfig(AbstractClassNameCheck.class);
        checkConfig.addAttribute("ignoreName", "true");
        checkConfig.addAttribute("ignoreModifier", "false");

        final String[] expected = {
            "18:1: " + getCheckMessage(NO_ABSTRACT_CLASS_MODIFIER, "AbstractClass"),
            "22:5: " + getCheckMessage(NO_ABSTRACT_CLASS_MODIFIER, "AbstractInnerClass"),
        };

        verify(checkConfig, getPath("naming" + File.separator + "InputAbstractClassName.java"), expected);
    }

    @Test
    public void testAllVariants() throws Exception {
        final DefaultConfiguration checkConfig = createCheckConfig(AbstractClassNameCheck.class);
        checkConfig.addAttribute("ignoreName", "false");
        checkConfig.addAttribute("ignoreModifier", "false");

        final String pattern = "^Abstract.+$";

        final String[] expected = {
            "3:1: " + getCheckMessage(ILLEGAL_ABSTRACT_CLASS_NAME, "InputAbstractClassName", pattern),
            "6:1: " + getCheckMessage(ILLEGAL_ABSTRACT_CLASS_NAME, "NonAbstractClassName", pattern),
            "10:5: " + getCheckMessage(ILLEGAL_ABSTRACT_CLASS_NAME, "NonAbstractInnerClass", pattern),
            "18:1: " + getCheckMessage(NO_ABSTRACT_CLASS_MODIFIER, "AbstractClass"),
            "22:5: " + getCheckMessage(NO_ABSTRACT_CLASS_MODIFIER, "AbstractInnerClass"),
        };

        verify(checkConfig, getPath("naming" + File.separator + "InputAbstractClassName.java"), expected);
    }

    @Test
    public void testFalsePositive() throws Exception {
        final DefaultConfiguration checkConfig = createCheckConfig(AbstractClassNameCheck.class);

        final String[] expected = {
            "9:5: " + getCheckMessage(NO_ABSTRACT_CLASS_MODIFIER, "AbstractClass"),
        };

        verify(checkConfig, getPath("naming" + File.separator
                 + "InputAbstractClassNameFormerFalsePositive.java"), expected);
    }

    @Test
    public void testGetAcceptableTokens() {
        AbstractClassNameCheck classNameCheckObj = new AbstractClassNameCheck();
        int[] actual = classNameCheckObj.getAcceptableTokens();
        int[] expected = {
            TokenTypes.CLASS_DEF,
        };
        Assert.assertArrayEquals(expected, actual);
    }

    @Test
    public void testGetRequiredTokens() {
        AbstractClassNameCheck classNameCheckObj = new AbstractClassNameCheck();
        int[] actual = classNameCheckObj.getRequiredTokens();
        int[] expected = {
            TokenTypes.CLASS_DEF,
        };
        Assert.assertArrayEquals(expected, actual);
    }
}


text:
module PostmanMta
  class Conversation < ApplicationModel
    def index(params = {})
      get('/conversations', body: params)
    end

    def archive(params = {})
      get('/archive/conversations', body: params)
    end

    def folder(folder, params = {})
      params = {
        folder: folder
      }.merge!(params)

      get('/conversations', body: params)
    end

    def find(conversation_id)
      get("/conversations/#{conversation_id}")
    end

    def move_to_trash(conversation_id)
      delete("/conversations/#{conversation_id}/trash")
    end

    def mark_as_read(params = {})
      patch('/conversations/mark', body: params.merge(event: 'mark_as_read'))
    end

    def mark_as_unread(params = {})
      patch('/conversations/mark', body: params.merge(event: 'mark_as_unread'))
    end

    def move(params = {})
      patch('/conversations/move', body: params)
    end

    def search(params = {})
      get('/search/conversations', body: params)
    end
  end
end


text:
<?php
/**
 * Piwik - free/libre analytics platform
 *
 * @link http://piwik.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 *
 */

namespace Piwik\Plugins\LanguagesManager\TranslationWriter\Filter;

abstract class FilterAbstract
{
    protected $filteredData = array();

    /**
     * Filter the given translations
     *
     * @param array $translations
     *
     * @return array   filtered translations
     */
    abstract public function filter($translations);

    /**
     * Returnes the data filtered out by the filter
     *
     * @return array
     */
    public function getFilteredData()
    {
        return $this->filteredData;
    }
}


text:
Simply display messages over your Android app to explain its functioning.
Only 2 files to add to your project, 2 lines of code to a first display.
![Sample screenshot](http://www.sdangin.fr/git/screenshot4.png)

## Setup
1. Add the file OverlayMsg.java to your project sources.
2. Add the file Overlay_msg.xml in the res/values/ directory of your project.
3. The main container must be a ```FrameLayout```

## Code examples
[From the XML file of the Sample Project.](https://github.com/Sylvaner/OverlayMsg/blob/master/SampleProject/res/layout/activity_main.xml)

![Base screenshot](http://www.sdangin.fr/git/base.png)

###  First example
* Display a message.
* In the middle of the screen.
* Change text size.
* Surround a TextView with a circle.

```java
OverlayMsg ovm = new OverlayMsg(this);
ovm.textSize = convertSpToPixel(40);
ovm.showTextWithCircle(R.id.globalLayout, R.id.textView1, "First text view", OverlayMsg.POSITION_CENTER, null);
```

![First example](http://www.sdangin.fr/git/screenshot1.png)

### Second example
* Display a message.
* At the top of the screen.
* Add a black background to the text.
* Hide 'Press to continue'.
* Surround a group of radio buttons with a rectangle.

```java
OverlayMsg ovm = new OverlayMsg(this);
ovm.showTextBackground = true;
ovm.textBackgroundColor = 0xFF000000;
ovm.showPressToContinue = false;
ovm.showTextWithRect(R.id.globalLayout, R.id.radiogroup, "A radio group", OverlayMsg.POSITION_TOP, null);
```

![Second example](http://www.sdangin.fr/git/screenshot2.png)

### Third example
* Display a message.
* At the bottom of the screen.
* Surround a radio button in a circle.
* With a green border.
* And a thickness of 50 pixels.
* Change 'Press to continue' text size

```java
OverlayMsg ovm = new OverlayMsg(this);
ovm.borderColor = 0xFF00FF00;
ovm.borderSize = 50;
ovm.pressToContinueTextSize = convertSpToPixel(10);
ovm.showTextWithCircle(R.id.globalLayout, R.id.radio1, "This things", OverlayMsg.POSITION_BOTTOM, null);
```

![Third example](http://www.sdangin.fr/git/screenshot3.png)

### Fourth example
* Display a message.
* At the top of the screen.
* With a special font.
* A dimension 50sp.
* Surround two CheckBox with a large rectangle.

```java
OverlayMsg ovm = new OverlayMsg(this);
Typeface typeface = Typeface.createFromAsset(getAssets(), "fonts/alex-toth.ttf");
ovm.textFont = typeface;
ovm.textSize = convertSpToPixel(50);
ovm.showTextWithBigRect(R.id.globalLayout, R.id.checkbox1, R.id.checkbox2, "A big box", OverlayMsg.POSITION_TOP, null);
```

![Fourth example](http://www.sdangin.fr/git/screenshot4.png)

### Fifth example
* Display a message.
* In the middle of the screen.
* Surround three different elements.
* Using different forms.
* Show a message to the action of a user.

```java
OverlayMsg ovm = new OverlayMsg(this);
int[] viewIdArray = new int[3];
viewIdArray[0] = R.id.textView1;
viewIdArray[1] = R.id.button2;
viewIdArray[2] = R.id.button5;
int[] shapeArray = new int[3];
shapeArray[0] = OverlayMsg.SHAPE_CIRCLE;
shapeArray[1] = OverlayMsg.SHAPE_RECTANGLE;
shapeArray[2] = OverlayMsg.SHAPE_CIRCLE;

ovm.showTextWithMultiple(
	R.id.globalLayout,
	viewIdArray,
	shapeArray,
	"A lot of things",
	OverlayMsg.POSITION_CENTER,
	new OverlayMsg.Event() {
		public void event() {
			Toast.makeText(getApplicationContext(), "Final sample", Toast.LENGTH_LONG).show();
		}
	});
```

![Fifth example](http://www.sdangin.fr/git/screenshot5.png)

## F.A.Q.
### Capture the back button

If you want to hide the message with the back button, you can add this code to your activity.

```java
public boolean onKeyDown(int keyCode, KeyEvent event)
{
  if (keyCode == KeyEvent.KEYCODE_BACK)
  {
    if (ovm.isCurrentlyShowed())
    {
      ovm.hideCurrentMessage();
      return true;
    }
  }
  return super.onKeyDown(keyCode, event);
}
```

### Display a message on the opening screen

If you want to display a message just after calling ```setContentView```, you must run the display delayed.

```java
new Handler().postDelayed(new Runnable(){
  public void run(){
    ovm.textSize = convertSpToPixel(40);
    ovm.showTextWithCircle(R.id.globalLayout, R.id.textView1, "First text view", OverlayMsg.POSITION_CENTER, null);
  }
}, 500);
```

# OverlayMsg (Français)
## Présentation
Afficher simplement des messages par dessus votre application Android pour expliquer son fonctionnement.
Seulement 2 fichiers à ajouter à votre projet, 2 lignes de code pour un premier affichage.
![Capture d'écran d'un exemple](http://www.sdangin.fr/git/screenshot4##ng)

## Installation
1. Ajoutez le fichier OverlayMsg.java aux sources de votre projet.
2. Ajoutez le fichier overlay_msg.xml dans le répertoire res/values/ de votre projet.
3. Le container principal doit être un ```FrameLayout```

## Exemples de code
[A partir du fichier XML du projet d'exemple (SampleProject)](https://github.com/Sylvaner/OverlayMsg/blob/master/SampleProject/res/layout/activity_main.xml)

![Base screenshot](http://www.sdangin.fr/git/base.png)

###  Premier exemple
* Afficher un message.
* Au milieu de l'écran.
* Changer la taille du texte.
* Entourer un TextView avec un cercle.

```java
OverlayMsg ovm = new OverlayMsg(this);
ovm.textSize = convertSpToPixel(40);
ovm.showTextWithCircle(R.id.globalLayout, R.id.textView1, "First text view", OverlayMsg.POSITION_CENTER, null);
```

![Premier exemple](http://www.sdangin.fr/git/screenshot1.png)

### Deuxième exemple
* Afficher un message.
* En haut de l'écran.
* Ajouter un fond noir à ce texte.
* Cacher "Press to continue"
* Entourer un groupe de boutons radio avec un rectangle.

```java
OverlayMsg ovm = new OverlayMsg(this);
ovm.showTextBackground = true;
ovm.textBackgroundColor = 0xFF000000;
ovm.showPressToContinue = false;
ovm.showTextWithRect(R.id.globalLayout, R.id.radiogroup, "A radio group", OverlayMsg.POSITION_TOP, null);
```

![Deuxième exemple](http://www.sdangin.fr/git/screenshot2.png)

### Troisième exemple
* Afficher un message.
* En bas de l'écran.
* Entourer un bouton radio d'un cercle.
* Avec un bord vert.
* Et une épaisseur de 50 pixels.
* Modifier la taille du message 'Press to continue'.

```java
OverlayMsg ovm = new OverlayMsg(this);
ovm.borderColor = 0xFF00FF00;
ovm.borderSize = 50;
ovm.pressToContinueTextSize = convertSpToPixel(10);
ovm.showTextWithCircle(R.id.globalLayout, R.id.radio1, "This things", OverlayMsg.POSITION_BOTTOM, null);
```

![Troisième exemple](http://www.sdangin.fr/git/screenshot3.png)

### Quatrième exemple
* Afficher un message.
* En haut de l'écran.
* Avec une police de caractère spéciale.
* Une dimension de 50sp.
* Entourer deux CheckBox d'un grand rectangle.

```java
OverlayMsg ovm = new OverlayMsg(this);
Typeface typeface = Typeface.createFromAsset(getAssets(), "fonts/alex-toth.ttf");
ovm.textFont = typeface;
ovm.textSize = convertSpToPixel(50);
ovm.showTextWithBigRect(R.id.globalLayout, R.id.checkbox1, R.id.checkbox2, "A big box", OverlayMsg.POSITION_TOP, null);
```

![Quatrième exemple](http://www.sdangin.fr/git/screenshot4.png)

### Cinquième exemple
* Afficher un message.
* Au milieu de l'écran.
* Entourer trois éléments différents.
* Avec des formes différentes.
* Afficher un message à l'action d'un utilisateur.

```java
OverlayMsg ovm = new OverlayMsg(this);
int[] viewIdArray = new int[3];
viewIdArray[0] = R.id.textView1;
viewIdArray[1] = R.id.button2;
viewIdArray[2] = R.id.button5;
int[] shapeArray = new int[3];
shapeArray[0] = OverlayMsg.SHAPE_CIRCLE;
shapeArray[1] = OverlayMsg.SHAPE_RECTANGLE;
shapeArray[2] = OverlayMsg.SHAPE_CIRCLE;

ovm.showTextWithMultiple(
	R.id.globalLayout,
	viewIdArray,
	shapeArray,
	"A lot of things",
	OverlayMsg.POSITION_CENTER,
	new OverlayMsg.Event() {
		public void event() {
			Toast.makeText(getApplicationContext(), "Final sample", Toast.LENGTH_LONG).show();
		}
	});
```

![Cinquième exemple](http://www.sdangin.fr/git/screenshot5.png)

## F.A.Q.
### Capturer le bouton BACK

Si vous voulez cacher le message avec le bouton BACK, vous pouvez ajouter ce code à votre 'Activity'.

```java
public boolean onKeyDown(int keyCode, KeyEvent event)
{
  if (keyCode == KeyEvent.KEYCODE_BACK)
  {
    if (ovm.isCurrentlyShowed())
    {
      ovm.hideCurrentMessage();
      return true;
    }
  }
  return super.onKeyDown(keyCode, event);
}
```

### Afficher un message à l'ouverture de l'écran

Si vous voulez afficher un message juste après avoir appelé ```setContentView```, vous devez lancer l'affichage en différé.

```java
new Handler().postDelayed(new Runnable(){
  public void run(){
    ovm.textSize = convertSpToPixel(40);
    ovm.showTextWithCircle(R.id.globalLayout, R.id.textView1, "First text view", OverlayMsg.POSITION_CENTER, null);
  }
}, 500);
```


text:
package com.just.agentweb.sample.client;

import android.util.Log;
import android.webkit.JsResult;
import android.webkit.WebView;

import com.just.agentweb.MiddlewareWebChromeBase;

/**
 * Created by cenxiaozhong on 2017/12/16.
 * After agentweb 3.0.0  , allow dev to custom self WebChromeClient's MiddleWare  .
 */
public class MiddlewareChromeClient extends MiddlewareWebChromeBase {
    public MiddlewareChromeClient() {
    }
    @Override
    public boolean onJsAlert(WebView view, String url, String message, JsResult result) {
        Log.i("Info","onJsAlert:"+url);
        return super.onJsAlert(view, url, message, result);
    }

    @Override
    public void onProgressChanged(WebView view, int newProgress) {
        super.onProgressChanged(view, newProgress);
        Log.i("Info","onProgressChanged:");
    }
}


text:
from google.appengine.api import search
from google.appengine.ext import deferred

from rogerthat.bizz.job import run_job
from rogerthat.bizz.profile import _re_index, USER_INDEX
from rogerthat.consts import MIGRATION_QUEUE
from rogerthat.models import UserProfile
from rogerthat.rpc import users
from rogerthat.utils import drop_index

def job(queue=MIGRATION_QUEUE):
    usr_index = search.Index(name=USER_INDEX)

    drop_index(usr_index)

    run_job(query, [], worker, [queue], worker_queue=queue)

def worker(up_key, queue):
    deferred.defer(_re_index, users.User(up_key.parent().name()), _queue=queue)

def query():
    return UserProfile.all(keys_only=True)


text:
package voldemort.utils;

import java.io.Serializable;

/**
 * @param T the type of object that is being wrapped
 * @param K the type of value used to identify the object
 *
 *        Immutable wrapper around an object that adds an id.
 */
public class Identified<T, K extends Serializable> implements Identifiable<K> {

    private final T _value;
    private final K _id;

    public Identified(T object, K id) {
        _value = object;
        _id = id;
    }

    /*
     * (non-Javadoc)
     *
     * @see com.linkedin.common.entity.Identifiable#getId()
     */
    public K getId() {
        return _id;
    }

    public T getValue() {
        return _value;
    }
}


text:
#ifndef _IO_H_
#define _IO_H_

#include <_mingw.h>
#include <string.h>

#pragma pack(push,_CRT_PACKING)

#ifndef _POSIX_

#ifdef __cplusplus
extern "C" {
#endif

_CRTIMP char* __cdecl _getcwd (char*, int);
#ifndef _FSIZE_T_DEFINED
  typedef unsigned long _fsize_t;
#define _FSIZE_T_DEFINED
#endif

#ifndef _FINDDATA_T_DEFINED

  struct _finddata32_t {
    unsigned attrib;
    __time32_t time_create;
    __time32_t time_access;
    __time32_t time_write;
    _fsize_t size;
    char name[260];
  };

/*#if _INTEGRAL_MAX_BITS >= 64*/

  struct _finddata32i64_t {
    unsigned attrib;
    __time32_t time_create;
    __time32_t time_access;
    __time32_t time_write;
    __int64 size;
    char name[260];
  };

  struct _finddata64i32_t {
    unsigned attrib;
    __time64_t time_create;
    __time64_t time_access;
    __time64_t time_write;
    _fsize_t size;
    char name[260];
  };

  struct __finddata64_t {
    unsigned attrib;
    __time64_t time_create;
    __time64_t time_access;
    __time64_t time_write;
    __int64 size;
    char name[260];
  };
/* #endif */

#ifdef _USE_32BIT_TIME_T
#define _finddata_t _finddata32_t
#define _finddatai64_t _finddata32i64_t

#ifdef _WIN64
#define _findfirst _findfirst32
#define _findnext _findnext32
#else
#define _findfirst32 _findfirst
#define _findnext32 _findnext
#endif
#define _findfirsti64 _findfirst32i64
#define _findnexti64 _findnext32i64
#else
#define _finddata_t _finddata64i32_t
#define _finddatai64_t __finddata64_t

#define _findfirst _findfirst64i32
#define _findnext _findnext64i32
#define _findfirsti64 _findfirst64
#define _findnexti64 _findnext64
#endif

#define _FINDDATA_T_DEFINED
#endif

#ifndef _WFINDDATA_T_DEFINED

  struct _wfinddata32_t {
    unsigned attrib;
    __time32_t time_create;
    __time32_t time_access;
    __time32_t time_write;
    _fsize_t size;
    wchar_t name[260];
  };

/* #if _INTEGRAL_MAX_BITS >= 64 */

  struct _wfinddata32i64_t {
    unsigned attrib;
    __time32_t time_create;
    __time32_t time_access;
    __time32_t time_write;
    __int64 size;
    wchar_t name[260];
  };

  struct _wfinddata64i32_t {
    unsigned attrib;
    __time64_t time_create;
    __time64_t time_access;
    __time64_t time_write;
    _fsize_t size;
    wchar_t name[260];
  };

  struct _wfinddata64_t {
    unsigned attrib;
    __time64_t time_create;
    __time64_t time_access;
    __time64_t time_write;
    __int64 size;
    wchar_t name[260];
  };
/* #endif */

#ifdef _USE_32BIT_TIME_T
#define _wfinddata_t _wfinddata32_t
#define _wfinddatai64_t _wfinddata32i64_t

#define _wfindfirst _wfindfirst32
#define _wfindnext _wfindnext32
#define _wfindfirsti64 _wfindfirst32i64
#define _wfindnexti64 _wfindnext32i64
#else
#define _wfinddata_t _wfinddata64i32_t
#define _wfinddatai64_t _wfinddata64_t

#define _wfindfirst _wfindfirst64i32
#define _wfindnext _wfindnext64i32
#define _wfindfirsti64 _wfindfirst64
#define _wfindnexti64 _wfindnext64
#endif

#define _WFINDDATA_T_DEFINED
#endif

#define _A_NORMAL 0x00
#define _A_RDONLY 0x01
#define _A_HIDDEN 0x02
#define _A_SYSTEM 0x04
#define _A_SUBDIR 0x10
#define _A_ARCH 0x20

#ifndef _SIZE_T_DEFINED
#define _SIZE_T_DEFINED
#undef size_t
#ifdef _WIN64
#if defined(__GNUC__) && defined(__STRICT_ANSI__)
  typedef unsigned int size_t __attribute__ ((mode (DI)));
#else
  typedef unsigned __int64 size_t;
#endif
#else
  typedef unsigned int size_t;
#endif
#endif

#ifndef _SSIZE_T_DEFINED
#define _SSIZE_T_DEFINED
#undef ssize_t
#ifdef _WIN64
#if defined(__GNUC__) && defined(__STRICT_ANSI__)
  typedef int ssize_t __attribute__ ((mode (DI)));
#else
  typedef __int64 ssize_t;
#endif
#else
  typedef int ssize_t;
#endif
#endif

#ifndef _OFF_T_DEFINED
#define _OFF_T_DEFINED
#ifndef _OFF_T_
#define _OFF_T_
  typedef long _off_t;
#if !defined(NO_OLDNAMES) || defined(_POSIX)
  typedef long off_t;
#endif
#endif
#endif

#ifndef _OFF64_T_DEFINED
#define _OFF64_T_DEFINED
#if defined(__GNUC__) && defined(__STRICT_ANSI__)
  typedef int _off64_t __attribute__ ((mode (DI)));
#if !defined(NO_OLDNAMES) || defined(_POSIX)
  typedef int off64_t __attribute__ ((mode (DI)));
#endif
#else
  typedef long long _off64_t;
#if !defined(NO_OLDNAMES) || defined(_POSIX)
  typedef long long off64_t;
#endif
#endif
#endif

  /* Some defines for _access nAccessMode (MS doesn't define them, but
  * it doesn't seem to hurt to add them). */
#define	F_OK	0	/* Check for file existence */
#define	X_OK	1	/* Check for execute permission. */
#define	W_OK	2	/* Check for write permission */
#define	R_OK	4	/* Check for read permission */

  _CRTIMP int __cdecl _access(const char *_Filename,int _AccessMode);
  _CRTIMP int __cdecl _chmod(const char *_Filename,int _Mode);
  _CRTIMP int __cdecl _chsize(int _FileHandle,long _Size);
  _CRTIMP int __cdecl _close(int _FileHandle);
  _CRTIMP int __cdecl _commit(int _FileHandle);
  _CRTIMP int __cdecl _creat(const char *_Filename,int _PermissionMode);
  _CRTIMP int __cdecl _dup(int _FileHandle);
  _CRTIMP int __cdecl _dup2(int _FileHandleSrc,int _FileHandleDst);
  _CRTIMP int __cdecl _eof(int _FileHandle);
  _CRTIMP long __cdecl _filelength(int _FileHandle);
  _CRTIMP intptr_t __cdecl _findfirst32(const char *_Filename,struct _finddata32_t *_FindData);
  _CRTIMP int __cdecl _findnext32(intptr_t _FindHandle,struct _finddata32_t *_FindData);
  _CRTIMP int __cdecl _findclose(intptr_t _FindHandle);
  _CRTIMP int __cdecl _isatty(int _FileHandle);
  _CRTIMP int __cdecl _locking(int _FileHandle,int _LockMode,long _NumOfBytes);
  _CRTIMP long __cdecl _lseek(int _FileHandle,long _Offset,int _Origin);
  _off64_t lseek64(int fd,_off64_t offset, int whence);
  _CRTIMP char *__cdecl _mktemp(char *_TemplateName);
  _CRTIMP int __cdecl _pipe(int *_PtHandles,unsigned int _PipeSize,int _TextMode);
  _CRTIMP int __cdecl _read(int _FileHandle,void *_DstBuf,unsigned int _MaxCharCount);

#ifndef _CRT_DIRECTORY_DEFINED
#define _CRT_DIRECTORY_DEFINED
  int __cdecl remove(const char *_Filename);
  int __cdecl rename(const char *_OldFilename,const char *_NewFilename);
  _CRTIMP int __cdecl _unlink(const char *_Filename);
#ifndef	NO_OLDNAMES
  int __cdecl unlink(const char *_Filename);
#endif
#endif

  _CRTIMP int __cdecl _setmode(int _FileHandle,int _Mode);
  _CRTIMP long __cdecl _tell(int _FileHandle);
  _CRTIMP int __cdecl _umask(int _Mode);
  _CRTIMP int __cdecl _write(int _FileHandle,const void *_Buf,unsigned int _MaxCharCount);

#if _INTEGRAL_MAX_BITS >= 64
  _CRTIMP __int64 __cdecl _filelengthi64(int _FileHandle);
  _CRTIMP intptr_t __cdecl _findfirst32i64(const char *_Filename,struct _finddata32i64_t *_FindData);
  _CRTIMP intptr_t __cdecl _findfirst64(const char *_Filename,struct __finddata64_t *_FindData);
#ifdef __cplusplus
#include <string.h>
#endif
  intptr_t __cdecl _findfirst64i32(const char *_Filename,struct _finddata64i32_t *_FindData);
  __CRT_INLINE intptr_t __cdecl _findfirst64i32(const char *_Filename,struct _finddata64i32_t *_FindData)
  {
    struct __finddata64_t fd;
    intptr_t ret = _findfirst64(_Filename,&fd);
    _FindData->attrib=fd.attrib;
    _FindData->time_create=fd.time_create;
    _FindData->time_access=fd.time_access;
    _FindData->time_write=fd.time_write;
    _FindData->size=(_fsize_t) fd.size;
    strncpy(_FindData->name,fd.name,260);
    return ret;
  }
  _CRTIMP int __cdecl _findnext32i64(intptr_t _FindHandle,struct _finddata32i64_t *_FindData);
  _CRTIMP int __cdecl _findnext64(intptr_t _FindHandle,struct __finddata64_t *_FindData);
  int __cdecl _findnext64i32(intptr_t _FindHandle,struct _finddata64i32_t *_FindData);
  __CRT_INLINE int __cdecl _findnext64i32(intptr_t _FindHandle,struct _finddata64i32_t *_FindData)
  {
    struct __finddata64_t fd;
    int ret = _findnext64(_FindHandle,&fd);
    _FindData->attrib=fd.attrib;
    _FindData->time_create=fd.time_create;
    _FindData->time_access=fd.time_access;
    _FindData->time_write=fd.time_write;
    _FindData->size=(_fsize_t) fd.size;
    strncpy(_FindData->name,fd.name,260);
    return ret;
  }
  __int64 __cdecl _lseeki64(int _FileHandle,__int64 _Offset,int _Origin);
  __int64 __cdecl _telli64(int _FileHandle);
#endif
#ifndef NO_OLDNAMES

#ifndef _UWIN
  int __cdecl chdir (const char *);
  char *__cdecl getcwd (char *, int);
  int __cdecl mkdir (const char *);
  char *__cdecl mktemp(char *);
  int __cdecl rmdir (const char*);
  int __cdecl chmod (const char *, int);
#endif /* _UWIN */

#endif /* Not NO_OLDNAMES */

  _CRTIMP errno_t __cdecl _sopen_s(int *_FileHandle,const char *_Filename,int _OpenFlag,int _ShareFlag,int _PermissionMode);

#ifndef __cplusplus
  _CRTIMP int __cdecl _open(const char *_Filename,int _OpenFlag,...);
  _CRTIMP int __cdecl _sopen(const char *_Filename,int _OpenFlag,int _ShareFlag,...);
#else
  extern "C++" _CRTIMP int __cdecl _open(const char *_Filename,int _Openflag,int _PermissionMode = 0);
  extern "C++" _CRTIMP int __cdecl _sopen(const char *_Filename,int _Openflag,int _ShareFlag,int _PermissionMode = 0);
#endif

#ifndef _WIO_DEFINED
#define _WIO_DEFINED
  _CRTIMP int __cdecl _waccess(const wchar_t *_Filename,int _AccessMode);
  _CRTIMP int __cdecl _wchmod(const wchar_t *_Filename,int _Mode);
  _CRTIMP int __cdecl _wcreat(const wchar_t *_Filename,int _PermissionMode);
  _CRTIMP intptr_t __cdecl _wfindfirst32(const wchar_t *_Filename,struct _wfinddata32_t *_FindData);
  _CRTIMP int __cdecl _wfindnext32(intptr_t _FindHandle,struct _wfinddata32_t *_FindData);
  _CRTIMP int __cdecl _wunlink(const wchar_t *_Filename);
  _CRTIMP int __cdecl _wrename(const wchar_t *_NewFilename,const wchar_t *_OldFilename);
  _CRTIMP wchar_t *__cdecl _wmktemp(wchar_t *_TemplateName);

#if _INTEGRAL_MAX_BITS >= 64
  _CRTIMP intptr_t __cdecl _wfindfirst32i64(const wchar_t *_Filename,struct _wfinddata32i64_t *_FindData);
  intptr_t __cdecl _wfindfirst64i32(const wchar_t *_Filename,struct _wfinddata64i32_t *_FindData);
  _CRTIMP intptr_t __cdecl _wfindfirst64(const wchar_t *_Filename,struct _wfinddata64_t *_FindData);
  _CRTIMP int __cdecl _wfindnext32i64(intptr_t _FindHandle,struct _wfinddata32i64_t *_FindData);
  int __cdecl _wfindnext64i32(intptr_t _FindHandle,struct _wfinddata64i32_t *_FindData);
  _CRTIMP int __cdecl _wfindnext64(intptr_t _FindHandle,struct _wfinddata64_t *_FindData);
#endif

  _CRTIMP errno_t __cdecl _wsopen_s(int *_FileHandle,const wchar_t *_Filename,int _OpenFlag,int _ShareFlag,int _PermissionFlag);

#if !defined(__cplusplus) || !(defined(_X86_) && !defined(__x86_64))
  _CRTIMP int __cdecl _wopen(const wchar_t *_Filename,int _OpenFlag,...);
  _CRTIMP int __cdecl _wsopen(const wchar_t *_Filename,int _OpenFlag,int _ShareFlag,...);
#else
  extern "C++" _CRTIMP int __cdecl _wopen(const wchar_t *_Filename,int _OpenFlag,int _PermissionMode = 0);
  extern "C++" _CRTIMP int __cdecl _wsopen(const wchar_t *_Filename,int _OpenFlag,int _ShareFlag,int _PermissionMode = 0);
#endif

#endif

  int __cdecl __lock_fhandle(int _Filehandle);
  void __cdecl _unlock_fhandle(int _Filehandle);
  _CRTIMP intptr_t __cdecl _get_osfhandle(int _FileHandle);
  _CRTIMP int __cdecl _open_osfhandle(intptr_t _OSFileHandle,int _Flags);

#ifndef	NO_OLDNAMES
  int __cdecl access(const char *_Filename,int _AccessMode);
  int __cdecl chmod(const char *_Filename,int _AccessMode);
  int __cdecl chsize(int _FileHandle,long _Size);
  int __cdecl close(int _FileHandle);
  int __cdecl creat(const char *_Filename,int _PermissionMode);
  int __cdecl dup(int _FileHandle);
  int __cdecl dup2(int _FileHandleSrc,int _FileHandleDst);
  int __cdecl eof(int _FileHandle);
  long __cdecl filelength(int _FileHandle);
  int __cdecl isatty(int _FileHandle);
  int __cdecl locking(int _FileHandle,int _LockMode,long _NumOfBytes);
  long __cdecl lseek(int _FileHandle,long _Offset,int _Origin);
  char *__cdecl mktemp(char *_TemplateName);
  int __cdecl open(const char *_Filename,int _OpenFlag,...);
  int __cdecl read(int _FileHandle,void *_DstBuf,unsigned int _MaxCharCount);
  int __cdecl setmode(int _FileHandle,int _Mode);
  int __cdecl sopen(const char *_Filename,int _OpenFlag,int _ShareFlag,...);
  long __cdecl tell(int _FileHandle);
  int __cdecl umask(int _Mode);
  int __cdecl write(int _Filehandle,const void *_Buf,unsigned int _MaxCharCount);
#endif

#ifdef __cplusplus
}
#endif
#endif

#ifdef __cplusplus
extern "C" {
#endif

/* Misc stuff */
char *getlogin(void);
#ifdef __USE_MINGW_ALARM
unsigned int alarm(unsigned int seconds);
#endif

#ifdef __USE_MINGW_ACCESS
/*  Old versions of MSVCRT access() just ignored X_OK, while the version
    shipped with Vista, returns an error code.  This will restore the
    old behaviour  */
static inline int __mingw_access (const char *__fname, int __mode) {
  return  _access (__fname, __mode & ~X_OK);
}

#define access(__f,__m)  __mingw_access (__f, __m)
#endif

#ifdef __cplusplus
}
#endif

#pragma pack(pop)

#include <sec_api/io_s.h>

#endif /* End _IO_H_ */


text:
title: Homemade Aate Ka Halwa Recipe
date: 2015-08-18 15:00:00 Z
permalink: "/homemade-aate-ka-halwa-recipe/"
categories:
- Sweet Dish
tags:
- Aate
- halwa
- sweet dish
id: 20
author: admin
layout: post
---

![Aate Ka Halwa]({{site.url}}/wp-content/uploads/2015/08/halwa-1-300x225.jpg)

## Homemade Aate Ka [Halwa](http://en.wikipedia.org/wiki/Halva "Halva") [Recipe](http://en.wikipedia.org/wiki/Chocolate_cake "Chocolate cake")

Homemade Aate ka Halwa recipe is famous [sweet dish](http://en.wikipedia.org/wiki/Dessert "Dessert"). It is very easy to make. In punjabi language it is also called a Kada Prashad. It is very simple recipe which make with a very less time. In this recipe the main ingredient is aata which is also called a [wheat flour](http://en.wikipedia.org/wiki/Wheat_flour "Wheat flour"). In this recipe i am used a [cardamom](http://en.wikipedia.org/wiki/Cardamom "Cardamom") powder which is optional. Aate ka halwa is most famous in Punjab. So it is a [Punjabi](http://en.wikipedia.org/wiki/Punjabi_language "Punjabi language") sweet dish. This is my all time favorite dish which I generally make on special occasions. It is very healthy, quick and easy recipe which takes few minutes to prepare.

### _Ingredients_:

*   1 cup aata (wheat flour)
*   1/2 cup [ghee](http://en.wikipedia.org/wiki/Ghee "Ghee")
*   4-5 [cashew nuts](http://en.wikipedia.org/wiki/Cashew "Cashew")
*   1/2 cup sugar
*   water as required
*   1 tbsp green cardamom powder (elaichi powder)

### _Method:_

*   To prepare this aate (wheat flour) ka halwa recipe,take a **pan** add 1/2 cup **ghee** and heat it. Keep the pan on **low flame**.
*   Now **add** a **cashew nuts** and **roast** it.
*   When it get roasted put it into a **tissue paper** or some plate.
*   Now, add **aata** in this ghee and **cook** it till **light brown**. Stir continuously.

![Homemade Aate Ka Halwa Recipe]({{site.url}}/wp-content/uploads/2015/08/2015-08-08-13.46.44-300x225.jpg)

 ![Homemade Aate Ka Halwa Recipe]({{site.url}}/wp-content/uploads/2015/08/2015-08-08-13.53.49-300x225.jpg)

*   When wheat or aata became light brown then **add** a **sugar** in it.
*   **Mix** well and cook it.
*   Now add **1 cup water** and **stir **simultaneously using whisk or spatula.
*   Now **add** a roasted **cashew nuts** and **cardamom powder** (elaichi powder).
*   **Stir** continuously.
*   **Garnish** with more **cashew nuts**.
*   It is now ready to serve.
*   **Serve** hot.

### _Tip:_

*   You can also add a **milk** with water and also add any type of **dry fruits**.
*   Be careful when you add water.


text:
Siriux Gazer Gallery
====================

Welcome to the Siriux Gazer Gallery application, a PHP project made for a
class in college, using Symfony2.

This document contains information on how to download and start using Gazer.
For a more detailed explanation on Symfony2 installation, see the
[Installation chapter](http://symfony.com/doc/current/book/installation.html)
of the Symfony Documentation.

1) Download Gazer
-----------------

To download Gazer, you have two options:

### Download an archive file (*recommended*)

The easiest way to get started is to download an archive of Gazer
(https://github.com/helderco/gazer/downloads) with vendors. Unpack it
somewhere under your web server root directory and you're done. The web
root is wherever your web server (e.g. Apache) looks when you access
`http://localhost` in a browser.

### Clone the git Repository

If you want to use Git, run the following commands:

    git clone git://github.com/helderco/gazer.git
    cd gazer
    mkdir -p app/logs app/cache web/uploads/media
    cp app/config/parameters.ini.dist app/config/parameters.ini

2) Installation
---------------

Once you've downloaded Gazer, installation is easy, and basically
involves making sure your system is ready for Symfony.

### a) Check your System Configuration

Before you begin, make sure that your local system is properly configured
for Symfony. To do this, execute the following:

    php app/check.php

If you get any warnings or recommendations, fix these now before moving on.

If the PHP version check failed, and you have a `php-5.3` and `php` installed
(where `php` is 5.2), you can create a symbolic link to `php-5.3` somewhere
and add it to your `$PATH`.

    ln -s `which php-5.3` ~/bin/php
    export PATH=~/bin/:$PATH

### b) Install the Vendor Libraries

If you downloaded via git, then you need to download all of the necessary
vendor libraries. If you're not sure if you need to do this, check to see
if you have a ``vendor/`` directory. If you don't, or if that directory is
empty, run the following:

    php bin/vendors install

Note that you **must** have git installed and be able to execute the `git`
command to execute this script. If you don't have git available, either install
it or download the Gazer archive with the vendor libraries already included.

### c) Configure

Edit the file `app/config/parameters.ini` to configure your database and
email credentials, and also create a secret key. If you don't yet have a
database created for this application, create one now.

If you downloaded the archive, it comes with a `gazer.sql` file that you can
use to create the database tables and the first user, but if you're using Git,
you can create the database tables with the following:

    php app/console doctrine:schema:create

And add an administrator:

    php app/console fos:user:create admin gazer@siriux.org s3cr3t --super-admin

You now have your first user with access to the administration area, with
username `admin` and password `s3cr3t`.

### d) Access the Application via the Browser

Congratulations! You're now ready to use Gazer. If you've unzipped Gazer
in the web root of your computer, then you should be able to access the
application via:

    http://localhost/gazer/web/

It is recommended that you create a virtual host pointing to the `web` folder
of Gazer. If you know how to do this, you can have a URL like this:

    http://gazer.local/

### e) Create Galleries

If you didn't take advantage of the `gazer.sql` you should access the
administration area now, and create some galleries. Without them, users
can't upload any photos.

Enjoy!


text:
rm -f /etc/apt/sources.list.d/*
cat <<EOF > /etc/apt/sources.list
deb http://httpredir.debian.org/debian jessie main contrib non-free
deb-src http://httpredir.debian.org/debian jessie main contrib non-free

deb http://httpredir.debian.org/debian jessie-updates main contrib non-free
deb-src http://httpredir.debian.org/debian jessie-updates main contrib non-free

deb http://security.debian.org/ jessie/updates main contrib non-free
deb-src http://security.debian.org/ jessie/updates main contrib non-free
EOF

# Update the box
export DEBIAN_FRONTEND=noninteractive
apt-get -y update
apt-get -y -o Dpkg::Options::="--force-confnew" dist-upgrade
apt-get -y install apt-transport-https curl
apt-get clean

# Tweak sshd to prevent DNS resolution (speed up logins)
printf '\nUseDNS no\n' >> /etc/ssh/sshd_config