text:
import React, { Component } from 'react';
import {
  AsyncStorage,
  Image,
  StatusBar,
  StyleSheet,
  Text,
  TouchableHighlight,
  View } from 'react-native';
import moment from 'moment';
import { Actions } from 'react-native-router-flux';

import AreaPicker from '../components/AreaPicker';
import DatePicker from '../components/DatePicker';
import Loading from '../components/Loading';

import eventConverter from '../converters/event';
import scheduleConverter from '../converters/schedule';
import theatreAreaConverter from '../converters/theatreArea';

require('moment/locale/fi');

const styles = StyleSheet.create({
  button: {
    alignItems: 'center',
    marginBottom: 10,
    marginTop: 10,
  },
  container: {
    backgroundColor: '#334d5d',
    flex: 1,
    flexDirection: 'column',
    justifyContent: 'space-between',
    paddingBottom: 5,
    paddingLeft: 5,
    paddingRight: 5,
  },
  logo: {
    height: 180,
    width: 180,
  },
  logoContainer: {
    alignItems: 'center',
    paddingTop: 30,
  },
  pickerTitle: {
    color: '#e6e6e6',
    fontSize: 28,
  },
});

const defaultAreaID = '1029';
const logo = require('../images/logo.png');

class Home extends Component {
  state = {
    areaDates: [],
    areas: [],
    loadingAreas: true,
    loadingMovies: true,
    movies: [],
    schedule: [],
    selectedAreaID: defaultAreaID,
    selectedAreaName: 'Valitse alue/teatteri',
    selectedDate: new Date(),
    showAreaPicker: false,
    showDatePicker: false,
    showShowScheduleButton: false,
  };

  componentDidMount() {
    try {
      AsyncStorage.getItem('savedAreaID').then((value) => {
        if (value !== null) {
          this.setState({
            selectedAreaID: value,
            isLoading: false,
          });
        }
      }).done();
    } catch (e) {
      AsyncStorage.setItem('savedAreaID', defaultAreaID);
    }
    this.fetchAreas();
    this.fetchMovies();
  }

  fetchAreas = () => {
    const request = new XMLHttpRequest();
    request.onreadystatechange = () => {
      if (request.readyState !== 4) {
        return;
      }
      if (request.status === 200) {
        const areas = theatreAreaConverter(request.responseText);
        this.setState({
          areas,
          loadingAreas: false,
          selectedAreaName: areas.find(x => x.ID === this.state.selectedAreaID).Name,
        });
        if (this.state.selectedAreaID !== defaultAreaID) {
          this.fetchSchedule(this.state.selectedAreaID, this.state.selectedDate);
        }
      }
    };
    request.open('GET', 'http://www.finnkino.fi/xml/TheatreAreas/');
    request.send();
  }

  fetchMovies = () => {
    const request = new XMLHttpRequest();
    request.onreadystatechange = () => {
      if (request.readyState !== 4) {
        return;
      }
      if (request.status === 200) {
        this.setState({
          loadingMovies: false,
          movies: eventConverter(request.responseText),
        });
      }
    };
    const url = 'http://www.finnkino.fi/xml/Events?includeLinks=true&includeGallery=true&includePictures=true';
    request.open('GET', url);
    request.send();
  }

  isUpcoming = value => moment(value.dttmShowStart).isAfter(this.state.selectedDate);

  fetchSchedule = (areaID, date) => {
    if (areaID === defaultAreaID) {
      this.setState({
        schedule: [],
        showShowScheduleButton: false,
      });
    } else {
      const request = new XMLHttpRequest();
      request.onreadystatechange = () => {
        if (request.readyState !== 4) {
          return;
        }
        if (request.status === 200) {
          const requestResult = scheduleConverter(request.responseText);
          if (requestResult !== undefined && requestResult.length > 0) {
            const filteredResults = requestResult.filter(this.isUpcoming);
            if (filteredResults.length > 0) {
              this.setState({
                schedule: filteredResults,
                showShowScheduleButton: true,
              });
            }
          } else {
            this.setState({
              schedule: [],
              showShowScheduleButton: false,
            });
          }
        }
      };
      const url = `http://www.finnkino.fi/xml/Schedule?area=${areaID}&dt=${moment(date).format('DD.MM.YYYY')}`;
      request.open('GET', url);
      request.send();
    }
  }

  handleAreaChange = (id) => {
    AsyncStorage.setItem('savedAreaID', id);
    this.setState({
      selectedAreaID: id,
      selectedAreaName: this.state.areas.find(x => x.ID === id).Name,
    });
    this.fetchSchedule(id, this.state.selectedDate);
  }

  handleDateChange = (selectedDate) => {
    this.setState({
      selectedDate,
    });
    this.fetchSchedule(this.state.selectedAreaID, selectedDate);
  }

  toggleAreaPicker = () => {
    if (!this.state.showAreaPicker) {
      this.setState({
        showAreaPicker: true,
        showDatePicker: false,
      });
    } else {
      this.setState({
        showAreaPicker: false,
      });
    }
  }

  toggleDatePicker = () => {
    if (!this.state.showDatePicker) {
      this.setState({
        showDatePicker: true,
        showAreaPicker: false,
      });
    } else {
      this.setState({
        showDatePicker: false,
      });
    }
  }

  showShowScheduleButtonStyle = () => {
    if (this.state.showShowScheduleButton) {
      return {
        color: '#efc84a',
        fontSize: 28,
      };
    }
    return {
      color: '#334d5d',
      fontSize: 28,
    };
  }

  render() {
    const goToMovieList = () => {
      this.setState({
        showAreaPicker: false,
        showDatePicker: false,
      });
      Actions.movielist({
        movies: this.state.movies,
        schedule: this.state.schedule,
      });
    };

    if (this.state.loadingAreas || this.state.loadingMovies) {
      return <Loading />;
    }

    return (
      <View style={styles.container}>
        <StatusBar backgroundColor="blue" barStyle="light-content" />
        <View style={styles.logoContainer}>
          <Image style={styles.logo} source={logo} />
        </View>
        <View>
          <TouchableHighlight
            style={styles.button}
            onPress={this.toggleAreaPicker}
            underlayColor="#334d5d"
          >
            <Text style={styles.pickerTitle}>{this.state.selectedAreaName}</Text>
          </TouchableHighlight>
          <TouchableHighlight
            style={styles.button}
            onPress={this.toggleDatePicker}
            underlayColor="#334d5d"
          >
            <Text style={styles.pickerTitle}>{moment(this.state.selectedDate).format('D.M.YYYY HH:mm')}</Text>
          </TouchableHighlight>
          <TouchableHighlight
            style={styles.button}
            onPress={goToMovieList}
            underlayColor="#334d5d"
          >
            <Text style={this.showShowScheduleButtonStyle()}>Näytä elokuvat</Text>
          </TouchableHighlight>
          {this.state.showAreaPicker ?
            <AreaPicker
              areas={this.state.areas}
              onValueChange={this.handleAreaChange}
              selectedAreaID={this.state.selectedAreaID}
            /> : null}
          {this.state.showDatePicker ?
            <DatePicker
              areaDates={this.state.areaDates}
              onDateChange={this.handleDateChange}
              selectedDate={this.state.selectedDate}
            /> : null}
        </View>
      </View>
    );
  }
}

export default Home;


text:
require 'spec_helper'

describe Instrumental::Command, "basic functions of command structs" do
  it "should not allow bad arguments to command#+" do
    command = Instrumental::Command.new("gauge", "abc", 1, Time.at(0), 1)

    # nil is a no-op
    expect(command + nil).to eq(command)
    # it will change the top of the other command
    expect(command + Instrumental::Command.new("increment", "abc", 1, Time.at(0), 1))
      .to eq(Instrumental::Command.new("gauge", "abc", 2, Time.at(0), 2))
  end

  it "should add together with like commands" do
    command = Instrumental::Command.new("gauge", "abc", 1, Time.at(0), 1)
    other   = Instrumental::Command.new("gauge", "abc", 2, Time.at(0), 4)
    expect(command + other).to eq(Instrumental::Command.new("gauge", "abc", 3, Time.at(0), 5))
  end
end

redpajama_set_name: RedPajamaGithub


text:
body { padding-top: 50px; }
.top-buffer { padding-top: 20px }
.top-buffer-small { padding-top: 5px }


text:
package de.prim.avilight.gui.dlg;

import de.prim.avilight.gui.AviLightComboBoxModel;

public class ReceiverChannelComboModel extends AviLightComboBoxModel<String>
{
  public static final String[] MODES =
                                     { "Normal", "Invertiert", "Gesperrt" };

  @Override
  public String getElementAt( int index )
  {
    return MODES[index];
  }

  @Override
  public int getSize()
  {
    return MODES.length;
  }

}


text:
package com.regosen.dailyfuzzy.models;

import android.util.Log;

import org.json.JSONObject;

import java.util.Arrays;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * This is a class that holds the data of the JSON objects
 * returned by the Reddit API.
 *
 * original author Hathy, modified by Rego Sen
 */
public class Post {

    private static final String IMAGE_URL_BASE = "http://i.imgur.com/";

    private static final String JSON_TAG_TITLE = "title";
    private static final String JSON_TAG_ID = "id";
    private static final String JSON_TAG_URL_PRE = "url";
    private static final String JSON_TAG_URL_POST = "link";
    private static final String JSON_TAG_THUMB = "thumbnail";

    private static List<String> ALLOWED_EXTENSIONS;

    public String title;
    public String id;
    public String thumb;
    public String link;

    public static String getExtension(String url)
    {
        if (url == null)
        {
            return null;
        }
        return url.substring(url.lastIndexOf(".") + 1, url.length()).toLowerCase();
    }

