text:
curl -X POST \
	-H 'accept: application/json' \
	-H 'content-type: application/json' \
	'https://api.mercadopago.com/v1/payments?access_token=ACCESS_TOKEN' \
	-d '{
		"transaction_amount": 100,
		"description": "Title of what you are paying for",
		"payer": {
			"email": "test_user_19653727@testuser.com",
			"identification":{
				"type": "IDENTIFICATION_TYPE_ID",
				"number": "12345678"
			},
			"entity_type": "individual"
		},
		"payment_method_id": "webpay",
		"transaction_details": {
			"financial_institution": 1234
		},
		"additional_info": {
			"ip_address": "127.0.0.1"
		},
		"callback_url": "http://www.your-site.com"
	}'


text:
Safari Content Blocker App for iOS 9 and OSX

![Screen1](Screenshot01.png)
![Screen2](Screenshot02.png)
![Screen3](Screenshot03.png)

- Currently blocks content from annoying ad networks on all sites thereby loading pages super fast

- Useful for data-capped, international roaming connections

- Blocking rules are at [RediffBlock/blockerList.json](RediffBlock/blockerList.json)

- View JSON in app

## Tested

- iPad mini 2 running ios 9 beta 5
- iPhone 6 Simulator running ios 9 beta 5
- Desktop version tested on beta Safari 9 for Yosemite & El Capitan
- Universal app contains link to Settings, JSON and instructions for turning on Content Blockers

## Reference Material

* A step-by-step guide: [installing BlockParty on a device with iOS 9 beta installed](https://medium.com/@searls/installing-a-content-blocker-on-ios-9-public-beta-a25b2b83848f)
* Instructions to install desktop version: [How to Use BlockParty for Desktop Safari](https://github.com/krishkumar/BlockParty/blob/master/BlockParty%20-%20Desktop%20Safari/How%20to%20Install.md)
* WWDC 2015 Session 511: [Safari Extensibility: Content Blocking and Shared Links](https://developer.apple.com/videos/wwdc/2015/?id=511)
* Introduction to WebKit Content Blockers: [Introduction & JSON Syntax](https://www.webkit.org/blog/3476/content-blockers-first-look/)

## TODO

- Modify, recompile JSON rules in app

redpajama_set_name: RedPajamaGithub


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

namespace MYCGenerator4OurDailyBread.GlobalVariables
{
    public static class GlobalVariables
    {
        public const string MainFolderTokenKey = "MainFolderToken";

        public const int MaxPlusNum = 10;
    }
}


text:
Positive keys:

* mod01.txt
* mod02.txt
* mod03.txt
* mod08.txt
* mod09.txt
* key04.pgp
* cert04.pem
* cert05.pem
* ssh06.pub
* pubkey03.pem
* privkey05.pem

## Fake moduli

It is possible to generate moduli that passes the moduli fingerprinting test but actually do not contain structure
the factorization algorithm is using. Dlog moduli test do not mark those as positive.


text:
namespace em = enterprise_management;

namespace policy {

enum PolicyLoadStatus {
  // Policy blob was successfully loaded and parsed.
  LOAD_RESULT_SUCCESS,

  // No previously stored policy was found.
  LOAD_RESULT_NO_POLICY_FILE,

  // Could not load the previously stored policy due to either a parse or
  // file read error.
  LOAD_RESULT_LOAD_ERROR,
};

// Struct containing the result of a policy load - if |status| ==
// LOAD_RESULT_SUCCESS, |policy| is initialized from the policy file on disk.
struct PolicyLoadResult {
  PolicyLoadStatus status;
  em::PolicyFetchResponse policy;
};

namespace {

// Subdirectory in the user's profile for storing user policies.
const FilePath::CharType kPolicyDir[] = FILE_PATH_LITERAL("Policy");
// File in the above directory for storing user policy data.
const FilePath::CharType kPolicyCacheFile[] = FILE_PATH_LITERAL("User Policy");

// Loads policy from the backing file. Returns a PolicyLoadResult with the
// results of the fetch.
policy::PolicyLoadResult LoadPolicyFromDisk(const FilePath& path) {
  policy::PolicyLoadResult result;
  // If the backing file does not exist, just return.
  if (!file_util::PathExists(path)) {
    result.status = policy::LOAD_RESULT_NO_POLICY_FILE;
    return result;
  }
  std::string data;
  if (!file_util::ReadFileToString(path, &data) ||
      !result.policy.ParseFromArray(data.c_str(), data.size())) {
    LOG(WARNING) << "Failed to read or parse policy data from " << path.value();
    result.status = policy::LOAD_RESULT_LOAD_ERROR;
    return result;
  }

  result.status = policy::LOAD_RESULT_SUCCESS;
  return result;
}

// Stores policy to the backing file (must be called via a task on
// the FILE thread).
void StorePolicyToDiskOnFileThread(const FilePath& path,
                                   const em::PolicyFetchResponse& policy) {
  DVLOG(1) << "Storing policy to " << path.value();
  DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE));
  std::string data;
  if (!policy.SerializeToString(&data)) {
    DLOG(WARNING) << "Failed to serialize policy data";
    return;
  }

  if (!file_util::CreateDirectory(path.DirName())) {
    DLOG(WARNING) << "Failed to create directory " << path.DirName().value();
    return;
  }

  int size = data.size();
  if (file_util::WriteFile(path, data.c_str(), size) != size) {
    DLOG(WARNING) << "Failed to write " << path.value();
  }
}

}  // namespace

UserCloudPolicyStore::UserCloudPolicyStore(Profile* profile,
                                           const FilePath& path)
    : ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)),
      profile_(profile),
      backing_file_path_(path) {
}

UserCloudPolicyStore::~UserCloudPolicyStore() {
}

void UserCloudPolicyStore::LoadImmediately() {
  DVLOG(1) << "Initiating immediate policy load from disk";
  // Cancel any pending Load/Store/Validate operations.
  weak_factory_.InvalidateWeakPtrs();
  // Load the policy from disk...
  PolicyLoadResult result = LoadPolicyFromDisk(backing_file_path_);
  // ...and install it, reporting success/failure to any observers.
  PolicyLoaded(false, result);
}

void UserCloudPolicyStore::Load() {
  DVLOG(1) << "Initiating policy load from disk";
  // Cancel any pending Load/Store/Validate operations.
  weak_factory_.InvalidateWeakPtrs();

  // Start a new Load operation and have us get called back when it is
  // complete.
  content::BrowserThread::PostTaskAndReplyWithResult(
      content::BrowserThread::FILE, FROM_HERE,
      base::Bind(&LoadPolicyFromDisk, backing_file_path_),
      base::Bind(&UserCloudPolicyStore::PolicyLoaded,
                 weak_factory_.GetWeakPtr(), true));
}

void UserCloudPolicyStore::PolicyLoaded(bool validate_in_background,
                                        PolicyLoadResult result) {
  DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
  switch (result.status) {
    case LOAD_RESULT_LOAD_ERROR:
      status_ = STATUS_LOAD_ERROR;
      NotifyStoreError();
      break;

    case LOAD_RESULT_NO_POLICY_FILE:
      DVLOG(1) << "No policy found on disk";
      NotifyStoreLoaded();
      break;

    case LOAD_RESULT_SUCCESS: {
      // Found policy on disk - need to validate it before it can be used.
      scoped_ptr<em::PolicyFetchResponse> cloud_policy(
          new em::PolicyFetchResponse(result.policy));
      Validate(cloud_policy.Pass(),
               validate_in_background,
               base::Bind(
                   &UserCloudPolicyStore::InstallLoadedPolicyAfterValidation,
                   weak_factory_.GetWeakPtr()));
      break;
    }
    default:
      NOTREACHED();
  }
}

void UserCloudPolicyStore::InstallLoadedPolicyAfterValidation(
    UserCloudPolicyValidator* validator) {
  validation_status_ = validator->status();
  if (!validator->success()) {
    DVLOG(1) << "Validation failed: status=" << validation_status_;
    status_ = STATUS_VALIDATION_ERROR;
    NotifyStoreError();
    return;
  }

  DVLOG(1) << "Validation succeeded - installing policy with dm_token: " <<
      validator->policy_data()->request_token();
  DVLOG(1) << "Device ID: " << validator->policy_data()->device_id();

  InstallPolicy(validator->policy_data().Pass(), validator->payload().Pass());
  status_ = STATUS_OK;
  NotifyStoreLoaded();
}

void UserCloudPolicyStore::RemoveStoredPolicy() {
  content::BrowserThread::PostTask(
      content::BrowserThread::FILE, FROM_HERE,
      base::Bind(base::IgnoreResult(&file_util::Delete),
                 backing_file_path_,
                 false));
}

void UserCloudPolicyStore::Store(const em::PolicyFetchResponse& policy) {
  // Stop any pending requests to store policy, then validate the new policy
  // before storing it.
  weak_factory_.InvalidateWeakPtrs();
  scoped_ptr<em::PolicyFetchResponse> policy_copy(
      new em::PolicyFetchResponse(policy));
  Validate(policy_copy.Pass(),
           true,
           base::Bind(&UserCloudPolicyStore::StorePolicyAfterValidation,
                      weak_factory_.GetWeakPtr()));
}

void UserCloudPolicyStore::Validate(
    scoped_ptr<em::PolicyFetchResponse> policy,
    bool validate_in_background,
    const UserCloudPolicyValidator::CompletionCallback& callback) {
  // Configure the validator.
  scoped_ptr<UserCloudPolicyValidator> validator =
      CreateValidator(policy.Pass());
  SigninManager* signin = SigninManagerFactory::GetForProfileIfExists(profile_);
  if (signin) {
    std::string username = signin->GetAuthenticatedUsername();
    DCHECK(!username.empty());
    validator->ValidateUsername(username);
  }

  if (validate_in_background) {
    // Start validation in the background. The Validator will free itself once
    // validation is complete.
    validator.release()->StartValidation(callback);
  } else {
    // Run validation immediately and invoke the callback with the results.
    validator->RunValidation();
    callback.Run(validator.get());
  }
}

void UserCloudPolicyStore::StorePolicyAfterValidation(
    UserCloudPolicyValidator* validator) {
  validation_status_ = validator->status();
  DVLOG(1) << "Policy validation complete: status = " << validation_status_;
  if (!validator->success()) {
    status_ = STATUS_VALIDATION_ERROR;
    NotifyStoreError();
    return;
  }

  // Persist the validated policy (just fire a task - don't bother getting a
  // reply because we can't do anything if it fails).
  content::BrowserThread::PostTask(
      content::BrowserThread::FILE, FROM_HERE,
      base::Bind(&StorePolicyToDiskOnFileThread,
                 backing_file_path_, *validator->policy()));
  InstallPolicy(validator->policy_data().Pass(), validator->payload().Pass());
  status_ = STATUS_OK;
  NotifyStoreLoaded();
}

// static
scoped_ptr<CloudPolicyStore> CloudPolicyStore::CreateUserPolicyStore(
    Profile* profile,
    bool force_immediate_policy_load) {
  FilePath path =
      profile->GetPath().Append(kPolicyDir).Append(kPolicyCacheFile);
  UserCloudPolicyStore* store = new UserCloudPolicyStore(profile, path);
  if (force_immediate_policy_load)
    store->LoadImmediately();
  return scoped_ptr<CloudPolicyStore>(store);
}

}  // namespace policy


