text:
#include <_lua/lua.gadget.taskinfo.h>
#include <_lua/lua.func.h>
#include <_lua/lua.func.wrap.h>
using namespace _luafunc;

/*##################################
##          Lua-TaskInfo          ##
##################################*/

_lua_taskinfo::_lua_taskinfo( lua_State* L ) :
	_lua_gadget( new _taskInfo( check<_bitmap>( L , 1 ) , lightcheck<_style>( L , 2 ) ) )
{}

int _lua_taskinfo::displayNotification( lua_State* L )
{
	_taskInfo* tI = this->getGadget<_taskInfo>();

	if( is_a<_voidCallback>( L , 3 ) )
		tI->displayNotification( check<string>( L , 1 ) , check<string>( L , 2 ) , check<_voidCallback>( L , 3 ) , lightcheck<_bitmap>( L , 4 ) );
	else
		tI->displayNotification( check<string>( L , 1 ) , check<string>( L , 2 ) , lightcheck<_bitmap>( L , 3 ) );

	return 0;
}

//! Lua-taskInfo
const char _lua_taskinfo::className[] = "TaskInfo";
Lunar<_lua_taskinfo>::FunctionType _lua_taskinfo::methods[] = {
	{ "displayNotification" , &_lua_taskinfo::displayNotification },
	LUA_CLASS_FUNC_END
};

Lunar<_lua_taskinfo>::PropertyType _lua_taskinfo::properties[] = {
	{ "image" , wrap( _lua_taskinfo , &_taskInfo::getImage ) , wrap( _lua_taskinfo , &_taskInfo::setImage ) },
	LUA_CLASS_ATTR_END
};


text:
package org.axonframework.integrationtests.saga;

/**
 * @author Allard Buijze
 */
public class SagaAssociationChangingEvent {

    private final String currentAssociationValue;
    private final String newAssociationValue;

    /**
     * Initialize an application event with the given source. Source may be null. In that case, the source
     * type and source description will be set to Object.class and [unknown source]
     * respectively.
     */
    protected SagaAssociationChangingEvent(String currentAssociationValue, String newAssociationValue) {
        this.currentAssociationValue = currentAssociationValue;
        this.newAssociationValue = newAssociationValue;
    }

    public String getCurrentAssociation() {
        return currentAssociationValue;
    }

    public String getNewAssociation() {
        return newAssociationValue;
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Repair\registerBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Repair\StoreBundle\Entity\users;
use Repair\StoreBundle\Entity\affliates;

class confirmationController extends Controller
{
  public function confirmAction(Request $request)
    {
	$status=$_GET['activelinkactivated'];
	$name=$_GET['wecomename'];
	$role=$_GET['role'];
	if($role==0)
	{
		$em = $this->getDoctrine()->getManager();
		$repository = $em->getRepository('RepairStoreBundle:users');
		$res=$repository->activeuser($status,$name);
	}
	else
	{
		$em = $this->getDoctrine()->getManager();
		$repository = $em->getRepository('RepairStoreBundle:affliates');
		$res=$repository->activeaffliate($status,$name);
	}

	return $this->render('RepairLoginBundle:login:thank.html.php');

    }
}


text:
//
//  AddressBookViewController.m
//  AddressBook12
//
//  Created by scjy on 15/12/3.
//  Copyright (c) 2015年 赵佳慧iOS. All rights reserved.
//

#import "AddressBookViewController.h"
#import "AddressBookTableViewCell.h"
#import "AddressBookModel.h"
#import "ShowAddressViewController.h"
@interface AddressBookViewController ()
@property(nonatomic,retain) UITableView *tableView;
@property(nonatomic,retain) NSArray *sectionTitleArray;
@property(nonatomic,retain) NSMutableArray *allAddressArray;
@end

@implementation AddressBookViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.title = @"通讯录";
    [self.view addSubview:self.tableView];
//解析文件
    [self configTableData];

}
//lazy Loading 懒加载
-(UITableView *)tableView{
    if (_tableView == nil) {
        //不存在 创建一个
        self.tableView = [[UITableView alloc]initWithFrame:self.view.frame style:UITableViewStylePlain];
        self.tableView.backgroundColor = [UIColor colorWithRed:1.0 green:0.9 blue:0.8 alpha:1.0 ];
        self.tableView.separatorColor = [UIColor magentaColor];
//设置代理
        self.tableView.dataSource = self;
        self.tableView.delegate = self;
//添加背景图片
//        self.tableView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"3.jpg"]];
    }
    return _tableView;
}
//解析文件
- (void)configTableData{
//找到文件路径
    NSString *pth = [[NSBundle mainBundle]pathForResource:@"AddressBook" ofType:@".plist"];
//找到 转化成字典型的数据
    NSDictionary *dic = [NSDictionary dictionaryWithContentsOfFile:pth];
    self.sectionTitleArray = dic.allKeys;//分区标题数组
    self.allAddressArray = [NSMutableArray new];

    for (NSString *key in self.sectionTitleArray) {

         __block NSMutableArray *groupArray = [NSMutableArray new];
        NSArray *array = dic[key];
        for (NSDictionary *dic in array) {
            //定义小组 存放每组人员的model数据
            AddressBookModel *model = [[AddressBookModel alloc]init];
            [model getModelFromDictionary:dic abdModelBlock:^(AddressBookModel *addressModel) {
                [groupArray addObject:addressModel];

            }];
        }
        [self.allAddressArray addObject:groupArray];

    }
    //NSLog(@"%@",self.allAddressArray);

}
//行
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    NSMutableArray *group = self.allAddressArray[section];

    return group.count;
}
//分区
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return self.sectionTitleArray.count;
}
//cell
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    //创建重用标识符
    static NSString *addressIdentifier = @"addressCell";
//从重用队列取出cell
    AddressBookTableViewCell *addressCell = [tableView dequeueReusableCellWithIdentifier:addressIdentifier];
    if (addressCell == nil) {
        addressCell = [[AddressBookTableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:addressIdentifier];
    }
    //清除颜色
//    addressCell.backgroundColor = [UIColor clearColor];
    NSMutableArray *group = self.allAddressArray[indexPath.section];
    AddressBookModel *model = group[indexPath.row];//分区下数据model

    addressCell.model = model;

    return addressCell;
}

//标题
-(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section{
    return self.sectionTitleArray[section];
}

//自定义高度
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    AddressBookModel *model = self.allAddressArray[indexPath.section][indexPath.row];
    CGFloat height = [AddressBookTableViewCell getCellWithHeight:model];
    return height;
}

//点击显示详细信息
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    ShowAddressViewController *showVc = [[ShowAddressViewController alloc]init];
    NSMutableArray *group = self.allAddressArray[indexPath.section];
    showVc.model = group[indexPath.row];