    private static boolean fileAllowed(String fileName) {
        String ext = getExtension(fileName);
        if (ALLOWED_EXTENSIONS == null)
        {
            // TODO: is there a cleaner way to do this?
            String[] temp = {"jpg","jpeg","png","gif","gifv","mp4","webm"};
            ALLOWED_EXTENSIONS = Arrays.asList(temp);
        }
        return ALLOWED_EXTENSIONS.contains(ext);
    }

    public JSONObject toJSON()
    {
        JSONObject json = new JSONObject();
        try {
            json.put(JSON_TAG_TITLE, title);
            json.put(JSON_TAG_ID, id);
            json.put(JSON_TAG_THUMB, thumb);
            json.put(JSON_TAG_URL_POST, link);
        } catch(Exception e){
            Log.e("Post.toJSON",e.toString());
            return null;
        }
        return json;
    }

    public Post(JSONObject json, boolean cached)
    {
        title = json.optString(JSON_TAG_TITLE).replace("&","&");
        id=json.optString(JSON_TAG_ID);
        thumb = json.optString(JSON_TAG_THUMB);
        if (cached) {
            link = json.optString(JSON_TAG_URL_POST);
        }
        else if ((title != null) && (id != null))
        {
            String url = json.optString(JSON_TAG_URL_PRE);
            Pattern pattern = Pattern.compile(".*imgur\\.com/(\\w+)\\.(\\w+)");
            Matcher matcher = pattern.matcher(url);
            if (matcher.matches()) {
                String imgurId = matcher.group(1);
                String base = IMAGE_URL_BASE + imgurId;
                String ext = matcher.group(2).toLowerCase();
                if (ext.equals("gifv")) {
                    link = base + ".mp4";
                }
                else {
                    link = base + "l." + ext;
                }
                thumb = base + "s.jpg";
            }
            /*
            else if (url.contains("/gfycat.com/"))
            {
                link = url.replace("/gfycat.com/","/zippy.gfycat.com/") + ".webm";
            }
            */
            else if (fileAllowed(url))
            {
                link = url;
            }
        }
    }

    public boolean isValid() { return (link != null); }

}


text:
package org.apache.flink.graph.asm.translate;

import org.apache.flink.api.common.functions.MapFunction;
import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.api.java.DataSet;
import org.apache.flink.api.java.functions.FunctionAnnotation.ForwardedFields;
import org.apache.flink.api.java.operators.translation.WrappingFunction;
import org.apache.flink.api.java.typeutils.TupleTypeInfo;
import org.apache.flink.api.java.typeutils.TypeExtractor;
import org.apache.flink.graph.Edge;
import org.apache.flink.graph.Vertex;
import org.apache.flink.util.Preconditions;

import static org.apache.flink.api.common.ExecutionConfig.PARALLELISM_DEFAULT;

/**
 * Methods for translation of the type or modification of the data of graph
 * IDs, vertex values, and edge values.
 */
public class Translate {

	// --------------------------------------------------------------------------------------------
	//  Translate vertex IDs
	// --------------------------------------------------------------------------------------------

	/**
	 * Translate {@link Vertex} IDs using the given {@link TranslateFunction}.
	 *
	 * @param vertices input vertices
	 * @param translator implements conversion from {@code OLD} to {@code NEW}
	 * @param <OLD> old vertex ID type
	 * @param <NEW> new vertex ID type
	 * @param <VV> vertex value type
	 * @return translated vertices
	 */
	public static <OLD, NEW, VV> DataSet<Vertex<NEW, VV>> translateVertexIds(DataSet<Vertex<OLD, VV>> vertices, TranslateFunction<OLD, NEW> translator) {
		return translateVertexIds(vertices, translator, PARALLELISM_DEFAULT);
	}

	/**
	 * Translate {@link Vertex} IDs using the given {@link TranslateFunction}.
	 *
	 * @param vertices input vertices
	 * @param translator implements conversion from {@code OLD} to {@code NEW}
	 * @param parallelism operator parallelism
	 * @param <OLD> old vertex ID type
	 * @param <NEW> new vertex ID type
	 * @param <VV> vertex value type
	 * @return translated vertices
	 */
	@SuppressWarnings("unchecked")
	public static <OLD, NEW, VV> DataSet<Vertex<NEW, VV>> translateVertexIds(DataSet<Vertex<OLD, VV>> vertices, TranslateFunction<OLD, NEW> translator, int parallelism) {
		Preconditions.checkNotNull(vertices);
		Preconditions.checkNotNull(translator);

		Class<Vertex<NEW, VV>> vertexClass = (Class<Vertex<NEW, VV>>) (Class<? extends Vertex>) Vertex.class;
		TypeInformation<OLD> oldType = ((TupleTypeInfo<Vertex<OLD, VV>>) vertices.getType()).getTypeAt(0);
		TypeInformation<NEW> newType = TypeExtractor.getUnaryOperatorReturnType(
			translator,
			TranslateFunction.class,
			0,
			1,
			new int[]{0},
			new int[]{1},
			oldType,
			null,
			false);
		TypeInformation<VV> vertexValueType = ((TupleTypeInfo<Vertex<OLD, VV>>) vertices.getType()).getTypeAt(1);

		TupleTypeInfo<Vertex<NEW, VV>> returnType = new TupleTypeInfo<>(vertexClass, newType, vertexValueType);

		return vertices
			.map(new TranslateVertexId<>(translator))
			.returns(returnType)
				.setParallelism(parallelism)
				.name("Translate vertex IDs");
	}

	/**
	 * Translate {@link Vertex} IDs using the given {@link TranslateFunction}.
	 *
	 * @param <OLD> old vertex ID type
	 * @param <NEW> new vertex ID type
	 * @param <VV> vertex value type
	 */
	@ForwardedFields("1")
	private static class TranslateVertexId<OLD, NEW, VV>
	extends WrappingFunction<TranslateFunction<OLD, NEW>>
	implements MapFunction<Vertex<OLD, VV>, Vertex<NEW, VV>> {
		private Vertex<NEW, VV> vertex = new Vertex<>();

		public TranslateVertexId(TranslateFunction<OLD, NEW> translator) {
			super(translator);
		}

		@Override
		public Vertex<NEW, VV> map(Vertex<OLD, VV> value)
				throws Exception {
			vertex.f0 = wrappedFunction.translate(value.f0, vertex.f0);
			vertex.f1 = value.f1;

			return vertex;
		}
	}

	// --------------------------------------------------------------------------------------------
	//  Translate edge IDs
	// --------------------------------------------------------------------------------------------

	/**
	 * Translate {@link Edge} IDs using the given {@link TranslateFunction}.
	 *
	 * @param edges input edges
	 * @param translator implements conversion from {@code OLD} to {@code NEW}
	 * @param <OLD> old edge ID type
	 * @param <NEW> new edge ID type
	 * @param <EV> edge value type
	 * @return translated edges
	 */
	public static <OLD, NEW, EV> DataSet<Edge<NEW, EV>> translateEdgeIds(DataSet<Edge<OLD, EV>> edges, TranslateFunction<OLD, NEW> translator) {
		return translateEdgeIds(edges, translator, PARALLELISM_DEFAULT);
	}

	/**
	 * Translate {@link Edge} IDs using the given {@link TranslateFunction}.
	 *
	 * @param edges input edges
	 * @param translator implements conversion from {@code OLD} to {@code NEW}
	 * @param parallelism operator parallelism
	 * @param <OLD> old edge ID type
	 * @param <NEW> new edge ID type
	 * @param <EV> edge value type
	 * @return translated edges
	 */
	@SuppressWarnings("unchecked")
	public static <OLD, NEW, EV> DataSet<Edge<NEW, EV>> translateEdgeIds(DataSet<Edge<OLD, EV>> edges, TranslateFunction<OLD, NEW> translator, int parallelism) {
		Preconditions.checkNotNull(edges);
		Preconditions.checkNotNull(translator);

		Class<Edge<NEW, EV>> edgeClass = (Class<Edge<NEW, EV>>) (Class<? extends Edge>) Edge.class;
		TypeInformation<OLD> oldType = ((TupleTypeInfo<Edge<OLD, EV>>) edges.getType()).getTypeAt(0);
		TypeInformation<NEW> newType = TypeExtractor.getUnaryOperatorReturnType(
			translator,
			TranslateFunction.class,
			0,
			1,
			new int[] {0},
			new int[] {1},
			oldType,
			null,
			false);
		TypeInformation<EV> edgeValueType = ((TupleTypeInfo<Edge<OLD, EV>>) edges.getType()).getTypeAt(2);

		TupleTypeInfo<Edge<NEW, EV>> returnType = new TupleTypeInfo<>(edgeClass, newType, newType, edgeValueType);

		return edges
			.map(new TranslateEdgeId<>(translator))
			.returns(returnType)
				.setParallelism(parallelism)
				.name("Translate edge IDs");
	}

	/**
	 * Translate {@link Edge} IDs using the given {@link TranslateFunction}.
	 *
	 * @param <OLD> old edge ID type
	 * @param <NEW> new edge ID type
	 * @param <EV> edge value type
	 */
	@ForwardedFields("2")
	private static class TranslateEdgeId<OLD, NEW, EV>
	extends WrappingFunction<TranslateFunction<OLD, NEW>>
	implements MapFunction<Edge<OLD, EV>, Edge<NEW, EV>> {
		private Edge<NEW, EV> edge = new Edge<>();

		public TranslateEdgeId(TranslateFunction<OLD, NEW> translator) {
			super(translator);
		}

		@Override
		public Edge<NEW, EV> map(Edge<OLD, EV> value)
				throws Exception {
			edge.f0 = wrappedFunction.translate(value.f0, edge.f0);
			edge.f1 = wrappedFunction.translate(value.f1, edge.f1);
			edge.f2 = value.f2;

			return edge;
		}
	}

