text:
package com.java110.fee.listener.tempCarFeeConfig;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.core.annotation.Java110Listener;
import com.java110.core.context.DataFlowContext;
import com.java110.core.factory.GenerateCodeFactory;
import com.java110.entity.center.Business;
import com.java110.fee.dao.ITempCarFeeConfigServiceDao;
import com.java110.po.tempCarFeeConfig.TempCarFeeConfigPo;
import com.java110.utils.constant.BusinessTypeConstant;
import com.java110.utils.constant.StatusConstant;
import com.java110.utils.util.Assert;
import org.slf4j.Logger;
import com.java110.core.log.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 保存 临时车收费标准信息 侦听
 * Created by wuxw on 2018/5/18.
 */
@Java110Listener("saveTempCarFeeConfigInfoListener")
@Transactional
public class SaveTempCarFeeConfigInfoListener extends AbstractTempCarFeeConfigBusinessServiceDataFlowListener {

    private static Logger logger = LoggerFactory.getLogger(SaveTempCarFeeConfigInfoListener.class);

    @Autowired
    private ITempCarFeeConfigServiceDao tempCarFeeConfigServiceDaoImpl;

    @Override
    public int getOrder() {
        return 0;
    }

    @Override
    public String getBusinessTypeCd() {
        return BusinessTypeConstant.BUSINESS_TYPE_SAVE_TEMP_CAR_FEE_CONFIG_INFO;
    }

    /**
     * 保存临时车收费标准信息 business 表中
     *
     * @param dataFlowContext 数据对象
     * @param business        当前业务对象
     */
    @Override
    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
        JSONObject data = business.getDatas();
        Assert.notEmpty(data, "没有datas 节点,或没有子节点需要处理");

        //处理 businessTempCarFeeConfig 节点
        if (data.containsKey(TempCarFeeConfigPo.class.getSimpleName())) {
            Object bObj = data.get(TempCarFeeConfigPo.class.getSimpleName());
            JSONArray businessTempCarFeeConfigs = null;
            if (bObj instanceof JSONObject) {
                businessTempCarFeeConfigs = new JSONArray();
                businessTempCarFeeConfigs.add(bObj);
            } else {
                businessTempCarFeeConfigs = (JSONArray) bObj;
            }
            //JSONObject businessTempCarFeeConfig = data.getJSONObject(TempCarFeeConfigPo.class.getSimpleName());
            for (int bTempCarFeeConfigIndex = 0; bTempCarFeeConfigIndex < businessTempCarFeeConfigs.size(); bTempCarFeeConfigIndex++) {
                JSONObject businessTempCarFeeConfig = businessTempCarFeeConfigs.getJSONObject(bTempCarFeeConfigIndex);
                doBusinessTempCarFeeConfig(business, businessTempCarFeeConfig);
                if (bObj instanceof JSONObject) {
                    dataFlowContext.addParamOut("configId", businessTempCarFeeConfig.getString("configId"));
                }
            }
        }
    }

    /**
     * business 数据转移到 instance
     *
     * @param dataFlowContext 数据对象
     * @param business        当前业务对象
     */
    @Override
    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
        JSONObject data = business.getDatas();

        Map info = new HashMap();
        info.put("bId", business.getbId());
        info.put("operate", StatusConstant.OPERATE_ADD);

        //临时车收费标准信息
        List<Map> businessTempCarFeeConfigInfo = tempCarFeeConfigServiceDaoImpl.getBusinessTempCarFeeConfigInfo(info);
        if (businessTempCarFeeConfigInfo != null && businessTempCarFeeConfigInfo.size() > 0) {
            reFreshShareColumn(info, businessTempCarFeeConfigInfo.get(0));
            tempCarFeeConfigServiceDaoImpl.saveTempCarFeeConfigInfoInstance(info);
            if (businessTempCarFeeConfigInfo.size() == 1) {
                dataFlowContext.addParamOut("configId", businessTempCarFeeConfigInfo.get(0).get("config_id"));
            }
        }
    }

    /**
     * 刷 分片字段
     *
     * @param info         查询对象
     * @param businessInfo 小区ID
     */
    private void reFreshShareColumn(Map info, Map businessInfo) {

        if (info.containsKey("community_id")) {
            return;
        }

        if (!businessInfo.containsKey("communityId")) {
            return;
        }

        info.put("community_id", businessInfo.get("communityId"));
    }

    /**
     * 撤单
     *
     * @param dataFlowContext 数据对象
     * @param business        当前业务对象
     */
    @Override
    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
        String bId = business.getbId();
        //Assert.hasLength(bId,"请求报文中没有包含 bId");
        Map info = new HashMap();
        info.put("bId", bId);
        info.put("statusCd", StatusConstant.STATUS_CD_VALID);
        Map paramIn = new HashMap();
        paramIn.put("bId", bId);
        paramIn.put("statusCd", StatusConstant.STATUS_CD_INVALID);
        //临时车收费标准信息
        List<Map> tempCarFeeConfigInfo = tempCarFeeConfigServiceDaoImpl.getTempCarFeeConfigInfo(info);
        if (tempCarFeeConfigInfo != null && tempCarFeeConfigInfo.size() > 0) {
            reFreshShareColumn(paramIn, tempCarFeeConfigInfo.get(0));
            tempCarFeeConfigServiceDaoImpl.updateTempCarFeeConfigInfoInstance(paramIn);
        }
    }

    /**
     * 处理 businessTempCarFeeConfig 节点
     *
     * @param business                 总的数据节点
     * @param businessTempCarFeeConfig 临时车收费标准节点
     */
    private void doBusinessTempCarFeeConfig(Business business, JSONObject businessTempCarFeeConfig) {

        Assert.jsonObjectHaveKey(businessTempCarFeeConfig, "configId", "businessTempCarFeeConfig 节点下没有包含 configId 节点");

        if (businessTempCarFeeConfig.getString("configId").startsWith("-")) {
            //刷新缓存
            //flushTempCarFeeConfigId(business.getDatas());

            businessTempCarFeeConfig.put("configId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_configId));

        }

        businessTempCarFeeConfig.put("bId", business.getbId());
        businessTempCarFeeConfig.put("operate", StatusConstant.OPERATE_ADD);
        //保存临时车收费标准信息
        tempCarFeeConfigServiceDaoImpl.saveBusinessTempCarFeeConfigInfo(businessTempCarFeeConfig);

    }

    @Override
    public ITempCarFeeConfigServiceDao getTempCarFeeConfigServiceDaoImpl() {
        return tempCarFeeConfigServiceDaoImpl;
    }

    public void setTempCarFeeConfigServiceDaoImpl(ITempCarFeeConfigServiceDao tempCarFeeConfigServiceDaoImpl) {
        this.tempCarFeeConfigServiceDaoImpl = tempCarFeeConfigServiceDaoImpl;
    }
}


text:
layout: page
title: Tough Spring Studios Executive Retreat
date: 2016-05-24
author: Rebecca Williams
tags: weekly links, java
status: published
summary: Nulla eget sollicitudin mi. Sed et lectus at.
banner: images/banner/leisure-02.jpg
booking:
  startDate: 07/14/2016
  endDate: 07/18/2016
  ctyhocn: PGFTLHX
  groupCode: TSSER
published: true
---
Maecenas vulputate purus at arcu vehicula, quis semper lectus scelerisque. Vivamus sodales tristique accumsan. In fermentum nisl lorem, vitae aliquet ipsum volutpat a. Pellentesque non neque in libero bibendum vulputate. Donec sed libero eget purus venenatis facilisis nec sit amet turpis. Etiam euismod consectetur dolor, a commodo erat mollis dapibus. Etiam vestibulum dolor sed odio volutpat gravida. Nulla vitae nunc nulla.

* Ut vel turpis pulvinar, iaculis quam ac, vestibulum dolor
* Donec aliquet purus vel felis finibus tincidunt.

Nunc at lectus urna. Nunc mollis neque congue, cursus erat fermentum, sodales velit. Nullam sem ipsum, malesuada a tincidunt ut, maximus sit amet nibh. Nulla malesuada diam arcu. Vivamus eget massa finibus, condimentum nunc eu, blandit dui. Integer elementum ac lectus vel euismod. Proin eget risus vel velit tempor consectetur. Nullam vestibulum libero diam, ultricies pulvinar mauris efficitur eu. Curabitur varius neque tortor, et venenatis velit luctus et. Mauris dictum nisl magna, dapibus volutpat mauris convallis non. Nulla in augue porttitor, pretium odio lacinia, dictum tellus. Vestibulum ut libero euismod, sodales felis sit amet, dapibus ipsum.

redpajama_set_name: RedPajamaGithub


text:
define(['angular', 'services/module-name', 'constants/AccessConstants', 'kylo-services-module'], function (angular, moduleName, AccessConstants) {

    return angular.module(moduleName).factory("AngularModuleExtensionService", ["$http", "$q", "$timeout", "$uiRouter", "CommonRestUrlService","BroadcastService","$urlMatcherFactory",
   function ($http, $q, $timeout, $uiRouter, CommonRestUrlService, BroadcastService,$urlMatcherFactory) {

       var EXTENSION_MODULES_INITIALIZED_EVENT = 'extensionModulesInitialized'
       /**
        * The array of extension module metadata
        * @type {Array}
        */
        var modules = [];

       /**
        * Map of the menu group to additional links that pertain to the extension modules
        * @type {{}}
        */
        var menuMap = {};

        var stateNames = [];

        var urlMatchers = [];

        var urlMatcherToStateMap = {};

        function lazyStateName(state){
            return state.state+".**";
        }

       function buildLazyRoute(state,extensionModule) {
            var lazyState = {
                name:lazyStateName(state),
                url:state.url,
                params:state.params,
                lazyLoad: function (transition) {
                    transition.injector().get('$ocLazyLoad').load(extensionModule.moduleJsUrl).then(function success(args) {
                        //upon success go back to the state
                        transition.router.stateService.go(state.state, transition.params())
                        return args;
                    }, function error(err) {
                        console.log("Error loading "+state.state, err);
                        return err;
                    });

                }
            }
            return lazyState;
       }

       function buildModuleNavigationLinks(extensionModule){
           if(extensionModule.navigation && extensionModule.navigation.length >0){

               _.each(extensionModule.navigation,function(menu) {
                   var group = menu.toggleGroupName;
                  if(group != undefined && group != null){
                      if(menuMap[group] == undefined){
                          menuMap[group] = menu
                          if(menu.links == undefined || menu.links == null) {
                              menu.links = [];
                          }
                      }
                      else {
                          _.each(menu.links,function(link){
                              menuMap[group].links.push(link);
                          })

                      }
                  }

               });
           }
       }

       function registerStates(extensionModule){
           var lazyStates = [];
           if(angular.isDefined(extensionModule.states)) {
               _.each(extensionModule.states, function(state) {
                   stateNames.push(state.state);
                   var urlMatcher = $urlMatcherFactory.compile(state.url);
                   urlMatchers.push(urlMatcher);
                   urlMatcherToStateMap[urlMatcher] = state.state;
                   var exists =  $uiRouter.stateRegistry.get(lazyStateName(state));
                   if(exists) {
                       $uiRouter.stateRegistry.deregister(lazyStateName(state))
                   }
                       $uiRouter.stateRegistry.register(buildLazyRoute(state, extensionModule));
               });
               modules.push(extensionModule);
               buildModuleNavigationLinks(extensionModule);
           }
       }

       var initialized = false;

       var data = {
           INITIALIZED_EVENT:EXTENSION_MODULES_INITIALIZED_EVENT,
           onInitialized:function(callback){
               BroadcastService.subscribeOnce(data.INITIALIZED_EVENT, callback);
           },
           isInitialized:function(){
               return initialized;
           },
           getModules:function(){
               return modules;
           },
           getNavigationMenu:function(){
               return menuMap;
           },
           stateExists:function(stateName) {
             return _.indexOf(stateNames, stateName) > -1;
           },
           urlExists:function(url) {
               var urlMatcher = _.find(urlMatchers,function(matcher){
                   var params = matcher.exec(url);
                   return angular.isObject(params);

               });
               return urlMatcher != undefined;
           },
           /**
            * return the state and associated parameters for a url
            * @param url
            * @return {{state: null, params: null, url: *, valid: boolean}}
            */
           stateAndParamsForUrl:function(url) {
             var data = {state:null,params:null,url:url,valid:false}

              var urlMatcher = _.find(urlMatchers,function(matcher){
                   var params = matcher.exec(url);
                   if(angular.isObject(params)){
                       data.params=params;
                       return true;
                   }
                   return false;
               });
              if(urlMatcher != undefined)
              {
                  var state = urlMatcherToStateMap[urlMatcher];
                  data.state = state;
                  data.valid = true;
               }
              return data;
           },
           /**
            * Registers the state with angular.
            * Returns the promise
            */
           registerModules:function(){
              var promise = $http.get(CommonRestUrlService.ANGULAR_EXTENSION_MODULES_URL);
              promise.then(function (response) {
                   if(response.data){
                       _.each(response.data,function(extensionModule) {
                          registerStates(extensionModule);
                       });
                       initialized=true;
                   }
                  BroadcastService.notify(EXTENSION_MODULES_INITIALIZED_EVENT);
               },function(err){
                  console.log('err',err)
              });
                return promise;
               }

       };

       return data;
   }]);
});


