text:
'use strict';

/* Directives */

// https://weblogs.asp.net/dwahlin/creating-custom-angularjs-directives-part-2-isolate-scope
angular.module('myApp.directives', []).
  directive('appVersion', ['version', function(version) {
    return function(scope, elm, attrs) {
      elm.text(version);
    };
  }])
  .directive('myFacebook', [function() {
  	return {
  		restrict: 'A',
  		scope: {
  			permissions: '@',
  			places: '=',
  			previous: '=',
  			next: '='
		},
  		link: function _link(scope, element, attributes) {

  			// https://developers.facebook.com/docs/facebook-login/login-flow-for-web/v1.0
			// Load the SDK asynchronously
	        (function(d) {
	          var js, id = 'facebook-jssdk',
	            ref = d.getElementsByTagName('script')[0];
	          if (d.getElementById(id)) {
	            return;
	          }
	          js = d.createElement('script');
	          js.id = id;
	          js.async = true;
	          js.src = "//connect.facebook.net/en_US/all.js";
	          ref.parentNode.insertBefore(js, ref);
	        }(document));

			// Initialize FB
	        window.fbAsyncInit = function() {
         	console.log('before fb init');
	          FB.init({
	            appId: '165552340444163',
	            status: true, // check login status
	            cookie: true, // enable cookies to access the session
	            xfbml: false // parse XFBML
	          });

	          console.log('after fb init');

	          //Check FB Status
	          FB.getLoginStatus(function(response) {
	            console.log('getLoginStatus - ' + response);
	            if (response.status === 'connected') {
	            	scope.logged = true;
           			scope.loadMyInfo();
           			console.log('load my info');
	            } else {
	            	/*FB.login(function(response){
	            		console.log(response);
	            		if (response.status === 'connected') {
	            			scope.loadMyInfo();
	            		}
	            	}, {scope: scope.permissions});*/
	          		scope.logged = false;
	            }
	          });
	      	};
  		},
  		controller: function _controller($scope) {
  			$scope.loadTaggedPlaces = function _loadFriends() {
  				FB.api('/me/tagged_places', function(response) {
  					$scope.$apply(function() {
  						$scope.places = response.data;
  						$scope.next = response.paging.next;
  						$scope.previous = response.paging.previous;
  						console.log('number of tagged places - ' +
  							$scope.places.length);
  						console.log('previous - ' + $scope.previous);
  						console.log('next - ' + $scope.next);
  					});
  				});
  			};

  			$scope.loadMyInfo = function _loadMyInfo() {
				FB.api('/me', function(meResponse) {
            		$scope.$apply(function() {
	            		$scope.username = meResponse.name;
	            		console.log('meResponse.name - ' + meResponse.name);
	            		console.log('scope.username  - ' + $scope.username );
	    		        $scope.logged = true;
	    		        $scope.loadTaggedPlaces();
	            	});
	            });
  			};

  			$scope.myLogin = function _myLogin() {
	            FB.login(function(response){
	            	console.log(response);
	            	if (response.status === 'connected') {
	            		$scope.loadMyInfo();
	            	}
	            }, {scope: $scope.permissions});
  			};
  		},
  		templateUrl : 'partials/greeting.html'
  	};
  }]);


text:
public class ServiceAdapter implements Service{
  public void foo() {
  }
}

redpajama_set_name: RedPajamaGithub


text:
package com.google.api.ads.dfp.jaxws.v201502;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;