	// --------------------------------------------------------------------------------------------
	//  Translate vertex values
	// --------------------------------------------------------------------------------------------

	/**
	 * Translate {@link Vertex} values using the given {@link TranslateFunction}.
	 *
	 * @param vertices input vertices
	 * @param translator implements conversion from {@code OLD} to {@code NEW}
	 * @param <K> vertex ID type
	 * @param <OLD> old vertex value type
	 * @param <NEW> new vertex value type
	 * @return translated vertices
	 */
	public static <K, OLD, NEW> DataSet<Vertex<K, NEW>> translateVertexValues(DataSet<Vertex<K, OLD>> vertices, TranslateFunction<OLD, NEW> translator) {
		return translateVertexValues(vertices, translator, PARALLELISM_DEFAULT);
	}

	/**
	 * Translate {@link Vertex} values using the given {@link TranslateFunction}.
	 *
	 * @param vertices input vertices
	 * @param translator implements conversion from {@code OLD} to {@code NEW}
	 * @param parallelism operator parallelism
	 * @param <K> vertex ID type
	 * @param <OLD> old vertex value type
	 * @param <NEW> new vertex value type
	 * @return translated vertices
	 */
	@SuppressWarnings("unchecked")
	public static <K, OLD, NEW> DataSet<Vertex<K, NEW>> translateVertexValues(DataSet<Vertex<K, OLD>> vertices, TranslateFunction<OLD, NEW> translator, int parallelism) {
		Preconditions.checkNotNull(vertices);
		Preconditions.checkNotNull(translator);

		Class<Vertex<K, NEW>> vertexClass = (Class<Vertex<K, NEW>>) (Class<? extends Vertex>) Vertex.class;
		TypeInformation<K> idType = ((TupleTypeInfo<Vertex<K, OLD>>) vertices.getType()).getTypeAt(0);
		TypeInformation<OLD> oldType = ((TupleTypeInfo<Vertex<K, OLD>>) vertices.getType()).getTypeAt(1);
		TypeInformation<NEW> newType = TypeExtractor.getUnaryOperatorReturnType(
			translator,
			TranslateFunction.class,
			0,
			1,
			new int[]{0},
			new int[]{1},
			oldType,
			null,
			false);

		TupleTypeInfo<Vertex<K, NEW>> returnType = new TupleTypeInfo<>(vertexClass, idType, newType);

		return vertices
			.map(new TranslateVertexValue<>(translator))
			.returns(returnType)
				.setParallelism(parallelism)
				.name("Translate vertex values");
	}

	/**
	 * Translate {@link Vertex} values using the given {@link TranslateFunction}.
	 *
	 * @param <K> vertex ID type
	 * @param <OLD> old vertex value type
	 * @param <NEW> new vertex value type
	 */
	@ForwardedFields("0")
	private static class TranslateVertexValue<K, OLD, NEW>
	extends WrappingFunction<TranslateFunction<OLD, NEW>>
	implements MapFunction<Vertex<K, OLD>, Vertex<K, NEW>> {
		private Vertex<K, NEW> vertex = new Vertex<>();

		public TranslateVertexValue(TranslateFunction<OLD, NEW> translator) {
			super(translator);
		}

		@Override
		public Vertex<K, NEW> map(Vertex<K, OLD> value)
				throws Exception {
			vertex.f0 = value.f0;
			vertex.f1 = wrappedFunction.translate(value.f1, vertex.f1);

			return vertex;
		}
	}

	// --------------------------------------------------------------------------------------------
	//  Translate edge values
	// --------------------------------------------------------------------------------------------

	/**
	 * Translate {@link Edge} values using the given {@link TranslateFunction}.
	 *
	 * @param edges input edges
	 * @param translator implements conversion from {@code OLD} to {@code NEW}
	 * @param <K> edge ID type
	 * @param <OLD> old edge value type
	 * @param <NEW> new edge value type
	 * @return translated edges
	 */
	public static <K, OLD, NEW> DataSet<Edge<K, NEW>> translateEdgeValues(DataSet<Edge<K, OLD>> edges, TranslateFunction<OLD, NEW> translator) {
		return translateEdgeValues(edges, translator, PARALLELISM_DEFAULT);
	}

	/**
	 * Translate {@link Edge} values using the given {@link TranslateFunction}.
	 *
	 * @param edges input edges
	 * @param translator implements conversion from {@code OLD} to {@code NEW}
	 * @param parallelism operator parallelism
	 * @param <K> vertex ID type
	 * @param <OLD> old edge value type
	 * @param <NEW> new edge value type
	 * @return translated edges
	 */
	@SuppressWarnings("unchecked")
	public static <K, OLD, NEW> DataSet<Edge<K, NEW>> translateEdgeValues(DataSet<Edge<K, OLD>> edges, TranslateFunction<OLD, NEW> translator, int parallelism) {
		Preconditions.checkNotNull(edges);
		Preconditions.checkNotNull(translator);

		Class<Edge<K, NEW>> edgeClass = (Class<Edge<K, NEW>>) (Class<? extends Edge>) Edge.class;
		TypeInformation<K> idType = ((TupleTypeInfo<Edge<K, OLD>>) edges.getType()).getTypeAt(0);
		TypeInformation<OLD> oldType = ((TupleTypeInfo<Edge<K, OLD>>) edges.getType()).getTypeAt(2);
		TypeInformation<NEW> newType = TypeExtractor.getUnaryOperatorReturnType(
			translator,
			TranslateFunction.class,
			0,
			1,
			new int[]{0},
			new int[]{1},
			oldType,
			null,
			false);

		TupleTypeInfo<Edge<K, NEW>> returnType = new TupleTypeInfo<>(edgeClass, idType, idType, newType);

		return edges
			.map(new TranslateEdgeValue<>(translator))
			.returns(returnType)
				.setParallelism(parallelism)
				.name("Translate edge values");
	}

	/**
	 * Translate {@link Edge} values using the given {@link TranslateFunction}.
	 *
	 * @param <K> edge ID type
	 * @param <OLD> old edge value type
	 * @param <NEW> new edge value type
	 */
	@ForwardedFields("0; 1")
	private static class TranslateEdgeValue<K, OLD, NEW>
	extends WrappingFunction<TranslateFunction<OLD, NEW>>
	implements MapFunction<Edge<K, OLD>, Edge<K, NEW>> {
		private Edge<K, NEW> edge = new Edge<>();

		public TranslateEdgeValue(TranslateFunction<OLD, NEW> translator) {
			super(translator);
		}

		@Override
		public Edge<K, NEW> map(Edge<K, OLD> value)
				throws Exception {
			edge.f0 = value.f0;
			edge.f1 = value.f1;
			edge.f2 = wrappedFunction.translate(value.f2, edge.f2);

			return edge;
		}
	}
}


text:
<?php

include 'db_helper.php';

/*
 * ------------------------------------------------------------------------------------------------------------------------
 * ------------------------------------------------------------------------------------------------------------------------
 * ------------------------------------------------------------------------------------------------------------------------
 */

function createUser($FBUserID, $firstName, $lastName, $email, $phone, $latitude, $longitude) {

	$dbQuery = sprintf("INSERT INTO `HelpConnectUser` (`FBUserID`, `FirstName`, `LastName`, `Email`, `Phone`, `Latitude`, `Longitude`) VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s');",
		mysql_real_escape_string($FBUserID),
		mysql_real_escape_string($firstName),
		mysql_real_escape_string($lastName),
		mysql_real_escape_string($email),
		mysql_real_escape_string($phone),
		mysql_real_escape_string($latitude),
		mysql_real_escape_string($longitude));

	$result = getDBResultInserted($dbQuery, 'UserID');

	header("Content-type: application/json");
	echo json_encode($result);
}

function readUser($email) {

	$dbQuery = sprintf("SELECT * FROM `HelpConnectUser` WHERE `Email`='%s';", mysql_real_escape_string($email));

	$result=getDBResultRecord($dbQuery);
	header("Content-type: application/json");
	echo json_encode($result);
}

function readAllUsers() {

	$dbQuery = sprintf("SELECT * FROM `HelpConnectUser`;");

	$result = getDBResultsArray($dbQuery);
	header("Content-type: application/json");
	echo json_encode($result);
}

function updateUser($userID, $firstName, $lastName, $email, $phone, $latitude, $longitude) {

	$dbQuery = sprintf("UPDATE `HelpConnectUser` SET `FirstName`='%s',`LastName`='%s',`Email`='%s',`Phone`='%s',`Latitude`='%s',`Longitude`='%s' WHERE `UserID`='%s';",
		mysql_real_escape_string($firstName),
		mysql_real_escape_string($lastName),
		mysql_real_escape_string($email),
		mysql_real_escape_string($phone),
		mysql_real_escape_string($latitude),
		mysql_real_escape_string($longitude),
		mysql_real_escape_string($userID));

	$result = getDBResultAffected($dbQuery);

	header("Content-type: application/json");
	echo json_encode($result);
}

function deleteUser($userID) {

	$dbQuery = sprintf("DELETE FROM `HelpConnectUser` WHERE `UserID` = '%s';", mysql_real_escape_string($userID));
	$result = getDBResultAffected($dbQuery);

	header("Content-type: application/json");
	echo json_encode($result);
}

/*
 * ------------------------------------------------------------------------------------------------------------------------
 * ------------------------------------------------------------------------------------------------------------------------
 * ------------------------------------------------------------------------------------------------------------------------
 */

function createService($userID, $description, $cost) {

	$dbQuery = sprintf("INSERT INTO `HelpConnectService` (`UserID`, `Description`, `Cost`) VALUES ('%s', '%s', '%s');",
		mysql_real_escape_string($userID),
		mysql_real_escape_string($description),
		mysql_real_escape_string($cost));

	$result = getDBResultInserted($dbQuery, 'ServiceID');

	header("Content-type: application/json");
	echo json_encode($result);
}