//
//    showVc.showImageName = model.imageModel;
//    showVc.showName = model.nameModel;
//    showVc.showGender = model.genderModel;
//    showVc.showAge = model.ageGender;
//    showVc.showPhoneNum = model.phoneModel;
//    showVc.showHobby = model.hobbyModel;

    [self.navigationController pushViewController:showVc animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end


text:
from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend
from django.core.validators import ValidationError, validate_email
from django.utils.crypto import get_random_string

from useful.django.getters import get_object_or_none

UserModel = get_user_model()

def get_random_password(size=7, cadre='abcdehkmnprstuvxyz2345678923456789'):
    """
    Returns the password composed of the easily readable letters and digits
    by default (digits doubled to increase the occurrence).
    """
    return get_random_string(size, cadre)

def get_unique_username(username):
    """
    Returns the first available username with appended numbering
    (started from 2) that is not yet present in the UserModel table.
    """
    assert username
    base = username
    idx = 2
    while True:
        if not UserModel.objects.filter(username=username).exists():
            break
        username = '%s%d' % (base, idx)
        idx += 1
    return username

class EmailLoginModelBackend(ModelBackend):
    """
    Logs the user in using his/her e-mail (case insensitively by default).
    Set up by the following Django setting::

        AUTHENTICATION_BACKENDS = ('useful.django.auth.EmailLoginModelBackend',)

    """
    EMAIL_CASE_SENSITIVE = False

    def get_user_by_email(self, email):
        try:
            validate_email(email)
            if self.EMAIL_CASE_SENSITIVE:
                user = UserModel.objects.get(email__exact=email)
            else:
                user = UserModel.objects.get(email__iexact=email)
        except (UserModel.DoesNotExist, ValidationError):
            user = None

        return user

    def authenticate(self, request, username=None, password=None, **kwargs):
        user = self.get_user_by_email(username)
        return user if user and user.check_password(password) else None

class UsernameOrEmailLoginModelBackend(EmailLoginModelBackend):
    """
    Tries to identify the given login-name as username or email
    (both case-insensitive by default).
    Set up by the following Django setting::

        AUTHENTICATION_BACKENDS = ('useful.django.auth.UsernameOrEmailLoginModelBackend',)
    """
    USERNAME_CASE_SENSITIVE = False

    def authenticate(self, request, username=None, password=None, **kwargs):
        if self.USERNAME_CASE_SENSITIVE:
            user = get_object_or_none(UserModel, username__exact=username)
        else:
            user = get_object_or_none(UserModel, username__iexact=username)

        if user is None:
            user = self.get_user_by_email(username)

        return user if user and user.check_password(password) else None


text:
//
//  RACTuple.h
//  ReactiveCocoa
//
//  Created by Josh Abernathy on 4/12/12.
//  Copyright (c) 2012 GitHub, Inc. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "RACDeprecated.h"
#import "metamacros.h"

@class RACSequence;
@class RACSignal;

/// Creates a new tuple with the given values. At least one value must be given.
/// Values can be nil.
#define RACTuplePack(...) \
    RACTuplePack_(__VA_ARGS__)

/// Declares new object variables and unpacks a RACTuple into them.
///
/// This macro should be used on the left side of an assignment, with the
/// tuple on the right side. Nothing else should appear on the same line, and the
/// macro should not be the only statement in a conditional or loop body.
///
/// If the tuple has more values than there are variables listed, the excess
/// values are ignored.
///
/// If the tuple has fewer values than there are variables listed, the excess
/// variables are initialized to nil.
///
/// Examples
///
///   RACTupleUnpack(NSString *string, NSNumber *num) = [RACTuple tupleWithObjects:@"foo", @5, nil];
///   NSLog(@"string: %@", string);
///   NSLog(@"num: %@", num);
///
///   /* The above is equivalent to: */
///   RACTuple *t = [RACTuple tupleWithObjects:@"foo", @5, nil];
///   NSString *string = t[0];
///   NSNumber *num = t[1];
///   NSLog(@"string: %@", string);
///   NSLog(@"num: %@", num);
#define RACTupleUnpack(...) \
        RACTupleUnpack_(__VA_ARGS__)

/// A sentinel object that represents nils in the tuple.
///
/// It should never be necessary to create a tuple nil yourself. Just use
/// +tupleNil.
@interface RACTupleNil : NSObject <NSCopying, NSCoding>

/// A singleton instance.
+ (instancetype)tupleNil;

@end

/// A tuple is an ordered collection of objects. It may contain nils, represented
/// by RACTupleNil.
@interface RACTuple : NSObject <NSCoding, NSCopying, NSFastEnumeration>

/// The number of objects in the tuple, including any nil values.
@property (nonatomic, readonly) NSUInteger count;

/// An array of all the objects in the tuple.
///
/// RACTupleNils are converted to NSNulls in the array.
@property (nonatomic, copy, readonly) NSArray *array;

/// A signal that will send all of the objects in the tuple.
///
/// RACTupleNils will be sent as `nil` values on the signal.
@property (nonatomic, strong, readonly) RACSignal *rac_signal;

/// Invokes +tupleWithArray:convertNullsToNils: with `convert` set to NO.
+ (instancetype)tupleWithArray:(NSArray *)array;

/// Creates a new tuple out of the given array.
///
/// convert - Whether to convert `NSNull` objects in the array to `RACTupleNil`
///           values for the tuple. If this is NO, `NSNull`s will be left
///           untouched.
+ (instancetype)tupleWithArray:(NSArray *)array convertNullsToNils:(BOOL)convert;

/// Creates a new tuple with the given objects.
///
/// To include nil objects in the tuple, use `RACTupleNil` in the argument list.
+ (instancetype)tupleWithObjects:(id)object, ... NS_REQUIRES_NIL_TERMINATION;

/// Retrieves the object at the given index.
///
/// Unlike `NSArray` and friends, it's perfectly fine to ask for the object at
/// an index past the end of the tuple. It will simply return nil.
///
/// Returns the object at `index`, or `nil` if the object is a `RACTupleNil` or
/// the index is out of bounds.
- (id)objectAtIndex:(NSUInteger)index;

@end

@interface RACTuple (ObjectSubscripting)

/// Invokes -objectAtIndex: with the given index.
- (id)objectAtIndexedSubscript:(NSUInteger)idx;

@end

@interface RACTuple (Deprecated)

@property (nonatomic, copy, readonly) RACSequence *rac_sequence RACDeprecated("Use -rac_signal instead");
@property (nonatomic, copy, readonly) NSArray *allObjects RACDeprecated("Renamed to -array");

@property (nonatomic, strong, readonly) id first RACDeprecated("Use subscripting or -objectAtIndex: instead");
@property (nonatomic, strong, readonly) id second RACDeprecated("Use subscripting or -objectAtIndex: instead");
@property (nonatomic, strong, readonly) id third RACDeprecated("Use subscripting or -objectAtIndex: instead");
@property (nonatomic, strong, readonly) id fourth RACDeprecated("Use subscripting or -objectAtIndex: instead");
@property (nonatomic, strong, readonly) id fifth RACDeprecated("Use subscripting or -objectAtIndex: instead");
@property (nonatomic, strong, readonly) id last RACDeprecated("Use subscripting or -objectAtIndex: instead");

- (instancetype)tupleByAddingObject:(id)obj RACDeprecated("Use -array and -arrayByAddingObject: instead");

@end

/// This and everything below is for internal use only.
///
/// See RACTuplePack() and RACTupleUnpack() instead.
#define RACTuplePack_(...) \
    ([RACTuple tupleWithArray:@[ metamacro_foreach(RACTuplePack_object_or_ractuplenil,, __VA_ARGS__) ]])

#define RACTuplePack_object_or_ractuplenil(INDEX, ARG) \
    (ARG) ?: RACTupleNil.tupleNil,

#define RACTupleUnpack_(...) \
    metamacro_foreach(RACTupleUnpack_decl,, __VA_ARGS__) \
    \
    int RACTupleUnpack_state = 0; \
    \
    RACTupleUnpack_after: \
        ; \
        metamacro_foreach(RACTupleUnpack_assign,, __VA_ARGS__) \
        if (RACTupleUnpack_state != 0) RACTupleUnpack_state = 2; \
        \
        while (RACTupleUnpack_state != 2) \
            if (RACTupleUnpack_state == 1) { \
                goto RACTupleUnpack_after; \
            } else \
                for (; RACTupleUnpack_state != 1; RACTupleUnpack_state = 1) \
                    [RACTupleUnpackingTrampoline trampoline][ @[ metamacro_foreach(RACTupleUnpack_value,, __VA_ARGS__) ] ]

#define RACTupleUnpack_state metamacro_concat(RACTupleUnpack_state, __LINE__)
#define RACTupleUnpack_after metamacro_concat(RACTupleUnpack_after, __LINE__)
#define RACTupleUnpack_loop metamacro_concat(RACTupleUnpack_loop, __LINE__)

#define RACTupleUnpack_decl_name(INDEX) \
    metamacro_concat(metamacro_concat(RACTupleUnpack, __LINE__), metamacro_concat(_var, INDEX))

#define RACTupleUnpack_decl(INDEX, ARG) \
    __strong id RACTupleUnpack_decl_name(INDEX);

#define RACTupleUnpack_assign(INDEX, ARG) \
    __strong ARG = RACTupleUnpack_decl_name(INDEX);

#define RACTupleUnpack_value(INDEX, ARG) \
    [NSValue valueWithPointer:&RACTupleUnpack_decl_name(INDEX)],

@interface RACTupleUnpackingTrampoline : NSObject

+ (instancetype)trampoline;
- (void)setObject:(RACTuple *)tuple forKeyedSubscript:(NSArray *)variables;

@end


text:
package com.ubirch.user.server.route

import akka.actor.ActorSystem
import akka.http.scaladsl.server.Directive1
import akka.http.scaladsl.server.directives.FutureDirectives
import akka.pattern.CircuitBreaker
import com.typesafe.scalalogging.StrictLogging
import com.ubirch.util.http.response.ResponseUtil

import scala.concurrent.duration.DurationInt
import scala.concurrent.{ExecutionContext, Future}
import scala.language.postfixOps
import scala.reflect.ClassTag
import scala.util.Try

trait WithRoutesHelpers extends StrictLogging with FutureDirectives {

  ru: ResponseUtil =>

  def system: ActorSystem

  lazy val defaultCircuitBreaker: CircuitBreaker = CircuitBreaker(
    scheduler = system.scheduler,
    maxFailures = 10,
    callTimeout = 3 seconds,
    resetTimeout = 6 seconds
  )

  class OnComplete[T <: Any](future: => Future[T])(implicit ec: ExecutionContext, classTag: ClassTag[T]) {

    def onCompleteWithNoCircuitBreaker:Directive1[Try[T]] = onComplete(future.recoverWith {
      case e: Exception =>
        logger.error("OOPs, (OC-CB) something happened: ", e)
        Future.failed(e)
    })

    def onCompleteWithCircuitBreaker(circuitBreaker: CircuitBreaker):Directive1[Try[T]] = {
      onCompleteWithBreaker(circuitBreaker)(future.recoverWith {
        case e: Exception =>
          logger.error("OOPs, (OC) something happened: ", e)
          Future.failed(e)
      })
    }

    def fold(maybeCircuitBreaker: => Option[CircuitBreaker] = Some(defaultCircuitBreaker)): Directive1[Try[T]] = {
      maybeCircuitBreaker.fold(onCompleteWithNoCircuitBreaker)(onCompleteWithCircuitBreaker)
    }

  }

  object OnComplete {
    def apply[T <: Any](future: => Future[T])(implicit ec: ExecutionContext, classTag: ClassTag[T]): OnComplete[T] =
      new OnComplete(future)
  }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jee="http://www.springframework.org/schema/jee"
	xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context"
	xmlns:aop="http://www.springframework.org/schema/aop" xmlns:mvc="http://www.springframework.org/schema/mvc"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">

    <bean id="dataSource"
		class="org.springframework.jdbc.datasource.DriverManagerDataSource">
		<property name="driverClassName">
			<value>org.relique.jdbc.csv.CsvDriver</value>
		</property>
		<property name="url">
			<value>jdbc:relique:csv:${dataSourceFilePath}</value>
		</property>
	</bean>

	<!-- 基础数据配置数据库配置 -->
	<bean id="tpeg130" class="org.apache.commons.dbcp.BasicDataSource"
		destroy-method="close">
		<property name="driverClassName" value="${base.jdbc.driverClassName}" />
		<property name="url" value="${base.jdbc.url.130}" />
		<property name="username" value="${base.jdbc.username}" />
		<property name="password" value="${base.jdbc.password}" />
		<property name="initialSize" value="${dataSource.initialSize}" />
		<property name="maxIdle" value="${dataSource.maxIdle}" />
		<property name="minIdle" value="${dataSource.minIdle}" />
		<property name="maxActive" value="${dataSource.maxActive}" />
		<property name="logAbandoned" value="${dataSource.logAbandoned}" />
		<property name="removeAbandoned" value="${dataSource.removeAbandoned}" />
		<property name="removeAbandonedTimeout" value="${dataSource.removeAbandonedTimeout}" />
		<property name="maxWait" value="${dataSource.maxWait}" />
		<property name="testWhileIdle" value="${dataSource.testWhileIdle}" />
		<property name="testOnBorrow" value="${dataSource.testOnBorrow}" />
		<property name="validationQuery" value="${dataSource.validationQuery}" />
	</bean>

</beans>


text: class PostgresConnection < PostgresLikeConnection; end


text:
using System;

namespace Lemonade.Data.Exceptions
{
    public class CreateFeatureException : Exception
    {
        public CreateFeatureException(Exception innerException)
            : base(Errors.FailedToCreateFeature, innerException)
        {
        }
    }
}


text:
Computing 2 Semester 2 - Python Quantum Random Walk Project
===========================================================

My semester 2 project written in python to plot a graph of a
qubit performing a quantum random walk.

Uses MatPlotLib and NumPy.

If you have any suggestions or questions about my work you can clone the repo and
submit your changes and I will merge and credit you accordingly.

Check the 'release' folder for current releases, the 'source' folder contains the
up to date project as a whole.

See the LICENSE file for copyright information.


text:
#!/usr/bin/env node
"use strict";

//module dependencies.
var app = require("../server/app");
var debug = require("debug")("express:server");
var http = require("http");

//get port from environment and store in Express.
var port = normalizePort(process.env.PORT || 8080);
app.set("port", port);

//create http server
var server = http.createServer(app);

//listen on provided ports
server.listen(port);

//add error handler
server.on("error", onError);

//start listening on port
server.on("listening", onListening);

/**
 * Normalize a port into a number, string, or false.
 */
function normalizePort(val) {
  var port = parseInt(val, 10);

  if (isNaN(port)) {
    // named pipe
    return val;
  }

  if (port >= 0) {
    // port number
    return port;
  }

  return false;
}

/**
 * Event listener for HTTP server "error" event.
 */
function onError(error) {
  if (error.syscall !== "listen") {
    throw error;
  }

  var bind = typeof port === "string"
    ? "Pipe " + port
    : "Port " + port;

  // handle specific listen errors with friendly messages
  switch (error.code) {
    case "EACCES":
      console.error(bind + " requires elevated privileges");
      process.exit(1);
      break;
    case "EADDRINUSE":
      console.error(bind + " is already in use");
      process.exit(1);
      break;
    default:
      throw error;
  }
}

/**
 * Event listener for HTTP server "listening" event.
 */
function onListening() {
  var addr = server.address();
  var bind = typeof addr === "string"
    ? "pipe " + addr
    : "port " + addr.port;
  debug("Listening on " + bind);
}


text:
package com.microsoft.services.orc.core;

import com.google.common.util.concurrent.ListenableFuture;
import com.microsoft.services.orc.http.HttpVerb;
import com.microsoft.services.orc.http.OrcResponse;
import com.microsoft.services.orc.http.OrcURL;
import com.microsoft.services.orc.http.Request;

import java.util.List;

import static com.microsoft.services.orc.core.Helpers.*;

/**
 * The type OrcCollectionFetcher.
 *
 * @param <TEntity>      the type parameter
 * @param <TFetcher>     the type parameter
 * @param <TOperations>  the type parameter
 */
public class OrcCollectionFetcher<TEntity, TFetcher extends OrcEntityFetcher, TOperations extends OrcOperations>
        extends OrcFetcher<TEntity>
        implements Readable<List<TEntity>> {

    private int top = -1;
    private int skip = -1;
    private String selectedId = null;
    private TOperations operations;
    private String select = null;
    private String expand = null;
    private String filter = null;
    private String orderBy = null;

    /**
     * Instantiates a new OrcCollectionFetcher.
     *
     * @param urlComponent the url component
     * @param parent the parent
     * @param clazz the clazz
     * @param operationClazz the operation clazz
     */
    public OrcCollectionFetcher(String urlComponent, OrcExecutable parent,
                                Class<TEntity> clazz, Class<TOperations> operationClazz) {
        super(urlComponent, parent, clazz);

        this.reset();

        try {
            this.operations = operationClazz.getConstructor(String.class,
                    OrcExecutable.class).newInstance("", this);
        } catch (Throwable ignored) {
        }
    }

    /**
     * Reset void.
     */
    public void reset() {
        this.top = -1;
        this.skip = -1;
        this.selectedId = null;
        this.select = null;
        this.expand = null;
        this.filter = null;
        this.orderBy = null;
    }

    /**
     * Top OrcCollectionFetcher.
     *
     * @param top the top
     * @return the o data collection fetcher
     */
    public OrcCollectionFetcher<TEntity, TFetcher, TOperations> top(int top) {
        this.top = top;
        return this;
    }

    /**
     * Skip OrcCollectionFetcher.
     *
     * @param skip the skip
     * @return the o data collection fetcher
     */
    public OrcCollectionFetcher<TEntity, TFetcher, TOperations> skip(int skip) {
        this.skip = skip;
        return this;
    }

    /**
     * Select OrcCollectionFetcher.
     *
     * @param select the select
     * @return the o data collection fetcher
     */
    public OrcCollectionFetcher<TEntity, TFetcher, TOperations> select(String select) {
        this.select = select;
        return this;
    }

    /**
     * Expand OrcCollectionFetcher.
     *
     * @param expand the expand
     * @return the o data collection fetcher
     */
    public OrcCollectionFetcher<TEntity, TFetcher, TOperations> expand(String expand) {
        this.expand = expand;
        return this;
    }

    /**
     * Filter OrcCollectionFetcher.
     *
     * @param filter the filter
     * @return the o data collection fetcher
     */
    public OrcCollectionFetcher<TEntity, TFetcher, TOperations> filter(String filter) {
        this.filter = filter;
        return this;
    }

    /**
     * Order OrcCollectionFetcher.
     *
     * @param orderBy the orderBy
     * @return the o data collection fetcher
     */
    public OrcCollectionFetcher<TEntity, TFetcher, TOperations> orderBy(String orderBy) {
        this.orderBy = orderBy;
        return this;
    }

    /**
     * Gets by id.
     *
     * @param id the id
     * @return the by id
     */
    public TFetcher getById(String id) {
        this.selectedId = id;
        String packageName = operations.getClass().getPackage().getName();
        String[] classNameParts = (clazz.getCanonicalName() + "Fetcher").split("\\.");
        String className = packageName + "." + classNameParts[classNameParts.length - 1];

        try {
            Class entityQueryClass = Class.forName(className);
            OrcEntityFetcher odataEntityQuery = (OrcEntityFetcher) entityQueryClass
                    .getConstructor(String.class, OrcExecutable.class)
                    .newInstance("", this);

            return (TFetcher) odataEntityQuery;
        } catch (Throwable e) {
            // if this happens, we couldn't find the xxxQuery class at runtime.
            // this must NEVER happen
            throw new RuntimeException(e);
        }
    }

    @Override
    protected ListenableFuture<OrcResponse> oDataExecute(Request request) {
        if (selectedId == null) {
            setPathForCollections(request.getUrl(), urlComponent, top, skip, select, expand, filter, orderBy);
        } else {
            setSelectorUrl(request.getUrl(), urlComponent, selectedId);
        }
        addCustomParametersToRequest(request, getParameters(), getHeaders());
        return parent.oDataExecute(request);
    }

    /**
     * Reads
     *
     * @return the listenable future
     */
    @Override
    public ListenableFuture<List<TEntity>> read() {
        return Helpers.transformToEntityListListenableFuture(readRaw(), this.clazz, getResolver());
    }

    /**
     * Reads raw
     *
     * @return the listenable future
     */
    @Override
    public ListenableFuture<String> readRaw() {
        return super.readRaw();
    }

    /**
     * Add listenable future.
     *
     * @param entity the entity
     * @return the listenable future
     */
    public ListenableFuture<TEntity> add(TEntity entity) {
        ListenableFuture<String> future = addRaw(getResolver().getJsonSerializer().serialize(entity));
        return transformToEntityListenableFuture(future, this.clazz, getResolver());
    }

    /**
     * Add raw.
     *
     * @param payload the payload
     * @return the listenable future
     */
    public ListenableFuture<String> addRaw(String payload) {
        byte[] payloadBytes = payload.getBytes(Constants.UTF8);

        Request request = getResolver().createRequest();
        request.setContent(payloadBytes);
        request.setVerb(HttpVerb.POST);

        ListenableFuture<OrcResponse> future = oDataExecute(request);
        return transformToStringListenableFuture(future);

    }

    /**
     * Gets operations.
     *
     * @return the operations
     */
    public TOperations getOperations() {
        return this.operations;
    }

    /**
     * Add parameter.
     *
     * @param name the name
     * @param value the value
     * @return the OrcCollectionFetcher
     */
    public OrcCollectionFetcher<TEntity, TFetcher, TOperations> addParameter(String name, Object value) {
        addCustomParameter(name, value);
        return this;
    }

    /**
     * Add header.
     *
     * @param name the name
     * @param value the value
     * @return the OrcCollectionFetcher
     */
    public OrcCollectionFetcher<TEntity, TFetcher, TOperations> addHeader(String name, String value) {
        addCustomHeader(name, value);
        return this;
    }

    /**
     * Sets path for collections.
     *
     * @param url the url
     * @param urlComponent the url component
     * @param top the top
     * @param skip the skip
     * @param select the select
     * @param expand the expand
     * @param filter the filter
     * @param orderBy the order by
     */
    protected void setPathForCollections(OrcURL url, String urlComponent, int top, int skip, String select, String expand, String filter, String orderBy) {
        if (top > -1) {
            url.addQueryStringParameter("$top", Integer.valueOf(top).toString());
        }

        if (skip > -1) {
            url.addQueryStringParameter("$skip", Integer.valueOf(skip).toString());
        }

        if (select != null) {
            url.addQueryStringParameter("$select", select);
        }

        if (expand != null) {
            url.addQueryStringParameter("$expand", expand);
        }

        if (filter != null) {
            url.addQueryStringParameter("$filter", filter);
        }

        if (orderBy != null) {
            url.addQueryStringParameter("$orderby", orderBy);
        }

        url.prependPathComponent(urlComponent);
    }
}


text:
from df_browse.gui_debug import print

from df_browse.dataframe_browser import df_func, DFCmd

# keyword arguments provided to dataframe mutator functions include:
# args_str, cn, c, r (where cn is column name, c is column index, and r is row index),
# bcols (the browser's visible columns, ordered)

@df_func
def eval_df(df, args_str, cn, c=0, r=0, **kwargs):
    return eval(args_str)

@df_func
def query(df, args_str, **kwargs):
    return df.query(args_str)

@df_func
def sort_ascending_on_columns(df, args_str, **kwargs):
    columns = [arg.strip() for arg in args_str.split(',')]
    return sort_on_columns(df, columns, ascending=True, **kwargs)

@df_func
def sort_descending_on_columns(df, args_str, **kwargs):
    columns = [arg.strip() for arg in args_str.split(',')]
    return sort_on_columns(df, columns, ascending=False, **kwargs)

@df_func
def sort_on_columns(df, columns, ascending=True, algorithm='mergesort', na_position=None, **kwargs):
    """args_str is expected to be a comma-separated list of column names"""
    print('sorting on columns', columns, ascending)
    na_position = na_position if na_position is not None else ('last' if ascending else 'first')
    return df.sort_values(columns, ascending=ascending, kind=algorithm, na_position=na_position)

@df_func
def str_match(df, args_str, cn, **kwargs):
    return df.loc[df[cn].str.match(args_str, na=False)]

@df_func
def str_contains(df, args_str, cn, **kwargs):
    return df.loc[df[cn].str.contains(args_str, na=False)]

def save_df(df, path):
    if path.endswith('.csv'):
        df.to_csv(path, index=False)
    elif path.endswith('.hdf'):
        df.to_hdf(path)

@df_func
def save_full_df(df, args_str, **kwargs):
    save_df(df, args_str)

@df_func
def save_visible_df(df, args_str, bcols, **kwargs):
    df = df.loc[:, bcols]
    save_df(df, args_str)


text:
<TITLE>Review for Me, Myself and I (1992)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Me, Myself and I (1992)

reviewed by
James Brundage

Isn't there some saying about avoiding all movies that have a part in them
called `jailbait?'  Or is it that you should avoid casting jailbait on the
basis of their parts?  Well, either way, when you have a movie like Me,
Myself, and I, which starts out by yelling `cocksucker' at the audience and
follows this up with a sequence where we learn of Buddy Arnett (George Segal
's) obsession with laying Lolitas, and then we are lead to believe that this
is supposed to be a comedy, we know that this is probably not going to end
up very funny.

And, like just about everything else in this incredibly predictable rant,
Me, Myself, and I performs exactly as you would expect it to.

Me, Myself, and I follows Crazy Diane/Sane Diane (Jobeth Williams), a
psychotic who believes that numbers are chasing her until she seduces her
next door neighbor, Buddy.  Life is honky dory for a while, and we see a lot
of Sane Diane and then Buddy has to deal with his estranged wife, Jailbait,
and other pains of living.  All of which makes for a cheesy melodrama with a
bit of multiple-personality disorder put in.

The performances are admittedly enjoyable, but the film's pacing is so slow,
it's style so off-Broadway that I feel more like I'm watching What Happened
Was… devoid of intellect.  Save me the trouble.

A few moments of humor are interspersed with a weak narrative, good
performers given bad material, and all of the other paradoxes that make a
movie so midlist that it will be marked off of my list, and should never
find its way onto yours.

RATING:  **1/2

MPAA Rating: R

Director: Pablo Ferro
Producer: Pable Ferro
Starring: Jobeth Williams, George Segal, Don Calfa, Shelly Hack, Betsy Lynn
George

James Brundage on Epinions:
http://mk2k.epinions.com/user-mk2k

James' mailing list:
http://filmcritic2000.listbot.com/

Short Stuff short film review:
http://www.othercinema.com/~jbrundage/

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
.material-switch > input[type="checkbox"] {
    display: none;
}

.material-switch > label {
    cursor: pointer;
    height: 0px;
    position: relative;
    width: 40px;
    margin-right: 15px;
}

.material-switch > label::before {
    background: rgb(0, 0, 0);
    box-shadow: inset 0px 0px 10px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    content: '';
    height: 16px;
    margin-top: -8px;
    position:absolute;
    opacity: 0.3;
    transition: all 0.4s ease-in-out;
    width: 40px;
}
.material-switch > label::after {
    background: rgb(255, 255, 255);
    border-radius: 16px;
    box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.3);
    content: '';
    height: 24px;
    left: -4px;
    margin-top: -8px;
    position: absolute;
    top: -4px;
    transition: all 0.3s ease-in-out;
    width: 24px;
}
.material-switch > input[type="checkbox"]:checked + label::before {
    background: inherit;
    opacity: 0.5;
}
.material-switch > input[type="checkbox"]:checked + label::after {
    background: inherit;
    left: 20px;
}
.checkboxfit{
    float: left;
    border: none;
}


text:
module MercuryWebParser
  class Error < StandardError
    # Raised when Mercury returns a 4xx or 500 HTTP status code
    class ClientError < Error
      # Creates a new error from an HTTP environement
      #
      # @param response [Hash]
      # @return [MercuryWebParser::Error::ClientError]
      def initialize(error = nil)
        http_error = error.response[:status].to_i

        if ERROR_MAP.key?(http_error)
          raise ERROR_MAP[http_error], error.response[:body]['message']
        end

        super
      end
    end # ClientError

    class ConfigurationError < MercuryWebParser::Error; end

    # Raised when there's an error in Faraday
    class RequestError < MercuryWebParser::Error; end

    # Raised when MercuryWebParser returns a 400 HTTP status code
    class BadRequest < MercuryWebParser::Error; end

    # Raised when the response from the parser is null
    class NotParseable < MercuryWebParser::Error; end

    # Raised when MercuryWebParser returns a 401 HTTP status code
    class UnauthorizedRequest < MercuryWebParser::Error; end

    # Raised when MercuryWebParser returns a 403 HTTP status code
    class Forbidden < MercuryWebParser::Error; end

    # Raised when MercuryWebParser returns a 404 HTTP status code
    class NotFound < MercuryWebParser::Error; end

    # Raised when MercuryWebParser returns a 500 HTTP status code
    class InternalServerError < MercuryWebParser::Error; end

    ERROR_MAP = {
      400 => MercuryWebParser::Error::BadRequest,
      401 => MercuryWebParser::Error::UnauthorizedRequest,
      403 => MercuryWebParser::Error::Forbidden,
      404 => MercuryWebParser::Error::NotFound,
      500 => MercuryWebParser::Error::InternalServerError
    }.freeze
  end # Error
end


text:
import { createStore, applyMiddleware } from 'redux';
import rootReducer from '../reducers';
import thunk from 'redux-thunk';
import logger from 'redux-logger';

// create a store that has redux-thunk middleware enabled
const createStoreWithMiddleware = applyMiddleware(
  thunk,
  logger()
)(createStore);

export default function configureStore(initialState) {
  const store = createStoreWithMiddleware(rootReducer, initialState);

  if (module.hot) {
    // Enable Webpack hot module replacement for reducers
    module.hot.accept('../reducers', () => {
      const nextReducer = require('../reducers');
      store.replaceReducer(nextReducer);
    });
  }

  return store;
}


text:
describe('404 community page page: ', () => {
  // beforeEach(() => {
  before(() => {
    cy.visit('/no-exsit-community/posts')
  })

  it('basic layout should be visible', () => {
    cy.id('error-page').should('be.visible')
    cy.id('site-logo').should('be.visible')

    cy.id('spin-planet').should('be.visible')
    cy.id('code-snippets').should('be.visible')
  })

  it('no-exsit-community title should be visible', () => {
    const el = cy.id('community-error-title')

    el.should('be.visible')
    el.contains('no-exsit-community')
  })
})


text:
      group.name
      <input type="text" id="name" minlength="1" maxlength="1" ng-model="group.name" required />

  <list-select options="teamList" selected-list="group.teams" display="name"></list-select>


text:
//
//  UIView+Animation.h
//  LXFCommonCode
//
//  Created by 林洵锋 on 2017/3/2.
//  Copyright © 2017年 LXF. All rights reserved.
//
//  GitHub: https://github.com/LinXunFeng
//  简书: http://www.jianshu.com/users/31e85e7a22a2

#import <UIKit/UIKit.h>

@interface UIView (Animation)

/** 动画回调方法 */
@property(nonatomic,copy)void(^completeBlock)();

/** 摇动动画 */
- (void) shakeAnimation;

/** 弹跳动画 */
- (void) springingAnimation;

/** 旋转180°动画 */
- (void) trans180DegreeAnimation;

/** 抛物线动画(起始、高度、时间、执行回调方法) */
- (void) throwFrom:(CGPoint)start to:(CGPoint)end height:(CGFloat)height
          duration:(CGFloat)duration completedBlock:(void(^)())completedBlock;

/** 点攒动画 */
- (void) praiseAnimation;

#pragma mark - other

// Moves
- (void)moveTo:(CGPoint)destination duration:(float)secs option:(UIViewAnimationOptions)option;
- (void)moveTo:(CGPoint)destination duration:(float)secs option:(UIViewAnimationOptions)option delegate:(id)delegate callback:(SEL)method;
- (void)raceTo:(CGPoint)destination withSnapBack:(BOOL)withSnapBack;
- (void)raceTo:(CGPoint)destination withSnapBack:(BOOL)withSnapBack delegate:(id)delegate callback:(SEL)method;

// Transforms
- (void)rotate:(int)degrees secs:(float)secs delegate:(id)delegate callback:(SEL)method;
- (void)scale:(float)secs x:(float)scaleX y:(float)scaleY delegate:(id)delegate callback:(SEL)method;
- (void)spinClockwise:(float)secs;
- (void)spinCounterClockwise:(float)secs;

// Transitions
- (void)curlDown:(float)secs;
- (void)curlUpAndAway:(float)secs;
- (void)drainAway:(float)secs;

// Effects
- (void)changeAlpha:(float)newAlpha secs:(float)secs;
- (void)pulse:(float)secs continuously:(BOOL)continuously;

//add subview
- (void)addSubviewWithFadeAnimation:(UIView *)subview;

@end


text:
const tape = require('tape');
const d3 = require('d3-selection');
const textures = require('../dist/textures');
const jsdom = require('./jsdom');

const template = () => {
	const texture = textures.paths();
	const document = jsdom('<svg></svg>');
	const svg = d3.select(document).select('svg');
	return {svg, texture};
};

tape(
	'svg.call(texture) append a node <defs>',
	t => {
		const {svg, texture} = template();
		svg.call(texture);
		t.ok(!svg.select('defs').empty());
		t.end();
	}
);

tape(
	'svg.call(texture) append a node <pattern>',
	t => {
		const {svg, texture} = template();
		svg.call(texture);
		t.ok(!svg.select('defs').select('pattern').empty());
		t.end();
	}
);

tape(
	'svg.call(texture) append a node <pattern> with the id attribute',
	t => {
		const {svg, texture} = template();
		svg.call(texture);
		t.notEqual(svg.select('defs').select('pattern').attr('id'), '');
		t.end();
	}
);

tape(
	'svg.call(texture) append a node <pattern> with the patternUnits attribute set to userSpaceOnUse',
	t => {
		const {svg, texture} = template();
		svg.call(texture);
		t.equal(svg.select('defs').select('pattern').attr('patternUnits'), 'userSpaceOnUse');
		t.end();
	}
);

tape(
	'svg.call(texture) append a node <pattern> with the attributes width and height set to 20',
	t => {
		const {svg, texture} = template();
		svg.call(texture);
		t.equal(svg.select('defs').select('pattern').attr('width'), '20');
		t.equal(svg.select('defs').select('pattern').attr('height'), '20');
		t.end();
	}
);

tape(
	'texture.lines() append a node <path> with some default attributes',
	t => {
		const {svg, texture} = template();
		svg.call(texture);
		const path = svg.select('defs').select('pattern').select('path');
		t.equal(path.attr('stroke-width'), '2');
		t.equal(path.attr('stroke'), '#343434');
		t.equal(path.attr('shape-rendering'), 'auto');
		t.equal(path.attr('stroke-linecap'), 'square');
		t.equal(path.attr('d'), 'M 5,15l5,-10l5,10');
		t.end();
	}
);

tape(
	'texture.heavier() doubles the strokeWidth',
	t => {
		const {svg, texture} = template();
		texture.heavier();
		svg.call(texture);
		t.equal(svg.select('defs').select('pattern').select('path').attr('stroke-width'), '4');
		t.end();
	}
);

tape(
	'texture.heavier(3) changes strokeWidth to strokeWidth * 2 * 3',
	t => {
		const {svg, texture} = template();
		texture.heavier(3);
		svg.call(texture);
		t.equal(svg.select('defs').select('pattern').select('path').attr('stroke-width'), '12');
		t.end();
	}
);

tape(
	'texture.lighter() divides the strokeWidth by 2',
	t => {
		const {svg, texture} = template();
		texture.lighter();
		svg.call(texture);
		t.equal(svg.select('defs').select('pattern').select('path').attr('stroke-width'), '1');
		t.end();
	}
);

tape(
	'texture.lighter(2) changes radius to strokeWidth / (2 * 2)',
	t => {
		const {svg, texture} = template();
		texture.lighter(2);
		svg.call(texture);
		t.equal(svg.select('defs').select('pattern').select('path').attr('stroke-width'), '0.5');
		t.end();
	}
);

tape(
	'texture.thinner() doubles the size',
	t => {
		const {svg, texture} = template();
		texture.thinner();
		svg.call(texture);
		t.equal(svg.select('defs').select('pattern').attr('width'), '40');
		t.end();
	}
);

tape(
	'texture.thinner(3) changes size to size * 2 * 3',
	t => {
		const {svg, texture} = template();
		texture.thinner(3);
		svg.call(texture);
		t.equal(svg.select('defs').select('pattern').attr('width'), '120');
		t.end();
	}
);

tape(
	'texture.thicker() divides the size by 2',
	t => {
		const {svg, texture} = template();
		texture.thicker();
		svg.call(texture);
		t.equal(svg.select('defs').select('pattern').attr('width'), '10');
		t.end();
	}
);

tape(
	'texture.thicker(2) changes size to size / (2 * 2)',
	t => {
		const {svg, texture} = template();
		texture.thicker(2);
		svg.call(texture);
		t.equal(svg.select('defs').select('pattern').attr('width'), '5');
		t.end();
	}
);

tape(
	'texture.background("firebrick") append a node <rect> with attribute fill equal to "firebrick"',
	t => {
		const {svg, texture} = template();
		texture.background('firebrick');
		svg.call(texture);
		t.equal(svg.select('defs').select('pattern').select('rect').attr('fill'), 'firebrick');
		t.end();
	}
);

tape(
	'texture.size(40) set size to 40',
	t => {
		const {svg, texture} = template();
		texture.size(40);
		svg.call(texture);
		const path = svg.select('defs').select('pattern').select('path');
		t.equal(path.attr('d'), 'M 10,30l10,-20l10,20');
		t.end();
	}
);

tape(
	'texture.shapeRendering("crispEdges") set shape-rendering to crispEdges',
	t => {
		const {svg, texture} = template();
		texture.shapeRendering('crispEdges');
		svg.call(texture);
		const path = svg.select('defs').select('pattern').select('path');
		t.equal(path.attr('shape-rendering'), 'crispEdges');
		t.end();
	}
);

tape(
	'texture.stroke("red") set stroke to red',
	t => {
		const {svg, texture} = template();
		texture.stroke('red');
		svg.call(texture);
		const path = svg.select('defs').select('pattern').select('path');
		t.equal(path.attr('stroke'), 'red');
		t.end();
	}
);

tape(
	'texture.strokeWidth(4) set stroke-width to 4',
	t => {
		const {svg, texture} = template();
		texture.strokeWidth(4);
		svg.call(texture);
		const path = svg.select('defs').select('pattern').select('path');
		t.equal(path.attr('stroke-width'), '4');
		t.end();
	}
);

tape(
	'texture.id("xyz") set pattern id to xyz',
	t => {
		const {svg, texture} = template();
		texture.id('xyz');
		svg.call(texture);
		t.equal(svg.select('defs').select('pattern').attr('id'), 'xyz');
		t.end();
	}
);

tape(
	'texture.url() returns a string with the pattern id',
	t => {
		const {svg, texture} = template();
		texture.id('xyz');
		svg.call(texture);
		t.equal(texture.url(), 'url(#xyz)');
		t.end();
	}
);

tape(
	'texture.stroke("black").strokeWidth(5) set stroke to black and strokeWidth to 5',
	t => {
		const {svg, texture} = template();
		texture.stroke('black').strokeWidth(5);
		svg.call(texture);
		const path = svg.select('defs').select('pattern').select('path');
		t.equal(path.attr('stroke'), 'black');
		t.equal(path.attr('stroke-width'), '5');
		t.end();
	}
);

tape(
	'texture.d("squares") set squared path',
	t => {
		const {svg, texture} = template();
		texture.d('squares');
		svg.call(texture);
		const path = svg.select('defs').select('pattern').select('path');
		t.equal(path.attr('d'), 'M 5 5 l 10 0 l 0 10 l -10 0 Z');
		t.end();
	}
);

tape(
	'texture.size(80).d("caps") set caps path',
	t => {
		const {svg, texture} = template();
		texture.size(80).d('caps');
		svg.call(texture);
		const path = svg.select('defs').select('pattern').select('path');
		t.equal(path.attr('d'), 'M 20,60l20,-40l20,40');
		t.end();
	}
);

tape(
	'texture.d("hexagons") set hexagons path and set width and height',
	t => {
		const {svg, texture} = template();
		texture.d('hexagons');
		svg.call(texture);
		t.equal(svg.select('defs').select('pattern').attr('width'), '60');
		t.end();
	}
);


text:
- [fixed] Swift-only: Updated symbol name kFirebaseInstallationsErrorDomain to
  InstallationsErrorDomain. (#9275)

# 8.4.0
- [fixed] Bump Promises dependency. (#8365)

# 7.0.0
- [changed] The global variable `FIRInstallationsVersionStr` is deleted.
  `FirebaseVersion()` or `FIRFirebaseVersion()` should be used instead.
- [changed] Throw an exception if `FIROptions.projectID` is missing or
  `FIROptions.APIKey` has incorrect format to catch critical configuration
  issues earlier. (#4692)
- [changed] Removed the `FIR` prefix from `FIRInstallationIDDidChange` and renamed
  `kFIRInstallationIDDidChangeNotificationAppNameKey` to `InstallationIDDidChangeAppNameKey`
  in Swift.
- [changed] API docs updated to use term "installation auth token" consistently. (#6014)

# 1.7.1
- [changed] Additional `FIRInstallationsItem` validation to catch potential storage issues. (#6570)

# 1.7.0
- [changed] Use ephemeral `NSURLSession` to prevent caching of request/response. (#6226)
- [changed] Backoff added for some error to prevent unnecessary API requests. (#6232)

# 1.5.0
- [changed] Functionally neutral source reorganization. (#5832)

# 1.3.0
- [changed] Mac OS Keychain storage changes: use a unique (per app) Keychain Service name to isolate Keychain items for different Mac OS applications.
  NOTE: Installation Identifiers created by previous versions will be reset on Mac OS which can affect e.g. A/B Testing variants or debug device targeting for Firebase Messaging.
  iOS, tvOS and watchOS Installation Identifiers will not be affected. (#5603)
- [changed] More readable server error console messages. (#5654)
- [changed] Auth Token auto fetch disabled. (#5656)

# 1.2.0
- [changed] Keychain key-value storage refactored to `GoogleUtilities`. (#5329)

# 1.1.1
- [fixed] Accessing `GULHeartbeatDateStorage` moved out of main thread. (#5098)

# 1.1.0
- [changed] Throw an exception when there are missing required `FirebaseOptions` parameters (`APIKey`, `googleAppID`, and `projectID`). Please make sure your `GoogleServices-Info.plist` (or `FirebaseOptions` if you configure Firebase in code) is up to date. The file and settings can be downloaded from the [Firebase Console](https://console.firebase.google.com/).  (#4683)

# 1.0.0
- [added] The Firebase Installations Service is an infrastructure service for Firebase services that creates unique identifiers and authentication tokens for Firebase clients (called "Firebase Installations") enabling Firebase Targeting, i.e. interoperation between Firebase services.
- [added] The Firebase Installations SDK introduces the Firebase Installations API. Developers that use API-restrictions for their API-Key may experience blocked requests (https://stackoverflow.com/questions/58495985/). This problem can be mitigated by following the instructions found [here](API_KEY_RESTRICTIONS.md).


text:
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'hjson'
require 'json'
require 'pp'
require 'hashdiff'
require 'power_assert'
require 'test/unit'


text:
void
bigQueue::_initialize(int    (*sortfcn)(const void *a, const void *b),
                      bool   (*readfcn)(FILE *f, void *a),
                      bool   (*writfcn)(FILE *f, void *a),
                      void   (*killfcn)(void *a),
                      u32bit   objectSize,
                      u32bit   memoryToUse,
                      char    *tmppath,
                      char    *filename) {
  _saveFile     = 0L;
  _tmpPath      = 0L;

  if (filename) {
    _saveFile = new char [strlen(filename) + 1];
    strcpy(_saveFile, filename);
  }
  if (tmppath) {
    _tmpPath = new char [strlen(tmppath) + 1];
    strcpy(_tmpPath, tmppath);
  }

  _sortFunction      = sortfcn;
  _writFunction      = writfcn;
  _readFunction      = readfcn;
  _killFunction      = killfcn;

  _objectSize        = objectSize;
  _memoryToUse       = memoryToUse;

  _maxOpenFiles      = getdtablesize() - 8;
  _numTemporaryFiles = 0;
  _numMergeFiles     = 0;

  _temporaryFiles = new FILE* [_maxOpenFiles];

  for (u32bit i=0; i<_maxOpenFiles; i++)
    _temporaryFiles[i] = 0L;

  //  Open the first temporary file for writing.
  //
  _temporaryFiles[_numTemporaryFiles++] = makeTempFile(_tmpPath);

  //  XXX: It would be rather convenient if we could get another file
  //  handle given an existing handle (no, dup(2) doesn't do that).
  //  In particular, we want two file pointers, one for read, one for
  //  write.
  //
  //_inputFile  = fdopen(dup(fileno(_temporaryFiles[0])), "w+");

  _thingBuffer = new u64bit [_objectSize / 8 + 1];

  _bufferMax = 0;
  _bufferLen = 0;
  _buffer    = 0L;

  if (_sortFunction) {
    _bufferMax = (u64bit)memoryToUse * 1024 * 1024 / ((u64bit)sizeof(void *) + objectSize);
    _bufferLen = 0;
    _buffer    = new void* [_bufferMax];
  }
}

bigQueue::~bigQueue() {
  delete [] _saveFile;
  delete [] _tmpPath;

  for (u32bit i=0; i<_numTemporaryFiles; i++)
    fclose(_temporaryFiles[i]);

  delete [] _temporaryFiles;

  //fclose(_inputFile);

  clearBuffer();
}

//  Add elements to the end of the array.
void
bigQueue::add(void *thing) {

  if (_buffer == 0L) {
    if (_writFunction)
      (*_writFunction)(_temporaryFiles[_numTemporaryFiles-1], thing);
    else
      fwrite(thing, _objectSize, 1, _temporaryFiles[_numTemporaryFiles-1]);
  } else {

    //  No space in the buffer?  Sort it, write it out and make a new
    //  one.
    //
    if (_bufferLen >= _bufferMax) {
      sortAndWriteBuffer();

      if (_numTemporaryFiles+1 >= _maxOpenFiles)
        mergeTemporaryFiles();

      _temporaryFiles[_numTemporaryFiles++] = makeTempFile(_tmpPath);
    }

    _buffer[_bufferLen++] = thing;
  }
}

void
bigQueue::sortAndWriteBuffer(void) {

  if (_bufferLen > 0) {

    //  Sort!
    //
    qsort(_buffer, _bufferLen, sizeof(void *), _sortFunction);

    //  Write!
    //
    if (_writFunction) {
      for (u32bit i=0; i<_bufferLen; i++)
        (*_writFunction)(_temporaryFiles[_numTemporaryFiles-1], _buffer[i]);
    } else {
      for (u32bit i=0; i<_bufferLen; i++)
        fwrite(_buffer[i], _objectSize, 1, _temporaryFiles[_numTemporaryFiles-1]);
    }

    //  Flush and rewind the file!
    //
    fflush(_temporaryFiles[_numTemporaryFiles-1]);
    ::rewind(_temporaryFiles[_numTemporaryFiles-1]);

    clearBuffer();
  }
}

void
bigQueue::clearBuffer(void) {

  if (_killFunction)
    for (u32bit i=0; i<_bufferLen; i++)
      (*_killFunction)(_buffer[i]);
  else
    for (u32bit i=0; i<_bufferLen; i++)
      free(_buffer[i]);

  _bufferLen = 0;
}

void
bigQueue::mergeTemporaryFiles(void) {

  if (_numTemporaryFiles > 1) {
    dict_t    *sorted;
    dnode_t   *nodes = new dnode_t [_maxOpenFiles];

    //  To be efficient, we need to maintain a sorted queue of the head
    //  elements of each temporary file.  A red-black tree would do
    //  nicely, eh?
    //
    sorted = dict_create(DICTCOUNT_T_MAX, _sortFunction);

    //  Grab the first thing off each file, insert it into the dictionary.
    //  The 'key' is our chunk of data, and the 'value' is the file number
    //  it came from.
    //
    for (u32bit i=0; i<_numTemporaryFiles; i++) {
      if (_temporaryFiles[i]) {

        //  Rewind all the temporary files.  XXXX This is probably done
        //  already.
        //
        ::rewind(_temporaryFiles[i]);

        void *thing = malloc(_objectSize);

        if (_readFunction)
          (*_readFunction)(_temporaryFiles[i], thing);
        else
          fread(thing, _objectSize, 1, _temporaryFiles[i]);

        if (feof(_temporaryFiles[i])) {
          fclose(_temporaryFiles[i]);
          _temporaryFiles[i] = 0L;
        } else {
          //  initialize the node with the value
          dnode_init(&nodes[i], (void *)(unsigned long)i);

          //  insert the node into the tree using the key
          dict_insert(sorted, &nodes[i], thing);
        }
      }
    }

    FILE *mergeFile = makeTempFile(_tmpPath);

    //  while there is stuff in the tree

    while (dict_isempty(sorted) == 0) {

      //  pop the head element off, and print it
      dnode_t  *head = dict_first(sorted);

      //  XXX: should be const thing

      void   *thing  = (void *)dnode_getkey(head);
      long    fileid = (long)dnode_get(head);

      if (_writFunction)
        (*_writFunction)(mergeFile, thing);
      else
        fwrite(thing, _objectSize, 1, mergeFile);

      //  delete the node from the tree
      dict_delete(sorted, head);

      //  destroy the thing
      if (_killFunction)
        (*_killFunction)(thing);
      else
        free(thing);

      //  load the next element from the same file that the head was
      //  from (that's stored as the value of the head element)

      thing = malloc(_objectSize);

      if (_readFunction)
        (*_readFunction)(_temporaryFiles[fileid], thing);
      else
        fread(thing, _objectSize, 1, _temporaryFiles[fileid]);

      //  if there was a next element in that file, insert it
      //  into the tree.  if not, close the temporary file.
      //
      if (feof(_temporaryFiles[fileid])) {
        fclose(_temporaryFiles[fileid]);
        _temporaryFiles[fileid] = 0;
        free(thing);
      } else {
        //  initialize the node with the value
        dnode_init(&nodes[fileid], (void *)fileid);

        //  insert the node into the tree using the key
        dict_insert(sorted, &nodes[fileid], thing);
      }
    }

    dict_free(sorted);
    delete [] nodes;

    _numTemporaryFiles = 1;
    _temporaryFiles[0] = mergeFile;
  }

  ::rewind(_temporaryFiles[0]);

#if 0
  fclose(_inputFile);
  errno = 0;
  _inputFile  = fdopen(dup(fileno(_temporaryFiles[0])), "w+");
  if (errno)
    fprintf(stderr, "bigQueue::mergeTemporaryFiles()-- _inputFile = fdopen() failed: %s\n", strerror(errno)), exit(1);

  ::rewind(_inputFile);
#endif
}

bool
bigQueue::next(void) {

  if (_readFunction) {
    //(*_readFunction)(_inputFile, _thingBuffer);
    (*_readFunction)(_temporaryFiles[0], _thingBuffer);
  } else {
    //fread(_thingBuffer, _objectSize, 1, _inputFile);
    fread(_thingBuffer, _objectSize, 1, _temporaryFiles[0]);
  }

#if 0
  if (feof(_inputFile))
    return(false);
#endif

  if (feof(_temporaryFiles[0]))
    return(false);

  return(true);
}

void*
bigQueue::get(void) {
  return(_thingBuffer);
}

void
bigQueue::rewind(void) {
  //::rewind(_inputFile);
  ::rewind(_temporaryFiles[0]);
  next();
}

void
bigQueue::save(char *filepath) {
  fprintf(stderr, "bigQueue::save()-- not implemented.\n");
}

void
bigQueue::sort(void) {
  sortAndWriteBuffer();
  mergeTemporaryFiles();
}

void
bigQueue::flush(void) {
  fflush(_temporaryFiles[_numTemporaryFiles-1]);
}


text:
package com.example.bharathramh.xplore;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.location.Address;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.os.Bundle;
//import android.app.Fragment;

import android.provider.Settings;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.TextView;

import com.example.JSON.FacebookFriendsJSONUtils;
import com.example.bharathramh.Adapters.NearByFriendsAdapter;
import com.example.bharathramh.StorageClassCollection.FacebookFriendsData;
import com.example.storeData.StoreDataInServer;
import com.facebook.AccessToken;
import com.facebook.AccessTokenTracker;
import com.facebook.CallbackManager;
import com.facebook.GraphRequest;
import com.facebook.GraphResponse;
import com.facebook.Profile;
import com.facebook.ProfileTracker;
import com.facebook.login.widget.LoginButton;
import com.parse.LogInCallback;
import com.parse.ParseException;
import com.parse.ParseFacebookUtils;
import com.parse.ParseUser;

import org.json.JSONArray;

import java.util.ArrayList;

/**
 * A simple {@link Fragment} subclass.
 * Activities that contain this fragment must implement the
 * {@link FriendsNearByFaceBook.OnFragmentInteractionListener} interface
 * to handle interaction events.
 */
public class FriendsNearByFaceBook extends Fragment implements PopulateNearByFriendsAsync.nearByFriendsListener{

    private OnFragmentInteractionListener mListener;
    LoginButton loginButton;
    CallbackManager callbackManager;
    AccessToken successToken;
    AccessTokenTracker tracker;
    ProfileTracker profileTracker;
    LocationManager mLocationManager;
    LocationListener mLocListener;
    Location mLocation;
    Boolean  viewCreated = false, friendsDataRetrieved = false;
    LoginButton facebookLogBtn;
    TextView notLoggedInText;
    ListView listView;
    ArrayList<FacebookFriendsData> data;
    NearByFriendsAdapter adapter;
    ProgressDialog progressDialog;

    public void friendsListReq(){
        Profile profile = Profile.getCurrentProfile();

        if(profile!=null){
            Log.d("facebooklogin", "Accessing from id: "+profile.getId());
        }else{
            return;
        }

        GraphRequest request ;
        request = GraphRequest.newMyFriendsRequest(AccessToken.getCurrentAccessToken(), new GraphRequest.GraphJSONArrayCallback() {
            @Override
            public void onCompleted(JSONArray jsonArray, GraphResponse graphResponse) {
                if(jsonArray!=null){
                    ArrayList<FacebookFriendsData> data =  FacebookFriendsJSONUtils.formatFriendsData(jsonArray.toString());
                    Log.d("facebookLogin", "friends data is " + jsonArray.toString() );
                    ArrayList<Long> fbIds = new ArrayList<Long>();
                    for(FacebookFriendsData temp : data){
                        fbIds.add(temp.getId());
                    }
                    Address queryAddress = getArguments().getParcelable("location");
                    Log.d("facebookLogin", "querying for "+ queryAddress.getLatitude()+" " +queryAddress.getLongitude()+ " "+fbIds);
                    Bundle b = new Bundle();
                    b.putDouble("latitude",queryAddress.getLatitude() );
                    b.putDouble("longitude",queryAddress.getLongitude() );
                    b.putSerializable("fbIds", fbIds);
                    b.putParcelable("AccessToken", AccessToken.getCurrentAccessToken());
                    new PopulateNearByFriendsAsync(FriendsNearByFaceBook.this, getActivity()).execute(b);

                }
            }
        });
        request.executeAsync();
        notLoggedInText.setText(getResources().getString(R.string.facebook_loading_data));
        notLoggedInText.setVisibility(View.VISIBLE);
        progressDialog = new ProgressDialog(getActivity());
        progressDialog.setMessage(getActivity().getResources().getString(R.string.loading_friends));
        progressDialog.setCancelable(true);
        progressDialog.setCanceledOnTouchOutside(false);
        progressDialog.show();
        Log.d("facebooklogin", "here");

    }

    public FriendsNearByFaceBook() {
        // Required empty public constructor
    }

    public static FriendsNearByFaceBook instance(Address address){
        FriendsNearByFaceBook f = new FriendsNearByFaceBook();
        Bundle _data = new Bundle();
        _data.putParcelable("location", address);
        f.setArguments(_data);
        return f;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        viewCreated = true;
        dispName();
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.fragment_friends_near_by_face_book, container, false);
        notLoggedInText = (TextView) view.findViewById(R.id.notLoggedInTextView);
        listView = (ListView) view.findViewById(R.id.facebookFriendsLocationListView);

        listView.setVisibility(View.GONE);

        LoginButton facebookLogBtn = (LoginButton) view.findViewById(R.id.login_button);
        facebookLogBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (Profile.getCurrentProfile() == null) {
                    Log.d("facebookLoginCV", "Login pressed");
                    ParseFacebookUtils.logInWithReadPermissionsInBackground(FriendsNearByFaceBook.this,
                            new ArrayList<String>() {{add("user_friends");}}, new LogInCallback() {
                                @Override
                                public void done(ParseUser user, ParseException err) {
                                    if (user == null) {
                                        notLoggedInText.setVisibility(View.VISIBLE);
                                        notLoggedInText.setText(getResources().getString(R.string.facebook_not_logged_in_msg));
                                        listView.setVisibility(View.GONE);
                                        if(data != null){
                                            data.clear();
                                        }
                                        if(adapter!=null){
                                            adapter.notifyDataSetChanged();
                                        }

                                        Log.d("MyApp", "Uh oh. The user cancelled the Facebook login.");
                                    } else if (user.isNew()) {

//                    successToken = user.getSessionToken();
//                    successToken = user.get
                                        Log.d("MyApp", "User signed up and logged in through Facebook!");
                                    } else {
//                    successToken = user.getSessionToken();

                                        Log.d("MyApp", "User logged in through Facebook!");
                                    }
                                    dispName();
                                }
                            });

                }else{
                    Log.d("facebookLoginCV", "Logout pressed here");

                }
            }
        });
        return view;
    }

    @Override
    public void onStart() {
        super.onStart();
    }

    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        try {
            mListener = (OnFragmentInteractionListener) activity;
        } catch (ClassCastException e) {
            throw new ClassCastException(activity.toString()
                    + " must implement OnFragmentInteractionListener");
        }
    }

public void dispName(){
    try {
        TextView tx = (TextView) getView().findViewById(R.id.facebookTextView);
        if(Profile.getCurrentProfile()!=null) {
            tx.setText("Welcome, " + Profile.getCurrentProfile().getName());
            friendsListReq();
        }else{
            tx.setText("Welcome");
            Log.d("facebookLogin", "disp name profile was null");
        }
    }catch (Exception e){
        e.printStackTrace();
    }
}

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        mLocationManager = (LocationManager) getActivity().getSystemService(Context.LOCATION_SERVICE);

        /* FacebookSdk.sdkInitialize(getActivity().getApplicationContext());
        callbackManager = CallbackManager.Factory.create();
*/          tracker = new AccessTokenTracker() {
            @Override
            protected void onCurrentAccessTokenChanged(AccessToken old, AccessToken accessToken) {
                Log.d("facebookloginoncreate", "access changed "+ accessToken);
                successToken = accessToken;
                Profile.fetchProfileForCurrentAccessToken();
                Log.d("facebookloginoncreate", "profile is  "+ Profile.getCurrentProfile());

            }
        };

        tracker.startTracking();

        profileTracker = new ProfileTracker() {
            @Override
            protected void onCurrentProfileChanged( Profile oldProfile, Profile currentProfile) {

                Log.d("facebookloginoncreate", "profile is "+ currentProfile + "getcurrent profile is "+ Profile.getCurrentProfile());
                if(currentProfile!=null){
                    Log.d("facebookloginoncreate",currentProfile.getProfilePictureUri(100,100)+" is the pic");
                }else{
                    Log.d("facebookloginoncreate", "profile was null");
                    notLoggedInText.setVisibility(View.VISIBLE);
                    notLoggedInText.setText(getResources().getString(R.string.facebook_not_logged_in_msg));
                    listView.setVisibility(View.GONE);
                    ParseUser.logOut();
                    dispName();
                }

            }
        };

        profileTracker.startTracking();

    }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
//        callbackManager.onActivityResult(requestCode, resultCode, data);
        Log.d("facebookLogin", "onactivityresult " + requestCode+ " "+ resultCode + " "+ data);
        ParseFacebookUtils.onActivityResult(requestCode, resultCode, data);
    }

    @Override
    public void onDestroy() {
        try{
            mLocationManager.removeUpdates(mLocListener);
        }catch (Exception e){
            e.printStackTrace();
        }
        super.onDestroy();
    }

    @Override
    public void onDetach() {
        super.onDetach();
        tracker.stopTracking();
        profileTracker.stopTracking();
        mListener = null;
    }

    public boolean hasNetwork(){
        ConnectivityManager cm = (ConnectivityManager) getActivity().getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo nwInfo = cm.getActiveNetworkInfo();
        if(nwInfo!=null &&nwInfo.isConnected()){
            return true;
        }else{
            return false;
        }
    }

    @Override
    public void onPause() {
        Log.d("mainviewfrag", "onPause");
        super.onPause();

    }

    @Override
    public void nearByFriendsDataRetrieved(ArrayList dataFB) {
        progressDialog.dismiss();
        this.data = dataFB;
        if(data!=null && data.size()>0){
            Log.d("facebookLogindata", data.toString());
            notLoggedInText.setVisibility(View.GONE);
            listView.setVisibility(View.VISIBLE);
            adapter = new NearByFriendsAdapter(getActivity(), R.layout.friends_nearby_details_container, data);
            listView.setAdapter(adapter);
            listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
                @Override
                public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                    try {
                        int versionCode = getActivity().getPackageManager().getPackageInfo("com.facebook.katana", 0).versionCode;
                        if (versionCode >= 3002850) {
                            Uri uri = Uri.parse("fb://facewebmodal/f?href=" + "https://www.facebook.com/" + data.get(position).getId());
                            startActivity(new Intent(Intent.ACTION_VIEW, uri));
                        } else {
                            // open the Facebook app using the old method (fb://profile/id or fb://page/id)
                            startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("fb://profile/"+data.get(position).getId())));
                        }
//                        Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("fb://profile/"+data.get(position).getId()));
//                        startActivity(intent);
                    } catch (Exception e) {
                        Intent intent =  new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.facebook.com/" + data.get(position).getId()));
                        startActivity(intent);
                    }
                }
            });

        }else{
            notLoggedInText.setText(getResources().getString(R.string.facebook_no_friends_present));
            Log.d("facebookLoginData", "Data was null");
        }
    }

    @Override
    public void onResume() {
        super.onResume();

        if(!hasNetwork()){
            AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
            builder.setTitle("Data not enabled");
            builder.setMessage("Would you like to enable the Internet connection");
            builder.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    Intent intent = new Intent(Settings.ACTION_SETTINGS);
                    startActivity(intent);
                }
            });
            builder.setNegativeButton("No", new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    dialog.cancel();
                    getActivity().getSupportFragmentManager().beginTransaction().remove(FriendsNearByFaceBook.this).commit();
                    getFragmentManager().popBackStack();
                }
            });

            AlertDialog alertDialog = builder.create();
            alertDialog.show();
        }

//        dispName();

        Log.d("facebookLogin", "onResume");

        /*String currentProvider = LocationManager.NETWORK_PROVIDER;
        if(currentProvider==null || currentProvider.equals("")){
            currentProvider = LocationManager.GPS_PROVIDER;
            if(currentProvider==null || currentProvider.equals("")) {
                AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
                builder.setTitle("InCompatible device");
                builder.setMessage("This feature is not available for you. " +
                        "Your device does not have a location provider.");
                builder.setPositiveButton("Exit", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        getActivity().getSupportFragmentManager().beginTransaction().remove(FaceBookLogin.this).commit();
                        getFragmentManager().popBackStack();
                    }
                });

                AlertDialog alertDialog = builder.create();
                alertDialog.show();
            }
        }*/

//        GPS_PROVIDER
        if(!mLocationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER) && !mLocationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)){

            AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
            builder.setTitle("Location access not enabled");
            builder.setMessage("Would you like to enable Location access");
            builder.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
                    startActivity(intent);
                }
            });
            builder.setNegativeButton("No", new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    dialog.cancel();

                }
            });

            AlertDialog alertDialog = builder.create();
            alertDialog.show();

        }else{

            mLocListener = new LocationListener() {
                @Override
                public void onLocationChanged(Location location) {

                    mLocation = location;
                    Log.d("facebookLoginLoc", "location change " + location);
                    if(Profile.getCurrentProfile()!=null){
                        try {
                            Log.d("facebookLoginLoc", "Profile is "+Profile.getCurrentProfile().getName());
                            Log.d("facebookLoginLoc", "trying to save "+Long.parseLong(Profile.getCurrentProfile().getId())+" "+ mLocation.getLatitude()+" "+ mLocation.getLongitude()+" "+ Profile.getCurrentProfile().getName());

                            StoreDataInServer.UpdateLocationData(Long.parseLong(Profile.getCurrentProfile().getId()), mLocation.getLatitude(), mLocation.getLongitude(), Profile.getCurrentProfile().getName());

                        }catch (Exception e){
                            e.printStackTrace();
                            Log.d("facebookLoginLoc", "Error while saving data");
                        }
                    }else{
                        Log.d("facebookLoginLoc", "Error while saving data, profile could be null "+Profile.getCurrentProfile());
                    }
                }

                @Override
                public void onStatusChanged(String provider, int status, Bundle extras) {

                }

                @Override
                public void onProviderEnabled(String provider) {

                }

                @Override
                public void onProviderDisabled(String provider) {

                }
            };

//            Log.d("facebookLoginLoc", "using "+currentProvider);
            try {
                for(String providers : mLocationManager.getProviders(true)) {
                    mLocationManager.requestLocationUpdates(providers, 0, 25000, mLocListener);
                }
            }catch (Exception e){
                e.printStackTrace();
            }

        }
    }

    /**
     * This interface must be implemented by activities that contain this
     * fragment to allow an interaction in this fragment to be communicated
     * to the activity and potentially other fragments contained in that
     * activity.
     *

     * See the Android Training lesson Communicating with Other Fragments for more information.
     */
    public interface OnFragmentInteractionListener {
        // TODO: Update argument type and name
//        public void onFragmentInteraction(Uri uri);
    }

}