text:
describe("Binding", function () {

    var Binding = drunk.Binding;
    var element = {};

    var viewModel = new drunk.ViewModel();

    beforeEach(function () {
        viewModel = new drunk.ViewModel({
            a: 1,
            b: {
                c: {
                    d: 2
                }
            }
        });
    });

    it("register with object handler", function () {
        var handler = {};
        Binding.register("test", handler);

        expect(typeof Binding.getByName('test')).toBe("function");
    });

    it("normal binding", function (done) {
        var binding = new Binding(viewModel, element, {
            name: "test",
            expression: 'a',
            init: jasmine.createSpy("init"),
            update: jasmine.createSpy("update"),
            release: jasmine.createSpy("release")
        });

        binding.$initialize();
        binding.$execute();

        expect(binding.viewModel).toBe(viewModel);
        expect(binding.element).toBe(element);
        expect(binding.name).toBe("test");
        expect(binding._update).toBeDefined();
        expect(binding._unwatch).toBeDefined();
        expect(binding._isActived).toBe(true);
        expect(binding.init).toHaveBeenCalled();
        expect(binding.update).toHaveBeenCalledWith(1, undefined);
        expect(viewModel._watchers.a).toBeDefined();

        viewModel.a = 234;

        drunk.util.requestAnimationFrame(function () {
            expect(binding.update).toHaveBeenCalledWith(234, 1);

            binding.$dispose();

            expect(binding.release).toHaveBeenCalled();
            expect(binding.viewModel).toBe(null);
            expect(binding._isActived).toBe(false);
            expect(binding.element).toBe(null);
            expect(viewModel._watchers.a).toBeNull();
            done();
        });
    });

    it("static literal binding", function () {
        var binding = new Binding(viewModel, element, {
            name: "test",
            expression: '"a"',
            update: jasmine.createSpy("update")
        });

        binding.$initialize();
        binding.$execute();

        expect(binding.update).toHaveBeenCalledWith("a", undefined);
        expect(binding._update).toBeUndefined();
    });

    it("two way binding", function (done) {
        var binding = new Binding(viewModel, element, {
            name: "test",
            expression: 'a',
            update: jasmine.createSpy("update")
        });

        binding.$initialize();
        binding.$execute();

        expect(binding.update.calls.count()).toBe(1);

        var watcher = viewModel._watchers.a;

        spyOn(viewModel, "$setValue").and.callThrough();

        binding.$setValue(2);

        expect(viewModel.$setValue.calls.any()).toEqual(true);
        expect(viewModel.a).toBe(2);
        expect(watcher.value).toBe(1);

        drunk.util.requestAnimationFrame(function () {
            expect(watcher.value).toBe(2);
            expect(binding.update.calls.count()).toBe(1);

            viewModel.$setValue('a', 3);
            drunk.util.requestAnimationFrame(function () {
                expect(watcher.value).toBe(3);
                expect(binding.update.calls.count()).toBe(2);
                done()
            });
        });
    });

    it("deep watch", function (done) {
        var binding = new Binding(viewModel, element, {
            isDeepWatch: true,
            expression: 'b',
            update: jasmine.createSpy("update")
        });

        binding.$initialize();
        binding.$execute();

        expect(binding.update.calls.count()).toBe(1);

        viewModel.b.c.d = 23;

        drunk.util.requestAnimationFrame(function () {
            expect(binding.update.calls.count()).toBe(2);

            done();
        });
    });

    it("reuse the same watcher", function (done) {
        var binding1 = new Binding(viewModel, element, {
            expression: 'a',
            update: jasmine.createSpy()
        });
        var binding2 = new Binding(viewModel, element, {
            expression: 'a',
            update: jasmine.createSpy()
        });

        binding1.$initialize();
        binding1.$execute();
        binding2.$initialize();
        binding2.$execute();

        var watcher = viewModel._watchers.a;

        expect(watcher._actions.length).toBe(2);

        binding2.$dispose();
        viewModel.a = 2;

        expect(watcher._actions.length).toBe(1);

        drunk.util.requestAnimationFrame(function () {
            expect(binding1.update).toHaveBeenCalledWith(2, 1);

            binding1.$dispose();

            expect(watcher._actions).toBeNull();
            expect(viewModel._watchers.a).toBeNull();

            done();
        });
    });

});


text:
#include "cr_pack.h"
#include "cr_mem.h"
#include "cr_net.h"
#include "cr_pixeldata.h"
#include "cr_protocol.h"
#include "cr_error.h"
#include "packspu.h"
#include "packspu_proto.h"

uint32_t g_u32VBoxHostCaps = 0;

static void
packspuWriteback( const CRMessageWriteback *wb )
{
    int *writeback;
    crMemcpy( &writeback, &(wb->writeback_ptr), sizeof( writeback ) );
    *writeback = 0;
}

/**
 * XXX Note that this routine is identical to crNetRecvReadback except
 * we set *writeback=0 instead of decrementing it.  Hmmm.
 */
static void
packspuReadback( const CRMessageReadback *rb, unsigned int len )
{
    /* minus the header, the destination pointer,
     * *and* the implicit writeback pointer at the head. */

    int payload_len = len - sizeof( *rb );
    int *writeback;
    void *dest_ptr;
    crMemcpy( &writeback, &(rb->writeback_ptr), sizeof( writeback ) );
    crMemcpy( &dest_ptr, &(rb->readback_ptr), sizeof( dest_ptr ) );

    *writeback = 0;
    crMemcpy( dest_ptr, ((char *)rb) + sizeof(*rb), payload_len );
}

static void
packspuReadPixels( const CRMessageReadPixels *rp, unsigned int len )
{
    crNetRecvReadPixels( rp, len );
    --pack_spu.ReadPixels;
}

static int
packspuReceiveData( CRConnection *conn, CRMessage *msg, unsigned int len )
{
    if (msg->header.type == CR_MESSAGE_REDIR_PTR)
        msg = (CRMessage*) msg->redirptr.pMessage;

    switch( msg->header.type )
    {
        case CR_MESSAGE_READ_PIXELS:
            packspuReadPixels( &(msg->readPixels), len );
            break;
        case CR_MESSAGE_WRITEBACK:
            packspuWriteback( &(msg->writeback) );
            break;
        case CR_MESSAGE_READBACK:
            packspuReadback( &(msg->readback), len );
            break;
        default:
            /*crWarning( "Why is the pack SPU getting a message of type 0x%x?", msg->type ); */
            return 0; /* NOT HANDLED */
    }
    return 1; /* HANDLED */
}

static CRMessageOpcodes *
__prependHeader( CRPackBuffer *buf, unsigned int *len, unsigned int senderID )
{
    int num_opcodes;
    CRMessageOpcodes *hdr;

    CRASSERT( buf );
    CRASSERT( buf->opcode_current < buf->opcode_start );
    CRASSERT( buf->opcode_current >= buf->opcode_end );
    CRASSERT( buf->data_current > buf->data_start );
    CRASSERT( buf->data_current <= buf->data_end );

    num_opcodes = buf->opcode_start - buf->opcode_current;
    hdr = (CRMessageOpcodes *)
        ( buf->data_start - ( ( num_opcodes + 3 ) & ~0x3 ) - sizeof(*hdr) );

    CRASSERT( (void *) hdr >= buf->pack );

    if (pack_spu.swap)
    {
        hdr->header.type = (CRMessageType) SWAP32(CR_MESSAGE_OPCODES);
        hdr->numOpcodes  = SWAP32(num_opcodes);
    }
    else
    {
        hdr->header.type = CR_MESSAGE_OPCODES;
        hdr->numOpcodes  = num_opcodes;
    }

    *len = buf->data_current - (unsigned char *) hdr;

    return hdr;
}

/*
 * This is called from either the Pack SPU and the packer library whenever
 * we need to send a data buffer to the server.
 */
void packspuFlush(void *arg )
{
    ThreadInfo *thread = (ThreadInfo *) arg;
    ContextInfo *ctx;
    unsigned int len;
    CRMessageOpcodes *hdr;
    CRPackBuffer *buf;

    /* we should _always_ pass a valid <arg> value */
    CRASSERT(thread && thread->inUse);
#ifdef CHROMIUM_THREADSAFE
    CR_LOCK_PACKER_CONTEXT(thread->packer);
#endif
    ctx = thread->currentContext;
    buf = &(thread->buffer);
    CRASSERT(buf);

    if (ctx && ctx->fCheckZerroVertAttr)
        crStateCurrentRecoverNew(ctx->clientState, &thread->packer->current);

    /* We're done packing into the current buffer, unbind it */
    crPackReleaseBuffer( thread->packer );

    /*
    printf("%s thread=%p thread->id = %d thread->pc=%p t2->id=%d t2->pc=%p packbuf=%p packbuf=%p\n",
           __FUNCTION__, (void*) thread, (int) thread->id, thread->packer,
           (int) t2->id, t2->packer,
           buf->pack, thread->packer->buffer.pack);
    */

    if ( buf->opcode_current == buf->opcode_start ) {
           /*
           printf("%s early return\n", __FUNCTION__);
           */
           /* XXX these calls seem to help, but might be appropriate */
           crPackSetBuffer( thread->packer, buf );
           crPackResetPointers(thread->packer);
#ifdef CHROMIUM_THREADSAFE
           CR_UNLOCK_PACKER_CONTEXT(thread->packer);
#endif
           return;
    }

    hdr = __prependHeader( buf, &len, 0 );

    CRASSERT( thread->netServer.conn );

    if ( buf->holds_BeginEnd )
    {
        /*crDebug("crNetBarf %d, (%d)", len, buf->size);*/
        crNetBarf( thread->netServer.conn, &(buf->pack), hdr, len );
    }
    else
    {
        /*crDebug("crNetSend %d, (%d)", len, buf->size);*/
        crNetSend( thread->netServer.conn, &(buf->pack), hdr, len );
    }

    buf->pack = crNetAlloc( thread->netServer.conn );

    /* The network may have found a new mtu */
    buf->mtu = thread->netServer.conn->mtu;

    crPackSetBuffer( thread->packer, buf );

    crPackResetPointers(thread->packer);

#ifdef CHROMIUM_THREADSAFE
    CR_UNLOCK_PACKER_CONTEXT(thread->packer);
#endif
}

/**
 * XXX NOTE: there's a lot of duplicate code here common to the
 * pack, tilesort and replicate SPUs.  Try to simplify someday!
 */
void packspuHuge( CROpcode opcode, void *buf )
{
    GET_THREAD(thread);
    unsigned int          len;
    unsigned char        *src;
    CRMessageOpcodes *msg;

    CRASSERT(thread);

    /* packet length is indicated by the variable length field, and
       includes an additional word for the opcode (with alignment) and
       a header */
    len = ((unsigned int *) buf)[-1];
    if (pack_spu.swap)
    {
        /* It's already been swapped, swap it back. */
        len = SWAP32(len);
    }
    len += 4 + sizeof(CRMessageOpcodes);

    /* write the opcode in just before the length */
    ((unsigned char *) buf)[-5] = (unsigned char) opcode;

    /* fix up the pointer to the packet to include the length & opcode
       & header */
    src = (unsigned char *) buf - 8 - sizeof(CRMessageOpcodes);

    msg = (CRMessageOpcodes *) src;

    if (pack_spu.swap)
    {
        msg->header.type = (CRMessageType) SWAP32(CR_MESSAGE_OPCODES);
        msg->numOpcodes  = SWAP32(1);
    }
    else
    {
        msg->header.type = CR_MESSAGE_OPCODES;
        msg->numOpcodes  = 1;
    }

    CRASSERT( thread->netServer.conn );
    crNetSend( thread->netServer.conn, NULL, src, len );
}

static void packspuFirstConnectToServer( CRNetServer *server
#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
                , struct VBOXUHGSMI *pHgsmi
#endif
        )
{
    crNetInit( packspuReceiveData, NULL );
    crNetServerConnect( server
#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
                , pHgsmi
#endif
            );
    if (server->conn)
    {
        g_u32VBoxHostCaps = crNetHostCapsGet();
        crPackCapsSet(g_u32VBoxHostCaps);
    }
}

void packspuConnectToServer( CRNetServer *server
#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
                , struct VBOXUHGSMI *pHgsmi
#endif
        )
{
    if (pack_spu.numThreads == 0) {
        packspuFirstConnectToServer( server
#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
                , pHgsmi
#endif
                );
        if (!server->conn) {
            crError("packspuConnectToServer: no connection on first create!");
            return;
        }
        pack_spu.swap = server->conn->swap;
    }
    else {
        /* a new pthread */
        crNetNewClient(server
#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
                , pHgsmi
#endif
        );
    }
}


text:
package org.citygml4j.xml.adapter.tunnel;

import org.citygml4j.core.model.tunnel.TunnelFurnitureProperty;
import org.xmlobjects.builder.ObjectBuildException;
import org.xmlobjects.gml.adapter.feature.AbstractFeaturePropertyAdapter;

import javax.xml.namespace.QName;

public class TunnelFurniturePropertyAdapter extends AbstractFeaturePropertyAdapter<TunnelFurnitureProperty> {

    @Override
    public TunnelFurnitureProperty createObject(QName name, Object parent) throws ObjectBuildException {
        return new TunnelFurnitureProperty();
    }
}


text:
import { User } from 'ngx-login-client';
import { UserUI, UserMapper } from './user';
import {
  Mapper,
  MapTree,
  switchModel,
  modelService
} from './common.model';
import { cloneDeep } from 'lodash';

export class Comment extends modelService {
    attributes: CommentAttributes;
    relationships: {
        'creator': {
          data: {
            id: string;
            type: string;
          };
      }
    };
    links: CommentLink;
    relationalData?: RelationalData;
}

export class CommentLink {
    self: string;
}

export class CommentAttributes {
    body: string;
    'body.rendered': string;
    'markup': string;
    'created-at': string;
}

export class Comments {
    data: Comment[];
}

export class CommentPost {
    data: Comment;
}

export class RelationalData {
  creator?: User;
}

export interface CommentUI {
  id: string;
  body: string;
  markup: string;
  createdAt: string;
  creator: UserUI;
  bodyRendered: string;
  selfLink: string;
}

export interface CommentService extends Comment {}

export class CommentMapper implements Mapper<CommentService, CommentUI> {
  constructor(private userMapper: UserMapper) {
    this.userMapper = userMapper
  }