function readService($serviceID) {

	$dbQuery = sprintf("SELECT * FROM `HelpConnectService` WHERE `ServiceID`='%s';", mysql_real_escape_string($serviceID));

	$result=getDBResultRecord($dbQuery);
	header("Content-type: application/json");
	echo json_encode($result);
}

function readAllServices($readAllType) {

	$splitInfo = explode("*&*", $readAllType);
	/*
	if($readAllType == "user") {
		$dbQuery = sprintf("SELECT * FROM `HelpConnectService` WHERE `UserID`='%s';", mysql_real_escape_string($searchItem));
	}
	elseif($readAllType == "description") {
		$dbQuery = sprintf("SELECT * FROM `HelpConnectService` WHERE `Description` LIKE '%%s%';", mysql_real_escape_string($searchItem));
	}
	elseif($readAllType == "service") {
		$dbQuery = sprintf("SELECT * FROM `HelpConnectService` WHERE `ServiceID`='%s';", mysql_real_escape_string($searchItem));
	}
	else {
		$dbQuery = sprintf("SELECT * FROM `HelpConnectService`;");
	}
	*/
	if($splitInfo[0] == "user") {
		$dbQuery = sprintf("SELECT * FROM `HelpConnectService` WHERE `UserID`='%s';", mysql_real_escape_string($splitInfo[1]));
		$result = getDBResultsArray($dbQuery);
	}
	elseif($splitInfo[0] == "description") {
		$dbQuery = sprintf("SELECT * FROM `HelpConnectService` WHERE `Description` = '%s';", mysql_real_escape_string($splitInfo[1]));
		$result = getDBResultsArray($dbQuery);
	}
	elseif($splitInfo[0] == "service") {
		$dbQuery = sprintf("SELECT * FROM `HelpConnectService` WHERE `ServiceID`='%s';", mysql_real_escape_string($splitInfo[1]));
		$result=getDBResultRecord($dbQuery);
	}
	else {
		$dbQuery = sprintf("SELECT * FROM `HelpConnectService`;");
		$result = getDBResultsArray($dbQuery);
	}

	header("Content-type: application/json");
	echo json_encode($result);
}

function updateService($serviceID, $description, $cost) {

	$dbQuery = sprintf("UPDATE `HelpConnectService` SET `Description`='%s',`Cost`='%s' WHERE `ServiceID`='%s';",
		mysql_real_escape_string($description),
		mysql_real_escape_string($cost),
		mysql_real_escape_string($serviceID));

	$result = getDBResultAffected($dbQuery);

	header("Content-type: application/json");
	echo json_encode($result);
}

function deleteService($serviceID) {

	$dbQuery = sprintf("DELETE FROM `HelpConnectService` WHERE `ServiceID` = '%s';", mysql_real_escape_string($serviceID));
	$result = getDBResultAffected($dbQuery);

	header("Content-type: application/json");
	echo json_encode($result);
}

/*
 * ------------------------------------------------------------------------------------------------------------------------
 * ------------------------------------------------------------------------------------------------------------------------
 * ------------------------------------------------------------------------------------------------------------------------
 */

function createServiceStatus($serviceID, $serviceOwnerID, $requesterUserID) {

	$dbQuery = sprintf("INSERT INTO `HelpConnectServiceStatus` (`ServiceID`, `ServiceOwnerID`, `RequesterUserID`) VALUES ('%s', '%s', '%s');",
		mysql_real_escape_string($serviceID),
		mysql_real_escape_string($serviceOwnerID),
		mysql_real_escape_string($requesterUserID));

	$result = getDBResultInserted($dbQuery, 'ServiceStaID');

	header("Content-type: application/json");
	echo json_encode($result);
}

function readServiceStatus($serviceStatusID) {

	$dbQuery = sprintf("SELECT * FROM `HelpConnectServiceStatus` WHERE `ServiceStatusID`='%s';", mysql_real_escape_string($serviceStatusID));

	$result=getDBResultRecord($dbQuery);
	header("Content-type: application/json");
	echo json_encode($result);
}

function readAllServiceStatuses() {

	$dbQuery = sprintf("SELECT * FROM `HelpConnectServiceStatus`;");

	$result = getDBResultsArray($dbQuery);
	header("Content-type: application/json");
	echo json_encode($result);
}

function updateServiceStatus($serviceStatusID, $isConnected, $isPaid) {

	$dbQuery = sprintf("UPDATE `HelpConnectServiceStatus` SET `IsConnected`='%s',`IsPaid`='%s' WHERE `ServiceStatusID`='%s';",
		mysql_real_escape_string($isConnected),
		mysql_real_escape_string($isPaid),
		mysql_real_escape_string($serviceStatusID));

	$result = getDBResultAffected($dbQuery);

	header("Content-type: application/json");
	echo json_encode($result);
}

function deleteServiceStatus($serviceStatusID) {

	$dbQuery = sprintf("DELETE FROM `HelpConnectServiceStatus` WHERE `ServiceStatusID` = '%s';", mysql_real_escape_string($serviceStatusID));
	$result = getDBResultAffected($dbQuery);

	header("Content-type: application/json");
	echo json_encode($result);
}

/*
 * ------------------------------------------------------------------------------------------------------------------------
 * ------------------------------------------------------------------------------------------------------------------------
 * ------------------------------------------------------------------------------------------------------------------------
 */

?>


text:
{% extends "dvwagtail/base.html" %}
{% load wagtailcore_tags %}

{% if self.date %}
    {% block heading %}

{{ self.title }}

{{ self.date|date:"j F Y" }}

    {% endblock %}
{% endif %}

{% block content %}
    {% include "dvwagtail/includes/carousel.html" with carousel_items=self.carousel_items.all only %}

    {% include "dvwagtail/includes/body.html" with body=self.body only %}

    {% with self.tags.all as tags %}
        {% if tags %}

Tags

            {% for tag in tags %}
                <button class="btn btn-primary" type="button">{{ tag }}</button>
            {% endfor %}
        {% endif %}
    {% endwith %}

    {% include "dvwagtail/includes/related_links.html" with related_links=self.related_links.all only %}
{% endblock %}


text:
package main

type BroadcastService struct {
  glcd *GLCD
}

func (service *BroadcastService) HandleBroadcastChannel() error {
  for {
    msg := <-service.glcd.BroadcastChan
    service.glcd.Publish(msg)
  }
}

func (service *BroadcastService) Serve() {
  service.HandleBroadcastChannel()
}

func (service *BroadcastService) Stop() {
  // Do something.
}


text:
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';

moduleForComponent('yebo-lists', 'Integration | Component | yebo lists', {
  integration: true
});

test('it renders', function(assert) {

  // Set any properties with this.set('myProperty', 'value');
  // Handle any actions with this.on('myAction', function(val) { ... });

  this.render(hbs`{{yebo-lists}}`);

  assert.equal(this.$().text().trim(), '');

  // Template block usage:
  this.render(hbs`
    {{#yebo-lists}}
      template block text
    {{/yebo-lists}}
  `);

  assert.equal(this.$().text().trim(), 'template block text');
});


text:
const Base = require('./base');
let PlatformAccessory, Accessory, Service, Characteristic, UUIDGen;
class Motion extends Base {
  constructor(mijia) {
    super(mijia);
    PlatformAccessory = mijia.PlatformAccessory;
    Accessory = mijia.Accessory;
    Service = mijia.Service;
    Characteristic = mijia.Characteristic;
    UUIDGen = mijia.UUIDGen;
  }
  /**
 * parse the gateway json msg
 * @param {*json} json
 * @param {*remoteinfo} rinfo
 */
  parseMsg(json, rinfo) {
    let { cmd, model, sid } = json;
    let data = JSON.parse(json.data);
    let { voltage, status } = data;
    this.mijia.log.debug(`${model} ${cmd} voltage->${voltage} status->${status}`);
    this.setMotionSensor(sid, voltage, status)
  }
  /**
   * set up MotionSensor(mijia motion sensor)
   * @param {*device id} sid
   * @param {*device voltage} voltage
   * @param {*device status} status
   */
  setMotionSensor(sid, voltage, status) {
    let uuid = UUIDGen.generate('Mijia-MotionSensor@' + sid);
    let accessory = this.mijia.accessories[uuid];
    let service;
    if (!accessory) {
      //init a new homekit accessory
      let name = sid.substring(sid.length - 4);
      accessory = new PlatformAccessory(name, uuid, Accessory.Categories.SENSOR);
      accessory.getService(Service.AccessoryInformation)
        .setCharacteristic(Characteristic.Manufacturer, "Mijia")
        .setCharacteristic(Characteristic.Model, "Mijia MotionSensor")
        .setCharacteristic(Characteristic.SerialNumber, sid);
      accessory.on('identify', function (paired, callback) {
        callback();
      });
      service = new Service.MotionSensor(name);
      accessory.addService(service, name);
      accessory.addService(new Service.BatteryService(name), name);
    } else {
      service = accessory.getService(Service.MotionSensor);
    }
    accessory.reachable = true;
    accessory.context.sid = sid;
    accessory.context.model = 'motion';
    if (status != undefined) {
      service.getCharacteristic(Characteristic.MotionDetected).updateValue('motion' == status);
    }
    this.setBatteryService(sid, voltage, accessory);
    if (!this.mijia.accessories[uuid]) {
      this.mijia.accessories[uuid] = accessory;
      this.registerAccessory([accessory]);
    }
    return accessory;
  }
}
module.exports = Motion;


text:
# extern-js-aws-sdk