text:
<?php

namespace PHPKitchen\Domain\Specs\Unit\Stubs\Models\Tmux;

use PHPKitchen\Domain\Specs\Unit\Stubs\Base\Record;

/**
 * Represents
 *
 * @package tests\stubs\models\tmux
 * @author Dmitry Kolodko <prowwid@gmail.com>
 */
class TmuxRecord extends Record {
    public $dummyRecord;
    public $id;

    public function getDummy() {
        return $this->dummyRecord;
    }

    public function getPrimaryKey($asBool = false) {
        return $this->id;
    }

    public function getListOfSelfRecords() {
        return [
            $this,
            $this,
            $this,
        ];
    }

    public function getListOfMixedValues() {
        return [
            $this,
            'value',
            1,
        ];
    }
}


text:
namespace CarDealer.Services.Models.Customers
{
    using System.Collections.Generic;
    using Sales;
    using System.Linq;

    public class CustomerTotalSalesModel
    {
        public string Name { get; set; }

        public bool IsYoungDriver { get; set; }

        public IEnumerable<SaleModel> BoughtCars { get; set; }

        public decimal TotalSpentMoney
            => this.BoughtCars
                   .Sum(c => c.Price * (1m - ((decimal) c.Discount+ (this.IsYoungDriver ? 0.05m : 0m))));
    }
}


text:
import React from 'react';
import {createRenderer} from 'react-addons-test-utils';
import { assert} from 'chai';
import sd from 'skin-deep';
import { latestRuns as data } from './data/runs/latestRuns';
import { RunsRecord } from '../../main/js/components/records.jsx';

import Branches from '../../main/js/components/Branches.jsx';

const t = () => {};

describe("Branches should render", () => {
  let tree;
  const
    renderer = createRenderer();

  beforeEach(() => {
    const branch = new RunsRecord(data[0]);
    tree = sd.shallowRender(<Branches t={t} data={branch} pipeline={{}} />, {
        router: {},
        location: {},
    });
  });

  it("renders the Branches", () => {
    const row = tree.everySubTree('CellLink');
    const lastCol = tree.everySubTree('td');
    const weatherIcon =row[0].getRenderOutput();
    assert.isNotNull(weatherIcon);
    assert.isNotNull(weatherIcon.props.score);
    assert.equal(weatherIcon.props.score, data[0].score);
    // dash for empty or id
    const commitHash = data[0].latestRun.commitId.substr(0, 7);
    const hashComp = row[3].getRenderOutput().props.children;
    const hashRendered = sd.shallowRender(hashComp).getRenderOutput();
    assert.equal(hashRendered.props.children, commitHash);
    assert.equal(row.length, 6);
    assert.equal(lastCol.length, 1);
  });
});

describe("Branches should not render", () => {
  let tree;
  const
    renderer = createRenderer();

  beforeEach(() => {
    tree = sd.shallowRender(<Branches t={t}/>);
  });

  it("renders the Branches", () => {
    assert.isNull(tree.getRenderOutput());
  });
});


text:
"""TCP echo server example."""
import argparse
import asyncio
import sys
try:
    import signal
except ImportError:
    signal = None

class EchoServer(asyncio.Protocol):

    TIMEOUT = 5.0

    def timeout(self):
        print('connection timeout, closing.')
        self.transport.close()

    def connection_made(self, transport):
        print('connection made')
        self.transport = transport

        # start 5 seconds timeout timer
        self.h_timeout = asyncio.get_event_loop().call_later(
            self.TIMEOUT, self.timeout)

    def data_received(self, data):
        print('data received: ', data.decode())
        self.transport.write(b'Re: ' + data)

        # restart timeout timer
        self.h_timeout.cancel()
        self.h_timeout = asyncio.get_event_loop().call_later(
            self.TIMEOUT, self.timeout)

    def eof_received(self):
        pass

    def connection_lost(self, exc):
        print('connection lost:', exc)
        self.h_timeout.cancel()

class EchoClient(asyncio.Protocol):

    message = 'This is the message. It will be echoed.'

    def connection_made(self, transport):
        self.transport = transport
        self.transport.write(self.message.encode())
        print('data sent:', self.message)

    def data_received(self, data):
        print('data received:', data)

        # disconnect after 10 seconds
        asyncio.get_event_loop().call_later(10.0, self.transport.close)

    def eof_received(self):
        pass

    def connection_lost(self, exc):
        print('connection lost:', exc)
        asyncio.get_event_loop().stop()

#
# 启动一个客户端
#
def start_client(loop, host, port):
    #
    # Task 对象
    #
    t = asyncio.Task(loop.create_connection(EchoClient, host, port))
    loop.run_until_complete(t)     # 启动

def start_server(loop, host, port):
    f = loop.create_server(EchoServer, host, port)
    return loop.run_until_complete(f)

ARGS = argparse.ArgumentParser(description="TCP Echo example.")
ARGS.add_argument(
    '--server', action="store_true", dest='server',
    default=False, help='Run tcp server')
ARGS.add_argument(
    '--client', action="store_true", dest='client',
    default=False, help='Run tcp client')
ARGS.add_argument(
    '--host', action="store", dest='host',
    default='127.0.0.1', help='Host name')
ARGS.add_argument(
    '--port', action="store", dest='port',
    default=9999, type=int, help='Port number')
ARGS.add_argument(
    '--iocp', action="store_true", dest='iocp',
    default=False, help='Use IOCP event loop')

if __name__ == '__main__':
    args = ARGS.parse_args()

    if ':' in args.host:
        args.host, port = args.host.split(':', 1)
        args.port = int(port)

    if (not (args.server or args.client)) or (args.server and args.client):
        print('Please specify --server or --client\n')
        ARGS.print_help()
    else:
        if args.iocp:
            from asyncio import windows_events
            loop = windows_events.ProactorEventLoop()
            asyncio.set_event_loop(loop)
        else:
            loop = asyncio.get_event_loop()
        print ('Using backend: {0}'.format(loop.__class__.__name__))

        if signal is not None and sys.platform != 'win32':
            loop.add_signal_handler(signal.SIGINT, loop.stop)

        if args.server:
            server = start_server(loop, args.host, args.port)     # 启动服务器
        else:
            start_client(loop, args.host, args.port)              # 启动客户端

        try:
            loop.run_forever()       # 启动
        finally:
            if args.server:
                server.close()
            loop.close()


text:
Conductor.require("../alert.js");

Conductor.card({
  activate: function() {
    start();
  }
});


text:
#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

/// Helper functions to access Keychain.
@interface FIRInstallationsKeychainUtils : NSObject

+ (nullable NSData *)getItemWithQuery:(NSDictionary *)query
                                error:(NSError *_Nullable *_Nullable)outError;

+ (BOOL)setItem:(NSData *)item
      withQuery:(NSDictionary *)query
          error:(NSError *_Nullable *_Nullable)outError;

+ (BOOL)removeItemWithQuery:(NSDictionary *)query error:(NSError *_Nullable *_Nullable)outError;

@end

NS_ASSUME_NONNULL_END


text:
/* Author: Ioan Sucan */

#ifndef OMPL_UTIL_TIME_
#define OMPL_UTIL_TIME_

#include <chrono>
#include <ctime>
#include <iomanip>
#include <sstream>

// std::put_time is not implemented in GCC 4.x
#if defined(__GNUC__) && (__GNUC__ < 5)
namespace std
{
    inline std::string put_time(const std::tm *tmb, const char *fmt)
    {
        char mbstr[100];
        std::strftime(mbstr, sizeof(mbstr), fmt, tmb);
        return string(mbstr);
    }
}
#endif

namespace ompl
{
    /** \brief Namespace containing time datatypes and time operations */
    namespace time
    {
        /** \brief Representation of a point in time */
        typedef std::chrono::system_clock::time_point point;

        /** \brief Representation of a time duration */
        typedef std::chrono::system_clock::duration duration;

        /** \brief Get the current time point */
        inline point now()
        {
            return std::chrono::system_clock::now();
        }

        /** \brief Return the time duration representing a given number of seconds */
        inline duration seconds(double sec)
        {
            auto s = (long)sec;
            auto us = (long)((sec - (double)s) * 1000000);
            return std::chrono::seconds(s) + std::chrono::microseconds(us);
        }

        /** \brief Return the number of seconds that a time duration represents */
        inline double seconds(const duration &d)
        {
            return std::chrono::duration<double>(d).count();
        }

        /** \brief Return string representation of point in time */
        inline std::string as_string(const point &p)
        {
            std::time_t pt = std::chrono::system_clock::to_time_t(p);
            std::stringstream ss;
            ss << std::put_time(std::localtime(&pt), "%F %T");
            return ss.str();
        }
    }
}

#endif


text:
/* $FreeBSD: release/9.1.0/sys/sys/shm.h 220388 2011-04-06 16:59:54Z trasz $ */
/*	$NetBSD: shm.h,v 1.15 1994/06/29 06:45:17 cgd Exp $	*/

/*-
 * Copyright (c) 1994 Adam Glass
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *      This product includes software developed by Adam Glass.
 * 4. The name of the author may not be used to endorse or promote products
 *    derived from this software without specific prior written permission
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/*
 * As defined+described in "X/Open System Interfaces and Headers"
 *                         Issue 4, p. XXX
 */

#ifndef _SYS_SHM_H_
#define _SYS_SHM_H_

#include <sys/cdefs.h>
#include <sys/ipc.h>
#include <sys/_types.h>

#define SHM_RDONLY  010000  /* Attach read-only (else read-write) */
#define SHM_RND     020000  /* Round attach address to SHMLBA */
#define SHMLBA      PAGE_SIZE /* Segment low boundary address multiple */

/* "official" access mode definitions; somewhat braindead since you have
   to specify (SHM_* >> 3) for group and (SHM_* >> 6) for world permissions */
#define SHM_R       (IPC_R)
#define SHM_W       (IPC_W)

/* predefine tbd *LOCK shmctl commands */
#define	SHM_LOCK	11
#define	SHM_UNLOCK	12

/* ipcs shmctl commands for Linux compatability */
#define	SHM_STAT	13
#define	SHM_INFO	14

#ifndef _PID_T_DECLARED
typedef	__pid_t		pid_t;
#define	_PID_T_DECLARED
#endif

#ifndef _TIME_T_DECLARED
typedef	__time_t	time_t;
#define	_TIME_T_DECLARED
#endif