/**
 *
 *             A {@code Creative} used for programmatic trafficking. This creative will be auto-created with
 *             the right approval from the buyer. This creative cannot be created through
 *             the API. This creative can be updated.
 *
 *
 *
Java class for ProgrammaticCreative complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="ProgrammaticCreative">
 *   <complexContent>
 *     <extension base="{https://www.google.com/apis/ads/publisher/v201502}Creative">
 *       <sequence>
 *       </sequence>
 *     </extension>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ProgrammaticCreative")
public class ProgrammaticCreative
    extends Creative
{

}


text:
dir="$(dirname "$0")"
java -classpath "$dir"/'../lib/*' com.lewisd.ksp.craftstats.StageParts "$@"


text:
import { Optional } from '@ephox/katamari';

import DOMUtils from '../api/dom/DOMUtils';
import DomTreeWalker from '../api/dom/TreeWalker';
import * as CaretContainer from '../caret/CaretContainer';
import { CaretPosition } from '../caret/CaretPosition';
import * as NodeType from '../dom/NodeType';
import { isCaretNode } from '../fmt/FormatContainer';
import * as RangeCompare from './RangeCompare';

const findParent = (node: Node, rootNode: Node, predicate: (node: Node) => boolean): Node | null => {
  let currentNode: Node | null = node;
  while (currentNode && currentNode !== rootNode) {
    if (predicate(currentNode)) {
      return currentNode;
    }

    currentNode = currentNode.parentNode;
  }

  return null;
};

const hasParent = (node: Node, rootNode: Node, predicate: (node: Node) => boolean): boolean =>
  findParent(node, rootNode, predicate) !== null;

const hasParentWithName = (node: Node, rootNode: Node, name: string): boolean =>
  hasParent(node, rootNode, (node) => node.nodeName === name);

const isCeFalseCaretContainer = (node: Node, rootNode: Node) => CaretContainer.isCaretContainer(node) && !hasParent(node, rootNode, isCaretNode);

const hasBrBeforeAfter = (dom: DOMUtils, node: Node, left: boolean) => {
  const parentNode = node.parentNode;
  if (parentNode) {
    const walker = new DomTreeWalker(node, dom.getParent(parentNode, dom.isBlock) || dom.getRoot());

    let currentNode: Node | null | undefined;
    while ((currentNode = walker[left ? 'prev' : 'next']())) {
      if (NodeType.isBr(currentNode)) {
        return true;
      }
    }
  }

  return false;
};

const isPrevNode = (node: Node, name: string): boolean =>
  node.previousSibling?.nodeName === name;

const hasContentEditableFalseParent = (root: HTMLElement, node: Node): boolean => {
  let currentNode: Node | null = node;
  while (currentNode && currentNode !== root) {
    if (NodeType.isContentEditableFalse(currentNode)) {
      return true;
    }

    currentNode = currentNode.parentNode;
  }

  return false;
};

// Walks the dom left/right to find a suitable text node to move the endpoint into
// It will only walk within the current parent block or body and will stop if it hits a block or a BR/IMG
const findTextNodeRelative = (dom: DOMUtils, isAfterNode: boolean, collapsed: boolean, left: boolean, startNode: Node): Optional<CaretPosition> => {
  const body = dom.getRoot();
  const nonEmptyElementsMap = dom.schema.getNonEmptyElements();
  const parentNode = startNode.parentNode;
  let lastInlineElement: Node | undefined;
  let node: Node | null | undefined;

  if (!parentNode) {
    return Optional.none();
  }

  const parentBlockContainer = dom.getParent(parentNode, dom.isBlock) || body;

  // Lean left before the BR element if it's the only BR within a block element. Gecko bug: #6680
  // This:

|
 becomes
|

  if (left && NodeType.isBr(startNode) && isAfterNode && dom.isEmpty(parentBlockContainer)) {
    return Optional.some(CaretPosition(parentNode, dom.nodeIndex(startNode)));
  }

  // Walk left until we hit a text node we can move to or a block/br/img
  const walker = new DomTreeWalker(startNode, parentBlockContainer);
  while ((node = walker[left ? 'prev' : 'next']())) {
    // Break if we hit a non content editable node
    if (dom.getContentEditableParent(node) === 'false' || isCeFalseCaretContainer(node, body)) {
      return Optional.none();
    }

    // Found text node that has a length
    if (NodeType.isText(node) && node.data.length > 0) {
      if (!hasParentWithName(node, body, 'A')) {
        return Optional.some(CaretPosition(node, left ? node.data.length : 0));
      }

      return Optional.none();
    }

    // Break if we find a block or a BR/IMG/INPUT etc
    if (dom.isBlock(node) || nonEmptyElementsMap[node.nodeName.toLowerCase()]) {
      return Optional.none();
    }

    lastInlineElement = node;
  }

  if (NodeType.isComment(lastInlineElement)) {
    return Optional.none();
  }

  // Only fetch the last inline element when in caret mode for now
  if (collapsed && lastInlineElement) {
    return Optional.some(CaretPosition(lastInlineElement, 0));
  }

  return Optional.none();
};

const normalizeEndPoint = (dom: DOMUtils, collapsed: boolean, start: boolean, rng: Range): Optional<CaretPosition> => {
  const body = dom.getRoot();
  let node: Node | null | undefined;
  let normalized = false;

  let container: Node | null = start ? rng.startContainer : rng.endContainer;
  let offset = start ? rng.startOffset : rng.endOffset;
  const isAfterNode = NodeType.isElement(container) && offset === container.childNodes.length;
  const nonEmptyElementsMap = dom.schema.getNonEmptyElements();
  let directionLeft = start;

  if (CaretContainer.isCaretContainer(container)) {
    return Optional.none();
  }

  if (NodeType.isElement(container) && offset > container.childNodes.length - 1) {
    directionLeft = false;
  }

  // If the container is a document move it to the body element
  if (NodeType.isDocument(container)) {
    container = body;
    offset = 0;
  }

  // If the container is body try move it into the closest text node or position
  if (container === body) {
    // If start is before/after a image, table etc
    if (directionLeft) {
      node = container.childNodes[offset > 0 ? offset - 1 : 0];
      if (node) {
        if (CaretContainer.isCaretContainer(node)) {
          return Optional.none();
        }

        if (nonEmptyElementsMap[node.nodeName] || NodeType.isTable(node)) {
          return Optional.none();
        }
      }
    }

    // Resolve the index
    if (container.hasChildNodes()) {
      offset = Math.min(!directionLeft && offset > 0 ? offset - 1 : offset, container.childNodes.length - 1);
      container = container.childNodes[offset];
      offset = NodeType.isText(container) && isAfterNode ? container.data.length : 0;

      // Don't normalize non collapsed selections like
[a

]
      if (!collapsed && container === body.lastChild && NodeType.isTable(container)) {
        return Optional.none();
      }

      if (hasContentEditableFalseParent(body, container) || CaretContainer.isCaretContainer(container)) {
        return Optional.none();
      }

      // Don't walk into elements that doesn't have any child nodes like a IMG
      if (container.hasChildNodes() && !NodeType.isTable(container)) {
        // Walk the DOM to find a text node to place the caret at or a BR
        node = container;
        const walker = new DomTreeWalker(container, body);

        do {
          if (NodeType.isContentEditableFalse(node) || CaretContainer.isCaretContainer(node)) {
            normalized = false;
            break;
          }

          // Found a text node use that position
          if (NodeType.isText(node) && node.data.length > 0) {
            offset = directionLeft ? 0 : node.data.length;
            container = node;
            normalized = true;
            break;
          }

          // Found a BR/IMG/PRE element that we can place the caret before
          if (nonEmptyElementsMap[node.nodeName.toLowerCase()] && !NodeType.isTableCellOrCaption(node)) {
            offset = dom.nodeIndex(node);
            container = node.parentNode;

            // Put caret after image and pre tag when moving the end point
            if (!directionLeft) {
              offset++;
            }

            normalized = true;
            break;
          }
        } while ((node = (directionLeft ? walker.next() : walker.prev())));
      }
    }
  }

  // Lean the caret to the left if possible
  if (collapsed) {
    // So this: x|x
    // Becomes: x|x
    // Seems that only gecko has issues with this
    if (NodeType.isText(container) && offset === 0) {
      findTextNodeRelative(dom, isAfterNode, collapsed, true, container).each((pos) => {
        container = pos.container();
        offset = pos.offset();
        normalized = true;
      });
    }

    // Lean left into empty inline elements when the caret is before a BR
    // So this: |

    // Becomes: |

    // Seems that only gecko has issues with this.
    // Special edge case for
x|

 since we don't want
x|

    if (NodeType.isElement(container)) {
      node = container.childNodes[offset];

      // Offset is after the containers last child
      // then use the previous child for normalization
      if (!node) {
        node = container.childNodes[offset - 1];
      }

      if (node && NodeType.isBr(node) && !isPrevNode(node, 'A') &&
        !hasBrBeforeAfter(dom, node, false) && !hasBrBeforeAfter(dom, node, true)) {
        findTextNodeRelative(dom, isAfterNode, collapsed, true, node).each((pos) => {
          container = pos.container();
          offset = pos.offset();
          normalized = true;
        });
      }
    }
  }

  // Lean the start of the selection right if possible
  // So this: x[x]
  // Becomes: x[x]
  if (directionLeft && !collapsed && NodeType.isText(container) && offset === container.data.length) {
    findTextNodeRelative(dom, isAfterNode, collapsed, false, container).each((pos) => {
      container = pos.container();
      offset = pos.offset();
      normalized = true;
    });
  }

  return normalized && container ? Optional.some(CaretPosition(container, offset)) : Optional.none();
};

const normalize = (dom: DOMUtils, rng: Range): Optional<Range> => {
  const collapsed = rng.collapsed, normRng = rng.cloneRange();
  const startPos = CaretPosition.fromRangeStart(rng);

  normalizeEndPoint(dom, collapsed, true, normRng).each((pos) => {
    // #TINY-1595: Do not move the caret to previous line
    if (!collapsed || !CaretPosition.isAbove(startPos, pos)) {
      normRng.setStart(pos.container(), pos.offset());
    }
  });

  if (!collapsed) {
    normalizeEndPoint(dom, collapsed, false, normRng).each((pos) => {
      normRng.setEnd(pos.container(), pos.offset());
    });
  }

  // If it was collapsed then make sure it still is
  if (collapsed) {
    normRng.collapse(true);
  }

  return RangeCompare.isEq(rng, normRng) ? Optional.none() : Optional.some(normRng);
};

export {
  normalize
};


text:
app.controller('WallController', function ($scope, $http, $location, $routeParams, $mdDialog, Data, ngToast, Upload) {
    $scope.user_id = $routeParams.user_id;
    $scope.transfer = null;
    $scope.busy = false;
    $scope.currentData = {
        query: '',
        mode: 'me',
        after: 0,
        before: 0,
        total: 0,
        limit: 10,
        data: []
    };
    /* function*/
    $scope.sex = function (id) {
        return id == 0 ? 'Male' : 'Female';
    };
    $scope.fromNow = function (time) {
        return moment(time).fromNow();
    };
    $scope.isOwn = function (user_id) {
        return user_id == app.user_id;
    };

    function isContrain(e, arr){
        for(var i = 0; i < arr.length; i++){
            if (e.id == arr[i].id) return true;
        }
        return false;
    }

    $scope.cover = function(file){

    };
    $scope.avatar = function(file){

    };
    $scope.$watch('cover', function (files) {
        // console.log(typeof files);
        if (typeof files != 'function') {
            console.log(files);
            if(files){
                $scope.doing = true;
                Upload.upload({
                    url: app.version + 'cover',
                    method: 'POST',
                    data: {file: files}
                }).then(function (response) {
                    if(response.data.status == 'success'){
                        // console.log(response.data);
                        $scope.user = response.data.data;
                    }
                });
            }
        }
    });

    $scope.$watch('avatar', function (file) {
        console.log(typeof file);
        if (typeof file != 'function') {
            console.log(file);
            if(file){
                $scope.doing = true;
                Upload.upload({
                    url: app.version + 'avatar',
                    method: 'POST',
                    data: {file: file}
                }).then(function (response) {
                    if(response.data.status == 'success'){
                        // console.log(response.data);
                        $scope.user = response.data.data;
                    }
                });
            }
        }
    });

    $scope.$watch(function () {
        return Data.getData();
    }, function (newValue, oldValue) {
        // console.log($scope.transfer, Data.getData());
        if ($scope.transfer != Data.getData()) {
            $scope.transfer = Data.getData();
            $scope.currentData.data.unshift($scope.transfer);
        }
    });
    /*user*/
    $scope.getUserData = function () {
        $http.get(app.version + 'users/' + $scope.user_id).then(function (response) {
            // console.log($scope.user_id);
            $scope.user = response.data.data;
            $(document).ready(function(){
                $("#sticker").sticky({topSpacing: 90});
                $("#tabs").sticky({topSpacing: 79});
            });
        }, function (response) {
            $location.path('/error');
        });

    };
    /*change mode*/
    $scope.changeMode = function (mode) {
        $scope.currentData.mode = mode;
        $scope.currentData.after = 0;
        $scope.currentData.before = 0;
        $scope.currentData.total = 0;
        $scope.currentData.data.length = 0;
        $scope.getPosts($scope.currentData);

    };
    /*bookmark*/
    $scope.createBookmark = function (post) {
        $http.post(app.version + 'bookmarks', {bookmark: {user_id: app.user_id, post_id: post.id}}).then(function (response) {
            ngToast.create(response.data.data);
            console.log(response.data);
        });
    };
    /*report*/
    $scope.createReport = function (post_id) {
        $http.post(app.version + 'report', {report: {user_id: app.user_id, post_id: post_id}}).then(function (res) {
            ngToast.create(res.data.data);
        }, function () {
            ngToast.create(res.data.data);
        });
    };
    /*Post get*/
    $scope.editPost = function (ev, post) {
        $mdDialog.show({
            locals: {post: post},
            controller: EditPostController,
            templateUrl: '/pages/post_edit.tmpl.html',
            parent: angular.element(document.body),
            targetEvent: ev,
            clickOutsideToClose: false
        }).then(function (data) {
            console.log(data);
            $scope.currentData.data.forEach(function (v, i) {
                if(data.id == v.id){
                    console.log(1);
                    $scope.currentData.data.splice(i, 1);
                    $scope.currentData.data.unshift(data);
                    return true;
                }
            });
        });
    };
    function EditPostController($scope, $http, $timeout, Upload, post) {
        $scope.doing = false;
        $scope.sending = false;
        // MOdel
        // $scope.post = {
        //     user_id: app.user_id,
        //     body: '',
        //     images: [],
        //     location: {
        //         name: 'Ha Noi, Viet Nam',
        //         lat: 21.0227732,
        //         long: 105.801944
        //     }
        // };
        //Upload Images
        $scope.deleteImage = function (img) {
            $scope.post.images.forEach(function (v, i) {
                if (v.id == img.id) {
                    $scope.post.images.splice(i, 1);
                    return null;
                }
            });
        };

        Upload.setDefaults({ngfKeep: true, ngfPattern: 'image/*'});

        $scope.$watch('files', function (files) {
            if (files != null) {
                // console.log(files);
                if (files.length > 0) {
                    $scope.doing = true;
                    $scope.file = files[files.length - 1];
                    files.length = 0;
                    Upload.upload({
                        url: app.version + 'images',
                        method: 'POST',
                        data: {file: $scope.file}
                    }).then(function (response) {
                        if (response.data.status == 'success') {
                            $scope.post.images.push(response.data.data);
                            $scope.doing = false;
                        }
                    }, function () {
                        $scope.doing = false;
                    });
                }
            }
        });

        /*Map google api*/
        $scope.map = null;

        $scope.cancel = function () {
            $mdDialog.cancel();
        };

        $scope.fromNow = function (time) {
            return moment(time).fromNow();
        };

        $scope.init = function () {
            //init map
            //console.log($scope.location.name);
            $scope.markerLatLng = new google.maps.LatLng($scope.post.location.lat, $scope.post.location.long);
            $scope.infoWindow = new google.maps.InfoWindow;

            $scope.map = new google.maps.Map(document.getElementById('map'), {
                center: $scope.markerLatLng,
                zoom: 13
            });
            // geocoder
            function getInfo(event, string) {
                var geoCoder = new google.maps.Geocoder;

                geoCoder.geocode({'location': event}, function (results, status) {
                    if (status == 'OK') {
                        if (!results[1]) {
                            alert('No results found');
                        } else {
                            $scope.markerLatLng = event;
                            $scope.marker.setPosition($scope.markerLatLng);

                            $scope.$apply(function () {
                                $scope.post.location.name = string ? string : results[0].formatted_address;
                                $scope.post.location.lat = $scope.markerLatLng.lat();
                                $scope.post.location.long = $scope.markerLatLng.lng();
                            });

                            $scope.infoWindow.setContent($scope.post.location.name);
                            $scope.infoWindow.open($scope.map, $scope.marker);

                        }
                    } else {
                        alert('Geocoder failed due to: ' + status);
                    }
                });
            }

            $scope.map.addListener('click', function (event) {
                $scope.markerLatLng = event.latLng;
                getInfo($scope.markerLatLng);
            });

            $scope.marker = new google.maps.Marker({
                position: $scope.markerLatLng,
                map: $scope.map
            });

            //add input
            $scope.input = document.getElementById('pac-input');
            $scope.searchBox = new google.maps.places.SearchBox($scope.input);
            $scope.map.controls[google.maps.ControlPosition.TOP_LEFT].push($scope.input);
            // Bias the SearchBox results towards current map's viewport.
            $scope.map.addListener('bounds_changed', function () {
                $scope.searchBox.setBounds($scope.map.getBounds());
            });
            // target
            $scope.searchBox.addListener('places_changed', function () {
                var places = $scope.searchBox.getPlaces();
                if (places.length == 0) {
                    return;
                }
                // For each place, get the icon, name and location.
                var bounds = new google.maps.LatLngBounds();
                places.forEach(function (place) {
                    if (!place.geometry) {
                        console.log("Returned place contains no geometry");
                        return;
                    }

                    if (place.geometry.viewport) {
                        getInfo(place.geometry.location, place.formatted_address);
                        // Only geocodes have viewport.
                        bounds.union(place.geometry.viewport);
                    } else {
                        bounds.extend(place.geometry.location);
                    }
                });
                $scope.map.fitBounds(bounds);
            });
        };

        $scope.sendPost = function () {
            $scope.sending = true;
            $http.patch(app.version + 'posts/' + post.id, {post: $scope.post}).then(function (res) {
                $scope.sending = false;
                $mdDialog.hide(res.data.data);
            }, function () {
                alert("Please! Try again.");
            });
        };

        $timeout(function () {
            $http.get(app.version + "posts/" + post.id).then(function (response) {
                $scope.post = response.data.data.post;
                // console.log($scope.post);
                $scope.init();
            });
        }, 100);
    }
    $scope.deletePost = function (post) {
        $http.delete(app.version + 'posts/' + post.id).then(function (response) {
            //console.log(response.data);
            $scope.currentData.data.forEach(function (value, index) {
                if (value.id == response.data.data.id){
                    $scope.currentData.data.splice(index, 1);
                    return 0;
                }
            });
        });
    };
    $scope.getPosts = function (data) {
        $scope.busy = true;
        $http.get(app.version + 'home/' + data.mode + '?after=' + data.after + "&user_id=" + $scope.user_id + "&limit=" + data.limit + "&query=" + data.query)
            .then(function (response) {
                if (response.data.total > 0) {
                    data.after = response.data.after;
                    data.before = response.data.before == 0 ? data.before : response.data.before;
                    for(var i = 0; i < response.data.data.length; i++){
                        if(!isContrain(response.data.data[i], data.data))
                            data.data.push(response.data.data[i]);
                    }
                    $scope.busy = false;
                    // console.log(data.data, response.data.data);
                }
            }, function () {
                $scope.busy = false;
            });
    };

    $scope.readMore = function () {
        $scope.getPosts($scope.currentData)
    };

    $scope.showPostContent = function (ev, post) {
        $mdDialog.show({
            locals: {post: post},
            controller: PostController,
            templateUrl: '/pages/post_detail.tmpl.html',
            parent: angular.element(document.body),
            targetEvent: ev,
            clickOutsideToClose: true
        }).then(function () {

        });
    };
    /*int */
    $scope.init = function () {
        $scope.getUserData();
    };
    $scope.init();

    function PostController($scope, $http, post, $timeout, $interval) {
        function isContrain(e, arr){
            for(var i = 0; i < arr.length; i++){
                if (e.id == arr[i].id) return true;
            }
            return false;
        }

        /*customize function*/
        $scope.cancel = function () {
            $mdDialog.cancel();
        };
        $scope.isOwn = function (user_id) {
            return user_id == app.user_id;
        };

        $scope.fromNow = function (time) {
            return moment(time).fromNow();
        };

        /*Rate */
        function updateRate(p, rate, rates){
            p.rate = rate;
            p.post.data.rates = rates
        }

        $scope.rate = function (p, point) {
            if(!p.rate){
                $http.post(app.version + 'rates', {rate: {user_id: app.user_id, post_id: p.post.id, point: point}})
                    .then(function (response) {
                        updateRate(p, response.data.data.rate, response.data.data.rates);
                    });
            }
            else if(p.rate.point != point){
                $http.patch(app.version + 'rates', {rate: {user_id: app.user_id, post_id: p.post.id, point: point}})
                    .then(function (response) {
                        updateRate(p, response.data.data.rate, response.data.data.rates);
                    });
            }
            else{

                $http.delete(app.version + 'rates/' + p.rate.id)
                    .then(function (response) {
                        updateRate(p, null, response.data.data.rates);
                    });
            }
        };

        /* comment*/
        $scope.dataComments = {
            total: 0,
            after: 0,
            before: 0,
            limit: 15,
            data: []
        };
        $scope.deleteComment = function (comment) {
            $http.delete(app.version + 'comments/' + comment.id).then(function (response) {
                $scope.dataComments.data.forEach(function (v, i) {
                    if(v.id == response.data.data.id){
                        $scope.dataComments.data.splice(i, 1);
                        $scope.dataComments.total--;
                        $scope.data.post.data.comments = response.data.data.comments;
                        return 0;
                    }
                });
            });
        };
        $scope.createComment = function (body) {
            if ($scope.comment.length > 0)
                $http.post(app.version + 'comments', {comment: {user_id: app.user_id, post_id: $scope.data.post.id, body: body}})
                    .then(function (response) {
                        if(response.data.status == 'success'){
                            if(!isContrain(response.data.data.comment, $scope.dataComments.data)){
                                $scope.dataComments.data.push(response.data.data.comment);
                                $scope.data.post.data.comments = response.data.data.comments;
                                $scope.comment = '';
                                $scope.dataComments.total++;
                            }
                        }
                    });
        };

        $scope.getComments = function(data){
            $scope.busy = true;
            $http.get(app.version + 'comments?post_id=' + $scope.data.post.id +"&after=" + data.after + "&limit=" + data.limit)
                .then(function (response) {
                    if (response.data.total > 0) {
                        data.after = response.data.after;
                        data.before = response.data.before == 0 ? data.before : response.data.before;
                        for(var i = 0; i < response.data.data.length; i++){
                            if(!isContrain(response.data.data[i], data.data)){
                                data.data.push(response.data.data[i]);
                                data.total++;
                            }
                        }
                        $scope.busy = false;
                        // console.log(data.data, response.data.data);
                    }
                });
        };
        /*image button*/
        $scope.imgIndex = 0;

        $scope.next = function (imagesArr) {

            if ($scope.imgIndex < imagesArr.length - 1) {
                $scope.imgIndex++;
            }
            else if ($scope.imgIndex == imagesArr.length - 1) {
                $scope.imgIndex = 0;
            }
        };

        $scope.prev = function (imagesArr) {

            if ($scope.imgIndex > 0) {
                $scope.imgIndex--;
            }
            else if ($scope.imgIndex == 0) {
                $scope.imgIndex = imagesArr.length - 1;
            }
        };

        /*init */
        $scope.init = function () {
            $http.get(app.version + 'posts/' + post.id).then(function (response) {
                if (response.data.status == 'success') {
                    $scope.data = response.data.data;
                    $scope.images = function (imagesArr) {
                        return imagesArr[$scope.imgIndex].src.url;
                    };
                    $scope.getComments($scope.dataComments);

                    $timeout(function () {
                        $interval(function () {
                            $http.get(app.version + 'posts/' + post.id).then(function (response) {
                                $scope.data = response.data.data;
                            });
                        }, 10000);
                    }, 5000);

                    $timeout(function () {
                        $interval(function () {
                            $http.get(app.version
                                + "realtime/comments?before="
                                + $scope.dataComments.before
                                + "&post_id=" + $scope.data.post.id
                                + "&limit=" + 10).then(function (res) {
                                res.data.data.forEach(function (v, i) {
                                    if(!isContrain(v, $scope.dataComments.data)) $scope.dataComments.data.unshift(v);
                                });
                                $scope.dataComments.before = res.data.before;
                            });
                        }, 5000);
                    }, 5000);
                }
            });

        };

        $scope.init();
    }
});


