text:
package com.microsoft.azure.management.appservice.v2019_08_01.implementation;

import com.microsoft.azure.management.appservice.v2019_08_01.DeletedSite;
import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl;
import rx.Observable;

class DeletedSiteImpl extends IndexableRefreshableWrapperImpl<DeletedSite, DeletedSiteInner> implements DeletedSite {
    private final AppServiceManager manager;
    private String location;
    private String deletedSiteId;

    DeletedSiteImpl(DeletedSiteInner inner,  AppServiceManager manager) {
        super(null, inner);
        this.manager = manager;
        // set resource ancestor and positional variables
        this.location = IdParsingUtils.getValueFromIdByName(inner.id(), "locations");
        this.deletedSiteId = IdParsingUtils.getValueFromIdByName(inner.id(), "deletedSites");
    }

    @Override
    public AppServiceManager manager() {
        return this.manager;
    }

    @Override
    protected Observable<DeletedSiteInner> getInnerAsync() {
        DeletedWebAppsInner client = this.manager().inner().deletedWebApps();
        return client.getDeletedWebAppByLocationAsync(this.location, this.deletedSiteId);
    }

    @Override
    public Integer deletedSiteId() {
        return this.inner().deletedSiteId();
    }

    @Override
    public String deletedSiteKind() {
        return this.inner().deletedSiteKind();
    }

    @Override
    public String deletedSiteName() {
        return this.inner().deletedSiteName();
    }

    @Override
    public String deletedTimestamp() {
        return this.inner().deletedTimestamp();
    }

    @Override
    public String geoRegionName() {
        return this.inner().geoRegionName();
    }

    @Override
    public String id() {
        return this.inner().id();
    }

    @Override
    public String kind() {
        return this.inner().kind();
    }

    @Override
    public String name() {
        return this.inner().name();
    }

    @Override
    public String resourceGroup() {
        return this.inner().resourceGroup();
    }

    @Override
    public String slot() {
        return this.inner().slot();
    }

    @Override
    public String subscription() {
        return this.inner().subscription();
    }

    @Override
    public String type() {
        return this.inner().type();
    }

}


text:
var del     = require("del");
var bower	  = require("bower");
var gulp    = require("gulp");
var less    = require("gulp-less");
var rename  = require("gulp-rename");
var minify  = require("gulp-minify-css");

var paths = {
  lessSrc : "src/less/sugar.less",
  cssDest : "dist/css/",
  fontDest : "dist/fonts",
  bowerDir : "bower_components/"
};

gulp.task("default", ["build"]);

gulp.task("build", ["clean", "less", "fonts"]);

gulp.task("clean", function(cb) {
  del("dist", cb);
});

gulp.task("less", ["bower"], function() {
  return gulp.src(paths.lessSrc)
  .pipe(less())
  .pipe(rename("sugar.css"))
  .pipe(gulp.dest(paths.cssDest))
  .pipe(minify())
  .pipe(rename("sugar.min.css"))
  .pipe(gulp.dest(paths.cssDest));
});

gulp.task("fonts", ["bower"], function() {
  return gulp.src(paths.bowerDir + "font-awesome/fonts/*.*")
  .pipe(gulp.dest(paths.fontDest));
});

gulp.task("bower", function(cb) {
  bower.commands.install()
  .on("end", function() {
    cb();
  });
});

redpajama_set_name: RedPajamaGithub


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Mycologia 53(4): 354 (1962)

#### Original name
Stereum alliciens Berk. & Cooke

### Remarks
null


text:
// JavaScript Document
$(document).ready(function() {

	  $("#qtt").on('change', function() {
		$("#addToCart").attr("data-quantity",$(this).val());
	  });

	  $(".my-cart-btn").click(function(){
		var quantity = $(this).attr("data-quantity");
		var id = $(this).attr("data-id");
		var name = $(this).attr("data-name");
		var summary = $(this).attr("data-summary");
		var price = $(this).attr("data-price");
		var image = $(this).attr("data-image");

        $.post(__URL + '/shop/add',
        {
          id: id,
          name: name,
		  quantity: quantity,
		  price: price,
		  image: image,
		  summary: summary
        },
        function(data,status){
			//window.alert(data);
			if(data==1){
			window.location.href = __URL + '/shop/cart';
			}else{
			window.location.href = __URL;
			}
        });
      });

	  $(".my-wishlist-btn").click(function(){
		  	var quantity = $(this).attr("data-quantity");
			var id = $(this).attr("data-id");
			var name = $(this).attr("data-name");
			var summary = $(this).attr("data-summary");
			var price = $(this).attr("data-price");
			var image = $(this).attr("data-image");
			$.post(__URL + '/shop/wishlist',
			{
			  id: id,
			  name: name,
			  quantity: quantity,
			  price: price,
			  image: image,
			  summary: summary
			},
			function(data,status){
				window.alert(data);
				/*if(data==1){
				window.location.href = window.location.href;
				}else{
				window.location.href = __URL;
				}*/
			});
      });

	  $( 'input[class="updateCart"]' ).on( "change", function() {
		  //var products=[{id:$(this).attr('dataId'),quantity:$(this).val()}];
		  $.post(__URL + '/shop/updatecart',{id:$(this).attr('dataId'),name:$(this).attr('dataName'),price:$(this).attr('dataPrice'),image:$(this).attr('dataImg'),quantity:$(this).val()},
		  	function(data,status){
				if(data==1){
				window.location.href = __URL + '/shop/cart';
				}else{
				window.location.href = __URL;
				}
			}
		);
	  });

	  $('.removeCart' ).click(function(){
		  //window.alert("cadchdgc");
		  $.post(__URL + '/shop/removecart',{id:$(this).attr('rel-id')},
		  	function(data,status){
				if(data==1){
				window.location.href = __URL + '/shop/cart';
				}else{
				window.location.href = __URL;
				}
			}
		  );
	  });

	  $('.delOrderBtn' ).click(function(){
		 //window.alert("cadchdgc");
	     $.post(__URL + '/shop/deleteOrder',{id:$(this).attr('data-id')},
		  	function(data,status){
				if(data==1){
				window.location.href = window.location.href;
				}else{
				window.location.href = __URL;
				}
			}
		 );
	  });

	  $("#cityId").on('change', function() {
		  $("#districtId").find('option').not(':first').remove();
		  $.post(__URL + '/city/ccity',{id:$(this).val()},
		  	function(data,status){
				$("#districtId").append(data);
			}
		  );
	  });

      $("#owl-demo").owlCarousel({

	  autoPlay: 3000,
      navigation : false,
      slideSpeed : 300,
	  pagination : false,
      paginationSpeed : 400,
      singleItem : true

      });

	  $("#owl-slide").owlCarousel({
		autoPlay: 3000,
		items : 4,
		lazyLoad : true,
		navigation : true,
		pagination : false,
	  });

	var sync1 = $("#sync1");
  	var sync2 = $("#sync2");

  sync1.owlCarousel({
    singleItem : true,
    slideSpeed : 1000,
    navigation: true,
    pagination:false,
    afterAction : syncPosition,
    responsiveRefreshRate : 200,
  });

  sync2.owlCarousel({
    items : 5,
    itemsDesktop      : [1199,10],
    itemsDesktopSmall     : [979,10],
    itemsTablet       : [768,8],
    itemsMobile       : [479,4],
    pagination:false,
    responsiveRefreshRate : 100,
    afterInit : function(el){
      el.find(".owl-item").eq(0).addClass("synced");
    }
  });

  function syncPosition(el){
    var current = this.currentItem;
    $("#sync2")
      .find(".owl-item")
      .removeClass("synced")
      .eq(current)
      .addClass("synced")
    if($("#sync2").data("owlCarousel") !== undefined){
      center(current)
    }
  }

  $("#sync2").on("click", ".owl-item", function(e){
    e.preventDefault();
    var number = $(this).data("owlItem");
    sync1.trigger("owl.goTo",number);
  });

  function center(number){
    var sync2visible = sync2.data("owlCarousel").owl.visibleItems;
    var num = number;
    var found = false;
    for(var i in sync2visible){
      if(num === sync2visible[i]){
        var found = true;
      }
    }

    if(found===false){
      if(num>sync2visible[sync2visible.length-1]){
        sync2.trigger("owl.goTo", num - sync2visible.length+2)
      }else{
        if(num - 1 === -1){
          num = 0;
        }
        sync2.trigger("owl.goTo", num);
      }
    } else if(num === sync2visible[sync2visible.length-1]){
      sync2.trigger("owl.goTo", sync2visible[1])
    } else if(num === sync2visible[0]){
      sync2.trigger("owl.goTo", num-1)
    }

  }

  	/*var goToCartIcon = function($addTocartBtn){
      var $cartIcon = $(".my-cart-icon");
      var $image = $('<img width="30px" height="30px" src="' + $addTocartBtn.data("image") + '"/>').css({"position": "fixed", "z-index": "999"});
      $addTocartBtn.prepend($image);
      var position = $cartIcon.position();
      $image.animate({
        top: position.top,
        left: position.left
      }, 500 , "linear", function() {
        $image.remove();
      });
    }

    $('.my-cart-btn').myCart({
      classCartIcon: 'my-cart-icon',
      classCartBadge: 'my-cart-badge',
      classProductQuantity: 'my-product-quantity',
      classProductRemove: 'my-product-remove',
      classCheckoutCart: 'my-cart-checkout',
      affixCartIcon: true,
      showCheckoutModal: true,
      clickOnAddToCart: function($addTocart){
        goToCartIcon($addTocart);
      },
      clickOnCartIcon: function($cartIcon, products, totalPrice, totalQuantity) {
        console.log("cart icon clicked", $cartIcon, products, totalPrice, totalQuantity);
      },
      checkoutCart: function(products, totalPrice, totalQuantity) {
        console.log("checking out", products, totalPrice, totalQuantity);
      },
      getDiscountPrice: function(products, totalPrice, totalQuantity) {
        console.log("calculating discount", products, totalPrice, totalQuantity);
        return totalPrice * 1;
      }
    });*/

    });


text:
@interface ViewController : UIViewController

@property (strong, nonatomic) IBOutlet UILabel *label;

- (IBAction)clicked:(id)sender;

@end


text:
#ifndef _AUTH_HPP_
#define _AUTH_HPP_

#include "irods_error.hpp"
#include "irods_operation_wrapper.hpp"
#include "irods_auth_types.hpp"
#include "irods_auth_plugin_context.hpp"

namespace irods {

/// @brief Type of an operation for start / stop
    typedef error( *auth_maintenance_operation )( plugin_property_map& );

    /**
     * @brief Base class for auth plugins
     */
    class auth : public plugin_base {
        public:
            /// @brief Constructor
            auth(
                const std::string& _name, // instance name
                const std::string& _ctx   // context
            );

            /// @brief Copy ctor
            auth( const auth& _rhs );

            virtual ~auth();

            /// @brief Assignment operator
            auth& operator=( const auth& _rhs );

            /// @brief Load operations from the plugin - overrides plugin base
            virtual error delay_load( void* _handle );

            /// @brief get a property from the map if it exists.
            template< typename T >
            error get_property( const std::string& _key, T& _val ) {
                error ret = properties_.get< T >( _key, _val );
                return ASSERT_PASS( ret, "Failed to get property for auth plugin." );
            } // get_property

            /// @brief set a property in the map
            template< typename T >
            error set_property( const std::string& _key, const T& _val ) {
                error ret = properties_.set< T >( _key, _val );
                return ASSERT_PASS( ret, "Failed to set property in the auth plugin." );
            } // set_property

            /// @brief Interface to set the start function
            error set_start_operation( const std::string& _name );

            /// @brief Interface to set the stop function
            error set_stop_operation( const std::string& _name );

