text:
ansible-role-concourse-ci
===

[![GitHub release](https://img.shields.io/github/release/dbaba/ansible-role-concourse-ci.svg)](https://github.com/dbaba/ansible-role-concourse-ci/releases/latest)
[![master Build Status](https://travis-ci.org/dbaba/ansible-role-concourse-ci.svg?branch=master)](https://travis-ci.org/dbaba/ansible-role-concourse-ci/)
[![License MIT](https://img.shields.io/github/license/dbaba/candy-red.svg)](http://opensource.org/licenses/MIT)

This is an Ansible role for [Concourse CI](https://concourse.ci) running as Docker containers with Docker-Compose. See the following links for detail.

- [concourse/Setting up/Standalone Binary](https://concourse.ci/binaries.html)
- [concourse/Setting up/Docker Repository](https://concourse.ci/docker-repository.html)

This role offers 1 web node and 1 worker node.

# Prerequisites

 * Ansible ... 2.0+
 * Vagrant ... 1.8+
 * Ruby    ... 2.0+ (tested version=2.3.1)

# Dependencies

 * [andrewrothstein.docker](https://galaxy.ansible.com/andrewrothstein/docker/)
 * [andrewrothstein.docker-compose](https://galaxy.ansible.com/andrewrothstein/docker-compose/)

# Setup
## For Evaluating Concourse CI

    git clone https://github.com/dbaba/ansible-role-concourse-ci.git
    cd ansible-role-concourse-ci
    vagrant up # roles directory is placed under `test/integration/default`

Then open your browser, go to http://localhost:8080 (user:`concourse`/password:`ci`) and you can download `fly` binary there.

## Environment Variables

  - `CONCOURSE_POSTGRESQL_DB_DIR`
  - `CONCOURSE_KEYS_WEB_DIR`
  - `CONCOURSE_KEYS_WORKER_DIR`
  - `CONCOURSE_EXTERNAL_URL`

## For Development and running test-kitchen

    mkdir ansible-roles # this empty folder is used for installing dependencies by `ansible-galaxy`
    cd ansible-roles
    git clone https://github.com/dbaba/ansible-role-concourse-ci.git
    cd ansible-role-concourse-ci
    gem install bundler
    bundle install
    ansible-galaxy install -r requirements.yml

# Test
## Syntax Test

    ansible-playbook -i localhost --syntax-check test/integration/default/default.yml

## Perform test with test-kitchen

    kitchen test

## Clear test VMs

    kitchen destroy

# Revision History
 * 2.0.0
    - Use docker image provided by concourse
 * 1.0.1
    - Set the valid slack notification secured key
 * 1.0.0
    - Initial Release

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>
<html>
<head>
<script>
if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.waitUntilDone();
    testRunner.setXSSAuditorEnabled(true);
}
</script>
</head>
<body>
<iframe src="http://localhost:8000/security/xssAuditor/resources/echo-intertag.pl?q=<script>alert('%b4%5f')</script>&charset=big5&notifyDone=1"></iframe>
</body>
</html>


text:
<add>
<doc>
<field name="uid">doi:10.1371/journal.pntd.0001417</field>
<field name="doi">10.1371/journal.pntd.0001417</field>
<field name="data_source">PLoS Open Access XML</field>
<field name="authors">Phonepasong Ayé Soukhathammavong, Somphou Sayasone, Khampheng Phongluxa, Vilavanh Xayaseng, Jürg Utzinger, Penelope Vounatsou, Christoph Hatz, Kongsap Akkhavong, Jennifer Keiser, Peter Odermatt</field>
<field name="title">Low Efficacy of Single-Dose Albendazole and Mebendazole against Hookworm and Effect on Concomitant Helminth Infection in Lao PDR</field>
<field name="journal">PLoS Neglected Tropical Diseases</field>
<field name="year">2012</field>
<field name="volume">6</field>
<field name="number">1</field>
<field name="pages">e1417</field>
<field name="license">Creative Commons Attribution (CC BY)</field>
<field name="license_url">http://creativecommons.org/licenses/by/3.0/</field>
<field name="fulltext">
Abstract

Background

Albendazole and mebendazole are increasingly deployed for preventive
chemotherapy targeting soil-transmitted helminth (STH) infections. We assessed
the efficacy of single oral doses of albendazole (400 mg) and mebendazole (500
mg) for the treatment of hookworm infection in school-aged children in Lao
PDR. Since Opisthorchis viverrini is co-endemic in our study setting, the
effect of the two drugs could also be determined against this liver fluke.

Methodology

We conducted a randomized, open-label, two-arm trial. In total, 200 children
infected with hookworm (determined by quadruplicate Kato-Katz thick smears
derived from two stool samples) were randomly assigned to albendazole (n =
100) and mebendazole (n = 100). Cure rate (CR; percentage of children who
became egg-negative after treatment), and egg reduction rate (ERR; reduction
in the geometric mean fecal egg count at treatment follow-up compared to
baseline) at 21–23 days posttreatment were used as primary outcome measures.
Adverse events were monitored 3 hours post treatment.

Principal Findings

Single-dose albendazole and mebendazole resulted in CRs of 36.0% and 17.6%
(odds ratio: 0.4; 95% confidence interval: 0.2–0.8; P = 0.01), and ERRs of
86.7% and 76.3%, respectively. In children co-infected with O. viverrini,
albendazole and mebendazole showed low CRs (33.3% and 24.2%, respectively) and
moderate ERRs (82.1% and 78.2%, respectively).

Conclusions/Significance

Both albendazole and mebendazole showed disappointing CRs against hookworm,
but albendazole cured infection and reduced intensity of infection with a
higher efficacy than mebendazole. Single-dose administrations showed an effect
against O. viverrini, and hence it will be interesting to monitor potential
ancillary benefits of a preventive chemotherapy strategy that targets STHs in
areas where opisthorchiasis is co-endemic.

Clinical Trial Registration

Current Controlled Trials ISRCTN29126001

Author Summary

Parasitic worms remain a public health problem in developing countries.
Regular deworming with the drugs albendazole and mebendazole is the current
global control strategy. We assessed the efficacies of a single tablet of
albendazole (400 mg) and mebendazole (500 mg) against hookworm in children of
southern Lao PDR. From each child, two stool samples were examined for the
presence and number of hookworm eggs. Two hundred children were found to be
infected. They were randomly assigned to albendazole (n = 100) or mebendazole
(n = 100) treatment. Three weeks later, another two stool samples were
analyzed for hookworm eggs. Thirty-two children who were given albendazole had
no hookworm eggs anymore in their stool, while only 15 children who received
mebendazole were found egg-negative. The total number of hookworm eggs was
reduced by 85.3% in the albendazole and 74.5% in the mebendazole group. About
one third of the children who were co-infected with the Asian liver fluke
Opisthorchis viverrini were cleared from this infection following albendazole
treatment and about one forth in the mebendazole group. Concluding, both
albendazole and mebendazole showed disapp</field></doc>
</add>


text:
package memlog

import (
	"sync"
)

/*
MemoryTopicStore is used for testing the commitlog and is not for production use.
*/
type MemoryTopicStore struct {
	term     int64
	votedFor string
	lock     sync.RWMutex
}

// Load reads the given topic information from persistent storage
func (topicStore *MemoryTopicStore) Load() (term int64, votedFor string, err error) {
	return 0, "", nil
}

// SetTerm persists the term and vote
func (topicStore *MemoryTopicStore) SetTerm(term int64, votedFor string) (err error) {
	topicStore.lock.Lock()
	defer topicStore.lock.Unlock()
	topicStore.term = term
	topicStore.votedFor = votedFor
	return nil
}


text:
@interface KARootViewController ()

@property (nonatomic) NSTextView *textField;
@property (nonatomic) NSTextView *displayView;
@property (nonatomic) NSButton *button;
@property (nonatomic) NSButton *pasteboardButton;
@property (nonatomic) NSVisualEffectView *vev;
@property (nonatomic) NSScrollView *scrollView;
@property (nonatomic, readonly) NSButton *warningButton;
@property (nonatomic, readonly) ApplicationCoordinator *applicationCoordinator;

@end

@implementation KARootViewController

- (instancetype)initWithApplicationCoordinator:(ApplicationCoordinator *)applicationCoordinator {
    self = [super init];

    if (self) {
        _applicationCoordinator = applicationCoordinator;
    }

    return self;
}

- (void)loadView {
    self.view = [[NSView alloc] init];
}

- (void)resize {
    self.view.bounds = CGRectMake(0, 0, self.view.window.frame.size.width, self.view.window.frame.size.height);
    self.vev.frame = self.view.bounds;
    CGFloat width = CGRectGetWidth(self.view.bounds);
    CGFloat height = CGRectGetHeight(self.view.bounds);

    CGFloat textWidth = width * 0.75;
    CGFloat textHeight = height * 0.2;

    self.scrollView.frame = NSMakeRect((width - (textWidth))/2, height - textHeight/2 - (width - (textWidth))/2, textWidth, textHeight);
    self.textField.frame = NSMakeRect((width - (textWidth))/2, height - textHeight/2 - (width - (textWidth))/2, textWidth, textHeight);
    [self.textField setMinSize:NSMakeSize(0.0, textHeight)];

    self.button.frame = NSMakeRect(CGRectGetWidth(self.scrollView.bounds), CGRectGetMinY(self.scrollView.frame) - CGRectGetHeight(self.scrollView.frame)/2, CGRectGetWidth(self.button.frame), CGRectGetHeight(self.button.frame));

    self.warningButton.frame = NSMakeRect((width - (textWidth))/2, CGRectGetMinY(self.scrollView.frame) - CGRectGetHeight(self.scrollView.frame)/2, CGRectGetWidth(self.warningButton.frame), CGRectGetHeight(self.warningButton.frame));

    textWidth = width * 0.95;

    self.displayView.frame = NSMakeRect((width - (textWidth))/2, CGRectGetMaxY(self.button.frame) - textHeight - CGRectGetHeight(self.button.frame) - 30, textWidth, textHeight);

    self.pasteboardButton.frame = NSMakeRect(CGRectGetWidth(self.displayView.bounds) - CGRectGetWidth(self.pasteboardButton.bounds), CGRectGetMinY(self.displayView.frame) - CGRectGetHeight(self.displayView.frame)/2 - 30, CGRectGetWidth(self.pasteboardButton.frame), CGRectGetHeight(self.pasteboardButton.frame));
}

- (void)viewDidLoad {
    [super viewDidLoad];

    self.vev = [[NSVisualEffectView alloc] init];
    self.vev.blendingMode = NSVisualEffectBlendingModeBehindWindow;
    self.vev.material = NSVisualEffectMaterialUltraDark;
    self.vev.state = NSVisualEffectStateActive;
    [self.view addSubview:self.vev];

    self.scrollView = [[NSScrollView alloc] init];

    self.textField = [[NSTextView alloc] init];

    self.textField.backgroundColor = [NSColor colorWithWhite:0.5 alpha:0.2];
    self.textField.textColor = [NSColor whiteColor];
    self.textField.insertionPointColor = [NSColor whiteColor];
    self.textField.richText = NO;
    self.textField.allowsUndo = YES;

    [self.textField setMaxSize:NSMakeSize(FLT_MAX, FLT_MAX)];
    [self.textField setVerticallyResizable:YES];
    [self.textField setHorizontallyResizable:NO];
    [self.textField setAutoresizingMask:NSViewWidthSizable];
    [self.scrollView setDrawsBackground:NO];

    [self.scrollView setHasVerticalScroller:YES];
    [self.scrollView setHasHorizontalScroller:NO];

    [self.scrollView addSubview:self.textField];
    [self.scrollView setDocumentView:self.textField];

    [self.view addSubview:self.scrollView];

    NSButton *button = [[NSButton alloc] init];
    [button setTitle:@"Initialize!"];
    [button setTarget:self];
    [button setAction:@selector(buttonPressed)];
    button.bezelStyle = NSRoundedBezelStyle;
    [self.view addSubview:button];
    [button sizeToFit];
    self.button = button;

    button = [[NSButton alloc] init];
    [button setTitle:@"Copy"];
    [button setTarget:self];
    [button setAction:@selector(pasteboardButtonPressed)];
    button.bezelStyle = NSRoundedBezelStyle;
    [self.view addSubview:button];
    [button sizeToFit];
    button.hidden = YES;
    self.pasteboardButton = button;

    NSTextView *displayView = [[NSTextView alloc] init];
    [self.view addSubview:displayView];
    displayView.editable = NO;
    displayView.backgroundColor = [NSColor clearColor];
    displayView.textColor = [NSColor whiteColor];
    displayView.insertionPointColor = [NSColor whiteColor];
    self.displayView = displayView;

    button = [[NSButton alloc] init];
    [button setTarget:self];
    [button setAction:@selector(warnings)];
    button.bezelStyle = NSRoundedBezelStyle;
    [self.view addSubview:button];
    [button sizeToFit];
    button.hidden = YES;
    _warningButton = button;
}

- (void)warnings {
    [self.applicationCoordinator displayWarnings:[self propertyWarnings]];
}

- (void)pasteboardButtonPressed {
    [[NSPasteboard generalPasteboard] declareTypes:@[NSPasteboardTypeString] owner:nil];
    [[NSPasteboard generalPasteboard] setData:[self.displayView.string dataUsingEncoding:NSUTF8StringEncoding] forType:NSPasteboardTypeString];
}

- (NSArray <KAWarning *> *)propertyWarnings {
    NSArray <Property *> * properties = [[[PropertyParser alloc] initWithString:self.textField.string] properties];

    NSString *output = [[KAInitializerWriterFactory initializerWriterForProperties:properties] initializer];
    self.displayView.string = output;

    return [[[KAPropertyWarningGenerator alloc] initWithProperties:properties] warnings];
}

- (void)buttonPressed {
    NSArray <Property *> * properties = [[[PropertyParser alloc] initWithString:self.textField.string] properties];

    NSString *output = [[KAInitializerWriterFactory initializerWriterForProperties:properties] initializer];
    self.displayView.string = output;

    NSArray *warnings = [[[KAPropertyWarningGenerator alloc] initWithProperties:properties] warnings];
    self.warningButton.hidden = warnings.count == 0;

    [self.warningButton setTitle:[[NSString alloc] initWithFormat:@"%ld Warnings!", warnings.count]];
    [self.warningButton sizeToFit];

    self.pasteboardButton.hidden = NO;
    [self resize];
}

- (void)viewWillAppear {
    [super viewWillAppear];
    dispatch_async(dispatch_get_main_queue(), ^{
        [self resize];
    });
}

- (void)viewDidLayout {
    [super viewDidLayout];
}

@end


text:
class Detour::OptOutFlag < Detour::FlaggableFlag
  validates_uniqueness_of :feature_id, scope: [:flaggable_type, :flaggable_id]
end


text:
<?xml version="1.0" encoding="utf-8"?>
<com.alexrwegener.dagger2byexamples.ui.home.HomeView xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_height="match_parent"
        android:layout_width="match_parent"
        android:orientation="vertical"
        android:gravity="center_horizontal"
        >
    <LinearLayout
            android:layout_height="wrap_content"
            android:layout_width="match_parent"
            android:orientation="horizontal"
            android:layout_margin="16dp"
            >
        <TextView
                android:id="@+id/home_first_name_label"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:text="First Name: "
                />
        <TextView
                android:id="@+id/home_first_name"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                />
    </LinearLayout>
    <LinearLayout
            android:layout_height="wrap_content"
            android:layout_width="match_parent"
            android:orientation="horizontal"
            android:layout_margin="16dp"
            >
        <TextView
                android:id="@+id/home_last_name_label"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:text="Last Name: "
                />
        <TextView
                android:id="@+id/home_last_name"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                />
    </LinearLayout>
    <LinearLayout
            android:layout_height="wrap_content"
            android:layout_width="match_parent"
            android:orientation="horizontal"
            android:layout_margin="16dp"
            >
        <TextView
                android:id="@+id/home_times_logged_in_label"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:text="Is enjoying scopes: "
                />
        <Switch
                android:id="@+id/home_enjoys_scopes"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                />
    </LinearLayout>
    <Button
            android:id="@+id/home_logout_button"
            style="?android:attr/selectableItemBackground"
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:layout_margin="16dp"
            android:textColor="@android:color/black"
            android:text="Logout"
            android:layout_marginLeft="16dp"
            android:layout_marginRight="16dp"
            android:layout_marginBottom="16dp"
            />
</com.alexrwegener.dagger2byexamples.ui.home.HomeView>


text:
package fr.xebia.cocktail;

import static org.junit.Assert.*;

import java.util.Collection;

import org.bson.types.ObjectId;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;

import com.mongodb.DBObject;

/**
 *
 * @author cyrilleleclerc
 *
 */
public class MongoDBCocktailRepositoryTest {

    static private CocktailRepository cocktailRepository;

    @BeforeClass
    public static void before() throws Exception {
        cocktailRepository = new CocktailRepository("mongodb://localhost:27017/devoxxfr-demo", "http://localhost:8983/solr/");
    }

    @AfterClass
    public static void afterClass() {
        cocktailRepository.preDestroy();
    }

    @Ignore
    @Test
    public void testInsertUpdateAndDelete() {
        Cocktail sexOnTheBeach = buildLongIslandCocktail();

        cocktailRepository.insert(sexOnTheBeach);
        assertNotNull("objectId has not been generated", sexOnTheBeach.getObjectId());

        // boolean deleted = cocktailDao.delete(sexOnTheBeach);
        // assertTrue("cocktail " + sexOnTheBeach + " was not deleted", deleted);
    }

    @Test
    public void testBsonMapping() {

        Cocktail sexOnTheBeach = buildSexOnTheBeachCocktail();
        ObjectId objectId = ObjectId.get();
        sexOnTheBeach.setObjectId(objectId);

        DBObject sexOnTheBeachAsDbObject = CocktailRepository.COCKTAIL_TO_BSON.apply(sexOnTheBeach);
        Cocktail actual = CocktailRepository.BSON_TO_COCKTAIL.apply(sexOnTheBeachAsDbObject);

        assertEquals(objectId, actual.getObjectId());
        assertEquals("Sex On The Beach", actual.getName());
        assertEquals(5, actual.getIngredients().size());
        assertArrayEquals(new String[] { "vodka", "peach schnapps (archers)", "orange juice", "cranberry juice", "raspberry syrup" },
                actual.getIngredientNames().toArray());
        assertEquals(2, actual.getComments().size());
    }

    protected Cocktail buildSexOnTheBeachCocktail() {
        Cocktail sexOnTheBeach = new Cocktail()
                .withName("Sex On The Beach")
                .withIngredient("1 shot", "vodka")
                .withIngredient("1 shot", "peach schnapps (archers)")
                .withIngredient("200 ml", "orange juice")
                .withIngredient("200 ml", "cranberry juice")
                .withIngredient("2 shots", "raspberry syrup")
                .withInstructions(
                        "Add ice to glass pour in shot of vodka add peach shnapps mix with orange, cranberry and raspberry\n" //
                                + "\n" //
                                + "Serve with an ubrella and a mixer stick and a fancy straw and an orange slice on side of "
                                + "glass this one is gorgeous can't believe you don't already have it on here!") //
                .addComment("I like it!!") //
                .addComment("Perfect balance between orange and vodka.");
        return sexOnTheBeach;
    }

    protected Cocktail buildLongIslandCocktail() {
        Cocktail longIslandIcedTea = new Cocktail()
                .withName("Long Island Iced tea")
                .withIngredient("1 Measure", "vodka")
                .withIngredient("1 Measure", "gin")
                .withIngredient("1 Measure", "white rum")
                .withIngredient("1 Measure", "tequila")
                .withIngredient("1 Measure", "triple sec")
                .withIngredient("3 measures", "orange juice")
                .withIngredient("to topp up the glass", "coke")
                .withInstructions(
                        "In a tall glass , add ice and all the ingredients and stir well. It should have the appearance of cloudy tea. Top with a piece of lemon\n"
                                + "\n"
                                + "Very yummy & very very decieving. It will get you hammered after only about 2 so drink with caution") //
                .addComment("Too strong for me!!");
        return longIslandIcedTea;
    }

    @Ignore
    @Test
    public void testAutoComplete() {
        Collection<String> words = cocktailRepository.suggestCocktailNameWords("lon");
        assertArrayEquals(new String[] { "long" }, words.toArray());
    }
}


text:
<project name="Jasper test" default="test1" basedir="">

	<import><javaresource name="com/anttoolkit/anttoolkit.xml"/></import>

	<target name="test1">
		<jasper.dataSource name="xxx">
			<column name="AAA" type="int"/>
			<column name="BBB" type="int"/>
			<column name="CCC" />
			<column name="DDD" type="boolean"/>
			<column name="EEE" type="float"/>
			<column name="FFF" type="date" format="MM/dd/yyyy hh:mm:ss aaa"/>
			<data>
				1,2,AAA,true,12.456,
				12,4,BBB,false,1.908,09/12/1980 07:20:23 PM
				5,67,CCC,yes,-3,
				34,-34,DDD,no,0,02/23/1980 11:20:23 AM
				34,-34,EEE,1,0,
				34,-34,FFF,0,0,
			</data>
			<data file="datasource.txt"/>
		</jasper.dataSource>

		<jasper.addToDataSource dataSource="xxx">
			<data>
				1,2,AAA,true,12.456,
				12,4,BBB,false,1.908,09/12/1980 07:20:23 PM
				5,67,CCC,yes,-3,
			</data>
		</jasper.addToDataSource>

		<jasper.report template="report1.jasper" format="pdf" reportFile="aaa.pdf" dataSource="xxx">
			<param name="report_title" value="HELLO WORLD"/>
			<param name="creation_time" type="date" value="02/02/2012 07:20:23 AM" format="MM/dd/yyyy hh:mm:ss aaa"/>
		</jasper.report>

		<jasper.report template="report1.jrxml" format="pdf" reportFile="bbb.pdf" dataSource="xxx">
			<param name="report_title" value="HELLO WORLD"/>
			<param name="creation_time" type="date" value="02/02/2012 07:20:23 AM" format="MM/dd/yyyy hh:mm:ss aaa"/>
		</jasper.report>

		<!-- When second time filling in report based on the same jrxml template,
		 actually it will not be compiled once again, cause it was already compiled
		 and cached after the first invocation -->
		<jasper.report template="report1.jrxml" format="pdf" reportFile="bbb1.pdf" dataSource="xxx">
			<param name="report_title" value="HELLO WORLD"/>
			<param name="creation_time" type="date" value="02/02/2012 07:20:23 AM" format="MM/dd/yyyy hh:mm:ss aaa"/>
		</jasper.report>

	</target>

	<target name="test2">

		<jasper.compile src="report1.jrxml" dest="aaa.jasper"/>

	</target>

</project>


text:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".MainActivity">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center_horizontal"
        android:orientation="vertical">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Hello World!" />

        <ImageView
            android:id="@+id/iv_origin"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:src="@mipmap/ic_launcher" />

        <Button
            android:id="@+id/btn_process"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="识别" />

    </LinearLayout>
</ScrollView>


text:
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.codeInsight.template.postfix.templates;

import com.intellij.codeInsight.template.postfix.templates.editable.PostfixTemplateEditor;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.util.NlsActions;
import com.intellij.openapi.util.NlsSafe;
import com.intellij.psi.PsiFile;
import org.jdom.Element;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.Set;

/**
 * Extension point interface for providing language specific postfix templates.
 * @see LanguagePostfixTemplate#EP_NAME
 * @see PostfixTemplate
 */
public interface PostfixTemplateProvider {
  /**
   * Identifier of template provider. Used for storing settings of provider's templates.
   */
  @NotNull
  default @NonNls String getId() {
    return getClass().getName();
  }

  /**
   * Presentation name of editable template type. If null, provider doesn't allow to custom templates.
   */
  @Nullable
  default @NlsActions.ActionText String getPresentableName() {
    return null;
  }

  /**
   * Returns builtin templates registered in the provider in their original state.
   * Consider using {@link PostfixTemplatesUtils#getAvailableTemplates(PostfixTemplateProvider)} for actually enabled templates.
   */
  @NotNull
  Set<PostfixTemplate> getTemplates();

  /**
   * Check symbol can separate template keys
   */
  boolean isTerminalSymbol(char currentChar);

  /**
   * Prepare file for template expanding. Running on EDT.
   * E.g. java postfix templates adds semicolon after caret in order to simplify context checking.
   *

   * File content doesn't contain template's key, it is deleted just before this method invocation.
   *

   * Note that while postfix template is checking its availability the file parameter is a _COPY_ of the real file,
   * so you can do with it anything that you want, but in the same time it doesn't recommended to modify editor state because it's real.
   */
  void preExpand(@NotNull PsiFile file, @NotNull Editor editor);

  /**
   * Invoked after template finished (doesn't matter if it finished successfully or not).
   * E.g. java postfix template use this method for deleting inserted semicolon.
   */
  void afterExpand(@NotNull PsiFile file, @NotNull Editor editor);

  /**
   * Prepare file for checking availability of templates.
   * Almost the same as {@link this#preExpand(PsiFile, Editor)} with several differences:
   * 1. Processes copy of file. So implementations can modify it without corrupting the real file.
   * 2. Could be invoked from anywhere (EDT, write-action, read-action, completion-thread etc.). So implementations should make
   * additional effort to make changes in file.
   *

   * Content of file copy doesn't contain template's key, it is deleted just before this method invocation.
   *

   * NOTE: editor is real (not copy) and it doesn't represents the copyFile.
   * So it's safer to use currentOffset parameter instead of offset from editor. Do not modify text via editor.
   */
  @NotNull
  PsiFile preCheck(@NotNull PsiFile copyFile, @NotNull Editor realEditor, int currentOffset);

  /**
   * Return the editor that it able to represent template in UI
   * and create the template from the settings that users set in UI.
   *

   * If templateToEdit is null, it's considered like an editor for a new template.
   */
  @Nullable
  default PostfixTemplateEditor createEditor(@Nullable PostfixTemplate templateToEdit) {
    return null;
  }

  /**
   * Instantiates the template that was serialized by the provider to XML.
   */
  @Nullable
  default PostfixTemplate readExternalTemplate(@NotNull @NonNls String id, @NotNull @NlsSafe String name, @NotNull Element template) {
    return null;
  }

  /**
   * Serialized to XML the template that was created by the provider.
   */
  default void writeExternalTemplate(@NotNull PostfixTemplate template, @NotNull Element parentElement) {
  }
}


text:
package org.oriole.common;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;

import java.io.IOException;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;

/**
 * Created by Lawrence on 9/17/2016.
 */
public class LocalDateTimeSerializer extends JsonSerializer<LocalDateTime> {

    @Override
    public void serialize(LocalDateTime dateTime, JsonGenerator jg,
                          SerializerProvider sp) throws IOException, JsonProcessingException {
        Instant instant = dateTime.toInstant(ZoneOffset.UTC);
        jg.writeString(DateTimeFormatter.ISO_INSTANT.format(instant));
    }
}


text:
<?php

namespace S118\EbrahimiBundle\Entity;

use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\Validator\Constraints as Assert;
use Assetic\Filter\GoogleClosure\CompilerApiFilter;
use Doctrine\ORM\Mapping AS ORM;

/**
 * @ORM\Entity
 * @ORM\Table(indexes={@ORM\Index(name="family", columns={"ln"})})
 */
class PersonEntity
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @ORM\Column(type="string", length=25, nullable=false)
     */
    private $fn;

    /**
     * @ORM\Column(type="string", length=30, nullable=false)
     */
    private $ln;

    /**
     * @ORM\Column(type="string", length=30, nullable=true)
     */
    private $city;

    /**
     * @ORM\Column(type="string", length=30, nullable=true)
     */
    private $street;

    /**
     * @ORM\Column(type="string", length=30, nullable=true)
     */
    private $alley;

    /**
     * @ORM\Column(type="boolean", nullable=false)
     */
    private $type;

    /**
     * @ORM\OneToMany(targetEntity="PhoneEntity", mappedBy="PersonEntity")
     */
    private $PhoneEntities;
    /**
     * Constructor
     */

    /**
     * @ORM\Column(name="fileName", type="string", length=255, nullable=true)
     */
    private $fileName;

    /**
     * @Assert\File(maxSize="6000000")
     */
    private $file;

    public function __construct()
    {
        $this->PhoneEntities = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set fn
     *
     * @param string $fn
     * @return PersonEntity
     */
    public function setFn($fn)
    {
        $this->fn = $fn;

        return $this;
    }

    /**
     * Get fn
     *
     * @return string
     */
    public function getFn()
    {
        return $this->fn;
    }

    /**
     * Set ln
     *
     * @param string $ln
     * @return PersonEntity
     */
    public function setLn($ln)
    {
        $this->ln = $ln;

        return $this;
    }

    /**
     * Get ln
     *
     * @return string
     */
    public function getLn()
    {
        return $this->ln;
    }

    /**
     * Set city
     *
     * @param string $city
     * @return PersonEntity
     */
    public function setCity($city)
    {
        $this->city = $city;

        return $this;
    }

    /**
     * Get city
     *
     * @return string
     */
    public function getCity()
    {
        return $this->city;
    }

    /**
     * Set street
     *
     * @param string $street
     * @return PersonEntity
     */
    public function setStreet($street)
    {
        $this->street = $street;

        return $this;
    }

    /**
     * Get street
     *
     * @return string
     */
    public function getStreet()
    {
        return $this->street;
    }

    /**
     * Set alley
     *
     * @param string $alley
     * @return PersonEntity
     */
    public function setAlley($alley)
    {
        $this->alley = $alley;

        return $this;
    }

    /**
     * Get alley
     *
     * @return string
     */
    public function getAlley()
    {
        return $this->alley;
    }

    /**
     * Set type
     *
     * @param boolean $type
     * @return PersonEntity
     */
    public function setType($type)
    {
        $this->type = $type;

        return $this;
    }

    /**
     * Get type
     *
     * @return boolean
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Set fileName
     *
     * @param string $fileName
     * @return Document
     */
    public function setFileName($fileName)
    {
        $this->fileName = $fileName;

        return $this;
    }

    /**
     * Get fileName
     *
     * @return string
     */
    public function getFileName()
    {
        return $this->fileName;
    }

    /**
     * Sets file.
     *
     * @param UploadedFile $file
     */
    public function setFile(UploadedFile $file = null)
    {
        $this->file = $file;
    }

    /**
     * Get file.
     *
     * @return UploadedFile
     */
    public function getFile()
    {
        return $this->file;
    }

    /**
     * Add PhoneEntities
     *
     * @param \S118\EbrahimiBundle\Entity\PhoneEntity $phoneEntities
     * @return PersonEntity
     */
    public function addPhoneEntitie(\S118\EbrahimiBundle\Entity\PhoneEntity $phoneEntities)
    {
        $this->PhoneEntities[] = $phoneEntities;

        return $this;
    }

    /**
     * Remove PhoneEntities
     *
     * @param \S118\EbrahimiBundle\Entity\PhoneEntity $phoneEntities
     */
    public function removePhoneEntitie(\S118\EbrahimiBundle\Entity\PhoneEntity $phoneEntities)
    {
        $this->PhoneEntities->removeElement($phoneEntities);
    }

    /**
     * Get PhoneEntities
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getPhoneEntities()
    {
        return $this->PhoneEntities;
    }

  public function __toString()
  {
      return $this->fn.' '.$this->ln;
  }

    public function getAbsolutePath()
    {
        return null === $this->fileName
            ? null
            : $this->getUploadRootDir().'/'.$this->fileName;
    }

    public function getWebPath()
    {
        return null === $this->fileName
            ? null
            : $this->getUploadDir().'/'.$this->fileName;
    }

    protected function getUploadRootDir()
    {
        // the absolute directory path where uploaded
        // documents should be saved
        return __DIR__.'/../../../../web/'.$this->getUploadDir();
    }

    protected function getUploadDir()
    {
        // get rid of the __DIR__ so it doesn't screw up
        // when displaying uploaded doc/image in the view.
        return 'bundles/118/persons/photoes';
    }

    public function upload($id)
    {
        // the file property can be empty if the field is not required
        if (null === $this->getFile()) {
            return;
        }

        // use the original file name here but you should
        // sanitize it at least to avoid any security issues

        // move takes the target directory and then the
        // target filename to move to

        $stringArray=explode(".",$this->getFile()->getClientOriginalName());
        $suffix=$stringArray[count($stringArray)-1];
        $this->fileName = ''.$this->id.'.'.$suffix;

        $this->getFile()->move(
            $this->getUploadRootDir(),
            $this->fileName
        );

        // clean up the file property as you won't need it anymore
        $this->file = null;
    }
}


text:
/* ==========================================================================
Basic Styling
 ========================================================================== */
body { width: 100%; height: 100%; font-family: "Merriweather", "Raleway", Lucida Sans Unicode, Arial, "Helvetica Neue", Helvetica, sans-serif;}
html { width: 100%; height: 100%;}

h1, h2, h3, h4, h5, h6 { margin: 0 0 35px; font-family: "Merriweather", Montserrat,"Helvetica Neue", Helvetica,Arial,sans-serif; font-weight: 700; }
h1, h2, h3, h4, h5, h6 { margin-top: 0;  margin-bottom: 10px;}

h4 {font-size: 16px;}

p { font-family: 'Merriweather', 'Ralewar', sans-serif; font-weight: 400; font-size: 14px; line-height: 29px; margin-bottom: 20px; }

a, a:visited { -webkit-transition: all 150ms ease-in; -moz-transition: all 150ms ease-in; -o-transition: all 150ms ease-in; transition: all 150ms ease-in;}
a { color: #00a8d6; -webkit-transition: all .2s ease-in-out; -moz-transition: all .2s ease-in-out; transition: all .2s ease-in-out;}
a:hover,
a:focus { text-decoration: none; color: #007DA0; outline: none; }

ul { margin: 0; padding: 0; list-style: none;}
ul li { }

::-moz-selection { text-shadow: none; background: #1F1F1F; color: #FFF;}
::selection { text-shadow: none; background: #1F1F1F; color: #FFF; }

img::selection { background: 0 0;}
img::-moz-selection { background: 0 0;}

hr {margin: 30px 0; border-top: 1px solid #EFEFEF;}
body { webkit-tap-highlight-color: rgba(255,255,255,.2);}

/* ==========================================================================
Classes
 ========================================================================== */
.headline {text-align: center;}
	.headline h1 {color: #31373a; padding-bottom: 15px; border-bottom: 2px solid #DDD; display: inline-block;}
	.headline p {margin-bottom: 50px;}

.white h1 {color: #FFF;}
.white p {color: #FFF;}

.section {padding: 100px 0;}

.padding70top {padding-top: 70px;}

.bordered {border:1px solid #DDD;}
.border-left {border-left: 1px solid #DDD;}
.border-right {border-right: 1px solid #DDD;}
.border-top {border-top: 1px solid #DDD;}
.border-bottom {border-bottom: 1px solid #DDD;}
.nopadding-bottom {padding-bottom: 0;}

.divider70 {clear: both; height: 70px;}
.divider20 {clear: both; height: 20px;}
.divider35 {clear: both; height: 35px;}

.btn {-webkit-transition: all .3s ease-in-out; -moz-transition: all .3s ease-in-out; transition: all .3s ease-in-out;}
.blue-btn { padding: 12px 15px; font-size: 12px; font-family: "Raleway", sans-serif; text-transform: uppercase; font-weight: 700; -webkit-border-radius: 2px; -moz-border-radius: 2px; -ms-border-radius: 2px; -o-border-radius: 2px; border-radius: 2px; background-color: #00a8d6; color: white;}
.blue-btn:hover { background-color: #31373a; color: #FFF;}

.tick-list {margin: 15px 0;}
.tick-list li {list-style: none; margin-bottom: 10px;}
.tick-list li i {margin-right: 10px; color: #00a8d6;}

.quote {color: #FFF; border: none; font-size: 40px; text-align: center; position: relative; font-weight: bold;}
.quote::before{  font-family:'FontAwesome'; content:"\f10d"; font-size: 20px; font-weight: bold; padding-right: 30px; font-weight: normal; }
.quote span {display: block; font-size: 16px; }

.text-center img {display: block; margin: 0 auto;}

/* ==========================================================================
Color Customizations
 ========================================================================== */
.bg-white {background-color: #FFF;}
.bg-grey {background-color: #F8F8F8;}
.bg-grey2 {background-color: #F5F5F5;}

.bg-blue {background-color: #00a8d6;}

.testimonial-bg {background:url(../images/home_background.png) no-repeat center center fixed; }
.bg-stats {background: url(../images/nabout-bg.jpg) no-repeat center center fixed; }
.bg-ipad {background: url(../images/ocean.jpg) no-repeat center center fixed;}
.bg-notebook {background: url(../images/notebook-bg.jpg) no-repeat center center fixed;}
.bg-ocean {background: url(../images/ocean.jpg) no-repeat center center fixed;}

.bg-grey-pattern {background: url(../img/grey-pattern.jpg);}

.cover {-webkit-background-size: cover; -moz-background-size: cover;-o-background-size: cover; background-size: cover; position: relative;}

.color-blue {color: #00a8d6;}
.color-white {color: #FFF;}

.overlay-bg {position: absolute; top: 0; left: 0; right: 0; bottom: 0; opacity: 0.3; background: rgba(0, 0, 0, 0.5); background: -webkit-radial-gradient(50% 55%, ellipse closest-corner, rgba(0, 0, 0, 0.57) 1%, rgba(0, 0, 0, 0.8) 100%); background:-moz-radial-gradient(50% 55%, ellipse closest-corner, rgba(0, 0, 0, 0.57) 1%, rgba(0, 0, 0, 0.8) 100%); background: -ms-radial-gradient(50% 55%, ellipse closest-corner, rgba(0, 0, 0, 0.57) 1%, rgba(0, 0, 0, 0.8) 100%); background: radial-gradient(50% 55%, ellipse closest-corner, rgba(0, 0, 0, 0.57) 1%, rgba(0, 0, 0, 0.8) 100%); -webkit-transition: all 0.3s ease-in-out; -moz-transition: all 0.3s ease-in-out; -ms-transition: all 0.3s ease-in-out; transition: all 0.3s ease-in-out; -webkit-transform: translate3d(0, 0, 0); -moz-transform: translate3d(0, 0, 0); -ms-transform: translate3d(0, 0, 0); -o-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); z-index: 0;}

/* ==========================================================================
Carousel Settings
 ========================================================================== */
.carousel-mod .carousel-indicators {position: static; display: block; width: auto; margin: 15px auto;}
.carousel-mod .carousel-indicators li {background-color: #A3A3A3; border: none; margin:0;}
.carousel-mod .carousel-indicators .active {background-color: #31373a; width: 10px; height: 10px;}
.carousel-mod .carousel-control.left, .carousel-mod .carousel-control.right {background: none; background-color: transparent; filter:none;}
.carousel-mod .carousel-control {top: 45%;}

/* ==========================================================================
 Navigation
 ========================================================================== */
.navbar-inverse { margin-bottom: 0; -webkit-border-radius: 0; -moz-border-radius: 0;border-radius: 0; padding: 0; -webkit-transition: background .5s ease-in-out,padding .5s ease-in-out; -moz-transition: background .5s ease-in-out,padding .5s ease-in-out; transition: background .5s ease-in-out,padding .5s ease-in-out; background-color: transparent; background: none;  border: none;}
.navbar-inverse .navbar-nav > li > a { color: #fff; display: block; -webkit-transition: all 100ms ease-in-out; -moz-transition: all 100ms ease-in-out; -o-transition: all 100ms ease-in-out; -ms-transition: all 100ms ease-in-out; transition: all 100ms ease-in-out; text-transform: uppercase; font-family: "Merriweather", Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif; font-weight: bold;}

.menu-right {float: right;}

.navbar-inverse .navbar-nav > li > a, .navbar-inverse .navbar-nav > li {-webkit-transition: all 400ms linear; -moz-transition: all 400ms linear; -o-transition: all 400ms linear; -ms-transition: all 400ms linear; transition: all 400ms linear;}

.navbar-toggle { padding: 4px 6px; font-size: 16px; color: #fff;}
.navbar-toggle:focus,
.navbar-toggle:active { outline: 0;}

.navbar-inverse .navbar-nav > .active > a, .navbar-inverse .navbar-nav > .active > a:hover, .navbar-inverse .navbar-nav > .active > a:focus {background-color: transparent;}

.navbar-brand { padding: 10px 15px;}
.navbar-brand:hover { color: #fff;}

.scroll-fixed-navbar { padding: 10px 0; background-color: #00a8d6; -webkit-box-shadow: 0 0 7px rgba(0, 0, 0, 0.1); -moz-box-shadow: 0 0 7px rgba(0, 0, 0, 0.1); box-shadow: 0 0 7px rgba(0, 0, 0, 0.1);}
.scroll-fixed-navbar .navbar-nav > li > a:hover,
.scroll-fixed-navbar .navbar-nav > li.active > a { color: #333; }

.navbar-toggle { position: relative; float: right; background-color: transparent; padding: 10px; margin: 13px 30px 13px 0; border: none; color: #fff; border: 2px solid #fff;}
.navbar-toggle .icon-bar { background-color: #fff;}

.navbar-inverse .navbar-collapse, .navbar-inverse .navbar-form {border-color: rgba(0,0,0,0.1);}

/* ==========================================================================
Logo
 ========================================================================== */
.navbar-inverse .navbar-brand  {color: #FFF; font-size: 30px; font-weight: 700; padding: 15px;}

/* ==========================================================================
Intro Slider
 ========================================================================== */
html, body {height: 100%;}
.carousel, .item, .active {height: 100%;}
.carousel-inner {height: 100%;}

#main-slider {background: #1A1A1A;}
#main-slider .carousel-caption { top: 40%; text-align:center; }
#main-slider .carousel-caption h2 {font-size: 50px; }
#main-slider .carousel-caption h4 {padding-top: 15px; border-top: 3px solid #DDD; display: inline-block; color: #EFEFEF; margin-top: 10px;}

.carousel-fade .carousel-inner .item { opacity: 0; -webkit-transition-property: opacity; transition-property: opacity;}
.carousel-fade .carousel-inner .active {opacity: 1;}
.carousel-fade .carousel-inner .active.left, .carousel-fade .carousel-inner .active.right { left: 0; opacity: 0; z-index: 1;}
.carousel-fade .carousel-inner .next.left, .carousel-fade .carousel-inner .prev.right {opacity: 1;}
.carousel-fade .carousel-control {z-index: 2;}

#main-slider .carousel [data-slide] { visibility: hidden; }
#main-slider .carousel:hover [data-slide] { visibility: visible; }

/* ==========================================================================
Call To Action
 ========================================================================== */
.call-to-action { padding: 25px 0; border-bottom: 1px solid #dce4e6; text-align: center;}
.call-to-action h4 {font-size: 15px; font-weight: normal; margin-top: 10px; border-right:1px solid #DDD;}
.call-to-action h4 strong {text-transform: uppercase; font-size: 16px;}
.icon-button { margin-left: 15px; }

/* ==========================================================================
Intro
 ========================================================================== */
.main-point {}
.main-point p {margin-bottom: 0;}
.main-point i { background-color: #00a8d6; width: 70px; height: 70px; border-radius: 35px; color: #FFF; line-height: 70px; text-align: center; font-size: 30px; display: inline-block; margin-right: 30px; float: left; margin-right: 20px;}
.main-point h4 { margin-bottom: 10px; }

/* ==========================================================================
Stats
 ========================================================================== */
.stats h4 {color: #FFF;}
.stats {text-align: center;}
.stats p {color: #FFF; font-size: 22px; margin-bottom: 35px; }
.stats p span {border-bottom: 3px solid #FFF; padding-bottom: 15px; }
.stats i {border-radius: 50%; background: rgba(0,0,0,0.2); width: 110px; height: 110px; line-height: 100px; border: 2px solid rgba(0,0,0,0.1); margin-bottom: 20px;}

/* ==========================================================================
About
 ========================================================================== */
.members-detail {text-align: center; background-color: #FFF; border-radius: 4px; padding-bottom: 30px; margin-top: 30px; transition: all 0.2s ease-in-out; -moz-transition: all 0.2s ease-in-out; -webkit-transition: all 0.2s ease-in-out; -o-transition: all 0.2s ease-in-out; }
.members-detail:hover { -webkit-box-shadow: 0 0 7px rgba(0, 0, 0, 0.1); -moz-box-shadow: 0 0 7px rgba(0, 0, 0, 0.1); box-shadow: 0 0 7px rgba(0, 0, 0, 0.1); cursor: pointer;}
.members-detail h4 { display: inline-block; padding-bottom: 10px; border-bottom: 2px solid #DDD;}
.members-detail img {margin-bottom: 20px; border-radius: 4px 4px 0 0; }
.members-social {display: block;}
.members-social li {display: inline-block;  height: 40px; width: 40px; border:1px solid #EFEFEF; line-height: 40px;}
.members-social li:hover a{color:#31373a;}

/* ==========================================================================
Skills
 ========================================================================== */
.skill { text-align: center;}
.skill h4 {color: #FFF; margin-top: -80px; padding-bottom: 80px; font-size: 14px;}
.knob {font-family: "Raleway", Lucida Sans Unicode, Arial, "Helvetica Neue", Helvetica, sans-serif!important; margin-top: 50px!important;  font-weight: normal!important; font-size: 24px!important;}

/* ==========================================================================
Portfolio
 ========================================================================== */
.hover-details {width: 100%; height: auto; overflow: hidden; position: relative; -moz-transition: all ease 400ms ease-in-out; -webkit-transition: all ease 400ms ease-in-out; -o-transition: all ease 400ms ease-in-out; transition: all ease 400ms ease-in-out; margin-bottom: 40px; }
.hover-details .img-cover { width: 100%; height: 100%; opacity: 0; position: absolute; top: 0; left: 0; background: rgba(0, 168, 214, 0.8); -moz-transition: all ease 400ms ease-in-out; -webkit-transition: all ease 400ms ease-in-out; -o-transition: all ease 400ms ease-in-out; transition: all ease 400ms ease-in-out; border-radius:3px; }
.hover-details > img { width: 100%; height: auto; -moz-transition: all ease 400ms ease-in-out; -webkit-transition: all ease 400ms ease-in-out; -o-transition: all ease 400ms ease-in-out; transition: all ease 400ms ease-in-out;}

.img-zoom { width:50px; height:50px; background-color: #d5512b; line-height: 50px; position: absolute; top: -50%; left: 50%; border-radius: 50%; margin-top: -25px; margin-left:  -25px; -webkit-transition: all ease 400ms ease-in-out; -moz-transition: all ease 400ms ease-in-out; -ms-transition: all ease 400ms ease-in-out; -o-transition: all ease 400ms ease-in-out; transition: all ease 400ms ease-in-out; text-align: center;}
.img-zoom i {color: #FFF;}

.img-cover h3 { width: 100%;	 position: absolute; bottom: -28%; color: #f8f8f8; font-size: 16px; text-align: center;	 padding: 0 10px; -webkit-transition: all 300ms ease-in-out; -moz-transition: all 300ms ease-in-out; -o-transition: all 300ms ease-in-out; -ms-transition: all 300ms ease-in-out; transition: all 300ms ease-in-out;}

.hover-details:hover {cursor: pointer;}
.hover-details:hover > img { transform: scale(1.2); -ms-transform: scale(1.2); -webkit-transform: scale(1.2); -o-transform: scale(1.2); -moz-transform: scale(1.2);}
.hover-details:hover .img-zoom { top: 45%;}
.hover-details:hover .img-cover h3 { bottom: 28%;}
.hover-details:hover .img-cover { opacity: 1;}
.img-zoom:hover { background-color: #333;}

/* ==========================================================================
Testimonials
 ========================================================================== */
.testimonial-inner {text-align: center;}
.testimonial-inner img {margin-bottom: 15px;}
.testimonial-inner p {display: block; position: relative; font-size: 16px;}
.testimonial-inner p::before{  font-family:'FontAwesome'; content:"\f10d"; font-size: 20px; font-weight: bold; padding-right: 30px; font-weight: normal; }
.testimonial-inner small {display: inline-block; border-top: 2px solid #333; padding-top: 10px; font-size: 14px; font-weight: bold;}

/* ==========================================================================
Services
 ========================================================================== */
.services-list {margin-bottom: 40px;}
.services-list i { background-color: #00a8d6; width: 60px; height: 60px; border-radius: 30px; color: #FFF; line-height: 60px; text-align: center; font-size: 30px; display: inline-block; margin-right: 30px; float: left; margin-right: 20px;}

/* ==========================================================================
Contact
 ========================================================================== */
.contact-form input[type="text"], .contact-form textarea { color: #818181; border: 1px solid #dddddd; outline: none; width: 100%; padding: 15px 20px; display: block; margin-bottom: 15px; transition: all 0.2s ease-in-out; -moz-transition: all 0.2s ease-in-out; -webkit-transition: all 0.2s ease-in-out; -o-transition: all 0.2s ease-in-out;  }
.contact-form textarea { min-height: 200px;}
.contact-form button { width: 100%; text-align: center; color: #fff; padding: 15px 0; background: #00a8d6; margin-bottom: 15px; border: none; transition: all 0.2s ease-in-out; -moz-transition: all 0.2s ease-in-out; -webkit-transition: all 0.2s ease-in-out; -o-transition: all 0.2s ease-in-out; text-transform: uppercase; font-weight: bold;}
.contact-form button i { color: #fff; font-size: 24px;}
.contact-form button:hover{ opacity: 0.8;}
.contact-list i {border: 1px solid #DDD; border-radius: 20px; height: 40px; width: 40px; text-align: center; line-height: 40px; margin-right: 10px; margin-bottom: 10px;}

/* ==========================================================================
Google Map
 ========================================================================== */
 #map {height: 400px;}

 /* ==========================================================================
   Video Container
============================================================================ */
.video-container { position:relative;}
.video-container iframe{ width:100%; height: 480px; border:none;}

/* ==========================================================================
Footer
 ========================================================================== */
.nav-footer{
	background-color:#F5F5F5;
}

.nav-footer ul a, .nav-footer ul a.langmenuToggler span{
	color: #555555;
}

.main-footer{
	background: #CCCCCC;
}

.main-footer .legal p{
	color:#353535;
}

.nav-sub-footer li a{
	color:#353535;
}
.nav-sub-footer li a:hover{
	color:#000;
}
.nav-sub-footer ul{
	color:#353535;
}
.main-footer { color: white; position: fixed; bottom: 0; width: 100%; z-index: 99; background: #E00D0D;}
.main-footer .legal { overflow: hidden; *zoom: 1; margin: 0 40px; padding: 20px 0; height: 30px; }
.main-footer .legal p { float: left; font-size: 0.64286em; line-height: 1.77778em; color: #a3a3a3; }

.nav-footer { background: #333; }
.nav-footer ul { margin: 0 40px; }
.nav-footer ul > li { display: block; float: left; padding: 14px 0;}
.nav-footer ul > li.lang { float: right; position: relative; min-width: 100px; text-align: center; }
.nav-footer ul a { font-size: 0.71429em; color: #a3a3a3; margin-right: 70px; text-transform: uppercase; }
.nav-footer ul a.langmenuToggler { cursor: pointer; margin-right: 0; padding-right: 15px; background: url("../images/langToggler-bg.png") 100% 50% no-repeat; }
.nav-footer ul a.langmenuToggler:hover { color: #a3a3a3; }
.nav-footer ul a.langmenuToggler span { color: #fff; }
.nav-footer ul a:hover { color: #be946c; }

.langmenu { position: absolute; top: -100px; left: 0; width: 100%; padding-bottom: 22px; background: url("../images/arrow-bottom.png") 50% 94% no-repeat; display: none; }
.langmenu ul { width: 100%; height: auto; padding: 10px 0; margin: 0; background-color: #2c2c2c; text-align: center; }
.langmenu ul li { float: none; display: inline; padding: 0; }
.langmenu ul a { display: block; margin: 1.5em 0; margin-right: 0; text-transform: none; font-size: 0.85714em; }
.langmenu ul a:hover { color: #c69c6d; }
.langmenu ul a.active { color: #c69c6d; }

.nav-sub-footer { float: right; }
.nav-sub-footer ul { margin-top: 15px; }
.nav-sub-footer li { display: inline-block; margin: 0 1em; }
.nav-sub-footer li.last { margin-right: 0; }
.nav-sub-footer li a { color: #e5e5e5; text-transform: uppercase; font-size: 0.71429em; }
.nav-sub-footer li a:hover { color: #be946c; }

/* ==========================================================================
Social Links
 ========================================================================== */
.social {}
.social li {display: inline-block; width: 35px; height: 35px; border-radius: 3px; text-align: center; line-height: 35px; webkit-transition: background-color 400ms ease-out 0.2s; -moz-transition: background-color 400ms ease-out 0.2s; -o-transition: background-color 400ms ease-out 0.2s; transition: background-color 400ms ease-out 0.2s;}
.social li a { color: #fff; }
.social li.facebook { background: #204385; }
.social li.twitter { background: #2aa9e0; }
.social li.google-plus { background: #d3492c; }
.social li.linkedin { background: #0073b2; }
.social li.skype { background: #00b0f6; }
.social li.youtube { background: #e22d24; }
.social li:hover {background:#31373a; cursor: pointer; }

/* ==========================================================================
Scroll To Top
 ========================================================================== */
a.scroll-up { display: none; position: fixed; right: 10px; bottom: 10px; padding:5px 10px; background: #00a8d6; text-align: center; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; -moz-transition: -moz-transform 0.8s ease-in-out; -o-transition: -o-transform 0.8s ease-in-out; -webkit-transition: -webkit-transform 0.8s ease-in-out; transition: transform 0.8s ease-in-out; -webkit-backface-visibility: hidden;}
a.scroll-up i {color: #FFF;}
a.scroll-up:hover,
a.scroll-up:focus { -moz-transform: scale(1.1, 1.1); -ms-transform: scale(1.1, 1.1); -webkit-transform: scale(1.1, 1.1); transform: scale(1.1, 1.1); background: #31373a;}

/* ---------------------------------------------------------------------- */
/*	Media Queries (to make the layout responsive)
/* ---------------------------------------------------------------------- */

/* ------ Tablet Portrait size to standard 960 (devices and browsers) ------*/
@media only screen and (min-width: 768px) and (max-width: 959px) {

}

/* ------ Mobile Landscape Size to Tablet Portrait (devices and browsers) ------*/
@media only screen and (min-width: 480px) and (max-width: 767px) {
	.menu-right {background: #00A8D6;}
	.navbar-inverse .navbar-toggle {padding: 10px; background: #333;}
	.navbar-inverse .navbar-nav > li > a {text-align: center;}
	.menu-right {float: none;}
	p {}
	h4 {}
	hr { margin: 15px 0;}
	.call-to-action h4 { border: none;}
	.call-to-action h4 strong {display: block; margin-bottom: 10px;}
	.headline h1 {}
	.section {padding: 70px 0;}
	.main-point {margin-bottom: 40px;}
	.stats {margin-bottom: 50px;}
	.services-list i {margin-bottom: 20px;}
	.video-container {margin-bottom: 40px;}
	.members-holder{width:80%; float: none; margin:20px auto;}
}

/* ------ Mobile Portrait Size to Mobile Landscape Size (devices and browsers) ------*/
@media only screen and (max-width: 479px) {
	.menu-right {background: #00A8D6;}
	.navbar-inverse .navbar-toggle {padding: 10px; background: #333;}
	.navbar-inverse .navbar-nav > li > a {text-align: center;}
	.menu-right {float: none;}
	p {font-size: 13px;}
	h4 {font-size: 16px; line-height: 25px;}
	hr { margin: 15px 0;}
	.call-to-action h4 { border: none;}
	.call-to-action h4 strong {display: block; margin-bottom: 10px;}
	.headline h1 {font-size: 30px;}
	.section {padding: 50px 0;}
	.main-point {margin-bottom: 40px; border: none; float: none; width: 100%;}
	.stats {margin-bottom: 50px; float: none; width: 100%;}
	.members-holder{width:80%; float: none; margin:20px auto;}
	.services-list i {margin-bottom: 20px;}
	.video-container {margin-bottom: 40px;}
	.img-cover h3 {display: none;}
	#footer {text-align: center;}
	.copyright {float: none;}
}


text:
Searching in MySQL JSON field in Django

# Challenge

MySQL has introduced JSON fields in MySQL Server 5.7, Currently it works well with [jsonfield](https://github.com/bradjasper/django-jsonfield) for Data Saving and retrieval. The problem that Searching can only be done through LIKE operator which isn't convinent for all function.

# Objective

Creating a new custom lookup operator "has" for Django that will support JSON Search in MySQL.

# Installation

### Install the Package
```sh
$ pip install jsonLookup
```

### Register to JSONFields

```python
from jsonLookup import hasLookup,jcontainsLookup
JSONField.register_lookup(hasLookup)
JSONField.register_lookup(jcontainsLookup)
```

### Write your JSON queries

```python
# Create test objects
User.objects.create(name="Ahmed",properties={"city":"Giza","Address":{"district":"Ahram","Code":11263}})
User.objects.create(name="Mohamed",properties={"city":"Cairo","Address":{"district":"Helipolis","Code":11351}})
# Run first query
q = User.objects.filter(properties__has="$.city=Giza")
print q[0].name
"Ahmed"
# Run Second query
q= User.objects.filter(properties__has="$.Address.Code=11351")
print q[0].name
"Mohamed"
```


text:
import urllib2
import os

def say(text):
	os.system("pico2wave -w speech.wav \"" + text + "\" && play speech.wav")
#os.system("espeak -ven+f4 \"news script running\"")
sources = open("/home/pi/piband/src/newssource.txt")
rope = str(sources.read())
temp = ""
ar = []
for x in rope:
	if x == "\n":
		ar.append(temp)
		temp = ""
	else:
		temp += x
print ar

say("Here are the top headlines from the news sources that you chose today:")
#Parsing the json and reading articles aloud:

for x in ar:
	response = urllib2.urlopen("https://newsapi.org/v1/articles?source=" + x + "&sortBy=top&apiKey=0b048c3a81aa42d08381279c729cefae")
	json = str(response.read())

	json = json[json.index("title") + 8:]
	title = json[0:json.index("\"")]
	print title
	say(title)


text:
(function (global, factory) {
    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core')) :
    typeof define === 'function' && define.amd ? define(['exports', '@angular/core'], factory) :
    (factory((global.ng2Webstorage = global.ng2Webstorage || {}),global.ng.core));
}(this, (function (exports,_angular_core) { 'use strict';

var STORAGE;
(function (STORAGE) {
    STORAGE[STORAGE["local"] = 0] = "local";
    STORAGE[STORAGE["session"] = 1] = "session";
})(STORAGE || (STORAGE = {}));

var LIB_KEY = 'ng2-webstorage';
var LIB_KEY_SEPARATOR = '|';
var STORAGE_NAMES = (_a = {},
    _a[STORAGE.local] = 'local',
    _a[STORAGE.session] = 'session',
    _a
);
var _a;

var CUSTOM_LIB_KEY = LIB_KEY;
var CUSTOM_LIB_KEY_SEPARATOR = LIB_KEY_SEPARATOR;
var KeyStorageHelper = (function () {
    function KeyStorageHelper() {
    }
    KeyStorageHelper.isManagedKey = function (sKey) {
        return sKey.indexOf(CUSTOM_LIB_KEY + CUSTOM_LIB_KEY_SEPARATOR) === 0;
    };
    KeyStorageHelper.retrieveKeysFromStorage = function (storage) {
        return Object.keys(storage).filter(function (key) { return key.indexOf(CUSTOM_LIB_KEY) === 0; });
    };
    KeyStorageHelper.genKey = function (raw) {
        if (typeof raw !== 'string')
            throw Error('attempt to generate a storage key with a non string value');
        return "" + CUSTOM_LIB_KEY + CUSTOM_LIB_KEY_SEPARATOR + raw.toString().toLowerCase();
    };
    KeyStorageHelper.setStorageKeyPrefix = function (key) {
        if (key === void 0) { key = LIB_KEY; }
        CUSTOM_LIB_KEY = key;
    };
    KeyStorageHelper.setStorageKeySeparator = function (separator) {
        if (separator === void 0) { separator = LIB_KEY_SEPARATOR; }
        CUSTOM_LIB_KEY_SEPARATOR = separator;
    };
    return KeyStorageHelper;
}());

var StorageObserverHelper = (function () {
    function StorageObserverHelper() {
    }
    StorageObserverHelper.observe = function (sType, sKey) {
        var oKey = this.genObserverKey(sType, sKey);
        if (oKey in this.observers)
            return this.observers[oKey];
        return this.observers[oKey] = new _angular_core.EventEmitter();
    };
    StorageObserverHelper.emit = function (sType, sKey, value) {
        var oKey = this.genObserverKey(sType, sKey);
        if (oKey in this.observers)
            this.observers[oKey].emit(value);
    };
    StorageObserverHelper.genObserverKey = function (sType, sKey) {
        return sType + "|" + sKey;
    };
    StorageObserverHelper.observers = {};
    return StorageObserverHelper;
}());

var MockStorageHelper = (function () {
    function MockStorageHelper() {
    }
    MockStorageHelper.isSecuredField = function (field) {
        return !!~MockStorageHelper.securedFields.indexOf(field);
    };
    MockStorageHelper.getStorage = function (sType) {
        if (!this.mockStorages[sType])
            this.mockStorages[sType] = MockStorageHelper.generateStorage();
        return this.mockStorages[sType];
    };
    MockStorageHelper.generateStorage = function () {
        var storage = {};
        Object.defineProperties(storage, {
            setItem: {
                writable: false,
                enumerable: false,
                configurable: false,
                value: function (key, value) {
                    if (!MockStorageHelper.isSecuredField(key))
                        this[key] = value;
                },
            },
            getItem: {
                writable: false,
                enumerable: false,
                configurable: false,
                value: function (key) {
                    return !MockStorageHelper.isSecuredField(key) ? this[key] || null : null;
                },
            },
            removeItem: {
                writable: false,
                enumerable: false,
                configurable: false,
                value: function (key) {
                    if (!MockStorageHelper.isSecuredField(key))
                        delete this[key];
                },
            },
            length: {
                enumerable: false,
                configurable: false,
                get: function () {
                    return Object.keys(this).length;
                }
            }
        });
        return storage;
    };
    MockStorageHelper.securedFields = ['setItem', 'getItem', 'removeItem', 'length'];
    MockStorageHelper.mockStorages = {};
    return MockStorageHelper;
}());

var WebStorageHelper = (function () {
    function WebStorageHelper() {
    }
    WebStorageHelper.store = function (sType, sKey, value) {
        this.getStorage(sType).setItem(sKey, JSON.stringify(value));
        this.cached[sType][sKey] = value;
        StorageObserverHelper.emit(sType, sKey, value);
    };
    WebStorageHelper.retrieve = function (sType, sKey) {
        if (this.cached[sType][sKey])
            return this.cached[sType][sKey];
        return this.cached[sType][sKey] = WebStorageHelper.retrieveFromStorage(sType, sKey);
    };
    WebStorageHelper.retrieveFromStorage = function (sType, sKey) {
        var data = null;
        try {
            data = JSON.parse(this.getStorage(sType).getItem(sKey));
        }
        catch (err) {
            console.warn("invalid value for " + sKey);
        }
        return data;
    };
    WebStorageHelper.refresh = function (sType, sKey) {
        if (!KeyStorageHelper.isManagedKey(sKey))
            return;
        var value = WebStorageHelper.retrieveFromStorage(sType, sKey);
        if (value != null && value !== this.cached[sType][sKey]) {
            this.cached[sType][sKey] = value;
            StorageObserverHelper.emit(sType, sKey, value);
        }
    };
    WebStorageHelper.clearAll = function (sType) {
        var _this = this;
        var storage = this.getStorage(sType);
        KeyStorageHelper.retrieveKeysFromStorage(storage)
            .forEach(function (sKey) {
            storage.removeItem(sKey);
            delete _this.cached[sType][sKey];
            StorageObserverHelper.emit(sType, sKey, null);
        });
    };
    WebStorageHelper.clear = function (sType, sKey) {
        this.getStorage(sType).removeItem(sKey);
        delete this.cached[sType][sKey];
        StorageObserverHelper.emit(sType, sKey, null);
    };
    WebStorageHelper.getStorage = function (sType) {
        return this.isStorageAvailable(sType) ? this.getWStorage(sType) : MockStorageHelper.getStorage(sType);
    };
    WebStorageHelper.getWStorage = function (sType) {
        var storage;
        switch (sType) {
            case STORAGE.local:
                storage = localStorage;
                break;
            case STORAGE.session:
                storage = sessionStorage;
                break;
            default:
                throw Error('invalid storage type');
        }
        return storage;
    };
    WebStorageHelper.isStorageAvailable = function (sType) {
        if (typeof this.storageAvailability[sType] === 'boolean')
            return this.storageAvailability[sType];
        var isAvailable = true, storage = this.getWStorage(sType);
        if (typeof storage === 'object') {
            try {
                storage.setItem('test-storage', 'foobar');
                storage.removeItem('test-storage');
            }
            catch (e) {
                isAvailable = false;
            }
        }
        else
            isAvailable = false;
        if (!isAvailable)
            console.warn(STORAGE_NAMES[sType] + " storage unavailable, Ng2Webstorage will use a fallback strategy instead");
        return this.storageAvailability[sType] = isAvailable;
    };
    WebStorageHelper.cached = (_a = {}, _a[STORAGE.local] = {}, _a[STORAGE.session] = {}, _a);
    WebStorageHelper.storageAvailability = (_b = {}, _b[STORAGE.local] = null, _b[STORAGE.session] = null, _b);
    return WebStorageHelper;
    var _a, _b;
}());

var WebStorageService = (function () {
    function WebStorageService(sType) {
        if (sType === void 0) { sType = null; }
        this.sType = sType;
        this.sType = sType;
    }
    WebStorageService.prototype.store = function (raw, value) {
        var sKey = KeyStorageHelper.genKey(raw);
        WebStorageHelper.store(this.sType, sKey, value);
    };
    WebStorageService.prototype.retrieve = function (raw) {
        var sKey = KeyStorageHelper.genKey(raw);
        return WebStorageHelper.retrieve(this.sType, sKey);
    };
    WebStorageService.prototype.clear = function (raw) {
        if (raw)
            WebStorageHelper.clear(this.sType, KeyStorageHelper.genKey(raw));
        else
            WebStorageHelper.clearAll(this.sType);
    };
    WebStorageService.prototype.observe = function (raw) {
        var sKey = KeyStorageHelper.genKey(raw);
        return StorageObserverHelper.observe(this.sType, sKey);
    };
    return WebStorageService;
}());

var __extends = (undefined && undefined.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var LocalStorageService = (function (_super) {
    __extends(LocalStorageService, _super);
    function LocalStorageService() {
        _super.call(this, STORAGE.local);
    }
    LocalStorageService.decorators = [
        { type: _angular_core.Injectable },
    ];
    /** @nocollapse */
    LocalStorageService.ctorParameters = function () { return []; };
    return LocalStorageService;
}(WebStorageService));

var __extends$1 = (undefined && undefined.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var SessionStorageService = (function (_super) {
    __extends$1(SessionStorageService, _super);
    function SessionStorageService() {
        _super.call(this, STORAGE.session);
    }
    SessionStorageService.decorators = [
        { type: _angular_core.Injectable },
    ];
    /** @nocollapse */
    SessionStorageService.ctorParameters = function () { return []; };
    return SessionStorageService;
}(WebStorageService));

var WebstorageConfig = (function () {
    function WebstorageConfig(config) {
        this.prefix = LIB_KEY;
        this.separator = LIB_KEY_SEPARATOR;
        if (config && config.prefix !== undefined) {
            this.prefix = config.prefix;
        }
        if (config && config.separator !== undefined) {
            this.separator = config.separator;
        }
    }
    return WebstorageConfig;
}());

function WebStorage(webSKey, sType) {
    return function (targetedClass, raw) {
        WebStorageDecorator(webSKey, STORAGE.local, targetedClass, raw);
    };
}

function WebStorageDecorator(webSKey, sType, targetedClass, raw) {
    var key = webSKey || raw;
    Object.defineProperty(targetedClass, raw, {
        get: function () {
            var sKey = KeyStorageHelper.genKey(key);
            return WebStorageHelper.retrieve(sType, sKey);
        },
        set: function (value) {
            var sKey = KeyStorageHelper.genKey(key);
            this[sKey] = value;
            WebStorageHelper.store(sType, sKey, value);
        }
    });
}

function LocalStorage(webSKey) {
    return function (targetedClass, raw) {
        WebStorageDecorator(webSKey, STORAGE.local, targetedClass, raw);
    };
}

function SessionStorage(webSKey) {
    return function (targetedClass, raw) {
        WebStorageDecorator(webSKey, STORAGE.session, targetedClass, raw);
    };
}

var WEBSTORAGE_CONFIG = new _angular_core.OpaqueToken('WEBSTORAGE_CONFIG');
var Ng2Webstorage = (function () {
    function Ng2Webstorage(ngZone, config) {
        this.ngZone = ngZone;
        if (config) {
            KeyStorageHelper.setStorageKeyPrefix(config.prefix);
            KeyStorageHelper.setStorageKeySeparator(config.separator);
        }
        this.initStorageListener();
    }
    Ng2Webstorage.forRoot = function (config) {
        return {
            ngModule: Ng2Webstorage,
            providers: [
                {
                    provide: WEBSTORAGE_CONFIG,
                    useValue: config
                },
                {
                    provide: WebstorageConfig,
                    useFactory: provideConfig,
                    deps: [
                        WEBSTORAGE_CONFIG
                    ]
                }
            ]
        };
    };
    Ng2Webstorage.prototype.initStorageListener = function () {
        var _this = this;
        if (window) {
            window.addEventListener('storage', function (event) { return _this.ngZone.run(function () {
                var storage = window.sessionStorage === event.storageArea ? STORAGE.session : STORAGE.local;
                WebStorageHelper.refresh(storage, event.key);
            }); });
        }
    };
    Ng2Webstorage.decorators = [
        { type: _angular_core.NgModule, args: [{
                    declarations: [],
                    providers: [SessionStorageService, LocalStorageService],
                    imports: []
                },] },
    ];
    /** @nocollapse */
    Ng2Webstorage.ctorParameters = function () { return [
        { type: _angular_core.NgZone, },
        { type: WebstorageConfig, decorators: [{ type: _angular_core.Optional }, { type: _angular_core.Inject, args: [WebstorageConfig,] },] },
    ]; };
    return Ng2Webstorage;
}());
function provideConfig(config) {
    return new WebstorageConfig(config);
}
function configure(_a) {
    var _b = _a === void 0 ? { prefix: LIB_KEY, separator: LIB_KEY_SEPARATOR } : _a, prefix = _b.prefix, separator = _b.separator;
    /*@Deprecation*/
    console.warn('[ng2-webstorage:deprecation] The configure method is deprecated since the v1.5.0, consider to use forRoot instead');
    KeyStorageHelper.setStorageKeyPrefix(prefix);
    KeyStorageHelper.setStorageKeySeparator(separator);
}

exports.WEBSTORAGE_CONFIG = WEBSTORAGE_CONFIG;
exports.Ng2Webstorage = Ng2Webstorage;
exports.provideConfig = provideConfig;
exports.configure = configure;
exports.WebstorageConfig = WebstorageConfig;
exports.LocalStorage = LocalStorage;
exports.SessionStorage = SessionStorage;
exports.WebStorage = WebStorage;
exports.WebStorageDecorator = WebStorageDecorator;
exports.WebStorageService = WebStorageService;
exports.LocalStorageService = LocalStorageService;
exports.SessionStorageService = SessionStorageService;

Object.defineProperty(exports, '__esModule', { value: true });

})));


text:
#import <PhotoLibraryServices/PLManagedObject.h>

@interface _PLManagedAlbumList : PLManagedObject
{
}

+ (id)entityInManagedObjectContext:(id)arg1;
+ (id)entityName;
+ (id)insertInManagedObjectContext:(id)arg1;

@end


text:
Contributions from the community are essential in keeping uPortal (any Open Source project really) strong and successful.  While we try to keep requirements for contributing to a minimum, there are a few guidelines we ask that you mind.

## Most importantly

If you're unsure or afraid of _anything_, just ask or submit the issue or pull request anyways. You
won't be yelled at for giving your best effort. The worst that can happen is that you'll be politely
asked to change something. We appreciate any sort of contributions, and don't want a wall of rules
to get in the way of that.

However, for those individuals who want a bit more guidance on the best way to contribute to the
project, read on. This document will cover what we're looking for. By addressing all the points
we're looking for, it raises the chances we can quickly merge or address your contributions.

## Individual Contributor License Agreement

uPortal is an Apereo project.  Apereo requires that contributions be through Individual Contributor License Agreements.  If you wish to make a contribution, you must complete an Individual Contributor License Agreement.  It is through this agreement that you are licensing your contribution to Apereo so that Apereo can then license it to others under uPortal's open source software license.

You can learn more about [Apereo licensing generally][], the [contributor licensing agreements specifically][], and get the actual [Individual Contributor License Agreement form][], as linked.

## Apereo Welcoming Policy

As an Apereo project, participation in uPortal is within the scope of the Apereo Welcoming Policy. cf. [`CODE_OF_CONDUCT.md`][] at the root of this repository.

## Getting Started

If you are just getting started with Git, GitHub and/or contributing to uPortal via GitHub there are a few pre-requisite steps.

*   Make sure you have a [GitHub account](https://github.com/signup/free)
*   [Fork](http://help.github.com/fork-a-repo) the uPortal repository.  As discussed in the linked page, this also includes:
    *   [Set](https://help.github.com/articles/set-up-git) up your local git install
    *   Clone your fork

## Communicate first and often

What contribution are you looking to make?  Whom will this benefit?  Would anyone like to know what you're doing? Can anyone help you design and scope your contribution?  Who can validate that it meets the need?

Your potential bugfix or improvement or new feature should be represented by a GitHub issue in.  (You'll also need this GitHub issue number in your topic branch name and in your commit messages, below.)

You should probably post on [uportal-dev@][] signaling your intentions and inviting early input and feedback.

Perhaps uPortal adopters on [uportal-user@][] will be interested in helping to validate requirements and design?

You may be able to find others to collaborate with for mutual benefit.

## Create the working (topic) branch

Create a "topic" branch on which you will work.  The convention is to name the branch using the GitHub issue number.  If there is not already a GitHub issue covering the work you want to do, create one.  Assuming you will be working from the master branch and working on the GitHub issue `#42`:

```shell
git checkout -b GH-42 master
```

For a more in-depth description of the git workflow check out the
[uPortal Git Workflow](https://wiki.jasig.org/display/UPC/Git+Workflow+for+Non-Committers)

## Code

*   Apply uPortal [code conventions][] and [architecture][].
*   Write automated unit tests exercising existing code you are touching and exercising your new code.  If you are fixing a bug, first write a unit test demonstrating the bug so as to stave off future regression.

uPortal uses [Android Open Source Project (AOSP) Java code style][AOSP Java style].

[You can][google-java-format-gradle-plugin_quickstart] check Java style with `./gradlew verGJF`,
and format Java files with `./gradlew goJF`.

## Collaborate

Consider pushing your changes to a topic branch in your (public) fork of the repository continually as you work, so that others can see what you are doing and can engage with you on it.  Consider commenting on the GitHub issue and/or on the [uportal-dev@][] email thread letting folks know this branch is available for collaboration.

## Commit

*   Make commits of logical units.
*   Be sure to use the GitHub issue key in the commit message.  This is how GitHub will pick up the related commits and display them on the GitHub issue.
*   Make sure you have added the necessary tests for your changes.
*   Run _all_ the tests to assure nothing else was accidentally broken.

_Prior to committing, if you want to pull in the latest upstream changes  (highly appreciated btw), please use [rebasing](https://www.atlassian.com/git/tutorials/merging-vs-rebasing) rather than merging.  Merging creates "merge commits" that really muck up the project timeline._

## Test

If your changes are not user-facing, consider writing unit tests. To run unit tests use:

```shell
./gradlew check
```

If your change is to a user-facing experience, it should not regress support for [supported browser versions](SUPPORTED_BROWSERS.md).

## Submit

*   You submitted a [Contributor License Agreement][], right?  Seriously, Apereo cannot accept your contribution other than under a Contributor License Agreement.
*   Push your changes to a topic branch in your fork of the repository.
*   Initiate a [pull request](http://help.github.com/send-pull-requests/).  Name the Pull Request prefixed with the issue identifier (e.g., "UP-4148 Update contributing guidance").  Mention and link the GitHub issue in the first couple lines of your Pull Request description so it's very convenient for reviewers to get to the GitHub issue from your pull request.  Use the pull request as another opportunity to communicate effectively about what is being changed.  Can your change be shown in before and after screenshots?  Did you make interesting implementation decisions or tradeoffs?
*   Update the GitHub issue, adding a comment including a link to the created pull request.  If the problem or improvement came to be better understood through implementation, update the description and add comments to communicate what was learned.  A release engineer will rely upon the GitHub to summarize release notes for the release including your change and those release notes will link to the GitHub issue, so the GitHub issue as a good place to communicate clearly about _what_ was changed _why_ and _how_.

## Acknowledgements

* Portions of these contributing guidelines inspired by
  [HashiCorp packer contributing guidelines][].

[Apereo licensing generally]: http://www.apereo.org/licensing
[contributor licensing agreements specifically]: http://www.apereo.org/licensing/agreements
[Contributor License Agreement]: http://www.apereo.org/licensing/agreements
[Individual Contributor License Agreement form]: https://www.apereo.org/licensing/agreements/icla

[`CODE_OF_CONDUCT.md`]: CODE_OF_CONDUCT.md

[uportal-dev@]: https://wiki.jasig.org/display/JSG/uportal-dev
[uportal-user@]: https://wiki.jasig.org/display/JSG/uportal-user

[code conventions]: https://wiki.jasig.org/display/UPM41/Code+Styles+and+Conventions
[AOSP Java style]: https://source.android.com/setup/contribute/code-style

[google-java-format-gradle-plugin_quickstart]: https://github.com/sherter/google-java-format-gradle-plugin#quick-start

[architecture]: https://wiki.jasig.org/pages/viewpage.action?pageId=65274379

[HashiCorp packer contributing guidelines]: https://github.com/hashicorp/packer/commit/87edf671771680e0989798a3460ff00453b9aa89#diff-6a3371457528722a734f3c51d9238c13


text:
<?xml version="1.0" encoding="UTF-8"?>

<channel name="thunar" version="1.0">
  <property name="last-view" type="string" value="ThunarDetailsView"/>
  <property name="last-icon-view-zoom-level" type="string" value="THUNAR_ZOOM_LEVEL_NORMAL"/>
  <property name="last-window-maximized" type="bool" value="true"/>
  <property name="last-window-width" type="int" value="1278"/>
  <property name="last-window-height" type="int" value="1383"/>
  <property name="last-separator-position" type="int" value="170"/>
  <property name="misc-single-click" type="bool" value="false"/>
  <property name="misc-text-beside-icons" type="bool" value="false"/>
  <property name="misc-file-size-binary" type="bool" value="false"/>
  <property name="shortcuts-icon-emblems" type="bool" value="true"/>
  <property name="shortcuts-icon-size" type="string" value="THUNAR_ICON_SIZE_SMALLEST"/>
  <property name="last-location-bar" type="string" value="ThunarLocationEntry"/>
  <property name="last-side-pane" type="string" value="ThunarTreePane"/>
  <property name="last-show-hidden" type="bool" value="true"/>
  <property name="last-details-view-zoom-level" type="string" value="THUNAR_ZOOM_LEVEL_38_PERCENT"/>
  <property name="last-details-view-column-widths" type="string" value="50,182,50,50,2077,50,50,63,66,67"/>
  <property name="last-sort-column" type="string" value="THUNAR_COLUMN_NAME"/>
  <property name="last-sort-order" type="string" value="GTK_SORT_ASCENDING"/>
  <property name="misc-directory-specific-settings" type="bool" value="true"/>
  <property name="misc-date-style" type="string" value="THUNAR_DATE_STYLE_SHORT"/>
</channel>


text:
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 2.0.0
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

namespace RakNet {

using System;
using System.Runtime.InteropServices;
#pragma warning disable 0660

public class SystemAddress : IDisposable {
  private HandleRef swigCPtr;
  protected bool swigCMemOwn;

  internal SystemAddress(IntPtr cPtr, bool cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = new HandleRef(this, cPtr);
  }

  internal static HandleRef getCPtr(SystemAddress obj) {
    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  }

  ~SystemAddress() {
    Dispose();
  }

  public virtual void Dispose() {
    lock(this) {
      if (swigCPtr.Handle != IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          RakNetPINVOKE.delete_SystemAddress(swigCPtr);
        }
        swigCPtr = new HandleRef(null, IntPtr.Zero);
      }
      GC.SuppressFinalize(this);
    }
  }

	public override int GetHashCode()
	{
		// return (int)((this.port+this.binaryAddress)% int.MaxValue);
		return (int) ToInteger(this);
	}
	public static bool operator ==(SystemAddress a, SystemAddress b)
	{
 	   	// If both are null, or both are same instance, return true.
 		if (System.Object.ReferenceEquals(a, b))
 		{
 	       		return true;
 	   	}

  		// If one is null, but not both, return false.
   	 	if (((object)a == null) || ((object)b == null))
    		{
       		 	return false;
    		}

		    return a.Equals(b);//Equals should be overloaded as well
	}

	public static bool operator !=(SystemAddress a, SystemAddress b)
	{
   		 return a.OpNotEqual(b);
	}

	public static bool operator < (SystemAddress a, SystemAddress b)
	{
    		return a.OpLess(b);
	}

	public static bool operator >(SystemAddress a, SystemAddress b)
	{
		return a.OpGreater(b);
	}

	public static bool operator <=(SystemAddress a, SystemAddress b)
	{
		return (a.OpLess(b) || a==b);
	}

	public static bool operator >=(SystemAddress a, SystemAddress b)
	{
		return (a.OpGreater(b) || a==b);
	}

	public override string ToString()
	{
		return ToString(true);
	}

	public void ToString(bool writePort,out string dest)
	{
		dest=ToString(writePort);
	}

  public SystemAddress() : this(RakNetPINVOKE.new_SystemAddress__SWIG_0(), true) {
  }

  public SystemAddress(string str) : this(RakNetPINVOKE.new_SystemAddress__SWIG_1(str), true) {
  }

  public SystemAddress(string str, ushort port) : this(RakNetPINVOKE.new_SystemAddress__SWIG_2(str, port), true) {
  }

  public ushort debugPort {
    set {
      RakNetPINVOKE.SystemAddress_debugPort_set(swigCPtr, value);
    }
    get {
      ushort ret = RakNetPINVOKE.SystemAddress_debugPort_get(swigCPtr);
      return ret;
    }
  }

  public static int size() {
    int ret = RakNetPINVOKE.SystemAddress_size();
    return ret;
  }

  public static uint ToInteger(SystemAddress sa) {
    uint ret = RakNetPINVOKE.SystemAddress_ToInteger(SystemAddress.getCPtr(sa));
    if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public byte GetIPVersion() {
    byte ret = RakNetPINVOKE.SystemAddress_GetIPVersion(swigCPtr);
    return ret;
  }

  public uint GetIPPROTO() {
    uint ret = RakNetPINVOKE.SystemAddress_GetIPPROTO(swigCPtr);
    return ret;
  }

  public void SetToLoopback() {
    RakNetPINVOKE.SystemAddress_SetToLoopback__SWIG_0(swigCPtr);
  }

  public void SetToLoopback(byte ipVersion) {
    RakNetPINVOKE.SystemAddress_SetToLoopback__SWIG_1(swigCPtr, ipVersion);
  }

  public bool IsLoopback() {
    bool ret = RakNetPINVOKE.SystemAddress_IsLoopback(swigCPtr);
    return ret;
  }

  public string ToString(bool writePort, char portDelineator) {
    string ret = RakNetPINVOKE.SystemAddress_ToString__SWIG_0(swigCPtr, writePort, portDelineator);
    return ret;
  }

  public string ToString(bool writePort) {
    string ret = RakNetPINVOKE.SystemAddress_ToString__SWIG_1(swigCPtr, writePort);
    return ret;
  }

  public void ToString(bool writePort, string dest, char portDelineator) {
    RakNetPINVOKE.SystemAddress_ToString__SWIG_2(swigCPtr, writePort, dest, portDelineator);
  }

  public bool FromString(string str, char portDelineator, int ipVersion) {
    bool ret = RakNetPINVOKE.SystemAddress_FromString__SWIG_0(swigCPtr, str, portDelineator, ipVersion);
    return ret;
  }

  public bool FromString(string str, char portDelineator) {
    bool ret = RakNetPINVOKE.SystemAddress_FromString__SWIG_1(swigCPtr, str, portDelineator);
    return ret;
  }

  public bool FromString(string str) {
    bool ret = RakNetPINVOKE.SystemAddress_FromString__SWIG_2(swigCPtr, str);
    return ret;
  }

  public bool FromStringExplicitPort(string str, ushort port, int ipVersion) {
    bool ret = RakNetPINVOKE.SystemAddress_FromStringExplicitPort__SWIG_0(swigCPtr, str, port, ipVersion);
    return ret;
  }

  public bool FromStringExplicitPort(string str, ushort port) {
    bool ret = RakNetPINVOKE.SystemAddress_FromStringExplicitPort__SWIG_1(swigCPtr, str, port);
    return ret;
  }

  public void CopyPort(SystemAddress right) {
    RakNetPINVOKE.SystemAddress_CopyPort(swigCPtr, SystemAddress.getCPtr(right));
    if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  }

  public bool EqualsExcludingPort(SystemAddress right) {
    bool ret = RakNetPINVOKE.SystemAddress_EqualsExcludingPort(swigCPtr, SystemAddress.getCPtr(right));
    if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public ushort GetPort() {
    ushort ret = RakNetPINVOKE.SystemAddress_GetPort(swigCPtr);
    return ret;
  }

  public ushort GetPortNetworkOrder() {
    ushort ret = RakNetPINVOKE.SystemAddress_GetPortNetworkOrder(swigCPtr);
    return ret;
  }

  public void SetPortHostOrder(ushort s) {
    RakNetPINVOKE.SystemAddress_SetPortHostOrder(swigCPtr, s);
  }

  public void SetPortNetworkOrder(ushort s) {
    RakNetPINVOKE.SystemAddress_SetPortNetworkOrder(swigCPtr, s);
  }

  public bool SetBinaryAddress(string str, char portDelineator) {
    bool ret = RakNetPINVOKE.SystemAddress_SetBinaryAddress__SWIG_0(swigCPtr, str, portDelineator);
    return ret;
  }

  public bool SetBinaryAddress(string str) {
    bool ret = RakNetPINVOKE.SystemAddress_SetBinaryAddress__SWIG_1(swigCPtr, str);
    return ret;
  }

  public void ToString_Old(bool writePort, string dest, char portDelineator) {
    RakNetPINVOKE.SystemAddress_ToString_Old__SWIG_0(swigCPtr, writePort, dest, portDelineator);
  }

  public void ToString_Old(bool writePort, string dest) {
    RakNetPINVOKE.SystemAddress_ToString_Old__SWIG_1(swigCPtr, writePort, dest);
  }

  public void FixForIPVersion(SystemAddress boundAddressToSocket) {
    RakNetPINVOKE.SystemAddress_FixForIPVersion(swigCPtr, SystemAddress.getCPtr(boundAddressToSocket));
    if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
  }

  public bool IsLANAddress() {
    bool ret = RakNetPINVOKE.SystemAddress_IsLANAddress(swigCPtr);
    return ret;
  }

  public SystemAddress CopyData(SystemAddress input) {
    SystemAddress ret = new SystemAddress(RakNetPINVOKE.SystemAddress_CopyData(swigCPtr, SystemAddress.getCPtr(input)), false);
    if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public bool Equals(SystemAddress right) {
    bool ret = RakNetPINVOKE.SystemAddress_Equals(swigCPtr, SystemAddress.getCPtr(right));
    if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  private bool OpNotEqual(SystemAddress right) {
    bool ret = RakNetPINVOKE.SystemAddress_OpNotEqual(swigCPtr, SystemAddress.getCPtr(right));
    if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  private bool OpGreater(SystemAddress right) {
    bool ret = RakNetPINVOKE.SystemAddress_OpGreater(swigCPtr, SystemAddress.getCPtr(right));
    if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  private bool OpLess(SystemAddress right) {
    bool ret = RakNetPINVOKE.SystemAddress_OpLess(swigCPtr, SystemAddress.getCPtr(right));
    if (RakNetPINVOKE.SWIGPendingException.Pending) throw RakNetPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public ushort systemIndex {
    set {
      RakNetPINVOKE.SystemAddress_systemIndex_set(swigCPtr, value);
    }
    get {
      ushort ret = RakNetPINVOKE.SystemAddress_systemIndex_get(swigCPtr);
      return ret;
    }
  }

}

}