text:
package com.maven.project.exceptions.user;

public class UserActivationAccountBannedException extends UserActivationException {

	// Constants---------------------------------------------------
	private static final long serialVersionUID = 3443909554123246479L;

	// Constructors--------------------------------------------------
	public UserActivationAccountBannedException(String message) {
			super(message);
		}

}


text:
A Compositional Query Framework for F# Queries, based on ["A Practical Theory of Language-Integrated Query" (ICFP 2013)](http://dl.acm.org/citation.cfm?id=2500586)

##Build

If you want to use the library simply proceed to the Installation section.

### Prerequisites
 - Visual Studio 2012 or later.

To build, open a command prompt or a terminal window and type

    build
to execute the build script for your system (tested only under Windows).

The default build target does not execute any unit tests since they require the presence of a properly configured SQL Server database.
You can follow the instructions in the README.md file [here](tests/FSharpComposableQuery.Tests) on setting up the testing environment.

If you receive a `File does not exist` error this may indicate you do not have MSBuild in your console path. In such a case do one of the following:
 - Open the VS Command Prompt from its shortcut or from inside Visual Studio
 - Add the respective directories where the executable lies manually to your PATH variable.

## Installation

You can find the library on [NuGet](https://www.nuget.org/packages/FSharpComposableQuery).

## Usage

Check out the [tutorial](http://fsprojects.github.io/FSharp.Linq.ComposableQuery/) for examples and an overview of the main use cases of this library.

## Maintainer(s)

- [@ixtreon](https://github.com/ixtreon)
- [@jamescheney](https://github.com/jamescheney)

The default maintainer account for projects under "fsprojects" is [@fsprojectsgit](https://github.com/fsprojectsgit) - F# Community Project Incubation Space (repo management)


text:
from __future__ import print_function

from bs4 import BeautifulSoup
from datetime import date
import os.path as path
import sys

_COMPILE_JS = '//third_party/closure_compiler/compile_js.gni'
_POLYMERS = ['polymer.html', 'polymer-mini.html', 'polymer-micro.html']
_COMPILED_RESOURCES_TEMPLATE = '''
# Copyright %d The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# NOTE: Created with %s, please do not edit.

import("%s")

%s
'''.strip()

def main(created_by, html_files):
    targets = ''

    def _html_to_extracted(html_file):
        assert html_file.endswith('.html')
        return html_file[:-len('.html')] + '-extracted'

    def _target_name(target_file):
        return _html_to_extracted(path.basename(target_file))

    def _has_extracted_js(html_file):
        return path.isfile(_html_to_extracted(html_file) + '.js')

    html_files = filter(_has_extracted_js, html_files)

    for html_file in sorted(html_files, key=_target_name):
        html_base = path.basename(html_file)
        if html_base in _POLYMERS:
            continue

        parsed = BeautifulSoup(open(html_file), 'html.parser')
        imports = set(
            i.get('href') for i in parsed.find_all('link', rel='import'))

        html_dir = path.dirname(html_file)
        dependencies = []
        externs = ''

        for html_import in sorted(imports):
            import_dir, import_base = path.split(html_import.encode('ascii'))
            if import_base in _POLYMERS:
                continue

            # Only exclude these after appending web animations externs.
            if not _has_extracted_js(path.join(html_dir, html_import)):
                continue

            target = ':' + _target_name(import_base)

            dependencies.append(import_dir + target)

        targets += '\njs_library("%s-extracted") {' % html_base[:-5]
        if dependencies:
            targets += '\n  deps = ['
            targets += '\n    "%s",' % '",\n    "'.join(dependencies)
            targets += '\n  ]'
        targets += externs
        targets += '\n}\n'

    targets = targets.strip()

    if targets:
        current_year = date.today().year
        print(_COMPILED_RESOURCES_TEMPLATE % (current_year, created_by,
                                              _COMPILE_JS, targets))

if __name__ == '__main__':
    main(path.basename(sys.argv[0]), sys.argv[1:])


text:
class Room;

class Sprite {
    public:
        Sprite();
        virtual ~Sprite();

        // Comparison functions For draw-order sorting
        bool operator< (const Sprite& rhs) const {
            return position.y + size.h < rhs.position.y + rhs.size.h;
        }
        struct PointerCompare {
            bool operator()(const Sprite* l, const Sprite* r) {
                return *l < *r;
            }
        };

        void Draw(Camera);
        Position GetPosition() { return position; };
        Size GetSize() { return size; };
        Skin* GetSkin() { return skin; };
        bool IsMirrored() { return isMirrored; };
        void SetPosition(int x, int y);
        void SetRoom(Room* room) { this->room = room; };
        virtual void Update();

        // Virtual methods for PhysicsBody
        virtual void Move(std::vector<Sprite*>*);
        virtual void PostMove();

    protected:
        bool isMirrored;
        Position position;
        Room* room;
        Size size;
        Skin* skin;
};

#endif // SPRITE_HPP


text:
package com.android.record.bean;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

import java.util.List;

/**
 * Created by kiddo on 17-3-31.
 */

public class GsonCard {
    @SerializedName("code")
    @Expose
    private Integer code;
    @SerializedName("message")
    @Expose
    private String message;
    @SerializedName("data")
    @Expose
    private List<SwipeCardBean> data = null;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public List<SwipeCardBean> getData() {
        return data;
    }

    public void setData(List<SwipeCardBean> data) {
        this.data = data;
    }
}


text:
<!doctype html>

<meta charset="utf-8">
<title>CSS Test: Gradient list markers</title>
<link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com">
<link rel="help" href="https://drafts.csswg.org/css-lists/#image-markers">
<link rel="help" href="https://drafts.csswg.org/css-images-3/#typedef-gradient">
<link rel="match" href="list-style-image-gradients-ref.html">
<meta name="assert" content="list-style-image:<gradient> with a single color renders the same as an image without an intrinsic size of the same color">

text

text

text

text

text

text

text

text

text

text

text

text


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

    Most of the code in the Qalingo project is copyrighted Hoteia and licensed
    under the Apache License Version 2.0 (release version 0.8.0)
            http://www.apache.org/licenses/LICENSE-2.0

                      Copyright (c) Hoteia, 2012-2014
    http://www.hoteia.com - http://twitter.com/hoteia - contact@hoteia.com

-->
<mappings xmlns="http://dozer.sourceforge.net" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://dozer.sourceforge.net
          http://dozer.sourceforge.net/schema/beanmapping.xsd">

    <mapping>
        <class-a>org.hoteia.qalingo.core.domain.CatalogMaster</class-a>
        <class-b bean-factory="org.hoteia.qalingo.core.dozer.CatalogCustomBeanFactory">org.hoteia.qalingo.core.pojo.catalog.CatalogPojo</class-b>
    </mapping>

    <mapping>
        <class-a>org.hoteia.qalingo.core.domain.CatalogVirtual</class-a>
        <class-b bean-factory="org.hoteia.qalingo.core.dozer.CatalogCustomBeanFactory">org.hoteia.qalingo.core.pojo.catalog.CatalogPojo</class-b>
    </mapping>

	<mapping>
		<class-a>org.hoteia.qalingo.core.domain.CatalogCategoryMaster</class-a>
		<class-b bean-factory="org.hoteia.qalingo.core.dozer.CatalogCategoryCustomBeanFactory">org.hoteia.qalingo.core.pojo.catalog.CatalogCategoryPojo</class-b>
	</mapping>

	<mapping>
		<class-a>org.hoteia.qalingo.core.domain.CatalogCategoryVirtual</class-a>
		<class-b bean-factory="org.hoteia.qalingo.core.dozer.CatalogCategoryCustomBeanFactory">org.hoteia.qalingo.core.pojo.catalog.CatalogCategoryPojo</class-b>
	</mapping>

    <mapping>
        <class-a>org.hoteia.qalingo.core.domain.ProductMarketing</class-a>
        <class-b bean-factory="org.hoteia.qalingo.core.dozer.ProductMarketingCustomBeanFactory">org.hoteia.qalingo.core.pojo.product.ProductMarketingPojo</class-b>
    </mapping>

    <mapping>
        <class-a>org.hoteia.qalingo.core.domain.ProductSku</class-a>
        <class-b bean-factory="org.hoteia.qalingo.core.dozer.ProductSkuCustomBeanFactory">org.hoteia.qalingo.core.pojo.product.ProductSkuPojo</class-b>
    </mapping>

</mappings>


text:
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
 * Microsemi Switchtec PCIe Driver
 * Copyright (c) 2017, Microsemi Corporation
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 */

#ifndef _LINUX_SWITCHTEC_IOCTL_H
#define _LINUX_SWITCHTEC_IOCTL_H

#include <linux/types.h>

#define SWITCHTEC_IOCTL_PART_CFG0	0
#define SWITCHTEC_IOCTL_PART_CFG1	1
#define SWITCHTEC_IOCTL_PART_IMG0	2
#define SWITCHTEC_IOCTL_PART_IMG1	3
#define SWITCHTEC_IOCTL_PART_NVLOG	4
#define SWITCHTEC_IOCTL_PART_VENDOR0	5
#define SWITCHTEC_IOCTL_PART_VENDOR1	6
#define SWITCHTEC_IOCTL_PART_VENDOR2	7
#define SWITCHTEC_IOCTL_PART_VENDOR3	8
#define SWITCHTEC_IOCTL_PART_VENDOR4	9
#define SWITCHTEC_IOCTL_PART_VENDOR5	10
#define SWITCHTEC_IOCTL_PART_VENDOR6	11
#define SWITCHTEC_IOCTL_PART_VENDOR7	12
#define SWITCHTEC_IOCTL_PART_BL2_0	13
#define SWITCHTEC_IOCTL_PART_BL2_1	14
#define SWITCHTEC_IOCTL_PART_MAP_0	15
#define SWITCHTEC_IOCTL_PART_MAP_1	16
#define SWITCHTEC_IOCTL_PART_KEY_0	17
#define SWITCHTEC_IOCTL_PART_KEY_1	18

#define SWITCHTEC_NUM_PARTITIONS_GEN3	13
#define SWITCHTEC_NUM_PARTITIONS_GEN4	19

/* obsolete: for compatibility with old userspace software */
#define SWITCHTEC_IOCTL_NUM_PARTITIONS	SWITCHTEC_NUM_PARTITIONS_GEN3

struct switchtec_ioctl_flash_info {
	__u64 flash_length;
	__u32 num_partitions;
	__u32 padding;
};

#define SWITCHTEC_IOCTL_PART_ACTIVE  1
#define SWITCHTEC_IOCTL_PART_RUNNING 2

struct switchtec_ioctl_flash_part_info {
	__u32 flash_partition;
	__u32 address;
	__u32 length;
	__u32 active;
};

struct switchtec_ioctl_event_summary_legacy {
	__u64 global;
	__u64 part_bitmap;
	__u32 local_part;
	__u32 padding;
	__u32 part[48];
	__u32 pff[48];
};

struct switchtec_ioctl_event_summary {
	__u64 global;
	__u64 part_bitmap;
	__u32 local_part;
	__u32 padding;
	__u32 part[48];
	__u32 pff[255];
};

#define SWITCHTEC_IOCTL_EVENT_STACK_ERROR		0
#define SWITCHTEC_IOCTL_EVENT_PPU_ERROR			1
#define SWITCHTEC_IOCTL_EVENT_ISP_ERROR			2
#define SWITCHTEC_IOCTL_EVENT_SYS_RESET			3
#define SWITCHTEC_IOCTL_EVENT_FW_EXC			4
#define SWITCHTEC_IOCTL_EVENT_FW_NMI			5
#define SWITCHTEC_IOCTL_EVENT_FW_NON_FATAL		6
#define SWITCHTEC_IOCTL_EVENT_FW_FATAL			7
#define SWITCHTEC_IOCTL_EVENT_TWI_MRPC_COMP		8
#define SWITCHTEC_IOCTL_EVENT_TWI_MRPC_COMP_ASYNC	9
#define SWITCHTEC_IOCTL_EVENT_CLI_MRPC_COMP		10
#define SWITCHTEC_IOCTL_EVENT_CLI_MRPC_COMP_ASYNC	11
#define SWITCHTEC_IOCTL_EVENT_GPIO_INT			12
#define SWITCHTEC_IOCTL_EVENT_PART_RESET		13
#define SWITCHTEC_IOCTL_EVENT_MRPC_COMP			14
#define SWITCHTEC_IOCTL_EVENT_MRPC_COMP_ASYNC		15
#define SWITCHTEC_IOCTL_EVENT_DYN_PART_BIND_COMP	16
#define SWITCHTEC_IOCTL_EVENT_AER_IN_P2P		17
#define SWITCHTEC_IOCTL_EVENT_AER_IN_VEP		18
#define SWITCHTEC_IOCTL_EVENT_DPC			19
#define SWITCHTEC_IOCTL_EVENT_CTS			20
#define SWITCHTEC_IOCTL_EVENT_HOTPLUG			21
#define SWITCHTEC_IOCTL_EVENT_IER			22
#define SWITCHTEC_IOCTL_EVENT_THRESH			23
#define SWITCHTEC_IOCTL_EVENT_POWER_MGMT		24
#define SWITCHTEC_IOCTL_EVENT_TLP_THROTTLING		25
#define SWITCHTEC_IOCTL_EVENT_FORCE_SPEED		26
#define SWITCHTEC_IOCTL_EVENT_CREDIT_TIMEOUT		27
#define SWITCHTEC_IOCTL_EVENT_LINK_STATE		28
#define SWITCHTEC_IOCTL_EVENT_GFMS			29
#define SWITCHTEC_IOCTL_EVENT_INTERCOMM_REQ_NOTIFY	30
#define SWITCHTEC_IOCTL_EVENT_UEC			31
#define SWITCHTEC_IOCTL_MAX_EVENTS			32

#define SWITCHTEC_IOCTL_EVENT_LOCAL_PART_IDX -1
#define SWITCHTEC_IOCTL_EVENT_IDX_ALL -2

#define SWITCHTEC_IOCTL_EVENT_FLAG_CLEAR     (1 << 0)
#define SWITCHTEC_IOCTL_EVENT_FLAG_EN_POLL   (1 << 1)
#define SWITCHTEC_IOCTL_EVENT_FLAG_EN_LOG    (1 << 2)
#define SWITCHTEC_IOCTL_EVENT_FLAG_EN_CLI    (1 << 3)
#define SWITCHTEC_IOCTL_EVENT_FLAG_EN_FATAL  (1 << 4)
#define SWITCHTEC_IOCTL_EVENT_FLAG_DIS_POLL  (1 << 5)
#define SWITCHTEC_IOCTL_EVENT_FLAG_DIS_LOG   (1 << 6)
#define SWITCHTEC_IOCTL_EVENT_FLAG_DIS_CLI   (1 << 7)
#define SWITCHTEC_IOCTL_EVENT_FLAG_DIS_FATAL (1 << 8)
#define SWITCHTEC_IOCTL_EVENT_FLAG_UNUSED    (~0x1ff)

struct switchtec_ioctl_event_ctl {
	__u32 event_id;
	__s32 index;
	__u32 flags;
	__u32 occurred;
	__u32 count;
	__u32 data[5];
};

#define SWITCHTEC_IOCTL_PFF_VEP 100
struct switchtec_ioctl_pff_port {
	__u32 pff;
	__u32 partition;
	__u32 port;
};

#define SWITCHTEC_IOCTL_FLASH_INFO \
	_IOR('W', 0x40, struct switchtec_ioctl_flash_info)
#define SWITCHTEC_IOCTL_FLASH_PART_INFO \
	_IOWR('W', 0x41, struct switchtec_ioctl_flash_part_info)
#define SWITCHTEC_IOCTL_EVENT_SUMMARY \
	_IOR('W', 0x42, struct switchtec_ioctl_event_summary)
#define SWITCHTEC_IOCTL_EVENT_SUMMARY_LEGACY \
	_IOR('W', 0x42, struct switchtec_ioctl_event_summary_legacy)
#define SWITCHTEC_IOCTL_EVENT_CTL \
	_IOWR('W', 0x43, struct switchtec_ioctl_event_ctl)
#define SWITCHTEC_IOCTL_PFF_TO_PORT \
	_IOWR('W', 0x44, struct switchtec_ioctl_pff_port)
#define SWITCHTEC_IOCTL_PORT_TO_PFF \
	_IOWR('W', 0x45, struct switchtec_ioctl_pff_port)

#endif


text:
module CompaniesHouseGateway
  module Constants
    # Check types suported by the Companies House XML Gateway
    SUPPORTED_REQUESTS = %w(NameSearch NumberSearch CompanyAppointments
                            CompanyDetails OfficerSearch OfficerDetails
                            Mortgages FilingHistory DocumentInfo Document)

    DATA_SETS = [
      "LIVE",      # Live companies and those dissolved in the last 12 months
      "DISSOLVED", # Companies that have been dissolved in the last 20 years
      "FORMER",    # All previous company names from the last 20 years
      "PROPOSED",  # Proposed changes to the names of existing companies
    ].freeze

    OFFICER_TYPES = [
      "DIS",       # Disqualified Directors only
      "LLP",       # Limited Liability Partnerships
      "CUR",       # Current (i.e., not above)
      "EUR",       # SE and ES appointments only
    ].freeze

    # White list of allowed prefixes for companies house numbers.
    # 1st line is English and Welsh prefixes
    # 2nd line is Scottish prefixes
    # 3rd line is Northen Irish prefixes
    # \d\d is the default prefix in regex notation.
    ALLOWED_PREFIXES = %w(AC BR FC GE IP LP OC RC SE ZC
                          SC SA SF SL SZ SP SO SR
                          NI NA NF NL NZ NP NO NR NC
                          \d\d)
  end
end


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Kri extends APP_Controlleri {
	function __construct()
    {
        parent::__construct();

        $this->load->model('risk/risk');
    }

	public function krientry()
	{
		$data = $this->loadDefaultAppConfig();
		$data['indonya'] = base_url('index.php/riski/kri/krisetting');
		$data['engnya'] = base_url('index.php/risk/kri/krisetting');
		$data['sidebarMenu'] = $this->getSidebarMenuStructure('riski/kri/krientry');
		$data['pageLevelStyles'] = '
		<link rel="stylesheet" type="text/css" href="assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css"/>
		<link href="assets/global/plugins/bootstrap-modal/css/bootstrap-modal-bs3patch.css" rel="stylesheet" type="text/css"/>
		<link href="assets/global/plugins/bootstrap-modal/css/bootstrap-modal.css" rel="stylesheet" type="text/css"/>
		<link rel="stylesheet" type="text/css" href="assets/global/plugins/bootstrap-datepicker/css/bootstrap-datepicker3.min.css"/>
		';

		$data['pageLevelScripts'] = '
		<script type="text/javascript" src="assets/global/plugins/datatables/media/js/jquery.dataTables.min.js"></script>
		<script type="text/javascript" src="assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.js"></script>
		<script src="assets/global/plugins/bootstrap-modal/js/bootstrap-modalmanager.js" type="text/javascript"></script>
		<script src="assets/global/plugins/bootstrap-modal/js/bootstrap-modal.js" type="text/javascript"></script>
		<script type="text/javascript" src="assets/global/plugins/bootstrap-datepicker/js/bootstrap-datepicker.min.js"></script>
		<script type="text/javascript" src="assets/global/plugins/jquery-validation/js/jquery.validate.min.js"></script>

		<script src="assets/scripts/riski/krientry.js"></script>
		';

		$data['pageLevelScriptsInit'] = 'Kri.init();';

		$this->load->model('risk/mriskregister');
		$data['division_list'] = $this->mriskregister->getDivisionList();

		$this->load->view('maini/header', $data);
		$this->load->view('kri_entry', $data);
		$this->load->view('main/footer', $data);
	}

	public function insertKriData()
	{
		$data = $this->loadDefaultAppConfig();
		if ($_POST['kri_library_id'] == '') $_POST['kri_library_id'] = null;

		$dd = implode('-', array_reverse( explode('-', $_POST['timing_pelaporan']) ));
		$kri = array(
			'risk_id' => $_POST['risk_id'],
			'kri_library_id' => $_POST['kri_library_id'],
			'key_risk_indicator' => $_POST['key_risk_indicator'],
			'kri_status' => 0,
			'treshold' => $_POST['treshold'],
			'treshold_type' => $_POST['treshold_type'],
			'timing_pelaporan' => $dd,
			'kri_owner' => $_POST['kri_owner'],
			'created_by' => $data['session']['username']
		);

		$tres = array();
		foreach($_POST['treshold_list'] as $v) {
			$tres[] = $v;
		}

		$res = $this->risk->insertNewKri($kri, $tres);

		$resp = array();
		if ($res) {
			$resp['success'] = true;
			$resp['msg'] = 'SUCCESS';
		} else {
			$resp['success'] = false;
			$resp['msg'] = $this->db->error();
		}
		echo json_encode($resp);
	}

	public function submitKriReport()
	{
		if (isset($_POST['id']) && is_numeric($_POST['id'])) {
			$rid = $_POST['id'];
			$kri = $this->risk->getKriById($rid);
			$kri_warning = null;
			$report = $_POST['owner_report'];

			if ($kri['treshold_type'] == 'SELECTION') {

				foreach ($kri['treshold_list'] as $key => $value) {
					if ($value['value_1'] == $_POST['owner_report']) {
						$kri_warning = $value['result'];
					}
				}
			} else {

				foreach ($kri['treshold_list'] as $key => $value) {
					if ($value['value_1'] == $_POST['owner_report']) {
						$kri_warning = $value['result'];
					}
				}
			}

			// if is div head then submit for verification, if pic for div head verify
			if ($this->session->credential['role_id'] == 4) {
				$stat = 2;
			} else {
				$stat = 1;
			}

			$par = array(
				'kri_status' => $stat,
				'owner_report' => $report,
				'kri_warning' => $kri_warning
			);

			$res = $this->risk->updateKri($rid, $par, $this->session->credential['username']);
			$resp = array();
			if ($res) {
				$resp['success'] = true;
				$resp['msg'] = 'SUCCESS';
			} else {
				$resp['success'] = false;
				$resp['msg'] = $this->db->error();
			}
			echo json_encode($resp);
		}
	}

	public function verifyKri()
	{
		if (isset($_POST['id']) && is_numeric($_POST['id'])) {
			$rid = $_POST['id'];
			$kri = $this->risk->getKriById($rid);
			$kri_warning = null;
			$report = $_POST['owner_report'];

			if ($kri['treshold_type'] == 'SELECTION') {

				foreach ($kri['treshold_list'] as $key => $value) {
					if ($value['value_1'] == $_POST['owner_report']) {
						$kri_warning = $value['result'];
					}
				}
			}else if ($kri['treshold_type'] == 'VALUE') {

				foreach ($kri['treshold_list'] as $key => $value) {
					if ($value['value_1'] == $_POST['owner_report']) {
						$kri_warning = $value['result'];
					}
				}
			} else {
				$tt = 'NUMERIC';
				if ($report <= 100) $tt = 'PERCENTAGE';

				foreach ($kri['treshold_list'] as $key => $value) {
					if ($value['value_type'] == $tt && $value['operator'] == 'BELOW'
						&& $report < $value['value_1'] ) {
						$kri_warning = $value['result'];
					}

					if ($value['value_type'] == $tt && $value['operator'] == 'BETWEEN'
						&& ($report >= $value['value_1'] && $report <= $value['value_2']) ) {
						$kri_warning = $value['result'];
					}

					if ($value['value_type'] == $tt && $value['operator'] == 'ABOVE'
						&& $report > $value['value_1'] ) {
						$kri_warning = $value['result'];
					}
				}
			}

			$stat = 3;

			$par = array(
				'kri_status' => $stat,
				'owner_report' => $report,
				'kri_warning' => $kri_warning
			);

			$res = $this->risk->updateKri($rid, $par, $this->session->credential['username']);
			$resp = array();
			if ($res) {
				$resp['success'] = true;
				$resp['msg'] = 'SUCCESS';
			} else {
				$resp['success'] = false;
				$resp['msg'] = $this->db->error();
			}
			echo json_encode($resp);
		}
	}

	public function krisetting() {
		$data = $this->loadDefaultAppConfig();
		$data['indonya'] = base_url('index.php/riski/kri/krisetting');
		$data['engnya'] = base_url('index.php/risk/kri/krisetting');
		$data['sidebarMenu'] = $this->getSidebarMenuStructure('riski/kri/krisetting');
		$data['pageLevelStyles'] = '
		<link rel="stylesheet" type="text/css" href="assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css"/>
		<link href="assets/global/plugins/bootstrap-modal/css/bootstrap-modal-bs3patch.css" rel="stylesheet" type="text/css"/>
		<link href="assets/global/plugins/bootstrap-modal/css/bootstrap-modal.css" rel="stylesheet" type="text/css"/>
		<link rel="stylesheet" type="text/css" href="assets/global/plugins/bootstrap-datepicker/css/bootstrap-datepicker3.min.css"/>
		';

		$data['pageLevelScripts'] = '
		<script type="text/javascript" src="assets/global/plugins/datatables/media/js/jquery.dataTables.min.js"></script>
		<script type="text/javascript" src="assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.js"></script>
		<script src="assets/global/plugins/bootstrap-modal/js/bootstrap-modalmanager.js" type="text/javascript"></script>
		<script src="assets/global/plugins/bootstrap-modal/js/bootstrap-modal.js" type="text/javascript"></script>
		<script type="text/javascript" src="assets/global/plugins/bootstrap-datepicker/js/bootstrap-datepicker.min.js"></script>
		<script type="text/javascript" src="assets/global/plugins/jquery-validation/js/jquery.validate.min.js"></script>

		<script src="assets/scripts/risk/krisetting.js"></script>
		';

		$data['pageLevelScriptsInit'] = 'Kri.init();';

		$this->load->view('maini/header', $data);
		$this->load->view('kri_setting', $data);
		$this->load->view('main/footer', $data);
	}

	public function getRiskForKri()
	{
		$order_by = $order = $filter_by = $filter_value = null;

		if (isset($_POST['order'][0]['column'])) {
			$order_idx = $_POST['order'][0]['column'];
			$order_by = $_POST['columns'][$order_idx]['data'];
			$order = $_POST['order'][0]['dir'];
		}

		if (isset($_POST['filter_by']) && isset($_POST['filter_value']) && $_POST['filter_value'] != '' ) {
			$filter_by = $_POST['filter_by'];
			$filter_value = $_POST['filter_value'];
		}

		$page = ceil($_POST['start'] / $_POST['length'])+1;

		$row = $_POST['length'];
		$this->load->model('risk/risk');
		$defFilter = array();
		if (isset($_POST['filter_library']) && trim($_POST['filter_library']) != '') {
			$defFilter['filter_library'] = trim($_POST['filter_library']);
		}

		$data = $this->risk->getDataMode('kriNotRisk', $defFilter, $page, $row, $order_by, $order, $filter_by, $filter_value);
		foreach($data['data'] as $k=>$v) {
			$data['data'][$k]['checkboxColumn'] = '<input type="checkbox" name="id[]" value="'.$v['risk_id'].'" rtype="'.$v['risk_level'].'">';
		}

		$data['draw'] = $_POST['draw']*1;
		$data['page'] = $page;
		echo json_encode($data);
	}

	public function getRiskKri()
	{
		$order_by = $order = $filter_by = $filter_value = null;

		if (isset($_POST['order'][0]['column'])) {
			$order_idx = $_POST['order'][0]['column'];
			$order_by = $_POST['columns'][$order_idx]['data'];
			$order = $_POST['order'][0]['dir'];
		}

		if (isset($_POST['filter_by']) && isset($_POST['filter_value']) && $_POST['filter_value'] != '' ) {
			$filter_by = $_POST['filter_by'];
			$filter_value = $_POST['filter_value'];
		}

		$page = ceil($_POST['start'] / $_POST['length'])+1;

		$row = $_POST['length'];
		$this->load->model('risk/risk');
		$defFilter = array();
		if (isset($_POST['filter_library']) && trim($_POST['filter_library']) != '') {
			$defFilter['filter_library'] = trim($_POST['filter_library']);
		}

		$data = $this->risk->getDataMode('kriRisk', $defFilter, $page, $row, $order_by, $order, $filter_by, $filter_value);

		$data['draw'] = $_POST['draw']*1;
		$data['page'] = $page;
		echo json_encode($data);
	}

	public function kriAddRisk() {
		if (isset($_POST['risk_id']) && is_array($_POST['risk_id']) && count($_POST['risk_id']) > 0) {
			$res = $this->risk->addRiskToKri($_POST['risk_id']);
			$resp = array();
			if ($res) {
				$resp['success'] = true;
				$resp['msg'] = 'SUCCESS';
			} else {
				$resp['success'] = false;
				$resp['msg'] = $this->db->error();
			}
			echo json_encode($resp);
		}
	}

	public function getKriLibrary()
	{
		$order_by = $order = $filter_by = $filter_value = null;

		if (isset($_POST['order'][0]['column'])) {
			$order_idx = $_POST['order'][0]['column'];
			$order_by = $_POST['columns'][$order_idx]['data'];
			$order = $_POST['order'][0]['dir'];
		}

		if (isset($_POST['filter_by']) && isset($_POST['filter_value']) && $_POST['filter_value'] != '' ) {
			$filter_by = $_POST['filter_by'];
			$filter_value = $_POST['filter_value'];
		}

		$page = ceil($_POST['start'] / $_POST['length'])+1;

		$row = $_POST['length'];
		$this->load->model('risk/risk');
		$defFilter = array();
		if (isset($_POST['filter_library']) && trim($_POST['filter_library']) != '') {
			$defFilter['filter_library'] = trim($_POST['filter_library']);
		}

		$data = $this->risk->getDataMode('kriLibrary', $defFilter, $page, $row, $order_by, $order, $filter_by, $filter_value);

		$data['draw'] = $_POST['draw']*1;
		$data['page'] = $page;
		echo json_encode($data);
	}

	public function getKri($rid) {
		if ($rid && is_numeric($rid)) {
			$kri = $this->risk->getKriById($rid);
			echo json_encode($kri);
		}
	}
}


text:
{-# OPTIONS_GHC -fno-warn-unused-imports #-}

-- | This module bridges between
-- <http://hackage.haskell.org/package/checkers checkers> and
-- <http://hackage.haskell.org/package/hspec hspec>. It makes it easy to
-- integrate tests for class laws provided by checkers into test suites written
-- with hspec.
--
-- Here's an example testing that lists satisfy the 'Monoid' laws:
--
-- @
--import Test.Hspec -- 'Test.Hspec'
--import Test.Hspec.Checkers -- 'Test.Hspec.Checkers'
--import Test.QuickCheck.Classes -- 'Test.QuickCheck.Classes'
--
--main :: IO ()
--main = 'hspec' spec
--
--spec :: Spec
--spec = do
--  'testBatch' ('monoid' (undefined :: [Int]))
-- @
module Test.Hspec.Checkers (testBatch) where

import           Test.Hspec
import           Test.QuickCheck.Checkers

-- to make haddock links work
import           Test.QuickCheck.Classes  (monoid)

-- | Allows to insert a 'TestBatch' into a Spec.
testBatch :: TestBatch -> Spec
testBatch (batchName, tests) = describe ("laws for: " ++ batchName) $
    foldr (>>) (return ()) (map (uncurry it) tests)


text:
<?php

class EpochTypeUnknownException extends DetailedException
{
    /**
     * Constructor
     *
     * @param string $selector column used to select user
     */
    public function __construct($selector)
    {
        parent::__construct(
            'epochtype_unknown_event', // Message to give to the user
            array('selector' => $selector) // Real message to log
        );
    }
}


text:
'use strict';

define(['jquery', 'underscore', 'models/cardModel', 'controllers/cardsController', 'controllers/addController',
    'modernizr'],
    function($, _, CardModel, CardsController, AddController, Modernizr) {

        var cardsPath = '../cards.json';
        var App = function(options) {
            options = options || {};
            if (Modernizr.localstorage) {
                this.cards = localStorage.cards ? JSON.parse(localStorage.cards) : [];
            } else {
                this.cards = [];
            }
            this.init();
        };

        _.extend(App.prototype, {
            init: function() {
                var self = this;

                if (this.cards.length === 0) {
                    var cards = $.getJSON(cardsPath, function() {}).done(function(data) {
                        console.log('cards have been loaded from json:', data);
                    }).fail(function() {
                        console.log('error while loading cards');
                    });

                    cards.done(function(data) {
                        for (var i = 0, len = data.length; i < len; i++) {
                            self.cards.push(new CardModel(data[i]));
                        }
                        localStorage.cards = JSON.stringify(self.cards);
                        var cardsContr = new CardsController();
                        new AddController(cardsContr);
                    });
                } else {
                    console.log('cards have been loaded from localStorage');
                    var cardsContr = new CardsController();
                    new AddController(cardsContr);
                }
            }

        });

        return App;
    });


text:
<?php

// C:\xampp\htdocs\login\src\Acme\LoginBundle/Resources/views\layout.html.twig
return array (
);


text:
package com.microsoft.azure.management.monitor.v2017_04_01;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * An Itsm receiver.
 */
public class ItsmReceiver {
    /**
     * The name of the Itsm receiver. Names must be unique across all receivers
     * within an action group.
     */
    @JsonProperty(value = "name", required = true)
    private String name;

    /**
     * OMS LA instance identifier.
     */
    @JsonProperty(value = "workspaceId", required = true)
    private String workspaceId;

    /**
     * Unique identification of ITSM connection among multiple defined in above
     * workspace.
     */
    @JsonProperty(value = "connectionId", required = true)
    private String connectionId;

    /**
     * JSON blob for the configurations of the ITSM action.
     * CreateMultipleWorkItems option will be part of this blob as well.
     */
    @JsonProperty(value = "ticketConfiguration", required = true)
    private String ticketConfiguration;

    /**
     * Region in which workspace resides. Supported
     * values:'centralindia','japaneast','southeastasia','australiasoutheast','uksouth','westcentralus','canadacentral','eastus','westeurope'.
     */
    @JsonProperty(value = "region", required = true)
    private String region;

    /**
     * Get the name of the Itsm receiver. Names must be unique across all receivers within an action group.
     *
     * @return the name value
     */
    public String name() {
        return this.name;
    }

    /**
     * Set the name of the Itsm receiver. Names must be unique across all receivers within an action group.
     *
     * @param name the name value to set
     * @return the ItsmReceiver object itself.
     */
    public ItsmReceiver withName(String name) {
        this.name = name;
        return this;
    }

    /**
     * Get oMS LA instance identifier.
     *
     * @return the workspaceId value
     */
    public String workspaceId() {
        return this.workspaceId;
    }

    /**
     * Set oMS LA instance identifier.
     *
     * @param workspaceId the workspaceId value to set
     * @return the ItsmReceiver object itself.
     */
    public ItsmReceiver withWorkspaceId(String workspaceId) {
        this.workspaceId = workspaceId;
        return this;
    }

    /**
     * Get unique identification of ITSM connection among multiple defined in above workspace.
     *
     * @return the connectionId value
     */
    public String connectionId() {
        return this.connectionId;
    }

    /**
     * Set unique identification of ITSM connection among multiple defined in above workspace.
     *
     * @param connectionId the connectionId value to set
     * @return the ItsmReceiver object itself.
     */
    public ItsmReceiver withConnectionId(String connectionId) {
        this.connectionId = connectionId;
        return this;
    }

    /**
     * Get jSON blob for the configurations of the ITSM action. CreateMultipleWorkItems option will be part of this blob as well.
     *
     * @return the ticketConfiguration value
     */
    public String ticketConfiguration() {
        return this.ticketConfiguration;
    }

    /**
     * Set jSON blob for the configurations of the ITSM action. CreateMultipleWorkItems option will be part of this blob as well.
     *
     * @param ticketConfiguration the ticketConfiguration value to set
     * @return the ItsmReceiver object itself.
     */
    public ItsmReceiver withTicketConfiguration(String ticketConfiguration) {
        this.ticketConfiguration = ticketConfiguration;
        return this;
    }

    /**
     * Get region in which workspace resides. Supported values:'centralindia','japaneast','southeastasia','australiasoutheast','uksouth','westcentralus','canadacentral','eastus','westeurope'.
     *
     * @return the region value
     */
    public String region() {
        return this.region;
    }

    /**
     * Set region in which workspace resides. Supported values:'centralindia','japaneast','southeastasia','australiasoutheast','uksouth','westcentralus','canadacentral','eastus','westeurope'.
     *
     * @param region the region value to set
     * @return the ItsmReceiver object itself.
     */
    public ItsmReceiver withRegion(String region) {
        this.region = region;
        return this;
    }

}


text:
@extends('templates.partials.main')

@section('container')

Categorias de convocatorias

            ID
            Nombre
            Categorias metrica

        @if(count($resultados) > 0 )
            @foreach($resultados as $resultado)

                    {{$resultado->id}}
                    {{$resultado->nombre}}

                     $resultado->id]) }}">Ver categorias de metrica

            @endforeach

            @else

No hay Categorias de convocatorias

        @endif

        $convocatoria_id]) }}" class="btn-floating btn-large red">
            add