            /// @brief interface to call start / stop functions
            error start_operation( void ) {
                return ( *start_operation_ )( properties_ );
            }
            error stop_operation( void ) {
                return ( *stop_operation_ )( properties_ );
            }

            /// @brief default start operation
            static error default_start_operation( plugin_property_map& ) {
                return SUCCESS();
            }

            /// @brief default stop operation
            static error default_stop_operation( plugin_property_map& ) {
                return SUCCESS();
            }

            // =-=-=-=-=-=-=-
            /// @brief delegate the call to the operation in question to the operation wrapper, with 0 param
            error call(
                rsComm_t* _comm,
                const std::string& _op,
                irods::first_class_object_ptr _obj ) {
                auth_plugin_context ctx( _comm, properties_, _obj, "" );
                return operations_[ _op ].call( ctx );

            } // call -

            // =-=-=-=-=-=-=-
            /// @brief delegate the call to the operation in question to the operation wrapper, with 1 param
            template< typename T1 >
            error call(
                rsComm_t* _comm,
                const std::string& _op,
                irods::first_class_object_ptr _obj,
                T1 _t1 ) {
                auth_plugin_context ctx( _comm, properties_, _obj, "" );
                return operations_[ _op ].call< T1 >( ctx, _t1 );

            } // call - T1

            // =-=-=-=-=-=-=-
            /// @brief delegate the call to the operation in question to the operation wrapper, with 2 params
            template< typename T1, typename T2 >
            error call(
                rsComm_t* _comm,
                const std::string& _op,
                irods::first_class_object_ptr _obj,
                T1 _t1,
                T2 _t2 ) {
                auth_plugin_context ctx( _comm, properties_, _obj, "" );
                return operations_[ _op ].call< T1, T2 >( ctx, _t1, _t2 );

            } // call - T1, T2

            // =-=-=-=-=-=-=-
            /// @brief delegate the call to the operation in question to the operation wrapper, with 3 params
            template< typename T1, typename T2, typename T3 >
            error call(
                rsComm_t* _comm,
                const std::string& _op,
                irods::first_class_object_ptr _obj,
                T1 _t1,
                T2 _t2,
                T3 _t3 ) {
                auth_plugin_context ctx( _comm, properties_, _obj, "" );
                return operations_[ _op ].call< T1, T2, T3 >(
                           ctx, _t1, _t2, _t3 );

            } // call - T1, T2, T3

            // =-=-=-=-=-=-=-
            /// @brief delegate the call to the operation in question to the operation wrapper, with 4 params
            template< typename T1, typename T2, typename T3, typename T4 >
            error call(
                rsComm_t* _comm,
                const std::string& _op,
                irods::first_class_object_ptr _obj,
                T1 _t1,
                T2 _t2,
                T3 _t3,
                T4 _t4 ) {
                auth_plugin_context ctx( _comm, properties_, _obj, "" );
                return  operations_[ _op ].call< T1, T2, T3, T4 >(
                            ctx, _t1, _t2, _t3, _t4 );

            } // call - T1, T2, T3, T4

            // =-=-=-=-=-=-=-
            /// @brief delegate the call to the operation in question to the operation wrapper, with 5 params
            template< typename T1, typename T2, typename T3, typename T4, typename T5 >
            error call(
                rsComm_t* _comm,
                const std::string& _op,
                irods::first_class_object_ptr _obj,
                T1 _t1,
                T2 _t2,
                T3 _t3,
                T4 _t4,
                T5 _t5 ) {
                auth_plugin_context ctx( _comm, properties_, _obj, "" );
                return operations_[ _op ].call< T1, T2, T3, T4, T5 >(
                           ctx, _t1, _t2, _t3, _t4, _t5 );

            } // call - T1, T2, T3, T4, T5

            // =-=-=-=-=-=-=-
            /// @brief delegate the call to the operation in question to the operation wrapper, with 6 params
            template< typename T1, typename T2, typename T3, typename T4, typename T5, typename T6 >
            error call(
                rsComm_t* _comm,
                const std::string& _op,
                irods::first_class_object_ptr _obj,
                T1 _t1,
                T2 _t2,
                T3 _t3,
                T4 _t4,
                T5 _t5,
                T6 _t6 ) {
                auth_plugin_context ctx( _comm, properties_, _obj, "" );
                return operations_[ _op ].call< T1, T2, T3, T4, T5, T6 >(
                           ctx, _t1, _t2, _t3, _t4, _t5, _t6 );

            } // call - T1, T2, T3, T4, T5, T6

            // =-=-=-=-=-=-=-
            /// @brief delegate the call to the operation in question to the operation wrapper, with 7 params
            template< typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7 >
            error call(
                rsComm_t* _comm,
                const std::string& _op,
                irods::first_class_object_ptr _obj,
                T1 _t1,
                T2 _t2,
                T3 _t3,
                T4 _t4,
                T5 _t5,
                T6 _t6,
                T7 _t7 ) {
                auth_plugin_context ctx( _comm, properties_, _obj, "" );
                return operations_[ _op ].call< T1, T2, T3, T4, T5, T6, T7 >(
                           ctx, _t1, _t2, _t3, _t4, _t5, _t6, _t7 );

            } // call - T1, T2, T3, T4, T5, T6, T7

            // =-=-=-=-=-=-=-
            /// @brief delegate the call to the operation in question to the operation wrapper, with 8 params
            template< typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8 >
            error call(
                rsComm_t* _comm,
                const std::string& _op,
                irods::first_class_object_ptr _obj,
                T1 _t1,
                T2 _t2,
                T3 _t3,
                T4 _t4,
                T5 _t5,
                T6 _t6,
                T7 _t7,
                T8 _t8 ) {
                auth_plugin_context ctx( _comm, properties_, _obj, "" );
                return operations_[ _op ].call< T1, T2, T3, T4, T5, T6, T7, T8 >(
                           ctx, _t1, _t2, _t3, _t4, _t5, _t6, _t7, _t8 );

            } // call - T1, T2, T3, T4, T5, T6, T7, T8

        protected:

            // =-=-=-=-=-=-=-
            /// @brief Start / Stop functions - can be overwritten by plugin devs
            //         called when a plugin is loaded or unloaded for init / cleanup
            std::string start_opr_name_;
            auth_maintenance_operation start_operation_;

            std::string stop_opr_name_;
            auth_maintenance_operation stop_operation_;

            // =-=-=-=-=-=-=-
            /// @brief operations to be loaded from the plugin
            lookup_table< operation_wrapper > operations_;

    };

/// @brief Given the name of an auth , try to load the shared object
    error load_auth_plugin(
        auth_ptr&,              // plugin
        const std::string&,     // plugin name
        const std::string&,     // instance name
        const std::string& );   // context string

}; // namespace irods

#endif // _AUTH_HPP_


text:
using System.Reactive.Subjects;
using WampSharp.Core.Listener;
using WampSharp.Core.Serialization;

namespace WampSharp.V1.PubSub.Client
{
    /// <summary>
    /// An implementation of <see cref="IWampPubSubClientFactory{TMessage}"/>.
    /// </summary>
    /// <typeparam name="TMessage"></typeparam>
    public class WampPubSubClientFactory<TMessage> : IWampPubSubClientFactory<TMessage>
    {
        private readonly IWampServerProxyFactory<TMessage> mServerProxyFactory;
        private readonly IWampFormatter<TMessage> mFormatter;

        /// <summary>
        /// Creates a new instance of <see cref="WampPubSubClientFactory{TMessage}"/>.
        /// </summary>
        /// <param name="serverProxyFactory">The server proxy factory used to get callbacks.</param>
        /// <param name="formatter">The formatter used to serialize/deserialize messages.</param>
        public WampPubSubClientFactory(IWampServerProxyFactory<TMessage> serverProxyFactory,
                                       IWampFormatter<TMessage> formatter)
        {
            mFormatter = formatter;
            mServerProxyFactory = serverProxyFactory;
        }

        public ISubject<TEvent> GetSubject<TEvent>(string topicUri, IWampConnection<TMessage> connection)
        {
            return new WampPubSubSubject<TMessage, TEvent>(topicUri, mServerProxyFactory, connection, mFormatter);
        }
    }
}


text:
using UnityEngine;

public class HealthComponent
{

    private float _health = 1f;
    private float _regenRate;

    // The wait time needed, after a hit, before starting to regenerate health.
    private CountUpTimer _hitWaitTimer = null;

    public const float MAX_HEALTH = 1f;
    public const float MIN_HEALTH = 0f;

    public HealthComponent(float regenRate = 0.04f, float initialHealth = 1f)
    {
        _regenRate = regenRate;
        _hitWaitTimer = new CountUpTimer(1f);
        Health = initialHealth;

    }

    public void Update()
    {
        if (_health < MAX_HEALTH && !_hitWaitTimer.IsRunning()) {
            Health += _regenRate * Time.deltaTime;
        }
    }

    public float GetHealth()
    {
        return _health;
    }

    private float Health
    {
        get { return _health; }
        set
        {
            if (value > MAX_HEALTH)
                _health = MAX_HEALTH;

            else if (value < MIN_HEALTH)
                _health = MIN_HEALTH;

            else
                _health = value;
        }
    }

    public void DealDamage(float dmg)
    {
        Health -= dmg;
        _hitWaitTimer.Start();
    }

    /// <summary>
    /// Return the amount of health as a percent out of 100.
    /// </summary>
    /// <returns></returns>
    public int GetPercentage()
    {
        return (int)(_health * 100);
    }

    // Reset the values for the health component;
    public void ReInit(float regen, float initHealth)
    {
        Health = initHealth;
        _regenRate = regen;
    }
}


text:
package com.sdl.odata.parser.extra;

import com.sdl.odata.api.edm.model.ComplexType;
import com.sdl.odata.api.edm.model.Property;
import com.sdl.odata.api.edm.model.Type;
import com.sdl.odata.api.edm.model.TypeDefinition;
import com.sdl.odata.parser.ODataUriParser;
import com.sdl.odata.parser.ParserTestSuite;
import com.sdl.odata.test.model.Address;
import org.junit.Before;
import org.junit.Test;
import scala.Option;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

/**
 * Entity Data Model Helpers Test.
 *
 */
public class EntityDataModelHelpersTest extends ParserTestSuite {

    /**
     * The OData Demo Order.
     */
    public static final String ORDER = "ODataDemo.Order";

    private ODataUriParser parser;

    @Before
    public void setup() {
        parser = new ODataUriParser(model);
    }

    @Test
    public void testEntityHelpersMethods() {
        assertThat(parser.isEntityType(ORDER), is(true));
        assertThat(parser.isEntityType("Edm.Int64"), is(false));
    }

    @Test(expected = IllegalArgumentException.class)
    public void testIllegalArgumentEntityCheck() {
        assertThat(parser.isEntityType("AnyAnotherEntity"), is(true));
    }

    @Test
    public void testEntityDefinition() {
        Option<TypeDefinition> type = parser.getTypeDefinition(ORDER);
        assertFalse(type.isDefined());
    }

    @Test
    public void testKeyProperty() {
        assertThat(parser.isPrimitiveKeyPropertyOf(ORDER, "id"), is(true));
    }

    @Test
    public void testNavigationProperty() {
        Type type = model.getType(Address.class);
        ComplexType addressType = (ComplexType) type;
        Property streetProp = (Property) addressType.getStructuralProperty("Street");

        assertThat(parser.isEntityNavigationProperty(streetProp), is(false));
        assertThat(parser.isPrimitiveCollectionProperty(streetProp), is(false));
        assertThat(parser.isEntitySingleNavigationProperty(streetProp), is(false));
        assertThat(parser.isEntityCollectionNavigationProperty(streetProp), is(false));
    }

