text:
package org.axonframework.eventsourcing;

import org.axonframework.eventhandling.DomainEventMessage;
import org.axonframework.eventhandling.EventMessage;
import org.axonframework.eventhandling.GenericDomainEventMessage;
import org.axonframework.eventsourcing.eventstore.DomainEventStream;
import org.axonframework.eventsourcing.eventstore.EventStore;
import org.axonframework.eventsourcing.utils.StubDomainEvent;
import org.axonframework.messaging.GenericMessage;
import org.axonframework.messaging.unitofwork.CurrentUnitOfWork;
import org.axonframework.messaging.unitofwork.DefaultUnitOfWork;
import org.axonframework.messaging.unitofwork.UnitOfWork;
import org.axonframework.modelling.command.Aggregate;
import org.axonframework.modelling.command.AggregateIdentifier;
import org.axonframework.modelling.command.AggregateLifecycle;
import org.axonframework.modelling.command.AggregateRoot;
import org.axonframework.modelling.command.ConflictingAggregateVersionException;
import org.junit.jupiter.api.*;
import org.mockito.*;

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

import static org.axonframework.messaging.MetaData.emptyInstance;
import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.*;

/**
 * @author Allard Buijze
 */
class EventSourcingRepositoryTest {

    private EventStore mockEventStore;
    private EventSourcingRepository<TestAggregate> testSubject;
    private UnitOfWork<?> unitOfWork;
    private StubAggregateFactory stubAggregateFactory;
    private SnapshotTriggerDefinition triggerDefinition;
    private SnapshotTrigger snapshotTrigger;

    @BeforeEach
    void setUp() {
        mockEventStore = mock(EventStore.class);
        stubAggregateFactory = new StubAggregateFactory();
        snapshotTrigger = mock(SnapshotTrigger.class);
        triggerDefinition = mock(SnapshotTriggerDefinition.class);
        when(triggerDefinition.prepareTrigger(any())).thenReturn(snapshotTrigger);
        testSubject = EventSourcingRepository.builder(TestAggregate.class)
                                             .aggregateFactory(stubAggregateFactory)
                                             .eventStore(mockEventStore)
                                             .snapshotTriggerDefinition(triggerDefinition)
                                             .filterByAggregateType()
                                             .build();
        unitOfWork = DefaultUnitOfWork.startAndGet(new GenericMessage<>("test"));
    }

    @AfterEach
    void tearDown() {
        if (unitOfWork.isActive()) {
            unitOfWork.rollback();
        }
    }

    @Test
    void testLoadAndSaveAggregate() {
        String identifier = UUID.randomUUID().toString();
        DomainEventMessage event1 =
                new GenericDomainEventMessage<>("type", identifier, (long) 1, "Mock contents", emptyInstance());
        DomainEventMessage event2 =
                new GenericDomainEventMessage<>("type", identifier, (long) 2, "Mock contents", emptyInstance());
        when(mockEventStore.readEvents(identifier)).thenReturn(DomainEventStream.of(event1, event2));

        Aggregate<TestAggregate> aggregate = testSubject.load(identifier, null);

        assertEquals(2, aggregate.invoke(TestAggregate::getHandledEvents).size());
        assertSame(event1, aggregate.invoke(TestAggregate::getHandledEvents).get(0));
        assertSame(event2, aggregate.invoke(TestAggregate::getHandledEvents).get(1));

        assertEquals(0, aggregate.invoke(TestAggregate::getLiveEvents).size());

        // now the aggregate is loaded (and hopefully correctly locked)
        StubDomainEvent event3 = new StubDomainEvent();

        aggregate.execute(r -> r.apply(event3));

        CurrentUnitOfWork.commit();

        verify(mockEventStore, times(1)).publish((EventMessage) any());
        assertEquals(1, aggregate.invoke(TestAggregate::getLiveEvents).size());
        assertSame(event3, aggregate.invoke(TestAggregate::getLiveEvents).get(0).getPayload());
    }

    @Test
    void testFilterEventsByType() {
        String identifier = UUID.randomUUID().toString();
        DomainEventMessage event1 =
                new GenericDomainEventMessage<>("type", identifier, (long) 1, "Mock contents", emptyInstance());
        DomainEventMessage event2 =
                new GenericDomainEventMessage<>("otherType", identifier, (long) 1, "Other contents", emptyInstance());
        when(mockEventStore.readEvents(identifier)).thenReturn(DomainEventStream.of(event1, event2));

        Aggregate<TestAggregate> aggregate = testSubject.load(identifier, null);

        assertEquals(1, aggregate.invoke(TestAggregate::getHandledEvents).size());
        assertSame(event1, aggregate.invoke(TestAggregate::getHandledEvents).get(0));

        assertEquals(0, aggregate.invoke(TestAggregate::getLiveEvents).size());
    }

    @Test
    void testLoad_FirstEventIsSnapshot() {
        String identifier = UUID.randomUUID().toString();
        TestAggregate aggregate = new TestAggregate(identifier);
        when(mockEventStore.readEvents(identifier)).thenReturn(
                DomainEventStream.of(new GenericDomainEventMessage<>("type", identifier, 10, aggregate)));
        assertSame(aggregate, testSubject.load(identifier).getWrappedAggregate().getAggregateRoot());
    }

    @Test
    void testLoadWithConflictingChanges() {
        String identifier = UUID.randomUUID().toString();
        when(mockEventStore.readEvents(identifier)).thenReturn(DomainEventStream.of(
                new GenericDomainEventMessage<>("type", identifier, (long) 1, "Mock contents", emptyInstance()),
                new GenericDomainEventMessage<>("type", identifier, (long) 2, "Mock contents", emptyInstance()),
                new GenericDomainEventMessage<>("type", identifier, (long) 3, "Mock contents", emptyInstance())
        ));

        testSubject.load(identifier, 1L);
        try {
            CurrentUnitOfWork.commit();
            fail("Expected ConflictingAggregateVersionException");
        } catch (ConflictingAggregateVersionException e) {
            assertEquals(identifier, e.getAggregateIdentifier());
            assertEquals(1L, e.getExpectedVersion());
            assertEquals(3L, e.getActualVersion());
        }
    }

    @Test
    void testLoadWithConflictingChanges_NoConflictResolverSet_UsingTooHighExpectedVersion() {
        String identifier = UUID.randomUUID().toString();
        when(mockEventStore.readEvents(identifier)).thenReturn(DomainEventStream.of(
                new GenericDomainEventMessage<>("type", identifier, (long) 1, "Mock contents", emptyInstance()),
                new GenericDomainEventMessage<>("type", identifier, (long) 2, "Mock contents", emptyInstance()),
                new GenericDomainEventMessage<>("type", identifier, (long) 3, "Mock contents", emptyInstance())
        ));

        try {
            testSubject.load(identifier, 100L);
            fail("Expected ConflictingAggregateVersionException");
        } catch (ConflictingAggregateVersionException e) {
            assertEquals(identifier, e.getAggregateIdentifier());
            assertEquals(100L, e.getExpectedVersion());
            assertEquals(3L, e.getActualVersion());
        }
    }

    @Test
    void testLoadEventsWithSnapshotter() {
        String identifier = UUID.randomUUID().toString();
        when(mockEventStore.readEvents(identifier)).thenReturn(DomainEventStream.of(
                new GenericDomainEventMessage<>("type", identifier, (long) 1, "Mock contents", emptyInstance()),
                new GenericDomainEventMessage<>("type", identifier, (long) 2, "Mock contents", emptyInstance()),
                new GenericDomainEventMessage<>("type", identifier, (long) 3, "Mock contents", emptyInstance())
        ));
        Aggregate<TestAggregate> aggregate = testSubject.load(identifier);
        aggregate.execute(r -> r.apply(new StubDomainEvent()));
        aggregate.execute(r -> r.apply(new StubDomainEvent()));

        InOrder inOrder = Mockito.inOrder(triggerDefinition, snapshotTrigger);
        inOrder.verify(triggerDefinition).prepareTrigger(stubAggregateFactory.getAggregateType());
        inOrder.verify(snapshotTrigger, times(3)).eventHandled(any());
        inOrder.verify(snapshotTrigger).initializationFinished();
        inOrder.verify(snapshotTrigger, times(2)).eventHandled(any());
    }

    private static class StubAggregateFactory extends AbstractAggregateFactory<TestAggregate> {

        public StubAggregateFactory() {
            super(TestAggregate.class);
        }

        @Override
        public TestAggregate doCreateAggregate(String aggregateIdentifier, DomainEventMessage firstEvent) {
            return new TestAggregate(aggregateIdentifier);
        }

        @Override
        public Class<TestAggregate> getAggregateType() {
            return TestAggregate.class;
        }
    }

    @AggregateRoot(type = "type")
    private static class TestAggregate {

        private List<EventMessage<?>> handledEvents = new ArrayList<>();
        private List<EventMessage<?>> liveEvents = new ArrayList<>();

        @AggregateIdentifier
        private String identifier;

        private TestAggregate(String identifier) {
            this.identifier = identifier;
        }

        public void apply(Object eventPayload) {
            AggregateLifecycle.apply(eventPayload);
        }

        public void changeState() {
            AggregateLifecycle.apply("Test more");
        }

        @EventSourcingHandler
        protected void handle(EventMessage event) {
            identifier = ((DomainEventMessage<?>) event).getAggregateIdentifier();
            handledEvents.add(event);
            if (AggregateLifecycle.isLive()) {
                liveEvents.add(event);
            }
        }

        public List<EventMessage<?>> getHandledEvents() {
            return handledEvents;
        }

        public List<EventMessage<?>> getLiveEvents() {
            return liveEvents;
        }

        public String getIdentifier() {
            return identifier;
        }
    }
}


text:
@implementation XBL_storageLanguage

@dynamic shortname;
@dynamic name;
@dynamic support;

+ (void)addText:(NSDictionary *)item
{
    NSArray * matched = [XBL_storageLanguage getFormat:@"shortname=%@" argument:@[item[@"name"]]];

    XBL_storageLanguage *text = nil;
    if ([matched count] > 0)
    {
        text = [matched lastObject];
    }
    else
    {
        text  = [NSEntityDescription insertNewObjectForEntityForName:@"XBL_storageLanguage" inManagedObjectContext:[[XBLanguage sharedInstance] managedObjectContext]];
    }
    text.name = item[@"name"];
    text.shortname = item[@"shortname"];
    text.support = item[@"support"] != [NSNull null] ? item[@"support"] : @"";
    [[XBLanguage sharedInstance] saveContext];
}

+ (NSArray *)getFormat:(NSString *)format argument:(NSArray *)argument
{
    NSEntityDescription *ed = [NSEntityDescription entityForName:@"XBL_storageLanguage" inManagedObjectContext:[[XBLanguage sharedInstance] managedObjectContext]];
    NSFetchRequest *fr = [[NSFetchRequest alloc] init];
    [fr setEntity:ed];

    NSPredicate *p1 = [NSPredicate predicateWithFormat:format argumentArray:argument];
    [fr setPredicate:p1];

    NSArray *result = [[[XBLanguage sharedInstance] managedObjectContext] executeFetchRequest:fr error:nil];
    return result;
}

+ (NSArray *)getAll
{
    NSEntityDescription *ed = [NSEntityDescription entityForName:@"XBL_storageLanguage" inManagedObjectContext:[[XBLanguage sharedInstance] managedObjectContext]];
    NSFetchRequest *fr = [[NSFetchRequest alloc] init];
    [fr setEntity:ed];

    NSArray *result = [[[XBLanguage sharedInstance] managedObjectContext] executeFetchRequest:fr error:nil];
    return result;
}

+ (void)clean
{
    NSArray *all = [XBL_storageLanguage getAll];
    for (XBL_storageLanguage *language in all)
    {
        [[[XBLanguage sharedInstance] managedObjectContext] deleteObject:language];
    }
    [[XBLanguage sharedInstance] saveContext];
}

@end

redpajama_set_name: RedPajamaGithub


text:
package com.parse.starter;

import android.graphics.Bitmap;
import android.media.Image;

import com.parse.ParseClassName;
import com.parse.ParseObject;
import com.parse.ParseUser;

import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.media.Image;
import android.widget.ImageView;

import com.parse.ParseACL;
import com.parse.ParseClassName;
import com.parse.ParseFile;
import com.parse.ParseObject;
import com.parse.ParseUser;

/**
 * Created by Zachary on 11/6/2015.
 */

@ParseClassName("photoFile")
public class photoFile extends ParseObject {

        Bitmap userImage, img2;
        byte[] img1, userImg;
        int voteForimg1, voteForimg2;
        String userName;
        String userComment;