@endsection


text:
var path    = require('path');
var config  = './' + path.join(process.env.NODE_ENV || 'development');

module.exports = require(config);


text:
    ng-drawing

      Web app that draws shapes on a page based on a user's commands

Commands available:

      clear 'colour':
      set the whole canvas to the given colour

      rectangle 'x' 'y' 'w' 'h' 'colour':
      draw an unfilled rectangle with a border of the given colour

      line 'x1' 'y1' 'x2' 'y2' 'colour':
      draw a line with the given colour

      fill 'x' 'y' 'colour':
      flood-fill starting at the given location


text:
dpkg --list \
  | awk '{ print $2 }' \
  | grep 'linux-headers' \
  | xargs apt-get -y purge;

# Remove specific Linux kernels, such as linux-image-3.11.0-15-generic but
# keeps the current kernel and does not touch the virtual packages,
# e.g. 'linux-image-generic', etc.
dpkg --list \
    | awk '{ print $2 }' \
    | grep 'linux-image-3.*-generic' \
    | grep -v `uname -r` \
    | xargs apt-get -y purge;

# Delete Linux source
dpkg --list \
    | awk '{ print $2 }' \
    | grep linux-source \
    | xargs apt-get -y purge;

# Delete development packages
dpkg --list \
    | awk '{ print $2 }' \
    | grep -- '-dev$' \
    | xargs apt-get -y purge;