text:
<?php

namespace L5SimpleFM;

use Illuminate\Support\ServiceProvider;
use L5SimpleFM\L5SimpleFM;
use Soliant\SimpleFM\Adapter;
use Soliant\SimpleFM\HostConnection;

class L5SimpleFMServiceProvider extends ServiceProvider
{

    /**
     * Register the application services.
     *
     * @return void
     */
    public function register()
    {
        $this->constructAndBindL5SimpleFM();
    }

    protected function constructAndBindL5SimpleFM()
    {
        $this->app->bind('L5SimpleFM\Contracts\FileMakerInterface', function ($app) {
            $username = env('FM_USERNAME', 'myFileMakerDatabaseUsername');
            $password = env('FM_PASSWORD', 'myFileMakerDatabasePassword');
            $host = env('FM_HOST', '127.0.0.1');
            $database = env('FM_DATABASE', 'myFileMakerDatabaseFileName');

            $hostConnection = new HostConnection($host, $database, $username, $password);
            return new L5SimpleFM(new Adapter($hostConnection));
        });
    }
}


text:
import eve
import itertools
import os
import random
import string
import uuid

from datetime import datetime
from eve import ETAG
from eve.tests import TestMinimal
from py2neo import Node, Relationship

from eve_neo4j import Neo4j, ValidatorNeo4j
from eve_neo4j.utils import create_node