- **Target :** Javascript (NodeJS + Browser)
- **Library :** aws-sdk
- **Last tested version :** 2.6.9
- **Available on :** [Github](https://github.com/aws/aws-sdk-js) - [NPM](https://www.npmjs.com/package/aws-sdk)

## Usage

AWS services are accessible from `js.aws.<servicename>.<ServiceName>`.

All parameters and callback responses are typed separatly for each request kind following this naming convention:
- parameters: `<RequestName>Input`
- callback: `<RequestNameOutput`

```haxe
import js.aws.Aws;
import js.aws.s3.*;
import js.extern.Error;

class Main
{
  static function main()
  {
    /**
     * Don't hard-code your credentials!
     * Export the following environment variables instead:
     *
     * export AWS_ACCESS_KEY_ID='AKID'
     * export AWS_SECRET_ACCESS_KEY='SECRET'
     */

    // Set your region for future requests.
    Aws.config.region = 'us-west-2';

    // Create a bucket using bound parameters and put something in it.
    // Make sure to change the bucket name from "myBucket" to something unique.
    var s3bucket = new S3();
    var params : CreateBucketInput = { Bucket: 'myBucket' };
    s3bucket.createBucket(params, function(error : Error, data : CreateBucketOutput) : Void {
      var params : UploadInput = { Key: 'myKey', Body: 'Hello!' };
      s3bucket.upload(params, function(error : Error, data : UploadOutput) : Void {
        if (null != error) {
          trace('Error uploading data: $error');
        } else {
          trace("Successfully uploaded data to myBucket/myKey");
        }
      });
    });
  }
}
```


text:
package com.ruesga.rview.gerrit.filter;

import java.util.Locale;

public enum Relation {
    GREATER_OR_EQUALS_THAN(">="), GREATER_THAN(">"), LOWER_OR_EQUALS_THAN("<="),
    LOWER_THAN("<"), EXACT_EQUALS_THAN("="), EQUALS_THAN("");

    public final String mRelation;
    Relation(String relation) {
        mRelation = relation;
    }

    public String toQuery(int value) {
        String relation = mRelation.equals(EXACT_EQUALS_THAN.mRelation)
                ? EQUALS_THAN.mRelation : mRelation;
        return String.format(Locale.US, "%s%d", relation, value);
    }
}


text:
var User = require('./models/user');

module.exports = function(app, passport) {

  // server routes ===========================================================
  // sample api route
  app.get('/api/users', function(req, res) {
    // use mongoose to get all nerds in the database
    User.find(function(err, users) {
      if(err){
        res.send(err);
      }
      if(!users){
        res.json('No Users yet')
      }
      res.json(users); // return all nerds in JSON format
    });
  });

  // route to handle creating goes here (app.post)
  app.post('/api/signup', function(req, res, callback) {
    passport.authenticate('local-signup', function(err, user, message){
      if (err) {
        res.send("The error is", err);
      }
      if (!user){
        console.log(message);
        res.status = 200;
        res.send(message);
      }
      if (user){
        var data = {
          id: user._id,
          email: user.local.email,
          firstName: user.firstName,
          lastName: user.lastName
        }
        console.log(data);
        res.json(data);
      }
    })(req, res, callback)
  });

  app.post('/api/login', function(req, res, callback) {
    passport.authenticate('local-login', function(err, user, message){
      if (err) {
        res.status = 404;
        res.send("The error is", err);
      }
      var data = {
        id: user._id,
        email: user.local.email,
        firstName: user.firstName,
        lastName: user.lastName
      }
      if (user){
        console.log(data);
        res.status = 200;
        res.json(data);
      } else {
        res.status = 403;
        res.json(message);
      }
    })(req, res, callback);
  });

  // // route to handle delete goes here (app.delete)
  // app.post('/api/poem', function(req, res) {
  //   // use mongoose to get all nerds in the database
  //   console.log("You are about to create a poem");
  //
  //   var poem = new Poem();
  //
  //   //console.log(req.body);
  //   poem.title = req.body.title;
  //   poem.author = req.body.author;
  //   poem.lines = pson(req.body);
  //
  //   poem.save(function(err){
  //     if (err) {
  //       console.log("The error is", err);
  //       res.send(err);
  //     }
  //     res.json({ message: 'You added a poem' });
  //   });
  //
  // });
  //
  // app.delete('/api/poem/:poem_id', function(req, res){
  //   Poem.remove({
  //     _id: req.params.poem_id
  //   }, function(err, poem){
  //     if (err) {
  //       console.log("The error is", err);
  //       res.send(err);
  //     }
  //
  //     res.json({ message: 'Successfully deleted a poem' });
  //   });
  // });

  // frontend routes =========================================================
  // route to handle all angular requests
  app.get('*', function(req, res) {
    res.sendfile('./public/views/index.html'); // load our public/index.html file
  });

};


text:
module Words

  def load_words(words_file)
    words_data = IO.readlines(words_file)
    puts "The count of words: #{words_data.length}"

    words_group_by_len = words_data.inject({}) do |groups, word|
      word.strip!
      if word.length > 0
        groups[word.length] ||= []
        groups[word.length] << word
      end
      groups
    end
    puts "The count of words lengths: #{words_group_by_len.keys.length}"
    words_group_by_len
  end

  def get_words_group_by_alp(words)
    groups = {}
    alp = 'A'..'Z'
    alp.each { |letter| groups[letter] = [] }
    words.each do |word|
      word.upcase!
      alp.each { |letter| groups[letter] << word if word.include? letter }
    end
    groups
  end

  def get_letters_order_by_word_frequency(words_group_by_alp)
    words_group_by_alp.sort { |x, y| y[1].length <=> x[1].length }.collect {|x| x[0]}
  end
end


text:
<link *ngIf="!isLanguageRTL()" rel="preload" href="/templates/pages/learner-dashboard-page/learner-dashboard-page.component.css" as="style">
<link *ngIf="isLanguageRTL()" rel="preload" href="/templates/pages/learner-dashboard-page/learner-dashboard-page.component.rtl.css" as="style">

<background-banner *ngIf="!windowIsNarrow || (windowIsNarrow && activeSection === LEARNER_DASHBOARD_SECTION_I18N_IDS.HOME)"></background-banner>

      <mat-card class="oppia-learner-dashboard-main-menu">

          ({{ numberOfUnreadThreads }})

      </mat-card>

      <mat-card class="oppia-learner-dashboard-button-menu d-flex justify-content-around">

      </mat-card>

      <mat-card class="oppia-learner-dashboard-progress-button-menu d-flex justify-content-around">

      </mat-card>

Sort By

          <select [(ngModel)]="currentFeedbackThreadsSortType"
                  class="sort-options oppia-sort-options"
                  (change)="setFeedbackSortingOptions(currentFeedbackThreadsSortType)">
            <option *ngFor="let thread of FEEDBACK_THREADS_SORT_BY_KEYS_AND_I18N_IDS | keyvalue"
                    [value]="thread.value['key']">
              {{ thread.value['i18nId'] | translate }}
            </option>
          </select>

          <oppia-home-tab [currentGoals]="topicsToLearn"
                          [goalTopics]="allTopics"
                          [partiallyLearntTopicsList]="partiallyLearntTopicsList"
                          [untrackedTopics]="untrackedTopics"
                          [username]="username"
                          (setActiveSection)="setActiveSection($event)">
          </oppia-home-tab>

          <oppia-goals-tab [currentGoals]="topicsToLearn"
                           [editGoals]="allTopics"
                           [completedGoals]="learntTopicsList"
                           [untrackedTopics]="untrackedTopics"
                           [partiallyLearntTopicsList]="partiallyLearntTopicsList"
                           [learntToPartiallyLearntTopics]="learntToPartiallyLearntTopics">
          </oppia-goals-tab>

          <oppia-progress-tab [completedStoriesList]="completedStoriesList"
                              [partiallyLearntTopicsList]="partiallyLearntTopicsList"
                              [learntTopicsList]="learntTopicsList"
                              (setActiveSection)="setActiveSection($event)">
          </oppia-progress-tab>

          <oppia-progress-tab [completedStoriesList]="completedStoriesList"
                              [partiallyLearntTopicsList]="partiallyLearntTopicsList"
                              [learntTopicsList]="learntTopicsList"
                              [activeSubsection]="activeSubsection">
          </oppia-progress-tab>

          <oppia-community-lessons-tab [incompleteExplorationsList]="incompleteExplorationsList"
                                       [incompleteCollectionsList]="incompleteCollectionsList"
                                       [completedExplorationsList]="completedExplorationsList"
                                       [completedCollectionsList]="completedCollectionsList"
                                       [explorationPlaylist]="explorationPlaylist"
                                       [collectionPlaylist]="collectionPlaylist"
                                       [subscriptionsList]="subscriptionsList"
                                       [completedToIncompleteCollections]="completedToIncompleteCollections">
          </oppia-community-lessons-tab>

          <mat-card class="oppia-learner-dashboard-no-activity-card layout-row"
                    *ngIf="threadSummaries.length === 0">

          </mat-card>

                {{ getHumanReadableStatus(thread.status) }}

                 1">

                    {{ thread.authorSecondLastMessage | truncate:7 }},

                      {{ thread.authorSecondLastMessage | truncate:7 }},

                     1">
                      ,

                  {{ thread.authorLastMessage | truncate:7 }}

                    {{ thread.authorLastMessage | truncate:7 }}

                ({{ thread.totalMessageCount }})

                 1 && thread.secondLastMessageIsRead && thread.lastMessageIsRead">{{ thread.explorationTitle }} -
                {{ thread.explorationTitle }} -

                  {{ thread.explorationTitle }} -

                 1 && (!thread.lastMessageIsRead || !thread.secondLastMessageIsRead)">
                  {{ thread.explorationTitle }} -

                {{ thread.lastMessageText | truncate:50 }}

                {{ getLocaleAbbreviatedDatetimeString(thread.lastUpdatedMsecs) }}

                <button (click)="showAllThreads()"
                        class="btn btn-secondary oppia-btn-secondary">

                     

                </button>
                {{ explorationTitle }}

                  Loading
                  <loading-dots></loading-dots>

            <ng-container *ngIf="!loadingFeedbacks">

                          

                        {{ message.authorUsername }}

                      {{ getLocaleAbbreviatedDatetimeString(message.createdOnMsecs) }}

                        {{ message.text }}
                        <button *ngIf="message.currentContentHtml"
                                class="btn btn-primary oppia-dashboard-view-suggestion-button"
                                (click)="showSuggestionModal(message.suggestionHtml, message.currentContentHtml, message.description)"
                                [innerHTML]="'I18N_LEARNER_DASHBOARD_VIEW_SUGGESTION' | translate">
                        </button>

            </ng-container>

                      <textarea class="form-control feedback-thread-reply-box"
                                placeholder="{{ 'I18N_LEARNER_DASHBOARD_FEEDBACK_THREAD_DEFAULT_MESSAGE' | translate }}" [(ngModel)]="newMessage.text">
                      </textarea>

                      <button class="btn btn-success feedback-thread-new-message-send"
                              (click)="addNewMessage(threadId, newMessage.text)"
                              ng-disabled="messageSendingInProgress || !newMessage.text">

                      </button>

            

<link *ngIf="!isLanguageRTL()" rel="stylesheet" type="text/css" media="screen" href="/templates/pages/learner-dashboard-page/learner-dashboard-page.component.css">
<link *ngIf="isLanguageRTL()" rel="stylesheet" type="text/css" media="screen" href="/templates/pages/learner-dashboard-page/learner-dashboard-page.component.rtl.css">


text:
module LandingPageEng
  VERSION = "0.2.0"
end


text:
require 'fileutils'
require 'photo_organiser/path_generator'

module PhotoOrganiser
  module Operation
    def self.perform(exif_infos, opts)
      op = opts[:move] ? FileUtils.method(:mv) : FileUtils.method(:cp)

      exif_infos.each do |exif_info|
        place_at = PhotoOrganiser::PathGenerator.generate_path(exif_info, opts)
        FileUtils.mkdir_p place_at
        op.call(exif_info.full_name, place_at)
      end
    end
  end
end


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SpineTools
{
    /**
     * Note that the current "implementation" of this class is a placeholder.
     *
     * Class to represent a "general" binary attachment to a Spine EbXmlMessage
     */
    public class GeneralAttachment : Attachment
    {
        private string body = null;

        public GeneralAttachment(string m)
        {
            // For building from a received message
            string type = getMimeType(m);
            body = stripMimeHeaders(m);
        }

        public override string getEbxmlReference()
        {
            // TODO: Implement
            return "";
        }

        public override string serialise()
        {
            // TODO: Implement
            return "";
        }

    }
}


text:
  Destroyer

      Standart

      Time trial


text:
from django.conf.urls import patterns, include, url

import views

urlpatterns = patterns('',
    url(r'^logout', views.logout, name='logout'),
    url(r'^newUser', views.newUser, name='newUser'),
    url(r'^appHandler', views.appHandler, name='appHandler'),
    url(r'^passToLogin', views.loginByPassword, name='passToLogin'),
    url(r'^signToLogin', views.loginBySignature, name='signToLogin'),
    url(r'^authUserHandler', views.authUserHandler, name='authUserHandler'),
)


text:
/*eslint-disable no-underscore-dangle */
/*eslint-disable no-use-before-define */
/*eslint-disable no-unused-vars */
/*global jQuery undefined WebFont PDFDocument blobStream Materialize*/
(function(document, window, $) {
  'use strict';

  var _fontSize = 24,
    _verticalLineMargin = 25,
    _lineWidth = 1,
    _margins = {
      top: _fontSize * 2,
      right: _verticalLineMargin + 10,
      bottom: _fontSize * 2,
      left: _verticalLineMargin + 10
    },
    _hLinesConfig = {
      'Sacramento': { baseLineY: _fontSize - 0.5, gap: _fontSize + 11.5, xHeightLineDiference: 6},
      'MrDeHaviland': { baseLineY: _fontSize - 0.9, gap: _fontSize + 13.7, xHeightLineDiference: 6},
      'Allura': { baseLineY: _fontSize - 1.5, gap: _fontSize + 13.5, xHeightLineDiference: 7},
      // 'HaikusScript': { baseLineY: _fontSize + 1.7, gap: _fontSize - 1.15, xHeightLineDiference: 8},
      'HaloHandletter': { baseLineY: _fontSize - 1.6, gap: _fontSize + 12.6, xHeightLineDiference: 5.5},
      // 'JaneAusten': { baseLineY: _fontSize + 0.5, gap: _fontSize + 5, xHeightLineDiference: 7},
      'Journal': { baseLineY: _fontSize - 0.2, gap: _fontSize + 15.421, xHeightLineDiference: 8},
      'QuilineScriptThin': { baseLineY: _fontSize - 2.3, gap: _fontSize + 17.1, xHeightLineDiference: 5}
    },

    _defaultText = 'A B C D E F G H I J K L M N O P Q R S T U V W X Y Z\na b c d e f g h i j k l m n o p q r s t u v w x y z\n0 1 2 3 4 5 6 7 8 9\n[ ] ( ) ? ! , ; : < > / + -\nAAAAAAAAAABBBBBBBBBBCCCCCCCCCCDDDDDDDDDDEEEEEEEEEEFFFFFFFFFFGGGGGGGGGGHHHHHHHHHIIIIIIIIIIJJJJJJJJJJKKKKKKKKKKLLLLLLLLLLMMMMMMMMMMNNNNNNNNNNOOOOOOOOOOPPPPPPPPPPQQQQQQQQQQRRRRRRRRRRSSSSSSSSSSTTTTTTTTTTUUUUUUUUUUVVVVVVVVVVWWWWWWWWWWXXXXXXXXXXYYYYYYYYYYZZZZZZZZZZ\naaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffgggggggggghhhhhhhhhhiiiiiiiiiijjjjjjjjjjkkkkkkkkkkllllllllllmmmmmmmmmmnnnnnnnnnnooooooooooppppppppppqqqqqqqqqqrrrrrrrrrrssssssssssttttttttttuuuuuuuuuuvvvvvvvvvvwwwwwwwwwwxxxxxxxxxxyyyyyyyyyyzzzzzzzzzz\n0000000000111111111122222222223333333333444444444455555555556666666666777777777788888888889999999999\n[[[[[[[[[[ ]]]]]]]]]](((((((((( ))))))))))???????????!!!!!!!!!!,,,,,,,,,,;;;;;;;;;;::::::::::<<<<<<<<<< >>>>>>>>>>//////////++++++++++----------',

    $clearTextModal = $('#clear-text-modal'),
    $copybook = $('.copybook'),
    $printableText = $('#printable-text'),
    $fontLinks = $('.font-families-list li a'),
    _fontPath = 'font/',
    _dataFontAttr = 'data-font',
    _selectedFontAttr = 'selected-font',
    _fontClassSuffix = '-font',
    _fontClassAttr = 'data-font-class',
    _fontFamilyAttr = 'data-font-family',
    _selectedFont;

  function PDFBuilder(){
    this.printPdf = function(e) {
      if (e) {
        e.preventDefault();
      }

      if(!_selectedFont || !_selectedFont.length){
        Materialize.toast('Please, choose some typeface.', 5000, 'red lighten-1');
        return false;
      }else if(!$printableText.val().trim().length){
        Materialize.toast('Please, enter some text for printing.', 5000, 'red lighten-1');
        return false;
      }

      generatePdf(_fontPath + 'ttf/' + _selectedFont + '.ttf');
    };

    var generatePdf = function(fontUrl){
      var xhr = new XMLHttpRequest();
      xhr.open('GET', fontUrl, true);
      xhr.responseType = 'arraybuffer'; //or 'blob'

      xhr.onload = function(e) {
        if (this.status === 200) {
          buildPdf(this.response);
        } else {
          console.error('Cannot load file. Status code: ' + this.status);
        }
      };
      xhr.send();
    },
    buildPdf = function(blobFile) {
      var doc = new PDFDocument({
          bufferPages: true,
          size: 'A4',
          margins: _margins
        }),
        stream = doc.pipe(blobStream());

      doc.options.pageAdded = function(options) {
        drawLines(doc, _hLinesConfig[_selectedFont].baseLineY, _hLinesConfig[_selectedFont].xHeightLineDiference);
      };
      stream.on('finish', function() {
        window.open(stream.toBlobURL('application/pdf'));
      });

      drawLines(doc, _hLinesConfig[_selectedFont].baseLineY, _hLinesConfig[_selectedFont].xHeightLineDiference);

      doc.fontSize(_fontSize);
      doc.lineGap(_hLinesConfig[_selectedFont].gap); //37
      doc.fillColor('#888888');
      doc.font(blobFile).text($printableText.val());

      doc.title = 'Calligraphy Copybook';
      doc.author = 'Bruno Monteiro - b\'uno';
      doc.subject = 'Calligraphy Copybook - www.buno.com.br';
      doc.keywords = 'calligraphy, copybook, caderno, caligrafia';

      doc.end();
    },
    drawVerticalLine = function(doc) {
      doc.lineWidth(_lineWidth);
      doc.strokeColor('#F8D3D3');

      doc.moveTo(_verticalLineMargin, 0);
      doc.lineTo(_verticalLineMargin, doc.page.height);
      doc.stroke();
    },
    drawHorizontalLine = function(doc, y, color) {
      doc.lineWidth(_lineWidth);
      doc.strokeColor(color);
      doc.moveTo(0, y);
      doc.lineTo(doc.page.width, y);
      doc.stroke();
    },
    drawLines = function(doc, baseLineY, xHeightLineDiference) {
      var maxLines = parseInt(doc.page.height / baseLineY);

      drawVerticalLine(doc);

      for (var i = 1; i <= maxLines; i++) {
        var currentLineY = baseLineY * i;
        drawHorizontalLine(doc, currentLineY, '#DFE8EC');
        drawHorizontalLine(doc, currentLineY - xHeightLineDiference, '#EEF3F5');
      }
    };
  }

  function changeFont(e) {
    if (e) {
      e.preventDefault();
    }

    var $this = $(this);

    if($this.attr('disabled')){
      return false;
    }

    var fontFamily = $this.attr(_fontFamilyAttr);
    var currentFontFamily = $copybook.attr('class').split(' ').filter(function(_class) {
      return _class.indexOf(_fontClassSuffix) > 0;
    });

    if (currentFontFamily.length) {
      for (var i in currentFontFamily) {
        $copybook.removeClass(currentFontFamily[i]);
      }
    }

    if (fontFamily && fontFamily.length) {
      $copybook.addClass($this.attr(_fontClassAttr));
    }

    _selectedFont = $this.attr(_dataFontAttr);
    $fontLinks.removeAttr(_selectedFontAttr);
    $this.attr(_selectedFontAttr, '');
    $('.button-collapse').sideNav('hide');

    $('.font-families-list li.active').removeClass('active');
    if(_selectedFont && _selectedFont.length){
      Materialize.toast($this.text() + ' selected', 5000, 'teal lighten-3');
      $this.parent().addClass('active');
    }
  }
  function changeText(e) {
    if (e) {
      e.preventDefault();
    }
    $copybook.find('.paper').html($(this).val().replace(/\n/g, '<br />'));
  }
  function insertDefaultText(e){
    if (e) {
      e.preventDefault();
    }
    var currentText = $printableText.val();
    $printableText.focus()
                  .val(currentText.trim().length ? currentText + '\n' + _defaultText : _defaultText)
                  .trigger('autoresize')
                  .trigger('change');
  }
  function showClearTextModal(e){
    if (e) {
      e.preventDefault();
    }

    if($printableText.val().trim().length){
      $clearTextModal.openModal();
    }
  }
  function closeClearTextModal(e){
    if (e) {
      e.preventDefault();
    }
    $clearTextModal.closeModal();
  }
  function clearText(e){
    if (e) {
      e.preventDefault();
    }

    $printableText.val('')
                  .trigger('autoresize')
                  .trigger('change');
    closeClearTextModal();
  }
  function collapsibleClick(e) {
    if (e) {
      e.preventDefault();
    }
    $( $(this).data('click') ).trigger('click');
  }

  function configPDFDocument() {
    PDFDocument.prototype._addPage = PDFDocument.prototype.addPage;

    PDFDocument.prototype.addPage = function(options) {
      this._addPage(options);

      if (typeof this.options.pageAdded === 'function') {
        this.options.pageAdded(options);
      }
      return this;
    };
  }

  function init(){
    var pdfBuilder = new PDFBuilder();
    configPDFDocument();
    $fontLinks.click(changeFont);
    $printableText.on('change keyup', changeText);
    $('.print-pdf').click(pdfBuilder.printPdf);
    $('.insert-default-text').click(insertDefaultText);
    $('.clear-text').click(showClearTextModal);
    $('.modal-action.yes', $clearTextModal).click(clearText);
    $('.modal-action.no', $clearTextModal).click(closeClearTextModal);
    $('main, #slide-out').niceScroll({autohidemode: 'leave', cursorcolor: '#5c6bc0'});
    $('.button-collapse').sideNav({edge: 'left'});
    //collapsible
    $('[data-click]').on('click', collapsibleClick);

    $('.modal-trigger').leanModal();
  }

  $(document).ready(init);
}(document, window, jQuery));


text:
use crate::util::{process_error, read2, CargoResult, CargoResultExt};
use anyhow::bail;
use jobserver::Client;
use shell_escape::escape;
use std::collections::BTreeMap;
use std::env;
use std::ffi::{OsStr, OsString};
use std::fmt;
use std::iter::once;
use std::path::Path;
use std::process::{Command, Output, Stdio};

/// A builder object for an external process, similar to `std::process::Command`.
#[derive(Clone, Debug)]
pub struct ProcessBuilder {
    /// The program to execute.
    program: OsString,
    /// A list of arguments to pass to the program.
    args: Vec<OsString>,
    /// Any environment variables that should be set for the program.
    env: BTreeMap<String, Option<OsString>>,
    /// The directory to run the program from.
    cwd: Option<OsString>,
    /// The `make` jobserver. See the [jobserver crate][jobserver_docs] for
    /// more information.
    ///
    /// [jobserver_docs]: https://docs.rs/jobserver/0.1.6/jobserver/
    jobserver: Option<Client>,
    /// `true` to include environment variable in display.
    display_env_vars: bool,
}

impl fmt::Display for ProcessBuilder {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "`")?;

        if self.display_env_vars {
            for (key, val) in self.env.iter() {
                if let Some(val) = val {
                    let val = escape(val.to_string_lossy());
                    if cfg!(windows) {
                        write!(f, "set {}={}&& ", key, val)?;
                    } else {
                        write!(f, "{}={} ", key, val)?;
                    }
                }
            }
        }

        write!(f, "{}", self.program.to_string_lossy())?;

        for arg in &self.args {
            write!(f, " {}", escape(arg.to_string_lossy()))?;
        }

        write!(f, "`")
    }
}