    @Test
    public void testActionDefinition() {
        assertTrue(parser.isAction("ODataDemoAction"));
        assertFalse(parser.isAction("wrongActionName"));
    }

    @Test
    public void testActionImportDefinition() {
        assertTrue(parser.isActionImport("ODataDemoActionImport"));
        assertFalse(parser.isActionImport("wrongActionImportName"));
    }

    @Test
    public void testFunctionDefinition() {
        assertTrue(parser.isFunction("ODataDemoFunction"));
        assertFalse(parser.isFunction("wrongFunctionName"));
    }

    @Test
    public void testFunctionImportDefinition() {
        assertTrue(parser.isFunctionImport("ODataDemoFunctionImport"));
        assertFalse(parser.isFunctionImport("wrongFunctionImportName"));
    }

    @Test
    public void testGetFunctionReturnType() {
        String result = parser.getFunctionReturnType("ODataDemoFunction").get();
        assertNotNull(result);
        assertEquals("Edm.String", result);
    }

    @Test
    public void testGetFunctionImportReturnType() {
        String result = parser.getFunctionImportReturnType("ODataDemoFunctionImport").get();
        assertNotNull(result);
        assertEquals("Edm.String", result);
    }
}


text:
'use strict';

module.exports = function(server, collection){
	var SharedModel = require('mongosync')(server, collection);
	var Moment = require('moment');
	var timeFormat = require('../../lib/time_format');

	var AuthTokenModel = SharedModel.extend({
		defaults: {
			user_id: '',
			expires: (new Moment()).format(timeFormat),
			sessionIP: ''
		}
	});

	return AuthTokenModel;
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingTop="4dip"
    android:paddingLeft="2dip"
    android:paddingBottom="4dip"
    android:contentDescription="Podcast show information"
>

   <ImageView android:layout_height="75dp" android:layout_width="75dp" android:id="@+id/thumbnailImage" android:src="@drawable/artwork_placeholder"></ImageView>

   <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
       android:orientation="vertical"
       android:layout_width="0dip"
       android:layout_weight="1"
       android:layout_height="match_parent"
       android:paddingLeft="4dip">

      <TextView
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/titleText"
        android:layout_width="match_parent"
        android:layout_height="0dip"
        android:layout_weight="1"
        android:singleLine="true"
        android:textSize="18sp"
        android:gravity="bottom"
        android:textColor="@color/title_color"
        android:paddingBottom="1dip">
      </TextView>

	   <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
	       android:orientation="horizontal"
	       android:layout_width="match_parent"
	       android:layout_height="0dip"
           android:layout_weight="1"
           android:layout_gravity="top"
           android:paddingTop="1dip"
           android:paddingRight="0dip">
	      <TextView
	        xmlns:android="http://schemas.android.com/apk/res/android"
	        android:id="@+id/episodeText"
	        android:layout_width="0dip"
	        android:layout_height="match_parent"
	        android:layout_weight="1"
	        android:gravity="left"
	        android:singleLine="true"
	        android:textSize="14sp"
	        android:textColor="@color/artist_color">
	      </TextView>
	      <TextView
	        xmlns:android="http://schemas.android.com/apk/res/android"
	        android:id="@+id/showDate"
	        android:layout_width="0dip"
	        android:layout_height="match_parent"
	        android:layout_weight="1"
	        android:gravity="right"
	        android:singleLine="true"
	        android:textSize="14sp"
	        android:paddingRight="3dip"
	        android:textColor="@color/artist_color">
	      </TextView>
	   </LinearLayout>
     </LinearLayout>
   <ImageView
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/showUnplayed"
     android:layout_height="60dip"
     android:layout_width="wrap_content"
     android:paddingLeft="3dip"
     android:paddingRight="0dip"
     android:src="@drawable/green_bar"
     android:layout_gravity="center_vertical|right">
   </ImageView>
</LinearLayout>


text:
"""Mirror the latest CAIDA routeview files into a cloud bucket."""

import os
import pathlib
from pprint import pprint
from typing import List
import urllib.request

from google.cloud import storage

import firehook_resources

CAIDA_ROUTEVIEW_DIR_URL = "http://data.caida.org/datasets/routing/routeviews-prefix2as/"
# This file contains only the last 30 routeview files created.
# To backfill beyond 30 days use bulk_download.py
CAIDA_CREATION_FILE = "pfx2as-creation.log"

def _get_latest_generated_routeview_files() -> List[str]:
  """Get a list of recently created files CAIDA routeview files on their server.

  Returns:
    A list of filename strings
    ex ["routeviews-rv2-20200720-1200.pfx2as.gz",
        "routeviews-rv2-20200719-1200.pfx2as.gz"]
  """
  url = CAIDA_ROUTEVIEW_DIR_URL + CAIDA_CREATION_FILE
  output = map(lambda line: line.decode('utf8').rstrip(),
               urllib.request.urlopen(url).readlines())

  files = []
  for line in output:
    if line[0] != "#":  # ignore comment lines
      # Line format:
      # 4492	1595262269	2020/07/routeviews-rv2-20200719-1200.pfx2as.gz
      # we only want the routeviews-rv2-20200719-1200.pfx2as.gz portion
      filename = pathlib.PurePosixPath(line.split()[2]).name
      files.append(filename)
  return files

class RouteviewMirror():
  """Syncer to look for any recent routeview files and mirror them in cloud."""

  def __init__(self, bucket: storage.bucket.Bucket,
               bucket_routeview_path: str) -> None:
    """Initialize a client for updating routeviews.

    Args:
      bucket: GCS bucket
      bucket_routeview_path: path to write routeview files in the bucket
    """
    self.caida_bucket = bucket
    self.bucket_routeview_path = bucket_routeview_path

  def _get_caida_files_in_bucket(self) -> List[str]:
    """Get a list of all caida files stored in our bucket.

    Returns:
      A list of filename strings
      ex ["routeviews-rv2-20200720-1200.pfx2as.gz",
          "routeviews-rv2-20200719-1200.pfx2as.gz"]
    """
    blobs = self.caida_bucket.list_blobs()
    filenames = [os.path.basename(blob.name) for blob in blobs]
    return filenames

  def _transfer_new_file(self, filename: str) -> None:
    """Transfer a routeview file into the cloud bucket.

    Args:
      filename: string of the format "routeviews-rv2-20200720-1200.pfx2as.gz"
    """
    year = filename[15:19]
    month = filename[19:21]

    url = CAIDA_ROUTEVIEW_DIR_URL + year + "/" + month + "/" + filename

    output_blob = self.caida_bucket.blob(
        os.path.join(self.bucket_routeview_path, filename))

    output = urllib.request.urlopen(url).read()
    output_blob.upload_from_string(output)

  def sync(self) -> None:
    """Look for new routeview files and transfer them into the cloud bucket."""
    latest_files = _get_latest_generated_routeview_files()
    existing_files = self._get_caida_files_in_bucket()
    new_files = list(set(latest_files) - set(existing_files))

    if not new_files:
      pprint("no new CAIDA files to transfer")

    for new_file in new_files:
      pprint(("transferring file: ", new_file))
      self._transfer_new_file(new_file)
      pprint(("transferred file: ", new_file))

def get_firehook_routeview_mirror() -> RouteviewMirror:
  """Factory function to get a RouteviewUpdater with our project values."""
  client = storage.Client()
  bucket = client.get_bucket(firehook_resources.CAIDA_BUCKET)

  return RouteviewMirror(bucket, firehook_resources.ROUTEVIEW_PATH)

if __name__ == "__main__":
  # Called manually when running a backfill.
  get_firehook_routeview_mirror().sync()


text:
<?php

use Symfony\Component\Routing\Exception\MethodNotAllowedException;
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
use Symfony\Component\Routing\RequestContext;

/**
 * appProdUrlMatcher
 *
 * This class has been auto-generated
 * by the Symfony Routing Component.
 */
class appProdUrlMatcher extends Symfony\Bundle\FrameworkBundle\Routing\RedirectableUrlMatcher
{
    /**
     * Constructor.
     */
    public function __construct(RequestContext $context)
    {
        $this->context = $context;
    }

    public function match($pathinfo)
    {
        $allow = array();
        $pathinfo = rawurldecode($pathinfo);
        $context = $this->context;
        $request = $this->request;

        if (0 === strpos($pathinfo, '/guild')) {
            // guild_home
            if (rtrim($pathinfo, '/') === '/guild') {
                if (substr($pathinfo, -1) !== '/') {
                    return $this->redirect($pathinfo.'/', 'guild_home');
                }

                return array (  '_controller' => 'Acme\\GuildBundle\\Controller\\PublicController::indexAction',  '_route' => 'guild_home',);
            }

            // guild_first_page
            if (preg_match('#^/guild/(?P<GuildId>[^/]++)/home$#s', $pathinfo, $matches)) {
                return $this->mergeDefaults(array_replace($matches, array('_route' => 'guild_first_page')), array (  '_controller' => 'Acme\\GuildBundle\\Controller\\PublicController::FirstPageAction',));
            }

            // guild_create
            if ($pathinfo === '/guild/creation') {
                return array (  '_controller' => 'Acme\\GuildBundle\\Controller\\PublicController::CreationAction',  '_route' => 'guild_create',);
            }

            // guild_membres
            if ($pathinfo === '/guild/membres') {
                return array (  '_controller' => 'Acme\\GuildBundle\\Controller\\PublicController::ShowMembresAction',  '_route' => 'guild_membres',);
            }

            // guild_planning
            if (preg_match('#^/guild/(?P<GuildId>[^/]++)/planning$#s', $pathinfo, $matches)) {
                return $this->mergeDefaults(array_replace($matches, array('_route' => 'guild_planning')), array (  '_controller' => 'Acme\\GuildBundle\\Controller\\PublicController::PlaningAction',));
            }

            // guild_new_event
            if (preg_match('#^/guild/(?P<GuildId>[^/]++)/newevent$#s', $pathinfo, $matches)) {
                return $this->mergeDefaults(array_replace($matches, array('_route' => 'guild_new_event')), array (  '_controller' => 'Acme\\GuildBundle\\Controller\\PublicController::AddEventAction',));
            }

            // guild_show_event
            if (preg_match('#^/guild/(?P<GuildId>[^/]++)/planning/(?P<EventId>[^/]++)$#s', $pathinfo, $matches)) {
                return $this->mergeDefaults(array_replace($matches, array('_route' => 'guild_show_event')), array (  '_controller' => 'Acme\\GuildBundle\\Controller\\PublicController::ShowEventAction',));
            }

            // guild_postuler
            if (preg_match('#^/guild/(?P<GuildId>[^/]++)/postuler/(?P<GuildName>[^/]++)$#s', $pathinfo, $matches)) {
                return $this->mergeDefaults(array_replace($matches, array('_route' => 'guild_postuler')), array (  '_controller' => 'Acme\\GuildBundle\\Controller\\PublicController::PostulerAction',));
            }

            // guild_show_allcandidatures
            if (preg_match('#^/guild/(?P<GuildId>[^/]++)/allcandidatures$#s', $pathinfo, $matches)) {
                return $this->mergeDefaults(array_replace($matches, array('_route' => 'guild_show_allcandidatures')), array (  '_controller' => 'Acme\\GuildBundle\\Controller\\PublicController::AllCandidaturesAction',));
            }

            // guild_show_candidatures
            if (preg_match('#^/guild/(?P<GuildId>[^/]++)/candidature/(?P<CandidatureId>[^/]++)$#s', $pathinfo, $matches)) {
                return $this->mergeDefaults(array_replace($matches, array('_route' => 'guild_show_candidatures')), array (  '_controller' => 'Acme\\GuildBundle\\Controller\\PublicController::ShowCandidatureAction',));
            }

        }

        // home
        if (rtrim($pathinfo, '/') === '') {
            if (substr($pathinfo, -1) !== '/') {
                return $this->redirect($pathinfo.'/', 'home');
            }

            return array (  '_controller' => 'Acme\\UserBundle\\Controller\\PublicController::indexAction',  '_route' => 'home',);
        }

        if (0 === strpos($pathinfo, '/log')) {
            if (0 === strpos($pathinfo, '/login')) {
                // fos_user_security_login
                if ($pathinfo === '/login') {
                    return array (  '_controller' => 'FOS\\UserBundle\\Controller\\SecurityController::loginAction',  '_route' => 'fos_user_security_login',);
                }

                // fos_user_security_check
                if ($pathinfo === '/login_check') {
                    if ($this->context->getMethod() != 'POST') {
                        $allow[] = 'POST';
                        goto not_fos_user_security_check;
                    }

                    return array (  '_controller' => 'FOS\\UserBundle\\Controller\\SecurityController::checkAction',  '_route' => 'fos_user_security_check',);
                }
                not_fos_user_security_check:

            }

            // fos_user_security_logout
            if ($pathinfo === '/logout') {
                return array (  '_controller' => 'FOS\\UserBundle\\Controller\\SecurityController::logoutAction',  '_route' => 'fos_user_security_logout',);
            }

        }

        if (0 === strpos($pathinfo, '/profile')) {
            // fos_user_profile_show
            if (rtrim($pathinfo, '/') === '/profile') {
                if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
                    $allow = array_merge($allow, array('GET', 'HEAD'));
                    goto not_fos_user_profile_show;
                }

                if (substr($pathinfo, -1) !== '/') {
                    return $this->redirect($pathinfo.'/', 'fos_user_profile_show');
                }

                return array (  '_controller' => 'FOS\\UserBundle\\Controller\\ProfileController::showAction',  '_route' => 'fos_user_profile_show',);
            }
            not_fos_user_profile_show:

            // fos_user_profile_edit
            if ($pathinfo === '/profile/edit') {
                return array (  '_controller' => 'FOS\\UserBundle\\Controller\\ProfileController::editAction',  '_route' => 'fos_user_profile_edit',);
            }

        }

        if (0 === strpos($pathinfo, '/re')) {
            if (0 === strpos($pathinfo, '/register')) {
                // fos_user_registration_register
                if (rtrim($pathinfo, '/') === '/register') {
                    if (substr($pathinfo, -1) !== '/') {
                        return $this->redirect($pathinfo.'/', 'fos_user_registration_register');
                    }

                    return array (  '_controller' => 'FOS\\UserBundle\\Controller\\RegistrationController::registerAction',  '_route' => 'fos_user_registration_register',);
                }

                if (0 === strpos($pathinfo, '/register/c')) {
                    // fos_user_registration_check_email
                    if ($pathinfo === '/register/check-email') {
                        if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
                            $allow = array_merge($allow, array('GET', 'HEAD'));
                            goto not_fos_user_registration_check_email;
                        }

                        return array (  '_controller' => 'FOS\\UserBundle\\Controller\\RegistrationController::checkEmailAction',  '_route' => 'fos_user_registration_check_email',);
                    }
                    not_fos_user_registration_check_email:

                    if (0 === strpos($pathinfo, '/register/confirm')) {
                        // fos_user_registration_confirm
                        if (preg_match('#^/register/confirm/(?P<token>[^/]++)$#s', $pathinfo, $matches)) {
                            if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
                                $allow = array_merge($allow, array('GET', 'HEAD'));
                                goto not_fos_user_registration_confirm;
                            }

                            return $this->mergeDefaults(array_replace($matches, array('_route' => 'fos_user_registration_confirm')), array (  '_controller' => 'FOS\\UserBundle\\Controller\\RegistrationController::confirmAction',));
                        }
                        not_fos_user_registration_confirm:

                        // fos_user_registration_confirmed
                        if ($pathinfo === '/register/confirmed') {
                            if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
                                $allow = array_merge($allow, array('GET', 'HEAD'));
                                goto not_fos_user_registration_confirmed;
                            }

                            return array (  '_controller' => 'FOS\\UserBundle\\Controller\\RegistrationController::confirmedAction',  '_route' => 'fos_user_registration_confirmed',);
                        }
                        not_fos_user_registration_confirmed:

                    }

                }

            }

            if (0 === strpos($pathinfo, '/resetting')) {
                // fos_user_resetting_request
                if ($pathinfo === '/resetting/request') {
                    if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
                        $allow = array_merge($allow, array('GET', 'HEAD'));
                        goto not_fos_user_resetting_request;
                    }

                    return array (  '_controller' => 'FOS\\UserBundle\\Controller\\ResettingController::requestAction',  '_route' => 'fos_user_resetting_request',);
                }
                not_fos_user_resetting_request:

                // fos_user_resetting_send_email
                if ($pathinfo === '/resetting/send-email') {
                    if ($this->context->getMethod() != 'POST') {
                        $allow[] = 'POST';
                        goto not_fos_user_resetting_send_email;
                    }

                    return array (  '_controller' => 'FOS\\UserBundle\\Controller\\ResettingController::sendEmailAction',  '_route' => 'fos_user_resetting_send_email',);
                }
                not_fos_user_resetting_send_email:

                // fos_user_resetting_check_email
                if ($pathinfo === '/resetting/check-email') {
                    if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
                        $allow = array_merge($allow, array('GET', 'HEAD'));
                        goto not_fos_user_resetting_check_email;
                    }

                    return array (  '_controller' => 'FOS\\UserBundle\\Controller\\ResettingController::checkEmailAction',  '_route' => 'fos_user_resetting_check_email',);
                }
                not_fos_user_resetting_check_email:

                // fos_user_resetting_reset
                if (0 === strpos($pathinfo, '/resetting/reset') && preg_match('#^/resetting/reset/(?P<token>[^/]++)$#s', $pathinfo, $matches)) {
                    if (!in_array($this->context->getMethod(), array('GET', 'POST', 'HEAD'))) {
                        $allow = array_merge($allow, array('GET', 'POST', 'HEAD'));
                        goto not_fos_user_resetting_reset;
                    }

                    return $this->mergeDefaults(array_replace($matches, array('_route' => 'fos_user_resetting_reset')), array (  '_controller' => 'FOS\\UserBundle\\Controller\\ResettingController::resetAction',));
                }
                not_fos_user_resetting_reset:

            }

        }

        // fos_user_change_password
        if ($pathinfo === '/profile/change-password') {
            if (!in_array($this->context->getMethod(), array('GET', 'POST', 'HEAD'))) {
                $allow = array_merge($allow, array('GET', 'POST', 'HEAD'));
                goto not_fos_user_change_password;
            }

            return array (  '_controller' => 'FOS\\UserBundle\\Controller\\ChangePasswordController::changePasswordAction',  '_route' => 'fos_user_change_password',);
        }
        not_fos_user_change_password:

        if (0 === strpos($pathinfo, '/log')) {
            // logout
            if ($pathinfo === '/logout') {
                return array('_route' => 'logout');
            }

            // login
            if ($pathinfo === '/login') {
                return array('_route' => 'login');
            }

        }

        // show_profile
        if ($pathinfo === '/mon-profile') {
            return array (  '_controller' => 'Acme\\UserBundle\\Controller\\PublicController::MonProfileAction',  '_route' => 'show_profile',);
        }

        throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();
    }
}