#ifndef _SIZE_T_DECLARED
typedef	__size_t	size_t;
#define	_SIZE_T_DECLARED
#endif

#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \
    defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7)
struct shmid_ds_old {
	struct ipc_perm_old shm_perm;	/* operation permission structure */
	int             shm_segsz;	/* size of segment in bytes */
	pid_t           shm_lpid;   /* process ID of last shared memory op */
	pid_t           shm_cpid;	/* process ID of creator */
	short		shm_nattch;	/* number of current attaches */
	time_t          shm_atime;	/* time of last shmat() */
	time_t          shm_dtime;	/* time of last shmdt() */
	time_t          shm_ctime;	/* time of last change by shmctl() */
	void           *shm_internal;   /* sysv stupidity */
};
#endif

struct shmid_ds {
	struct ipc_perm shm_perm;	/* operation permission structure */
	size_t          shm_segsz;	/* size of segment in bytes */
	pid_t           shm_lpid;   /* process ID of last shared memory op */
	pid_t           shm_cpid;	/* process ID of creator */
	int		shm_nattch;	/* number of current attaches */
	time_t          shm_atime;	/* time of last shmat() */
	time_t          shm_dtime;	/* time of last shmdt() */
	time_t          shm_ctime;	/* time of last change by shmctl() */
};

#ifdef _KERNEL
#include <vm/vm.h>

/*
 * System 5 style catch-all structure for shared memory constants that
 * might be of interest to user programs.  Do we really want/need this?
 */
struct shminfo {
	u_long	shmmax;		/* max shared memory segment size (bytes) */
	u_long	shmmin;		/* max shared memory segment size (bytes) */
	u_long	shmmni;		/* max number of shared memory identifiers */
	u_long	shmseg;		/* max shared memory segments per process */
	u_long	shmall;		/* max amount of shared memory (pages) */
};

/*
 * Add a kernel wrapper to the shmid_ds struct so that private info (like the
 * MAC label) can be added to it, without changing the user interface.
 */
struct shmid_kernel {
	struct shmid_ds u;
	vm_object_t object;
	struct label *label;	/* MAC label */
	struct ucred *cred;	/* creator's credendials */
};

extern struct shminfo	shminfo;

struct shm_info {
	int used_ids;
	unsigned long shm_tot;
	unsigned long shm_rss;
	unsigned long shm_swp;
	unsigned long swap_attempts;
	unsigned long swap_successes;
};

struct thread;
struct proc;
struct vmspace;

void	shmexit(struct vmspace *);
void	shmfork(struct proc *, struct proc *);
#else /* !_KERNEL */

#include <sys/cdefs.h>

#ifndef _SIZE_T_DECLARED
typedef __size_t        size_t;
#define _SIZE_T_DECLARED
#endif

__BEGIN_DECLS
#ifdef __BSD_VISIBLE
int shmsys(int, ...);
#endif
void *shmat(int, const void *, int);
int shmget(key_t, size_t, int);
int shmctl(int, int, struct shmid_ds *);
int shmdt(const void *);
__END_DECLS

#endif /* !_KERNEL */

#endif /* !_SYS_SHM_H_ */


text:
package org.gradle.internal.nativeintegration.console;

public enum FallbackConsoleMetaData implements ConsoleMetaData {
    ATTACHED(true),
    NOT_ATTACHED(false);

    private final boolean attached;

    FallbackConsoleMetaData(boolean attached) {
        this.attached = attached;
    }

    @Override
    public boolean isStdOut() {
        return attached;
    }

    @Override
    public boolean isStdErr() {
        return attached;
    }

    @Override
    public int getCols() {
        return 0;
    }

    @Override
    public int getRows() {
        return 0;
    }

    @Override
    public boolean isWrapStreams() {
        return attached;
    }
}


text:
var arrayMenores;

$(document).ready(function(){

    arrayMenores=new Array();
    // Primer menor. Podría estar ya en el index
    // load obsoleto??
    $("#Menor1").load("http://localhost:80/Practica3/EjercicioDosVCompleta/servidor/menor.html");

    $("#finInscripcion").click(function() {
        if (validarTutor() == true && validarMenor() == true)
            // Relacionar y enviar al servidor para que guarde
            guardar();
    });

    $("#addMenor").click(function() {
        if (validarMenor() == true) {
            switch(arrayMenores.length)
            {
                case 1:
                    $("#Menor2").load("http://localhost:80/Practica3/EjercicioDosVCompleta/servidor/menor.html");
                    finicializarMenor();
                    break;

                case 2:
                    $("#Menor3").load("http://localhost:80/Practica3/EjercicioDosVCompleta/servidor/menor.html");
                    finicializarMenor();
                    break;

                default:
                    alert("Máximo tres niños");
                    // Deshabilitar botón
            }
        }
    });

});

// Variables globales para tutor
var tutor;
var dniTutor;
var nombre;
var ape1;
var ape2;

function validarTutor() {
        dniTutor = $("#dniTutor").val();
        nombre =$("#nombreTutor").val();
        ape1=$("#ape1Tutor").val();
        ape2= $("#ape2Tutor").val();

        crearObjetoTutor();
        alert("Tutor correcto y objeto creado " + tutor.nombre);
        return true;
}

function guardar() {
    // Los objetos están creados, sólo falta unirlos
    tutor.addMenores(arrayMenores);
    // Envio al servidor
    alert("Envio");
    var objeto = JSON.stringify(tutor);

    $.ajax({
       url : 'http://localhost:80/Practica3',data : objeto, type : 'POST', dataType : 'JSON',
        success : function (mensaje) {

        },

        error : function (xhr, status) {

        },

        complete : function (xhr, status) {

        }
    });

    $.ajax({
        // la URL para la petición
        url : 'http://localhost:80/Practica3/EjercicioDosVCompleta/servidor/insertar.php',
        // la información a enviar
        data : objeto,
        // especifica si será una petición POST o GET
        type : 'POST',
        // el tipo de información que se espera de respuesta
        dataType : 'JSON',

        // código a ejecutar si la petición es satisfactoria;
        // la respuesta es pasada como argumento a la función
        success : function(mensajeRecibido) {
            alert(mensajeRecibido);
        },

        // código a ejecutar si la petición falla;
        // son pasados como argumentos a la función el objeto de la petición y código de estatus de la petición
        error : function(xhr, status) {
            alert('Disculpe, existió un problema' + xhr + " " + status);
        },

        // código a ejecutar sin importar si la petición falló o no
        complete : function(xhr, status) {
            alert('Petición realizada');
        }
    });

}

function crearObjetoTutor(){
    tutor = new Tutor(dniTutor,nombre,ape1,ape2);
}

// Variables globales para menor
var dniMenor;
var nombreMenor;
var ape1Menor;
var ape2Menor;
var municipio;
var localidad;
var direccion;
var sexo;
var fechaNacimiento;
var codigoPostal;
var aTelefonos=new Array();
var centroEducativo;
var discapacidad;

function validarMenor() {

        dniMenor=$(".menor:last [name=dniMenor]").val();
        // C/ o numeros está mal según la expresión. Debería utilizar otra er
        var arrayCadenas =  $(".menor:last .textoMenor");
        nombreMenor =  arrayCadenas[0].value;
        alert("Valido los datos del menor: " + nombreMenor);
        ape1Menor = arrayCadenas[1].value;
        ape2Menor = arrayCadenas[2].value;
        municipio = arrayCadenas[3].value;
        localidad = arrayCadenas[4].value;
        direccion = arrayCadenas[5].value;

        // Un radio Masculino o Femenino ya está marcado por defecto
        sexo=$('.menor:last input:radio[name=sexo]:checked').val();

        fechaNacimiento = $(".menor:last [type=date]:first").val();
        codigoPostal = $(".menor:last [name=cp]").val();

       // Me falta telefonos
        //centroEducativo = listaCentros[parseInt($(".menor:last [name=centro]").val())];

        discapacidad = $(".menor:last [name=discapacidad] :checked").val();

        crearObjetoMenor();
        alert("Menor correcto y objeto creado " + menor.nombre);
        return true;
}

function crearObjetoMenor(){
    menor = new Menor(dniMenor,nombreMenor,ape1Menor,ape2Menor,sexo,fechaNacimiento,direccion + localidad + municipio,aTelefonos,centroEducativo,discapacidad);
    arrayMenores[arrayMenores.length]=menor;

}

function finicializarMenor(){
    $("form:last *").val("");
}

function llenarCentros(numero){
   // Quitar lo que puede haber
    $(".menor:last select option").remove();

    $.getJSON( "http://localhost:80/Practica3/EjercicioDosVCompleta/servidor/CargarDatos.php", function( data ) {
        alert("hola");
        alert((data[0].nombre).toString());
        for(var x = 0; x < data.length; x++){
            $(".menor:last select").append( "<option>" + data[x].nombre + " </option>");
        }
        /*$.each( data, function( key, val ) {
            //alert(key + " " + val);
            //var objeto = JSON.parse(val);
            $(".menor:last select").append( "<option value='" + key + "'>" + val + " </option>");
            //JSON.parse Me falla
        });*/
    });
}


text:
@echo off
setlocal

REM Unless required by applicable law or agreed to in writing, software
REM distributed under the License is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM See the License for the specific language governing permissions and
REM limitations under the License.
REM
REM Copyright 2011 Selventa, Inc. All rights reserved.

call "%~dp0\setenv.cmd"
cd "%BELFRAMEWORK_HOME%\server\tomcat\bin"

if not defined TOMCAT_HTTP_PORT (
    set TOMCAT_HTTP_PORT=8080
)
set JAVA_OPTS=%JAVA_OPTS% -Dtomcat.http.port=%TOMCAT_HTTP_PORT%

call catalina.bat start
if %ERRORLEVEL% GEQ 1 (
    echo Unable to start server.
) else (
    set BASE_URL="http://localhost:%TOMCAT_HTTP_PORT%"
    echo BEL Server successfully started. Default url is %BASE_URL%/
    echo     WebAPI is available. Default url is %BASE_URL%/openbel-ws/
    echo     WebAPI WSDL is available. Default url is %BASE_URL%/openbel-ws/belframework.wsdl
)

goto END

:END
endlocal


text:
/*

    Name:       Base16 Atelier Seaside Dark
    Author:     Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/seaside/)

    CodeMirror template by Jan T. Sott (https://github.com/idleberg)
    Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16)

*/