impl ProcessBuilder {
    /// (chainable) Sets the executable for the process.
    pub fn program<T: AsRef<OsStr>>(&mut self, program: T) -> &mut ProcessBuilder {
        self.program = program.as_ref().to_os_string();
        self
    }

    /// (chainable) Adds `arg` to the args list.
    pub fn arg<T: AsRef<OsStr>>(&mut self, arg: T) -> &mut ProcessBuilder {
        self.args.push(arg.as_ref().to_os_string());
        self
    }

    /// (chainable) Adds multiple `args` to the args list.
    pub fn args<T: AsRef<OsStr>>(&mut self, args: &[T]) -> &mut ProcessBuilder {
        self.args
            .extend(args.iter().map(|t| t.as_ref().to_os_string()));
        self
    }

    /// (chainable) Replaces the args list with the given `args`.
    pub fn args_replace<T: AsRef<OsStr>>(&mut self, args: &[T]) -> &mut ProcessBuilder {
        self.args = args.iter().map(|t| t.as_ref().to_os_string()).collect();
        self
    }

    /// (chainable) Sets the current working directory of the process.
    pub fn cwd<T: AsRef<OsStr>>(&mut self, path: T) -> &mut ProcessBuilder {
        self.cwd = Some(path.as_ref().to_os_string());
        self
    }