text:
/**
 *
 */
package com.hsjawanda.gaeobjectify.tests;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import com.google.common.base.Optional;
import com.hsjawanda.gaeobjectify.util.PositionalUriInfo;
import com.hsjawanda.gaeobjectify.util.PositionalUriParserV2;

/**
 * @author Harshdeep Jawanda <hsjawanda@gmail.com>
 *
 */
public class PositionalUriParserTests {

	private static final String specifier = "/photos/user/{userId}/{photoId}";

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void test() {
		fail("Not yet implemented");
	}

	@Test
	public void v2ExactParamTest() {
		PositionalUriParserV2 parser = PositionalUriParserV2.instance(specifier);
		Optional<PositionalUriInfo> info = parser.parse("/photoS/uSER/abc/def/", true);
		assertTrue(info.isPresent());
		assertEquals("abc", info.get().getParam("userId").orNull());
		assertEquals("def", info.get().getParam("photoId").orNull());
	}

	@Test
	public void v2NoParamTest() {
		PositionalUriParserV2 parser = PositionalUriParserV2.instance(specifier);
		Optional<PositionalUriInfo> info = parser.parse("/photoS/uSER/", true);
		assertTrue(info.isPresent());
		assertFalse(info.get().getParam("userId").isPresent());
		assertFalse(info.get().getParam("photoId").isPresent());
	}

	@Test
	public void v2OneMissingConstPartTest() {
		PositionalUriParserV2 parser = PositionalUriParserV2.instance(specifier);
		Optional<PositionalUriInfo> info = parser.parse("/photoS/uSE", true);
		assertFalse(info.isPresent());
		info = parser.parse("/photoS/", true);
		assertFalse(info.isPresent());
		info = parser.parse("/photo", true);
		assertFalse(info.isPresent());
	}

	@Test
	public void v2OneLessParamTest() {
		PositionalUriParserV2 parser = PositionalUriParserV2.instance(specifier);
		Optional<PositionalUriInfo> info = parser.parse("/photoS/uSER/abc/", true);
		assertTrue(info.isPresent());
		assertEquals("abc", info.get().getParam("userId").orNull());
		assertFalse(info.get().getParam("photoId").isPresent());
	}

	@Test
	public void v2ExtraParamTest() {
		PositionalUriParserV2 parser = PositionalUriParserV2.instance(specifier);
		Optional<PositionalUriInfo> info = parser.parse("/photoS/uSER/abc/def/ghi?uvw=xyz", true);
		assertTrue(info.isPresent());
		assertEquals("abc", info.get().getParam("userId").orNull());
		assertEquals("def", info.get().getParam("photoId").orNull());
	}

	@Test
	public void v2WithJsessionIdTest() {
		PositionalUriParserV2 parser = PositionalUriParserV2.instance(specifier);
		Optional<PositionalUriInfo> info = parser.parse("/photoS/uSER/abc/def;jSESSionid=ac", true);
		assertTrue(info.isPresent());
		assertEquals("abc", info.get().getParam("userId").orNull());
		assertEquals("def", info.get().getParam("photoId").orNull());
	}

}


text:
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="20dp"
    android:height="20dp"
    android:viewportWidth="20"
    android:viewportHeight="20"
    android:tint="?attr/colorControlNormal">
  <path
      android:fillColor="@android:color/white"
      android:pathData="M4.5,15.5V8H6V12.938L14.938,4L16,5.062L7.062,14H12V15.5Z"/>
</vector>


text:
select
	 ProductName
	,listprice
	,[DateKey]
	,[UnitsBalance]
from
	[dbo].[Product] prod inner join
	[dbo].[ProductInventory] inv ON prod.ProductKey = inv.ProductKey

-- Showing the JOIN statement works the same way

select
	 ProductName
	,listprice
	,[DateKey]
	,[UnitsBalance]
from
	[dbo].[Product] prod  join
	[dbo].[ProductInventory] inv ON prod.ProductKey = inv.ProductKey

-- Example code where I don't use an alias for my tables, it can make the query quite cumbersome when
-- using multiple joins and where you are introducing more complexity to the query

select
	 ProductName
	,listprice
	,[DateKey]
	,[UnitsBalance]
from
	[dbo].[Product]  join
	[dbo].[ProductInventory] ON [dbo].[Product].ProductKey = [dbo].[ProductInventory].ProductKey