# Delete obsolete networking
apt-get -y purge ppp pppconfig pppoeconf;

# Delete oddities
apt-get -y purge popularity-contest;

apt-get -y autoremove;
apt-get -y clean;

rm -f VBoxGuestAdditions_*.iso VBoxGuestAdditions_*.iso.?;


text:
package net

import (
	"syscall"
	"time"
)

// BUG(mikio): On every POSIX platform, reads from the "ip4" network
// using the ReadFrom or ReadFromIP method might not return a complete
// IPv4 packet, including its header, even if there is space
// available. This can occur even in cases where Read or ReadMsgIP
// could return a complete packet. For this reason, it is recommended
// that you do not uses these methods if it is important to receive a
// full packet.
//
// The Go 1 compatibility guidelines make it impossible for us to
// change the behavior of these methods; use Read or ReadMsgIP
// instead.

func sockaddrToIP(sa syscall.Sockaddr) Addr {
	switch sa := sa.(type) {
	case *syscall.SockaddrInet4:
		return &IPAddr{IP: sa.Addr[0:]}
	case *syscall.SockaddrInet6:
		return &IPAddr{IP: sa.Addr[0:], Zone: zoneToString(int(sa.ZoneId))}
	}
	return nil
}

func (a *IPAddr) family() int {
	if a == nil || len(a.IP) <= IPv4len {
		return syscall.AF_INET
	}
	if a.IP.To4() != nil {
		return syscall.AF_INET
	}
	return syscall.AF_INET6
}