class TestBaseNeo4j(TestMinimal):

    def setUp(self, settings_file=None, url_converters=None):
        self.this_directory = os.path.dirname(os.path.realpath(__file__))
        self.settings_file = os.path.join(
            self.this_directory,
            'test_settings_neo4j.py')

        self.app = eve.Eve(
            settings=self.settings_file,
            url_converters=url_converters,
            data=Neo4j,
            validator=ValidatorNeo4j)
        self.domain = self.app.config['DOMAIN']
        self.known_resource_count = 101
        self.known_resource = 'people'
        self.known_resource_url = \
            '/%s' % self.domain[self.known_resource]['url']
        self.test_client = self.app.test_client()
        self.setupDB()

        self.empty_resource = 'empty'
        self.empty_resource_url = '/%s' % self.empty_resource

        response, _ = self.get(self.known_resource, '?max_results=2')
        person = self.response_item(response)
        self.item = person
        self.item_id = self.item[self.app.config['ID_FIELD']]
        self.item_firstname = self.item['firstname']
        self.item_etag = self.item[ETAG]
        self.item_id_url = ('/%s/%s' %
                            (self.domain[self.known_resource]['url'],
                             self.item_id))

        self.unknown_item_id = '05ced1a0-b16f-4ae8-8432-a80a84a947b2'
        self.unknown_resource = 'unknown'
        self.unknown_resource_url = '/%s' % self.unknown_resource

        self.readonly_resource = 'payments'
        self.readonly_resource_url = (
            '/%s' % self.domain[self.readonly_resource]['url'])

        response, _ = self.get('payments', '?max_results=1')
        self.readonly_id = self.response_item(response)['_id']
        self.readonly_id_url = ('%s/%s' % (self.readonly_resource_url,
                                           self.readonly_id))

        # self.epoch = date_to_str(datetime(1970, 1, 1))

    def response_item(self, response, i=0):
        if self.app.config['HATEOAS']:
            return response['_items'][i]
        else:
            return response[i]

    def setupDB(self):
        self.graph = self.app.data.driver.graph
        self.bulk_insert()

    def tearDown(self):
        self.dropGraph()
        self.dropIndexes()
        del self.app

    def dropGraph(self):
        self.graph.delete_all()

    def dropIndexes(self):
        schema = self.graph.schema
        for label in itertools.chain(
                self.graph.node_labels, self.graph.relationship_types):
            for property_ in schema.get_uniqueness_constraints(label):
                schema.drop_uniqueness_constraint(label, property_)

    def add_control_fields(self, entity):
        dt = datetime.now()
        entity['_created'] = dt
        entity['_updated'] = dt
        entity['_id'] = str(uuid.uuid4())

    def bulk_insert(self):
        tx = self.graph.begin()
        people = self.random_people(self.known_resource_count)
        [self.add_control_fields(person) for person in people]
        people = [
            create_node(self.known_resource, person) for person in people]
        [tx.create(person) for person in people]

        # load random invoice
        try:
            dt = datetime.now().timestamp()
        except AttributeError:
            import time
            dt = time.mktime(datetime.now().timetuple())
        invoice = Node('invoice', number=random.randint(0, 100))
        invoice['_created'] = dt
        invoice['_updated'] = dt
        invoice['_id'] = str(uuid.uuid4())
        relation = Relationship(people[0], 'has_invoice', invoice)
        tx.create(invoice | relation)

        # load random payments
        for _ in range(10):
            payment = Node(
                'payments', number=random.randint(0, 100),
                string=self.random_string(6))
            try:
                dt = datetime.now().timestamp()
            except AttributeError:
                import time
                dt = time.mktime(datetime.now().timetuple())
            payment['_created'] = dt
            payment['_updated'] = dt
            payment['_id'] = str(uuid.uuid4())
            tx.create(payment)
        tx.commit()

    def random_string(self, length=6):
        return ''.join(random.choice(string.ascii_lowercase)
                       for _ in range(length)).capitalize()

    def random_address(self):
        return {
            'address': self.random_string(),
            'city': self.random_string()
        }

    def random_people(self, num):
        people = []
        for i in range(num):
            person = {
                'firstname': self.random_string(6),
                'lastname': self.random_string(6),
                'address': self.random_address()
            }
            people.append(person)
        return people