text:
module GraphQL
  module StaticValidation
    module NoDefinitionsArePresent
      include GraphQL::StaticValidation::Error::ErrorHelper

      def initialize(*)
        super
        @schema_definition_nodes = []
      end

      def on_invalid_node(node, parent)
        @schema_definition_nodes << node
        nil
      end

      alias :on_directive_definition :on_invalid_node
      alias :on_schema_definition :on_invalid_node
      alias :on_scalar_type_definition :on_invalid_node
      alias :on_object_type_definition :on_invalid_node
      alias :on_input_object_type_definition :on_invalid_node
      alias :on_interface_type_definition :on_invalid_node
      alias :on_union_type_definition :on_invalid_node
      alias :on_enum_type_definition :on_invalid_node
      alias :on_schema_extension :on_invalid_node
      alias :on_scalar_type_extension :on_invalid_node
      alias :on_object_type_extension :on_invalid_node
      alias :on_input_object_type_extension :on_invalid_node
      alias :on_interface_type_extension :on_invalid_node
      alias :on_union_type_extension :on_invalid_node
      alias :on_enum_type_extension :on_invalid_node

      def on_document(node, parent)
        super
        if @schema_definition_nodes.any?
          add_error(GraphQL::StaticValidation::NoDefinitionsArePresentError.new(%|Query cannot contain schema definitions|, nodes: @schema_definition_nodes))
        end
      end
    end
  end
end


text:
package com.satanko.weballgrade.data.dao.impl.hibernate;

import com.satanko.weballgrade.data.dao.ClassDAO;
import com.satanko.weballgrade.data.model.Clazz;
import com.satanko.weballgrade.service.PreparedServerResponses;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.ws.rs.WebApplicationException;
import org.hibernate.SessionFactory;

/**
 * This class provides an implementation of the {@link ClassDAO}
 * interface using the Hibernate Framework to perform interactions with a single database table.
 *
 * @author Julian Tropper (julian.tropper@gmail.com)
 * ATTENTION: If not otherwise specified, the author(s) of the class is/are also responsible for all methods.
 *
 * @version 1.0
 */
public class HibernateClassDAO implements ClassDAO{

    /**
     * A field providing methods for interactions with the database via Hibernate

     * Additional Information ...jboss.org/wiki/SessionsAndTransactions
     *
     * @see AllGradeDBUtil
     */
    private SessionFactory sf = AllGradeDBUtil.getSessionFactory();

    /**
     * {@inheritDoc }
     */
    @Override
    public void updateAllClasses(ArrayList<String> classes) {
        try {
            sf.getCurrentSession().beginTransaction();
            for (int i = 0; i < classes.size(); i++) {
                sf.getCurrentSession().saveOrUpdate(new Clazz(classes.get(i)));
            }
            sf.getCurrentSession().getTransaction().commit();
        } catch (RuntimeException re) {
            sf.getCurrentSession().getTransaction().rollback();
            Logger.getLogger(HibernateStudentDAO.class.getName()).log(Level.SEVERE, re.getMessage());
            throw new WebApplicationException(PreparedServerResponses.ERROR_DATABASE);
        }
    }

    /**
     * {@inheritDoc }
     */
    @Override
    public List<Clazz> selectClassList() {
        try {
            sf.getCurrentSession().beginTransaction();

            List<Clazz> classList = sf.getCurrentSession()
                    .createSQLQuery("SELECT classToken FROM AG_Class")
                    .addEntity(Clazz.class)
                    .list();

            sf.getCurrentSession().getTransaction().commit();
            return classList;
        } catch (RuntimeException re) {
            sf.getCurrentSession().getTransaction().rollback();
            Logger.getLogger(HibernateStudentDAO.class.getName()).log(Level.SEVERE, re.getMessage());
            throw new WebApplicationException(PreparedServerResponses.ERROR_DATABASE);
        }
    }
}


text:
package events

import "time"

// PublishOptions contains all the options which can be provided when publishing an event
type PublishOptions struct {
	// Metadata contains any keys which can be used to query the data, for example a customer id
	Metadata map[string]string
	// Timestamp to set for the event, if the timestamp is a zero value, the current time will be used
	Timestamp time.Time
}

// PublishOption sets attributes on PublishOptions
type PublishOption func(o *PublishOptions)

// WithMetadata sets the Metadata field on PublishOptions
func WithMetadata(md map[string]string) PublishOption {
	return func(o *PublishOptions) {
		o.Metadata = md
	}
}

// WithTimestamp sets the timestamp field on PublishOptions
func WithTimestamp(t time.Time) PublishOption {
	return func(o *PublishOptions) {
		o.Timestamp = t
	}
}

// SubscribeOptions contains all the options which can be provided when subscribing to a topic
type SubscribeOptions struct {
	// Queue is the name of the subscribers queue, if two subscribers have the same queue the message
	// should only be published to one of them
	Queue string
	// StartAtTime is the time from which the messages should be consumed from. If not provided then
	// the messages will be consumed starting from the moment the Subscription starts.
	StartAtTime time.Time
	// AutoAck if true (default true), automatically acknowledges every message so it will not be redelivered.
	// If false specifies that each message need ts to be manually acknowledged by the subscriber.
	// If processing is successful the message should be ack'ed to remove the message from the stream.
	// If processing is unsuccessful the message should be nack'ed (negative acknowledgement) which will mean it will
	// remain on the stream to be processed again.
	AutoAck bool
	AckWait time.Duration
	// RetryLimit indicates number of times a message is retried
	RetryLimit int
	// CustomRetries indicates whether to use RetryLimit
	CustomRetries bool
}

// SubscribeOption sets attributes on SubscribeOptions
type SubscribeOption func(o *SubscribeOptions)

// WithQueue sets the Queue fielf on SubscribeOptions to the value provided
func WithQueue(q string) SubscribeOption {
	return func(o *SubscribeOptions) {
		o.Queue = q
	}
}

// WithStartAtTime sets the StartAtTime field on SubscribeOptions to the value provided
func WithStartAtTime(t time.Time) SubscribeOption {
	return func(o *SubscribeOptions) {
		o.StartAtTime = t
	}
}

// WithAutoAck sets the AutoAck field on SubscribeOptions and an ackWait duration after which if no ack is received
// the message is requeued in case auto ack is turned off
func WithAutoAck(ack bool, ackWait time.Duration) SubscribeOption {
	return func(o *SubscribeOptions) {
		o.AutoAck = ack
		o.AckWait = ackWait
	}
}

// WithRetryLimit sets the RetryLimit field on SubscribeOptions.
// Set to -1 for infinite retries (default)
func WithRetryLimit(retries int) SubscribeOption {
	return func(o *SubscribeOptions) {
		o.RetryLimit = retries
		o.CustomRetries = true
	}
}

func (s SubscribeOptions) GetRetryLimit() int {
	if !s.CustomRetries {
		return -1
	}
	return s.RetryLimit
}

// WriteOptions contains all the options which can be provided when writing an event to a store
type WriteOptions struct {
	// TTL is the duration the event should be recorded for, a zero value TTL indicates the event should
	// be stored indefinately
	TTL time.Duration
}

// WriteOption sets attributes on WriteOptions
type WriteOption func(o *WriteOptions)

// WithTTL sets the TTL attribute on WriteOptions
func WithTTL(d time.Duration) WriteOption {
	return func(o *WriteOptions) {
		o.TTL = d
	}
}

// ReadOptions contains all the options which can be provided when reading events from a store
type ReadOptions struct {
	// Limit the number of results to return
	Limit uint
	// Offset the results by this number, useful for paginated queries
	Offset uint
}

// ReadOption sets attributes on ReadOptions
type ReadOption func(o *ReadOptions)

// ReadLimit sets the limit attribute on ReadOptions
func ReadLimit(l uint) ReadOption {
	return func(o *ReadOptions) {
		o.Limit = 1
	}
}

// ReadOffset sets the offset attribute on ReadOptions
func ReadOffset(l uint) ReadOption {
	return func(o *ReadOptions) {
		o.Offset = 1
	}
}


text:
require File.dirname(__FILE__) + '/../../spec_helper'
require 'matrix'

describe "Matrix#minor with start_row, nrows, start_col, ncols" do

  before(:each) do
    @matrix = Matrix[ [1,2], [3,4], [5,6] ]
  end

  it "returns the given portion of the Matrix" do
    @matrix.minor(0,1,0,2).should == Matrix[ [1, 2] ]
    @matrix.minor(1,2,1,1).should == Matrix[ [4], [6] ]
  end

  it "returns an empty Matrix unless nrows and ncols are greater than 0" do
    @matrix.minor(0,0,0,0).should == Matrix[]
    @matrix.minor(1,0,1,0).should == Matrix[]
    @matrix.minor(1,0,1,1).should == Matrix[]
    @matrix.minor(1,1,1,0).should == Matrix[[]] # FIXME: Inconsistent
  end

  # This actually raises a NoMethodError: "(undefined method `call' for
  #  Matrix[]:Matrix)", but we don't spec for this as it is yet another
  #  bug in Matrix.
  it "raises for out-of-bounds arguments" do
    @matrix.minor(3,0,0,0).should raise_error
    @matrix.minor(0,0,0,9).should raise_error
    lambda{@matrix.minor(9,9,9,9)}.should raise_error
  end

end

describe "Matrix#minor with col_range, row_range" do

  before(:each) do
    @matrix = Matrix[ [1,2], [3,4], [5,6] ]
  end

  it "returns the given portion of the Matrix" do
    @matrix.minor(0..0,0..1).should == Matrix[ [1, 2] ]
    @matrix.minor(1..2,1..2).should == Matrix[ [4], [6] ]
    @matrix.minor(0...3,0...3).should == @matrix
  end

  it "returns an empty Matrix if col_range or row_range don't select any elements" do
    @matrix.minor(3..6,3..6).should == Matrix[]
  end

end


text:
//  See http://www.boost.org/libs/config for the most recent version.//
//  Revision $Id$
//

// Test file for macro BOOST_NO_CXX11_TRAILING_RESULT_TYPES
// This file should not compile, if it does then
// BOOST_NO_CXX11_TRAILING_RESULT_TYPES should not be defined.
// See file boost_no_cxx11_trailing_result_types.ipp for details

// Must not have BOOST_ASSERT_CONFIG set; it defeats
// the objective of this file:
#ifdef BOOST_ASSERT_CONFIG
#  undef BOOST_ASSERT_CONFIG
#endif

#include <boost/config.hpp>
#include "test.hpp"

#ifdef BOOST_NO_CXX11_TRAILING_RESULT_TYPES
#include "boost_no_cxx11_trailing_result_types.ipp"
#else
#error "this file should not compile"
#endif

int main( int, char *[] )
{
   return boost_no_cxx11_trailing_result_types::test();
}


text:
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.assertThat;

public class ChromeDriverExample {
    WebDriver driver;

    @Before
    public void setUp() throws Exception {
        System.setProperty("webdriver.chrome.driver",
                System.getProperty("user.dir") + "/../../vendor/chrome-driver-2.15/chromedriver_mac32");
        driver = new ChromeDriver();

//    Option 2
//    Start the chromedriver in your terminal
//    Connect to it via Selenium Remote, like so:
//        driver = new RemoteWebDriver(new URL("http://localhost:9515"), DesiredCapabilities.chrome());
    }

    @After
    public void tearDown() throws Exception {
        driver.quit();
    }

    @Test
    public void chromeDriverTest() {
        driver.get("http://the-internet.herokuapp.com/");
        assertThat(driver.getTitle(), is(equalTo("The Internet")));
    }

}


text:
param($installPath, $toolsPath, $package, $project)
function Add-AnalyzerReferences($folderPath)
{
    # Write-Host 'Folder '$folderPath
    if (Test-Path $folderPath)
    {
        foreach ($dllPath in Get-ChildItem -Path "$folderPath\*.dll" -Exclude *.resources.dll)
        {
            # Write-Host 'File '$dllPath.FullName
            $project.Object.AnalyzerReferences.Add($dllPath.FullName)
        }
    }
}