func (a *IPAddr) sockaddr(family int) (syscall.Sockaddr, error) {
	if a == nil {
		return nil, nil
	}
	return ipToSockaddr(family, a.IP, 0, a.Zone)
}

// IPConn is the implementation of the Conn and PacketConn interfaces
// for IP network connections.
type IPConn struct {
	conn
}

func newIPConn(fd *netFD) *IPConn { return &IPConn{conn{fd}} }

// ReadFromIP reads an IP packet from c, copying the payload into b.
// It returns the number of bytes copied into b and the return address
// that was on the packet.
//
// ReadFromIP can be made to time out and return an error with
// Timeout() == true after a fixed time limit; see SetDeadline and
// SetReadDeadline.
func (c *IPConn) ReadFromIP(b []byte) (int, *IPAddr, error) {
	if !c.ok() {
		return 0, nil, syscall.EINVAL
	}
	// TODO(cw,rsc): consider using readv if we know the family
	// type to avoid the header trim/copy
	var addr *IPAddr
	n, sa, err := c.fd.readFrom(b)
	switch sa := sa.(type) {
	case *syscall.SockaddrInet4:
		addr = &IPAddr{IP: sa.Addr[0:]}
		n = stripIPv4Header(n, b)
	case *syscall.SockaddrInet6:
		addr = &IPAddr{IP: sa.Addr[0:], Zone: zoneToString(int(sa.ZoneId))}
	}
	if err != nil {
		err = &OpError{Op: "read", Net: c.fd.net, Source: c.fd.laddr, Addr: c.fd.raddr, Err: err}
	}
	return n, addr, err
}

func stripIPv4Header(n int, b []byte) int {
	if len(b) < 20 {
		return n
	}
	l := int(b[0]&0x0f) << 2
	if 20 > l || l > len(b) {
		return n
	}
	if b[0]>>4 != 4 {
		return n
	}
	copy(b, b[l:])
	return n - l
}

// ReadFrom implements the PacketConn ReadFrom method.
func (c *IPConn) ReadFrom(b []byte) (int, Addr, error) {
	if !c.ok() {
		return 0, nil, syscall.EINVAL
	}
	n, addr, err := c.ReadFromIP(b)
	if addr == nil {
		return n, nil, err
	}
	return n, addr, err
}

// ReadMsgIP reads a packet from c, copying the payload into b and the
// associated out-of-band data into oob.  It returns the number of
// bytes copied into b, the number of bytes copied into oob, the flags
// that were set on the packet and the source address of the packet.
func (c *IPConn) ReadMsgIP(b, oob []byte) (n, oobn, flags int, addr *IPAddr, err error) {
	if !c.ok() {
		return 0, 0, 0, nil, syscall.EINVAL
	}
	var sa syscall.Sockaddr
	n, oobn, flags, sa, err = c.fd.readMsg(b, oob)
	switch sa := sa.(type) {
	case *syscall.SockaddrInet4:
		addr = &IPAddr{IP: sa.Addr[0:]}
	case *syscall.SockaddrInet6:
		addr = &IPAddr{IP: sa.Addr[0:], Zone: zoneToString(int(sa.ZoneId))}
	}
	if err != nil {
		err = &OpError{Op: "read", Net: c.fd.net, Source: c.fd.laddr, Addr: c.fd.raddr, Err: err}
	}
	return
}