.cm-s-base16-atelierseaside-dark.CodeMirror {background: #131513; color: #cfe8cf;}
.cm-s-base16-atelierseaside-dark div.CodeMirror-selected {background: #242924 !important;}
.cm-s-base16-atelierseaside-dark .CodeMirror-gutters {background: #131513; border-right: 0px;}
.cm-s-base16-atelierseaside-dark .CodeMirror-linenumber {color: #687d68;}
.cm-s-base16-atelierseaside-dark .CodeMirror-cursor {border-left: 1px solid #809980 !important;}

.cm-s-base16-atelierseaside-dark span.cm-comment {color: #e619c3;}
.cm-s-base16-atelierseaside-dark span.cm-atom {color: #ad2bee;}
.cm-s-base16-atelierseaside-dark span.cm-number {color: #ad2bee;}

.cm-s-base16-atelierseaside-dark span.cm-property, .cm-s-base16-atelierseaside-dark span.cm-attribute {color: #29a329;}
.cm-s-base16-atelierseaside-dark span.cm-keyword {color: #e6193c;}
.cm-s-base16-atelierseaside-dark span.cm-string {color: #98981b;}

.cm-s-base16-atelierseaside-dark span.cm-variable {color: #29a329;}
.cm-s-base16-atelierseaside-dark span.cm-variable-2 {color: #3d62f5;}
.cm-s-base16-atelierseaside-dark span.cm-def {color: #87711d;}
.cm-s-base16-atelierseaside-dark span.cm-error {background: #e6193c; color: #809980;}
.cm-s-base16-atelierseaside-dark span.cm-bracket {color: #cfe8cf;}
.cm-s-base16-atelierseaside-dark span.cm-tag {color: #e6193c;}
.cm-s-base16-atelierseaside-dark span.cm-link {color: #ad2bee;}

.cm-s-base16-atelierseaside-dark .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;}


text:
class Employer < User
	has_many :jobs, foreign_key: 'user_id'
end


text:
<readable><title>3547313700_39368b9a2f</title><content>
Two dogs are facing each other on the grass beside a wooden fence .
Two dogs play in grass .
two dogs play together .
Two puppies playfully nip and chase each other .
Two tan dogs , one larger than the other , interact in a grassy yard enclosed by a wooded fence .
</content></readable>


text:
=======
Credits
=======

Development Lead
----------------

* Ramiro Gómez <code@ramiro.org>

Contributors
------------

None yet. Why not be the first?


text:
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'ruby-jmeter'

test do
  threads 1 do

    # populate ${testdata} array with *all* results from shared data url
    # using default match number -1
    test_data :postcodes

    # testdata now populated with:
    #testdata_1=NSW
    #testdata_1_g=1
    #testdata_1_g0="NSW"
    #testdata_1_g1=NSW
    #testdata_2=nsw-sydney-2000
    #testdata_2_g=1
    #testdata_2_g0="nsw-sydney-2000"
    #testdata_2_g1=nsw-sydney-2000
    #testdata_matchNr=2

    # visit first column match
    visit 'http://example.com/?${testdata_1}'

    # visit second column match
    visit 'http://example.com/?${testdata_2}'

    # populate named ${postcodes} array  with all results from shared data url
    # using specific key, command and host
    test_data key: 'postcodes',
      command: 'SRANDMEMBER',
      host: '54.252.206.143'

    # populate named ${postcode_random} from shared data url
    # using random result, match number 0 and override name
    test_data :postcodes,
      name: 'postcode_random',
      match_num: 0

    # populate named ${postcode} from shared data url
    # using exact result, match number 1 and override name
    test_data 'postcodes',
      name: 'postcode_exact',
      regex: '^(\d+)',
      match_num: 1

    # populate named ${postcode} from a stubbed data url
    # with stub = true and default value 2010
    test_data 'postcodes',
      name: 'postcode_stub',
      regex: '^(\d+)',
      match_num: 1,
      default: '2010',
      stub: true

    debug_sampler
    view_results
  end
end.run(path: '/usr/share/jmeter/bin/', gui: true)


text:
package org.javaee7.jta.exceptions;

public class BadPetDataRuntimeException extends RuntimeException {

	private static final long serialVersionUID = 1L;

}


text:
import { define } from 'skatejs';

import { Tooltip } from './Tooltip';

// export for public access to Skate Class
export { Tooltip } from './Tooltip';

// register WebComponent by our name
define( Tooltip );


text:
import {Component, View, OnInit, CORE_DIRECTIVES, Input} from 'angular2/angular2';
import {UserStatService, userStatsServiceInjectables as _serviceInjectables} from './user-stat-service';
import {Filter} from './time-range-filter';

@Component({
    selector: 'user-stats'
})
@View({
    directives: [CORE_DIRECTIVES],
    template: `

            {{user.user.name}}
            {{user.stats.created}}
            {{user.stats.declined}}

    `
})
export class UserStats implements OnInit {
  @Input() filter: Filter;
  data: Array<UserStat>;
  database: Array<UserStat>;

  constructor(private userStatsService: UserStatService){
  }

  onInit(): void{
    this.data = this.database = this.userStatsService.getStats();
    this.filter.toRx().subscribe((newFilter) => {
      console.log('filter by:', newFilter.username);
      this.data = this.database.filter((user) => {
        return user.user.name.indexOf(newFilter.username) !== -1;
      });
    });
  }
}

export var userStatsInjectables = _serviceInjectables;


text:
#import "IGListDataSourceChangeTransaction.h"

@implementation IGListDataSourceChangeTransaction {
    // Given
    IGListDataSourceChangeBlock _block;
    NSArray<IGListItemUpdateBlock> *_itemUpdateBlocks;
    NSArray<IGListUpdatingCompletion> *_completionBlocks;

    // Internal
    NSMutableArray<IGListUpdatingCompletion> *_inUpdateCompletionBlocks;
    IGListBatchUpdateState _state;
}

- (instancetype)initWithChangeBlock:(IGListDataSourceChangeBlock)block
                   itemUpdateBlocks:(NSArray<IGListItemUpdateBlock> *)itemUpdateBlocks
                   completionBlocks:(NSArray<IGListUpdatingCompletion> *)completionBlocks {
    if (self = [super init]) {
        _block = block;
        _itemUpdateBlocks = itemUpdateBlocks;
        _completionBlocks = completionBlocks;
    }
    return self;
}

- (IGListBatchUpdateState)state {
    return _state;
}

#pragma mark - Update

- (void)begin {
    // Item updates must not send mutations to the collection view while we are reloading
    _state = IGListBatchUpdateStateExecutingBatchUpdateBlock;

    // Execute all stored item update blocks even if all cells will get reloaded. the actual collection view
    // mutations will be discarded, but clients are encouraged to put their actual /data/ mutations inside the
    // update block as well, so if we don't execute the block the changes will never happen
    for (IGListItemUpdateBlock itemUpdateBlock in _itemUpdateBlocks) {
        itemUpdateBlock();
    }

    _state = IGListBatchUpdateStateExecutedBatchUpdateBlock;

    // Apply dataSource change
    if (_block) {
        _block();
    }

    for (IGListUpdatingCompletion completion in _completionBlocks) {
        completion(YES);
    }

    // Execute any completion blocks from item updates. Added after item blocks are executed in order to capture any
    // re-entrant updates.
    NSArray *inUpdateCompletionBlocks = [_inUpdateCompletionBlocks copy];
    for (IGListUpdatingCompletion completion in inUpdateCompletionBlocks) {
        completion(YES);
    }

    _state = IGListBatchUpdateStateIdle;
}

#pragma mark - Cancel

- (BOOL)cancel {
    // This transaction is synchronous
    return NO;
}

#pragma mark - Item updates

- (void)insertItemsAtIndexPaths:(NSArray <NSIndexPath *> *)indexPaths {
    // no-op because changing the UICollectionView's dataSource invalidates section/item counts
}

- (void)deleteItemsAtIndexPaths:(NSArray <NSIndexPath *> *)indexPaths {
    // no-op because changing the UICollectionView's dataSource invalidates section/item counts
}

- (void)moveItemFromIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
    // no-op because changing the UICollectionView's dataSource invalidates section/item counts
}

- (void)reloadItemFromIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
    // no-op because changing the UICollectionView's dataSource invalidates section/item counts
}

- (void)reloadSections:(NSIndexSet *)sections {
    // no-op because changing the UICollectionView's dataSource invalidates section/item counts
}

- (void)addCompletionBlock:(IGListUpdatingCompletion)completion {
    if (!_inUpdateCompletionBlocks) {
        _inUpdateCompletionBlocks = [NSMutableArray new];
    }
    [_inUpdateCompletionBlocks addObject:completion];
}

@end


text:
<?php

namespace ArhivaRevisteVechi\lib;
require_once HELPERS . "/h_misc.php";
require_once HELPERS . "/HtmlPrinter.php";

use ArhivaRevisteVechi\lib\helpers\HtmlPrinter;

class Pagina
{
    const NORMAL_THUMB = "minithumb";
    const MICRO_THUMB  = "microthumb";

    const THUMB = 0;
    const IMAGE = 1;

    public $editiaParinte;
    public $numar;

    public $paginaBaseName;

    public $path;
    public $thumbPath;

    public function __construct(Editie $editie, $numar = 1)
    {
        $this->editiaParinte  = $editie;
        $this->numar          = $numar;

        $this->paginaBaseName = $this->buildPaginaBaseName();
        $this->path           = $this->makePath();
        $this->thumbPath      = $this->makePath(true);
    }

    /**
     * Construieste numele imaginii fara extensie
     * (ex: 'Level 1999 12 002' fara spatii)
     */
    private function buildPaginaBaseName()
    {
        return $this->editiaParinte->editieBaseNameForPages
        . padLeft($this->numar, PAGINA_PAD);
    }

    /**
     * Construieste calea catre o imagine sau thumbnail:
     * ex. $isForThumb == false: img/level/1999/12/Level199912002.jpg
     * ex. $isForThumb == true: img/level/1999/12/th/Level199912002_th.jpg
     *
     * Daca nu exista, returneaza imaginea default.
     */
    public function makePath($isForThumb = false)
    {
        $imagePath = $this->editiaParinte->editieDirPath
            . DIRECTORY_SEPARATOR
            . ($isForThumb ? "th" . DIRECTORY_SEPARATOR : "")
            . $this->paginaBaseName
            . ($isForThumb ? "_th" : "")
            . ".jpg";
        return $imagePath;
    }

    public function getLinkToPaginaDirArticol($articolId)
    {
        return $this->editiaParinte->getEditieUrl() . "&articol=$articolId" . "&pagina=$this->numar";
    }

    public function getMicroThumbWithLinkToPaginaDinArticol($articolId)
    {
        $destinationLink = $this->getLinkToPaginaDirArticol($articolId);
        return $this->getImageWithLink(self::THUMB, $this->thumbPath, $destinationLink, "microthumb");
    }

    public function getMicroThumbWithLinkToFull()
    {
        return $this->getImageWithLink(self::THUMB, $this->thumbPath, $this->path, "microthumb");
    }

    public function getThumbWithLinkToFullImage()
    {
        $firstPageMarginClass = ($this->numar == 1) ? "first-page" : "";
        return $this->getImageWithLink(self::THUMB, $this->thumbPath, $this->path, "minithumb $firstPageMarginClass");
    }

    public function getThumbWithLinkToEditie($cssClass)
    {
        $destinationLink = $this->editiaParinte->getEditieUrl();
        return $this->getImageWithLink(self::THUMB, $this->thumbPath, $destinationLink, $cssClass, true);
    }

    public function getHugeThumbWithLinkToFullImage()
    {
        return $this->getImageWithLink(self::IMAGE, $this->path, $this->path, "fullthumb");
    }

    // TODO implement alt description
    /**
     * Primeste calea catre o imagine si un link de destinatie si afiseaza
     * respectiva imagines cu link catre destinatia specificata, atasand
     * si clasele css specificate optional
     *
     * Daca fisierul nu exista (imaginea primita este cea default),
     * va fi afisata imaginea default fara link, cu exceptia cazului in
     * care e specificat explicit (forceLink), util in cazul editiilor
     * care nu au imagini scanate, dar au cuprins
     */
    function getImageWithLink($imgType, $displayedImagePath, $targetLink, $cssClasses, $forceLink = false)
    {
        $htmlClassList = getCssClassList($cssClasses);

        $imageExists = file_exists($displayedImagePath);

        // daca imaginea nu exista, afiseaza imaginea default
        if (!$imageExists) {
            $displayedImagePath = ($imgType == self::THUMB ? THUMB_DEFAULT : COPERTA_DEFAULT);
        }

        $displayedElement = HtmlPrinter::wrapImg($displayedImagePath, $htmlClassList, 'Image');

        if (!$imageExists && !$forceLink)
            return $displayedElement;

        return HtmlPrinter::wrapLink($displayedElement, $targetLink) . PHP_EOL;
    }

//    static function fromPath($editie, $path)
//    {
//        $attrs = array(
//            "isFromPath" => true,
//            "path"       => $path
//        );
//        return new Pagina($editie, true, $path);
//    }
//
//    static function fromName($editie, $numar)
//    {
//        $attrs = array(
//            "numar_pg"  => $numar
//        );
//        return new Pagina($editie, false, $attrs);
//    }

}


text:
@protocol LJTapDetectingImageViewDelegate;

@interface LJTapDetectingImageView : FLAnimatedImageView

@property (nonatomic, weak) id <LJTapDetectingImageViewDelegate> tapDelegate;

@end

@protocol LJTapDetectingImageViewDelegate <NSObject>

@optional

- (void)imageView:(FLAnimatedImageView *)imageView singleTapDetected:(UITapGestureRecognizer *)tap;
- (void)imageView:(FLAnimatedImageView *)imageView doubleTapDetected:(UITapGestureRecognizer *)tap;
- (void)imageView:(FLAnimatedImageView *)imageView LongTapDetected:(UILongPressGestureRecognizer *)tap;

@end


text:
import gql from 'util/GraphQL';
import { loadFixtures, unloadFixtures, resetFrom } from 'util/fixtures';
import client from 'util/client';
import MockDate from 'mockdate';
import fixtures from '../__fixtures__/CreateOrUpdateReplyRequestFeedback';

describe('CreateOrUpdateReplyRequestFeedback', () => {
  beforeAll(() => loadFixtures(fixtures));

  it('creates new feedback', async () => {
    MockDate.set(1485593157011);
    const userId = 'fb-user-2';
    const appId = 'app';
    const replyRequestId = 'foo';

    const { data, errors } = await gql`
      mutation($replyRequestId: String!) {
        CreateOrUpdateReplyRequestFeedback(
          replyRequestId: $replyRequestId
          vote: UPVOTE
        ) {
          id
          feedbackCount
          positiveFeedbackCount
          negativeFeedbackCount
          ownVote
        }
      }
    `(
      {
        replyRequestId,
      },
      { userId, appId }
    );
    MockDate.reset();

    expect(errors).toBeUndefined();
    expect(data).toMatchSnapshot();

    const { body: replyrequest } = await client.get({
      index: 'replyrequests',
      type: 'doc',
      id: replyRequestId,
    });
    expect(replyrequest._source).toMatchSnapshot();

    // Cleanup
    await resetFrom(fixtures, '/replyrequests/doc/foo');
  });

  it('updates existing feedback', async () => {
    MockDate.set(1485593157011);
    const userId = 'fb-user-1';
    const appId = 'app';
    const replyRequestId = 'foo';

    const { data, errors } = await gql`
      mutation($replyRequestId: String!) {
        CreateOrUpdateReplyRequestFeedback(
          replyRequestId: $replyRequestId
          vote: DOWNVOTE
        ) {
          id
          feedbackCount
          positiveFeedbackCount
          negativeFeedbackCount
          ownVote
        }
      }
    `(
      {
        replyRequestId,
      },
      { userId, appId }
    );
    MockDate.reset();

    expect(errors).toBeUndefined();
    expect(data).toMatchSnapshot();

    const { body: replyrequest } = await client.get({
      index: 'replyrequests',
      type: 'doc',
      id: replyRequestId,
    });
    expect(replyrequest._source).toMatchSnapshot();

    // Cleanup
    await resetFrom(fixtures, '/replyrequests/doc/foo');
  });

  afterAll(() => unloadFixtures(fixtures));
});


text:
using NLog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;

namespace Web.Controllers
{
    public class ApiControllerBase : ApiController
    {
        protected static ILogger logger = LogManager.GetCurrentClassLogger();

    }
}


text:
/*
    Module dependencies
*/

var express = require('express'),       // the main ssjs framework
    path = require('path'),             // for path manipulation
    mongoose = require('mongoose'),
    app = express();                    // create an express app

var db = require('./db');
var routes = require('./routes');       // by default, brings in routes/index.js

/*
    Configure environments
*/

app.configure(function(){
    app.set('port', process.env.PORT || 3000);
    app.use(express.bodyParser());
    app.use(express.methodOverride());
    app.use(app.router);
    app.use(express.static(path.join(__dirname, 'public')));
    app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
});

// Add headers
app.use(function (req, res, next) {
    // Website you wish to allow to connect
    res.setHeader('Access-Control-Allow-Origin', 'http://localhost:8888');
    // Request methods you wish to allow
    res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');
    // Request headers you wish to allow
    res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,content-type');
    // Set to true if you need the website to include cookies in the requests sent
    // to the API (e.g. in case you use sessions)
    res.setHeader('Access-Control-Allow-Credentials', true);
    // Pass to next layer of middleware
    next();
});

// development only
if ('development' == app.get('env')) {
    app.use(express.errorHandler());
}

/*
    URL routes
*/

app.get('/', function(req, res) {
    res.sendfile('index.html');
});
app.get('/addBathroom', function(req, res) {
    res.sendfile('addBathroom.html');
}); // Page to add new bathrooms

app.get('/get/bathrooms/', routes.getAll); // get all bathrooms
app.post('/add/bathroom', routes.addBathroom); // add a new bathroom
app.get('/b/:id', routes.getBathroom); // get details about a bathroom

app.post('/add/review/:bid', routes.addReview); // post a new review at a post
app.get('/get/reviews/:bid', routes.getReviews); // get reviews for a bathroom

app.listen(app.get('port'));
console.log('Express server listening on port ' + app.get('port'));


text:
import {DocumentActionPopoverDialogProps} from '@sanity/base'
import {Popover, useClickOutside, useGlobalKeyDown, useLayer} from '@sanity/ui'
import React, {useCallback, useState} from 'react'
import {POPOVER_FALLBACK_PLACEMENTS} from './constants'

export function PopoverDialog(props: {
  dialog: DocumentActionPopoverDialogProps
  referenceElement: HTMLElement | null
}) {
  const {dialog, referenceElement} = props

  return (
    <Popover
      content={<PopoverDialogContent dialog={dialog} />}
      fallbackPlacements={POPOVER_FALLBACK_PLACEMENTS}
      open
      placement="top"
      portal
      preventOverflow
      referenceElement={referenceElement}
    />
  )
}

function PopoverDialogContent(props: {dialog: DocumentActionPopoverDialogProps}) {
  const {dialog} = props
  const {content, onClose} = dialog
  const {isTopLayer} = useLayer()
  const [element, setElement] = useState<HTMLElement | null>(null)

  const handleClickOutside = useCallback(() => {
    if (isTopLayer) onClose()
  }, [isTopLayer, onClose])

  const handleGlobalKeyDown = useCallback(
    (event) => {
      if (event.key === 'Escape' && isTopLayer) onClose()
    },
    [isTopLayer, onClose]
  )

  useClickOutside(handleClickOutside, [element])
  useGlobalKeyDown(handleGlobalKeyDown)

  return
{content}

}


text:
@import url(font-awesome.min.css);
@import url("https://fonts.googleapis.com/css?family=Roboto:400,700");
/*
	Lens by HTML5 UP
	html5up.net | @ajlkn
	Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
*/
/* Reset */
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline; }

article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
  display: block; }

body {
  line-height: 1; }

ol, ul {
  list-style: none; }

blockquote, q {
  quotes: none; }

blockquote:before, blockquote:after, q:before, q:after {
  content: '';
  content: none; }

table {
  border-collapse: collapse;
  border-spacing: 0; }

body {
  -webkit-text-size-adjust: none; }

/* Box Model */
*, *:before, *:after {
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box; }

/* Basic */
/*
	@-ms-viewport {
		width: device-width;
	}
*/
@media screen and (max-width: 480px) {
  html, body {
    min-width: 320px; } }
body.is-loading-0 *, body.is-loading-0 *:before, body.is-loading-0 *:after {
  -moz-animation: none !important;
  -webkit-animation: none !important;
  -ms-animation: none !important;
  animation: none !important;
  -moz-transition: none !important;
  -webkit-transition: none !important;
  -ms-transition: none !important;
  transition: none !important; }

html, body {
  background-color: #101010;
  overflow: hidden; }

/* Type */
html {
  font-size: 16pt; }
  @media screen and (max-width: 1680px) {
    html {
      font-size: 12pt; } }
  @media screen and (max-width: 1280px) {
    html {
      font-size: 11pt; } }

body {
  background-color: #fff;
  color: #aaa; }

body, input, select, textarea {
  font-family: "Roboto", Helvetica, sans-serif;
  font-weight: 400;
  line-height: 1.65;
  font-size: 1em;
  color: #aaa; }

a {
  -moz-transition: color 0.25s ease, border-bottom-color 0.25s ease;
  -webkit-transition: color 0.25s ease, border-bottom-color 0.25s ease;
  -ms-transition: color 0.25s ease, border-bottom-color 0.25s ease;
  transition: color 0.25s ease, border-bottom-color 0.25s ease;
  border-bottom: dotted 1px;
  color: inherit;
  text-decoration: none; }
  a:hover {
    border-bottom-color: transparent;
    color: #00D3B7; }

strong, b {
  font-weight: 400;
  color: #555; }

em, i {
  font-style: italic; }

p {
  margin: 0 0 1.25em 0; }

h1, h2, h3, h4, h5, h6 {
  font-weight: 400;
  line-height: 1.25;
  margin: 0 0 0.5em 0;
  color: #555; }
  h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
    color: inherit;
    text-decoration: none; }

h2 {
  font-size: 1.25em; }

h3 {
  font-size: 1em; }

h4 {
  font-size: 0.9em; }

h5 {
  font-size: 0.8em; }

h6 {
  font-size: 0.7em; }

sub {
  font-size: 0.8em;
  position: relative;
  top: 0.5em; }

sup {
  font-size: 0.8em;
  position: relative;
  top: -0.5em; }

blockquote {
  border-left: solid 4px #ccc;
  font-style: italic;
  margin: 0 0 1.25em 0;
  padding: 0.3125em 0 0.3125em 1.25em; }

code {
  border-radius: 4px;
  border: solid 1px;
  font-family: "Courier New", monospace;
  font-size: 0.9em;
  margin: 0 0.25em;
  padding: 0.25em 0.65em;
  border-color: #ccc; }

pre {
  -webkit-overflow-scrolling: touch;
  font-family: "Courier New", monospace;
  font-size: 0.9em;
  margin: 0 0 1.25em 0; }
  pre code {
    display: block;
    padding: 1em 1.5em;
    overflow-x: auto; }

hr {
  border: 0;
  border-bottom: solid 1px #ccc;
  margin: 1.25em 0; }
  hr.major {
    margin: 1.875em 0; }

.align-left {
  text-align: left; }

.align-center {
  text-align: center; }

.align-right {
  text-align: right; }

/* Button */
input[type="submit"],
input[type="reset"],
input[type="button"],
button,
.button {
  -moz-appearance: none;
  -webkit-appearance: none;
  -ms-appearance: none;
  appearance: none;
  -moz-transition: background-color 0.25s ease-in-out, border-color 0.25s ease-in-out, color 0.25s ease-in-out;
  -webkit-transition: background-color 0.25s ease-in-out, border-color 0.25s ease-in-out, color 0.25s ease-in-out;
  -ms-transition: background-color 0.25s ease-in-out, border-color 0.25s ease-in-out, color 0.25s ease-in-out;
  transition: background-color 0.25s ease-in-out, border-color 0.25s ease-in-out, color 0.25s ease-in-out;
  background-color: transparent;
  border-radius: 4px;
  border: solid 1px #ccc;
  color: #555;
  cursor: pointer;
  display: inline-block;
  line-height: 1;
  padding: 0.75em 1.5em;
  text-align: center;
  text-decoration: none;
  white-space: nowrap; }
  input[type="submit"]:hover,
  input[type="reset"]:hover,
  input[type="button"]:hover,
  button:hover,
  .button:hover {
    border-color: #00D3B7;
    color: #00D3B7; }
    input[type="submit"]:hover:active,
    input[type="reset"]:hover:active,
    input[type="button"]:hover:active,
    button:hover:active,
    .button:hover:active {
      background-color: rgba(0, 211, 183, 0.15); }
  input[type="submit"].icon,
  input[type="reset"].icon,
  input[type="button"].icon,
  button.icon,
  .button.icon {
    padding-left: 1.35em; }
    input[type="submit"].icon:before,
    input[type="reset"].icon:before,
    input[type="button"].icon:before,
    button.icon:before,
    .button.icon:before {
      margin-right: 0.5em; }
  input[type="submit"].fit,
  input[type="reset"].fit,
  input[type="button"].fit,
  button.fit,
  .button.fit {
    display: block;
    margin: 0 0 0.625em 0;
    width: 100%; }
  input[type="submit"].small,
  input[type="reset"].small,
  input[type="button"].small,
  button.small,
  .button.small {
    font-size: 0.8em; }
  input[type="submit"].big,
  input[type="reset"].big,
  input[type="button"].big,
  button.big,
  .button.big {
    font-size: 1.35em; }
  input[type="submit"].disabled, input[type="submit"]:disabled,
  input[type="reset"].disabled,
  input[type="reset"]:disabled,
  input[type="button"].disabled,
  input[type="button"]:disabled,
  button.disabled,
  button:disabled,
  .button.disabled,
  .button:disabled {
    -moz-pointer-events: none;
    -webkit-pointer-events: none;
    -ms-pointer-events: none;
    pointer-events: none;
    opacity: 0.25; }

/* Form */
form {
  margin: 0 0 1.25em 0; }

label {
  color: #555;
  display: block;
  font-size: 0.9em;
  font-weight: 400;
  margin: 0 0 0.625em 0; }

input[type="text"],
input[type="password"],
input[type="email"],
select,
textarea {
  -moz-appearance: none;
  -webkit-appearance: none;
  -ms-appearance: none;
  appearance: none;
  background-color: transparent;
  border-radius: 4px;
  border: solid 1px #ccc;
  color: inherit;
  display: block;
  outline: 0;
  padding: 0 0.75em;
  text-decoration: none;
  width: 100%; }
  input[type="text"]:invalid,
  input[type="password"]:invalid,
  input[type="email"]:invalid,
  select:invalid,
  textarea:invalid {
    box-shadow: none; }
  input[type="text"]:focus,
  input[type="password"]:focus,
  input[type="email"]:focus,
  select:focus,
  textarea:focus {
    border-color: #00D3B7; }

.select-wrapper {
  text-decoration: none;
  display: block;
  position: relative; }
  .select-wrapper:before {
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
    font-family: FontAwesome;
    font-style: normal;
    font-weight: normal;
    text-transform: none !important; }
  .select-wrapper:before {
    color: #ccc;
    content: '\f107';
    display: block;
    height: 2.75em;
    line-height: 2.75em;
    pointer-events: none;
    position: absolute;
    right: 0;
    text-align: center;
    top: 0;
    width: 2.75em; }
  .select-wrapper select::-ms-expand {
    display: none; }

input[type="text"],
input[type="password"],
input[type="email"],
select {
  height: 2.75em; }

textarea {
  padding: 0.75em 1em; }

input[type="checkbox"],
input[type="radio"] {
  -moz-appearance: none;
  -webkit-appearance: none;
  -ms-appearance: none;
  appearance: none;
  display: block;
  float: left;
  margin-right: -2em;
  opacity: 0;
  width: 1em;
  z-index: -1; }
  input[type="checkbox"] + label,
  input[type="radio"] + label {
    text-decoration: none;
    color: #aaa;
    cursor: pointer;
    display: inline-block;
    font-size: 1em;
    font-weight: 400;
    margin: 0;
    padding-left: 2.4em;
    padding-right: 0.75em;
    position: relative; }
    input[type="checkbox"] + label:before,
    input[type="radio"] + label:before {
      -moz-osx-font-smoothing: grayscale;
      -webkit-font-smoothing: antialiased;
      font-family: FontAwesome;
      font-style: normal;
      font-weight: normal;
      text-transform: none !important; }
    input[type="checkbox"] + label:before,
    input[type="radio"] + label:before {
      background: transparent;
      border-radius: 4px;
      border: solid 1px #ccc;
      content: '';
      display: inline-block;
      height: 1.65em;
      left: 0;
      line-height: 1.58125em;
      position: absolute;
      text-align: center;
      top: 0;
      width: 1.65em; }
  input[type="checkbox"]:checked + label:before,
  input[type="radio"]:checked + label:before {
    background-color: #555;
    border-color: #555;
    color: #fff;
    content: '\f00c'; }
  input[type="checkbox"]:focus + label:before,
  input[type="radio"]:focus + label:before {
    border-color: #00D3B7; }

input[type="checkbox"] + label:before {
  border-radius: 4px; }

input[type="radio"] + label:before {
  border-radius: 100%; }

::-webkit-input-placeholder {
  opacity: 1.0;
  color: #ccc !important; }

:-moz-placeholder {
  opacity: 1.0;
  color: #ccc !important; }

::-moz-placeholder {
  opacity: 1.0;
  color: #ccc !important; }

:-ms-input-placeholder {
  opacity: 1.0;
  color: #ccc !important; }

.formerize-placeholder {
  opacity: 1.0;
  color: #ccc !important; }

.field {
  margin: 0 0 1.25em 0; }

/* Icon */
.icon {
  text-decoration: none;
  border-bottom: none;
  position: relative; }
  .icon:before {
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
    font-family: FontAwesome;
    font-style: normal;
    font-weight: normal;
    text-transform: none !important; }
  .icon > .label {
    display: none; }

/* List */
ol {
  list-style: decimal;
  margin: 0 0 1.25em 0;
  padding-left: 1.25em; }
  ol li {
    padding-left: 0.25em; }

ul {
  list-style: disc;
  margin: 0 0 1.25em 0;
  padding-left: 1em; }
  ul li {
    padding-left: 0.5em; }
  ul.alt {
    list-style: none;
    padding-left: 0; }
    ul.alt li {
      border-top: solid 1px #ccc;
      padding: 0.5em 0; }
      ul.alt li:first-child {
        border-top: 0;
        padding-top: 0; }
  ul.icons {
    cursor: default;
    list-style: none;
    padding-left: 0; }
    ul.icons li {
      display: inline-block;
      padding: 0 1em 0 0; }
      ul.icons li:last-child {
        padding-right: 0; }
      ul.icons li .icon:before {
        font-size: 1.5rem; }
  ul.actions {
    cursor: default;
    list-style: none;
    padding-left: 0; }
    ul.actions li {
      display: inline-block;
      padding: 0 0.625em 0 0;
      vertical-align: middle; }
      ul.actions li:last-child {
        padding-right: 0; }
    ul.actions.small li {
      padding: 0 0.3125em 0 0; }
    ul.actions.vertical li {
      display: block;
      padding: 0.625em 0 0 0; }
      ul.actions.vertical li:first-child {
        padding-top: 0; }
      ul.actions.vertical li > * {
        margin-bottom: 0; }
    ul.actions.vertical.small li {
      padding: 0.3125em 0 0 0; }
      ul.actions.vertical.small li:first-child {
        padding-top: 0; }
    ul.actions.fit {
      display: table;
      margin-left: -0.625em;
      padding: 0;
      table-layout: fixed;
      width: calc(100% + 0.625em); }
      ul.actions.fit li {
        display: table-cell;
        padding: 0 0 0 0.625em; }
        ul.actions.fit li > * {
          margin-bottom: 0; }
      ul.actions.fit.small {
        margin-left: -0.3125em;
        width: calc(100% + 0.3125em); }
        ul.actions.fit.small li {
          padding: 0 0 0 0.3125em; }

dl {
  margin: 0 0 1.25em 0; }
  dl dt {
    display: block;
    font-weight: 400;
    margin: 0 0 0.625em 0; }
  dl dd {
    margin-left: 1.25em; }

/* Main */
#main {
  -moz-transition: opacity 0.75s ease, right 0.75s ease, left 0.75s ease, visibility 0.75s;
  -webkit-transition: opacity 0.75s ease, right 0.75s ease, left 0.75s ease, visibility 0.75s;
  -ms-transition: opacity 0.75s ease, right 0.75s ease, left 0.75s ease, visibility 0.75s;
  transition: opacity 0.75s ease, right 0.75s ease, left 0.75s ease, visibility 0.75s;
  -webkit-overflow-scrolling: touch;
  position: fixed;
  top: 0;
  width: 22.5em;
  height: 100%;
  background: #fff;
  outline: 0;
  overflow-x: hidden;
  overflow-y: auto;
  text-align: left;
  visibility: visible;
  z-index: 10000;
  left: 0; }
  #main .toggle {
    -webkit-tap-highlight-color: transparent;
    position: absolute;
    top: 0;
    width: 4em;
    height: 4em;
    background-image: url("images/close-small-alt.svg");
    background-repeat: no-repeat;
    background-size: 32px 32px;
    cursor: pointer;
    display: none;
    z-index: 1;
    background-position: calc(100% - 0.5em) 0.5em;
    right: 0; }
  body.fullscreen #main {
    visibility: hidden;
    left: -22.5em; }
  body.is-loading-1 #main {
    opacity: 0;
    left: -2em; }
  @media screen and (max-width: 1280px) {
    #main {
      width: 19em; }
      body.fullscreen #main {
        left: -19em; } }
  @media screen and (max-width: 980px) {
    #main {
      background: rgba(255, 255, 255, 0.925); }
      #main .toggle {
        display: block; } }
  @media screen and (max-width: 480px) {
    #main {
      -moz-transition: opacity 0.5s ease, visibility 0.5s;
      -webkit-transition: opacity 0.5s ease, visibility 0.5s;
      -ms-transition: opacity 0.5s ease, visibility 0.5s;
      transition: opacity 0.5s ease, visibility 0.5s;
      width: 100%;
      background: #fff;
      text-align: center; }
      body.is-loading-1 #main {
        left: auto !important;
        right: auto !important; }
      body.fullscreen #main {
        left: auto !important;
        right: auto !important;
        opacity: 0; }
      #main .toggle {
        display: none; } }

/* Header */
#header {
  padding: 3em 2.25em 1.75em 2.25em ; }
  #header h1 {
    font-size: 2.25em;
    font-weight: 700; }

/* Footer */
#footer {
  padding: 2.25em 2.25em 1em 2.25em ; }
  #footer .copyright {
    list-style: none;
    padding: 0; }
    #footer .copyright li {
      display: inline-block;
      font-size: 0.8em;
      margin-left: 0.35em;
      padding: 0; }
      #footer .copyright li:first-child {
        margin-left: 0; }

/* Thumbnails */
#thumbnails {
  display: -moz-flex;
  display: -webkit-flex;
  display: -ms-flex;
  display: flex;
  -moz-flex-wrap: wrap;
  -webkit-flex-wrap: wrap;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  padding: 0 0.75em; }
  #thumbnails article {
    position: relative;
    width: 50%;
    background: #101010;
    outline: 0; }
    #thumbnails article .thumbnail {
      -webkit-tap-highlight-color: transparent;
      display: block;
      position: relative;
      border: 0;
      outline: 0; }
      #thumbnails article .thumbnail img {
        display: block;
        width: 100%; }
      #thumbnails article .thumbnail:before {
        -moz-pointer-events: none;
        -webkit-pointer-events: none;
        -ms-pointer-events: none;
        pointer-events: none;
        -moz-transition: opacity 0.25s ease;
        -webkit-transition: opacity 0.25s ease;
        -ms-transition: opacity 0.25s ease;
        transition: opacity 0.25s ease;
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        box-shadow: inset 0 0 0 2px #00D3B7, inset 0 0 0px 3px rgba(0, 0, 0, 0.15);
        opacity: 0;
        z-index: 1; }
      #thumbnails article .thumbnail:focus:before {
        opacity: 0.5; }
    #thumbnails article h2, #thumbnails article p {
      display: none; }
    #thumbnails article.active .thumbnail:before {
      opacity: 1; }
  @media screen and (max-width: 480px) {
    #thumbnails article .thumbnail:before {
      display: none; } }