$analyzersPath = Join-Path (Split-Path -Path $toolsPath -Parent) "analyzers\dotnet"
Add-AnalyzerReferences($analyzersPath)

if($project.Type -eq "C#")
{
    $csAnalyzersPath = Join-Path $analyzersPath "cs"
    Add-AnalyzerReferences($csAnalyzersPath)
}
if($project.Type -eq "VB.NET")
{
    $vbAnalyzersPath = Join-Path $analyzersPath "vb"
    Add-AnalyzerReferences($vbAnalyzersPath)
}


text:
#pragma once

#ifndef _READCASM_H_
#define _READCASM_H_

#include "toonzproc.h"
#include "casm_node.h"

#undef TNZAPI
#undef TNZVAR
#ifdef TNZ_IS_CASMLIB
#define TNZAPI TNZ_EXPORT_API
#define TNZVAR TNZ_EXPORT_VAR
#else
#define TNZAPI TNZ_IMPORT_API
#define TNZVAR TNZ_IMPORT_VAR
#endif

TNZAPI int n_compute(CASM_NODE *node, int x1, int y1, int x2, int y2,
					 float dx, float dy,
					 RASTER *raster, CASM_TILE *out);

TNZAPI int n_compare(CASM_NODE *n1, CASM_NODE *n2);

TNZAPI void n_write(CASM_NODE *n, T_CHAN fp);

TNZAPI CASM_NODE *n_insert(CASM_NODE *node);

TNZAPI CASM_FRAME *readcasm(char *filename, int first_frame, int last_frame,
							int frame_step, int shrink,
							CASM_COMPUTE_FUNCTION **compute_functions,
							TBOOL is_central_affine, TBOOL is_tv_licence);

TNZAPI int readcasm_get_camera_size(int *lx, int *ly);

TNZAPI char *readcasm_get_sink_script(char ***argv);

TNZAPI int readcasm_get_audio_info(int *from_audio, int *to_audio, int *from_video,
								   char **audioname);

TNZAPI int readcasm_set_camera_size(int lx, int ly, int shrink);

TNZAPI int readcasm_get_field(void);

TNZAPI void readcasm_get_camera_dpi(double *camera_x_dpi, double *camera_y_dpi);

TNZAPI int readcasm_get_frames_n(void);

TNZAPI int is_binary_op(CASM_NODE *arg, CASM_NODE **arg2, CASM_NODE **arg3);

TNZAPI int is_special_binary_op(CASM_NODE *arg, CASM_NODE **arg2, CASM_NODE **arg3);

TNZAPI int is_unary_op(CASM_NODE *arg, CASM_NODE **arg2);

TNZAPI int is_n_ary_op(CASM_NODE *arg, int *num_args, CASM_NODE ***args);

TNZAPI int is_affine_op(CASM_NODE *n, CASM_NODE **arg);

TNZAPI int get_affine_args(CASM_NODE *n, AFFINE *aff, CASM_NODE **arg);

TNZAPI CASM_NODE *create_affine_op(AFFINE *aff, CASM_NODE *n);

TNZAPI int n_compare_ric(CASM_NODE *tree1, CASM_NODE *tree2);

TNZAPI void make_border(RASTER *raster);

TNZAPI void readcasm_create_new_frame(CASM_NODE *node, char *filename);

TNZAPI void readcasm_do_for_all_frames(void (*fun)(CASM_FRAME *f));

TNZAPI void readcasm_touch_frames(void);

TNZAPI int is_read_op(CASM_NODE *arg);

TNZAPI int is_backlit_op(CASM_NODE *arg, CASM_NODE **arg2, CASM_NODE **arg3);

TNZAPI int n_compare_ric(CASM_NODE *tree1, CASM_NODE *tree2);

TNZAPI void make_border(RASTER *raster);

TNZAPI void reset_camera_size(void);

TNZAPI CASM_NODE *go_to_leaf_node(CASM_NODE *node);

TNZAPI void apply_extcmap(CASM_NODE *node, char *cmapname);

TNZAPI int readcasm_frame(CASM_FRAME **frame);

TNZAPI void init_readcasm_functions(CASM_COMPUTE_FUNCTION **casm_functions,
									int pipeid, int shrink);

TNZAPI void init_readcasm_input_channel(void);

TNZAPI CASM_FRAME *get_tree_pointer(void);

TNZAPI void readcasm_set_msg_trace(void);
TNZAPI TBOOL readcasm_open_log_file(char *casmname, char *filename);
TNZAPI TBOOL readcasm_close_log_file(void);
TNZAPI void readcasm_set_frame(int frame_num);
TNZAPI int readcasm_get_frame(void);

TNZAPI void readcasm_get_render_tile(int *x1, int *y1, int *x2, int *y2);

TNZAPI int is_matte_op(CASM_NODE *n, CASM_NODE **arg_dn, CASM_NODE **arg_up);
TNZAPI int is_localblur_op(CASM_NODE *n, CASM_NODE **arg_dn, CASM_NODE **arg_up);
TNZAPI int is_localtransp_op(CASM_NODE *n, CASM_NODE **arg_dn, CASM_NODE **arg_up);
TNZAPI int is_ovr_op(CASM_NODE *n, CASM_NODE **arg_dn, CASM_NODE **arg_up);
TNZAPI int is_add_op(CASM_NODE *n, CASM_NODE **arg_dn, CASM_NODE **arg_up);
TNZAPI int is_warp_op(CASM_NODE *n, CASM_NODE **arg_dn, CASM_NODE **arg_up);
TNZAPI int is_colorcard_op(CASM_NODE *n);
TNZAPI int get_add_args(CASM_NODE *n, CASM_NODE **arg_dn, CASM_NODE **arg_up, float *value);
TNZAPI int there_is_colorcard(CASM_NODE *arg);
TNZAPI int there_is_standard_colorcard(CASM_NODE *arg);
TNZAPI int there_is_colorcard_with_ovr(CASM_NODE *arg);
TNZAPI TBOOL get_colorcard_rgbm(CASM_NODE *arg, LPIXEL *color);

TNZAPI enum CASM_RESAMPLE_TYPE get_resample_type(void);
TNZAPI void casm_set_resample_type(enum CASM_RESAMPLE_TYPE type);

TNZAPI void free_casmtree(CASM_NODE *n);
TNZAPI CASM_NODE *dup_casmtree(CASM_NODE *n);
TNZAPI CASM_NODE *make_subtree(CASM_NODE *n, int from_column, int to_column);
TNZAPI int split_tree(CASM_NODE *tree, CASM_NODE **lefttree, CASM_NODE **righttree,
					  int occurrence);
TNZAPI int writecasm(CASM_FRAME *frames_list, T_CHAN fp,
					 int start_frame, int write_header, TBOOL is_central_affine);
TNZAPI int get_level_list(CASM_NODE *tree, char ***levels);
TNZAPI CASM_NODE *change_leaf(CASM_NODE *tree, int occurrence,
							  char *newlevelname, char *newpalette,
							  int dx, int dy);
TNZAPI CASM_NODE *make_a_sandwich(CASM_NODE *bread_dn_tree,
								  char *newlevelname, char *newpalette, int dx, int dy,
								  CASM_NODE *bread_up_tree);

TNZAPI void write_raster(char *filename, RASTER *raster);
TNZAPI int read_raster(char *filename, RASTER *raster,
					   int shrink, int border, double *x_dpi, double *y_dpi);

/*
#undef  TNZAPI
#ifdef WIN32
#ifdef TNZ_IS_COMMONLIB
  #define TNZAPI TNZ_EXPORT_API
#else
  #define TNZAPI TNZ_IMPORT_API
#endif
#else
  #define TNZAPI extern
#endif
*/

TNZVAR int Is_casm;
TNZVAR int Always_scale_opt;

#endif


text:
<!doctype html>
<html>
  <head>
    <script src="../resources/js-test.js"></script>
    <script src="resources/compatibility.js"></script>
    <script src="resources/audio-testing.js"></script>
    <title>Test Negative AudioParam.exponentialRampToValueAtTime</title>
  </head>

  <body>
    <script>
      description("Test AudioParam.exponentialRampToValueAtTime() with Negative Values.");
      window.jsTestIsAsync = true;

      var sampleRate = 48000;

      var audit = Audit.createTaskRunner();

      audit.defineTask("both negative values", function (done) {
        var renderDuration = 0.125;

        // Create context with two channels.  Channel 0 contains the positive-valued exponential and
        // channel 1 contains the negative-valued exponential.  We'll compare the two channels to
        // verify that they're the same, as they should be.
        var context = new OfflineAudioContext(2, renderDuration * sampleRate, sampleRate);
        var source = context.createBufferSource();
        source.buffer = createConstantBuffer(context, 1, 1);
        source.loop = true;

        // Gain node gp is for the positive-valued exponential ramp, and gn is for the negative-valued
        // exponential ramp.
        var gp = context.createGain();
        var gn = context.createGain();
        var merger = context.createChannelMerger(2);

        source.connect(gp)
              .connect(merger, 0, 0);
        source.connect(gn)
              .connect(merger, 0, 1);
        merger.connect(context.destination);

        gp.gain.setValueAtTime(1, 0);
        gp.gain.exponentialRampToValueAtTime(2, renderDuration);

        gn.gain.setValueAtTime(-1, 0);
        gn.gain.exponentialRampToValueAtTime(-2, renderDuration);

        source.start();

        context.startRendering().then(function (resultBuffer) {
          // Verify that channels have the same values, except for the sign.
          var expected = resultBuffer.getChannelData(0);
          var actual = resultBuffer.getChannelData(1);
          var inverted = expected.map(sample => -sample);

          Should("Negative exponential ramp from -1 to -2", actual)
            .beEqualToArray(inverted);
        }).then(done);
      });

      audit.defineTask("negative-end", function (done) {
        // Positive start value and negative end value should just do nothing.
        var renderDuration = 0.125;
        var context = new OfflineAudioContext(1, renderDuration * sampleRate, sampleRate);
        var source = context.createBufferSource();
        source.buffer = createConstantBuffer(context, 1, 1);
        source.loop = true;

        // Gain node gp is for the positive-valued exponential ramp, and gn is for the negative-valued
        // exponential ramp.
        var g = context.createGain();

        g.gain.setValueAtTime(2, 0);
        g.gain.exponentialRampToValueAtTime(-1, renderDuration);

        source.connect(g)
              .connect(context.destination);

        source.start();

        context.startRendering().then(function (resultBuffer) {
          var actual = resultBuffer.getChannelData(0);

          Should("Exponential ramp from 2 to -1", actual)
            .beConstantValueOf(2);
        }).then(done);
      });

      audit.defineTask("positive-end", function (done) {
        // Positive start value and negative end value should just do nothing.
        var renderDuration = 0.125;
        var context = new OfflineAudioContext(1, renderDuration * sampleRate, sampleRate);
        var source = context.createBufferSource();
        source.buffer = createConstantBuffer(context, 1, 1);
        source.loop = true;

        var g = context.createGain();

        g.gain.setValueAtTime(-1, 0);
        g.gain.exponentialRampToValueAtTime(1, renderDuration);

        source.connect(g)
              .connect(context.destination);
        source.start();

        context.startRendering().then(function (resultBuffer) {
          var actual = resultBuffer.getChannelData(0);

          Should("Exponential ramp from -1 to 1", actual)
            .beConstantValueOf(-1);
        }).then(done);
      });

      audit.defineTask("propagate", function (done) {
        // Test propagation of ramp if the exponential ramp start and end values have opposite sign.
        var renderDuration = 0.125;
        var linearRampEnd = renderDuration / 4;
        var exponentialRampEnd = renderDuration / 2;

        var context = new OfflineAudioContext(1, renderDuration * sampleRate, sampleRate);
        var source = context.createBufferSource();
        source.buffer = createConstantBuffer(context, 1, 1);
        source.loop = true;

        var g = context.createGain();

        g.gain.setValueAtTime(2, 0);
        g.gain.linearRampToValueAtTime(-1, linearRampEnd);
        g.gain.exponentialRampToValueAtTime(1, exponentialRampEnd);

        source.connect(g)
              .connect(context.destination);
        source.start();

        context.startRendering().then(function (resultBuffer) {
          var actual = resultBuffer.getChannelData(0);

          // Since the start value of the exponential ramp is -1 and the end value is 1, the ramp
          // should just propagate -1 from the end of the linear ramp "forever".
          var endFrame = Math.ceil(linearRampEnd * sampleRate);
          Should("Exponential ramp from -1 to 1 after the end of the linear ramp",
             actual.slice(endFrame))
            .beConstantValueOf(-1);
        }).then(done);

      });

      audit.defineTask("finish", function (done) {
        finishJSTest();
        done();
      });

      audit.runTasks();
    </script>
  </body>