// WriteToIP writes an IP packet to addr via c, copying the payload
// from b.
//
// WriteToIP can be made to time out and return an error with
// Timeout() == true after a fixed time limit; see SetDeadline and
// SetWriteDeadline.  On packet-oriented connections, write timeouts
// are rare.
func (c *IPConn) WriteToIP(b []byte, addr *IPAddr) (int, error) {
	if !c.ok() {
		return 0, syscall.EINVAL
	}
	if c.fd.isConnected {
		return 0, &OpError{Op: "write", Net: c.fd.net, Source: c.fd.laddr, Addr: addr.opAddr(), Err: ErrWriteToConnected}
	}
	if addr == nil {
		return 0, &OpError{Op: "write", Net: c.fd.net, Source: c.fd.laddr, Addr: nil, Err: errMissingAddress}
	}
	sa, err := addr.sockaddr(c.fd.family)
	if err != nil {
		return 0, &OpError{Op: "write", Net: c.fd.net, Source: c.fd.laddr, Addr: addr.opAddr(), Err: err}
	}
	n, err := c.fd.writeTo(b, sa)
	if err != nil {
		err = &OpError{Op: "write", Net: c.fd.net, Source: c.fd.laddr, Addr: addr.opAddr(), Err: err}
	}
	return n, err
}

// WriteTo implements the PacketConn WriteTo method.
func (c *IPConn) WriteTo(b []byte, addr Addr) (int, error) {
	if !c.ok() {
		return 0, syscall.EINVAL
	}
	a, ok := addr.(*IPAddr)
	if !ok {
		return 0, &OpError{Op: "write", Net: c.fd.net, Source: c.fd.laddr, Addr: addr, Err: syscall.EINVAL}
	}
	return c.WriteToIP(b, a)
}

// WriteMsgIP writes a packet to addr via c, copying the payload from
// b and the associated out-of-band data from oob.  It returns the
// number of payload and out-of-band bytes written.
func (c *IPConn) WriteMsgIP(b, oob []byte, addr *IPAddr) (n, oobn int, err error) {
	if !c.ok() {
		return 0, 0, syscall.EINVAL
	}
	if c.fd.isConnected {
		return 0, 0, &OpError{Op: "write", Net: c.fd.net, Source: c.fd.laddr, Addr: addr.opAddr(), Err: ErrWriteToConnected}
	}
	if addr == nil {
		return 0, 0, &OpError{Op: "write", Net: c.fd.net, Source: c.fd.laddr, Addr: nil, Err: errMissingAddress}
	}
	var sa syscall.Sockaddr
	sa, err = addr.sockaddr(c.fd.family)
	if err != nil {
		return 0, 0, &OpError{Op: "write", Net: c.fd.net, Source: c.fd.laddr, Addr: addr.opAddr(), Err: err}
	}
	n, oobn, err = c.fd.writeMsg(b, oob, sa)
	if err != nil {
		err = &OpError{Op: "write", Net: c.fd.net, Source: c.fd.laddr, Addr: addr.opAddr(), Err: err}
	}
	return
}

// DialIP connects to the remote address raddr on the network protocol
// netProto, which must be "ip", "ip4", or "ip6" followed by a colon
// and a protocol number or name.
func DialIP(netProto string, laddr, raddr *IPAddr) (*IPConn, error) {
	return dialIP(netProto, laddr, raddr, noDeadline)
}

func dialIP(netProto string, laddr, raddr *IPAddr, deadline time.Time) (*IPConn, error) {
	net, proto, err := parseNetwork(netProto)
	if err != nil {
		return nil, &OpError{Op: "dial", Net: netProto, Source: laddr.opAddr(), Addr: raddr.opAddr(), Err: err}
	}
	switch net {
	case "ip", "ip4", "ip6":
	default:
		return nil, &OpError{Op: "dial", Net: netProto, Source: laddr.opAddr(), Addr: raddr.opAddr(), Err: UnknownNetworkError(netProto)}
	}
	if raddr == nil {
		return nil, &OpError{Op: "dial", Net: netProto, Source: laddr.opAddr(), Addr: nil, Err: errMissingAddress}
	}
	fd, err := internetSocket(net, laddr, raddr, deadline, syscall.SOCK_RAW, proto, "dial", noCancel)
	if err != nil {
		return nil, &OpError{Op: "dial", Net: netProto, Source: laddr.opAddr(), Addr: raddr.opAddr(), Err: err}
	}
	return newIPConn(fd), nil
}

// ListenIP listens for incoming IP packets addressed to the local
// address laddr.  The returned connection's ReadFrom and WriteTo
// methods can be used to receive and send IP packets with per-packet
// addressing.
func ListenIP(netProto string, laddr *IPAddr) (*IPConn, error) {
	net, proto, err := parseNetwork(netProto)
	if err != nil {
		return nil, &OpError{Op: "listen", Net: netProto, Source: nil, Addr: laddr.opAddr(), Err: err}
	}
	switch net {
	case "ip", "ip4", "ip6":
	default:
		return nil, &OpError{Op: "listen", Net: netProto, Source: nil, Addr: laddr.opAddr(), Err: UnknownNetworkError(netProto)}
	}
	fd, err := internetSocket(net, laddr, nil, noDeadline, syscall.SOCK_RAW, proto, "listen", noCancel)
	if err != nil {
		return nil, &OpError{Op: "listen", Net: netProto, Source: nil, Addr: laddr.opAddr(), Err: err}
	}
	return newIPConn(fd), nil
}


text:
JNIEXPORT void JNICALL Java_net_skoobe_crossgl_CrossGLView_setupCube
  (JNIEnv *env, jclass cls, jfloat width, jfloat height)
{
    gl_cube_setup(width, height);
}

JNIEXPORT void JNICALL Java_net_skoobe_crossgl_CrossGLView_drawCube
  (JNIEnv *env, jclass cls)
{
    gl_cube_draw();
}


text:
package garbagetown.app.managecustomer;

import org.joda.time.DateTime;
import org.junit.Before;
import org.junit.Test;
import org.springframework.validation.BindingResult;
import org.springframework.validation.DirectFieldBindingResult;
import org.springframework.validation.FieldError;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.junit.Assert.assertThat;

/**
 * Created by garbagetown on 12/7/15.
 */
public class CustomerFormValidatorTest {

    CustomerFormValidator customerFormValidator;
    CustomerForm customerForm;

    @Before
    public void setUp() {
        customerFormValidator = new CustomerFormValidator();
        customerForm = new CustomerForm();

        DateTime now = DateTime.now();
        customerForm.setCustomerBirthYear(now.getYear() - 20);
        customerForm.setCustomerBirthMonth(now.getMonthOfYear());
        customerForm.setCustomerBirthDay(now.getDayOfMonth());

        String password = "password";
        customerForm.setCustomerPass(password);
        customerForm.setCustomerPassConfirm(password);
    }

    @Test
    public void testValidate() {
        BindingResult result = new DirectFieldBindingResult(customerForm, "customerForm");

        customerFormValidator.validate(customerForm, result);

        assertThat(result.hasErrors(), is(false));
    }

    @Test
    public void testValidate_validLeapYear() {
        customerForm.setCustomerBirthYear(1996);
        customerForm.setCustomerBirthMonth(2);
        customerForm.setCustomerBirthDay(29);

        BindingResult result = new DirectFieldBindingResult(customerForm, "customerForm");

        customerFormValidator.validate(customerForm, result);

        assertThat(result.hasErrors(), is(false));
    }

    @Test
    public void testValidate_invalidDate() {
        customerForm.setCustomerBirthYear(1997);
        customerForm.setCustomerBirthMonth(2);
        customerForm.setCustomerBirthDay(29);

        BindingResult result = new DirectFieldBindingResult(customerForm, "customerForm");

        customerFormValidator.validate(customerForm, result);

        assertThat(result.hasErrors(), is(true));

        FieldError error = result.getFieldError("customerBirthYear");
        assertThat(error, is(notNullValue()));
        assertThat(error.getCode(), is("IncorrectDate.customerBirth"));
        assertThat(error.getDefaultMessage(), is("Incorrect date was entered."));
    }

    @Test
    public void testValidate_invalidPasswordConfirm() {
        customerForm.setCustomerPassConfirm("invalidPassword");

        BindingResult result = new DirectFieldBindingResult(customerForm, "customerForm");

        customerFormValidator.validate(customerForm, result);

        assertThat(result.hasErrors(), is(true));

        assertCustomerPassError(result.getFieldError("customerPass"));
    }

    private void assertCustomerPassError(FieldError error) {
        assertThat(error, is(notNullValue()));
        assertThat(error.getCode(), is("NotEquals.customerPass"));
        assertThat(error.getDefaultMessage(), is("customerPass and CustomerPassConfirm are not same."));

    }

    @Test
    public void testValidate_nullPassword() {
        customerForm.setCustomerPass(null);

        BindingResult result = new DirectFieldBindingResult(customerForm, "customerForm");

        customerFormValidator.validate(customerForm, result);

        assertThat(result.hasErrors(), is(true));

        assertCustomerPassError(result.getFieldError("customerPass"));
    }

    @Test
    public void testValidate_nullPasswordConfirm() {
        customerForm.setCustomerPassConfirm(null);

        BindingResult result = new DirectFieldBindingResult(customerForm, "customerForm");

        customerFormValidator.validate(customerForm, result);

        assertThat(result.hasErrors(), is(true));

        assertCustomerPassError(result.getFieldError("customerPass"));
    }
}


text:
package com.google.api.ads.dfp.jaxws.v201505;

import java.util.List;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.ws.RequestWrapper;
import javax.xml.ws.ResponseWrapper;

/**
 *
 *       Provides operations for creating, updating and retrieving {@link AudienceSegment} objects.
 *
 *
 * This class was generated by the JAX-WS RI.
 * JAX-WS RI 2.2.9-b130926.1035
 * Generated source version: 2.1
 *
 */
@WebService(name = "AudienceSegmentServiceInterface", targetNamespace = "https://www.google.com/apis/ads/publisher/v201505")
@XmlSeeAlso({
    ObjectFactory.class
})
public interface AudienceSegmentServiceInterface {

    /**
     *
     *         Creates new {@link RuleBasedFirstPartyAudienceSegment} objects.
     *
     *         @param segments first-party audience segments to create
     *         @return created first-party audience segments
     *
     *
     * @param segments
     * @return
     *     returns java.util.List<com.google.api.ads.dfp.jaxws.v201505.FirstPartyAudienceSegment>
     * @throws ApiException_Exception
     */
    @WebMethod
    @WebResult(name = "rval", targetNamespace = "https://www.google.com/apis/ads/publisher/v201505")
    @RequestWrapper(localName = "createAudienceSegments", targetNamespace = "https://www.google.com/apis/ads/publisher/v201505", className = "com.google.api.ads.dfp.jaxws.v201505.AudienceSegmentServiceInterfacecreateAudienceSegments")
    @ResponseWrapper(localName = "createAudienceSegmentsResponse", targetNamespace = "https://www.google.com/apis/ads/publisher/v201505", className = "com.google.api.ads.dfp.jaxws.v201505.AudienceSegmentServiceInterfacecreateAudienceSegmentsResponse")
    public List<FirstPartyAudienceSegment> createAudienceSegments(
        @WebParam(name = "segments", targetNamespace = "https://www.google.com/apis/ads/publisher/v201505")
        List<FirstPartyAudienceSegment> segments)
        throws ApiException_Exception
    ;