/* Viewer */
@-moz-keyframes spinner {
  0% {
    -moz-transform: rotate(0deg);
    -webkit-transform: rotate(0deg);
    -ms-transform: rotate(0deg);
    transform: rotate(0deg); }
  100% {
    -moz-transform: rotate(360deg);
    -webkit-transform: rotate(360deg);
    -ms-transform: rotate(360deg);
    transform: rotate(360deg); } }
@-webkit-keyframes spinner {
  0% {
    -moz-transform: rotate(0deg);
    -webkit-transform: rotate(0deg);
    -ms-transform: rotate(0deg);
    transform: rotate(0deg); }
  100% {
    -moz-transform: rotate(360deg);
    -webkit-transform: rotate(360deg);
    -ms-transform: rotate(360deg);
    transform: rotate(360deg); } }
@-ms-keyframes spinner {
  0% {
    -moz-transform: rotate(0deg);
    -webkit-transform: rotate(0deg);
    -ms-transform: rotate(0deg);
    transform: rotate(0deg); }
  100% {
    -moz-transform: rotate(360deg);
    -webkit-transform: rotate(360deg);
    -ms-transform: rotate(360deg);
    transform: rotate(360deg); } }
@keyframes spinner {
  0% {
    -moz-transform: rotate(0deg);
    -webkit-transform: rotate(0deg);
    -ms-transform: rotate(0deg);
    transform: rotate(0deg); }
  100% {
    -moz-transform: rotate(360deg);
    -webkit-transform: rotate(360deg);
    -ms-transform: rotate(360deg);
    transform: rotate(360deg); } }