</html>


text:
<!DOCTYPE html>

  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

  <title>Homepage Example - Semantic</title>

  <link rel="stylesheet" type="text/css" href="../dist/semantic.css">
  <link rel="stylesheet" type="text/css" href="examples/homepage.css">

Cat University

              Menu

                Classes
                Cocktail Hours
                Community

              Courses

                Petting
                Feeding
                Mind Reading

            Library
            Community

            An Old Cat Can Learn New Tricks

At least he won't reach his highest potential unless you enroll him in Cat University's 2013 class.

Come to ICU 2013

Register Now

              Courses

Take your kitty to a cat-ducation course and learn how to treat her well.

                Learn

              Library

Dig through our cat library to found out amazing things you can do with your kitty.

                Research

              Community

Get feedback on your cat from a community of loving pet owners on our online bulletin board system.

                Share

            The Best Cat Articles

How to Win Your Cats Attention

Getting your cat to notice you is a large part of being a pet owner. Although I have a lot of patience for writing things about cats, perhaps this might be enough body copy to make this section of text look filled out.

This and other tips can be found in our newsletter, amazing right?

Read More

More articles

              How to win in a fight with a cat

Jan 20, 2023

              A Supposedly Fun Cat Toy I will Never Buy Again

Jan 1, 2023

              Much ado about yarn

Dec 20, 2022

Bi-Daily Newsletter

Sign up and get spammed with cats every day. We have no unsubscribe button!

                <input name="email" type="text" placeholder="name@email.com">

Sign up

				Projects

					  Jenny Hess

						Friends

						Jenny is a student studying Media Management at the New School.

					  Jenny Hess

						Friends

						Jenny is a student studying Media Management at the New School.

					  Jenny Hess

						Friends

						Jenny is a student studying Media Management at the New School.

					  Jenny Hess

						Friends

						Jenny is a student studying Media Management at the New School.

					  Jenny Hess

						Friends

						Jenny is a student studying Media Management at the New School.

					  Jenny Hess

						Friends

						Jenny is a student studying Media Management at the New School.

Contact Me

				<addr>
				  Unit 710, 35 Mariner Terrace

				  Toronto, ON

				</addr>

(647) 938-4094


text:
<?php
session_name("Project");
session_start();
require_once('dbconn.php');
if(!checkUserSession($_SESSION["user"]))
{
	header("Location:login.php");
}
if(checkProjectPermission("DELIVER") == false)
{

        header("Location:error.php");
}
$projid=$_GET["proj_id"];

$coned=getConnection();
$sqled="
select id,b.project_type,c.name customer,project_name,
concat(d.emp_firstname,' ',d.emp_lastname) pm,
ifnull(Budget,0) budget , ifnull(Excess_budget,0) excess_budget,
Contract_value,License_value,
tlr,base_product,
concat(e.emp_firstname,' ',e.emp_lastname) crt_by,
a.status, c.customer_id,report_type,b.project_type_id,project_manager_id,project_director_id,
Planned_start_date,Planned_End_date,Actual_Start_Date sdt,Actual_End_Date edt,
Objectives, Scope, success_factor, docurl
 from project_details a