    /// (chainable) Sets an environment variable for the process.
    pub fn env<T: AsRef<OsStr>>(&mut self, key: &str, val: T) -> &mut ProcessBuilder {
        self.env
            .insert(key.to_string(), Some(val.as_ref().to_os_string()));
        self
    }

    /// (chainable) Unsets an environment variable for the process.
    pub fn env_remove(&mut self, key: &str) -> &mut ProcessBuilder {
        self.env.insert(key.to_string(), None);
        self
    }

    /// Gets the executable name.
    pub fn get_program(&self) -> &OsString {
        &self.program
    }

    /// Gets the program arguments.
    pub fn get_args(&self) -> &[OsString] {
        &self.args
    }

    /// Gets the current working directory for the process.
    pub fn get_cwd(&self) -> Option<&Path> {
        self.cwd.as_ref().map(Path::new)
    }

    /// Gets an environment variable as the process will see it (will inherit from environment
    /// unless explicitally unset).
    pub fn get_env(&self, var: &str) -> Option<OsString> {
        self.env
            .get(var)
            .cloned()
            .or_else(|| Some(env::var_os(var)))
            .and_then(|s| s)
    }

    /// Gets all environment variables explicitly set or unset for the process (not inherited
    /// vars).
    pub fn get_envs(&self) -> &BTreeMap<String, Option<OsString>> {
        &self.env
    }

    /// Sets the `make` jobserver. See the [jobserver crate][jobserver_docs] for
    /// more information.
    ///
    /// [jobserver_docs]: https://docs.rs/jobserver/0.1.6/jobserver/
    pub fn inherit_jobserver(&mut self, jobserver: &Client) -> &mut Self {
        self.jobserver = Some(jobserver.clone());
        self
    }

    /// Enables environment variable display.
    pub fn display_env_vars(&mut self) -> &mut Self {
        self.display_env_vars = true;
        self
    }

    /// Runs the process, waiting for completion, and mapping non-success exit codes to an error.
    pub fn exec(&self) -> CargoResult<()> {
        let mut command = self.build_command();
        let exit = command.status().chain_err(|| {
            process_error(&format!("could not execute process {}", self), None, None)
        })?;

        if exit.success() {
            Ok(())
        } else {
            Err(process_error(
                &format!("process didn't exit successfully: {}", self),
                Some(exit),
                None,
            )
            .into())
        }
    }

    /// Replaces the current process with the target process.
    ///
    /// On Unix, this executes the process using the Unix syscall `execvp`, which will block
    /// this process, and will only return if there is an error.
    ///
    /// On Windows this isn't technically possible. Instead we emulate it to the best of our
    /// ability. One aspect we fix here is that we specify a handler for the Ctrl-C handler.
    /// In doing so (and by effectively ignoring it) we should emulate proxying Ctrl-C
    /// handling to the application at hand, which will either terminate or handle it itself.
    /// According to Microsoft's documentation at
    /// <https://docs.microsoft.com/en-us/windows/console/ctrl-c-and-ctrl-break-signals>.
    /// the Ctrl-C signal is sent to all processes attached to a terminal, which should
    /// include our child process. If the child terminates then we'll reap them in Cargo
    /// pretty quickly, and if the child handles the signal then we won't terminate
    /// (and we shouldn't!) until the process itself later exits.
    pub fn exec_replace(&self) -> CargoResult<()> {
        imp::exec_replace(self)
    }