        public photoFile(){

        }

    /*
        public photoFile( ParseFile file){  //byte[] userPic, Bitmap img1, Bitmap img2,
            //this.userImage = userPic;
            ParseFile photo = file;
            //this.img2 = img2;

        }

*/

        public void setImages(Bitmap image, Bitmap image2){

            img2 = image2;
        }

    /**
        public void setImg1(byte[] image){
            put("imageTest", image);
            img1 = image;
        }

        public void updateVoteForimg1(){
            voteForimg1 += 1;
        }
**/
        public byte[] getImg1() {
            return img1;
        }

        public Bitmap getImg2() {
            return img2;
        }
/**
        public int getVoteForimg1() {
            return voteForimg1;
        }

        public String getUserName() {
            return userName;
        }
**/
        public byte[] getUserPicture(){
            return userImg;
        }
/**
        public void setUserName(String userName){
            this.userName = userName;
        }
**/
        public void setUserPicture(ParseFile photo){
            put("profilePicture", photo);
        }

/**
        public String getDisplayName() {
            return getString("displayName");
        }
        public void setDisplayName(String displayName) {
            put("displayName", displayName);
        }
**/
        public ParseUser getOwner() {
            return getParseUser("owner");
        }
        public void setOwner(ParseUser user) {
            put("owner", user);
        }

/**
        public void setVote1(int voteForimg1) {
            put("voteImage1", voteForimg1);
        }

        public void putImage(Image img){
            put("Image", img);
        }

        public int getVote(){
            return 1;
        }

**/

    }


text:
/* ---------------------------------------------------------------------- */
/*  MediaElement.js
/* ---------------------------------------------------------------------- */

.audio-player,
.audio-player div,
.audio-player h1,
.audio-player a,
.audio-player img,
.audio-player span,
.audio-player button {
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
}

.audio-player {
    position:relative;
    width:700px;
    height:40px;
    background:#444;
    overflow:hidden;
}

/* Buttons */
.mejs-controls .mejs-button button {
    cursor:pointer;
    display:block;
    position:absolute;
    text-indent:-9999px;
}

/* Play & Pause */
.mejs-controls .mejs-play button,
.mejs-controls .mejs-pause button {
    width:40px;
    height:40px;
    top:0;
    left:0;
    background:url(../images/audio-play-pause.png) 0 0;
}

.mejs-controls .mejs-pause button { background-position:0 -40px; }

/* Mute & Unmute */
.mejs-controls .mejs-mute button,
.mejs-controls .mejs-unmute button {
    width:40px;
    height:40px;
    top:0;
    left:535px;
    background:url(../images/audio-volume.png) 0 0;
}

.mejs-controls .mejs-unmute button { background-position: 0 -40px; }

/* Volume Slider */
.mejs-controls .mejs-horizontal-volume-slider {
    position:absolute;
    top:15px;
    left:575px;
    cursor:pointer;
}

.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total {
    width:115px;
    height:10px;
    background:#e4e4e4;
}

.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current {
    position:absolute;
    width:0;
    height:10px;
    top:0;
    left:0;
    background:#ff674f;
}

/* Progress Slider */
.mejs-controls .mejs-time-rail { width:480px; }

.mejs-controls .mejs-time-rail span {
    position:absolute;
    display:block;
    width:480px;
    height:10px;
    top:15px;
    left:45px;
    cursor:pointer;
}