#viewer {
  -moz-transition: opacity 0.75s ease, width 0.75s ease;
  -webkit-transition: opacity 0.75s ease, width 0.75s ease;
  -ms-transition: opacity 0.75s ease, width 0.75s ease;
  transition: opacity 0.75s ease, width 0.75s ease;
  position: absolute;
  top: 0;
  width: calc(100% - 22.5em);
  height: 100%;
  right: 0; }
  #viewer .inner {
    -moz-pointer-events: none;
    -webkit-pointer-events: none;
    -ms-pointer-events: none;
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2; }
    #viewer .inner > * {
      -moz-pointer-events: auto;
      -webkit-pointer-events: auto;
      -ms-pointer-events: auto;
      pointer-events: auto; }
    #viewer .inner:before {
      background-image: -moz-linear-gradient(left, rgba(16,16,16,0.2), rgba(16,16,16,0) 10em, rgba(16,16,16,0)), -moz-linear-gradient(right, rgba(16,16,16,0.2), rgba(16,16,16,0) 10em, rgba(16,16,16,0));
      background-image: -webkit-linear-gradient(left, rgba(16,16,16,0.2), rgba(16,16,16,0) 10em, rgba(16,16,16,0)), -webkit-linear-gradient(right, rgba(16,16,16,0.2), rgba(16,16,16,0) 10em, rgba(16,16,16,0));
      background-image: -ms-linear-gradient(left, rgba(16,16,16,0.2), rgba(16,16,16,0) 10em, rgba(16,16,16,0)), -ms-linear-gradient(right, rgba(16,16,16,0.2), rgba(16,16,16,0) 10em, rgba(16,16,16,0));
      background-image: linear-gradient(left, rgba(16,16,16,0.2), rgba(16,16,16,0) 10em, rgba(16,16,16,0)), linear-gradient(right, rgba(16,16,16,0.2), rgba(16,16,16,0) 10em, rgba(16,16,16,0));
      content: '';
      display: block;
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%; }
    #viewer .inner .toggle {
      -webkit-tap-highlight-color: transparent;
      position: absolute;
      top: 0;
      width: 4em;
      height: 4em;
      background-image: url("images/close.svg");
      background-repeat: no-repeat;
      background-size: 64px 64px;
      cursor: pointer;
      z-index: 1;
      left: 0;
      background-position: 0.75em 0.75em; }
    #viewer .inner .nav-next,
    #viewer .inner .nav-previous {
      -webkit-tap-highlight-color: transparent;
      position: absolute;
      top: 50%;
      width: 6em;
      height: 6em;
      margin-top: -3em;
      background-image: url("images/arrow.svg");
      background-position: center;
      background-repeat: no-repeat;
      background-size: contain;
      cursor: pointer; }
    #viewer .inner .nav-previous {
      -moz-transform: scaleX(-1);
      -webkit-transform: scaleX(-1);
      -ms-transform: scaleX(-1);
      transform: scaleX(-1);
      left: 0; }
    #viewer .inner .nav-next {
      right: 0; }
  #viewer .slide {
    -moz-transition: opacity 0.5s ease-in-out;
    -webkit-transition: opacity 0.5s ease-in-out;
    -ms-transition: opacity 0.5s ease-in-out;
    transition: opacity 0.5s ease-in-out;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 1;
    z-index: 1; }
    #viewer .slide .caption {
      background-image: -moz-linear-gradient(bottom, rgba(16,16,16,0.75), rgba(16,16,16,0.25) 80%, rgba(16,16,16,0));
      background-image: -webkit-linear-gradient(bottom, rgba(16,16,16,0.75), rgba(16,16,16,0.25) 80%, rgba(16,16,16,0));
      background-image: -ms-linear-gradient(bottom, rgba(16,16,16,0.75), rgba(16,16,16,0.25) 80%, rgba(16,16,16,0));
      background-image: linear-gradient(bottom, rgba(16,16,16,0.75), rgba(16,16,16,0.25) 80%, rgba(16,16,16,0));
      padding: 2em 2em 0.75em 2em ;
      position: absolute;
      bottom: 0;
      left: 0;
      width: 100%;
      color: rgba(255, 255, 255, 0.5);
      z-index: 1; }
      #viewer .slide .caption h2, #viewer .slide .caption h3, #viewer .slide .caption h4, #viewer .slide .caption h5, #viewer .slide .caption h6 {
        color: #fff; }
    #viewer .slide .image {
      -moz-transition: opacity 0.5s ease-in-out;
      -webkit-transition: opacity 0.5s ease-in-out;
      -ms-transition: opacity 0.5s ease-in-out;
      transition: opacity 0.5s ease-in-out;
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-repeat: no-repeat;
      background-size: cover;
      opacity: 0; }
    #viewer .slide:before {
      -moz-animation: spinner 1s linear infinite;
      -webkit-animation: spinner 1s linear infinite;
      -ms-animation: spinner 1s linear infinite;
      animation: spinner 1s linear infinite;
      -moz-transition: opacity 0.5s ease-in-out;
      -webkit-transition: opacity 0.5s ease-in-out;
      -ms-transition: opacity 0.5s ease-in-out;
      transition: opacity 0.5s ease-in-out;
      content: '';
      display: block;
      position: absolute;
      top: 50%;
      left: 50%;
      width: 3em;
      height: 3em;
      background-image: url("images/spinner.svg");
      background-position: center;
      background-repeat: no-repeat;
      background-size: contain;
      margin: -1.5em 0 0 -1.5em;
      opacity: 0; }
    #viewer .slide.loading:before {
      opacity: 1; }
    #viewer .slide.active .image {
      opacity: 1; }
  body.fullscreen #viewer {
    width: 100%; }
    body.fullscreen #viewer .inner .toggle {
      background-image: url("images/open.svg"); }
  body.is-loading-1 #viewer {
    opacity: 0; }
  body.is-loading-2 #viewer .slide {
    opacity: 0; }
  @media screen and (max-width: 1280px) {
    #viewer {
      width: calc(100% - 19em); } }
  @media screen and (max-width: 980px) {
    #viewer {
      width: 100%; }
      #viewer .inner .toggle {
        -moz-transition: opacity 0.75s ease;
        -webkit-transition: opacity 0.75s ease;
        -ms-transition: opacity 0.75s ease;
        transition: opacity 0.75s ease;
        background-image: url("images/open.svg");
        opacity: 0;
        left: 0; }
      body.fullscreen #viewer .inner .toggle {
        opacity: 1; } }
  @media screen and (max-width: 736px) {
    #viewer .inner .toggle {
      background-size: 32px 32px; }
    #viewer .inner .nav-next,
    #viewer .inner .nav-previous {
      background-image: url("images/arrow-small.svg");
      background-size: 32px 32px; }
    body.fullscreen #viewer .inner .toggle {
      background-image: url("images/open-small.svg"); } }
  @media screen and (max-width: 480px) {
    #viewer {
      -moz-transition: opacity 0.5s ease;
      -webkit-transition: opacity 0.5s ease;
      -ms-transition: opacity 0.5s ease;
      transition: opacity 0.5s ease;
      -moz-transition-delay: 0s;
      -webkit-transition-delay: 0s;
      -ms-transition-delay: 0s;
      transition-delay: 0s;
      opacity: 0; }
      #viewer .inner .toggle {
        background-image: url("images/close-small.svg") !important;
        background-size: 32px 32px; }
      body.fullscreen #viewer {
        -moz-transition-delay: 0.5s;
        -webkit-transition-delay: 0.5s;
        -ms-transition-delay: 0.5s;
        transition-delay: 0.5s;
        opacity: 1; } }