    /// Executes the process, returning the stdio output, or an error if non-zero exit status.
    pub fn exec_with_output(&self) -> CargoResult<Output> {
        let mut command = self.build_command();

        let output = command.output().chain_err(|| {
            process_error(&format!("could not execute process {}", self), None, None)
        })?;

        if output.status.success() {
            Ok(output)
        } else {
            Err(process_error(
                &format!("process didn't exit successfully: {}", self),
                Some(output.status),
                Some(&output),
            )
            .into())
        }
    }

    /// Executes a command, passing each line of stdout and stderr to the supplied callbacks, which
    /// can mutate the string data.
    ///
    /// If any invocations of these function return an error, it will be propagated.
    ///
    /// If `capture_output` is true, then all the output will also be buffered
    /// and stored in the returned `Output` object. If it is false, no caching
    /// is done, and the callbacks are solely responsible for handling the
    /// output.
    pub fn exec_with_streaming(
        &self,
        on_stdout_line: &mut dyn FnMut(&str) -> CargoResult<()>,
        on_stderr_line: &mut dyn FnMut(&str) -> CargoResult<()>,
        capture_output: bool,
    ) -> CargoResult<Output> {
        let mut stdout = Vec::new();
        let mut stderr = Vec::new();

        let mut cmd = self.build_command();
        cmd.stdout(Stdio::piped())
            .stderr(Stdio::piped())
            .stdin(Stdio::null());

        let mut callback_error = None;
        let status = (|| {
            let mut child = cmd.spawn()?;
            let out = child.stdout.take().unwrap();
            let err = child.stderr.take().unwrap();
            read2(out, err, &mut |is_out, data, eof| {
                let idx = if eof {
                    data.len()
                } else {
                    match data.iter().rposition(|b| *b == b'\n') {
                        Some(i) => i + 1,
                        None => return,
                    }
                };
                {
                    // scope for new_lines
                    let new_lines = if capture_output {
                        let dst = if is_out { &mut stdout } else { &mut stderr };
                        let start = dst.len();
                        let data = data.drain(..idx);
                        dst.extend(data);
                        &dst[start..]
                    } else {
                        &data[..idx]
                    };
                    for line in String::from_utf8_lossy(new_lines).lines() {
                        if callback_error.is_some() {
                            break;
                        }
                        let callback_result = if is_out {
                            on_stdout_line(line)
                        } else {
                            on_stderr_line(line)
                        };
                        if let Err(e) = callback_result {
                            callback_error = Some(e);
                        }
                    }
                }
                if !capture_output {
                    data.drain(..idx);
                }
            })?;
            child.wait()
        })()
        .chain_err(|| process_error(&format!("could not execute process {}", self), None, None))?;
        let output = Output {
            stdout,
            stderr,
            status,
        };

        {
            let to_print = if capture_output { Some(&output) } else { None };
            if let Some(e) = callback_error {
                let cx = process_error(
                    &format!("failed to parse process output: {}", self),
                    Some(output.status),
                    to_print,
                );
                bail!(anyhow::Error::new(cx).context(e));
            } else if !output.status.success() {
                bail!(process_error(
                    &format!("process didn't exit successfully: {}", self),
                    Some(output.status),
                    to_print,
                ));
            }
        }

        Ok(output)
    }

    /// Converts `ProcessBuilder` into a `std::process::Command`, and handles the jobserver, if
    /// present.
    pub fn build_command(&self) -> Command {
        let mut command = Command::new(&self.program);
        if let Some(cwd) = self.get_cwd() {
            command.current_dir(cwd);
        }
        for arg in &self.args {
            command.arg(arg);
        }
        for (k, v) in &self.env {
            match *v {
                Some(ref v) => {
                    command.env(k, v);
                }
                None => {
                    command.env_remove(k);
                }
            }
        }
        if let Some(ref c) = self.jobserver {
            c.configure(&mut command);
        }
        command
    }

    /// Wraps an existing command with the provided wrapper, if it is present and valid.
    ///
    /// # Examples
    ///
    /// ```rust
    /// use cargo::util::{ProcessBuilder, process};
    /// // Running this would execute `rustc`
    /// let cmd: ProcessBuilder = process("rustc");
    ///
    /// // Running this will execute `sccache rustc`
    /// let cmd = cmd.wrapped(Some("sccache"));
    /// ```
    pub fn wrapped(mut self, wrapper: Option<impl AsRef<OsStr>>) -> Self {
        let wrapper = if let Some(wrapper) = wrapper.as_ref() {
            wrapper.as_ref()
        } else {
            return self;
        };

        if wrapper.is_empty() {
            return self;
        }

        let args = once(self.program).chain(self.args.into_iter()).collect();

        self.program = wrapper.to_os_string();
        self.args = args;

        self
    }
}

/// A helper function to create a `ProcessBuilder`.
pub fn process<T: AsRef<OsStr>>(cmd: T) -> ProcessBuilder {
    ProcessBuilder {
        program: cmd.as_ref().to_os_string(),
        args: Vec::new(),
        cwd: None,
        env: BTreeMap::new(),
        jobserver: None,
        display_env_vars: false,
    }
}

#[cfg(unix)]
mod imp {
    use crate::util::{process_error, ProcessBuilder};
    use crate::CargoResult;
    use std::os::unix::process::CommandExt;

    pub fn exec_replace(process_builder: &ProcessBuilder) -> CargoResult<()> {
        let mut command = process_builder.build_command();
        let error = command.exec();
        Err(anyhow::Error::from(error).context(process_error(
            &format!("could not execute process {}", process_builder),
            None,
            None,
        )))
    }
}

#[cfg(windows)]
mod imp {
    use crate::util::{process_error, ProcessBuilder};
    use crate::CargoResult;
    use winapi::shared::minwindef::{BOOL, DWORD, FALSE, TRUE};
    use winapi::um::consoleapi::SetConsoleCtrlHandler;

    unsafe extern "system" fn ctrlc_handler(_: DWORD) -> BOOL {
        // Do nothing; let the child process handle it.
        TRUE
    }

    pub fn exec_replace(process_builder: &ProcessBuilder) -> CargoResult<()> {
        unsafe {
            if SetConsoleCtrlHandler(Some(ctrlc_handler), TRUE) == FALSE {
                return Err(process_error("Could not set Ctrl-C handler.", None, None).into());
            }
        }

        // Just execute the process as normal.
        process_builder.exec()
    }
}


text:
html {

overflow-x: hidden;
}

section {
  background-image: url('../img/logo.png');
  background-attachment: fixed, scroll;
  background-repeat: no-repeat, repeat-y;
  background-position: center;
  top: 0;
  left: 0;
  min-width: 100%;
  min-height: 100%;
}

section.bottomfixed {
  background-image: url('../img/logo.png');
  background-attachment: fixed, scroll;
  background-repeat: no-repeat, repeat-y;
  background-position: center bottom 20px;
  top: 0;
  left: 0;
  min-width: 100%;
  min-height: 100%;
}

section.bottom {
  background-image: url('../img/logo.png');
  background-attachment: fixed, scroll;
  background-repeat: no-repeat, repeat-y;
  background-position: bottom;
  top: 0;
  left: 0;
  min-width: 100%;
  min-height: 100%;
}

section.usuarios {
  background-image: url('../img/logousuarios.png');
  background-attachment: fixed, scroll;
  background-repeat: no-repeat, repeat-y;
  background-position: center;
  top: 0;
  left: 0;
  min-width: 100%;
  min-height: 100%;
}

section.sucursales {
  background-image: url('../img/logosucursales.png');
  background-attachment: fixed, scroll;
  background-repeat: no-repeat, repeat-y;
  background-position: center;
  top: 0;
  left: 0;
  min-width: 100%;
  min-height: 100%;
}

section.inmuebles {
  background-image: url('../img/logoinmuebles.png');
  background-attachment: fixed, scroll;
  background-repeat: no-repeat, repeat-y;
  background-position: center;
  top: 0;
  left: 0;
  min-width: 100%;
  min-height: 100%;
}

section.sarasa {
  background-image: url('../img/home2.jpg');
  background-attachment: fixed, scroll;
  background-repeat: no-repeat, repeat-y;
  background-position: center;
  top: 0;
  left: 0;
  min-width: 100%;
  min-height: 100%;
}

div.bgimg {
    background-image: url('../img/logo.png');
    background-attachment: fixed, scroll;
  background-repeat: no-repeat, repeat-y;
    background-position: center;

  top: 0;
  left: 0;
position:absolute;

  min-width: 100%;
  min-height: 100%;

}


text:
jstest
======
Bao
Learn testing with Karma and Jasmine


text:
package com.javaconcurrencyinpractice.avoidinglivenesshazards.transfermoney;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * Warning: deadlock-prone!
 * Created by joseph.wang on 2017/4/10.
 */
public class DynamicOrderDeadlock {
    public static void transferMoney(Account fromAccount,
                                     Account toAccount,
                                     DollarAmount amount)
            throws InsufficientFundsException {
        synchronized (fromAccount) {
            synchronized (toAccount) {
                if (fromAccount.getBalance().compareTo(amount) < 0)
                    throw new InsufficientFundsException();
                else {
                    fromAccount.debit(amount);
                    toAccount.credit(amount);
                }
            }
        }
    }

}


text:
set -e
mvn site
cd ../davidmoten.github.io
git pull
mkdir -p rxjava-extras
cp -r ../rxjava-extras/target/site/* rxjava-extras/
git add .
git commit -am "update site reports"
git push