inner join project_type b on a.project_type_id = b.project_type_id
inner join hr_mysql_live.ohrm_customer c on a.ohrm_customer_id= c.customer_id
inner join hr_mysql_live.hs_hr_employee d on a.project_manager_id= d.emp_number
inner join hr_mysql_live.hs_hr_employee e on a.Project_created_by= e.emp_number
where id = ".$projid ;
$resulted = mysqli_query($coned,$sqled) or debug($sqled."   failed

".mysql_error());
$rowed = mysqli_fetch_array($resulted);
if($rowed[status] != "ACTIVE"  )
        header("Location:error1.php");

?>

<? include 'header.php';
?>

Make Project Phase Delivered

<?
 if($rowed[tlr]=="GREEN")
                echo "<img src='images/green.jpg' alt='red' width='40' height='40'	";

        if($rowed[tlr]=="RED")
	echo "<img src='images/red.jpg' alt='red' width='40' height='40'	";

if($rowed[tlr]=="AMBER")
	echo "<img src='images/amber.jpg' alt='red' width='40' height='40'	";
$_GET['projid']=$projid;
include 'operproj.php';

?>

<form name="projectForm"  action="updateprojstatus.php" method="post" onsubmit="return formSubmit();" >

	Project Type :

 <?
include 'getprojtype.php'; ?>

        Base Product :

                        <?
include 'getprodtype.php'; ?>

	Report Period :

	<select id='rpttype' name='rpttype' value =''>
	<option value='Choose..' selected='selected'>Choose...</option>
	<option value='WEEKLY'>WEEKLY</option>
	<option value='FORTNIGHTLY'>FORTNIGHTLY</option>
<option value='MONTHLY'>MONTHLY</option>
<option value='QUARTERLY'>QUARTERLY</option>
</select>
<?
echo "<input name='proj_id' id='proj_id' type='hidden' value='$projid'>";
echo "<input name='byFld' id='byFld'  type='hidden' value='project_delivered_by'>";
echo "<input name='statuschg' id='statuschg'  type='hidden' value='DELIVERED'>";
echo "<input name='onFld' id='onFld'  type='hidden' value='project_delivered_on'>";
?>

<?
echo "";
echo "";
echo "";
echo "";

echo "";
echo "";

?>

		Customer :

                        <?
include 'getcustomer.php'; ?>

		Project :

		 <input type = "text" id='proj' name='proj' size='50'>

<?
echo "";
echo "";
echo "";
echo "";
?>

		Project Manager :

                        <?
$_GET['q']='pm';
include 'getemp.php'; ?>

		Project Director :

                        <?
$_GET['q']='pd';
include 'getemp.php'; ?>

<?
echo "";
echo "";
echo "";
echo "";
?>

Project Status :

<select id='statusx' name='statusx' value =''>
<option value='Choose..' selected='selected'>Choose...</option>
<option value='INITIATED'>INITIATED</option>
<option value='ACTIVE'>ACTIVE</option>
<option value='CLOSED'>CLOSED</option>
<option value='INITIATE CLOSURE'>INITIATE CLOSURE</option>
<option value='AUTHORISE CLOSURE'>AUTHORISE CLOSURE</option>
<option value='WARRANTY'>WARRANTY</option>
<option value='DELIVERED'>DELIVERED</option>
<option value='AUTHORISED'>AUTHORISED</option>
<option value='APPROVED'>APPROVED</option>
</select>

<?
echo "";
echo "";
?>

Planned Start date :
 <input type = "date" id="PlannedStartDate" name="PlannedStartDate">
Planned End Date :
 <input type = "date" id="PlannedEndDate" name="PlannedEndDate">

<?
echo "";
echo "";
echo "";
echo "";
?>

Actual Start date :
 <input type = "date" id="ActualStartDate" name="ActualStartDate">
 Actual End Date :
 <input type = "date" id="ActualEndDate" name="ActualEndDate">

Financial Details (in INR)

Contract Value :
  <input type="text" name="ContractVal" id="ContractVal">

License Value :
  <input type="text" name="LicenseVal" id="LicenseVal">

<?
echo "";
echo "";
echo "";
echo "";

echo "";
echo "";
echo "";
echo "";

?>

Original Budget :
  <input type="text" id="BudgetVal" name="BudgetVal">

<?
echo "";
echo "";
echo "";
echo "";

?>

Project Details

Objectives :
<? echo "
  <textarea rows=5 cols=40 id='Objectives' name='Objectives' requried>$rowed[Objectives]</textarea>";
?>

Scope :
<? echo "  <textarea rows=5 cols=40 id='Scope' name='Scope' required>$rowed[Scope]</textarea>";?>

Success Factor :
<? echo "
  <textarea rows=5 cols=40 id='Success' name='Success' requried>$rowed[success_factor]</textarea>";?>

<?
echo "";
echo "";
echo "";
echo "";

echo "";
echo "";
echo "Links to Documentation and Estimation	";
?>

<input type="submit"  value="Set Delivered Phase">

</form>

<? closeConnection($coned); ?>


text:
package com.zg.model;

import com.zg.dto.UserDTO;
import com.zg.utils.StringUtils;

public class User {
    private int id;
    private String name;
    private int age;

    public static User fromUserDTO(UserDTO user) {
        return new User(user);
    }

    User(UserDTO user) {
        this.id = user.getId();
        this.name = user.getName();
        this.age = user.getAge();
    }

    public User() {
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

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

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return StringUtils.asStringPretty(this);
    }
}


text:
User.class_eval do

  devise :invitable, :confirmable, :database_authenticatable, :token_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable, :encryptable, :encryptor => "authlogic_sha512"

  # TODO: fix validation duplication of email
  validates_presence_of :phone, :state_id

  #validates_uniqueness_of :phone

  belongs_to :state
  has_one :profile

  has_many :comments
  has_many :deposit_payments

  delegate :fullname, :to => :profile, :allow_nil => true

  scope :daily_subscription, includes(:profile).where( "profiles.subscription" => Profile::SUBSCRIPTION_DAILY )

  accepts_nested_attributes_for :profile

  # Setup accessible (or protected) attributes for your model
  attr_accessible :email, :password, :password_confirmation, :remember_me, :persistence_token, :phone, :state_id, :phone_confirm_key, :phone_confirm

  before_create :set_phone_confirm_key
  after_create :create_user_profile

  def create_user_profile
    create_profile(:balance => 0, :user_id => self.id).save(:validate => false)
  end

  def phone_confirm!
    self.update_attributes(:phone_confirm_key => nil, :phone_confirm => true)
  end

  def phone_confirm?
    self.phone_confirm
  end

  # Генерация и сохранение нового пароля
  def generate_new_password
    new_password = ActiveSupport::SecureRandom.hex(4)
    self.reset_password!(new_password, new_password)
  end

  # Отправка нового кода подтверждения на мобильный
  def send_new_mobile_code
    cfg = YAML.load_file("config/sms_gateway.yml")
    gw = ActiveSmsgate::Gateway.gateway('qtelecom').new(:login => cfg["login"], :password => cfg["password"], :ssl=>cfg["ssl"])
    gw.deliver_sms(:phones=>self.phone, :message=>"#{I18n.t("sms.confirmation_text")} #{phone_confirm_key}")
    logger.info("Confirmation code send by email to number '#{self.phone}'")
  end

  # Список друзей
  # Список будет строится через инвайты
  #
  def friends
    self.class.where(:invited_by_id => self.id)
  end

  protected

  # Ключ подтверждения который будет выслан на мобильный
  def set_phone_confirm_key
    self.phone_confirm_key = rand(9999)
    send_new_mobile_code
  end

  def password_required?
    false
    #    !persisted? || password.present? || password_confirmation.present?
  end

end


text:
//
//  SeafGlobal.m
//  seafilePro
//
//  Created by Wang Wei on 11/9/14.
//  Copyright (c) 2014 Seafile. All rights reserved.
//
@import LocalAuthentication;

#import "SeafGlobal.h"
#import "SeafUploadFile.h"
#import "SeafAvatar.h"
#import "SeafDir.h"
#import "SeafRepos.h"
#import "Utils.h"
#import "Debug.h"
#import "SecurityUtilities.h"
#import "Version.h"
#import "SeafDbCacheProvider.h"
#import "SeafStorage.h"

/*
static NSError * NewNSErrorFromException(NSException * exc) {
    NSMutableDictionary * info = [NSMutableDictionary dictionary];
    [info setValue:exc.name forKey:@"SeafExceptionName"];
    [info setValue:exc.reason forKey:@"SeafExceptionReason"];
    [info setValue:exc.callStackReturnAddresses forKey:@"SeafExceptionCallStackReturnAddresses"];
    [info setValue:exc.callStackSymbols forKey:@"SeafExceptionCallStackSymbols"];
    [info setValue:exc.userInfo forKey:@"SeafExceptionUserInfo"];

    return [[NSError alloc] initWithDomain:@"seafile" code:-1 userInfo:info];
}
*/

@interface SeafGlobal()

@property NSTimer *autoSyncTimer;

@end

@implementation SeafGlobal

@synthesize cacheProvider = _cacheProvider;

-(id)init
{
    if (self = [super init]) {
        _conns = [[NSMutableArray alloc] init];
        _saveAlbumSem = dispatch_semaphore_create(1);
         NSURL *rootURL = [[[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:SEAFILE_SUITE_NAME] URLByAppendingPathComponent:@"seafile" isDirectory:true];
        [SeafStorage registerRootPath:rootURL.path metadataStorage:[[NSUserDefaults alloc] initWithSuiteName:SEAFILE_SUITE_NAME]];

        _cacheProvider = [[SeafDbCacheProvider alloc] init];
        [self checkSystemSettings];

        [SeafStorage.sharedObject setObject:SEAFILE_VERSION forKey:@"VERSION"];
        [[AFNetworkReachabilityManager sharedManager] startMonitoring];
        [SeafStorage.sharedObject removeObjectForKey:@"EXPORTED"];
        Debug("Cache root path=%@, clientVersion=%@",  SeafStorage.sharedObject.rootPath, SEAFILE_VERSION);
    }
    return self;
}

- (void)checkSystemSettings
{
    NSUserDefaults * standardUserDefaults = [NSUserDefaults standardUserDefaults];
    id obj = [standardUserDefaults objectForKey:@"allow_invalid_cert"];
    if (!obj) {
        [self registerDefaultsFromSettingsBundle];
    }
}

- (void)loadSystemSettings:(NSUserDefaults *)standardUserDefaults
{
    SeafStorage.sharedObject.allowInvalidCert = [standardUserDefaults boolForKey:@"allow_invalid_cert"];
}

- (void)defaultsChanged:(NSNotification *)notification
{
    NSUserDefaults *standardUserDefaults = (NSUserDefaults *)[notification object];
    [self loadSystemSettings:standardUserDefaults];
}

+ (SeafGlobal *)sharedObject
{
    static SeafGlobal *object = nil;
    if (!object) {
        object = [[SeafGlobal alloc] init];

    }
    return object;
}

- (NSString *)fileProviderStorageDir
{
    return [[[[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:SEAFILE_SUITE_NAME] path] stringByAppendingPathComponent:@"File Provider Storage"];
}

- (void)registerDefaultsFromSettingsBundle
{
    Debug("Registering default values from Settings.bundle");
    NSUserDefaults * defs = [NSUserDefaults standardUserDefaults];

    NSString *settingsBundle = [[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"Seafile" ofType:@"bundle"]] pathForResource:@"Settings" ofType:@"bundle"];
    if(!settingsBundle) {
        Debug("Could not find Settings.bundle");
        return;
    }

    NSDictionary *settings = [NSDictionary dictionaryWithContentsOfFile:[settingsBundle stringByAppendingPathComponent:@"Root.plist"]];
    NSArray *preferences = [settings objectForKey:@"PreferenceSpecifiers"];
    NSMutableDictionary *defaultsToRegister = [[NSMutableDictionary alloc] initWithCapacity:[preferences count]];

    for (NSDictionary *prefSpecification in preferences) {
        NSString *key = [prefSpecification objectForKey:@"Key"];
        if (key) {
            // check if value readable in userDefaults
            id currentObject = [defs objectForKey:key];
            if (currentObject == nil) {
                // not readable: set value from Settings.bundle
                id objectToSet = [prefSpecification objectForKey:@"DefaultValue"];
                [defaultsToRegister setObject:objectToSet forKey:key];
                Debug("Setting object %@ for key %@", objectToSet, key);
            } else {
                // already readable: don't touch
                Debug("Key %@ is readable (value: %@), nothing written to defaults.", key, currentObject);
            }
        }
    }

    [defs registerDefaults:defaultsToRegister];
}

- (void)migrateUserDefaults
{
    NSUserDefaults *oldDef = [NSUserDefaults standardUserDefaults];
    NSUserDefaults *newDef = [[NSUserDefaults alloc] initWithSuiteName:SEAFILE_SUITE_NAME];
    NSArray *accounts = [oldDef objectForKey:@"ACCOUNTS"];
    if (accounts && accounts.count > 0) {
        Debug("Start migrate: %@", accounts);
        for(NSString *key in oldDef.dictionaryRepresentation) {
            [newDef setObject:[oldDef objectForKey:key] forKey:key];
        }
        [newDef synchronize];
        [oldDef removeObjectForKey:@"ACCOUNTS"];
        [oldDef synchronize];
        Debug("accounts:%@\nnew:%@", oldDef.dictionaryRepresentation, newDef.dictionaryRepresentation);
    }
}
- (void)migrateDocuments
{
    NSURL *oldURL = [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject];
    NSURL *newURL = [[[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:SEAFILE_SUITE_NAME] URLByAppendingPathComponent:@"seafile" isDirectory:true];
    if ([Utils fileExistsAtPath:newURL.path])
        return;

    [Utils checkMakeDir:newURL.path];

    if (!newURL) return;

    NSFileManager* manager = [NSFileManager defaultManager];
    NSEnumerator *childFilesEnumerator = [[manager subpathsAtPath:oldURL.path] objectEnumerator];
    NSString* fileName;
    while ((fileName = [childFilesEnumerator nextObject]) != nil){
        NSError *error = nil;
        NSString* src = [oldURL.path stringByAppendingPathComponent:fileName];
        NSString* dest = [newURL.path stringByAppendingPathComponent:fileName];
        if ([Utils fileExistsAtPath:dest]) continue;
        [[NSFileManager defaultManager] moveItemAtPath:src toPath:dest error:&error];
        if (error) {
            Warning("migrate data error=%@", error);
        }
    }
}
- (void)migrate
{
    [self migrateUserDefaults];
    [self migrateDocuments];
}

- (BOOL)isCertInUse:(NSData *)clientIdentityKey
{
    for (SeafConnection *conn in self.conns) {
        if (conn.clientIdentityKey != nil && [clientIdentityKey isEqual:conn.clientIdentityKey])
            return true;
    }
    return false;
}

- (BOOL)saveAccounts
{
    NSMutableArray *accounts = [[NSMutableArray alloc] init];
    for (SeafConnection *connection in self.conns) {
        NSMutableDictionary *account = [[NSMutableDictionary alloc] init];
        [account setObject:connection.address forKey:@"url"];
        [account setObject:connection.username forKey:@"username"];
        [accounts addObject:account];
    }
    Debug("accounts:%@", accounts);
    [SeafStorage.sharedObject setObject:accounts forKey:@"ACCOUNTS"];
    return true;
};

- (void)loadAccounts
{
    NSUserDefaults * standardUserDefaults = [NSUserDefaults standardUserDefaults];
    NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
    [center addObserver:self
               selector:@selector(defaultsChanged:)
                   name:NSUserDefaultsDidChangeNotification
                 object:standardUserDefaults];
    [self loadSystemSettings:standardUserDefaults];
    Debug("allowInvalidCert=%d", SeafStorage.sharedObject.allowInvalidCert);

    NSMutableArray *connections = [[NSMutableArray alloc] init];
    NSArray *accounts = [SeafStorage.sharedObject objectForKey:@"ACCOUNTS"];
    for (NSDictionary *account in accounts) {
        NSString *url = [account objectForKey:@"url"];
        NSString *username = [account objectForKey:@"username"];
        [_cacheProvider migrateUploadedPhotos:url username:username account:[NSString stringWithFormat:@"%@/%@", url, username]];
        SeafConnection *conn = [[SeafConnection alloc] initWithUrl:url cacheProvider:_cacheProvider username:username];
        if (conn.username)
            [connections addObject:conn];
    }
    _conns = connections;
}

- (SeafConnection *)getConnection:(NSString *)url username:(NSString *)username
{
    SeafConnection *conn;
    if ([url hasSuffix:@"/"])
        url = [url substringToIndex:url.length-1];
    for (conn in self.conns) {
        if ([conn.address isEqual:url] && [conn.username isEqual:username])
            return conn;
    }
    return nil;
}

- (BOOL)saveConnection:(SeafConnection *)conn
{
    NSString *address = conn.address;
    if ([address hasSuffix:@"/"]) {
        address = [address substringToIndex:address.length-1];
    }
    BOOL existed = false;
    for (int i = 0; i < self.conns.count; ++i) {
        SeafConnection *c = self.conns[i];
        if ([c.address isEqual:address] && [conn.username isEqual:c.username]) {
            self.conns[i] = conn;
            existed = true;
            break;
        }
    }
    if (!existed) [self.conns addObject: conn];
    return [self saveAccounts];
}

- (BOOL)removeConnection:(SeafConnection *)conn
{
    [self.conns removeObject:conn];
    return [self saveAccounts];
}

- (NSArray *)publicAccounts {
    return self.conns;
}

- (void)tick:(NSTimer *)timer
{
#define UPDATE_INTERVAL 1800
    static double lastUpdate = 0;
    if (![[AFNetworkReachabilityManager sharedManager] isReachable]) {
        return;
    }
    @synchronized(timer) {
        double cur = [[NSDate date] timeIntervalSince1970];
        if (cur - lastUpdate > UPDATE_INTERVAL) {
            Debug("%fs has passed, refreshRepoPassowrds", cur - lastUpdate);
            lastUpdate = cur;
            for (SeafConnection *conn in self.conns) {
                [conn refreshRepoPasswords];
                [conn photosDidChange:nil];
            }
        }
    }
}

- (void)startTimer
{
    Debug("Start timer.");
    [self tick:nil];
    dispatch_async(dispatch_get_global_queue(0, 0), ^{
        self->_autoSyncTimer = [NSTimer scheduledTimerWithTimeInterval:15*30
                                                          target:self
                                                        selector:@selector(tick:)
                                                        userInfo:nil
                                                         repeats:YES];
        [[NSRunLoop currentRunLoop] addTimer:self->_autoSyncTimer forMode:NSRunLoopCommonModes];
        //use this method to ensure that the timer working
        [[NSRunLoop currentRunLoop] run];
    });
    [[AFNetworkReachabilityManager sharedManager] setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) {
        [self tick:self->_autoSyncTimer];
    }];
}

- (void)enterBackground
{

}
- (void)enterForeground
{
    [SeafGlobal.sharedObject loadSystemSettings:[NSUserDefaults standardUserDefaults]];
}

@end