/*# sourceMappingURL=main.css.map */


text:
function [swt_im, ccomps, E] = swt(IM, light_on_dark)
    % TODO:
    %   * Thresholding connected components
    %   * Try both light on dark, dark on light, and pick best

    % Assume light on dark text unless otherwise specified
    if nargin < 2 || isempty(light_on_dark)
        light_on_dark = 1;
    end

    % start workers if necessary
    % if matlabpool('size') == 0
    %     matlabpool open 8
    % end

    %% Configuration
    edge_fn = @(img) edge(img, 'canny');
    IM = imfilter(IM, fspecial('gaussian', 3));

    %% CANNY EDGE DETECTION
    E = edge_fn(IM);
    [h,w] = size(E);
    [R,C] = find(E); % Edge locations

    %% SWT
    [FX,FY] = gradient(IM);
    FX = imfilter(FX, fspecial('gaussian', 3));
    FY = imfilter(FY, fspecial('gaussian', 3));

    if ~light_on_dark
        FX = -FX;
        FY = -FY;
    end

    stroke_widths = Inf*ones(h,w);
    MSW = floor(sqrt(h^2+w^2));
    vectors_seen = cell(1,h*w);

    % TODO: can this be parallelized?
    'Extracting raw stroke widths'
    v = 1;
    jump = 0.05;
    for i=1:length(R)
        % Start at some edge pixel, get its coordinates
        % *_round = round values
        start_r = R(i) + 0.5;
        start_c = C(i) + 0.5;

        curr_r = start_r;
        curr_c = start_c;
        curr_r_round = R(i);
        curr_c_round = C(i);

        % Find the gradient vector components at this point
        grad_x = FX(curr_r_round, curr_c_round);
        grad_y = FY(curr_r_round, curr_c_round);

        % Normalize the gradient vector to length 1
        hyp2 = (grad_x)^2 + (grad_y)^2;
        if (hyp2 == 0) ; continue; end
        c = sqrt(1/hyp2);
        grad_x = c*grad_x;
        grad_y = c*grad_y;

        % Walk in direction of gradient vector
        PV_R = zeros(1,MSW);
        PV_C = zeros(1,MSW);

        point_idx = 0;
        while(1)
            % Get next unit step along gradient
            curr_r = curr_r + jump*grad_y;
            curr_c = curr_c + jump*grad_x;

            % Round next point to integers to access pixel
            next_r_round = round(curr_r);
            next_c_round = round(curr_c);

            if (next_r_round == curr_r_round && ...
                next_c_round == curr_c_round)
                continue
            end

            curr_r_round = next_r_round;
            curr_c_round = next_c_round;

            % Check if next point is valid
            if (curr_r_round <= 0 || curr_r_round > h) || ...
                (curr_c_round <= 0 || curr_c_round > w)
                break;
            end

            % If the point is valid, increment stroke width
            point_idx = point_idx + 1;

            % Add next point to points visited
            PV_R(1,point_idx) = curr_r_round;
            PV_C(1,point_idx) = curr_c_round;

            if (E(curr_r_round, curr_c_round) > 0)
                % Get gradient at new point
                new_grad_x = FX(curr_r_round, curr_c_round);
                new_grad_y = FY(curr_r_round, curr_c_round);

                % Normalize
                hyp2 = (new_grad_x)^2 + (new_grad_y)^2;
                c = sqrt(1/hyp2);
                new_grad_x = new_grad_x * c;
                new_grad_y = new_grad_y * c;

                % End if gradient at new point is in opposite direction
                if(acos(grad_x*-new_grad_x + grad_y*-new_grad_y) < (pi/2))
                    break;
                end
            end
        end

        % Delete trailing zeros from preallocated arrays
        i1 = find(PV_R, 1, 'first');
        i2 = find(PV_R, 1, 'last');
        PV_R = PV_R(i1:i2);
        PV_C = PV_C(i1:i2);

        % Add vector seen to list
        vectors_seen(v) = {{PV_R,PV_C}};
        v = v+1;

        % So now PV_R and PV_C contain all points visited along a gradient
        % We need to replace all these points with the stroke width.
        sw = sqrt((start_r - curr_r)^2 + (start_c - curr_c)^2);
        indices = PV_R + (PV_C - 1)*h;
        stroke_widths(indices) = min(sw, stroke_widths(indices));
    end

    % Remove trailing empty cells
    vectors_seen = vectors_seen(~cellfun('isempty', vectors_seen));

    % Replace outlier values with median along vector
    'Replacing outliers with medians'
    for j=1:length(vectors_seen)
        % Access vectors visited from cell array
        rows = vectors_seen{j}{1};
        cols = vectors_seen{j}{2};

        % Create array of stroke widths at vector points
        widths = stroke_widths(rows + (cols - 1) * h);

        % Find median along vector
        med = median(widths);

        % Replace entries larger than median with median
        stroke_widths(rows + (cols - 1)*h) = min(widths, med);
    end

    % Connected components analysis
    'Creating connected graph'
    is_connected = @(A,B) ((A ./ B <= 3) & (B ./ A <= 3));
    ccomps = conn_comp(stroke_widths, @is_connected);

    ccomps = reshape(cc_labels, h, w);
    swt_im = stroke_widths;