.mejs-controls .mejs-time-rail .mejs-time-total { background:#e4e4e4; }

.mejs-controls .mejs-time-rail .mejs-time-loaded {
    top:0;
    left:0;
    width:0;
    background:#cccccc;
}

.mejs-controls .mejs-time-rail .mejs-time-current {
    top:0;
    left:0;
    width:0;
    background:#ff674f;
}

.mejs-time-float { display:none !important; }

.recent-posts .audio-player { width:300px; margin:31px 0 32px; }

.recent-posts .mejs-controls .mejs-mute button,
.recent-posts .mejs-controls .mejs-unmute button { left:185px; }

.recent-posts .mejs-controls .mejs-horizontal-volume-slider { left:225px; }

.recent-posts .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total { width:65px; }

.recent-posts .mejs-controls .mejs-time-rail { width:130px; }

.recent-posts .mejs-controls .mejs-time-rail span { width:130px; }

/* ---------------------------------------------------------------------- */
/*  FlexSlider
/* ---------------------------------------------------------------------- */

/* Browser Resets */
.flex-container a:active,
.flexslider a:active,
.flex-container a:focus,
.flexslider a:focus  {outline: none;}
.slides,
.flex-control-nav,
.flex-direction-nav {margin: 0; padding: 0; list-style: none;}

/* FlexSlider Necessary Styles
*********************************/
.slider {margin: 0 0 10px; float:left; width:100%;}
.flexslider {margin: 0; padding: 0;}
.flexslider .slides > li {display: none; -webkit-backface-visibility: hidden;} /* Hide the slides before the JS is loaded. Avoids image jumping */
.flexslider .slides img {width: 100%; display: block;}
.flex-pauseplay span {text-transform: capitalize;}

/* Clearfix for the .slides element */
.slides:after {content: "."; display: block; clear: both; visibility: hidden; line-height: 0; height: 0;}
html[xmlns] .slides {display: block;}
* html .slides {height: 1%;}

/* No JavaScript Fallback */
/* If you are not using another script, such as Modernizr, make sure you
 * include js that eliminates this class on page load */
.no-js .slides > li:first-child {display: block;}

/* FlexSlider Default Theme
*********************************/
.flexslider {position: relative; zoom: 1;}
.flex-viewport {max-height: 2000px; -webkit-transition: all 1s ease; -moz-transition: all 1s ease; transition: all 1s ease;}
.loading .flex-viewport {max-height: 300px;}
.flexslider .slides {zoom: 1;}

.carousel li {margin-right: 5px}

/* Direction Nav */
.flex-direction-nav {*height: 0;}
.flex-direction-nav a {width: 30px; height: 30px; display: block; background: #333 url(../images/arrow_nav.png) no-repeat -1px 0; position: absolute; top:20px; cursor: pointer; text-indent: -9999px; -webkit-border-radius:3px; -moz-border-radius:3px; border-radius:3px; -webkit-transition:background-color .3s; -moz-transition:background-color .3s; -ms-transition:background-color .3s; -o-transition:background-color .3s; transition:background-color .3s;}
.flex-direction-nav .flex-next {background-position:-30px 0; right:20px; }
.flex-direction-nav .flex-prev {left:20px;}
.flexslider:hover .flex-next:hover, .flexslider:hover .flex-prev:hover {background-color:#ff674f;}
.flex-direction-nav .flex-disabled {cursor: default;}

/* Control Nav */
.flex-control-nav {width: 100%; position: absolute; bottom: -40px; text-align: center;}
.flex-control-nav li {margin: 0 6px; display: inline-block; zoom: 1; *display: inline;}
.flex-control-paging li a {width: 11px; height: 11px; display: block; background: #666; background: rgba(0,0,0,0.5); cursor: pointer; text-indent: -9999px; -webkit-border-radius: 20px; -moz-border-radius: 20px; -o-border-radius: 20px; border-radius: 20px; box-shadow: inset 0 0 3px rgba(0,0,0,0.3);}
.flex-control-paging li a:hover { background: #333; background: rgba(0,0,0,0.7); }
.flex-control-paging li a.flex-active { background: #000; background: rgba(0,0,0,0.9); cursor: default; }

.flex-control-thumbs {margin: 5px 0 0; position: static; overflow: hidden;}
.flex-control-thumbs li {width: 25%; float: left; margin: 0;}
.flex-control-thumbs img {width: 100%; display: block; opacity: .7; cursor: pointer;}
.flex-control-thumbs img:hover {opacity: 1;}
.flex-control-thumbs .flex-active {opacity: 1; cursor: default;}

/* Caption */
.flexslider .caption {
	opacity:0;
	position:absolute;
	bottom:20px;
	padding:15px 35px 15px 20px;
	background:rgba(0,0,0,.65);
	-webkit-transition:opacity .8s;
	   -moz-transition:opacity .8s;
	    -ms-transition:opacity .8s;
	     -o-transition:opacity .8s;
	        transition:opacity .8s;
}

.flexslider .caption.left  { left:0; border-right:5px solid #ff674f; }
.flexslider .caption.right { right:0; border-left:5px solid #ff674f; }

.flexslider .caption * { color:#ffffff; margin:0; }
.flexslider .caption p { color:#a4a4a4; }

.flexslider .caption .body { float:left; max-width:400px; }

.flexslider .caption .meta { float:right; margin:0 0 0 35px; }

.flexslider .caption .meta .button { margin:21px 0; }

.flexslider:hover .caption { opacity:1; }

/* ---------------------------------------------------------------------- */
/*  prettyPhoto
/* ---------------------------------------------------------------------- */

div.pp_default .pp_top,div.pp_default .pp_top .pp_middle,div.pp_default .pp_top .pp_left,div.pp_default .pp_top .pp_right,div.pp_default .pp_bottom,div.pp_default .pp_bottom .pp_left,div.pp_default .pp_bottom .pp_middle,div.pp_default .pp_bottom .pp_right{height:13px}
div.pp_default .pp_top .pp_left{background:url(../images/prettyPhoto/default/sprite.png) -78px -93px no-repeat}
div.pp_default .pp_top .pp_middle{background:url(../images/prettyPhoto/default/sprite_x.png) top left repeat-x}
div.pp_default .pp_top .pp_right{background:url(../images/prettyPhoto/default/sprite.png) -112px -93px no-repeat}
div.pp_default .pp_content .ppt{color:#f8f8f8}
div.pp_default .pp_content_container .pp_left{background:url(../images/prettyPhoto/default/sprite_y.png) -7px 0 repeat-y;padding-left:13px}
div.pp_default .pp_content_container .pp_right{background:url(../images/prettyPhoto/default/sprite_y.png) top right repeat-y;padding-right:13px}
div.pp_default .pp_next:hover{background:url(../images/prettyPhoto/default/sprite_next.png) center right no-repeat;cursor:pointer}
div.pp_default .pp_previous:hover{background:url(../images/prettyPhoto/default/sprite_prev.png) center left no-repeat;cursor:pointer}
div.pp_default .pp_expand{background:url(../images/prettyPhoto/default/sprite.png) 0 -29px no-repeat;cursor:pointer;height:28px;width:28px}
div.pp_default .pp_expand:hover{background:url(../images/prettyPhoto/default/sprite.png) 0 -56px no-repeat;cursor:pointer}
div.pp_default .pp_contract{background:url(../images/prettyPhoto/default/sprite.png) 0 -84px no-repeat;cursor:pointer;height:28px;width:28px}
div.pp_default .pp_contract:hover{background:url(../images/prettyPhoto/default/sprite.png) 0 -113px no-repeat;cursor:pointer}
div.pp_default .pp_close{background:url(../images/prettyPhoto/default/sprite.png) 2px 1px no-repeat;cursor:pointer;height:30px;width:30px}
div.pp_default .pp_gallery ul li a{background:url(../images/prettyPhoto/default/default_thumb.png) center center #f8f8f8;border:1px solid #aaa}
div.pp_default .pp_social{margin-top:7px}
div.pp_default .pp_gallery a.pp_arrow_previous,div.pp_default .pp_gallery a.pp_arrow_next{left:auto;position:static}
div.pp_default .pp_nav .pp_play,div.pp_default .pp_nav .pp_pause{background:url(../images/prettyPhoto/default/sprite.png) -51px 1px no-repeat;height:30px;width:30px}
div.pp_default .pp_nav .pp_pause{background-position:-51px -29px}
div.pp_default a.pp_arrow_previous,div.pp_default a.pp_arrow_next{background:url(../images/prettyPhoto/default/sprite.png) -31px -3px no-repeat;height:20px;margin:4px 0 0;width:20px}
div.pp_default a.pp_arrow_next{background-position:-82px -3px;left:52px}
div.pp_default .pp_content_container .pp_details{margin-top:5px}
div.pp_default .pp_nav{clear:none;height:30px;position:relative;width:110px}
div.pp_default .pp_nav .currentTextHolder{color:#999;font-family:Georgia;font-size:11px;font-style:italic;left:75px;line-height:25px;margin:0;padding:0 0 0 10px;position:absolute;top:2px}
div.pp_default .pp_close:hover,div.pp_default .pp_nav .pp_play:hover,div.pp_default .pp_nav .pp_pause:hover,div.pp_default .pp_arrow_next:hover,div.pp_default .pp_arrow_previous:hover{opacity:0.7}
div.pp_default .pp_description{font-size:11px;font-weight:700;line-height:14px;margin:5px 50px 5px 0}
div.pp_default .pp_bottom .pp_left{background:url(../images/prettyPhoto/default/sprite.png) -78px -127px no-repeat}
div.pp_default .pp_bottom .pp_middle{background:url(../images/prettyPhoto/default/sprite_x.png) bottom left repeat-x}
div.pp_default .pp_bottom .pp_right{background:url(../images/prettyPhoto/default/sprite.png) -112px -127px no-repeat}
div.pp_default .pp_loaderIcon{background:url(../images/prettyPhoto/default/loader.gif) center center no-repeat}
div.light_rounded .pp_top .pp_left{background:url(../images/prettyPhoto/light_rounded/sprite.png) -88px -53px no-repeat}
div.light_rounded .pp_top .pp_right{background:url(../images/prettyPhoto/light_rounded/sprite.png) -110px -53px no-repeat}
div.light_rounded .pp_next:hover{background:url(../images/prettyPhoto/light_rounded/btnNext.png) center right no-repeat;cursor:pointer}
div.light_rounded .pp_previous:hover{background:url(../images/prettyPhoto/light_rounded/btnPrevious.png) center left no-repeat;cursor:pointer}
div.light_rounded .pp_expand{background:url(../images/prettyPhoto/light_rounded/sprite.png) -31px -26px no-repeat;cursor:pointer}
div.light_rounded .pp_expand:hover{background:url(../images/prettyPhoto/light_rounded/sprite.png) -31px -47px no-repeat;cursor:pointer}
div.light_rounded .pp_contract{background:url(../images/prettyPhoto/light_rounded/sprite.png) 0 -26px no-repeat;cursor:pointer}
div.light_rounded .pp_contract:hover{background:url(../images/prettyPhoto/light_rounded/sprite.png) 0 -47px no-repeat;cursor:pointer}
div.light_rounded .pp_close{background:url(../images/prettyPhoto/light_rounded/sprite.png) -1px -1px no-repeat;cursor:pointer;height:22px;width:75px}
div.light_rounded .pp_nav .pp_play{background:url(../images/prettyPhoto/light_rounded/sprite.png) -1px -100px no-repeat;height:15px;width:14px}
div.light_rounded .pp_nav .pp_pause{background:url(../images/prettyPhoto/light_rounded/sprite.png) -24px -100px no-repeat;height:15px;width:14px}
div.light_rounded .pp_arrow_previous{background:url(../images/prettyPhoto/light_rounded/sprite.png) 0 -71px no-repeat}
div.light_rounded .pp_arrow_next{background:url(../images/prettyPhoto/light_rounded/sprite.png) -22px -71px no-repeat}
div.light_rounded .pp_bottom .pp_left{background:url(../images/prettyPhoto/light_rounded/sprite.png) -88px -80px no-repeat}
div.light_rounded .pp_bottom .pp_right{background:url(../images/prettyPhoto/light_rounded/sprite.png) -110px -80px no-repeat}
div.dark_rounded .pp_top .pp_left{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -88px -53px no-repeat}
div.dark_rounded .pp_top .pp_right{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -110px -53px no-repeat}
div.dark_rounded .pp_content_container .pp_left{background:url(../images/prettyPhoto/dark_rounded/contentPattern.png) top left repeat-y}
div.dark_rounded .pp_content_container .pp_right{background:url(../images/prettyPhoto/dark_rounded/contentPattern.png) top right repeat-y}
div.dark_rounded .pp_next:hover{background:url(../images/prettyPhoto/dark_rounded/btnNext.png) center right no-repeat;cursor:pointer}
div.dark_rounded .pp_previous:hover{background:url(../images/prettyPhoto/dark_rounded/btnPrevious.png) center left no-repeat;cursor:pointer}
div.dark_rounded .pp_expand{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -31px -26px no-repeat;cursor:pointer}
div.dark_rounded .pp_expand:hover{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -31px -47px no-repeat;cursor:pointer}
div.dark_rounded .pp_contract{background:url(../images/prettyPhoto/dark_rounded/sprite.png) 0 -26px no-repeat;cursor:pointer}
div.dark_rounded .pp_contract:hover{background:url(../images/prettyPhoto/dark_rounded/sprite.png) 0 -47px no-repeat;cursor:pointer}
div.dark_rounded .pp_close{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -1px -1px no-repeat;cursor:pointer;height:22px;width:75px}
div.dark_rounded .pp_description{color:#fff;margin-right:85px}
div.dark_rounded .pp_nav .pp_play{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -1px -100px no-repeat;height:15px;width:14px}
div.dark_rounded .pp_nav .pp_pause{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -24px -100px no-repeat;height:15px;width:14px}
div.dark_rounded .pp_arrow_previous{background:url(../images/prettyPhoto/dark_rounded/sprite.png) 0 -71px no-repeat}
div.dark_rounded .pp_arrow_next{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -22px -71px no-repeat}
div.dark_rounded .pp_bottom .pp_left{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -88px -80px no-repeat}
div.dark_rounded .pp_bottom .pp_right{background:url(../images/prettyPhoto/dark_rounded/sprite.png) -110px -80px no-repeat}
div.dark_rounded .pp_loaderIcon{background:url(../images/prettyPhoto/dark_rounded/loader.gif) center center no-repeat}
div.dark_square .pp_left,div.dark_square .pp_middle,div.dark_square .pp_right,div.dark_square .pp_content{background:#000}
div.dark_square .pp_description{color:#fff;margin:0 85px 0 0}
div.dark_square .pp_loaderIcon{background:url(../images/prettyPhoto/dark_square/loader.gif) center center no-repeat}
div.dark_square .pp_expand{background:url(../images/prettyPhoto/dark_square/sprite.png) -31px -26px no-repeat;cursor:pointer}
div.dark_square .pp_expand:hover{background:url(../images/prettyPhoto/dark_square/sprite.png) -31px -47px no-repeat;cursor:pointer}
div.dark_square .pp_contract{background:url(../images/prettyPhoto/dark_square/sprite.png) 0 -26px no-repeat;cursor:pointer}
div.dark_square .pp_contract:hover{background:url(../images/prettyPhoto/dark_square/sprite.png) 0 -47px no-repeat;cursor:pointer}
div.dark_square .pp_close{background:url(../images/prettyPhoto/dark_square/sprite.png) -1px -1px no-repeat;cursor:pointer;height:22px;width:75px}
div.dark_square .pp_nav{clear:none}
div.dark_square .pp_nav .pp_play{background:url(../images/prettyPhoto/dark_square/sprite.png) -1px -100px no-repeat;height:15px;width:14px}
div.dark_square .pp_nav .pp_pause{background:url(../images/prettyPhoto/dark_square/sprite.png) -24px -100px no-repeat;height:15px;width:14px}
div.dark_square .pp_arrow_previous{background:url(../images/prettyPhoto/dark_square/sprite.png) 0 -71px no-repeat}
div.dark_square .pp_arrow_next{background:url(../images/prettyPhoto/dark_square/sprite.png) -22px -71px no-repeat}
div.dark_square .pp_next:hover{background:url(../images/prettyPhoto/dark_square/btnNext.png) center right no-repeat;cursor:pointer}
div.dark_square .pp_previous:hover{background:url(../images/prettyPhoto/dark_square/btnPrevious.png) center left no-repeat;cursor:pointer}
div.light_square .pp_expand{background:url(../images/prettyPhoto/light_square/sprite.png) -31px -26px no-repeat;cursor:pointer}
div.light_square .pp_expand:hover{background:url(../images/prettyPhoto/light_square/sprite.png) -31px -47px no-repeat;cursor:pointer}
div.light_square .pp_contract{background:url(../images/prettyPhoto/light_square/sprite.png) 0 -26px no-repeat;cursor:pointer}
div.light_square .pp_contract:hover{background:url(../images/prettyPhoto/light_square/sprite.png) 0 -47px no-repeat;cursor:pointer}
div.light_square .pp_close{background:url(../images/prettyPhoto/light_square/sprite.png) -1px -1px no-repeat;cursor:pointer;height:22px;width:75px}
div.light_square .pp_nav .pp_play{background:url(../images/prettyPhoto/light_square/sprite.png) -1px -100px no-repeat;height:15px;width:14px}
div.light_square .pp_nav .pp_pause{background:url(../images/prettyPhoto/light_square/sprite.png) -24px -100px no-repeat;height:15px;width:14px}
div.light_square .pp_arrow_previous{background:url(../images/prettyPhoto/light_square/sprite.png) 0 -71px no-repeat}
div.light_square .pp_arrow_next{background:url(../images/prettyPhoto/light_square/sprite.png) -22px -71px no-repeat}
div.light_square .pp_next:hover{background:url(../images/prettyPhoto/light_square/btnNext.png) center right no-repeat;cursor:pointer}
div.light_square .pp_previous:hover{background:url(../images/prettyPhoto/light_square/btnPrevious.png) center left no-repeat;cursor:pointer}
div.facebook .pp_top .pp_left{background:url(../images/prettyPhoto/facebook/sprite.png) -88px -53px no-repeat}
div.facebook .pp_top .pp_middle{background:url(../images/prettyPhoto/facebook/contentPatternTop.png) top left repeat-x}
div.facebook .pp_top .pp_right{background:url(../images/prettyPhoto/facebook/sprite.png) -110px -53px no-repeat}
div.facebook .pp_content_container .pp_left{background:url(../images/prettyPhoto/facebook/contentPatternLeft.png) top left repeat-y}
div.facebook .pp_content_container .pp_right{background:url(../images/prettyPhoto/facebook/contentPatternRight.png) top right repeat-y}
div.facebook .pp_expand{background:url(../images/prettyPhoto/facebook/sprite.png) -31px -26px no-repeat;cursor:pointer}
div.facebook .pp_expand:hover{background:url(../images/prettyPhoto/facebook/sprite.png) -31px -47px no-repeat;cursor:pointer}
div.facebook .pp_contract{background:url(../images/prettyPhoto/facebook/sprite.png) 0 -26px no-repeat;cursor:pointer}
div.facebook .pp_contract:hover{background:url(../images/prettyPhoto/facebook/sprite.png) 0 -47px no-repeat;cursor:pointer}
div.facebook .pp_close{background:url(../images/prettyPhoto/facebook/sprite.png) -1px -1px no-repeat;cursor:pointer;height:22px;width:22px}
div.facebook .pp_description{margin:0 37px 0 0}
div.facebook .pp_loaderIcon{background:url(../images/prettyPhoto/facebook/loader.gif) center center no-repeat}
div.facebook .pp_arrow_previous{background:url(../images/prettyPhoto/facebook/sprite.png) 0 -71px no-repeat;height:22px;margin-top:0;width:22px}
div.facebook .pp_arrow_previous.disabled{background-position:0 -96px;cursor:default}
div.facebook .pp_arrow_next{background:url(../images/prettyPhoto/facebook/sprite.png) -32px -71px no-repeat;height:22px;margin-top:0;width:22px}
div.facebook .pp_arrow_next.disabled{background-position:-32px -96px;cursor:default}
div.facebook .pp_nav{margin-top:0}
div.facebook .pp_nav p{font-size:15px;padding:0 3px 0 4px}
div.facebook .pp_nav .pp_play{background:url(../images/prettyPhoto/facebook/sprite.png) -1px -123px no-repeat;height:22px;width:22px}
div.facebook .pp_nav .pp_pause{background:url(../images/prettyPhoto/facebook/sprite.png) -32px -123px no-repeat;height:22px;width:22px}
div.facebook .pp_next:hover{background:url(../images/prettyPhoto/facebook/btnNext.png) center right no-repeat;cursor:pointer}
div.facebook .pp_previous:hover{background:url(../images/prettyPhoto/facebook/btnPrevious.png) center left no-repeat;cursor:pointer}
div.facebook .pp_bottom .pp_left{background:url(../images/prettyPhoto/facebook/sprite.png) -88px -80px no-repeat}
div.facebook .pp_bottom .pp_middle{background:url(../images/prettyPhoto/facebook/contentPatternBottom.png) top left repeat-x}
div.facebook .pp_bottom .pp_right{background:url(../images/prettyPhoto/facebook/sprite.png) -110px -80px no-repeat}
div.pp_pic_holder a:focus{outline:none}
div.pp_overlay{background:#000;display:none;left:0;position:absolute;top:0;width:100%;z-index:9500}
div.pp_pic_holder{display:none;position:absolute;width:100px;z-index:10000}
.pp_content{height:40px;min-width:40px}
* html .pp_content{width:40px}
.pp_content_container{position:relative;text-align:left;width:100%}
.pp_content_container .pp_left{padding-left:20px}
.pp_content_container .pp_right{padding-right:20px}
.pp_content_container .pp_details{float:left;margin:10px 0 2px}
.pp_description{display:none;margin:0}
.pp_social{float:left;margin:0}
.pp_social .facebook{float:left;margin-left:5px;overflow:hidden;width:55px}
.pp_social .twitter{float:left}
.pp_nav{clear:right;float:left;margin:3px 10px 0 0}
.pp_nav p{float:left;margin:2px 4px;white-space:nowrap}
.pp_nav .pp_play,.pp_nav .pp_pause{float:left;margin-right:4px;text-indent:-10000px}
a.pp_arrow_previous,a.pp_arrow_next{display:block;float:left;height:15px;margin-top:3px;overflow:hidden;text-indent:-10000px;width:14px}
.pp_hoverContainer{position:absolute;top:0;width:100%;z-index:2000}
.pp_gallery{display:none;left:50%;margin-top:-50px;position:absolute;z-index:10000}
.pp_gallery div{float:left;overflow:hidden;position:relative}
.pp_gallery ul{float:left;height:35px;margin:0 0 0 5px;padding:0;position:relative;white-space:nowrap}
.pp_gallery ul a{border:1px rgba(0,0,0,0.5) solid;display:block;float:left;height:33px;overflow:hidden}
.pp_gallery ul a img{border:0}
.pp_gallery li{display:block;float:left;margin:0 5px 0 0;padding:0}
.pp_gallery li.default a{background:url(../images/prettyPhoto/facebook/default_thumbnail.gif) 0 0 no-repeat;display:block;height:33px;width:50px}
.pp_gallery .pp_arrow_previous,.pp_gallery .pp_arrow_next{margin-top:7px!important}
a.pp_next{background:url(../images/prettyPhoto/default/sprite_next.png) 10000px 10000px no-repeat;display:block;float:right;height:100%;text-indent:-10000px;width:49%}
a.pp_previous{background:url(../images/prettyPhoto/default/sprite_prev.png) 10000px 10000px no-repeat;display:block;float:left;height:100%;text-indent:-10000px;width:49%}
a.pp_expand,a.pp_contract{cursor:pointer;display:none;height:20px;position:absolute;right:30px;text-indent:-10000px;top:10px;width:20px;z-index:20000}
a.pp_close{display:block;line-height:22px;position:absolute;right:0;text-indent:-10000px;top:0}
.pp_loaderIcon{display:block;height:24px;left:50%;margin:-12px 0 0 -12px;position:absolute;top:50%;width:24px}
#pp_full_res{line-height:1!important}
#pp_full_res .pp_inline{text-align:left}
#pp_full_res .pp_inline p{margin:0 0 15px}
div.ppt{color:#fff;display:none;font-size:17px;margin:0 0 5px 15px;z-index:9999}
div.pp_default .pp_content,div.light_rounded .pp_content{background-color:#fff}
div.pp_default #pp_full_res .pp_inline,div.light_rounded .pp_content .ppt,div.light_rounded #pp_full_res .pp_inline,div.light_square .pp_content .ppt,div.light_square #pp_full_res .pp_inline,div.facebook .pp_content .ppt,div.facebook #pp_full_res .pp_inline{color:#000}
div.pp_default .pp_gallery ul li a:hover,div.pp_default .pp_gallery ul li.selected a,.pp_gallery ul a:hover,.pp_gallery li.selected a{border-color:#fff}
div.pp_default .pp_details,div.light_rounded .pp_details,div.dark_rounded .pp_details,div.dark_square .pp_details,div.light_square .pp_details,div.facebook .pp_details{position:relative}
div.light_rounded .pp_top .pp_middle,div.light_rounded .pp_content_container .pp_left,div.light_rounded .pp_content_container .pp_right,div.light_rounded .pp_bottom .pp_middle,div.light_square .pp_left,div.light_square .pp_middle,div.light_square .pp_right,div.light_square .pp_content,div.facebook .pp_content{background:#fff}
div.light_rounded .pp_description,div.light_square .pp_description{margin-right:85px}
div.light_rounded .pp_gallery a.pp_arrow_previous,div.light_rounded .pp_gallery a.pp_arrow_next,div.dark_rounded .pp_gallery a.pp_arrow_previous,div.dark_rounded .pp_gallery a.pp_arrow_next,div.dark_square .pp_gallery a.pp_arrow_previous,div.dark_square .pp_gallery a.pp_arrow_next,div.light_square .pp_gallery a.pp_arrow_previous,div.light_square .pp_gallery a.pp_arrow_next{margin-top:12px!important}
div.light_rounded .pp_arrow_previous.disabled,div.dark_rounded .pp_arrow_previous.disabled,div.dark_square .pp_arrow_previous.disabled,div.light_square .pp_arrow_previous.disabled{background-position:0 -87px;cursor:default}
div.light_rounded .pp_arrow_next.disabled,div.dark_rounded .pp_arrow_next.disabled,div.dark_square .pp_arrow_next.disabled,div.light_square .pp_arrow_next.disabled{background-position:-22px -87px;cursor:default}
div.light_rounded .pp_loaderIcon,div.light_square .pp_loaderIcon{background:url(../images/prettyPhoto/light_rounded/loader.gif) center center no-repeat}
div.dark_rounded .pp_top .pp_middle,div.dark_rounded .pp_content,div.dark_rounded .pp_bottom .pp_middle{background:url(../images/prettyPhoto/dark_rounded/contentPattern.png) top left repeat}
div.dark_rounded .currentTextHolder,div.dark_square .currentTextHolder{color:#c4c4c4}
div.dark_rounded #pp_full_res .pp_inline,div.dark_square #pp_full_res .pp_inline{color:#fff}
.pp_top,.pp_bottom{height:20px;position:relative}
* html .pp_top,* html .pp_bottom{padding:0 20px}
.pp_top .pp_left,.pp_bottom .pp_left{height:20px;left:0;position:absolute;width:20px}
.pp_top .pp_middle,.pp_bottom .pp_middle{height:20px;left:20px;position:absolute;right:20px}
* html .pp_top .pp_middle,* html .pp_bottom .pp_middle{left:0;position:static}
.pp_top .pp_right,.pp_bottom .pp_right{height:20px;left:auto;position:absolute;right:0;top:0;width:20px}
.pp_fade,.pp_gallery li.default a img{display:none}

@media only screen and (-webkit-min-device-pixel-ratio:2),only screen and (-moz-min-device-pixel-ratio:2),only screen and (-o-min-device-pixel-ratio:2),only screen and (min-device-pixel-ratio:2) {
    div.pp_default .pp_expand,div.pp_default .pp_expand:hover,div.pp_default .pp_contract,div.pp_default .pp_contract:hover,div.pp_default .pp_close,div.pp_default .pp_nav .pp_play,div.pp_default .pp_nav .pp_pause,div.pp_default a.pp_arrow_previous,div.pp_default a.pp_arrow_next {
        background-image: url(../images/prettyPhoto/sprite_2x.png);
        background-size: 130px 147px
    }

    div.pp_default .pp_next:hover {
        background-image: url(../images/prettyPhoto/sprite_next_2x.png);
        background-size: 28px 30px
    }

    div.pp_default .pp_previous:hover {
        background-image: url(../images/prettyPhoto/sprite_prev_2x.png);
        background-size: 28px 30px
    }

    div.pp_default .pp_content,div.light_rounded .pp_content {
        background-color: #f8f8f8
    }

    div.pp_default .pp_top .pp_left,div.pp_default .pp_top .pp_middle,div.pp_default .pp_top .pp_right,div.pp_default .pp_content_container .pp_left,div.pp_default .pp_content_container .pp_right,div.pp_default .pp_bottom .pp_left,div.pp_default .pp_bottom .pp_middle,div.pp_default .pp_bottom .pp_right {
        background-color: #f8f8f8;
        background-image: none
    }

    div.pp_default .pp_top {
        height: 16px
    }

    div.pp_default .pp_top .pp_left {
        -webkit-border-top-left-radius: 10px;
        -moz-border-radius-topleft: 10px;
        border-top-left-radius: 10px;
        border-left: 5px solid #202020;
        border-top: 5px solid #202020
    }

    div.pp_default .pp_top .pp_right {
        -webkit-border-top-right-radius: 10px;
        -moz-border-radius-topright: 10px;
        border-top-right-radius: 10px;
        border-right: 5px solid #202020;
        border-top: 5px solid #202020
    }

    div.pp_default .pp_top .pp_middle {
        border-top: 5px solid #202020
    }

    div.pp_default .pp_content_container .pp_left {
        border-left: 5px solid #202020;
        padding-left: 11px
    }

    div.pp_default .pp_content_container .pp_right {
        border-right: 5px solid #202020
    }

    div.pp_default .pp_bottom .pp_left {
        -webkit-border-bottom-left-radius: 10px;
        -moz-border-radius-pp_bottomleft: 10px;
        border-top-pp_bottom-radius: 10px;
        border-left: 5px solid #202020;
        border-bottom: 5px solid #202020
    }

    div.pp_default .pp_bottom .pp_right {
        -webkit-border-bottom-right-radius: 10px;
        -moz-border-radius-bottomright: 10px;
        border-bottom-right-radius: 10px;
        border-right: 5px solid #202020;
        border-bottom: 5px solid #202020
    }

    div.pp_default .pp_bottom .pp_middle {
        border-bottom: 5px solid #202020
    }

    .flex-direction-nav a {
    	background-image:url(../images/arrow_nav@2x.png);
    	-webkit-background-size:60px 30px;
    }

    .mejs-controls .mejs-play button,
	.mejs-controls .mejs-pause button {
		background-image:url(../images/audio-play-pause@2x.png);
		-webkit-background-size:40px 80px;
	}

    .mejs-controls .mejs-mute button,
    .mejs-controls .mejs-unmute button {
        background-image:url(../images/audio-volume@2x.png);
        -webkit-background-size:40px 80px;
    }
}

/* Tablet */
@media only screen and (min-width: 768px) and (max-width: 959px) {
    .audio-player { width:508px; }

    .mejs-controls .mejs-mute button,
    .mejs-controls .mejs-unmute button { left:383px; }

    .mejs-controls .mejs-horizontal-volume-slider { left:423px; }

    .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total { width:75px; }

    .mejs-controls .mejs-time-rail { width:328px; }

    .mejs-controls .mejs-time-rail span { width:328px; }

    .recent-posts .audio-player { width:236px; margin:25px 0 26px; }

    .recent-posts .mejs-controls .mejs-mute button,
    .recent-posts .mejs-controls .mejs-unmute button { left:150px; }

    .recent-posts .mejs-controls .mejs-horizontal-volume-slider { left:190px; }

    .recent-posts .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total { width:35px; }

    .recent-posts .mejs-controls .mejs-time-rail { width:95px; }

    .recent-posts .mejs-controls .mejs-time-rail span { width:95px; }
}

/* Portrait */
@media only screen and (max-width: 767px) {
	.flexslider .caption { display:none; }

    .audio-player { width:300px; }

    .mejs-controls .mejs-mute button,
    .mejs-controls .mejs-unmute button { left:185px; }

    .mejs-controls .mejs-horizontal-volume-slider { left:225px; }

    .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total { width:65px; }

    .mejs-controls .mejs-time-rail { width:130px; }

    .mejs-controls .mejs-time-rail span { width:130px; }

    .recent-posts .audio-player { margin:0; }
}

/* Landscape */
@media only screen and (min-width: 480px) and (max-width: 767px) {
	.flexslider .caption { display:none; }

    .audio-player,
    .recent-posts .audio-player { width:420px; }

    .mejs-controls .mejs-mute button,
    .mejs-controls .mejs-unmute button,
    .recent-posts .mejs-controls .mejs-mute button,
    .recent-posts .mejs-controls .mejs-unmute button { left:305px; }

    .mejs-controls .mejs-horizontal-volume-slider,
    .recent-posts .mejs-controls .mejs-horizontal-volume-slider { left:345px; }

    .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total,
    .recent-posts .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total { width:65px; }

    .mejs-controls .mejs-time-rail,
    .recent-posts .mejs-controls .mejs-time-rail { width:250px; }

    .mejs-controls .mejs-time-rail span,
    .recent-posts .mejs-controls .mejs-time-rail span { width:250px; }
}


text:
#include <gtest/gtest.h>
#include "chasky/core/common/eigen_matrix.h"
#include "chasky/core/framework/function.h"
#include "chasky/core/framework/function_def_builder.h"
#include "chasky/core/functions/AddN.h"
// TODO Add AddN FromDef test
namespace chasky {
namespace test {

class AddN_Test : public ::testing::Test {
protected:
  virtual void SetUp() {
    LOG(INFO) << FunctionDefLibrary::Instance().DebugString();
    ASSERT_TRUE(FunctionDefLibrary::Instance().LookUp("AddN", &def).ok());

    auto func_sign = Function::Signature("AddN", CH_MAT_FLOAT);
    auto status = FunctionLibrary::Instance().LookUp(func_sign, &creator);
    EXPECT_TRUE(status.ok());
    if (!status.ok()) {
      LOG(ERROR) << status.msg();
    }
  }

protected:
  FunctionDef *def;
  FunctionLibrary::FunctionCreatorType *creator;
};

TEST_F(AddN_Test, init) {}

TEST_F(AddN_Test, FromDef) {
  // Fill the missing attributes
  NodeDef node_def;
  (*node_def.mutable_attr())["dim"] =
      AttrValueBuilder().Value((int64_t)200).Finalize();
  (*node_def.mutable_attr())["dtype"] =
      AttrValueBuilder().Value(CH_MAT_FLOAT_LIST).Finalize();

  auto function = (*creator)();
  ASSERT_TRUE(function->FromDef(*def, node_def.attr()).ok());

  auto addn =
      dynamic_cast<functions::AddN<math::CpuFloatMatrix> *>(function.get());

  EXPECT_EQ(addn->Dim(), 200);
  EXPECT_EQ(addn->Dtype(), CH_MAT_FLOAT_LIST);
}

// The arguments' preparation is done by Nodes(the upper level), so in function
// level, much work should done manully.
TEST_F(AddN_Test, ForwardCompute) {
  // prepare inputs, just one argument list field.
  DLOG(INFO) << "preparing arguments";
  const size_t width = 20;
  const size_t height = 40;

  // input argument's definition
  auto arg_def = ArgumentDefBuilder()
                     .Name("input1")
                     .Type("float_mat_list")
                     .SetIsRef(false)
                     .Finalize();
  // activation's definition
  auto arg_def_act = ArgumentDefBuilder()
                         .Name("input1")
                         .Type("float_mat")
                         .Shape(width, height)
                         .SetIsRef(false)
                         .Finalize();

  Argument arg(&arg_def);
  Argument act(&arg_def_act);

  std::vector<std::shared_ptr<math::CpuFloatMatrix>> mats;
  auto shape = std::make_pair(width, height);
  for (size_t i = 0; i < width; i++) {
    mats.emplace_back(std::make_shared<math::CpuFloatMatrix>(shape, true));
  }

  *(arg.ArgField()->float_mat_vals) = mats;

  std::vector<const Argument *> inputs = {&arg};
  std::vector<Argument *> outputs = {&act};

  DLOG(INFO) << "begin forward";
  // create addn
  NodeDef node_def;
  (*node_def.mutable_attr())["dim"] =
      AttrValueBuilder().Value((int64_t)width).Finalize();
  (*node_def.mutable_attr())["dtype"] =
      AttrValueBuilder().Value(CH_MAT_FLOAT_LIST).Finalize();

  auto function = (*creator)();
  ASSERT_TRUE(function->FromDef(*def, node_def.attr()).ok());

  auto status = function->ForwardCompute(inputs, &outputs, *def);
  ASSERT_TRUE(status.ok());
}

TEST_F(AddN_Test, BackwardCompute) {
  DLOG(INFO) << "preparing arguments";
  const size_t width = 20;
  const size_t height = 40;

  // input argument's definition
  auto arg_def = ArgumentDefBuilder()
                     .Name("input1")
                     .Type("float_mat_list")
                     .SetIsRef(false)
                     .Finalize();
  // activation's definition
  auto arg_def_act = ArgumentDefBuilder()
                         .Name("input1")
                         .Type("float_mat")
                         .Shape(width, height)
                         .SetIsRef(false)
                         .Finalize();

  Argument x_arg(&arg_def), grad_arg(&arg_def_act), previous_grad_arg(&arg_def);

  auto shape = std::make_pair(width, height);
  for (size_t i = 0; i < 10 /*num_input_node*/; i++) {
    x_arg.ArgField()->float_mat_vals->emplace_back(
        std::make_shared<math::CpuFloatMatrix>(shape));

    previous_grad_arg.ArgField()->float_mat_vals->emplace_back(
        std::make_shared<math::CpuFloatMatrix>(shape, /*random*/ false));
  }
  std::vector<const Argument *> x({&x_arg});
  std::vector<Argument *> previous_grad({&previous_grad_arg});

  // create addn
  NodeDef node_def;
  // fill all the missing attributes
  (*node_def.mutable_attr())["dim"] =
      AttrValueBuilder().Value((int64_t)width).Finalize();
  (*node_def.mutable_attr())["dtype"] =
      AttrValueBuilder().Value(CH_MAT_FLOAT_LIST).Finalize();

  auto function = (*creator)();
  ASSERT_TRUE(function->FromDef(*def, node_def.attr()).ok());

  // begin computation
  EXPECT_TRUE(function->BackwardCompute(x, grad_arg, &previous_grad).ok());
}

} // namespace test
} // namespace chasky


text:
var oa_person = {

	 config: null
	,loadConfig: function(afterAjax){
		$.ajax({
			url: config_path__oa_person__loadConfig
			,dataType: 'json'
	        ,type: "POST"
	        ,data: {
                 executor: top.basic_user.loginData.username
                ,session: top.basic_user.loginData.session
	        }
			,success : function(response) {
				oa_person.config = response;
				if ( typeof(afterAjax) == "string" ){
					eval(afterAjax);
				}else if( typeof(afterAjax) == "function"){
					afterAjax();
				}
			}
			,error : function(){
				alert(top.il8n.disConnect);
			}
		});
	}

	,uploadPhoto: function(){
		var path = $('#photo').val();

		var win = $.ligerDialog.open({
			 content: "x<form id='xx' method='post' enctype='multipart/form-data' action="+config_path__oa_person__uploadPhoto+" target='send'><input name='file' type='file' /><input name='executor' value='"+top.basic_user.loginData.username+"' style='display:none' /><input name='session' value='"+top.basic_user.loginData.session+"' style='display:none' /><input type='submit' value='"+top.getIl8n('submit')+"' /></form>
"
			,height: 150
			,width: 400
			,isHidden: false
			,id: "dialog_photoUpload"
		});

		win.close = function(){
            this.unmask();
            this._removeDialog();
			$.ligerui.remove(this);
		};

		$("#oa_person_uploadPhoto_if").load(function(){
	        var d = $("#oa_person_uploadPhoto_if").contents();
	        var s = $('body',d).html() ;
	        if(s=='')return;
	        eval("var obj = "+s);
	        if(obj.status=='1'){

	        	$('#photo').val(obj.path);
	        	$('#person_photo__img').attr("src",obj.path);
	        }
	    });
	}

	,getAddressMode: 2
	,getAddress: function(){
		var formD;
		if($.ligerui.get("getAddress_formD")){
			formD = $.ligerui.get("getAddress_formD");
			formD.show();
		}else{
			var form = $("<form id='getAddress_form'></form");
			$(form).ligerForm({
				inputWidth: 170
				,labelWidth: 90
				,space: 40
				,fields: [
					 { display: top.getIl8n('zone_2'), name: "getAddress_zone_2", newline: true, type: "select", options :{data: oa_person.config.zone_2 , valueField : "code" , textField: "value" } }
					,{ display: top.getIl8n('zone_4'), name: "getAddress_zone_4", newline: true, type: "select", options :{valueField : "code" , textField: "value" } }
					,{ display: top.getIl8n('zone_6'), name: "getAddress_zone_6", newline: true, type: "select", options :{valueField : "code" , textField: "value" } }
					,{ display: top.getIl8n('zone_8'), name: "getAddress_zone_8", newline: true, type: "select", options :{valueField : "code" , textField: "value" } }
					,{ display: top.getIl8n('zone_10'), name: "getAddress_zone_10", newline: true, type: "select", options :{valueField : "code" , textField: "value" } }
				]

			});
			$.ligerDialog.open({
				 id: "getAddress_formD"
				,width: 350
				,height: 300
				,content: form
				,title: top.getIl8n('oa_person','address')

				,buttons : [
				    {text: top.getIl8n('set'), onclick:function(){
				    	var thecode = "";
				    	var theaddress = "";

				    	if($.ligerui.get("getAddress_zone_2").getValue()!=""){
				    		thecode = $('#getAddress_zone_2').val();
				    		theaddress = $('#getAddress_zone_2_val').val();
				    	}
				    	if($.ligerui.get("getAddress_zone_4").getValue()!=""){
				    		thecode = $('#getAddress_zone_4').val();
				    		theaddress = $('#getAddress_zone_4_val').val();
				    	}
				    	if($.ligerui.get("getAddress_zone_6").getValue()!=""){
				    		thecode = $('#getAddress_zone_6').val();
				    		theaddress = $('#getAddress_zone_6_val').val();
				    	}
				    	if($.ligerui.get("getAddress_zone_8").getValue()!=""){
				    		thecode = $('#getAddress_zone_8').val();
				    		theaddress += $('#getAddress_zone_8_val').val();
				    	}
				    	if($.ligerui.get("getAddress_zone_10").getValue()!=""){
				    		thecode = $('#getAddress_zone_10').val();
				    		theaddress += $('#getAddress_zone_10_val').val();
				    	}

				    	if(oa_person.getAddressMode==1){
							$.ligerui.get("address").setValue(thecode);
							$.ligerui.get("address_code").setValue(theaddress);
				    	}else{
							$.ligerui.get("address_birth").setValue(thecode);
							$.ligerui.get("address_birth_code").setValue(theaddress);
				    	}
					}}]
			});

			$('#getAddress_zone_2').change(function(){
				var data = $('#getAddress_zone_2_val').val();
				$.ajax({
					url: config_path__oa_person__lowerCodes,
					data: {
						code: data
						,reference: 'zone'

		                ,executor: top.basic_user.loginData.username
		                ,session: top.basic_user.loginData.session
					}
					,type: "POST"
					,dataType: 'json'
					,contentType: "application/x-www-form-urlencoded; charset=gb2312"
					,success: function(response) {
						liger.get("getAddress_zone_4").setData(response);
					},
					error : function(){
						alert(top.getIl8n('disConnect'));
					}
				});
			});

			$('#getAddress_zone_4').change(function(){
				var data = $('#getAddress_zone_4_val').val();
				$.ajax({
					url: config_path__oa_person__lowerCodes,
					data: {
						code: data
						,reference: 'zone'

		                ,executor: top.basic_user.loginData.username
		                ,session: top.basic_user.loginData.session
					}
					,type: "POST"
					,dataType: 'json'
					,contentType: "application/x-www-form-urlencoded; charset=gb2312"
					,success: function(response) {
						liger.get("getAddress_zone_6").setData(response);
					},
					error : function(){
						alert(top.getIl8n('disConnect'));
					}
				});
			});

			$('#getAddress_zone_6').change(function(){
				var data = $('#getAddress_zone_6_val').val();
				$.ajax({
					url: config_path__oa_person__lowerCodes,
					data: {
						code: data
						,reference: 'zone'

		                ,executor: top.basic_user.loginData.username
		                ,session: top.basic_user.loginData.session
					}
					,type: "POST"
					,dataType: 'json'
					,contentType: "application/x-www-form-urlencoded; charset=gb2312"
					,success: function(response) {
						liger.get("getAddress_zone_8").setData(response);
					},
					error : function(){
						alert(top.getIl8n('disConnect'));
					}
				});
			});

			$('#getAddress_zone_8').change(function(){
				var data = $('#getAddress_zone_8_val').val();
				$.ajax({
					url: config_path__oa_person__lowerCodes,
					data: {
						code: data
						,reference: 'zone'

		                ,executor: top.basic_user.loginData.username
		                ,session: top.basic_user.loginData.session
					}
					,type: "POST"
					,dataType: 'json'
					,contentType: "application/x-www-form-urlencoded; charset=gb2312"
					,success: function(response) {
						liger.get("getAddress_zone_10").setData(response);
					},
					error : function(){
						alert(top.getIl8n('disConnect'));
					}
				});
			});
		}
	}

	,getSchool: function(){
		var formD;
		if($.ligerui.get("formD")){
			formD = $.ligerui.get("formD");
			formD.show();
		}else{
			var form = $("<form id='form'></form>");
			$(form).ligerForm({
				inputWidth: 170
				,labelWidth: 90
				,space: 40
				,fields: [
					 { display: top.getIl8n('type'), name: "getSchool_type", newline: false, type: "select", options :{data : [{"code":"3","value":"大学"},{"code":"4","value":"高中"},{"code":"5","value":"初中"},{"code":"6","value":"小学"}], valueField : "code" , textField: "value" } }
					,{ display: top.getIl8n('zone_2'), name: "getSchool_zone_2", newline: true, type: "select", options :{data: oa_person.config.zone_2 , valueField : "code" , textField: "value" } }
					,{ display: top.getIl8n('zone_4'), name: "getSchool_zone_4", newline: true, type: "select", options :{valueField : "code" , textField: "value" } }
					,{ display: top.getIl8n('zone_6'), name: "getSchool_zone_6", newline: true, type: "select", options :{valueField : "code" , textField: "value" } }
					,{ display: top.getIl8n('py_prefix'), name: "getSchool_prefix", newline: true, type: "select", options :{data :
					[{"code":"A","value":"A"},{"code":"B","value":"B"},{"code":"C","value":"C"},{"code":"D","value":"D"},{"code":"E","value":"E"},{"code":"F","value":"F"},{"code":"G","value":"G"},{"code":"H","value":"H"},{"code":"I","value":"I"},{"code":"J","value":"J"},{"code":"K","value":"K"},{"code":"L","value":"L"},{"code":"M","value":"M"},{"code":"N","value":"N"},{"code":"O","value":"O"},{"code":"P","value":"P"},{"code":"Q","value":"Q"},{"code":"R","value":"R"},{"code":"S","value":"S"},{"code":"T","value":"T"},{"code":"U","value":"U"},{"code":"V","value":"V"},{"code":"W","value":"W"},{"code":"X","value":"X"},{"code":"Y","value":"Y"},{"code":"Z","value":"Z"}]
					 , valueField : "code" , textField: "value" } }
					,{ display: top.getIl8n('school'), name: "getSchool_school", newline: true, type: "select", options :{valueField : "code" , textField: "value" } }
				]

			});
			$.ligerDialog.open({
				 id: "formD"
				,width: 350
				,height: 300
				,title: top.getIl8n('school')
				,content: form
				,buttons : [
					{text: top.getIl8n('read'), onclick:function(){
						var district = $.ligerui.get("getSchool_zone_6").getValue();

						$.ajax({
							url: config_path__service_resource__qq_schools
							,dataType: 'json'
					        ,type: "POST"
					        ,data: {
					        	data: $.ligerui.toJSON({
					        		type: $.ligerui.get("getSchool_type").getValue()
					        		,country: "0"
					        		,province: $.ligerui.get("getSchool_zone_2").getValue()
					        		,prefix: $.ligerui.get("getSchool_prefix").getValue()
					        		,district: district
					        	})

				                ,executor: top.basic_user.loginData.username
				                ,session: top.basic_user.loginData.session
					        }
							,success : function(response) {
								liger.get("getSchool_school").setData(response);
							}
							,error : function(){
								alert(top.il8n.disConnect);
							}
						});
					}},
				    {text: top.getIl8n('set'), onclick:function(){
						$.ligerui.get("degree_school").setValue($('#getSchool_school').val());
						$.ligerui.get("degree_school_code").setValue($('#getSchool_school_val').val());
					}}]
			});

			$('#getSchool_zone_2').change(function(){
				var data = $('#getSchool_zone_2_val').val();
				$.ajax({
					url: config_path__oa_person__lowerCodes,
					data: {
						code: data
						,reference: 'zone'

						//服务端权限验证所需
		                ,executor: top.basic_user.loginData.username
		                ,session: top.basic_user.loginData.session
					}
					,type: "POST"
					,dataType: 'json'
					,contentType: "application/x-www-form-urlencoded; charset=gb2312"
					,success: function(response) {
						liger.get("getSchool_zone_4").setData(response);
					},
					error : function(){
						alert(top.getIl8n('disConnect'));
					}
				});
			});

			$('#getSchool_zone_4').change(function(){
				var data = $('#getSchool_zone_4_val').val();
				$.ajax({
					url: config_path__oa_person__lowerCodes,
					data: {
						code: data
						,reference: 'zone'

						//服务端权限验证所需
		                ,executor: top.basic_user.loginData.username
		                ,session: top.basic_user.loginData.session
					}
					,type: "POST"
					,dataType: 'json'
					,contentType: "application/x-www-form-urlencoded; charset=gb2312"
					,success: function(response) {
						liger.get("getSchool_zone_6").setData(response);
					},
					error : function(){
						alert(top.getIl8n('disConnect'));
					}
				});
			});
		}
	}

	,add: function(){

		var config = {
			id: 'oa_person__add',
			fields: [
				 { display: top.getIl8n('name'), name: "name", validate: { required:true }, type: "text" }

				,{ display: top.getIl8n('oa_person','birthday'), name: "birthday", type: "date" }
				,{ display: top.getIl8n('oa_person','card'), name: "card", type: "select", options :{data : oa_person.config.card, valueField : "code" , textField: "value", slide: false } }
				,{ display: top.getIl8n('oa_person','cardid'), name: "cardid", type: "text"}

				,{ display: top.getIl8n('oa_person','height'), name: "height", type: "number" }

				,{ display: top.getIl8n('oa_person','cellphone'), name: "cellphone", type: "number" }
				,{ display: top.getIl8n('oa_person','email'), name: "email", type: "text" }
				,{ display: top.getIl8n('oa_person','qq'), name: "qq", type: "number", newline: false }

				,{ display: top.getIl8n('oa_person','nationality'), name: "nationality", type: "text" }

				,{ display: top.getIl8n('oa_person','nation'), name: "nation", type: "select", options :{data : oa_person.config.nation, valueField : "code" , textField: "value", slide: false }, newline: false  }
				,{ display: top.getIl8n('oa_person','gender'), name: "gender", type: "select", options :{data : oa_person.config.gender, valueField : "code" , textField: "value", slide: false } }
				,{ display: top.getIl8n('oa_person','marriage'), name: "marriage", type: "select", options :{data : oa_person.config.marriage, valueField : "code" , textField: "value", slide: false }, newline: false  }
				,{ display: top.getIl8n('oa_person','degree'), name: "degree", type: "select", options :{data : oa_person.config.degree, valueField : "code" , textField: "value", slide: false } }
				,{ display: top.getIl8n('oa_person','politically'), name: "politically", type: "select", options :{data : oa_person.config.politically, valueField : "code" , textField: "value", slide: false }, newline: false  }

				,{ display: top.getIl8n('oa_person','photo'), name: "photo", type: "text" }

				,{ display: top.getIl8n('oa_person','degree_school'), name: "degree_school", type: "text" }
				,{ display: top.getIl8n('oa_person','degree_school_code'), name: "degree_school_code", type: "text" , newline: false}
				,{ display: top.getIl8n('oa_person','address_birth'), name: "address_birth", type: "text" }
				,{ display: top.getIl8n('oa_person','address_birth_code'), name: "address_birth_code", type: "text" , newline: false }
				,{ display: top.getIl8n('oa_person','address'), name: "address", type: "text" }
				,{ display: top.getIl8n('oa_person','address_code'), name: "address_code", type: "text" , newline: false }

			]
		};

		$(document.body).append("<form id='form'></form>");
		$('#form').ligerForm(config);

		$("#photo").attr("disabled",true);
		$("#photo").css("background-color","#EEEEEE");
		$("#photo").parent().css("background-color","#EEEEEE");
		$("#photo").parent().parent().next().css("width","80px").append("

");
		$('#form').append("");

		$("#address_birth_code").attr("disabled",true);
		$("#degree_school_code").attr("disabled",true);
		$("#address_code").attr("disabled",true);
		$("#address_birth_code").css("background-color","#EEEEEE");
		$("#address_birth_code").parent().css("background-color","#EEEEEE");
		$("#degree_school_code").css("background-color","#EEEEEE");
		$("#degree_school_code").parent().css("background-color","#EEEEEE");
		$("#address_code").css("background-color","#EEEEEE");
		$("#address_code").parent().css("background-color","#EEEEEE");
		$("#degree_school").parent().parent().next().append("

");
		$("#address_birth").parent().parent().next().append("

");
		$("#address").parent().parent().next().append("

");

		$('#form').append('

<input type="submit" value="'+top.getIl8n('add')+'" id="oa_person__submit" class="l-button l-button-submit" />' );

		var v = $('#form').validate({
			debug: true,
			//JS前端验证错误
			errorPlacement: function (lable, element) {
				if (element.hasClass("l-text-field")) {
					element.parent().addClass("l-text-invalid");
				}
			},
			//JS前端验证通过
			success: function (lable) {
				var element = $("[ligeruiid="+$(lable).attr('for')+"]",$("form"));
				if (element.hasClass("l-text-field")) {
					element.parent().removeClass("l-text-invalid");
				}
			},
			//提交表单,在表单内 submit 元素提交之后,要与后台通信
			submitHandler: function () {
				if(oa_person.ajaxState)return;
				oa_person.ajaxState = true;
				$("#oa_person__submit").attr("value",top.getIl8n('waitting'));

				var data = {};

				var doms = $("input[type='text']",$('#form'));
				for(var i=0;i<doms.length;i++){
					var theid = $(doms[i]).attr('id');
					var thetype = $(doms[i]).attr('ltype');

					var thevalue = $.ligerui.get(theid).getValue();
					if(thetype=='date')thevalue = $('#'+theid).val();
					if(thevalue!="" && thevalue!=0 && thevalue!="0" && thevalue!=null){
						eval("data."+theid+"='"+thevalue+"'");
					}
				}

				$.ajax({
					url: config_path__oa_person__add,
					data: {
		                 executor: top.basic_user.loginData.username
		                ,session: top.basic_user.loginData.session

						,data: $.ligerui.toJSON(data)
					},
					type: "POST",
					dataType: 'json',
					success: function(response) {
						//服务端添加成功,修改 AJAX 通信状态,修改按钮的文字信息,读取反馈信息
						if(response.status=="1"){
							basic_user.ajaxState = false;
							alert(top.getIl8n('done'));
							$("#oa_person__submit").attr("value", top.getIl8n('submit') );
							top.myglobal.personid = response.id;
						//服务端添加失败
						}else{
							alert(response.msg);
							basic_user.ajaxState = false;
							$("#oa_person__submit").attr("value", top.getIl8n('submit') );
						}
					},
					error : function(){
						alert(top.il8n.disConnect);
					}
				});
			}
		});
	}

	//AJAX 通信状态,如果为TRUE,则表示服务端还在通信中
	,ajaxState: false
	,modify: function(){

		var config = {
			id: 'oa_person__modify',
			fields: [
				 { display: top.getIl8n('name'), name: "name", validate: { required:true }, type: "text" }

				,{ display: top.getIl8n('oa_person','birthday'), name: "birthday", type: "date" }
				,{ display: top.getIl8n('oa_person','card'), name: "card", type: "select", options :{data : oa_person.config.card, valueField : "code" , textField: "value", slide: false } }
				,{ display: top.getIl8n('oa_person','cardid'), name: "cardid", type: "text"}

				,{ display: top.getIl8n('oa_person','height'), name: "height", type: "number" }

				,{ display: top.getIl8n('oa_person','cellphone'), name: "cellphone", type: "number" }
				,{ display: top.getIl8n('oa_person','email'), name: "email", type: "text" }
				,{ display: top.getIl8n('oa_person','qq'), name: "qq", type: "number", newline: false }

				,{ display: top.getIl8n('oa_person','nationality'), name: "nationality", type: "text" }

				,{ display: top.getIl8n('oa_person','nation'), name: "nation", type: "select", options :{data : oa_person.config.nation, valueField : "code" , textField: "value", slide: false }, newline: false  }
				,{ display: top.getIl8n('oa_person','gender'), name: "gender", type: "select", options :{data : oa_person.config.gender, valueField : "code" , textField: "value", slide: false } }
				,{ display: top.getIl8n('oa_person','marriage'), name: "marriage", type: "select", options :{data : oa_person.config.marriage, valueField : "code" , textField: "value", slide: false }, newline: false  }
				,{ display: top.getIl8n('oa_person','degree'), name: "degree", type: "select", options :{data : oa_person.config.degree, valueField : "code" , textField: "value", slide: false } }
				,{ display: top.getIl8n('oa_person','politically'), name: "politically", type: "select", options :{data : oa_person.config.politically, valueField : "code" , textField: "value", slide: false }, newline: false  }

				,{ display: top.getIl8n('oa_person','photo'), name: "photo", type: "text" }

				,{ display: top.getIl8n('oa_person','degree_school'), name: "degree_school", type: "text" }
				,{ display: top.getIl8n('oa_person','degree_school_code'), name: "degree_school_code", type: "text" , newline: false}
				,{ display: top.getIl8n('oa_person','address_birth'), name: "address_birth", type: "text" }
				,{ display: top.getIl8n('oa_person','address_birth_code'), name: "address_birth_code", type: "text" , newline: false }
				,{ display: top.getIl8n('oa_person','address'), name: "address", type: "text" }
				,{ display: top.getIl8n('oa_person','address_code'), name: "address_code", type: "text" , newline: false }

			]
		};

		$(document.body).append("<form id='form'></form>");
		$('#form').ligerForm(config);

		$("#photo").attr("disabled",true);
		$("#photo").css("background-color","#EEEEEE");
		$("#photo").parent().css("background-color","#EEEEEE");
		$("#photo").parent().parent().next().css("width","80px").append("

");
		$('#form').append("");

		$("#address_birth_code").attr("disabled",true);
		$("#degree_school_code").attr("disabled",true);
		$("#address_code").attr("disabled",true);
		$("#address_birth_code").css("background-color","#EEEEEE");
		$("#address_birth_code").parent().css("background-color","#EEEEEE");
		$("#degree_school_code").css("background-color","#EEEEEE");
		$("#degree_school_code").parent().css("background-color","#EEEEEE");
		$("#address_code").css("background-color","#EEEEEE");
		$("#address_code").parent().css("background-color","#EEEEEE");
		$("#degree_school").parent().parent().next().append("

");
		$("#address_birth").parent().parent().next().append("

");
		$("#address").parent().parent().next().append("

");

		$('#form').append('

<input type="submit" value="'+top.getIl8n('modify')+'" id="oa_person__submit" class="l-button l-button-submit" />' );

		var v = $('#form').validate({
			debug: true,
			//JS前端验证错误
			errorPlacement: function (lable, element) {
				if (element.hasClass("l-text-field")) {
					element.parent().addClass("l-text-invalid");
				}
			},
			//JS前端验证通过
			success: function (lable) {
				var element = $("[ligeruiid="+$(lable).attr('for')+"]",$("form"));
				if (element.hasClass("l-text-field")) {
					element.parent().removeClass("l-text-invalid");
				}
			},
			//提交表单,在表单内 submit 元素提交之后,要与后台通信
			submitHandler: function () {
				if(basic_user.ajaxState)return;
				basic_user.ajaxState = true;
				$("#oa_person__submit").attr("value",top.getIl8n('waitting'));

				var data = {};

				var doms = $("input[type='text']",$('#form'));
				for(var i=0;i<doms.length;i++){
					var theid = $(doms[i]).attr('id');
					var thetype = $(doms[i]).attr('ltype');

					var thevalue = $.ligerui.get(theid).getValue();
					if(thetype=='date')thevalue = $('#'+theid).val();
					if(thevalue!="" && thevalue!=0 && thevalue!="0" && thevalue!=null){
						eval("data."+theid+"='"+thevalue+"'");
					}
				}

				data.id = getParameter("id", window.location.toString() );

				$.ajax({
					url: config_path__oa_person__modify,
					data: {
		                 executor: top.basic_user.loginData.username
		                ,session: top.basic_user.loginData.session

						,data: $.ligerui.toJSON(data)
					},
					type: "POST",
					dataType: 'json',
					success: function(response) {
						//服务端添加成功,修改 AJAX 通信状态,修改按钮的文字信息,读取反馈信息
						if(response.status=="1"){
							basic_user.ajaxState = false;
							alert(top.getIl8n('done'));
							$("#oa_person__submit").attr("value", top.getIl8n('submit') );
							top.myglobal.personid = response.id;
						//服务端添加失败
						}else{
							alert(response.msg);
							basic_user.ajaxState = false;
							$("#oa_person__submit").attr("value", top.getIl8n('submit') );
						}
					},
					error : function(){
						alert(top.il8n.disConnect);
					}
				});
			}
		});

		$.ajax({
			url: config_path__oa_person__view
			,data: {
				id: getParameter("id", window.location.toString() )

				//服务端权限验证所需
				,executor: top.basic_user.loginData.username
				,session: top.basic_user.loginData.session
			}
			,type: "POST"
			,dataType: 'json'
			,success: function(response) {
				if(response.status!="1"){
					alert(response.msg);
					return;
				}
			    var data = response.data;
			    for (x in data) {
			    	if(x.substring(x.length-1,x.length)=="_"){
			    		eval("delete data."+x+";");
			    	}
			    }

			    for (x in data) {
			    	if(x=="id")continue;

			    	eval("var thevalue = data."+x+";");
			    	if(x=="types")thevalue = thevalue.replace(",",";");
			    	if(x=="expert_gruops")thevalue = thevalue.replace(",",";");

			    	$.ligerui.get(x).setValue(thevalue);

			    }

			    $('#person_photo__img').attr("src",data.photo);
			}
		});
	}

	,view: function(){
		var id = getParameter("id", window.location.toString() );
    	$(document.body).html("

");
    	var htmls = "";
    	$.ajax({
            url: config_path__oa_person__view
            ,data: {
                id: id

                ,executor: top.basic_user.loginData.username
                ,session: top.basic_user.loginData.session
            },
            type: "POST",
            dataType: 'json',
            success: function(response) {
            	if(response.status!="1")return;
            	var data = response.data;

            	if(typeof(data.photo)=="undefined") data.photo = '../file/tavatar.gif';
            	for(var j in data){
            		if(j=='sql'||j=='card'||j=='gender'||j=='nation'||j=='ismarried'||j=='degree'||j=='politically')continue;
            		if(j=='photo'){
        				htmls += '

'
        				continue;
            		}
            		if(j=='id'||j=='remark')htmls+="
";

            		if(j=='remark'||j=='types_'||j=='degree_school'||j=='address_birth'||j=='address'||j=='cardid'){
	            		eval("var key = getIl8n('oa_person','"+j+"');");
	            		htmls += ""+key+""+data[j]+"";
            		}else{
            			eval("var key = getIl8n('oa_person','"+j+"');");
                		htmls += ""+key+""+data[j]+"";
            		}
            	};

            	$("#content").html(htmls);
            }
		});
	}
};


text:
  Les Menus est
       un village
       situé dans le département de l'Orne en Basse-Normandie. On dénombrait 185 habitants en 2008.

Le nombre de logements, à Les Menus, se décomposait en 2011 en zero appartements et 118 maisons soit
 un marché plutôt équilibré.

Si vous envisagez de demenager à Les Menus, vous pourrez aisément trouver une maison à acheter.

À proximité de Les Menus sont positionnées géographiquement les villes de
Senonches à 8 km, 3 232 habitants,
Meaucé à 6 km, 518 habitants,
Le Pas-Saint-l'Homer située à 3 km, 114 habitants,
La Madeleine-Bouvet localisée à 6 km, 377 habitants,
Vaupillon à 8 km, 461 habitants,
Les Ressuintes à 7 km, 145 habitants,
 entre autres. De plus, Les Menus est située à seulement 23 km de Nogent-le-Rotrou.


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Xerces-C++: SecurityManager.hpp File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">

Main Page

Related Pages

Classes

Files

SecurityManager.hpp File Reference

Go to the source code of this file.

Classes

class  	SecurityManager

 	Allow application to force the parser to behave in a security-conscious way.  More...

Defines

#define 	XERCESC_INCLUDE_GUARD_SECURITYMANAGER_HPP

Define Documentation

          #define XERCESC_INCLUDE_GUARD_SECURITYMANAGER_HPP

<address style="text-align: right;">Generated on Wed Apr 21 17:55:49 2010 for Xerces-C++ by

 1.5.6 </address>


text:
package main

import (
	"net/http"

	"github.com/1and1/soma/internal/msg"
	"github.com/1and1/soma/lib/proto"
	"github.com/julienschmidt/httprouter"
)

func OutputTree(w http.ResponseWriter, r *http.Request,
	params httprouter.Params) {
	defer PanicCatcher(w)

	if params.ByName(`tree`) != `tree` {
		DispatchBadRequest(&w, nil)
		return
	}
	treeT := ``
	switch {
	case params.ByName(`repository`) != ``:
		treeT = `repository`
	case params.ByName(`bucket`) != ``:
		treeT = `bucket`
	case params.ByName(`group`) != ``:
		treeT = `group`
	case params.ByName(`cluster`) != ``:
		treeT = `cluster`
	case params.ByName(`node`) != ``:
		treeT = `node`
	default:
		DispatchBadRequest(&w, nil)
		return
	}

	returnChannel := make(chan msg.Result)
	handler := handlerMap[`tree_r`].(*outputTree)
	handler.input <- msg.Request{
		Type:       `tree`,
		Action:     `output_tree`,
		Reply:      returnChannel,
		RemoteAddr: extractAddress(r.RemoteAddr),
		User:       params.ByName(`AuthenticatedUser`),
		Tree: proto.Tree{
			Id:   params.ByName(treeT),
			Type: treeT,
		},
		IsAdmin: false,
	}
	result := <-returnChannel
	SendMsgResult(&w, &result)
}

// vim: ts=4 sw=4 sts=4 noet fenc=utf-8 ffs=unix


text:
[Instructions here](https://github.com/oci-pronghorn/FogLighter/blob/master/README.md)
# Example Project:
The following sketch demonstrates a simple application using the Light Sensor: when the light sensor detects a dark enough room, the LED light will turn on, otherwise the LED will stay off.
Demo code:
```java
package com.ociweb.grove;
import static com.ociweb.iot.grove.AnalogDigitalTwig.*;
import com.ociweb.iot.maker.*;
import static com.ociweb.iot.maker.Port.*;

public class IoTApp implements FogApp
{
    private static final Port LIGHT_SENSOR_PORT= A2;
    private static final Port LED_PORT = D2;

    private static final int darkValue = 350; //Light reading that will turn on the light

    public static void main( String[] args ) {
        FogRuntime.run(new IoTApp());
    }
    @Override
    public void declareConnections(Hardware c) {
        c.connect(LightSensor, LIGHT_SENSOR_PORT);
        c.connect(LED, LED_PORT, 200); //200 is the rate in milliseconds to update the device data
    }

    @Override
    public void declareBehavior(FogRuntime runtime) {
    	final FogCommandChannel lcdScreenChannel = runtime.newCommandChannel(DYNAMIC_MESSAGING);
    	runtime.addAnalogListener((port, time, durationMillis, average, value)->{
    		lcdScreenChannel.setValue(LED_PORT, value < darkValue);
    		System.out.println(value);
    	});
    }
}
```
When executed, the above code will cause the light sensor on A2 (analog output 2) to continuously print out the value of light present in the room. If the value drops below the darkValue (350), the LED light on D2 (digatal output 2) will turn on.


text:
package jarvis

//Licensed under the Apache License, Version 2.0 (the "License");
//you may not use this file except in compliance with the License.
//You may obtain a copy of the License at
//
//http://www.apache.org/licenses/LICENSE-2.0
//
//Unless required by applicable law or agreed to in writing, software
//distributed under the License is distributed on an "AS IS" BASIS,
//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//See the License for the specific language governing permissions and
//limitations under the License.
//
// Code generated by Alibaba Cloud SDK Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

import (
	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
)

// DescribeConsoleAccessWhiteList invokes the jarvis.DescribeConsoleAccessWhiteList API synchronously
// api document: https://help.aliyun.com/api/jarvis/describeconsoleaccesswhitelist.html
func (client *Client) DescribeConsoleAccessWhiteList(request *DescribeConsoleAccessWhiteListRequest) (response *DescribeConsoleAccessWhiteListResponse, err error) {
	response = CreateDescribeConsoleAccessWhiteListResponse()
	err = client.DoAction(request, response)
	return
}

// DescribeConsoleAccessWhiteListWithChan invokes the jarvis.DescribeConsoleAccessWhiteList API asynchronously
// api document: https://help.aliyun.com/api/jarvis/describeconsoleaccesswhitelist.html
// asynchronous document: https://help.aliyun.com/document_detail/66220.html
func (client *Client) DescribeConsoleAccessWhiteListWithChan(request *DescribeConsoleAccessWhiteListRequest) (<-chan *DescribeConsoleAccessWhiteListResponse, <-chan error) {
	responseChan := make(chan *DescribeConsoleAccessWhiteListResponse, 1)
	errChan := make(chan error, 1)
	err := client.AddAsyncTask(func() {
		defer close(responseChan)
		defer close(errChan)
		response, err := client.DescribeConsoleAccessWhiteList(request)
		if err != nil {
			errChan <- err
		} else {
			responseChan <- response
		}
	})
	if err != nil {
		errChan <- err
		close(responseChan)
		close(errChan)
	}
	return responseChan, errChan
}

// DescribeConsoleAccessWhiteListWithCallback invokes the jarvis.DescribeConsoleAccessWhiteList API asynchronously
// api document: https://help.aliyun.com/api/jarvis/describeconsoleaccesswhitelist.html
// asynchronous document: https://help.aliyun.com/document_detail/66220.html
func (client *Client) DescribeConsoleAccessWhiteListWithCallback(request *DescribeConsoleAccessWhiteListRequest, callback func(response *DescribeConsoleAccessWhiteListResponse, err error)) <-chan int {
	result := make(chan int, 1)
	err := client.AddAsyncTask(func() {
		var response *DescribeConsoleAccessWhiteListResponse
		var err error
		defer close(result)
		response, err = client.DescribeConsoleAccessWhiteList(request)
		callback(response, err)
		result <- 1
	})
	if err != nil {
		defer close(result)
		callback(nil, err)
		result <- 0
	}
	return result
}

// DescribeConsoleAccessWhiteListRequest is the request struct for api DescribeConsoleAccessWhiteList
type DescribeConsoleAccessWhiteListRequest struct {
	*requests.RpcRequest
	SrcIP         string           `position:"Query" name:"SrcIP"`
	SourceIp      string           `position:"Query" name:"SourceIp"`
	PageSize      requests.Integer `position:"Query" name:"PageSize"`
	QueryProduct  string           `position:"Query" name:"queryProduct"`
	CurrentPage   requests.Integer `position:"Query" name:"CurrentPage"`
	WhiteListType requests.Integer `position:"Query" name:"WhiteListType"`
	DstIP         string           `position:"Query" name:"DstIP"`
	Lang          string           `position:"Query" name:"Lang"`
	Status        string           `position:"Query" name:"Status"`
	SourceCode    string           `position:"Query" name:"SourceCode"`
}

// DescribeConsoleAccessWhiteListResponse is the response struct for api DescribeConsoleAccessWhiteList
type DescribeConsoleAccessWhiteListResponse struct {
	*responses.BaseResponse
	RequestId string   `json:"RequestId" xml:"RequestId"`
	Module    string   `json:"module" xml:"module"`
	PageInfo  PageInfo `json:"PageInfo" xml:"PageInfo"`
	DataList  []Data   `json:"DataList" xml:"DataList"`
}

// CreateDescribeConsoleAccessWhiteListRequest creates a request to invoke DescribeConsoleAccessWhiteList API
func CreateDescribeConsoleAccessWhiteListRequest() (request *DescribeConsoleAccessWhiteListRequest) {
	request = &DescribeConsoleAccessWhiteListRequest{
		RpcRequest: &requests.RpcRequest{},
	}
	request.InitWithApiInfo("jarvis", "2018-02-06", "DescribeConsoleAccessWhiteList", "jarvis", "openAPI")
	return
}

// CreateDescribeConsoleAccessWhiteListResponse creates a response to parse from DescribeConsoleAccessWhiteList response
func CreateDescribeConsoleAccessWhiteListResponse() (response *DescribeConsoleAccessWhiteListResponse) {
	response = &DescribeConsoleAccessWhiteListResponse{
		BaseResponse: &responses.BaseResponse{},
	}
	return
}


text:
from django.shortcuts import render, redirect
from django.http import HttpResponse

def sdtd(request):
	return render(request, 'sdtd/serverlist.html')

def screenshots(request):
	return render(request, 'sdtd/screenshots/screenshots.html')

def whisperwind(request):
    return render(request, 'sdtd/whisperwind/whisperwindmain.html')

def wwrules(request):
    return render(request, 'sdtd/whisperwind/wwpages/rules.html')

def wwcommands(request):
    return render(request, 'sdtd/whisperwind/wwpages/commands.html')

def wwdonations(request):
    return render(request, 'sdtd/whisperwind/wwpages/donations.html')

def karazhan(request):
    return render(request, 'sdtd/karazhan/karazhanmain.html')

def kararules(request):
    return render(request, 'sdtd/karazhan/karapages/rules.html')

def karacommands(request):
    return render(request, 'sdtd/karazhan/karapages/commands.html')

def karadonations(request):
    return render(request, 'sdtd/karazhan/karapages/donations.html')

def lightbringer(request):
    return render(request, 'sdtd/lightbringer/lightbringermain.html')

def lbinstall(request):
    return render(request, 'sdtd/lightbringer/lbpages/install.html')

def lbrules(request):
    return render(request, 'sdtd/lightbringer/lbpages/rules.html')

def lbcommands(request):
    return render(request, 'sdtd/lightbringer/lbpages/commands.html')

def lbdonations(request):
    return render(request, 'sdtd/lightbringer/lbpages/donations.html')

def northshire(request):
    return render(request, 'sdtd/northshirevalley/northshiremain.html')

def nvrules(request):
    return render(request, 'sdtd/northshirevalley/nvpages/rules.html')

def nvcommands(request):
    return render(request, 'sdtd/northshirevalley/nvpages/commands.html')

def nvdonations(request):
    return render(request, 'sdtd/northshirevalley/nvpages/donations.html')

def daggerspine(request):
    return render(request, 'sdtd/daggerspine/daggerspinemain.html')

def dsrules(request):
    return render(request, 'sdtd/daggerspine/dspages/rules.html')

def dscommands(request):
    return render(request, 'sdtd/daggerspine/dspages/commands.html')

def dsdonations(request):
    return render(request, 'sdtd/daggerspine/dspages/donations.html')


text:
package frame

import (
	"io"
	"sync"
)

// Client provides bidirectional outgoing framed communication.
//
// It allows sending framed requests where each request has a corresponding
// response. Only one active request is allowed at a time. Other requests are
// blocked while a request is ongoing.
type Client struct {
	sync.Mutex

	r *Reader
	w *Writer
}

// NewClient builds a new Client which uses the given writer to send requests
// and the given reader to read their responses.
func NewClient(w io.Writer, r io.Reader) *Client {
	return &Client{
		r: NewReader(r),
		w: NewWriter(w),
	}
}

// Send sends the given frame and returns its response.
func (c *Client) Send(b []byte) ([]byte, error) {
	c.Lock()
	defer c.Unlock()

	if err := c.w.Write(b); err != nil {
		return nil, err
	}
	return c.r.Read()
}


text:
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/vmmigration/v1/vmmigration.proto

namespace Google\Cloud\VMMigration\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * NetworkInterface represents a NIC of a VM.
 *
 * Generated from protobuf message google.cloud.vmmigration.v1.NetworkInterface
 */
class NetworkInterface extends \Google\Protobuf\Internal\Message
{
    /**
     * The network to connect the NIC to.
     *
     * Generated from protobuf field string network = 1;
     */
    private $network = '';
    /**
     * The subnetwork to connect the NIC to.
     *
     * Generated from protobuf field string subnetwork = 2;
     */
    private $subnetwork = '';
    /**
     * The internal IP to define in the NIC.
     * The formats accepted are: `ephemeral` \ ipv4 address \ a named address
     * resource full path.
     *
     * Generated from protobuf field string internal_ip = 3;
     */
    private $internal_ip = '';
    /**
     * The external IP to define in the NIC.
     *
     * Generated from protobuf field string external_ip = 4;
     */
    private $external_ip = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $network
     *           The network to connect the NIC to.
     *     @type string $subnetwork
     *           The subnetwork to connect the NIC to.
     *     @type string $internal_ip
     *           The internal IP to define in the NIC.
     *           The formats accepted are: `ephemeral` \ ipv4 address \ a named address
     *           resource full path.
     *     @type string $external_ip
     *           The external IP to define in the NIC.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce();
        parent::__construct($data);
    }

    /**
     * The network to connect the NIC to.
     *
     * Generated from protobuf field string network = 1;
     * @return string
     */
    public function getNetwork()
    {
        return $this->network;
    }

    /**
     * The network to connect the NIC to.
     *
     * Generated from protobuf field string network = 1;
     * @param string $var
     * @return $this
     */
    public function setNetwork($var)
    {
        GPBUtil::checkString($var, True);
        $this->network = $var;

        return $this;
    }

    /**
     * The subnetwork to connect the NIC to.
     *
     * Generated from protobuf field string subnetwork = 2;
     * @return string
     */
    public function getSubnetwork()
    {
        return $this->subnetwork;
    }

    /**
     * The subnetwork to connect the NIC to.
     *
     * Generated from protobuf field string subnetwork = 2;
     * @param string $var
     * @return $this
     */
    public function setSubnetwork($var)
    {
        GPBUtil::checkString($var, True);
        $this->subnetwork = $var;

        return $this;
    }

    /**
     * The internal IP to define in the NIC.
     * The formats accepted are: `ephemeral` \ ipv4 address \ a named address
     * resource full path.
     *
     * Generated from protobuf field string internal_ip = 3;
     * @return string
     */
    public function getInternalIp()
    {
        return $this->internal_ip;
    }

    /**
     * The internal IP to define in the NIC.
     * The formats accepted are: `ephemeral` \ ipv4 address \ a named address
     * resource full path.
     *
     * Generated from protobuf field string internal_ip = 3;
     * @param string $var
     * @return $this
     */
    public function setInternalIp($var)
    {
        GPBUtil::checkString($var, True);
        $this->internal_ip = $var;

        return $this;
    }

    /**
     * The external IP to define in the NIC.
     *
     * Generated from protobuf field string external_ip = 4;
     * @return string
     */
    public function getExternalIp()
    {
        return $this->external_ip;
    }

    /**
     * The external IP to define in the NIC.
     *
     * Generated from protobuf field string external_ip = 4;
     * @param string $var
     * @return $this
     */
    public function setExternalIp($var)
    {
        GPBUtil::checkString($var, True);
        $this->external_ip = $var;

        return $this;
    }

}


text:
#!/bin/bash

# 1. commit to bump the version and update the changelog/readme
# 2. tag that commit
# 3. use dist.sh to produce tar.gz for all platforms
# 4. aws s3 cp dist s3://bitly-downloads/nsq/ --recursive --include "nsq-1.2.1*" --profile bitly --acl public-read
# 5. docker manifest push nsqio/nsq:latest
# 6. push to nsqio/master
# 7. update the release metadata on github / upload the binaries
# 8. update nsqio/nsqio.github.io/_posts/2014-03-01-installing.md
# 9. send release announcement emails
# 10. update IRC channel topic
# 11. tweet

set -e

DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
rm -rf   $DIR/dist/docker
mkdir -p $DIR/dist/docker

GOFLAGS='-ldflags="-s -w"'
version=$(awk '/const Binary/ {print $NF}' < $DIR/internal/version/binary.go | sed 's/"//g')
goversion=$(go version | awk '{print $3}')

echo "... running tests"
./test.sh

export GO111MODULE=on
for target in "linux/amd64" "linux/arm64" "darwin/amd64" "darwin/arm64" "freebsd/amd64" "windows/amd64"; do
    os=${target%/*}
    arch=${target##*/}
    echo "... building v$version for $os/$arch"
    BUILD=$(mktemp -d ${TMPDIR:-/tmp}/nsq-XXXXX)
    TARGET="nsq-$version.$os-$arch.$goversion"
    GOOS=$os GOARCH=$arch CGO_ENABLED=0 \
        make DESTDIR=$BUILD PREFIX=/$TARGET BLDFLAGS="$GOFLAGS" install
    pushd $BUILD
    sudo chown -R 0:0 $TARGET
    tar czvf $TARGET.tar.gz $TARGET
    mv $TARGET.tar.gz $DIR/dist
    popd
    make clean
    sudo rm -r $BUILD
done

rnd=$(LC_ALL=C tr -dc 'a-zA-Z0-9' < /dev/urandom | head -c10)
docker buildx create --use --name nsq-$rnd
docker buildx build --tag nsqio/nsq:v$version --platform linux/amd64,linux/arm64 .
if [[ ! $version == *"-"* ]]; then
    echo "Tagging nsqio/nsq:v$version as the latest release"
    shas=$(docker manifest inspect nsqio/nsq:$version |\
        grep digest | awk '{print $2}' | sed 's/[",]//g' | sed 's/^/nsqio\/nsq@/')
    docker manifest create nsqio/nsq:latest $shas
fi