  serviceToUiMapTree: MapTree = [{
    fromPath: ['id'],
    toPath: ['id']
  }, {
    fromPath: ['attributes', 'body'],
    toPath: ['body']
  }, {
    fromPath: ['attributes', 'markup'],
    toPath: ['markup']
  }, {
    fromPath: ['attributes', 'created-at'],
    toPath: ['createdAt']
  }, {
    fromPath: ['attributes', 'body.rendered'],
    toPath: ['bodyRendered']
  }, {
    fromPath: ['relationships', 'creator', 'data'],
    toPath: ['creator'],
    toFunction: this.userMapper.toUIModel.bind(this.userMapper)
  }, {
    fromPath: ['links', 'self'],
    toPath: ['selfLink']
  }];

  uiToServiceMapTree: MapTree = [{
    toPath: ['id'],
    fromPath: ['id']
  }, {
    toPath: ['attributes', 'body'],
    fromPath: ['body']
  }, {
    toPath: ['attributes', 'markup'],
    fromPath: ['markup']
  }, {
    toPath: ['attributes', 'created-at'],
    fromPath: ['createdAt']
  }, {
    toPath: ['relationships', 'creator', 'data'],
    fromPath: ['creator']
  }, {
    toPath: ['attributes', 'body.rendered'],
    fromPath: ['bodyRendered']
  }, {
    toPath: ['type'],
    toValue: 'comments'
  }, {
    toPath: ['links', 'self'],
    fromPath: ['selfLink']
  }];

  toUIModel(arg: CommentService): CommentUI {
    return switchModel<CommentService, CommentUI>(
      arg, this.serviceToUiMapTree
    )
  }

  toServiceModel(arg: CommentUI): CommentService {
    return switchModel<CommentUI, CommentService>(
      arg, this.uiToServiceMapTree
    )
  }
}

export class CommentCreatorResolver {
  constructor(private comment: CommentUI) {}

  resolveCreator(creators: UserUI[]) {
    const creator = creators.find(a => a.id === this.comment.creator.id);
    if (creator) {
      this.comment.creator = cloneDeep(creator);
    }
  }

  getComment() {
    return this.comment;
  }
}


text:
package ligueBaseball.exceptions;

public class FailedToDeleteEntityException extends Exception
{
    private static final long serialVersionUID = 2048533964955399849L;

    public FailedToDeleteEntityException(String message) {
        super(message);
    }

    public FailedToDeleteEntityException(String message, Throwable cause) {
        super(message, cause);
    }

    public FailedToDeleteEntityException(Throwable cause) {
        super("Impossible de détruire l'entitée.", cause);
    }
}


text:
  Search Hadith by ID:
  <input class="form-control" style="width: 100px;" type="text" id="search_hadith_by_id"/>
  <button class="search-btn">

</button>

<fieldset>

  <legend>Displaying All Ahadith </legend>
  <?php if( $this->user_roles->is_authorized( array('admin_hadith_add') )   ): ?>
  <?php echo anchor(base_url().'admin/hadith/add', 'Add New Hadith', 'class="btn btn-primary"'); ?>
  <?php endif; ?>

        #
        Arabic Plain
        English Plain
        Urdu Plain
        Hadith in books
        <?php if( $this->user_roles->is_authorized( array('admin_hadith_edit') )   ): ?>
        Action
        <?php endif; ?>

      <?php foreach($ahadith as $hadith): ?>

          <?php echo $hadith->hadith_id; ?>
          <?php echo substr( $hadith->hadith_plain_ar, 0 ,20); ?> …
          <?php echo substr( $hadith->hadith_plain_en, 0, 20); ?> …
          <?php echo substr( $hadith->hadith_plain_ur, 0, 20); ?> …
          <a href='<?php echo (base_url().'admin/hadith-in-book/'.$hadith->hadith_id); ?>' >view
        <?php if( $this->user_roles->is_authorized( array('admin_hadith_edit') )   ): ?>
          <a href='<?php echo (base_url().'admin/hadith/update/'.$hadith->hadith_id); ?>' >

          <?php endif; ?>

      <?php endforeach; ?>

</fieldset>


text:
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;

/// <summary>
/// This class is used for creating a test that has an entry point
/// that is not the test itself. For example a test that starts from
/// a native exe instead of a managed entry point.
/// </summary>
public class Program
{
    static int Main(string[] noArgs)
    {
        if (Environment.OSVersion.Platform != PlatformID.Win32NT)
        {
            Console.WriteLine($"Exe launcher only supported on Windows environments...");
            return 100;
        }

#if BLOCK_WINDOWS_NANO
        // Not supported on Windows Nano
        if (TestLibrary.Utilities.IsWindowsNanoServer)
        {
            return 100;
        }
#endif

        string workingDir = Environment.CurrentDirectory;
        Console.WriteLine($"Searching for exe to launch in {workingDir}...");

        Assembly thisAssem = Assembly.GetEntryAssembly();
        string startExe = string.Empty;
        foreach (string exeMaybe in Directory.EnumerateFiles(workingDir, "*.exe"))
        {
            // This entry point is _not_ an option
            if (exeMaybe.Equals(thisAssem.Location, StringComparison.OrdinalIgnoreCase))
            {
                continue;
            }

            startExe = exeMaybe;
            break;
        }

        if (string.IsNullOrEmpty(startExe))
        {
            throw new Exception("Unable to find start EXE");
        }

        var startInfo = new ProcessStartInfo()
        {
            FileName = startExe,

            UseShellExecute = false,
            RedirectStandardOutput = true,
            RedirectStandardError = true
        };

        Console.WriteLine($"Launching '{startExe}'...");
        using (Process p = Process.Start(startInfo))
        {
            p.OutputDataReceived += (_, args) => Console.WriteLine(args.Data);
            p.BeginOutputReadLine();

            p.ErrorDataReceived += (_, args) => Console.Error.WriteLine(args.Data);
            p.BeginErrorReadLine();

            p.WaitForExit();
            return p.ExitCode;
        }
    }
}


text:
tablesync
=========

Field-level table synchronization, including algorithm, RESTful API spec, and reference implementations.


text:
..
..
.. Licensed under the Apache License, Version 2.0 (the "License");
.. you may not use this file except in compliance with the License.
.. You may obtain a copy of the License at
..
..     http://www.apache.org/licenses/LICENSE-2.0
..
.. Unless required by applicable law or agreed to in writing, software
.. distributed under the License is distributed on an "AS IS" BASIS,
.. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
.. See the License for the specific language governing permissions and
.. limitations under the License.
..

.. |arrow| image:: fwda.png

.. _rl-caching_proxy:

Caching Proxies
===============
The main function of a CDN is to proxy requests from clients to origin servers
and cache the results.
To proxy, in the CDN context, is to obtain content using HTTP from an origin
server on behalf of a client. To cache is to store the results so they can be
reused when other clients are requesting the same content. There are three
types of proxies in use on the Internet today which are described below.

.. index::
  Reverse Proxy

.. _rl-rev-proxy:

|arrow| Reverse Proxy
---------------------
  A reverse proxy acts on behalf of the origin server. The client is mostly unaware it is communicating with a proxy and not the actual origin.
  All EDGE caches in a Traffic Control CDN are reverse proxies.
  To the end user a Traffic Control based CDN appears as a reverse proxy since
  it retrieves content from the origin server, acting on behalf of that origin server. The client requests a URL that has
  a hostname which resolves to the reverse proxy's IP address and, in compliance
  with the HTTP 1.1 specification, the client sends a ``Host:`` header to the reverse
  proxy that matches the hostname in the URL.
  The proxy looks up this hostname in a
  list of mappings to find the origin hostname; if the hostname of the Host header is not found in the list,
  the proxy will send an error (``404 Not Found``) to the client.
  If the supplied hostname is found in this list of mappings, the proxy checks the cache, and when the content is not already present, connects to the
  origin the requested ``Host:`` maps to and requests the path of the original URL, providing the origin hostname in the ``Host`` header.  The proxy then stores the URL in cache and serves the contents to the client. When there are subsequent requests for
  the same URL, a caching proxy serves the content out of cache thereby reducing
  latency and network traffic.

.. seealso:: `ATS documentation on reverse proxy <https://docs.trafficserver.apache.org/en/latest/admin/reverse-proxy-http-redirects.en.html#http-reverse-proxy>`_.

To insert a reverse proxy into the previous HTTP 1.1 example, the reverse proxy requires provisioning
for ``www.origin.com``. By adding a remap rule to the cache, the reverse proxy then maps requests to
this origin. The content owner must inform the clients, by updating the URL, to receive the content
from the cache and not from the origin server directly. For this example, the remap rule on the
cache is: ``http://www-origin-cache.cdn.com http://www.origin.com``.

..  Note:: In the previous example minimal headers were shown on both the request and response. In the examples that follow, the origin server response is more realistic.

::

  HTTP/1.1 200 OK
  Date: Sun, 14 Dec 2014 23:22:44 GMT
  Server: Apache/2.2.15 (Red Hat)
  Last-Modified: Sun, 14 Dec 2014 23:18:51 GMT
  ETag: "1aa008f-2d-50a3559482cc0"
  Content-Length: 45
  Connection: close
  Content-Type: text/html; charset=UTF-8

  This is a fun file

The client is given the URL ``http://www-origin-cache.cdn.com/foo/bar/fun.html`` (note the different hostname) and when attempting to obtain that URL, the following occurs:

1. The client sends a request to the LDNS server to resolve the name ``www-origin-cache.cdn.com`` to an IPv4 address.

2. Similar to the previous case, the LDNS server resolves the name ``www-origin-cache.cdn.com`` to an IPv4 address, in this example, this address is 55.44.33.22.

3. The client opens a TCP connection from a random port locally, to port 80 (the HTTP default) on 55.44.33.22, and sends the following: ::

    GET /foo/bar/fun.html HTTP/1.1
    Host: www-origin-cache.cdn.com

4. The reverse proxy looks up ``www-origin-cache.cdn.com`` in its remap rules, and finds the origin is ``www.origin.com``.

5. The proxy checks its cache to see if the response for ``http://www-origin-cache.cdn.com/foo/bar/fun.html`` is already in the cache.

6a. If the response is not in the cache:

  1. The proxy uses DNS to get the IPv4 address for ``www.origin.com``, connect to it on port 80, and sends: ::

   	GET /foo/bar/fun.html HTTP/1.1
   	Host: www.origin.com

  2. The origin server responds with the headers and content as shown: ::

      HTTP/1.1 200 OK
      Date: Sun, 14 Dec 2014 23:22:44 GMT
      Server: Apache/2.2.15 (Red Hat)
      Last-Modified: Sun, 14 Dec 2014 23:18:51 GMT
      ETag: "1aa008f-2d-50a3559482cc0"
      Content-Length: 45
      Connection: close
      Content-Type: text/html; charset=UTF-8

      This is a fun file

  3. The proxy sends the origin response on to the client adding a ``Via:`` header (and maybe others): ::

      HTTP/1.1 200 OK
      Date: Sun, 14 Dec 2014 23:22:44 GMT
      Last-Modified: Sun, 14 Dec 2014 23:18:51 GMT
      ETag: "1aa008f-2d-50a3559482cc0"
      Content-Length: 45
      Connection: close
      Content-Type: text/html; charset=UTF-8
      Age: 0
      Via: http/1.1 cache01.cdn.kabletown.net (ApacheTrafficServer/4.2.1 [uScSsSfUpSeN:t cCSi p sS])
      Server: ATS/4.2.1

    	This is a fun file

6b. If it *is* in the cache:

  The proxy responds to the client with the previously retrieved result: ::

      HTTP/1.1 200 OK
      Date: Sun, 14 Dec 2014 23:22:44 GMT
      Last-Modified: Sun, 14 Dec 2014 23:18:51 GMT
      ETag: "1aa008f-2d-50a3559482cc0"
      Content-Length: 45
      Connection: close
      Content-Type: text/html; charset=UTF-8
      Age: 39711
      Via: http/1.1 cache01.cdn.kabletown.net (ApacheTrafficServer/4.2.1 [uScSsSfUpSeN:t cCSi p sS])
      Server: ATS/4.2.1

      This is a fun file

.. index::
  Forward Proxy

.. _rl-fwd-proxy:

|arrow| Forward Proxy
---------------------
  A forward proxy acts on behalf of the client. The origin server is mostly
  unaware of the proxy, the client requests the proxy to retrieve content from a
  particular origin server. All MID caches in a Traffic Control based CDN are
  forward proxies. In a forward proxy scenario, the client is explicitely configured  to use the
  the proxy's IP address and port as a forward proxy. The client always connects to the forward
  proxy for content. The content provider does not have to change the URL the
  client obtains, and is unaware of the proxy in the middle.