    /**
     *
     *         Gets an {@link AudienceSegmentPage} of {@link AudienceSegment} objects that satisfy the given
     *         {@link Statement#query}. The following fields are supported for filtering:
     *
     *

     *

     *         PQL Property
     *         Object Property
     *

     *

     *         {@code id}
     *         {@link AudienceSegment#id}
     *

     *

     *         {@code name}
     *         {@link AudienceSegment#name}
     *

     *

     *         {@code status}
     *         {@link AudienceSegment#status}
     *

     *

     *         {@code type}
     *         {@link AudienceSegment#type}
     *

     *

     *         {@code size}
     *         {@link AudienceSegment#size}
     *

     *

     *         {@code dataProviderName}
     *         {@link AudienceSegmentDataProvider#name}
     *

     *

     *         {@code approvalStatus}
     *         {@link ThirdPartyAudienceSegment#approvalStatus}
     *

     *

     *         {@code cost}
     *         {@link ThirdPartyAudienceSegment#cost}
     *

     *

     *         {@code startDateTime}
     *         {@link ThirdPartyAudienceSegment#startDateTime}
     *

     *

     *         {@code endDateTime}
     *         {@link ThirdPartyAudienceSegment#endDateTime}
     *

     *

     *
     *         @param filterStatement a Publisher Query Language statement used to filter a set of audience
     *         segments
     *         @return the audience segments that match the given filter
     *
     *
     * @param filterStatement
     * @return
     *     returns com.google.api.ads.dfp.jaxws.v201505.AudienceSegmentPage
     * @throws ApiException_Exception
     */
    @WebMethod
    @WebResult(name = "rval", targetNamespace = "https://www.google.com/apis/ads/publisher/v201505")
    @RequestWrapper(localName = "getAudienceSegmentsByStatement", targetNamespace = "https://www.google.com/apis/ads/publisher/v201505", className = "com.google.api.ads.dfp.jaxws.v201505.AudienceSegmentServiceInterfacegetAudienceSegmentsByStatement")
    @ResponseWrapper(localName = "getAudienceSegmentsByStatementResponse", targetNamespace = "https://www.google.com/apis/ads/publisher/v201505", className = "com.google.api.ads.dfp.jaxws.v201505.AudienceSegmentServiceInterfacegetAudienceSegmentsByStatementResponse")
    public AudienceSegmentPage getAudienceSegmentsByStatement(
        @WebParam(name = "filterStatement", targetNamespace = "https://www.google.com/apis/ads/publisher/v201505")
        Statement filterStatement)
        throws ApiException_Exception
    ;

    /**
     *
     *         Performs the given {@link AudienceSegmentAction} on the set of segments identified by the given
     *         statement.
     *
     *         @param action {@link AudienceSegmentAction} to perform
     *         @param filterStatement a Publisher Query Language statement used to filter a set of audience
     *         segments
     *         @return {@link UpdateResult} indicating the result
     *
     *
     * @param filterStatement
     * @param action
     * @return
     *     returns com.google.api.ads.dfp.jaxws.v201505.UpdateResult
     * @throws ApiException_Exception
     */
    @WebMethod
    @WebResult(name = "rval", targetNamespace = "https://www.google.com/apis/ads/publisher/v201505")
    @RequestWrapper(localName = "performAudienceSegmentAction", targetNamespace = "https://www.google.com/apis/ads/publisher/v201505", className = "com.google.api.ads.dfp.jaxws.v201505.AudienceSegmentServiceInterfaceperformAudienceSegmentAction")
    @ResponseWrapper(localName = "performAudienceSegmentActionResponse", targetNamespace = "https://www.google.com/apis/ads/publisher/v201505", className = "com.google.api.ads.dfp.jaxws.v201505.AudienceSegmentServiceInterfaceperformAudienceSegmentActionResponse")
    public UpdateResult performAudienceSegmentAction(
        @WebParam(name = "action", targetNamespace = "https://www.google.com/apis/ads/publisher/v201505")
        AudienceSegmentAction action,
        @WebParam(name = "filterStatement", targetNamespace = "https://www.google.com/apis/ads/publisher/v201505")
        Statement filterStatement)
        throws ApiException_Exception
    ;

    /**
     *
     *         Updates the given {@link RuleBasedFirstPartyAudienceSegment} objects.
     *
     *         @param segments first-party audience segments to update
     *         @return updated first-party audience segments
     *
     *
     * @param segments
     * @return
     *     returns java.util.List<com.google.api.ads.dfp.jaxws.v201505.FirstPartyAudienceSegment>
     * @throws ApiException_Exception
     */
    @WebMethod
    @WebResult(name = "rval", targetNamespace = "https://www.google.com/apis/ads/publisher/v201505")
    @RequestWrapper(localName = "updateAudienceSegments", targetNamespace = "https://www.google.com/apis/ads/publisher/v201505", className = "com.google.api.ads.dfp.jaxws.v201505.AudienceSegmentServiceInterfaceupdateAudienceSegments")
    @ResponseWrapper(localName = "updateAudienceSegmentsResponse", targetNamespace = "https://www.google.com/apis/ads/publisher/v201505", className = "com.google.api.ads.dfp.jaxws.v201505.AudienceSegmentServiceInterfaceupdateAudienceSegmentsResponse")
    public List<FirstPartyAudienceSegment> updateAudienceSegments(
        @WebParam(name = "segments", targetNamespace = "https://www.google.com/apis/ads/publisher/v201505")
        List<FirstPartyAudienceSegment> segments)
        throws ApiException_Exception
    ;

}


text:
import { ToDoListsController } from '../controllers/todo_lists.controller';
import { BaseRoutes } from './base.routes';

//
// ToDo Lists routes
//
const routes = new class TodoListsRoutes extends BaseRoutes {

  /**
   * Constructor
   */
  constructor() {
    const endpointName = '/todo-lists';

    /* istanbul ignore next */
    super(new ToDoListsController(), endpointName);
  }

  /**
   * Retrieve a ToDo list and all its ToDo's
   *
   * @return {object}
   */
  viewAll() {
    /* istanbul ignore next */
    const route = super.view();

    // Overwrite attributes
    route.path += '/todos';
    route.config.description = 'Retrieve a ToDo list and all its ToDo\'s';
    route.handler = this.controller.viewAll.bind(this.controller);

    return route;
  }

  /**
   * Create a new ToDo list
   *
   * @return {object}
   */
  create() {
    /* istanbul ignore next */
    const route = super.create();

    // Update end-point description (used in Documentation)
    route.config.description = 'Create a new ToDo list';

    // Add validations for POST payload
    route.config.validate.payload = {
      name: this.joi.string().required().description('ToDo list name')
    };

    return route;
  }

  /**
   * Update an existing ToDo list
   *
   * @return {object}
   */
  update() {
    /* istanbul ignore next */
    const route = super.update();

    // Update end-point description (used in Documentation)
    route.config.description = 'Update an existing ToDo list';

    // Add validations for POST payload
    route.config.validate.payload = {
      name: this.joi.string().description('ToDo list name')
    };

    return route;
  }
}();

//
// Export public end-points
//
export default [
  routes.index(),
  routes.view(),
  routes.viewAll(),
  routes.create(),
  routes.update(),
  routes.remove()
];


text:
import React from 'react';

class ContactPage extends React.Component {

  render() {
    return (

Contact Page

    );
  }

}

export default ContactPage;


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

	var Entries = Ember.ArrayProxy.extend({
		store: new app.Store( app.storeNamespace ),
		content: [],

		createNew: function( value ) {
			if ( !value.trim() )
				return;
			var todo = this.get( 'store' ).createFromTitle( value );
			this.pushObject( todo );
		},

		pushObject: function( item, ignoreStorage) {
			if ( !ignoreStorage )
				this.get( 'store' ).create( item );
			return this._super( item );
		},

		removeObject: function( item ) {
			this.get( 'store' ).remove( item );
			return this._super( item );
		},

		clearCompleted: function() {
			this.filterProperty(
				'completed', true
			).forEach( this.removeObject, this );
		},

		total: function() {
			return this.get( 'length' );
		}.property( '@each.length' ),

		remaining: function() {
			return this.filterProperty( 'completed', false ).get( 'length' );
		}.property( '@each.completed' ),

		completed: function() {
			return this.filterProperty( 'completed', true ).get( 'length' );
		}.property( '@each.completed' ),

		noneLeft: function() {
			return this.get( 'total' ) === 0;
		}.property( 'total' ),

		allAreDone: function( key, value ) {
			if ( value !== undefined ) {
				this.setEach( 'completed', value );
				return value;
			} else {
				return !!this.get( 'length' ) &&
					this.everyProperty( 'completed', true );
			}
		}.property( '@each.completed' ),

		init: function() {
			this._super();
			// Load items if any upon initialization
			var items = this.get( 'store' ).findAll();
			if ( items.get( 'length' ) ) {
				this.set( '[]', items );
			};
		}
	});

	app.EntriesController = Entries;
	app.entriesController = Entries.create();

})( window.Todos );


text:
package org.kaazing.k3po.driver.internal.types;

import static java.util.Collections.emptySet;

import java.util.LinkedHashSet;
import java.util.Set;

import org.kaazing.k3po.driver.internal.netty.channel.agrona.ChannelReader;
import org.kaazing.k3po.driver.internal.netty.channel.agrona.ChannelWriter;
import org.kaazing.k3po.lang.types.StructuredTypeInfo;
import org.kaazing.k3po.lang.types.TypeInfo;
import org.kaazing.k3po.lang.types.TypeSystemSpi;

public final class AgronaTypeSystem implements TypeSystemSpi
{
    private final Set<TypeInfo<?>> acceptOptions;
    private final Set<TypeInfo<?>> connectOptions;
    private final Set<TypeInfo<?>> readOptions;
    private final Set<TypeInfo<?>> writeOptions;
    private final Set<StructuredTypeInfo> readConfigs;
    private final Set<StructuredTypeInfo> writeConfigs;
    private final Set<StructuredTypeInfo> readAdvisories;
    private final Set<StructuredTypeInfo> writeAdvisories;

    public AgronaTypeSystem()
    {
        TypeInfo<?> readerType = new TypeInfo<>("reader", ChannelReader.class);
        TypeInfo<?> writerType = new TypeInfo<>("writer", ChannelWriter.class);

        Set<TypeInfo<?>> acceptOptions = new LinkedHashSet<>();
        acceptOptions.add(readerType);
        acceptOptions.add(writerType);
        this.acceptOptions = acceptOptions;

        Set<TypeInfo<?>> connectOptions = new LinkedHashSet<>();
        connectOptions.add(readerType);
        connectOptions.add(writerType);
        this.connectOptions = connectOptions;

        this.readOptions = emptySet();
        this.writeOptions = emptySet();
        this.readConfigs = emptySet();
        this.writeConfigs = emptySet();
        this.readAdvisories = emptySet();
        this.writeAdvisories = emptySet();
    }

    @Override
    public String getName()
    {
        return "agrona";
    }

    @Override
    public Set<TypeInfo<?>> acceptOptions()
    {
        return acceptOptions;
    }

    @Override
    public Set<TypeInfo<?>> connectOptions()
    {
        return connectOptions;
    }

    @Override
    public Set<TypeInfo<?>> readOptions()
    {
        return readOptions;
    }

    @Override
    public Set<TypeInfo<?>> writeOptions()
    {
        return writeOptions;
    }

    @Override
    public Set<StructuredTypeInfo> readConfigs()
    {
        return readConfigs;
    }

    @Override
    public Set<StructuredTypeInfo> writeConfigs()
    {
        return writeConfigs;
    }

    @Override
    public Set<StructuredTypeInfo> readAdvisories()
    {
        return readAdvisories;
    }

    @Override
    public Set<StructuredTypeInfo> writeAdvisories()
    {
        return writeAdvisories;
    }
}


text:
package com.sun.java.swing.action;

import javax.swing.KeyStroke;

// Referenced classes of package com.sun.java.swing.action:
//            DelegateAction, ActionManager

public class CancelAction extends DelegateAction
{

    public CancelAction()
    {
        this(VALUE_SMALL_ICON);
    }

    public CancelAction(String iconPath)
    {
        super("Cancel", ActionManager.getIcon(iconPath));
        putValue("ActionCommandKey", "cancel-command");
        putValue("ShortDescription", "Cancels the action");
        putValue("LongDescription", "Cancels the action");
        putValue("MnemonicKey", VALUE_MNEMONIC);
        putValue("AcceleratorKey", VALUE_ACCELERATOR);
    }

    public static final String VALUE_COMMAND = "cancel-command";
    public static final String VALUE_NAME = "Cancel";
    public static final String VALUE_SMALL_ICON = null;
    public static final String VALUE_LARGE_ICON = null;
    public static final Integer VALUE_MNEMONIC = new Integer(67);
    public static final KeyStroke VALUE_ACCELERATOR = null;
    public static final String VALUE_SHORT_DESCRIPTION = "Cancels the action";
    public static final String VALUE_LONG_DESCRIPTION = "Cancels the action";

}


text:
angular.module('app')
    .filter('momentFromNow', function() {
        return function(input) {
            return moment(input).fromNow();
        };
    });