end


text:
package org.jiris.gatling.mqtt.action

import org.jiris.gatling.mqtt.protocol.MqttProtocol
import org.jiris.gatling.mqtt.protocol.MqttComponents
import org.jiris.gatling.mqtt.request.builder.MqttAttributes
import io.gatling.core.action.builder.ActionBuilder
import io.gatling.core.protocol.ProtocolComponentsRegistry
import org.fusesource.mqtt.client.MQTT
import io.gatling.core.config.GatlingConfiguration
import io.gatling.core.structure.ScenarioContext
import io.gatling.core.action.Action
import io.gatling.core.protocol.ProtocolComponents
import com.typesafe.scalalogging.Logger
import io.gatling.core.session.Session

class MqttRequestActionBuilder(mqttAttributes: MqttAttributes) extends ActionBuilder {
  def mqttComponents(protocolComponentsRegistry: ProtocolComponentsRegistry): MqttComponents =
      protocolComponentsRegistry.components(MqttProtocol.MqttProtocolKey)

  def build(ctx:ScenarioContext, next: Action): Action = {
    val mqttProtocol = mqttComponents(ctx.protocolComponentsRegistry).mqttProtocol

    mqttProtocol.impl match {
      case Some("paho") =>
        new PahoMqttRequestAction(
            ctx.coreComponents.statsEngine,
            mqttAttributes,
            mqttProtocol,
            next
        )
      case _ =>
        new MqttRequestAction(
            ctx.coreComponents.statsEngine,
            new MQTT,
            mqttAttributes,
            mqttProtocol,
            next)
        }
  }
}


text:
<?php
use yii\helpers\Html;
use app\func\Proc;

\Yii::$app->getView()->registerJsFile('@web/js/osmotraktform.js' . Proc::appendTimestampUrlParam(Yii::$app->basePath . '/web/js/osmotraktform.js'));

/* @var $this yii\web\View */
/* @var $model app\models\Fregat\Osmotrakt */

$this->title = 'Обновить акт осмотра основной материальной ценности';
$this->params['breadcrumbs'] = Proc::Breadcrumbs($this, [
            'model' => [$model],
        ]);
?>

    <div class="panel panel-<?= Yii::$app->params['panelStyle'] ?>">

<?= Html::encode($this->title) ?>

            <?=
            $this->render('_form', [
                'model' => $model,
            ])
            ?>


text:
import React from 'react';
import { shallow } from 'enzyme';

import { MicrosoftTranslation } from './MicrosoftTranslation';

describe('<MicrosoftTranslation>', () => {
  it('renders the MicrosoftTranslation component properly', () => {
    const wrapper = shallow(<MicrosoftTranslation />);

    expect(wrapper.find('li')).toHaveLength(1);
    expect(wrapper.find('Localized').props().id).toEqual(
      'machinery-MicrosoftTranslation--visit-bing',
    );
    expect(wrapper.find('li a').props().href).toContain(
      'https://www.bing.com/translator',
    );
    expect(wrapper.find('li a').props().title).toContain(
      'Visit Microsoft Translator',
    );
    expect(wrapper.find('li a span').text()).toEqual('MICROSOFT TRANSLATOR');
  });
});


text:
author_id: 2
excerpt:
  We presented in two separate tracks at Desert Code Camp in Phoenix to a great turnout. You can checkout the slides here.
layout: post
title: Desert Code Camp Followup
tags:
- community
- conferences
---

Thanks to everyone who attended the two sessions taught by us at [Desert Code Camp](http://desertcodecamp.com)! We hope that you had a great time and learned a lot. I know we did!

As promised, here are the slides from the Understanding Functional Programming session:

[Understanding Functional Programming](http://www.slideshare.net/cchandler/understanding-functional-programming?type=presentation)

<iframe src="//www.slideshare.net/slideshow/embed_code/key/1GTngDpF3CR7mm" width="425" height="355" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="border:1px solid #CCC; border-width:1px; margin-bottom:5px; max-width: 100%;" allowfullscreen> </iframe>

**What topic(s) would you like to see next time?**


text:
<wicket:panel>

BayesPhylogenies Configuration

                            <textarea readonly wicket:id="analysis.controlBlock" cols="36" rows="12" onClick="select()">BayesPhylo settings preview</textarea>

Scale Test Configuration

                        Test name:
                        name

                        Repetitions:
                        repetitions

                        Minimum nodes:
                        scaleNodesMin

                        Nodes increments:
                        scaleNodesIncrements

                        Maximum nodes:
                        scaleNodesMax

                        Processors per node:
                        ppn

</wicket:panel>


text:
package Examples;

import com.aspose.words.*;
import org.testng.annotations.Test;

import java.io.File;
import java.io.FileOutputStream;
import java.text.MessageFormat;

@Test
public class ExXamlFixedSaveOptions extends ApiExampleBase {
    //ExStart
    //ExFor:XamlFixedSaveOptions
    //ExFor:XamlFixedSaveOptions.ResourceSavingCallback
    //ExFor:XamlFixedSaveOptions.ResourcesFolder
    //ExFor:XamlFixedSaveOptions.ResourcesFolderAlias
    //ExFor:XamlFixedSaveOptions.SaveFormat
    //ExSummary:Shows how to print the URIs of linked resources created during conversion of a document to fixed-form .xaml.
    @Test //ExSkip
    public void xamlFixedResourceFolder() throws Exception {
        // Open a document which contains resources
        Document doc = new Document(getMyDir() + "Rendering.doc");

        XamlFixedSaveOptions options = new XamlFixedSaveOptions();
        {
            options.setSaveFormat(SaveFormat.XAML_FIXED);
            options.setResourcesFolder(getArtifactsDir() + "XamlFixedResourceFolder");
            options.setResourcesFolderAlias(getArtifactsDir() + "XamlFixedFolderAlias");
            options.setResourceSavingCallback(new ResourceUriPrinter());
        }

        // A folder specified by ResourcesFolderAlias will contain the resources instead of ResourcesFolder
        // We must ensure the folder exists before the streams can put their resources into it
        new File(options.getResourcesFolderAlias()).mkdir();

        doc.save(getArtifactsDir() + "XamlFixedResourceFolder.xaml", options);
    }

    /// <summary>
    /// Counts and prints URIs of resources created during conversion to to fixed .xaml
    /// </summary>
    private static class ResourceUriPrinter implements IResourceSavingCallback {
        public void resourceSaving(ResourceSavingArgs args) throws Exception {
            // If we set a folder alias in the SaveOptions object, it will be printed here
            System.out.println(MessageFormat.format("Resource #{0} \"{1}\"", ++mSavedResourceCount, args.getResourceFileName()));
            System.out.println("\t" + args.getResourceFileUri());

            // If we specified a ResourcesFolderAlias we will also need to redirect each stream to put its resource in that folder
            args.setResourceStream(new FileOutputStream(new File(args.getResourceFileUri())));
            args.setKeepResourceStreamOpen(false);
        }

        private int mSavedResourceCount;
    }
    //ExEnd
}


text:
'use strict';

var compress = require('compression');

module.exports = function(app){
  app.use(compress());
};


text:
package com.leafsoft.jersey.service;

import java.util.Date;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

import org.json.JSONArray;

import com.leafsoft.jersey.errorhandling.AppException;
import com.leafsoft.org.OrgUtil;
import com.leafsoft.school.dao.DaoSelectorUtil;
import com.leafsoft.school.dao.StaffQualificationDao;
import com.leafsoft.school.dao.StudentDetailsDao;
import com.leafsoft.school.model.StaffQualification;
import com.leafsoft.school.model.StudentDetail;

@Path("/staffqualification")
public class StaffQualificationService {

	private static final Logger LOGGER = Logger.getLogger(StaffQualificationService.class.getName());

	@GET
	@Path("/{staffid}")
	@Produces(MediaType.APPLICATION_JSON)
	public Response setStaffQualification(@PathParam("staffid") int staffid) {
		StaffQualificationDao staffQualificationdao = DaoSelectorUtil.getStaffQualificationDao();
		List<StaffQualification> result = staffQualificationdao.getStaffDetailsByStaffId(staffid);
		return Response.ok().entity(new JSONArray(result).toString()).build();
	}

	@GET
	@Produces(MediaType.APPLICATION_JSON)
	public Response getStudent() {
		StudentDetailsDao studentDao = DaoSelectorUtil.getStudentDatailsDao();
		List<StudentDetail> studentdetails = studentDao.getAllStudents();
		return Response.ok().entity(new JSONArray(studentdetails).toString()).build();
	}

	@POST
	@Consumes(MediaType.APPLICATION_JSON)
	@Produces(MediaType.APPLICATION_JSON)
	public Response createStudent(List<StaffQualification> staffQualifications) throws AppException {
		StaffQualificationDao staffQualificationdao = DaoSelectorUtil.getStaffQualificationDao();
		LOGGER.log(Level.INFO,OrgUtil.getOrgdb());
		LOGGER.log(Level.INFO,new Date().toString());
		LOGGER.log(Level.INFO,String.valueOf(System.currentTimeMillis()));
		LOGGER.log(Level.INFO,new Date(System.currentTimeMillis()).toString());
		List<StaffQualification> result = staffQualificationdao.addNewStaffQualification(staffQualifications);
		return Response.ok().entity(new JSONArray(result).toString()).build();
	}

}

//{"studentname":"3843948","dob":"2016-04-17","gender":0,"status":"0","regdate":"1460884906452","StudentContactDetails":{"familyid":"10000"}}