..  seealso:: `ATS documentation on forward proxy <https://docs.trafficserver.apache.org/en/latest/admin/forward-proxy.en.html>`_.

Below is an example of the client retrieving the URL ``http://www.origin.com/foo/bar/fun.html`` through a forward proxy:

1. The client requires configuration to use the proxy, as opposed to the reverse proxy example. Assume the client configuration is through preferences entries or other to use the proxy IP address 99.88.77.66 and proxy port 8080.

2. To retrieve ``http://www.origin.com/foo/bar/fun.html`` URL, the client connects to 99.88.77.66 on port 8080 and sends:

 ::

  GET http://www.origin.com/foo/bar/fun.html HTTP/1.1

 ..  Note:: In this case, the client places the entire URL after GET, including protocol and hostname (``http://www.origin.com``),  but in the reverse proxy and direct-to-origin case it  puts only the path portion of the URL (``/foo/bar/fun.html``) after the GET.

3. The proxy verifies whether the response for ``http://www-origin-cache.cdn.com/foo/bar/fun.html`` is already in the cache.

4a. If it is not in the cache:

  1. The proxy uses DNS to obtain the IPv4 address for ``www.origin.com``, connects to it on port 80, and sends: ::

      GET /foo/bar/fun.html HTTP/1.1
      Host: www.origin.com

  2. The origin server responds with the headers and content as shown below: ::

      HTTP/1.1 200 OK
      Date: Sun, 14 Dec 2014 23:22:44 GMT
      Server: Apache/2.2.15 (Red Hat)
      Last-Modified: Sun, 14 Dec 2014 23:18:51 GMT
      ETag: "1aa008f-2d-50a3559482cc0"
      Content-Length: 45
      Connection: close
      Content-Type: text/html; charset=UTF-8

      This is a fun file

  3. The proxy sends this on to the client adding a ``Via:`` header (and maybe others): ::

      HTTP/1.1 200 OK
      Date: Sun, 14 Dec 2014 23:22:44 GMT
      Last-Modified: Sun, 14 Dec 2014 23:18:51 GMT
      ETag: "1aa008f-2d-50a3559482cc0"
      Content-Length: 45
      Connection: close
      Content-Type: text/html; charset=UTF-8
      Age: 0
      Via: http/1.1 cache01.cdn.kabletown.net (ApacheTrafficServer/4.2.1 [uScSsSfUpSeN:t cCSi p sS])
      Server: ATS/4.2.1

      This is a fun file

4b. If it *is* in the cache:

  The proxy responds to the client with the previously retrieved result: ::

    HTTP/1.1 200 OK
    Date: Sun, 14 Dec 2014 23:22:44 GMT
    Last-Modified: Sun, 14 Dec 2014 23:18:51 GMT
    ETag: "1aa008f-2d-50a3559482cc0"
    Content-Length: 45
    Connection: close
    Content-Type: text/html; charset=UTF-8
    Age: 99711
    Via: http/1.1 cache01.cdn.kabletown.net (ApacheTrafficServer/4.2.1 [uScSsSfUpSeN:t cCSi p sS])
    Server: ATS/4.2.1

    This is a fun file

.. index::
  Transparent Proxy

|arrow| Transparent Proxy
-------------------------
  Neither the origin nor the client are aware of the actions performed by the transparent proxies. A Traffic Control based CDN does not use transparent proxies.   If you are interested you can learn more about transparent proxies on `wikipedia <http://en.wikipedia.org/wiki/Proxy_server#Transparent_proxy>`_.


text:
	<title>Ian Hickie's panel show appearances</title>

	<link rel="stylesheet" media="all" href="../style.css" type="text/css"/>

Ian Hickie's panel show appearances

Ian Hickie has appeared in 4 episodes between 2015-2018. Note that these appearances may be for more than one person if multiple people have the same name.

2015

2016

2017

2018

2018-07-18 / The Drum

2018-06-11 / The Drum

2018-03-02 / The Drum

2015-10-05 / Q&A


text:
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="stylesheet" href="http://www.petercorke.com/RVC/common/toolboxhelp.css">
    <title>M-File Help: delta2tr</title>

      M-File Help: delta2tr
      View code for delta2tr

delta2tr

Convert differential motion  to a homogeneous transform

T = delta2tr(d) is a homogeneous transform (4x4) representing differential
translation and rotation. The vector d=(dx, dy, dz, dRx, dRy, dRz)
represents an infinitessimal motion, and is an approximation to the spatial
velocity multiplied by time.

See also

tr2delta

© 1990-2014 Peter Corke.


text:
<?php

namespace Phalcon\Db {

    /**
     * Phalcon\Db\ReferenceInterface initializer
     */
    interface ReferenceInterface
        {

        /**
         * Gets the index name
         *
         * @return string
         */
        public function getName();

        /**
         * Gets the schema where referenced table is
         *
         * @return string
         */
        public function getSchemaName();

        /**
         * Gets the schema where referenced table is
         *
         * @return string
         */
        public function getReferencedSchema();

        /**
         * Gets local columns which reference is based
         *
         * @return array
         */
        public function getColumns();

        /**
         * Gets the referenced table
         *
         * @return string
         */
        public function getReferencedTable();

        /**
         * Gets referenced columns
         *
         * @return array
         */
        public function getReferencedColumns();

    }
}


text:
<?php
/**
 * Created by PhpStorm.
 * User: jonathan
 * Date: 16/09/15
 * Time: 16:10
 */

namespace Core\Router;

use Core\App;
use Core\Helper\Debug;

class Route {

    private $path;
    private $callable;
    private $prefix;
    private $matches = [];
    private $params = [];

    /**
     * Route constructor.
     * @param $path
     * @param $callable
     * @param $prefix
     */
    public function __construct($path, $callable, $prefix = '') {
        $this->path = trim($path, '/');
        $this->callable = $callable;
        $this->prefix = $prefix;
    }

    public function match($url) {

        $url = trim($url, '/');
        $path = str_replace("\\", "/",preg_replace_callback('#:([\w]+)#', [$this, 'paramMatch'], $this->path)); // problem windows !!
        $regex = "#^$path$#i";

        if(!preg_match($regex, $url, $matches))
            return false;

        array_shift($matches);

        $this->matches = $matches;

        return true;
    }

    private function paramMatch($match) {
        if(isset($this->params[$match[1]]))
            return  '(' . $this->params[$match[1]] . ')';

        return '([^/]+)';
    }

    public function call() {

        Debug::add('CallableRoute', $this->callable);

        if(is_string($this->callable)) {

            // Si page == 'home => on affiche la page d'accueil
            if($this->callable === 'home') {
                $twigEngine = App::getInstance()->getTwig();

                $layout = $twigEngine->loadTemplate("default" . '.twig');
                $vars['_layout'] = $layout;

                echo $twigEngine->render("home" . '.twig', $vars);
                exit;
            }

            $page = strtolower(str_ireplace('\\', '/', $this->prefix) . str_ireplace('.', DS, $this->callable));

            /*if (!file_exists (ROOT . VIEW . $page . ".twig")) {
               App::getInstance()->redirect('');
            } else {*/

                $params = explode('.', $this->callable);

                $controller = "Content\\Controller\\" . $this->prefix . $params[0] . 'Controller';

                $controller = new $controller();

                return call_user_func_array([$controller, $params[1]], $this->matches);
            //}
        } else {
            return call_user_func_array($this->callable, $this->matches);
        }

        return false;
    }

    public function with($param, $regex) {
        $this->params[$param] = str_replace('(', '(?:', $regex);

        return $this;
    }

}


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

describe TaxonSplit, "validation" do
  it "should not allow the same taxon on both sides of the split" do
    old_taxon = Taxon.make!
    new_taxon = Taxon.make!
    tc = TaxonSplit.make
    tc.add_input_taxon(old_taxon)
    tc.add_output_taxon(new_taxon)
    tc.add_output_taxon(old_taxon)
    tc.save
    expect(tc).not_to be_valid
  end
end

describe TaxonSplit, "commit" do
  before(:each) { prepare_split }

  it "should generate updates for observers of the old taxon"
  it "should generate updates for identifiers of the old taxon"
  it "should generate updates for listers of the old taxon"

  it "should mark the input taxon as inactive" do
    @split.commit
    @input_taxon.reload
    expect(@input_taxon).not_to be_is_active
  end

  it "should mark the output taxon as active" do
    @split.commit
    @output_taxon1.reload
    expect(@output_taxon1).to be_is_active
    @output_taxon2.reload
    expect(@output_taxon2).to be_is_active
  end
end

describe TaxonSplit, "commit_records" do
  before(:each) { prepare_split }
  it "should not update records" do
    obs = Observation.make!(:taxon => @input_taxon)
    @split.commit_records
    obs.reload
    expect(obs.taxon).to eq(@input_taxon)
  end
end

def prepare_split
  @input_taxon = Taxon.make!
  @output_taxon1 = Taxon.make!
  @output_taxon2 = Taxon.make!
  @split = TaxonSplit.make
  @split.add_input_taxon(@input_taxon)
  @split.add_output_taxon(@output_taxon1)
  @split.add_output_taxon(@output_taxon2)
  @split.save!
end


text:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto" >
    <item
        android:id="@+id/media_route_menu_item"
        android:title="@string/media_route_menu_title"
        app:actionProviderClass="android.support.v7.app.MediaRouteActionProvider"
        app:showAsAction="always"/>
</menu>


text:
typedef struct
{
	int alloc,size;
	void **buffer;
} array;

void array_sort(array *a, int (*cmp)(void *, void *));
array *array_create(int size);
array *array_copy(array *a);
void array_empty(array *a);
void array_destroy(array *a);
void array_append(array *a, void *data);
void array_push(array *a, void *data);
void *array_pop(array *a);
void *array_peekLast(array *a);
void *array_peek(array *a);
void array_insert(array *a, int index, void *data);
void *array_remove(array *a, int index);
void *array_get(const array *a, int index);
void *array_set(array *a, int index, void *data);
void array_set_size(array *a, int size);
int array_get_size(const array *a);
#endif


text:
/**
gcc srs_audio_raw_publish.c ../../objs/lib/srs_librtmp.a -g -O0 -lstdc++ -o srs_audio_raw_publish
*/

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

// for open audio raw file.
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

#include "../../objs/include/srs_librtmp.h"

// https://github.com/simple-rtmp-server/srs/issues/212#issuecomment-63648892
// allspace:
//      Take this file as an example: https://github.com/allspace/files/blob/master/srs.pcm
//      It's captured using SDK callback method. I have filtered out h264 video, so it's audio only now.
//      For every frame, it's a 8 bytes vendor specific header, following 160 bytes audio frame.
//      The header part can be ignored.
int read_audio_frame(char* audio_raw, int file_size, char** pp, char** pdata, int* psize)
{
    char* p = *pp;

    if (file_size - (p - audio_raw) < 168) {
        srs_human_trace("audio must be 160+8 bytes. left %d bytes.",
            (int)(file_size - (p - audio_raw)));
        return - 1;
    }

    // ignore 8bytes vendor specific header.
    p += 8;

    // 160 bytes audio frame
    *pdata = p;
    *psize = 160;

    // next frame.
    *pp = p + *psize;

    return 0;
}

int main(int argc, char** argv)
{
    printf("publish raw audio as rtmp stream to server like FMLE/FFMPEG/Encoder\n");
    printf("SRS(simple-rtmp-server) client librtmp library.\n");
    printf("version: %d.%d.%d\n", srs_version_major(), srs_version_minor(), srs_version_revision());

    if (argc <= 2) {
        printf("Usage: %s <audio_raw_file> <rtmp_publish_url>\n", argv[0]);
        printf("     audio_raw_file: the audio raw steam file.\n");
        printf("     rtmp_publish_url: the rtmp publish url.\n");
        printf("For example:\n");
        printf("     %s ./audio.raw.pcm rtmp://127.0.0.1:1935/live/livestream\n", argv[0]);
        printf("Where the file: http://winlinvip.github.io/srs.release/3rdparty/audio.raw.pcm\n");
        printf("See: https://github.com/simple-rtmp-server/srs/issues/212\n");
        exit(-1);
    }

    const char* raw_file = argv[1];
    const char* rtmp_url = argv[2];
    srs_human_trace("raw_file=%s, rtmp_url=%s", raw_file, rtmp_url);

    // open file
    int raw_fd = open(raw_file, O_RDONLY);
    if (raw_fd < 0) {
        srs_human_trace("open audio raw file %s failed.", raw_file);
        goto rtmp_destroy;
    }

    off_t file_size = lseek(raw_fd, 0, SEEK_END);
    if (file_size <= 0) {
        srs_human_trace("audio raw file %s empty.", raw_file);
        goto rtmp_destroy;
    }
    srs_human_trace("read entirely audio raw file, size=%dKB", (int)(file_size / 1024));

    char* audio_raw = (char*)malloc(file_size);
    if (!audio_raw) {
        srs_human_trace("alloc raw buffer failed for file %s.", raw_file);
        goto rtmp_destroy;
    }

    lseek(raw_fd, 0, SEEK_SET);
    ssize_t nb_read = 0;
    if ((nb_read = read(raw_fd, audio_raw, file_size)) != file_size) {
        srs_human_trace("buffer %s failed, expect=%dKB, actual=%dKB.",
            raw_file, (int)(file_size / 1024), (int)(nb_read / 1024));
        goto rtmp_destroy;
    }

    // connect rtmp context
    srs_rtmp_t rtmp = srs_rtmp_create(rtmp_url);

    if (srs_rtmp_handshake(rtmp) != 0) {
        srs_human_trace("simple handshake failed.");
        goto rtmp_destroy;
    }
    srs_human_trace("simple handshake success");

    if (srs_rtmp_connect_app(rtmp) != 0) {
        srs_human_trace("connect vhost/app failed.");
        goto rtmp_destroy;
    }
    srs_human_trace("connect vhost/app success");

    if (srs_rtmp_publish_stream(rtmp) != 0) {
        srs_human_trace("publish stream failed.");
        goto rtmp_destroy;
    }
    srs_human_trace("publish stream success");

    u_int32_t timestamp = 0;
    u_int32_t time_delta = 17;
    // @remark, to decode the file.
    char* p = audio_raw;
    for (;p < audio_raw + file_size;) {
        // @remark, read a frame from file buffer.
        char* data = NULL;
        int size = 0;
        if (read_audio_frame(audio_raw, file_size, &p, &data, &size) < 0) {
            srs_human_trace("read a frame from file buffer failed.");
            goto rtmp_destroy;
        }

        // 0 = Linear PCM, platform endian
        // 1 = ADPCM
        // 2 = MP3
        // 7 = G.711 A-law logarithmic PCM
        // 8 = G.711 mu-law logarithmic PCM
        // 10 = AAC
        // 11 = Speex
        char sound_format = 1;
        // 3 = 44 kHz
        char sound_rate = 3;
        // 1 = 16-bit samples
        char sound_size = 1;
        // 1 = Stereo sound
        char sound_type = 1;

        timestamp += time_delta;

        if (srs_audio_write_raw_frame(rtmp,
            sound_format, sound_rate, sound_size, sound_type,
            data, size, timestamp) != 0
        ) {
            srs_human_trace("send audio raw data failed.");
            goto rtmp_destroy;
        }

        srs_human_trace("sent packet: type=%s, time=%d, size=%d, codec=%d, rate=%d, sample=%d, channel=%d",
            srs_human_flv_tag_type2string(SRS_RTMP_TYPE_AUDIO), timestamp, size, sound_format, sound_rate, sound_size,
            sound_type);

        // @remark, when use encode device, it not need to sleep.
        usleep(1000 * time_delta);
    }

rtmp_destroy:
    srs_rtmp_destroy(rtmp);
    close(raw_fd);
    free(audio_raw);

    return 0;
}


text: CKEDITOR.plugins.setLang("uicolor","it",{title:"Selettore Colore UI",preview:"Anteprima Live",config:"Incolla questa stringa nel tuo file config.js",predefined:"Set di colori predefiniti"});


text:
@class SYLeftDrawerCell;

@protocol SYLeftDrawerCellDelegate <NSObject>

@optional
- (void)didClickedLeftDrawerCell:(SYLeftDrawerCell *)cell;

@end

@interface SYLeftDrawerCell : UITableViewCell

@property (nonatomic, strong) SYTheme *theme;

@property (nonatomic, weak) id<SYLeftDrawerCellDelegate> delegate;

+ (instancetype)cellWithTableView:(UITableView *)tableView;

@end


text:
'use strict';

// Init the application configuration module for AngularJS application
var ApplicationConfiguration = (function() {
	// Init module configuration options
	var applicationModuleName = 'angleApp';
	// var applicationModuleVendorDependencies = ['ngResource', 'ngCookies',  'ngAnimate',  'ngTouch',  'ngSanitize',  'ui.router', 'ui.bootstrap', 'ui.utils'];
	var applicationModuleVendorDependencies = ['ngAnimate', 'ngStorage','ngTouch', 'ngCookies', 'pascalprecht.translate', 'ui.bootstrap', 'ui.router', 'oc.lazyLoad', 'cfp.loadingBar', 'ngSanitize', 'ngResource', 'ui.utils'];
	// Add a new vertical module
	var registerModule = function(moduleName, dependencies) {
		// Create angular module
		angular.module(moduleName, dependencies || []);

		// Add the module to the AngularJS configuration file
		angular.module(applicationModuleName).requires.push(moduleName);
	};

	return {
		applicationModuleName: applicationModuleName,
		applicationModuleVendorDependencies: applicationModuleVendorDependencies,
		registerModule: registerModule
	};
})();


text:
import * as assert from 'assert';
import { LineDecoder } from 'vs/base/node/decoder';

suite('Decoder', () => {

	test('decoding', () => {
		const lineDecoder = new LineDecoder();
		let res = lineDecoder.write(Buffer.from('hello'));
		assert.strictEqual(res.length, 0);

		res = lineDecoder.write(Buffer.from('\nworld'));
		assert.strictEqual(res[0], 'hello');
		assert.strictEqual(res.length, 1);

		assert.strictEqual(lineDecoder.end(), 'world');
	});
});


text:
package cli

import (
	"fmt"
	"io/ioutil"
	"os"
	"path"

	"github.com/Sirupsen/logrus"
	"github.com/docker/infrakit/pkg/discovery/local"
	"github.com/docker/infrakit/pkg/rpc/server"
)

// EnsureDirExists makes sure the directory where the socket file will be placed exists.
func EnsureDirExists(dir string) {
	os.MkdirAll(dir, 0700)
}

// RunPlugin runs a plugin server, advertising with the provided name for discovery.
// The plugin should conform to the rpc call convention as implemented in the rpc package.
func RunPlugin(name string, plugin server.VersionedInterface, more ...server.VersionedInterface) {
	dir := local.Dir()
	EnsureDirExists(dir)

	socketPath := path.Join(dir, name)
	pidPath := path.Join(dir, name+".pid")
	run("", socketPath, pidPath, plugin, more...)
}

// RunListener runs a plugin server, listening at listen address, and
// advertising with the provided name for discovery.
// The plugin should conform to the rpc call convention as implemented in the rpc package.
func RunListener(listen, name string, plugin server.VersionedInterface, more ...server.VersionedInterface) {
	dir := local.Dir()
	EnsureDirExists(dir)

	discoverPath := path.Join(dir, name+".listen")
	pidPath := path.Join(dir, name+".pid")
	run(listen, discoverPath, pidPath, plugin, more...)
}

func run(listen, discoverPath, pidPath string,
	plugin server.VersionedInterface, more ...server.VersionedInterface) {

	var stoppable server.Stoppable

	if listen != "" {
		s, err := server.StartListenerAtPath(listen, discoverPath, plugin, more...)
		if err != nil {
			logrus.Error(err)
		}
		stoppable = s
	} else {
		s, err := server.StartPluginAtPath(discoverPath, plugin, more...)
		if err != nil {
			logrus.Error(err)
		}
		stoppable = s
	}

	// write PID file
	err := ioutil.WriteFile(pidPath, []byte(fmt.Sprintf("%v", os.Getpid())), 0644)
	if err != nil {
		logrus.Error(err)
	}
	logrus.Infoln("PID file at", pidPath)
	if stoppable != nil {
		stoppable.AwaitStopped()
	}

	// clean up
	os.Remove(pidPath)
	logrus.Infoln("Removed PID file at", pidPath)

	os.Remove(discoverPath)
	logrus.Infoln("Removed discover file at", discoverPath)
}


text:
'use strict';

var Marionette = require('backbone.marionette'),
    HomeView = require('./views/home'),
    AboutView = require('./views/about');

var Router = Marionette.AppRouter.extend({

    routes : {
        '': 'default',
        'about': 'about'
    },

    default: function () {
        var view = new HomeView();
        this.options.layout.content.show(view);
    },

    about: function () {
        var view = new AboutView();
        this.options.layout.content.show(view);
    }

});

module.exports = Router;


text:
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.chrome.browser.metrics;

import android.os.Build;
import android.os.SystemClock;

import org.chromium.base.ObserverList;
import org.chromium.base.ThreadUtils;
import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace;
import org.chromium.base.annotations.NativeMethods;
import org.chromium.base.compat.ApiHelperForN;

/**
 * Utilities to support startup metrics - Android version.
 */
@JNINamespace("chrome::android")
public class UmaUtils {
    /** Observer for this class. */
    public interface Observer {
        /**
         * Called when hasComeToForeground() changes from false to true.
         */
        void onHasComeToForeground();
    }

    private static ObserverList<Observer> sObservers;

    /** Adds an observer. */
    public static boolean addObserver(Observer observer) {
        ThreadUtils.assertOnUiThread();
        if (sObservers == null) sObservers = new ObserverList<>();
        return sObservers.addObserver(observer);
    }

    /** Removes an observer. */
    public static boolean removeObserver(Observer observer) {
        ThreadUtils.assertOnUiThread();
        if (sObservers == null) return false;
        return sObservers.removeObserver(observer);
    }

    // All these values originate from SystemClock.uptimeMillis().
    private static long sApplicationStartTimeMs;
    private static long sForegroundStartTimeMs;
    private static long sBackgroundTimeMs;

    private static boolean sSkipRecordingNextForegroundStartTimeForTesting;

    // Will short-circuit out of the next recordForegroundStartTime() call.
    public static void skipRecordingNextForegroundStartTimeForTesting() {
        sSkipRecordingNextForegroundStartTimeForTesting = true;
    }

    /**
     * Record the time in the application lifecycle at which Chrome code first runs
     * (Application.attachBaseContext()).
     */
    public static void recordMainEntryPointTime() {
        // We can't simply pass this down through a JNI call, since the JNI for chrome
        // isn't initialized until we start the native content browser component, and we
        // then need the start time in the C++ side before we return to Java. As such we
        // save it in a static that the C++ can fetch once it has initialized the JNI.
        sApplicationStartTimeMs = SystemClock.uptimeMillis();
    }

    /**
     * Record the time at which Chrome was brought to foreground.
     */
    public static void recordForegroundStartTime() {
        if (sSkipRecordingNextForegroundStartTimeForTesting) {
            sSkipRecordingNextForegroundStartTimeForTesting = false;
            return;
        }

        // Since this can be called from multiple places (e.g. ChromeActivitySessionTracker
        // and FirstRunActivity), only set the time if it hasn't been set previously or if
        // Chrome has been sent to background since the last foreground time.
        if (sForegroundStartTimeMs == 0 || sForegroundStartTimeMs < sBackgroundTimeMs) {
            if (sObservers != null && sForegroundStartTimeMs == 0) {
                for (Observer observer : sObservers) {
                    observer.onHasComeToForeground();
                }
            }

            sForegroundStartTimeMs = SystemClock.uptimeMillis();
        }
    }

    /**
     * Record the time at which Chrome was sent to background.
     */
    public static void recordBackgroundTime() {
        sBackgroundTimeMs = SystemClock.uptimeMillis();
    }

    /**
     * Determines if Chrome was brought to foreground.
     */
    public static boolean hasComeToForeground() {
        return sForegroundStartTimeMs != 0;
    }

    /**
     * Determines if Chrome was brought to background.
     */
    public static boolean hasComeToBackground() {
        return sBackgroundTimeMs != 0;
    }

    /**
     * Determines if this client is eligible to send metrics and crashes based on sampling. If it
     * is, and there was user consent, then metrics and crashes would be reported
     */
    public static boolean isClientInMetricsReportingSample() {
        return UmaUtilsJni.get().isClientInMetricsReportingSample();
    }

    /**
     * Sets whether metrics reporting was opt-in or not. If it was opt-in, then the enable checkbox
     * on first-run was default unchecked. If it was opt-out, then the checkbox was default checked.
     * This should only be set once, and only during first-run.
     */
    public static void recordMetricsReportingDefaultOptIn(boolean optIn) {
        UmaUtilsJni.get().recordMetricsReportingDefaultOptIn(optIn);
    }

    @CalledByNative
    public static long getApplicationStartTime() {
        return sApplicationStartTimeMs;
    }

    @CalledByNative
    public static long getProcessStartTime() {
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
            return 0;
        }
        return ApiHelperForN.getStartUptimeMillis();
    }

    @NativeMethods
    interface Natives {
        boolean isClientInMetricsReportingSample();
        void recordMetricsReportingDefaultOptIn(boolean optIn);
    }
}