text:
using System;
using System.Linq;
using System.Threading.Tasks;
using IdentityServer4.EntityFramework.Interfaces;
using IdentityServer4.EntityFramework.Mappers;
using IdentityServer4.Models;
using IdentityServer4.Stores;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;

namespace IdentityServer4.EntityFramework.Stores
{
    /// <summary>
    /// Implementation of IClientStore thats uses EF.
    /// </summary>
    /// <seealso cref="IdentityServer4.Stores.IClientStore" />
    public class ClientStore : IClientStore
    {
        /// <summary>
        /// The DbContext.
        /// </summary>
        protected readonly IConfigurationDbContext Context;

        /// <summary>
        /// The logger.
        /// </summary>
        protected readonly ILogger<ClientStore> Logger;

        /// <summary>
        /// Initializes a new instance of the <see cref="ClientStore"/> class.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="logger">The logger.</param>
        /// <exception cref="ArgumentNullException">context</exception>
        public ClientStore(IConfigurationDbContext context, ILogger<ClientStore> logger)
        {
            Context = context ?? throw new ArgumentNullException(nameof(context));
            Logger = logger;
        }

        /// <summary>
        /// Finds a client by id
        /// </summary>
        /// <param name="clientId">The client id</param>
        /// <returns>
        /// The client
        /// </returns>
        public virtual async Task<Client> FindClientByIdAsync(string clientId)
        {
            IQueryable<Entities.Client> baseQuery = Context.Clients
                .Where(x => x.ClientId == clientId);

            var client = (await baseQuery.ToArrayAsync())
                .SingleOrDefault(x => x.ClientId == clientId);
            if (client == null) return null;

            await baseQuery.Include(x => x.AllowedCorsOrigins).SelectMany(c => c.AllowedCorsOrigins).LoadAsync();
            await baseQuery.Include(x => x.AllowedGrantTypes).SelectMany(c => c.AllowedGrantTypes).LoadAsync();
            await baseQuery.Include(x => x.AllowedScopes).SelectMany(c => c.AllowedScopes).LoadAsync();
            await baseQuery.Include(x => x.Claims).SelectMany(c => c.Claims).LoadAsync();
            await baseQuery.Include(x => x.ClientSecrets).SelectMany(c => c.ClientSecrets).LoadAsync();
            await baseQuery.Include(x => x.IdentityProviderRestrictions).SelectMany(c => c.IdentityProviderRestrictions).LoadAsync();
            await baseQuery.Include(x => x.PostLogoutRedirectUris).SelectMany(c => c.PostLogoutRedirectUris).LoadAsync();
            await baseQuery.Include(x => x.Properties).SelectMany(c => c.Properties).LoadAsync();
            await baseQuery.Include(x => x.RedirectUris).SelectMany(c => c.RedirectUris).LoadAsync();

            var model = client.ToModel();

            Logger.LogDebug("{clientId} found in database: {clientIdFound}", clientId, model != null);

            return model;
        }
    }
}