text:
package fi.uta.fsd.metka.transfer.settings;

import fi.uta.fsd.metka.model.general.ConfigurationKey;

public class JSONListEntry {
    private UploadJsonRequest.JsonType type;
    private String title;
    private ConfigurationKey configKey;
    private String jsonKey;

    public UploadJsonRequest.JsonType getType() {
        return type;
    }

    public void setType(UploadJsonRequest.JsonType type) {
        this.type = type;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public ConfigurationKey getConfigKey() {
        return configKey;
    }

    public void setConfigKey(ConfigurationKey configKey) {
        this.configKey = configKey;
    }

    public String getJsonKey() {
        return jsonKey;
    }

    public void setJsonKey(String jsonKey) {
        this.jsonKey = jsonKey;
    }
}


text:
set -eux -o pipefail

prjdir=`git rev-parse --show-toplevel`

build_binary() {
  docker run \
    --rm \
    -v $prjdir:/go/src/github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME \
    -w /go/src/github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME \
    -e CIRCLE_TAG \
    -e CIRCLE_SHA1 \
    -e CIRCLE_PROJECT_USERNAME \
    -e CIRCLE_PROJECT_REPONAME \
    -e API_EMAIL \
    -e API_USERNAME \
    casualjim/gox -ldflags "-X github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/cmd/swagger/commands.Commit=${CIRCLE_SHA1} -X github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/cmd/swagger/commands.Version=${CIRCLE_TAG}" -output "./dist/bin/{{.Dir}}_{{.OS}}_{{.Arch}}" "$@" ./cmd/swagger
}

prepare() {
  rm -rf $prjdir/dist
  mkdir -p $prjdir/dist/{bin,build}
  mkdir -p $prjdir/dist/linux/amd64/usr/bin
}

prepare_linuxpkg() {
  cp $prjdir/dist/bin/swagger_linux_amd64 $prjdir/dist/linux/amd64/usr/bin/swagger
}

build_linuxpkg() {
  docker run \
    --rm \
    -v $prjdir:/go/src/github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME \
    -w /go/src/github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME \
    -e CIRCLE_TAG \
    -e CIRCLE_SHA1 \
    -e CIRCLE_PROJECT_USERNAME \
    -e CIRCLE_PROJECT_REPONAME \
    -e API_EMAIL \
    -e API_USERNAME \
    casualjim/fpm -t $1 -p ./dist/build -s dir -C ./dist/linux/amd64 -v $CIRCLE_TAG -n swagger --license "ASL 2.0" -a x86_64 -m $API_EMAIL --url "https://goswagger.io" usr
}

upload_to_github() {
  echo "uploading to github"
  cd $prjdir/dist/bin
  sha1sum * > sha1sum.txt
  sha256sum * > sha256sum.txt

  github-release release -u $CIRCLE_PROJECT_USERNAME -r $CIRCLE_PROJECT_REPONAME -t $CIRCLE_TAG -d "$(cat $prjdir/notes/v${CIRCLE_TAG}.md)"
  for f in $(ls .); do
    github-release upload -u $CIRCLE_PROJECT_USERNAME -r $CIRCLE_PROJECT_REPONAME -t $CIRCLE_TAG -n $f -f $f
  done
}

upload_to_bintray() {
  cd $prjdir
  curl \
    --retry 10 \
    --retry-delay 5 \
    -T ./dist/build/swagger-${CIRCLE_TAG//-/_}-1.x86_64.rpm \
    -u${API_USERNAME}:${BINTRAY_TOKEN} \
    https://api.bintray.com/content/go-swagger/goswagger-rpm/swagger/${CIRCLE_TAG}/swagger-${CIRCLE_TAG//-/_}-1.x86_64.rpm

  curl --retry 10 --retry-delay 5 -XPOST -u${API_USERNAME}:${BINTRAY_TOKEN} https://api.bintray.com/content/go-swagger/goswagger-rpm/swagger/${CIRCLE_TAG}/publish

  curl \
    --retry 10 \
    --retry-delay 5 \
    -T ./dist/build/swagger_${CIRCLE_TAG}_amd64.deb \
    -u${API_USERNAME}:${BINTRAY_TOKEN} \
    "https://api.bintray.com/content/go-swagger/goswagger-debian/swagger/${CIRCLE_TAG}/swagger_${CIRCLE_TAG}_amd64.deb;deb_distribution=ubuntu;deb_component=main;deb_architecture=amd64"

    curl --retry 10 --retry-delay 5 -XPOST -u${API_USERNAME}:${BINTRAY_TOKEN} https://api.bintray.com/content/go-swagger/goswagger-debian/swagger/${CIRCLE_TAG}/publish
}

deploy_docker() {
  cd $prjdir
  docker run --rm -it -v `pwd`:/go/src/github.com/go-swagger/go-swagger -w /go/src/github.com/go-swagger/go-swagger golang:1.7-alpine go build -o ./dist/swagger-musl  -a -tags netgo -installsuffix netgo ./cmd/swagger
  docker build -t quay.io/goswagger/swagger:$CIRCLE_TAG .
  docker tag quay.io/goswagger/swagger:$CIRCLE_TAG quay.io/goswagger/swagger:latest
  docker login -u $API_USERNAME -e $API_EMAIL -p $QUAY_PASS https://quay.io
  docker push quay.io/goswagger/swagger
}

prepare

# build binaries
build_binary -os="linux darwin windows" -arch="amd64 386"
build_binary -os="linux" -arch="arm64 arm"

# build linux packages
prepare_linuxpkg
build_linuxpkg deb
build_linuxpkg rpm

# upload binary packages
upload_to_github
upload_to_bintray

deploy_docker


text:
struct lua_State;

namespace Lumix
{

namespace FS
{
class IFile;
}

class Renderer;
class Shader;
class ShaderBinary;

class ShaderInstance
{
public:
	explicit ShaderInstance(Shader& shader)
		: m_shader(shader)
	{
		for (int i = 0; i < lengthOf(m_program_handles); ++i)
		{
			m_program_handles[i] = BGFX_INVALID_HANDLE;
			m_binaries[i * 2] = nullptr;
			m_binaries[i * 2 + 1] = nullptr;
		}
	}
	~ShaderInstance();

	bgfx::ProgramHandle m_program_handles[32];
	ShaderBinary* m_binaries[64];
	uint32 m_define_mask;
	Shader& m_shader;
};

struct LUMIX_RENDERER_API ShaderCombinations
{
	ShaderCombinations();

	typedef char Define[40];
	typedef StaticString<20> Pass;
	typedef uint8 Defines[16];
	typedef Pass Passes[32];

	int m_pass_count;
	int m_define_count;
	int m_vs_local_mask[32];
	int m_fs_local_mask[32];
	Defines m_defines;
	Passes m_passes;
	uint32 m_all_defines_mask;
};

class LUMIX_RENDERER_API ShaderBinary : public Resource
{
public:
	ShaderBinary(const Path& path, ResourceManager& resource_manager, IAllocator& allocator);
	bgfx::ShaderHandle getHandle() { return m_handle; }

private:
	void unload() override;
	bool load(FS::IFile& file) override;

private:
	bgfx::ShaderHandle m_handle;
};

class LUMIX_RENDERER_API Shader : public Resource
{
	friend class ShaderInstance;

public:
	struct TextureSlot
	{
		TextureSlot() { reset(); }

		void reset() { m_name[0] = m_uniform[0] = '\0'; m_define_idx = -1; m_is_atlas = false; m_uniform_handle = BGFX_INVALID_HANDLE; }

		char m_name[30];
		char m_uniform[30];
		int m_define_idx;
		bool m_is_atlas;
		bgfx::UniformHandle m_uniform_handle;
	};

	struct Uniform
	{
		enum Type
		{
			INT,
			FLOAT,
			MATRIX4,
			TIME,
			COLOR,
			VEC3
		};

		char name[32];
		uint32 name_hash;
		Type type;
		bgfx::UniformHandle handle;
	};

public:
	static const int MAX_TEXTURE_SLOT_COUNT = 16;

public:
	Shader(const Path& path, ResourceManager& resource_manager, IAllocator& allocator);
	~Shader();

	bool hasDefine(uint8 define_idx) const;
	ShaderInstance& getInstance(uint32 mask);
	ShaderInstance* getFirstInstance();
	const TextureSlot& getTextureSlot(int index) const { return m_texture_slots[index]; }
	int getTextureSlotCount() const { return m_texture_slot_count; }
	Renderer& getRenderer();
	Uniform& getUniform(int index) { return m_uniforms[index]; }
	int getUniformCount() const { return m_uniforms.size(); }

	static bool getShaderCombinations(Renderer& renderer,
		const char* shader_content,
		ShaderCombinations* output);

	IAllocator& m_allocator;
	Array<ShaderInstance*> m_instances;
	ShaderCombinations m_combintions;
	uint64 m_render_states;
	TextureSlot m_texture_slots[MAX_TEXTURE_SLOT_COUNT];
	int m_texture_slot_count;
	Array<Uniform> m_uniforms;

private:
	bool generateInstances();
	uint32 getDefineMaskFromDense(uint32 dense) const;

	void onBeforeReady() override;
	void unload(void) override;
	bool load(FS::IFile& file) override;
};

} // ~namespace Lumix


text:
<?php

namespace MarvinLabs\SetupWizard\Steps;

class RequirementsStep extends BaseStep
{
    public function __construct($id)
    {
        parent::__construct($id);
    }

    public function getFormData()
    {
        $formData = ['requirements' => []];

        // PHP version
        $requiredPhpVersion = $this->getRequiredPhpVersion();
        $formData['requirements'][] = [
            'label' => trans('setup_wizard::steps.requirements.view.php_version', ['ver' => $requiredPhpVersion]),
            'check' => $this->checkPhpVersion($requiredPhpVersion),
        ];

        // PHP extensions
        $requiredPhpExtensions = $this->getRequiredPhpExtensions();
        foreach ($requiredPhpExtensions as $ext) {
            $formData['requirements'][] = [
                'label' => trans('setup_wizard::steps.requirements.view.php_extension', ['name' => $ext]),
                'check' => $this->checkPhpExtensionEnabled($ext),
            ];
        }

        return $formData;
    }

    public function apply($formData)
    {
        // PHP version
        $requiredPhpVersion = $this->getRequiredPhpVersion();
        if (!$this->checkPhpVersion($requiredPhpVersion)) return false;

        // PHP extensions
        $requiredPhpExtensions = $this->getRequiredPhpExtensions();
        foreach ($requiredPhpExtensions as $ext) {
            if (!$this->checkPhpExtensionEnabled($ext)) return false;
        }

        return true;
    }

    public function undo()
    {
        return true;
    }

    protected function getRequiredPhpVersion()
    {
        return config('setup_wizard.requirements.php_version');
    }

    protected function checkPhpVersion($requiredPhpVersion)
    {
        $currentPhpVersion = phpversion();

        return version_compare($requiredPhpVersion, $currentPhpVersion, '<=');
    }

    protected function getRequiredPhpExtensions()
    {
        return config('setup_wizard.requirements.php_extensions');
    }

    protected function checkPhpExtensionEnabled($ext)
    {
        return extension_loaded($ext);
    }

}


text:
#include <complex.h>
#include <math.h>

long double
cargl(long double complex z)
{
	return (atan2l(cimagl(z), creall(z)));
}


text:
using OpenMetaverse;
using OpenMetaverse.StructuredData;
using Aurora.Framework;

namespace Aurora.ScriptEngine.AuroraDotNetEngine
{
    /// <summary>
    ///   These plugins provide for the ability to hook up onto scripts for events and are called each iteration by the script engine event thread
    /// </summary>
    public interface IScriptPlugin
    {
        /// <summary>
        ///   Returns the plugin name
        /// </summary>
        /// <returns></returns>
        string Name { get; }

        /// <summary>
        ///   Start the plugin
        /// </summary>
        /// <param name = "engine"></param>
        void Initialize(ScriptEngine engine);

        /// <summary>
        ///   Add the given region to the plugin that it will be serving
        /// </summary>
        /// <param name = "scene"></param>
        void AddRegion(IScene scene);

        /// <summary>
        ///   Check the module and all scripts that it may be being used by
        ///   This is called every iteration by the event thread
        /// </summary>
        /// <returns></returns>
        bool Check();

        /// <summary>
        ///   Serialize any data that we may have for the given script
        /// </summary>
        /// <param name = "itemID"></param>
        /// <param name = "primID"></param>
        /// <returns></returns>
        OSD GetSerializationData(UUID itemID, UUID primID);

        /// <summary>
        ///   Create from the information that we serialized earlier the info that we have for the given script and add it back to the script
        /// </summary>
        /// <param name = "itemID"></param>
        /// <param name = "objectID"></param>
        /// <param name = "data"></param>
        void CreateFromData(UUID itemID, UUID objectID, OSD data);

        /// <summary>
        ///   Remove the given script from the plugin
        /// </summary>
        /// <param name = "primID"></param>
        /// <param name = "itemID"></param>
        void RemoveScript(UUID primID, UUID itemID);
    }
}


text:
<?php

namespace Themer;
use Themer\Parser;

/**
 * Themer Loader Class
 *
 * Load's Themer views and assets
 *
 * @package   Themer
 * @author    Braden Schaeffer
 */
class Load {

  protected static $asset_headers = array(
    'css' => 'text/css',
    'js'  => 'text/javascript',
    'jpg' => 'image/jpg',
    'png' => 'image/png',
    'gif' => 'image/gif'
  );

  private static $_ob_level;

  /**
   * Auto-initializer called by the autoloader. Sets the ob level.
   *
   * @static
   * @access  public
   * @return  void
   */
  public static function __autoinit()
  {
    static::$_ob_level = ob_get_level();
  }

  /**
   * Load the Themer application front.
   *
   * @static
   * @access  public
   * @return  void
   */
  public static function application()
  {
    $theme_contents = \Themer::load_theme();

    $data = array(
      'metas'                 => Parser\Meta::load($theme_contents),
      'info' => array(
        'Title'               => Data::get('Title'),
        'Description'         => Data::get('Description'),
      ),
      'pages'                 => Data::get('Pages'),
      'advanced' => array(
        'AskEnabled'          => Data::get('AskEnabled'),
        'AskLabel'            => Data::get('AskLabel'),
        'CustomCSS'           => Data::get('CustomCSS'),
        'SubmissionsEnabled'  => Data::get('SubmissionsEnabled'),
        'SubmitLabel'         => Data::get('SubmitLabel'),
        'TwitterUsername'     => Data::get('TwitterUsername'),
        '_per_page'           => Data::get('_per_page'),
      )
    );

    $themer = static::view('application', array('data' => $data), TRUE);

    static::display_html($themer);
  }

  /**
   * Loads a specific Themer asset.
   *
   * @static
   * @access  public
   * @param   string  the asset to load
   * @return  void
   */
  public static function asset($asset_path = '')
  {
    $path = THEMER_BASEPATH.'themer/public/'.$asset_path;

    if( ! @file_exists($path))
    {
      self::_not_found($asset_path);
    }

    header("HTTP/1.0 200 OK");

    $tmp = explode('.', $path);
    $ext = end($tmp);

    if(isset(static::$asset_headers[$ext]))
    {
      header("Content-Type: ".static::$asset_headers[$ext], TRUE);
    }

    echo file_get_contents($path);
    exit(1);
  }

  /**
   * Loads a view for the Themer application. The general idea for his
   * code was taken from CodeIgniter v2.0.0 (beta).
   *
   * @access  public
   * @param   string  the view file to load
   * @param   array   the optional variables to load
   * @param   bool    whether to return the view or not
   * @return  void
   */
  public static function view($_t_file = '', $_t_vars = array(), $_t_return = FALSE)
  {
    $_t_path = THEMER_BASEPATH.'themer/views/'.$_t_file.'.php';

    if( ! @file_exists($_t_path))
    {
      self::_not_found('themer/views/'.$_t_file.'.php');
    }

    if(is_array($_t_vars))
    {
      extract($_t_vars);
    }

    ob_start();

    require $_t_path;

    if($_t_return)
    {
      $contents = ob_get_contents();
      @ob_end_clean();
      return $contents;
    }

    if(ob_get_level() > static::$_ob_level + 1)
    {
      ob_end_flush();
    }
    else
    {
      echo ob_get_contents();
      @ob_end_clean();
    }
  }

  /**
   * Outputs HTML content to the browser.
   *
   * @static
   * @access  public
   * @param   string  the html content
   * @return  void
   */
  public static function display_html($html = '')
  {
    header("HTTP/1.0 200 OK", TRUE);
    header('Content-Type: text/html', TRUE);
    exit($html);
  }

  /**
   * Sets 404 headers and displays a simple message about the file.
   *
   * @static
   * @access  private
   * @param   string  the file path that could not be loaded
   * @return  void
   */
  private static function _not_found($path = '')
  {
    header('HTTP/1.0 404 Not Found', TRUE);
    exit("
File not found: $path
");
  }
}

/* End of file load.php */
/* Location: ./themer/load.php */


text:
package de.tum.viewmaintenance.Operations;

import com.datastax.driver.core.Row;
import de.tum.viewmaintenance.trigger.TriggerRequest;
import de.tum.viewmaintenance.view_table_structure.Table;

import java.util.List;

/**
 * Created by anarchy on 8/13/15.
 */
public abstract class GenericOperation {
    private Row deltaTableRecord;
    private GenericOperation sqlOperation;
    private List<Table> inputViewTable;
    private List<Table> operationViewTable;

    public void processOperation(String type, TriggerRequest triggerRequest) {
        if (type.equalsIgnoreCase("insert")) {
            insertTrigger(triggerRequest);
        } else if (type.equalsIgnoreCase("update")) {
            updateTrigger(triggerRequest);
        } else if (type.equalsIgnoreCase("delete")) {
            deleteTrigger(triggerRequest);
        }
    }
    public abstract boolean insertTrigger(TriggerRequest triggerRequest);
    public abstract boolean updateTrigger(TriggerRequest triggerRequest);
    public abstract boolean deleteTrigger(TriggerRequest triggerRequest);

}


text:
package org.elasticsearch.spark.sql

import java.sql.Date
import java.sql.Timestamp
import java.util.{Map => JMap}
import scala.collection.JavaConverters.mapAsScalaMapConverter
import scala.collection.{Map => SMap}
import scala.collection.Seq
import org.apache.spark.sql.Row
import org.apache.spark.sql.types.{ArrayType, DataType, DataTypes, MapType, StructType}
import org.apache.spark.sql.types.DataTypes.BinaryType
import org.apache.spark.sql.types.DataTypes.BooleanType
import org.apache.spark.sql.types.DataTypes.ByteType
import org.apache.spark.sql.types.DataTypes.DateType
import org.apache.spark.sql.types.DataTypes.DoubleType
import org.apache.spark.sql.types.DataTypes.FloatType
import org.apache.spark.sql.types.DataTypes.IntegerType
import org.apache.spark.sql.types.DataTypes.LongType
import org.apache.spark.sql.types.DataTypes.ShortType
import org.apache.spark.sql.types.DataTypes.StringType
import org.apache.spark.sql.types.DataTypes.TimestampType
import org.elasticsearch.hadoop.cfg.ConfigurationOptions.ES_SPARK_DATAFRAME_WRITE_NULL_VALUES_DEFAULT
import org.elasticsearch.hadoop.cfg.Settings
import org.elasticsearch.hadoop.serialization.EsHadoopSerializationException
import org.elasticsearch.hadoop.serialization.Generator
import org.elasticsearch.hadoop.serialization.SettingsAware
import org.elasticsearch.hadoop.serialization.builder.FilteringValueWriter
import org.elasticsearch.hadoop.serialization.builder.ValueWriter.Result
import org.elasticsearch.hadoop.util.unit.Booleans

class DataFrameValueWriter(writeUnknownTypes: Boolean = false) extends FilteringValueWriter[Any] with SettingsAware {

  def this() {
    this(false)
  }

  private var writeNullValues: Boolean = Booleans.parseBoolean(ES_SPARK_DATAFRAME_WRITE_NULL_VALUES_DEFAULT)

  override def setSettings(settings: Settings): Unit = {
    super.setSettings(settings)
    writeNullValues = settings.getDataFrameWriteNullValues
  }

  override def write(value: Any, generator: Generator): Result = {
    value match {
      case Tuple2(row, schema: StructType) =>
        writeStruct(schema, row, generator)
      case map: Map[_, _] =>
        writeMapWithInferredSchema(map, generator)
      case seq: Seq[Row] =>
        writeArray(seq, generator)
    }
  }

  private[spark] def writeArray(value: Seq[Row], generator: Generator): Result = {
    if (value.nonEmpty) {
      val schema = value.head.schema
      val result = write(DataTypes.createArrayType(schema), value, generator)
      if (!result.isSuccesful) {
        return handleUnknown(value, generator)
      }
    } else {
      generator.writeBeginArray().writeEndArray()
    }
    Result.SUCCESFUL()
  }

  private[spark] def writeStruct(schema: StructType, value: Any, generator: Generator): Result = {
    value match {
      case r: Row =>
        generator.writeBeginObject()

        schema.fields.view.zipWithIndex foreach {
          case (field, index) =>
            if (shouldKeep(generator.getParentPath,field.name)) {
              if (!r.isNullAt(index)) {
                generator.writeFieldName(field.name)
                val result = write(field.dataType, r(index), generator)
                if (!result.isSuccesful) {
                  return handleUnknown(value, generator)
                }
              } else if (writeNullValues) {
                generator.writeFieldName(field.name)
                generator.writeNull()
              }
            }
        }
        generator.writeEndObject()

        Result.SUCCESFUL()
    }
  }

  private[spark] def write(schema: DataType, value: Any, generator: Generator): Result = {
    schema match {
      case s @ StructType(_)    => writeStruct(s, value, generator)
      case a @ ArrayType(_, _)  => writeArray(a, value, generator)
      case m @ MapType(_, _, _) => writeMap(m, value, generator)
      case _                    => writePrimitive(schema, value, generator)
    }
  }

  private[spark] def writeArray(schema: ArrayType, value: Any, generator: Generator): Result = {
    value match {
      case a: Array[_] => doWriteSeq(schema.elementType, a, generator)
      case s: Seq[_]   => doWriteSeq(schema.elementType, s, generator)
      // unknown array type
      case _           => handleUnknown(value, generator)
    }
  }

  private def doWriteSeq(schema: DataType, value: Seq[_], generator: Generator): Result = {
    generator.writeBeginArray()
    if (value != null) {
      value.foreach { v =>
        val result = write(schema, v, generator)
        if (!result.isSuccesful()) {
          return handleUnknown(value, generator)
        }
      }
    }
    generator.writeEndArray()
    Result.SUCCESFUL()
  }

  private[spark] def writeMap(schema: MapType, value: Any, generator: Generator): Result = {
    value match {
      case sm: SMap[_, _] => doWriteMap(schema, sm, generator)
      case jm: JMap[_, _] => doWriteMap(schema, jm.asScala, generator)
      // unknown map type
      case _              => handleUnknown(value, generator)
    }
  }

  private def doWriteMap(schema: MapType, value: SMap[_, _], generator: Generator): Result = {
    generator.writeBeginObject()

    if (value != null) {
      for ((k, v) <- value) {
        if (shouldKeep(generator.getParentPath(), k.toString())) {
          generator.writeFieldName(k.toString)
          val result = write(schema.valueType, v, generator)
          if (!result.isSuccesful()) {
            return handleUnknown(v, generator)
          }
        }
      }
    }

    generator.writeEndObject()
    Result.SUCCESFUL()
  }

  private def writeMapWithInferredSchema(value: Any, generator: Generator): Result = {
    value match {
      case sm: SMap[_, _] => doWriteMapWithInferredSchema(sm, generator)
      case jm: JMap[_, _] => doWriteMapWithInferredSchema(jm.asScala, generator)
      // unknown map type
      case _              => handleUnknown(value, generator)
    }
  }

  private def doWriteMapWithInferredSchema(map: SMap[_, _], generator: Generator): Result = {
    if (map != null && map.valuesIterator.hasNext) {
      val sampleValueOption = getFirstNotNullElement(map.valuesIterator)
      val schema = inferMapSchema(sampleValueOption)
      doWriteMap(schema, map, generator)
    } else {
      writeEmptyMap(generator)
    }
  }

  private def writeEmptyMap(generator: Generator): Result = {
    generator.writeBeginObject().writeEndObject()
    Result.SUCCESFUL()
  }

  private def inferMapSchema(valueOption: Option[Any]): MapType = {
    if(valueOption.isDefined) {
      val valueType = inferType(valueOption.get)
      MapType(StringType, valueType) //The key type is never read
    } else {
      MapType(StringType, StringType) //Does not matter if the map is empty or has no values
    }
  }

  def inferArraySchema(array: Array[_]): DataType = {
    val EMPTY_ARRAY_TYPE = StringType  //Makes no difference for an empty array
    if (array.isEmpty) {
      EMPTY_ARRAY_TYPE
    } else {
      val sampleValueOption = getFirstNotNullElement(array.iterator)
      if (sampleValueOption.isDefined) {
        inferType(sampleValueOption.get)
      }
      else {
        EMPTY_ARRAY_TYPE
      }
    }
  }

  def getFirstNotNullElement(iterator: Iterator[_]): Option[Any] = {
    iterator.find(value => Option(value).isDefined)
  }

  private def inferType(value: Any): DataType = {
    value match {
      case _: String               => StringType
      case _: Int                  => IntegerType
      case _: Integer              => IntegerType
      case _: Boolean              => BooleanType
      case _: java.lang.Boolean    => BooleanType
      case _: Short                => ShortType
      case _: java.lang.Short      => ShortType
      case _: Long                 => LongType
      case _: java.lang.Long       => LongType
      case _: Double               => DoubleType
      case _: java.lang.Double     => DoubleType
      case _: Float                => FloatType
      case _: java.lang.Float      => FloatType
      case _: Timestamp            => TimestampType
      case _: Date                 => DateType
      case _: Array[Byte]          => BinaryType
      case array: Array[_]         => ArrayType(inferArraySchema(array))
      case map: Map[_, _]          => inferMapSchema(getFirstNotNullElement(map.valuesIterator))
    }
  }

  private[spark] def writePrimitive(schema: DataType, value: Any, generator: Generator): Result = {
    if (value == null) {
      generator.writeNull()
    }
    else schema match {
      case BinaryType    => generator.writeBinary(value.asInstanceOf[Array[Byte]])
      case BooleanType   => generator.writeBoolean(value.asInstanceOf[Boolean])
      case ByteType      => generator.writeNumber(value.asInstanceOf[Byte])
      case ShortType     => generator.writeNumber(value.asInstanceOf[Short])
      case IntegerType   => generator.writeNumber(value.asInstanceOf[Int])
      case LongType      => generator.writeNumber(value.asInstanceOf[Long])
      case DoubleType    => generator.writeNumber(value.asInstanceOf[Double])
      case FloatType     => generator.writeNumber(value.asInstanceOf[Float])
      case TimestampType => generator.writeNumber(value.asInstanceOf[Timestamp].getTime())
      case DateType      => generator.writeNumber(value.asInstanceOf[Date].getTime())
      case StringType    => generator.writeString(value.toString)
      case _             => {
        val className = schema.getClass().getName()
        if ("org.apache.spark.sql.types.DecimalType".equals(className) || "org.apache.spark.sql.catalyst.types.DecimalType".equals(className)) {
          throw new EsHadoopSerializationException("Decimal types are not supported by Elasticsearch - consider using a different type (such as string)")
        }
        return handleUnknown(value, generator)
      }
    }

    Result.SUCCESFUL()
  }

  protected def handleUnknown(value: Any, generator: Generator): Result = {
    if (!writeUnknownTypes) {
      println("can't handle type " + value);
      Result.FAILED(value)
    } else {
      generator.writeString(value.toString())
      Result.SUCCESFUL()
    }
  }
}


text:
#include "PrometheusExposerWrapper.h"

#include <cinttypes>

namespace org::apache::nifi::minifi::extensions::prometheus {

PrometheusExposerWrapper::PrometheusExposerWrapper(uint32_t port)
    : exposer_(std::to_string(port)) {
  logger_->log_info("Started Prometheus metrics publisher on port %" PRIu32, port);
}

void PrometheusExposerWrapper::registerMetric(const std::shared_ptr<PublishedMetricGaugeCollection>& metric) {
  exposer_.RegisterCollectable(metric);
}

void PrometheusExposerWrapper::removeMetric(const std::shared_ptr<PublishedMetricGaugeCollection>& metric) {
  exposer_.RemoveCollectable(metric);
}

}  // namespace org::apache::nifi::minifi::extensions::prometheus


text:
@implementation NCDBCertMasteryLevel

// Insert code here to add functionality to your managed object subclass

@end


text:
#include <cntr2/oo_bridge.h>
#include <memheap/heap_def.h>

static unknown *pointer_clone(const unknown* ref_x, pf_alloc alc, void* heap) {
	/* just return the reference that ref_x points to */
	return (unknown*)ref_x;
}
static void pointer_destroy(const unknown* ref_x, pf_dealloc dlc, void* heap) {
	/* no need to destroy */
}
static compres pointer_compare_to(const unknown* ref_x, const unknown* ref_y) {
	/* just use the address to compare */
	if (ref_x < ref_y)
		return -1;
	else if (ref_x > ref_y)
		return 1;
	return 0;
}
static bool pointer_equals(const unknown* ref_x, const unknown* ref_y) {
	/* just use the address to compare */
	return ref_x == ref_y;
}
static hashcode pointer_hashcode(const unknown* ref_x) {
	// TODO
	return (hashcode)ref_x;
}
unknown_traits pointer_traits = {
	pointer_destroy,
	pointer_clone,
	pointer_compare_to,
	pointer_equals,
	pointer_hashcode
};

static unknown *int_clone(const unknown* ref_x, pf_alloc alc, void* heap) {
	int* new_int = (int*)alloc(alc, heap, sizeof(int));
	*new_int = *(int*)ref_x;
	return (unknown*)new_int;
}
static void int_destroy(const unknown* ref_x, pf_dealloc dlc, void* heap) {
	dealloc(dlc, heap, (void*)ref_x);
}
static compres int_compare_to(const unknown* ref_x, const unknown* ref_y) {
	int x = *(int*)ref_x;
	int y = *(int*)ref_y;

	if (x < y)
		return -1;
	else if (x > y)
		return 1;
	return 0;
}
static bool int_equals(const unknown* ref_x, const unknown* ref_y) {
	int x = *(int*)ref_x;
	int y = *(int*)ref_y;
	return x == y;
}
static hashcode int_hashcode(const unknown* ref_x) {
	// TODO
	return (hashcode)(*(int*)ref_x);
}
unknown_traits int_traits = {
	int_destroy,
	int_clone,
	int_compare_to,
	int_equals,
	int_hashcode
};

static unknown *longint_clone(const unknown* ref_x, pf_alloc alc, void* heap) {
	longint* new_longint = (longint*)alloc(alc, heap, sizeof(longint));
	*new_longint = *(longint*)ref_x;
	return (unknown*)new_longint;
}
static void longint_destroy(const unknown* ref_x, pf_dealloc dlc, void* heap) {
	dealloc(dlc, heap, (void*)ref_x);
}
static compres longint_compare_to(const unknown* ref_x, const unknown* ref_y) {
	longint x = *(longint*)ref_x;
	longint y = *(longint*)ref_y;

	if (x < y)
		return -1;
	else if (x > y)
		return 1;
	return 0;
}
static bool longint_equals(const unknown* ref_x, const unknown* ref_y) {
	longint x = *(longint*)ref_x;
	longint y = *(longint*)ref_y;
	return x == y;
}
static hashcode longint_hashcode(const unknown* ref_x) {
	// TODO
	return (hashcode)(*(longint*)ref_x);
}
unknown_traits longint_traits = {
	longint_destroy,
	longint_clone,
	longint_compare_to,
	longint_equals,
	longint_hashcode
};

static unknown *float_clone(const unknown* ref_x, pf_alloc alc, void* heap) {
	float* new_float = (float*)alloc(alc, heap, sizeof(float));
	*new_float = *(float*)ref_x;
	return (unknown*)new_float;
}
static void float_destroy(const unknown* ref_x, pf_dealloc dlc, void* heap) {
	dealloc(dlc, heap, (void*)ref_x);
}
static compres float_compare_to(const unknown* ref_x, const unknown* ref_y) {
	float x = *(float*)ref_x;
	float y = *(float*)ref_y;

	if (x < y)
		return -1;
	else if (x > y)
		return 1;
	return 0;
}
static bool float_equals(const unknown* ref_x, const unknown* ref_y) {
	float x = *(float*)ref_x;
	float y = *(float*)ref_y;
	return x == y;
}
static hashcode float_hashcode(const unknown* ref_x) {
	// TODO
	return (hashcode)(*(float*)ref_x);
}
unknown_traits float_traits = {
	float_destroy,
	float_clone,
	float_compare_to,
	float_equals,
	float_hashcode
};

static unknown *double_clone(const unknown* ref_x, pf_alloc alc, void* heap) {
	double* new_double = (double*)alloc(alc, heap, sizeof(double));
	*new_double = *(double*)ref_x;
	return (unknown*)new_double;
}
static void double_destroy(const unknown* ref_x, pf_dealloc dlc, void* heap) {
	dealloc(dlc, heap, (void*)ref_x);
}
static compres double_compare_to(const unknown* ref_x, const unknown* ref_y) {
	double x = *(double*)ref_x;
	double y = *(double*)ref_y;

	if (x < y)
		return -1;
	else if (x > y)
		return 1;
	return 0;
}
static bool double_equals(const unknown* ref_x, const unknown* ref_y) {
	double x = *(double*)ref_x;
	double y = *(double*)ref_y;
	return x == y;
}
static hashcode double_hashcode(const unknown* ref_x) {
	// TODO
	return (hashcode)(*(double*)ref_x);
}
unknown_traits double_traits = {
	double_destroy,
	double_clone,
	double_compare_to,
	double_equals,
	double_hashcode
};

static unknown *char_clone(const unknown* ref_x, pf_alloc alc, void* heap) {
	char* new_char = (char*)alloc(alc, heap, sizeof(char));
	*new_char = *(char*)ref_x;
	return (unknown*)new_char;
}
static void char_destroy(const unknown* ref_x, pf_dealloc dlc, void* heap) {
	dealloc(dlc, heap, (void*)ref_x);
}
static compres char_compare_to(const unknown* ref_x, const unknown* ref_y) {
	char x = *(char*)ref_x;
	char y = *(char*)ref_y;

	if (x < y)
		return -1;
	else if (x > y)
		return 1;
	return 0;
}
static bool char_equals(const unknown* ref_x, const unknown* ref_y) {
	char x = *(char*)ref_x;
	char y = *(char*)ref_y;
	return x == y;
}
static hashcode char_hashcode(const unknown* ref_x) {
	// TODO
	return (hashcode)(*(char*)ref_x);
}
unknown_traits char_traits = {
	char_destroy,
	char_clone,
	char_compare_to,
	char_equals,
	char_hashcode
};

#include <string.h>
static unknown *string_clone(const unknown* ref_x, pf_alloc alc, void* heap) {
	char* old_str = (char*)ref_x;
	int str_len = (int)strlen(old_str);
	char* new_str = (char*)alloc(alc, heap, sizeof(char) * (str_len + 1));
	strcpy(new_str, old_str);
	return (unknown*)new_str;
}
static void string_destroy(const unknown* ref_x, pf_dealloc dlc, void* heap) {
	dealloc(dlc, heap, (void*)ref_x);
}
static compres string_compare_to(const unknown* ref_x, const unknown* ref_y) {
	char* x = (char*)ref_x;
	char* y = (char*)ref_y;

	int res = strcmp(x, y);

	return res;
}
static bool string_equals(const unknown* ref_x, const unknown* ref_y) {
	char* x = (char*)ref_x;
	char* y = (char*)ref_y;

	int res = strcmp(x, y);

	return res == 0;
}
static hashcode string_hashcode(const unknown* ref_x) {
	// TODO
	return (hashcode)((char*)ref_x);
}
unknown_traits string_traits = {
	string_destroy,
	string_clone,
	string_compare_to,
	string_equals,
	string_hashcode
};


text:
<!DOCTYPE html>

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

    <title>FoodBuddy Reservations</span</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">

    <link href="css/shop-homepage.css" rel="stylesheet">

	<link href="css/cart-page.css" rel="stylesheet">

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation

                </button>
                FoodBuddy

                        Shop

                        Profile

                        Preferences

                        Q&A

                        Log Off

Reservation Cart

				</form>

					Day
					Time
					Location
					Food Name
					Amount

					Monday
					9:30 pm
					Sam's Mart
					Bananas
					2 lbs.

					Monday
					10:00 pm
					Key Food
					Wheat Bread
					1 loaf

Copyright © Team 14


text:
<?php

class Game_model extends CI_Model
{
	public function __construct()
	{
		parent::__construct();
		$this->load->database();
	}

	public function getUserList() {
		$this->db->select('user1 as user,count(*) as counted',false);
		$this->db->from('game');
		$this->db->group_by('user');
		$query1 = $this->db->get_compiled_select();

		$this->db->select('user2 as user,count(*) as counted',false);
		$this->db->from('game');
		$this->db->group_by('user');
		$query2 = $this->db->get_compiled_select();

		$this->db->select('user3 as user,count(*) as counted',false);
		$this->db->from('game');
		$this->db->group_by('user');
		$query3 = $this->db->get_compiled_select();

		$this->db->select('user4 as user,count(*) as counted',false);
		$this->db->from('game');
		$this->db->group_by('user');
		$query4 = $this->db->get_compiled_select();

		$select_query = $query1.' UNION ALL '.$query2.' UNION ALL '.$query3.' UNION ALL '.$query4;

		$query = $this->db->query('SELECT user,sum(counted) as counted FROM( '.$select_query.' )AS B GROUP BY user ORDER BY counted');

		$result = $query->result_array();

		// var_dump($info);
		// $this->db->join('user');

		// $result = $this->db->get()->result_array();
		return $result;
	}
}


text: import './utility/render';