text:
import gzip
import io
import pytest

import docker

from .api_test import DockerClientTest

class BuildTest(DockerClientTest):
    def test_build_container(self):
        script = io.BytesIO('\n'.join([
            'FROM busybox',
            'MAINTAINER docker-py',
            'RUN mkdir -p /tmp/test',
            'EXPOSE 8080',
            'ADD https://dl.dropboxusercontent.com/u/20637798/silence.tar.gz'
            ' /tmp/silence.tar.gz'
        ]).encode('ascii'))

        self.client.build(fileobj=script)

    def test_build_container_pull(self):
        script = io.BytesIO('\n'.join([
            'FROM busybox',
            'MAINTAINER docker-py',
            'RUN mkdir -p /tmp/test',
            'EXPOSE 8080',
            'ADD https://dl.dropboxusercontent.com/u/20637798/silence.tar.gz'
            ' /tmp/silence.tar.gz'
        ]).encode('ascii'))

        self.client.build(fileobj=script, pull=True)

    def test_build_container_stream(self):
        script = io.BytesIO('\n'.join([
            'FROM busybox',
            'MAINTAINER docker-py',
            'RUN mkdir -p /tmp/test',
            'EXPOSE 8080',
            'ADD https://dl.dropboxusercontent.com/u/20637798/silence.tar.gz'
            ' /tmp/silence.tar.gz'
        ]).encode('ascii'))

        self.client.build(fileobj=script, stream=True)

    def test_build_container_custom_context(self):
        script = io.BytesIO('\n'.join([
            'FROM busybox',
            'MAINTAINER docker-py',
            'RUN mkdir -p /tmp/test',
            'EXPOSE 8080',
            'ADD https://dl.dropboxusercontent.com/u/20637798/silence.tar.gz'
            ' /tmp/silence.tar.gz'
        ]).encode('ascii'))
        context = docker.utils.mkbuildcontext(script)

        self.client.build(fileobj=context, custom_context=True)

    def test_build_container_custom_context_gzip(self):
        script = io.BytesIO('\n'.join([
            'FROM busybox',
            'MAINTAINER docker-py',
            'RUN mkdir -p /tmp/test',
            'EXPOSE 8080',
            'ADD https://dl.dropboxusercontent.com/u/20637798/silence.tar.gz'
            ' /tmp/silence.tar.gz'
        ]).encode('ascii'))
        context = docker.utils.mkbuildcontext(script)
        gz_context = gzip.GzipFile(fileobj=context)

        self.client.build(
            fileobj=gz_context,
            custom_context=True,
            encoding="gzip"
        )

    def test_build_remote_with_registry_auth(self):
        self.client._auth_configs = {
            'https://example.com': {
                'user': 'example',
                'password': 'example',
                'email': 'example@example.com'
            }
        }

        self.client.build(path='https://github.com/docker-library/mongo')

    def test_build_container_with_named_dockerfile(self):
        self.client.build('.', dockerfile='nameddockerfile')

    def test_build_container_with_container_limits(self):
        self.client.build('.', container_limits={
            'memory': 1024 * 1024,
            'cpusetcpus': 1,
            'cpushares': 1000,
            'memswap': 1024 * 1024 * 8
        })

    def test_build_container_invalid_container_limits(self):
        self.assertRaises(
            docker.errors.DockerException,
            lambda: self.client.build('.', container_limits={
                'foo': 'bar'
            })
        )

    def test_build_container_with_tag(self):
        script = io.BytesIO('\n'.join([
            'FROM busybox',
            'MAINTAINER docker-py',
            'RUN mkdir -p /tmp/test',
            'EXPOSE 8080',
            'ADD https://dl.dropboxusercontent.com/u/20637798/silence.tar.gz'
            ' /tmp/silence.tar.gz'
        ]).encode('ascii'))

        self.client.build(fileobj=script, tag='complex_tag-1.0')

    def test_build_container_with_invalid_tag1(self):
        script = io.BytesIO('\n'.join([
            'FROM busybox',
            'MAINTAINER docker-py',
            'RUN mkdir -p /tmp/test',
            'EXPOSE 8080',
            'ADD https://dl.dropboxusercontent.com/u/20637798/silence.tar.gz'
            ' /tmp/silence.tar.gz'
        ]).encode('ascii'))

        with pytest.raises(AttributeError):
            self.client.build(fileobj=script, tag='compleX_tag-1.0')

    def test_build_container_with_invalid_tag2(self):
        script = io.BytesIO('\n'.join([
            'FROM busybox',
            'MAINTAINER docker-py',
            'RUN mkdir -p /tmp/test',
            'EXPOSE 8080',
            'ADD https://dl.dropboxusercontent.com/u/20637798/silence.tar.gz'
            ' /tmp/silence.tar.gz'
        ]).encode('ascii'))

        with pytest.raises(AttributeError):
            self.client.build(fileobj=script, tag='complex!_tag-1.0')


text:
using System.Data.Common;
using System.Data.Entity;
using Abp.Zero.EntityFramework;
using EntityFramework.DynamicFilters;
using Portal.Core;
using Portal.Core.Authorization.Roles;
using Portal.Core.Authorization.Users;
using Portal.Core.Content;
using Portal.Core.Content.Entities;
using Portal.Core.DataFilters;
using Portal.Core.MultiTenancy;
using Portal.Data.Configurations;

namespace Portal.Data
{
    public class PortalDbContext : AbpZeroDbContext<Tenant, Role, User>
    {
        public PortalDbContext()
            : base(CoreConsts.ConnectionStringName)
        {
        }

        /* NOTE:
         *   This constructor is used by ABP to pass connection string defined in DataModule.PreInitialize.
         *   Notice that, actually you will not directly create an instance of PortalDbContext since ABP automatically handles it.
         */
        public PortalDbContext(string nameOrConnectionString)
            : base(nameOrConnectionString)
        {
        }

        //This constructor is used in tests
        public PortalDbContext(DbConnection existingConnection)
         : base(existingConnection, false)
        {
        }

        public PortalDbContext(DbConnection existingConnection, bool contextOwnsConnection)
         : base(existingConnection, contextOwnsConnection)
        {
        }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);

            modelBuilder.Filter(FilterNames.Approved, (IApproved entity) => entity.IsApproved, true);

            // book library
            modelBuilder.Configurations.Add(new BookConfig());
            modelBuilder.Configurations.Add(new EntityConfig<Author>());
            modelBuilder.Configurations.Add(new EntityConfig<Issue>());
            modelBuilder.Configurations.Add(new EntityConfig<Publisher>());
            modelBuilder.Configurations.Add(new EntityConfig<Tag>());
            modelBuilder.Configurations.Add(new ViewerConfig<BookViewer>());
            modelBuilder.Configurations.Add(new CatalogConfig<Book, BookCatalog>());
            modelBuilder.Configurations.Add(new ErrorReportConfig<Book, BookErrorReport>());

            // training library
            modelBuilder.Configurations.Add(new TrainingConfig());
            modelBuilder.Configurations.Add(new EntityConfig<Company>());
            modelBuilder.Configurations.Add(new ViewerConfig<TrainingViewer>());
            modelBuilder.Configurations.Add(new CatalogConfig<Training, TrainingCatalog>());
            modelBuilder.Configurations.Add(new ErrorReportConfig<Training, TrainingErrorReport>());

            // common
            modelBuilder.Configurations.Add(new EntityConfig<Language>());
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
package org.onosproject.routing.fpm;

import org.onosproject.routing.fpm.protocol.FpmHeader;

import java.net.SocketAddress;

/**
 * Listener for events from the route source.
 */
public interface FpmListener {

    /**
     * Handles an FPM message.
     *
     * @param fpmMessage FPM message
     */
    void fpmMessage(FpmHeader fpmMessage);

    /**
     * Signifies that a new peer has attempted to initiate an FPM connection.
     *
     * @param address remote address of the peer
     * @return true if the connection should be admitted, otherwise false
     */
    boolean peerConnected(SocketAddress address);

    /**
     * Signifies that an FPM connection has been disconnected.
     *
     * @param address remote address of the peer
     */
    void peerDisconnected(SocketAddress address);
}


text:
<template name="blogLoading">

</template>


text:
layout: default
title: Professional UX Designer & Code Enthusiast
description:
featured_image: /images/home2.jpg
---

Professional UX Designer & Code Enthusiast

For hire in a corporate or agency setting.

		{% include socials.html %}

		{% for project in site.projects reversed %}

{{ project.title }}

{{ project.subtitle }}

{{ project.description }}

		{% endfor %}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>GetMentionsFromKnowledgeStore</title>
<meta name="date" content="2017-01-10">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

vu.cltl.storyteller.knowledgestore

Class GetMentionsFromKnowledgeStore

java.lang.Object

vu.cltl.storyteller.knowledgestore.GetMentionsFromKnowledgeStore

public class GetMentionsFromKnowledgeStore
extends java.lang.Object

Created by piek on 09/02/16.

Field Summary

Fields

Modifier and Type
Field and Description

static java.lang.String
pass

static java.lang.String
serviceBase

static java.lang.String
user

Constructor Summary

Constructors

Constructor and Description

GetMentionsFromKnowledgeStore()

Method Summary

All Methods Static Methods Concrete Methods

Modifier and Type
Method and Description

static void
createRawTextIndexFromMentions(java.util.ArrayList<org.json.JSONObject> objects,
                              org.json.JSONObject timeLineObject,
                              java.lang.String KS)

static void
createRawTextIndexFromMentions(java.util.ArrayList<org.json.JSONObject> objects,
                              org.json.JSONObject timeLineObject,
                              java.lang.String SERVICE,
                              java.lang.String KS,
                              java.lang.String KSuser,
                              java.lang.String KSpass)

static java.lang.String
createSnippetIndexFromMentions(java.util.ArrayList<org.json.JSONObject> objects,
                              java.lang.String SERVICE,
                              java.lang.String KS,
                              java.lang.String KSuser,
                              java.lang.String KSpass)

static java.lang.String
getKSNafRawText(java.lang.String urlString)

static java.lang.String
getNafRawText(java.lang.String stringUrl)

static java.util.ArrayList<eu.kyotoproject.kaf.KafWordForm>
getNafWordFormList(java.lang.String stringUrl)

static java.lang.String
getStringFromDocument(org.w3c.dom.Document doc)

static java.lang.String
getText(java.lang.String stringUrl)

static java.lang.String
makeRequestUrl(java.lang.String SERVICE,
              java.lang.String knowledgeStore,
              java.lang.String mentionUri)

static java.lang.String
makeTextRequestUrl(java.lang.String knowledgeStore,
                  java.lang.String mentionUri)

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

pass

public static java.lang.String pass

serviceBase

public static java.lang.String serviceBase

user

public static java.lang.String user

Constructor Detail

GetMentionsFromKnowledgeStore

public GetMentionsFromKnowledgeStore()

Method Detail

createRawTextIndexFromMentions

public static void createRawTextIndexFromMentions(java.util.ArrayList<org.json.JSONObject> objects,
                                                  org.json.JSONObject timeLineObject,
                                                  java.lang.String KS)

createRawTextIndexFromMentions

public static void createRawTextIndexFromMentions(java.util.ArrayList<org.json.JSONObject> objects,
                                                  org.json.JSONObject timeLineObject,
                                                  java.lang.String SERVICE,
                                                  java.lang.String KS,
                                                  java.lang.String KSuser,
                                                  java.lang.String KSpass)

createSnippetIndexFromMentions

public static java.lang.String createSnippetIndexFromMentions(java.util.ArrayList<org.json.JSONObject> objects,
                                                              java.lang.String SERVICE,
                                                              java.lang.String KS,
                                                              java.lang.String KSuser,
                                                              java.lang.String KSpass)
                                                       throws org.json.JSONException

Throws:

org.json.JSONException

getKSNafRawText

public static java.lang.String getKSNafRawText(java.lang.String urlString)
                                        throws java.lang.Exception

Throws:

java.lang.Exception

getNafRawText

public static java.lang.String getNafRawText(java.lang.String stringUrl)
                                      throws java.lang.Exception

Throws:

java.lang.Exception

getNafWordFormList

public static java.util.ArrayList<eu.kyotoproject.kaf.KafWordForm> getNafWordFormList(java.lang.String stringUrl)
                                                                               throws java.lang.Exception

Throws:

java.lang.Exception

getStringFromDocument

public static java.lang.String getStringFromDocument(org.w3c.dom.Document doc)
                                              throws javax.xml.transform.TransformerException

Throws:

javax.xml.transform.TransformerException

getText

public static java.lang.String getText(java.lang.String stringUrl)
                                throws java.lang.Exception

Throws:

java.lang.Exception

makeRequestUrl

public static java.lang.String makeRequestUrl(java.lang.String SERVICE,
                                              java.lang.String knowledgeStore,
                                              java.lang.String mentionUri)

makeTextRequestUrl

public static java.lang.String makeTextRequestUrl(java.lang.String knowledgeStore,
                                                  java.lang.String mentionUri)

Skip navigation links

Overview

Package

Class

Tree

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
sort
---

The sort plugin is a very basic low-level element sorting function that allows you to sort DOM elements with a custom comparator (similar to `Array.prototype.sort`).

Assuming the following markup:

Banana

Carrot

Apple

You could sort the items alphabetically like so:

    $('li').sortElements(function(a, b){
        return $(a).text() > $(b).text() ? 1 : -1;
    });

That would result in:

Apple

Banana

Carrot

It also let's you specify what element will be sorted. The current collection's elements will be those referred to as `a` and `b` on each call of the comparator, but you might not want those elements to be the ones to move. E.g. you might want it to be a parent. For example, when sorting a table column, you would sort by the `<td>` elements, but the elements you actually want to move within the DOM are the `<tr>` (each `<td>`'s parent):

    $('td').sortElements(myComparator, function(){
        // Return a reference to the desired element:
        return this.parentNode;
    });

See more info here: [http://james.padolsey.com/javascript/sorting-elements-with-jquery/](http://james.padolsey.com/javascript/sorting-elements-with-jquery/).


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.tfyre.victronenergy.common;

/**
 *
 * @author acid
 */
public abstract class Common implements Runnable {

    private final Socket socket;
    private final Thread thread;

    public Common(Socket socket) {
        this.thread = new Thread(this);
        this.thread.setName("common");
        this.thread.setDaemon(true);
        this.socket = socket;
    }

    public Socket getSocket() {
        return socket;
    }

    public Thread getThread() {
        return thread;
    }

    public static String toHex(final byte[] data) {
        final StringBuilder sb = new StringBuilder();
        for (final byte b : data) {
            if ((b < 32) || (b > 126)) {
                sb.append(String.format("[%02X]", b));
            } else {
                sb.append(String.format("[%02X]", b));
                //sb.append((char) b);
            }
        }
        return sb.toString();
    }
}


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.
 */
package com.facebook.presto.raptor.backup;

import com.facebook.presto.spi.PrestoException;
import com.google.common.annotations.VisibleForTesting;

import javax.annotation.PostConstruct;
import javax.inject.Inject;

import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.OptionalLong;
import java.util.UUID;

import static com.facebook.presto.raptor.RaptorErrorCode.RAPTOR_ERROR;
import static com.facebook.presto.raptor.storage.FileStorageService.getFileSystemPath;
import static com.facebook.presto.raptor.util.FileUtil.copyFile;
import static java.nio.file.Files.readAttributes;
import static java.util.Locale.ENGLISH;
import static java.util.Objects.requireNonNull;

public class FileBackupStore
        implements BackupStore
{
    private final File baseDir;

    @Inject
    public FileBackupStore(FileBackupConfig config)
    {
        this(config.getBackupDirectory());
    }

    public FileBackupStore(File baseDir)
    {
        this.baseDir = requireNonNull(baseDir, "baseDir is null");
    }

    @PostConstruct
    public void start()
    {
        createDirectories(baseDir);
    }

    @Override
    public void backupShard(UUID uuid, File source)
    {
        File backupFile = getFileSystemPath(baseDir, uuid);
        createDirectories(backupFile.getParentFile());

        try {
            copyFile(source.toPath(), backupFile.toPath());
        }
        catch (IOException e) {
            throw new PrestoException(RAPTOR_ERROR, "Failed to create backup shard file", e);
        }
    }

    @Override
    public void restoreShard(UUID uuid, File target)
    {
        try {
            copyFile(getBackupFile(uuid).toPath(), target.toPath());
        }
        catch (IOException e) {
            throw new PrestoException(RAPTOR_ERROR, "Failed to copy backup shard: " + uuid, e);
        }
    }

    @Override
    public OptionalLong shardSize(UUID uuid)
    {
        Path path = getBackupFile(uuid).toPath();
        try {
            BasicFileAttributes attributes = readAttributes(path, BasicFileAttributes.class);
            if (!attributes.isRegularFile()) {
                return OptionalLong.empty();
            }
            return OptionalLong.of(attributes.size());
        }
        catch (IOException e) {
            return OptionalLong.empty();
        }
    }

    @VisibleForTesting
    public File getBackupFile(UUID uuid)
    {
        File file = getFileSystemPath(baseDir, uuid);
        File legacy = getLegacyFileSystemPath(baseDir, uuid);
        if (!file.exists() && legacy.exists()) {
            return legacy;
        }
        return file;
    }

    // TODO: remove this after old data is migrated
    private static File getLegacyFileSystemPath(File base, UUID shardUuid)
    {
        String uuid = shardUuid.toString().toLowerCase(ENGLISH);
        return base.toPath()
                .resolve(uuid.substring(0, 3))
                .resolve(uuid.substring(3, 6))
                .resolve(uuid + ".orc")
                .toFile();
    }

    private static void createDirectories(File dir)
    {
        if (!dir.mkdirs() && !dir.isDirectory()) {
            throw new PrestoException(RAPTOR_ERROR, "Failed creating directories: " + dir);
        }
    }
}


text:
"""
https://www.hackerrank.com/challenges/encryption
One classic method for composing secret messages is called a square code.  The spaces are removed from the english text
and the characters are written into a square (or rectangle). The width and height of the rectangle have the constraint,

floor(sqrt( len(word) )) <= width, height <= ceil(sqrt( len(word) ))

Among the possible squares, choose the one with the minimum area.

In case of a rectangle, the number of rows will always be smaller than the number of columns. For example, the sentence
"if man was meant to stay on the ground god would have given us roots" is 54 characters long, so it is written in the
form of a rectangle with 7 rows and 8 columns. Many more rectangles can accomodate these characters; choose the one with
minimum area such that: length * width >= len(word)

                ifmanwas
                meanttos
                tayonthe
                groundgo
                dwouldha
                vegivenu
                sroots

The coded message is obtained by reading the characters in a column, inserting a space, and then moving on to the next
column towards the right. For example, the message above is coded as:

imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau

You will be given a message in English with no spaces between the words.The maximum message length can be 81 characters.
Print the encoded message.

Here are some more examples:

Sample Input:

haveaniceday

Sample Output:

hae and via ecy
"""
from math import sqrt, floor, ceil

__author__ = 'Danyang'

class Solution(object):
    def solve(self, cipher):
        l = len(cipher)
        r = range(int(floor(sqrt(l))), int(ceil(sqrt(l))) + 1)

        min_pair = (r[-1], r[-1])
        for h in r:
            for w in r:
                if h * w >= l and h * w < min_pair[0] * min_pair[1]:
                    min_pair = (h, w)
        h, w = min_pair
        rect = [[None for _ in xrange(w)] for _ in xrange(h)]
        for i in xrange(l):
            rect[i / w][i % w] = cipher[i]

        result = []
        for j in xrange(w):
            sb = []
            for i in xrange(h):
                if rect[i][j] == None: break
                sb.append(rect[i][j])
            result.append("".join(sb))

        return " ".join(result)

if __name__ == "__main__":
    import sys

    f = open("1.in", "r")
    # f = sys.stdin
    cipher = f.readline().strip()

    # solve
    s = "%s\n" % (Solution().solve(cipher))
    print s,


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

    exports.AutomatedAppCreation = React.createClass({
        getInitialState: function(){
            return {
                pendingAppCreation: false
            };
        },

        render: function(){
            /*
                {
                    automateTwitterAppCreation: () => void,
                    switchToManual: () => void
                }
            */
            const data = this.props;
            const state = this.state;

            return React.DOM.div({}, [
                // Why the user is being bothered
                React.DOM.p({}, [
                    "You need a 'Twitter App' to use Twitter Assistant."
                ]),

                // Quick action
                React.DOM.div({className: 'app-creation' + (state.pendingAppCreation ? ' pending' : '')}, React.DOM.button({
                    className: 'automatic',
                    disabled: state.pendingAppCreation ? 'disabled' : null,
                    onClick: e => {
                        data.automateTwitterAppCreation();
                        this.setState({
                            pendingAppCreation: true
                        });
                    }
                }, "Create an app automatically")),

                // Explain what's about to happen
                React.DOM.div({/*className: "instructions"*/}, [
                    React.DOM.p({}, "A tab will open in the background. On your behalf, it's going to:"),
                    React.DOM.ol({}, [
                        React.DOM.li({}, React.DOM.strong({}, "Create a Twitter app")),
                        React.DOM.li({}, [
                            React.DOM.strong({}, "Accept"),
                            " the ",
                            React.DOM.a({
                                target: "_blank",
                                href: "https://dev.twitter.com/terms/api-terms"
                            }, 'Twitter API terms of services ("Developer rules of the road")')
                        ]),
                        React.DOM.li({}, [
                            "When the app is created, the addon will ",
                            React.DOM.strong({}, 'fetch the "API key" and "API secret"'),
                            ' from the "API keys" tab.'
                        ])
                    ])
                ]),

                // Alternatives
                React.DOM.p({className: 'discrete'}, [
                    "You can also ",
                    React.DOM.a({
                        target: '_blank',
                        href: 'http://iag.me/socialmedia/how-to-create-a-twitter-app-in-8-easy-steps/',
                        onClick: data.switchToManual
                    }, 'create an app manually "in 8 easy steps"'),
                    " or maybe ",
                    React.DOM.button({
                        className: "existing-app",
                        onClick: data.switchToManual
                    }, "you already have one")
                ])
            ]);
        }
    });

})(this);


text:
class Status < ActiveRecord::Base
  has_many :clients
end


text:
Send Expression
---------------

::

        Expr1 ! Expr2

Sends the value of Expr2 as a message to the process specified by Expr1. The
value of Expr2 is also the return value of the expression.

Expr1 must evaluate to a pid, a registered name (atom) or a tuple (Name,Node),
where Name is an atom and Node a node name, also an atom.

 * If Expr1 evaluates to a name, but this name is not registered, a badarg
   run-time error will occur.

 * Sending a message to a pid never fails, even if the pid identifies a
   non-existing process.

 * Distributed message sending, that is if Expr1 evaluates to a tuple
   (Name,Node) (or a pid located at another node), also never fails.


text:
module SeedMigration
  VERSION = "1.2.3"
end


text:
<?php

$title = 'Icons';

$content = <<<HTML

Material Design Icons

Handcrafted by our friends from Google

Your browser does not support iframes.

The icons are visible on Desktop mode inside an iframe. Since the iframe is not working on Mobile and Tablets please visit the icons on their original page on Google. Check the  Material Icons

HTML;

return view('layout', compact('title', 'content'));


text:
// Copyright (c) 2011-2017 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <bench/bench.h>
#include <chainparams.h>
#include <consensus/consensus.h>
#include <consensus/merkle.h>
#include <consensus/validation.h>
#include <miner.h>
#include <pow.h>
#include <test/test_bitcoin.h>
#include <txadmission.h>
#include <validation/validation.h>

#include <boost/thread.hpp>

#include <list>
#include <vector>

std::shared_ptr<CBlock> PrepareBlock(const CScript &coinbase_scriptPubKey, const CChainParams &chainparams)
{
    std::unique_ptr<CBlockTemplate> pblocktemplate(new CBlockTemplate());
    auto block = std::make_shared<CBlock>(BlockAssembler(chainparams).CreateNewBlock(coinbase_scriptPubKey)->block);
    block->nTime = chainActive.Tip()->GetMedianTimePast() + 1;
    block->hashMerkleRoot = BlockMerkleRoot(*block);

    return block;
}

static CTxIn MineBlock(const CScript &coinbase_scriptPubKey, const CChainParams &chainparams)
{
    auto block = PrepareBlock(coinbase_scriptPubKey, chainparams);

    block->nTime = chainActive.Tip()->GetMedianTimePast() + 1;
    block->hashMerkleRoot = BlockMerkleRoot(*block);
    while (!CheckProofOfWork(block->GetHash(), block->nBits, chainparams.GetConsensus()))
    {
        ++block->nNonce;
        assert(block->nNonce);
    }

    CValidationState state;
    // need to copy the object corresponding by the shared_pointer because
    // ProcessNewBlock accept plain pointer to a block not shared one.
    auto aux_block = *block;
    bool processed = ProcessNewBlock(state, chainparams, nullptr, &aux_block, true, nullptr, false);
    assert(processed);
    assert(state.IsValid());

    return CTxIn{block->vtx[0]->GetHash(), 0};
}

static void AssembleBlock(benchmark::State &state)
{
    TestingSetup test_setup(CBaseChainParams::REGTEST);
    const CChainParams &chainparams = Params(CBaseChainParams::REGTEST);

    const CScript redeemScript = CScript() << OP_DROP << OP_TRUE;
    const CScript SCRIPT_PUB = CScript() << OP_HASH160 << ToByteVector(CScriptID(redeemScript)) << OP_EQUAL;

    const CScript scriptSig = CScript() << std::vector<uint8_t>(100, 0xff) << ToByteVector(redeemScript);

    // Collect some loose transactions that spend the coinbases of our mined blocks
    constexpr size_t NUM_BLOCKS{200};
    std::array<CTransactionRef, NUM_BLOCKS - COINBASE_MATURITY + 1> txs;
    for (size_t b = 0; b < NUM_BLOCKS; ++b)
    {
        CMutableTransaction tx;
        tx.vin.push_back(MineBlock(SCRIPT_PUB, chainparams));
        tx.vin.back().scriptSig = scriptSig;
        tx.vout.emplace_back(49.999 * COIN, SCRIPT_PUB);
        if (NUM_BLOCKS - b >= COINBASE_MATURITY)
        {
            txs.at(b) = MakeTransactionRef(tx);
        }
    }

    {
        // Required for AcceptToMemoryPool.
        LOCK(cs_main);

        for (const auto &txr : txs)
        {
            CValidationState vstate;
            bool ret{AcceptToMemoryPool(mempool, vstate, txr, false, /* fLimitFree */
                nullptr /* pfMissingInputs */, true, /* fRejectAbsurdFee */
                TransactionClass::DEFAULT)};
            assert(ret);
        }
    }

    while (state.KeepRunning())
    {
        PrepareBlock(SCRIPT_PUB, chainparams);
    }
}

BENCHMARK(AssembleBlock, 700);


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>AutoCompletionChoice (gewt 1.2.0 API)</title>
<meta name="date" content="2018-10-29">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

de.esoco.ewt.impl.gwt.code

Class AutoCompletionChoice

java.lang.Object

de.esoco.ewt.impl.gwt.code.AutoCompletionChoice

All Implemented Interfaces:

com.google.gwt.user.client.rpc.IsSerializable, java.io.Serializable

public class AutoCompletionChoice
extends java.lang.Object
implements java.io.Serializable, com.google.gwt.user.client.rpc.IsSerializable

TODO: DOCUMENT ME!

See Also:

Serialized Form

Constructor Summary

Constructors

Constructor and Description

AutoCompletionChoice(java.lang.String sText,
                    java.lang.String sDisplayText,
                    java.lang.String sCssClassName,
                    EditorPosition rReplaceTextFrom,
                    EditorPosition rReplaceTextTo)

Creates a new instance.

Method Summary

All Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

boolean
equals(java.lang.Object o)

java.lang.String
getCssClassName()

Returns the css class name.

java.lang.String
getDisplayText()

Returns the display text.

EditorPosition
getReplaceTextFrom()

Returns the replace text from.

EditorPosition
getReplaceTextTo()

Returns the replace text to.

java.lang.String
getText()

Returns the text.

int
hashCode()

java.lang.String
toString()

Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

AutoCompletionChoice

public AutoCompletionChoice(java.lang.String sText,
                            java.lang.String sDisplayText,
                            java.lang.String sCssClassName,
                            EditorPosition rReplaceTextFrom,
                            EditorPosition rReplaceTextTo)

Creates a new instance.

Parameters:

sText - TODO: DOCUMENT ME!

sDisplayText - TODO: DOCUMENT ME!

sCssClassName - TODO: DOCUMENT ME!

rReplaceTextFrom - TODO: DOCUMENT ME!

rReplaceTextTo - TODO: DOCUMENT ME!

Method Detail

equals

public boolean equals(java.lang.Object o)

Overrides:

equals in class java.lang.Object

See Also:

Object.equals(java.lang.Object)

getCssClassName

public java.lang.String getCssClassName()

Returns the css class name.

Returns:

The css class name

getDisplayText

public java.lang.String getDisplayText()

Returns the display text.

Returns:

The display text

getReplaceTextFrom

public EditorPosition getReplaceTextFrom()

Returns the replace text from.

Returns:

The replace text from

getReplaceTextTo

public EditorPosition getReplaceTextTo()

Returns the replace text to.

Returns:

The replace text to

getText

public java.lang.String getText()

Returns the text.

Returns:

The text

hashCode

public int hashCode()

Overrides:

hashCode in class java.lang.Object

See Also:

Object.hashCode()

toString

public java.lang.String toString()

Overrides:

toString in class java.lang.Object

See Also:

Object.toString()

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
using System;

namespace CallfireApiClient.Api.CallsTexts.Model
{
    public class Text : Action<TextRecord>
    {
        public string Message { get; set; }

        public TextResult? FinalTextResult { get; set; }

        public enum TextResult
        {
            SENT,
            RECEIVED,
            DNT,
            TOO_BIG,
            INTERNAL_ERROR,
            CARRIER_ERROR,
            CARRIER_TEMP_ERROR,
            UNDIALED,
        }

        public override string ToString()
        {
            return string.Format("{0} [Text: Message={1}, FinalTextResult={2}]", base.ToString(), Message, FinalTextResult);
        }
    }
}


text:
@extends("layouts.masterfront")
@section('content')

Formulir Izin Usaha Industri (IUI)

			{!! Form::open(['url'=>"editformulir/iui/".$formulir->id, 'method'=>'PATCH', 'class'=>'form-horizontal'])!!}

Keterangan Pemohon

					Nama :

						<input  type="text" class="form-control" name="nama_pemohon" value="{{$formulir->nama_pemohon}}" required>

					Alamat :

						<input  type="text" class="form-control" name="alamat_pemohon" value="{{$formulir->alamat_pemohon}}" required>

					Nomor Telepon :

						<input  type="text" class="form-control" name="nomor_telepon_pemohon" value="{{$formulir->nomor_telepon_pemohon}}" required>

Keterangan Perusahaan

					Nama Perusahaan :

						<input  type="text" class="form-control" name="nama_perusahaan" value="{{$formulir->nama_perusahaan}}" required>

					Alamat Perusahaan :

						<input  type="text" class="form-control" name="alamat_perusahaan" value="{{$formulir->alamat_perusahaan}}" required>

					Nomor Telepon Perusahaan :

						<input  type="text" class="form-control" name="nomor_telepon_perusahaan" value="{{$formulir->nomor_telepon_perusahaan}}" required>

					NPWP :

						<input  type="text" class="form-control" name="npwp" value="{{$formulir->npwp}}" required>

					Nama Pemilik :

						<input  type="text" class="form-control" name="nama_pemilik" value="{{$formulir->nama_pemilik}}" required>

					Alamat Pemilik :

						<input  type="text" class="form-control" name="alamat_pemilik" value="{{$formulir->alamat_pemilik}}" required>

					Nomor Telepon Pemilik :

						<input  type="text" class="form-control" name="no_telepon_pemilik" value="{{$formulir->no_telepon_pemilik}}" required>

					Desa/Kelurahan :

						<input  type="text" class="form-control" name="lokasi_kelurahan_pabrik" value="{{$formulir->lokasi_kelurahan_pabrik}}" required>

					Kecamatan :

						<input  type="text" class="form-control" name="lokasi_kecamatan_pabrik" value="{{$formulir->lokasi_kecamatan_pabrik}}" required>

					Kabupaten :

						<input  type="text" class="form-control" name="lokasi_kabupaten_pabrik" value="{{$formulir->lokasi_kabupaten_pabrik}}" required>

					Kepemilikan :

						<input  type="text" class="form-control" name="kepemilikan_pabrik" value="{{$formulir->kepemilikan_pabrik}}" required>

					Luas Bangunan :

						<input  type="text" class="form-control" name="luas_bangunan_pabrik" value="{{$formulir->luas_bangunan_pabrik}}" required>

					Luas Tanah :

						<input  type="text" class="form-control" name="luas_tanah_pabrik" value="{{$formulir->luas_tanah_pabrik}}" required>

					Mesin/Peralatan Utama :

						<input  type="text" class="form-control" name="alat_utama_produksi" value="{{$formulir->alat_utama_produksi}}" required>

					Mesin/Peralatan Pembantu :

						<input  type="text" class="form-control" name="alat_pembantu_produksi" value="{{$formulir->alat_pembantu_produksi}}" required>

					Tenaga Penggerak :

						<input  type="text" class="form-control" name="tenaga_penggerak" value="{{$formulir->tenaga_penggerak}}" required>

					Jenis Industri :

						<input  type="text" class="form-control" name="jenis_industri" value="{{$formulir->jenis_industri}}" required>

					Komoditi :

						<input  type="text" class="form-control" name="komoditi" value="{{$formulir->komoditi}}" required>

					Kapasitas Terpasang per Tahun :

						<input  type="text" class="form-control" name="kapasita_terpasang_per_tahun" value="{{$formulir->kapasita_terpasang_per_tahun}}" required>

					Kebutuhan Baku/Penolong:

						<input  type="text" class="form-control" name="kebutuhan_bahan_baku" value="{{$formulir->kebutuhan_bahan_baku}}" required>

					Laki-laki :

						<input  type="text" class="form-control" name="jumlah_tenaga_kerja_pribumi_lk" value="{{$formulir->jumlah_tenaga_kerja_pribumi_lk}}" required>

					Wanita :

						<input  type="text" class="form-control" name="jumlah_tenaga_kerja_pribumi_pr" value="{{$formulir->jumlah_tenaga_kerja_pribumi_pr}}" required>

					Laki-laki :

						<input  type="text" class="form-control" name="jumlah_tenaga_kerja_asing_lk" value="{{$formulir->jumlah_tenaga_kerja_asing_lk}}" required>

					Wanita :

						<input  type="text" class="form-control" name="jumlah_tenaga_kerja_asing_pr" value="{{$formulir->jumlah_tenaga_kerja_asing_pr}}" required>

					Nilai Investasi :

						<input  type="text" class="form-control" name="nilai_investasi" value="{{$formulir->nilai_investasi}}" required>

					Merek :

						<input  type="text" class="form-control" name="merek" value="{{$formulir->merek}}" required>

				<

						<button type="submit" class="text-center btn btn-success ">Save</button>
						Cancel

			{!!Form::close()!!}

@stop


text:
#ifndef PLANE_H
#define PLANE_H

#include "Vector3.hpp"

#include <cmath>

namespace godot {

enum ClockDirection {

	CLOCKWISE,
	COUNTERCLOCKWISE
};

class Plane {
public:
	Vector3 normal;
	real_t d;

	void set_normal(const Vector3 &p_normal);

	inline Vector3 get_normal() const { return normal; } ///Point is coplanar, CMP_EPSILON for precision

	void normalize();

	Plane normalized() const;

	/* Plane-Point operations */

	inline Vector3 center() const { return normal * d; }
	Vector3 get_any_point() const;
	Vector3 get_any_perpendicular_normal() const;

	bool is_point_over(const Vector3 &p_point) const; ///< Point is over plane
	real_t distance_to(const Vector3 &p_point) const;
	bool has_point(const Vector3 &p_point, real_t _epsilon = CMP_EPSILON) const;

	/* intersections */

	bool intersect_3(const Plane &p_plane1, const Plane &p_plane2, Vector3 *r_result = 0) const;
	bool intersects_ray(Vector3 p_from, Vector3 p_dir, Vector3 *p_intersection) const;
	bool intersects_segment(Vector3 p_begin, Vector3 p_end, Vector3 *p_intersection) const;

	Vector3 project(const Vector3 &p_point) const;

	/* misc */

	inline Plane operator-() const { return Plane(-normal, -d); }
	bool is_almost_like(const Plane &p_plane) const;

	bool operator==(const Plane &p_plane) const;
	bool operator!=(const Plane &p_plane) const;
	operator String() const;

	inline Plane() { d = 0; }
	inline Plane(real_t p_a, real_t p_b, real_t p_c, real_t p_d) :
			normal(p_a, p_b, p_c),
			d(p_d) {}

	Plane(const Vector3 &p_normal, real_t p_d);
	Plane(const Vector3 &p_point, const Vector3 &p_normal);
	Plane(const Vector3 &p_point1, const Vector3 &p_point2, const Vector3 &p_point3, ClockDirection p_dir = CLOCKWISE);
};

} // namespace godot

#endif // PLANE_H


text:
#include "RDIDeviceEnumerationTrigger.h"

#include <assert.h>
#include <algorithm>
#include "RDITime.h"
#include "RDICommon.h"

/*
	Notes:
	- Maybe an the "invisible" window code of the WindowsHookEnumerationTrigger could be moved into a InvisibleWindowEnumerationTrigger class.
	  It would create the invisible window and handle the WM_DEVICECHANGE message in its WndProc normally (without a hook).
	  This would be cleaner
*/
namespace RDI
{

/*
	WindowsHookEnumerationTrigger
*/
HHOOK WindowsHookEnumerationTrigger::mHookHandle = 0;
std::vector<WindowsHookEnumerationTrigger*> WindowsHookEnumerationTrigger::mTriggerInstances;
const TCHAR* WindowsHookEnumerationTrigger::invisibleWindowClassName = _T("WindowsHookEnumerationTrigger");

WindowsHookEnumerationTrigger::WindowsHookEnumerationTrigger( bool doCreateInvisibleWindow )
	:	mCreateInvisibleWindow( doCreateInvisibleWindow ),
		mInvisibleWindow(NULL),
		mEnumerationNeeded(false)
{
	if ( mCreateInvisibleWindow )
	{
		bool ret = createInvisibleWindow();
		assert( ret );
	}

	// We initialize mEnumerationNeeded to true so a first enumeration is triggered immediately
	// (i.e. the first time enumerationNeeded() is called), rather than having to wait
	// for a first system-wide WM_DEVICECHANGE message
	mEnumerationNeeded = true;

	if ( mTriggerInstances.empty() )
	{
		DWORD threadID = GetCurrentThreadId();
		HINSTANCE hInstance = GetModuleHandle(NULL) ;
		mHookHandle = SetWindowsHookEx( WH_CALLWNDPROC, wndProcHook, hInstance, threadID );
		assert( mHookHandle );
	}
	mTriggerInstances.push_back(this);
}

WindowsHookEnumerationTrigger::~WindowsHookEnumerationTrigger()
{
	std::vector<WindowsHookEnumerationTrigger*>::iterator itr;
	itr = std::find( mTriggerInstances.begin(), mTriggerInstances.end(), this );
	assert( itr!=mTriggerInstances.end() );
	mTriggerInstances.erase(itr);

	if ( mTriggerInstances.empty() )
	{
		SetLastError( ERROR_SUCCESS);
		/*BOOL ret =*/ UnhookWindowsHookEx( mHookHandle );
		//DWORD a = GetLastError();
		//assert( ret!=0 );
		mHookHandle = 0;
	}

	if ( mCreateInvisibleWindow )
	{
		/*BOOL ret =*/ DestroyWindow( mInvisibleWindow );
		//assert( ret!=0 );
		mInvisibleWindow = NULL;

		// Try to unregister the class. This will work only if there no Window
		// in existence that uses this class
		HINSTANCE hInstance = GetModuleHandle(NULL) ;
		/*ret =*/ UnregisterClass( invisibleWindowClassName, hInstance );
		//if ( ret!=0)
		//	printf("OK");
	}
}

bool WindowsHookEnumerationTrigger::enumerationNeeded()
{
	MSG Msg;
	while (PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE) > 0)
    {
		TranslateMessage(&Msg);
        DispatchMessage(&Msg);
    }

	bool ret = mEnumerationNeeded;
	if ( mEnumerationNeeded )
		mEnumerationNeeded = false;
	return ret;
}

LRESULT CALLBACK WindowsHookEnumerationTrigger::invisibleWindowWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	// We could check for WM_DEVICECHANGE here, but we use a hook for that
	return DefWindowProc(hwnd, msg, wParam, lParam);
}

bool WindowsHookEnumerationTrigger::createInvisibleWindow()
{
	// Inspired from http://www.winprog.org/tutorial/simple_window.html
	// and http://msdn.microsoft.com/en-us/library/ms632599(VS.85).aspx#message_only
	WNDCLASS wndclass;
	memset( &wndclass, 0, sizeof(wndclass) );
	HINSTANCE hInstance = GetModuleHandle(NULL) ;
    if ( GetClassInfo( hInstance, invisibleWindowClassName, &wndclass )==0 )
	{
		WNDCLASSEX wc;
		wc.cbSize        = sizeof(WNDCLASSEX);
		wc.style         = 0;
		wc.lpfnWndProc   = invisibleWindowWndProc;
		wc.cbClsExtra    = 0;
		wc.cbWndExtra    = 0;
		wc.hInstance     = hInstance;
		wc.hIcon         = LoadIcon(NULL, IDI_APPLICATION);
		wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
		wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
		wc.lpszMenuName  = NULL;
		wc.lpszClassName = invisibleWindowClassName;
		wc.hIconSm       = LoadIcon(NULL, IDI_APPLICATION);
	 	if( !RegisterClassEx(&wc) )
			return false;
	}

	// Message-only windows, can't receive broadcast messages
	// http://msdn.microsoft.com/en-us/library/ms632599(VS.85).aspx#message_only
	HWND hwnd = CreateWindowEx( WS_EX_CLIENTEDGE, invisibleWindowClassName, _T(""), WS_OVERLAPPEDWINDOW,
								CW_USEDEFAULT, CW_USEDEFAULT, 240, 120,
								NULL /*HWND_MESSAGE*/,	NULL, hInstance, NULL );
    if( hwnd==NULL )
	{
		BOOL ret = UnregisterClass( invisibleWindowClassName, hInstance );
		assert( ret!=0 );
		return false;
	}

	// The invisible window is not initially shown nor updated
    // ShowWindow(hwnd, SW_SHOW);
	// UpdateWindow(hwnd);

	// Remember the invisible window
	mInvisibleWindow = hwnd;

	return true;
}

LRESULT CALLBACK WindowsHookEnumerationTrigger::wndProcHook( int nCode, WPARAM wParam, LPARAM lParam )
{
	if ( nCode<0 )  // Do not process message
		return CallNextHookEx( NULL, nCode, wParam, lParam );

	if ( wParam!=0 )
	{
		const CWPSTRUCT& params = *reinterpret_cast<CWPSTRUCT*>(lParam);
		if ( params.message==WM_DEVICECHANGE )
		{
			for ( std::size_t i=0; i<WindowsHookEnumerationTrigger::mTriggerInstances.size(); ++i )
				WindowsHookEnumerationTrigger::mTriggerInstances[i]->mEnumerationNeeded = true;
		}
	}

	// Process event
	return CallNextHookEx( NULL, nCode, wParam, lParam );
}

/*
	TimeBasedEnumerationTrigger
*/
TimeBasedEnumerationTrigger::TimeBasedEnumerationTrigger( unsigned int intervalInMs )
	: mIntervalInMs(intervalInMs),
	  mStartTime(0),
	  mNextTime(0)
{
	mStartTime = Time::getTimeAsMilliseconds();

	// At startup, we schedule the enumeration as soon as possible,
	// instead of waiting an initial interval like so:
	// updateNextTime();
	mNextTime = mStartTime;
}

bool TimeBasedEnumerationTrigger::enumerationNeeded()
{
	bool ret = false;
	unsigned int currentTime = Time::getTimeAsMilliseconds();
	if ( currentTime>=mNextTime )
	{
		ret = true;
		updateNextTime();
	}
	return ret;
}

// Return the number of intervals done since start.
// Returns -1 if interval was set to 0 (continuous firing)
int TimeBasedEnumerationTrigger::updateNextTime()
{
	int numIntervalsDone = -1;
	unsigned int currentTime = Time::getTimeAsMilliseconds();
	if ( mIntervalInMs==0 )
	{
		mNextTime = currentTime;
	}
	else
	{
		unsigned int timeSinceStart = currentTime - mStartTime;
		numIntervalsDone = timeSinceStart / mIntervalInMs;
		assert( numIntervalsDone>=0 );
		mNextTime = mStartTime + (static_cast<unsigned int>(numIntervalsDone) + 1) * mIntervalInMs;
	}
	return numIntervalsDone;
}

}


text:
package org.hisp.dhis.android.core.arch.api.filters.internal;

import java.io.IOException;

import retrofit2.Converter;

public class FilterConverter implements Converter<Filter, String> {

    @Override
    public String convert(Filter filter) throws IOException {
        //the convert logic is actually in the Filter implementations.
        return filter.generateString();
    }
}


text:
/* This file is part of Lwt, released under the MIT license. See LICENSE.md for
   details, or visit https://github.com/ocsigen/lwt/blob/master/LICENSE.md. */

#include "lwt_config.h"

#if !defined(LWT_ON_WINDOWS)

#include <caml/mlvalues.h>
#include <caml/unixsupport.h>
#include <unistd.h>

CAMLprim value lwt_unix_get_page_size(value Unit)
{
    long page_size = sysconf(_SC_PAGESIZE);
    if (page_size < 0) page_size = 4096;
    return Val_long(page_size);
}
#endif


text:
import ConfigParser
import json
import logging
import os
import sys
import tempfile
import traceback

import click
from requests.exceptions import HTTPError

from sppclient.sdk import client
import util

cmd_folder = os.path.abspath(os.path.join(os.path.dirname(__file__), 'commands'))

class MyCLI(click.MultiCommand):
    def list_commands(self, ctx):
        rv = []
        for filename in os.listdir(cmd_folder):
            if filename.endswith('.py') and filename.startswith('cmd_'):
                rv.append(filename[4:-3])
        rv.sort()
        return rv

    def get_command(self, ctx, name):
        try:
            if sys.version_info[0] == 2:
                name = name.encode('ascii', 'replace')

            mod = __import__('sppclient.cli.commands.cmd_' + name, None, None, ['cli'])
        except ImportError:
            logging.error(traceback.format_exc())
            return

        return mod.cli

def get_existing_session(username):
    parser = ConfigParser.RawConfigParser()
    parser.read([cfgfile])

    try:
        return parser.get(username, 'sessionid')
    except ConfigParser.NoSectionError:
        raise Exception('Please provide login credentials.')

def save_config(username, sessionid):
    parser = ConfigParser.RawConfigParser()
    parser.add_section(username)
    parser.set(username, 'sessionid', sessionid)
    parser.write(open(cfgfile, 'wb'))

@click.command(cls=MyCLI)
@click.option('--url', envvar='SPP_URL', default='http://localhost:8082', metavar='URL', help='SPP url.')
@click.option('--user', envvar='SPP_USER', default='admin', metavar='USERNAME', help='SPP user.')
@click.option('--passwd', envvar='SPP_PASSWD', default=None, metavar='PASSWORD', help='SPP password.')
@click.option('--json', is_flag=True, help='Show raw json.')
@click.option('--links', is_flag=True, help='Include links in output. Implies --json option.')
@click.version_option('0.43')
@util.pass_context
def cli(ctx, url, user, passwd, json, links):
    """spp is a command line tool with which SPP operations
    can be carried out.
    """

    if user and passwd:
        ctx.spp_session = client.SppSession(url, username=user, password=passwd)
        save_config(user, ctx.spp_session.sessionid)
    else:
        ctx.spp_session = client.SppSession(url, sessionid=get_existing_session(user))

    ctx.json = json
    ctx.links = links
    if ctx.links:
        ctx.json = True

# cli = MyCLI(help='Script to perform SPP operations. ')

def init_logging():
    fd, logfile = tempfile.mkstemp(suffix='.txt', prefix='sppclient')
    os.close(fd)
    logging.basicConfig(filename=logfile, level=logging.DEBUG, format='%(asctime)-15s: %(levelname)s: %(message)s')

def process_http_error(e):
    if not isinstance(e, HTTPError):
        return

    if not e.response.content:
        return

    logging.error(e.response.content)

    try:
        d = json.loads(e.response.content)
        click.secho('%s (%s)' % (d.get('id', 'Unknown'), d.get('description', 'Unknown')), fg='red')
    except Exception:
        pass

def main():
    global cfgfile

    init_logging()

    cfgfile = os.path.join(click.get_app_dir("sppcli"), 'config.ini')
    cfgdir = os.path.dirname(cfgfile)
    if not os.path.exists(cfgdir):
        os.makedirs(cfgdir)

    try:
        cli()
    except Exception as e:
        logging.error(traceback.format_exc())

        exctype, value = sys.exc_info()[:2]
        click.secho(traceback.format_exception_only(exctype, value)[0], fg='red')

        process_http_error(e)


text:
package org.nibble.service.vo.pedidos;

import dbbeans.proveedor.dbPROVEEDOR;
import java.util.Vector;

public class Bean73a
{

    public Bean73a()
    {
    }

    public int getIidproveedor(int index)
    {
        dbPROVEEDOR a = (dbPROVEEDOR)vProveedores.elementAt(index);
        return a.getIidproveedor();
    }

    public int getSize()
    {
        return vProveedores.size();
    }

    public String getVchrazonsocial(int index)
    {
        dbPROVEEDOR a = (dbPROVEEDOR)vProveedores.elementAt(index);
        return a.getVchrazonsocial();
    }

    public Vector getVProveedores()
    {
        return vProveedores;
    }

    public void setVProveedores(Vector newVProveedores)
    {
        vProveedores = newVProveedores;
    }

    private Vector vProveedores;
}


text:
import * as _ from "lodash";
declare const sortedIndexOf: typeof _.sortedIndexOf;
export default sortedIndexOf;


text:
import { Directive } from "@angular/core";

@Directive({ selector: "input[type='hidden']"})
export class InputHiddenDirective {
}


text:
package com.webside.resource.service;

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

import com.webside.resource.model.ResourceEntity;

public interface ResourceService{

	/**
	 * 自定义方法
	 * 获取用户ID对应的资源信息
	 * @param userId
	 * @return
	 */
	public List<ResourceEntity> findResourcesByUserId(int userId);

	/**
	 * 自定义方法
	 * 获取用户ID对应的资源菜单信息
	 * @param userId
	 * @return
	 */
	public List<ResourceEntity> findResourcesMenuByUserId(int userId);

	public List<ResourceEntity> queryListByPage(Map<String, Object> parameter);

	public List<ResourceEntity> queryTreeGridListByPage(Map<String, Object> parameter);

	public ResourceEntity findByName(String name);

	public ResourceEntity findById(Long id);

	public int update(ResourceEntity resourceEntity);

    public int deleteBatchById(List<Long> resourceIds);

    public List<ResourceEntity> queryResourceList(Map<String, Object> parameter);

    public int insert(ResourceEntity resourceEntity);

    public int count(Map<String, Object> parameter);

    public boolean deleteRoleAndResource(List<Long> resourceIds);

}


text:
.. _use_cases:

Use Cases
*********

.. toctree::
   :maxdepth: 1
   :hidden:

   migrating_translations
   using_pofilter
   using_csv2po
   using_oo2po
   checking_for_inconsistencies
   creating_a_terminology_list_from_your_existing_translations
   running_the_tools_on_microsoft_windows
   cleanup_translator_comments
   creating_mozilla_pot_files
   document_translation

* :doc:`Migrating an older version of your translations to the latest templates
  <migrating_translations>`
* :doc:`Checking for technical errors in your translations <using_pofilter>`
* :doc:`Translating using only a spreadsheet <using_csv2po>` (a look at the
  whole roundtrip from PO to CSV and back)
* :doc:`Creating OpenOffice.org POT files <using_oo2po>`
* :doc:`Checking for inconsistencies in your translations
  <checking_for_inconsistencies>`
* :doc:`Creating a terminology list from your existing translations
  <creating_a_terminology_list_from_your_existing_translations>`
* :doc:`Running the tools on Microsoft Windows
  <running_the_tools_on_microsoft_windows>`
* Using ``phase`` for the complete translation roundtrip
* :doc:`Cleanup translator comments <cleanup_translator_comments>`
* :doc:`Creating Mozilla POT files <creating_mozilla_pot_files>`
* :doc:`Document translation <document_translation>`


text:
<?php

/**
 * Swaggy Jenkins
 * PHP version 7.4
 *
 * @package OpenAPIServer
 * @author  OpenAPI Generator team
 * @link    https://github.com/openapitools/openapi-generator
 */

/**
 * Jenkins API clients generated from Swagger / Open API specification
 * The version of the OpenAPI document: 1.5.1-pre.0
 * Contact: blah@cliffano.com
 * Generated by: https://github.com/openapitools/openapi-generator.git
 */

/**
 * NOTE: This class is auto generated by the openapi generator program.
 * https://github.com/openapitools/openapi-generator
 */
namespace OpenAPIServer\Model;

use OpenAPIServer\BaseModel;

/**
 * PipelineRunNode
 *
 * @package OpenAPIServer\Model
 * @author  OpenAPI Generator team
 * @link    https://github.com/openapitools/openapi-generator
 */
class PipelineRunNode extends BaseModel
{
    /**
     * @var string Models namespace.
     * Can be required for data deserialization when model contains referenced schemas.
     */
    protected const MODELS_NAMESPACE = '\OpenAPIServer\Model';

    /**
     * @var string Constant with OAS schema of current class.
     * Should be overwritten by inherited class.
     */
    protected const MODEL_SCHEMA = <<<'SCHEMA'
{
  "type" : "object",
  "properties" : {
    "_class" : {
      "type" : "string"
    },
    "displayName" : {
      "type" : "string"
    },
    "durationInMillis" : {
      "type" : "integer"
    },
    "edges" : {
      "type" : "array",
      "items" : {
        "$ref" : "#/components/schemas/PipelineRunNodeedges"
      }
    },
    "id" : {
      "type" : "string"
    },
    "result" : {
      "type" : "string"
    },
    "startTime" : {
      "type" : "string"
    },
    "state" : {
      "type" : "string"
    }
  }
}
SCHEMA;
}


text:
package com.is2t.mwt.widgets.button.renderer;

import com.is2t.mwt.widgets.button.ImageButton;
import com.is2t.mwt.widgets.renderers.util.Drawer;

import ej.microui.io.GraphicsContext;
import ej.microui.io.Image;
import ej.mwt.MWT;
import ej.mwt.Renderable;
import ej.mwt.Widget;

public class ImageButtonRenderer extends ButtonRenderer {

	public ImageButtonRenderer(Drawer drawer) {
		super(drawer);
	}

	@Override
	public Class<?> getManagedType() {
		return ImageButton.class;
	}

	@Override
	public int getMargin() {
		return 10;
	}

	@Override
	public int getPadding() {
		return MWT.NONE;
	}

	@Override
	public int getPreferredContentHeight(Widget widget) {
		ImageButton button = (ImageButton) widget;
		return button.getNormalImage().getHeight();
	}

	@Override
	public int getPreferredContentWidth(Widget widget) {
		ImageButton button = (ImageButton) widget;
		return button.getNormalImage().getWidth();
	}

	@Override
	public void render(GraphicsContext g, Renderable renderable) {
		ImageButton button = (ImageButton) renderable;
		int width = button.getWidth();
		int height = button.getHeight();
		Image image;

		if (button.isPressed()) {
			image = button.getPressedImage();
		} else {
			image = button.getNormalImage();
		}

		g.drawImage(image, width / 2, height / 2, GraphicsContext.HCENTER | GraphicsContext.VCENTER);
	}
}


text:
Validates if the given input is alphanumeric.

Valid values:

```js
validator.alnum('pt-BR').validate('kre123skção');
validator.alnum('nb-NO').validate('Ære321');
validator.alnum().validate('alganet');
validator.alnum().validate('abc123');
```

Invalid values:

```js
validator.alnum('pt-BR').validate('Ære321');
validator.alnum('nb-NO').validate('kre123skção');
validator.alnum().validate('16-50');
validator.alnum().validate('@#$');
validator.alnum().validate('_');
```


text:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
  <persistence-unit name="br.com.crescer_spring-crescer-web_jar_1.0.0.0PU" transaction-type="RESOURCE_LOCAL">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <class>br.com.crescer.entitiy.Cidade</class>
    <class>br.com.crescer.entitiy.Pedido</class>
    <class>br.com.crescer.entitiy.Cliente</class>
    <class>br.com.crescer.entitiy.Pedidoitem</class>
    <class>br.com.crescer.entitiy.Produto</class>
    <class>br.com.crescer.entitiy.Material</class>
    <properties>
      <property name="javax.persistence.jdbc.url" value="jdbc:oracle:thin:@localhost:1521:XE"/>
      <property name="javax.persistence.jdbc.user" value="CRESCER16"/>
      <property name="javax.persistence.jdbc.driver" value="oracle.jdbc.OracleDriver"/>
      <property name="javax.persistence.jdbc.password" value="CRESCER16"/>
    </properties>
  </persistence-unit>
</persistence>


text:
/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */
/*global define */

define(function (require, exports, module) {

    'use strict';

    module.exports = {
        root: true
    };
});


text:
Repo for the Tech4Africa Random Hack of Kindness, focusing on education.

## Problem
Students arrive at school / university, and find that their teachers are not there, they are drunk, or simply not teaching.

## Solution
Enable students to rate their teachers using a simple mobile app, so that this data can be shared with other students / educational institutions.
Hopefully the result will be greater accountability.


text:
<!--
  ~ Copyright (C) 2015 Baidu, Inc. All Rights Reserved.
  -->
<resources >
    <string name="app_name" >HackDex</string >
</resources >


text:
from json import load

def read_json(json_file_path):

    with open(json_file_path) as json_file:

        return load(json_file)


text:
package org.globsframework.utils.container.intkey;

public interface IntKeyContainer<T> {

    T get(int key);

    IntKeyContainer<T> put(int key, T elem);

    IntKeyContainer<T> remove(int key);

    IntKeyContainer<T> clear();

    void apply(Functor<T> functor);

    interface Functor<T> {
        void apply(int key, T value);
    }

}


text:
#require "rubygems"
#require 'test/unit'
require "rspec"

#$LOAD_PATH << File.expand_path(File.join('..', 'lib'), File.dirname(__FILE__))

__END__

# http://www.messaliberty.com/2009/03/ruby-how-to-use-rspec-01-quickstart/

Needed "require 'test/unit'" before "require 'spec'" due to an error below with autospec.

/home/ice/.gem/ruby/1.8/gems/rspec-1.1.11/lib/spec.rb:25:in `exit?': undefined method `run?' for Test::Unit:Module (NoMethodError)
        from /home/ice/.gem/ruby/1.8/gems/rspec-1.1.11/lib/spec/runner.rb:192:in `register_at_exit_hook'
        from spec/messa/db/clawler/page_data_spec.rb:9

ref: http://www.ruby-forum.com/topic/170889


text:
require 'chef/config'
require 'chef/mixin/check_helper'
require 'chef/mixin/params_validate'
require 'chef/mixin/from_file'
require 'chef/couchdb'
require 'chef/queue'
require 'extlib'
require 'json'

class Chef
  class Node

    attr_accessor :attribute, :recipe_list, :couchdb_rev, :run_state

    include Chef::Mixin::CheckHelper
    include Chef::Mixin::FromFile
    include Chef::Mixin::ParamsValidate

    DESIGN_DOCUMENT = {
      "version" => 3,
      "language" => "javascript",
      "views" => {
        "all" => {
          "map" => <<-EOJS
          function(doc) {
            if (doc.chef_type == "node") {
              emit(doc.name, doc);
            }
          }
          EOJS
        },
        "all_id" => {
          "map" => <<-EOJS
          function(doc) {
            if (doc.chef_type == "node") {
              emit(doc.name, doc.name);
            }
          }
          EOJS
        },
      },
    }

    # Create a new Chef::Node object.
    def initialize()
      @name = nil
      @attribute = Mash.new
      @recipe_list = Array.new
      @couchdb_rev = nil
      @couchdb = Chef::CouchDB.new
      @run_state = {
        :template_cache => Hash.new,
        :seen_recipes => Hash.new
      }
    end

    # Find a recipe for this Chef::Node by fqdn.  Will search first for
    # Chef::Config["node_path"]/fqdn.rb, then hostname.rb, then default.rb.
    #
    # Returns a new Chef::Node object.
    #
    # Raises an ArgumentError if it cannot find the node.
    def find_file(fqdn)
      node_file = nil
      host_parts = fqdn.split(".")
      hostname = host_parts[0]

      if File.exists?(File.join(Chef::Config[:node_path], "#{fqdn}.rb"))
        node_file = File.join(Chef::Config[:node_path], "#{fqdn}.rb")
      elsif File.exists?(File.join(Chef::Config[:node_path], "#{hostname}.rb"))
        node_file = File.join(Chef::Config[:node_path], "#{hostname}.rb")
      elsif File.exists?(File.join(Chef::Config[:node_path], "default.rb"))
        node_file = File.join(Chef::Config[:node_path], "default.rb")
      end
      unless node_file
        raise ArgumentError, "Cannot find a node matching #{fqdn}, not even with default.rb!"
      end
      self.from_file(node_file)
    end

    # Set the name of this Node, or return the current name.
    def name(arg=nil)
      if arg != nil
        validate(
          { :name => arg },
          {
            :name => {
              :kind_of => String
            }
          }
        )
        @name = arg
      else
        @name
      end
    end

    # Return an attribute of this node.  Returns nil if the attribute is not found.
    def [](attrib)
      if @attribute.has_key?(attrib)
        @attribute[attrib]
      elsif @attribute.has_key?(attrib.to_s)
        @attribute[attrib.to_s]
      else
        nil
      end
    end

    # Set an attribute of this node
    def []=(attrib, value)
      @attribute[attrib] = value
    end

    # Yield each key to the block
    def each(&block)
      @attribute.each_key do |k|
        yield(k)
      end
    end

    # Iterates over each attribute, passing the attribute and value to the block.
    def each_attribute(&block)
      @attribute.sort {|a,b| a[0] <=> b[0] }.each do |k,v|
        yield(k, v)
      end
    end

    # Return true if this Node has a given attribute, false if not.  Takes either a symbol or
    # a string.
    def attribute?(attrib)
      result = false
      result = @attribute.has_key?(attrib)
      return result if result
      return @attribute.has_key?(attrib.to_sym)
    end

    # Returns true if this Node expects a given recipe, false if not.
    def recipe?(recipe_name)
      @recipe_list.detect { |r| r == recipe_name } ? true : false
    end

    # Returns an Array of recipes.  If you call it with arguments, they will become the new
    # list of recipes.
    def recipes(*args)
      if args.length > 0
        @recipe_list = args.flatten
      else
        @recipe_list
      end
    end

    # Set an attribute based on the missing method.  If you pass an argument, we'll use that
    # to set the attribute values.  Otherwise, we'll wind up just returning the attributes
    # value.
    def method_missing(symbol, *args)
      if args.length != 0
        @attribute[symbol] = args.length == 1 ? args[0] : args
      else
        if @attribute.has_key?(symbol)
          @attribute[symbol]
        else
          raise ArgumentError, "Attribute #{symbol.to_s} is not defined!"
        end
      end
    end

    # Turns the node into an object that we can index.  I apologize up front for the
    # super confusion that is the recursive index_flatten hash, which comes up next.
    # Faith, young one, faith.
    #
    # === Returns
    # index_hash<Hash>:: A flattened hash of all the nodes attributes, suitable for indexing.
    def to_index
      index_hash = {
        "index_name" => "node",
        "id" => "node_#{@name}",
        "name" => @name,
      }
      @attribute.each do |key, value|
        if value.kind_of?(Hash) || value.kind_of?(Mash)
          index_flatten_hash(key, value).each do |to_index|
            to_index.each do |nk, nv|
              index_hash[nk] = nv
            end
          end
        else
          index_hash[key] = value
        end
      end
      index_hash["recipe"] = @recipe_list if @recipe_list.length > 0
      index_hash
    end

    # Ah, song of my heart, index_flatten_hash.  This method flattens a hash in preparation
    # for indexing, by appending the name of it's parent to a current key with an _.  Hence,
    # node[:bar][:baz] = 'monkey' becomes bar_baz:monkey.
    #
    # === Returns
    # results<Array>:: An array of hashes with one element.
    def index_flatten_hash(parent_name, hash)
      results = Array.new
      hash.each do |k, v|
        if v.kind_of?(Hash) || v.kind_of?(Mash)
          results << index_flatten_hash("#{parent_name}_#{k}", v)
        else
          results << { "#{parent_name}_#{k}", v }
        end
      end
      results.flatten
    end

    # Serialize this object as a hash
    def to_json(*a)
      result = {
        "name" => @name,
        'json_class' => self.class.name,
        "attributes" => @attribute,
        "chef_type" => "node",
        "recipes" => @recipe_list,
      }
      result["_rev"] = @couchdb_rev if @couchdb_rev
      result.to_json(*a)
    end

    # Create a Chef::Node from JSON
    def self.json_create(o)
      node = new
      node.name(o["name"])
      o["attributes"].each do |k,v|
        node[k] = v
      end
      o["recipes"].each do |r|
        node.recipes << r
      end
      node.couchdb_rev = o["_rev"] if o.has_key?("_rev")
      node
    end

    # List all the Chef::Node objects in the CouchDB.  If inflate is set to true, you will get
    # the full list of all Nodes, fully inflated.
    def self.list(inflate=false)
      rs = Chef::CouchDB.new.list("nodes", inflate)
      if inflate
        rs["rows"].collect { |r| r["value"] }
      else
        rs["rows"].collect { |r| r["key"] }
      end
    end

    # Load a node by name from CouchDB
    def self.load(name)
      Chef::CouchDB.new.load("node", name)
    end

    # Remove this node from the CouchDB
    def destroy
      Chef::Queue.send_msg(:queue, :remove, self)
      @couchdb.delete("node", @name, @couchdb_rev)
    end

    # Save this node to the CouchDB
    def save
      Chef::Queue.send_msg(:queue, :index, self)
      results = @couchdb.store("node", @name, self)
      @couchdb_rev = results["rev"]
    end

    # Set up our CouchDB design document
    def self.create_design_document
      Chef::CouchDB.new.create_design_document("nodes", DESIGN_DOCUMENT)
    end

    # As a string
    def to_s
      "node[#{@name}]"
    end

  end
end


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>YamlConfigurationLoader</title>
<meta name="date" content="2015-05-16">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.apache.cassandra.config

Class YamlConfigurationLoader

java.lang.Object

org.apache.cassandra.config.YamlConfigurationLoader

All Implemented Interfaces:

ConfigurationLoader

Direct Known Subclasses:

OffsetAwareConfigurationLoader

public class YamlConfigurationLoader
extends java.lang.Object
implements ConfigurationLoader

Constructor Summary

Constructors

Constructor and Description

YamlConfigurationLoader()

Method Summary

Methods

Modifier and Type
Method and Description

Config
loadConfig()

Loads a Config object to use to configure a node.

Config
loadConfig(java.net.URL url)

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

YamlConfigurationLoader

public YamlConfigurationLoader()

Method Detail

loadConfig

public Config loadConfig()
                  throws ConfigurationException

Description copied from interface: ConfigurationLoader

Loads a Config object to use to configure a node.

Specified by:

loadConfig in interface ConfigurationLoader

Returns:

the Config to use.

Throws:

ConfigurationException - if the configuration cannot be properly loaded.

loadConfig

public Config loadConfig(java.net.URL url)
                  throws ConfigurationException

Throws:

ConfigurationException

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
layout: post
title: All in the Family
date: 2012-07-26 18:45
author: admin
comments: true
---
If there's been one change I have had this year since getting hitched this winter (note to self, six months coming up - buy flowers) it's that I never, ever get lonely. Either people are in our house or we, in theirs.

This past week alone, we will have hosted 3 times by the time the week ends. I'm not used to this - all these people around me, all the time:)

Now, this is all tongue in cheek and all -  but between hosting and painting there sure isn't a whole lot of 'me' time lately (that, and fixing computer problems for BW, but we'll leave that alone...hoo boy touchy subject)

Take this Tuesday, for example. We had company, or visitors and it was my family that came to see me. They brought gifts, and of course we had a lovely time as we spent time together away from the TV:

All is not bad on the Island of Grand, though because when we host or get hosted, one thing happens time and time again, and that is: we eat well. A little too well, methinks:

If you can't read the numbers, that's OK. Let's just pretend they're low. My point is that with all this social dining lately, I think I am starting to feel gravity's pull a touch more than I am used to.

I blame the following:

Burgers with Blue Cheese Dressing

Grilled Sirloin Steak

This might have something to do with my weight increase too I think.

If you recall, when I started this blog I told you we did this. Well, it's been some time since that actually happened let me tell you, and much to BW's dismay we have to start again. There's a fine line between fat and happy, and well - just fat.

The takeaway is that all this socializing comes with a price, and that price has to be paid in 2 mile daily increments or else.. like I said, fat.

I guess that this is a small price to pay for visiting with your friends and family, and truth be told - it's priceless. But all this socializing sure is hard on a (former) skinny guy's waistline.


text:
using System;
using System.IO;
using PHP.Core;

namespace Pluton.PluginLoaders
{
    /// <summary>
    /// PHP plugin.
    /// </summary>
    public class PHPPlugin : BasePlugin
    {
        ScriptContext context;
        public PhpArray PHPGlobals;
        PhpObject Class;
        private DirectoryInfo rpath;

        /// <summary>
        /// Initializes a new instance of the <see cref="Pluton.PHPPlugin"/> class.
        /// </summary>
        /// <param name="name">Name.</param>
        /// <param name="code">Code.</param>
        /// <param name="rootdir">Rootdir.</param>
        public PHPPlugin(string name, string code, DirectoryInfo rootdir)
            : base(name, rootdir)
        {
            rpath = rootdir;
            Type = PluginType.PHP;

            if (CoreConfig.GetInstance().GetBoolValue("php", "checkHash") && !code.VerifyMD5Hash())
            {
                Logger.LogDebug(String.Format("[Plugin] MD5Hash not found for: {0} [{1}]!", name, Type));
                State = PluginState.HashNotFound;
                return;
            }

            System.Threading.ThreadPool.QueueUserWorkItem(
                new System.Threading.WaitCallback(a => Load(code)), null);
        }

        /// <summary>
        /// Invoke the specified method and args.
        /// </summary>
        /// <param name="method">Method.</param>
        /// <param name="args">Arguments.</param>
        /// <param name="func">Func.</param>
        public override object Invoke(string func, params object[] args)
        {
            try
            {
                if (State == PluginState.Loaded && Globals.Contains(func))
                {
                    object result = (object)null;

                    using (new Stopper(Name, func))
                    {
                        var caller = new PhpCallback(Class, func);
                        result = caller.Invoke(args);
                    }
                    return result;
                }
                else
                {
                    Logger.LogWarning("[Plugin] Function: " + func + " not found in plugin: " + Name + ", or plugin is not loaded.");
                    return null;
                }
            }
            catch (Exception ex)
            {
                string fileinfo = (String.Format("{0}<{1}>.{2}()", Name, Type, func) + Environment.NewLine);
                Logger.LogError(fileinfo + FormatException(ex));
                return null;
            }
        }

        public override void Load(string code = "")
        {
            try
            {
                context = ScriptContext.CurrentContext;
                context.Include(rpath  + "\\" + Name + ".php", true);
                Class = (PhpObject) context.NewObject(Name);
                PHPGlobals = context.GlobalVariables;
                context.GlobalVariables.Add("Commands", chatCommands);
                context.GlobalVariables.Add("DataStore", DataStore.GetInstance());
                context.GlobalVariables.Add("Find", Find.GetInstance());
                context.GlobalVariables.Add("GlobalData", GlobalData);
                context.GlobalVariables.Add("Plugin", this);
                context.GlobalVariables.Add("Server", Pluton.Server.GetInstance());
                context.GlobalVariables.Add("ServerConsoleCommands", consoleCommands);
                context.GlobalVariables.Add("Util", Util.GetInstance());
                context.GlobalVariables.Add("Web", Web.GetInstance());
                context.GlobalVariables.Add("World", World.GetInstance());
                foreach (var x in PHPGlobals)
                {
                    Globals.Add(x.Key.ToString());
                }

                State = PluginState.Loaded;
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
                State = PluginState.FailedToLoad;
            }

            PluginLoader.GetInstance().OnPluginLoaded(this);
        }
    }
}


text:
<?php
	date_default_timezone_set('Asia/Ho_Chi_Minh');

	require 'config.php';
	require 'paths.php';

	//autoload libs
	function __autoload($class){
		require LIBS . $class .'.php';
	}
	require_once LIBS .'other' . DS . 'PHPMailer' . DS . 'class.phpmailer.php';
	require_once LIBS .'other' . DS . 'simple_html_dom.php';

class autoConFirm {
    function __construct() {
        $this->db = new Database();
    }

    public function setConfirm(){
    	$sqlSelect = <<<SQL
    	SELECT booking_detail_id, booking_id, booking_detail_date, booking_detail_time_start, booking_detail_quantity ,booking_detail_time_confirm, client_name, client_phone, client_email, user_address
    	FROM booking_detail
    	INNER JOIN booking ON booking.booking_id = booking_detail.booking_detail_booking_id
    	INNER JOIN client ON client.client_id = booking.booking_client_id
    	INNER JOIN user ON user.user_id = booking_detail.booking_detail_user_id
    	WHERE booking_detail.booking_detail_is_confirm <> 1
SQL;

		$unActive =  $this->db->select($sqlSelect);

		// print_r($unActive);
		foreach ($unActive as $key => $value) {
			 echo $key;
			$dateConfirm = strtotime($value['booking_detail_time_confirm']);
			$now = strtotime(date('Y-m-d H:i:s'));

			// if confirm time is little now time then confirm booking_detail
			if($now >= $dateConfirm){
				$to = $value['client_email'];
				$client_phone = $value['client_phone'];
			 	$params = [
		            "CLIENT_NAME" => $value['client_name'],
		            "BOOKING_CODE" =>  $value['booking_id'],
		            "SPA_NAME" => $value['user_address'],
		            "SERVICE_DATE" => date_format(date_create($value['booking_detail_date']),"d/m/Y"),
		            "SERVICE_TIME" => substr($value['booking_detail_time_start'],0,2)."h ".substr($value['booking_detail_time_start'],3,2)."'",
		            "SERVICE_NUMBER" => $value['booking_detail_quantity'],
	            ];

				$update = $this->updateConfirm($value['booking_detail_id']);
				if($update){
					$email = new email_template();
					$sms = new sms();

					$email->send($to, $params,'clientAppointmentConfirmed');
					$sms->send($client_phone, $params, 'clientOrderConfirmed');
				}

			}

		}
    }

    // update field booking_detail_is_confirm = 1 in tabel booking_detail
    public function updateConfirm($booking_detail_id){
    	$data = array(
			"booking_detail_is_confirm" => 1,
			"booking_detail_request_change" => 0,
			"booking_detail_client_response" => 0
		);
		$where = "booking_detail_id = $booking_detail_id";
    	return $this->db->update('booking_detail', $data, $where);
    }
}

$confirm = new autoConFirm();
$confirm->setConfirm();


text:
<!DOCTYPE html>

	<meta charset="utf-8">

	<title>SensorsAnalyticsSDK Class Reference</title>

	<link rel="stylesheet" href="../css/style.css">
	<meta name="viewport" content="initial-scale=1, maximum-scale=1.4">
	<meta name="generator" content="appledoc 2.2.1 (build 1334)">

				qudianDoc

				qudian

Index

Hierarchy

							On This Page

							<select id="jump-to">
	<option value="top">Jump To…</option>

	<option value="overview">Overview</option>

	<option value="tasks">Tasks</option>

	<optgroup label="Properties">

		<option value="//api/name/checkForEventBindingsOnActive">checkForEventBindingsOnActive</option>

		<option value="//api/name/distinctId">distinctId</option>

		<option value="//api/name/flushBeforeEnterBackground">flushBeforeEnterBackground</option>

		<option value="//api/name/flushBulkSize">flushBulkSize</option>

		<option value="//api/name/flushInterval">flushInterval</option>

		<option value="//api/name/people">people</option>

		<option value="//api/name/vtrackWindow">vtrackWindow</option>

	</optgroup>

	<optgroup label="Class Methods">

		<option value="//api/name/sharedInstance">+ sharedInstance</option>

		<option value="//api/name/sharedInstanceWithServerURL:andConfigureURL:andDebugMode:">+ sharedInstanceWithServerURL:andConfigureURL:andDebugMode:</option>

		<option value="//api/name/sharedInstanceWithServerURL:andConfigureURL:andVTrackServerURL:andDebugMode:">+ sharedInstanceWithServerURL:andConfigureURL:andVTrackServerURL:andDebugMode:</option>

	</optgroup>

	<optgroup label="Instance Methods">

		<option value="//api/name/clearSuperProperties">- clearSuperProperties</option>

		<option value="//api/name/clearTrackTimer">- clearTrackTimer</option>

		<option value="//api/name/currentSuperProperties">- currentSuperProperties</option>

		<option value="//api/name/enableAutoTrack">- enableAutoTrack</option>

		<option value="//api/name/enableEditingVTrack">- enableEditingVTrack</option>

		<option value="//api/name/filterAutoTrackControllers:">- filterAutoTrackControllers:</option>

		<option value="//api/name/flush">- flush</option>

		<option value="//api/name/getLastScreenTrackProperties">- getLastScreenTrackProperties</option>

		<option value="//api/name/getLastScreenUrl">- getLastScreenUrl</option>

		<option value="//api/name/identify:">- identify:</option>

		<option value="//api/name/libVersion">- libVersion</option>

		<option value="//api/name/registerSuperProperties:">- registerSuperProperties:</option>

		<option value="//api/name/showUpWebView:WithRequest:">- showUpWebView:WithRequest:</option>

		<option value="//api/name/showUpWebView:WithRequest:andProperties:">- showUpWebView:WithRequest:andProperties:</option>

		<option value="//api/name/track:">- track:</option>

		<option value="//api/name/track:withProperties:">- track:withProperties:</option>

		<option value="//api/name/trackInstallation:">- trackInstallation:</option>

		<option value="//api/name/trackInstallation:withProperties:">- trackInstallation:withProperties:</option>

		<option value="//api/name/trackSignUp:">- trackSignUp:</option>

		<option value="//api/name/trackSignUp:withProperties:">- trackSignUp:withProperties:</option>

		<option value="//api/name/trackTimer:">- trackTimer:</option>

		<option value="//api/name/trackTimer:withTimeUnit:">- trackTimer:withTimeUnit:</option>

		<option value="//api/name/trackViewScreen:withProperties:">- trackViewScreen:withProperties:</option>

		<option value="//api/name/unregisterSuperProperty:">- unregisterSuperProperty:</option>

	</optgroup>

</select>

SensorsAnalyticsSDK Class Reference

	Inherits from
	NSObject

	Declared in
	SensorsAnalyticsSDK.h
SensorsAnalyticsSDK.m

Overview

@class
SensorsAnalyticsSDK类

@abstract
在SDK中嵌入SensorsAnalytics的SDK并进行使用的主要API

@discussion
使用SensorsAnalyticsSDK类来跟踪用户行为,并且把数据发给所指定的SensorsAnalytics的服务。
它也提供了一个SensorsAnalyticsPeople类型的property,用来访问用户Profile相关的API。

  people

@property

@property (atomic, readonly, strong) SensorsAnalyticsPeople *people

Discussion

@property

@abstract
对SensorsAnalyticsPeople这个API的访问接口

Declared In

SensorsAnalyticsSDK.h

  distinctId

@property

@property (atomic, readonly, copy) NSString *distinctId

Discussion

@property

@abstract
获取用户的唯一用户标识

Declared In

SensorsAnalyticsSDK.h

  checkForEventBindingsOnActive

@property

@property (atomic) BOOL checkForEventBindingsOnActive

Discussion

@property

@abstract
当App进入活跃状态时,是否从SensrosAnalytics获取新的可视化埋点配置

@discussion
默认值为 YES。

Declared In

SensorsAnalyticsSDK.h

  flushBeforeEnterBackground

@proeprty

@property (atomic) BOOL flushBeforeEnterBackground

Discussion

@proeprty

@abstract
当App进入后台时,是否执行flush将数据发送到SensrosAnalytics

@discussion
默认值为 YES

Declared In

SensorsAnalyticsSDK.h

  flushInterval

@property

@property (atomic) UInt64 flushInterval

Discussion

@property

@abstract
两次数据发送的最小时间间隔,单位毫秒

@discussion
默认值为 15 * 1000 毫秒, 在每次调用track、trackSignUp以及profileSet等接口的时候,
都会检查如下条件,以判断是否向服务器上传数据:
1. 是否WIFI/3G/4G网络
2. 是否满足以下数据发送条件之一:
1) 与上次发送的时间间隔是否大于 flushInterval
2) 本地缓存日志数目是否达到 flushBulkSize
如果同时满足这两个条件,则向服务器发送一次数据;如果不满足,则把数据加入到队列中,等待下次检查时把整个队列的内容一并发送。
需要注意的是,为了避免占用过多存储,队列最多只缓存10000条数据。

Declared In

SensorsAnalyticsSDK.h

  flushBulkSize

@property

@property (atomic) UInt64 flushBulkSize

Discussion

@property

@abstract
本地缓存的最大事件数目,当累积日志量达到阈值时发送数据

@discussion
默认值为 100,在每次调用track、trackSignUp以及profileSet等接口的时候,都会检查如下条件,以判断是否向服务器上传数据:
1. 是否WIFI/3G/4G网络
2. 是否满足以下数据发送条件之一:
1) 与上次发送的时间间隔是否大于 flushInterval
2) 本地缓存日志数目是否达到 flushBulkSize
如果同时满足这两个条件,则向服务器发送一次数据;如果不满足,则把数据加入到队列中,等待下次检查时把整个队列的内容一并发送。
需要注意的是,为了避免占用过多存储,队列最多只缓存10000条数据。

Declared In

SensorsAnalyticsSDK.h

  vtrackWindow

@property

@property (atomic) UIWindow *vtrackWindow

Discussion

@property

@abstract
可视化埋点中,UIWindow 对象。

@discussion
该方法应在 SDK 初始化完成后立即调用

默认值为App 的 UIWindow 对象是 UIApplication 的 windows 列表中的 firstObject,若用户调用 UIWindow 的 makeKeyAndVisible 等方法,
改变了 windows 列表中各个对象的 windowLevel,会导致可视化埋点无法正常获取需要埋点的 UIWindow 对象。用户调用该借口,设置可视化埋点需要管理的
UIWindow 对象

Declared In

SensorsAnalyticsSDK.h

+ sharedInstanceWithServerURL:andConfigureURL:andDebugMode:

@abstract
根据传入的配置,初始化并返回一个SensorsAnalyticsSDK的单例

+ (SensorsAnalyticsSDK *)sharedInstanceWithServerURL:(NSString *)serverURL andConfigureURL:(NSString *)configureURL andDebugMode:(SensorsAnalyticsDebugMode)debugMode

Parameters

						serverURL

收集事件的 URL

						configureURL

获取配置信息的 URL

						debugMode

Sensors Analytics 的 Debug 模式

Return Value

返回的单例

Discussion

@abstract
根据传入的配置,初始化并返回一个SensorsAnalyticsSDK的单例

@discussion
该方法会根据 configureURL 参数的 Url Path,自动计算可视化埋点配置系统的 Url。例如,若传入的 configureURL 为:
http://sa_host:8007/api/vtrack/config/iOS.conf
则会自动生成可视化埋点配置系统的 Url:
ws://sa_host:8007/api/ws
若用户私有环境中部署了 Sensors Analytics 系统,并修改了 Nginx 配置,则需要使用 SensorsAnalyticsSDK#sharedInstanceWithServerURL:andConfigureURL:andDebugMode 进行初始化。

Declared In

SensorsAnalyticsSDK.h

+ sharedInstanceWithServerURL:andConfigureURL:andVTrackServerURL:andDebugMode:

@abstract
根据传入的配置,初始化并返回一个SensorsAnalyticsSDK的单例

+ (SensorsAnalyticsSDK *)sharedInstanceWithServerURL:(NSString *)serverURL andConfigureURL:(NSString *)configureURL andVTrackServerURL:(NSString *)vtrackServerURL andDebugMode:(SensorsAnalyticsDebugMode)debugMode

Parameters

						serverURL

收集事件的URL

						configureURL

获取配置信息的URL

						vtrackServerURL

可视化埋点配置系统的URL

						debugMode

Sensors Analytics 的Debug模式

Return Value

返回的单例

Discussion

@abstract
根据传入的配置,初始化并返回一个SensorsAnalyticsSDK的单例

Declared In

SensorsAnalyticsSDK.h

+ sharedInstance

@abstract
返回之前所初始化好的单例

+ (SensorsAnalyticsSDK *)sharedInstance

Return Value

返回的单例

Discussion

@abstract
返回之前所初始化好的单例

@discussion
调用这个方法之前,必须先调用sharedInstanceWithServerURL这个方法

Declared In

SensorsAnalyticsSDK.h

– enableEditingVTrack

@abstract
允许 App 连接可视化埋点管理界面

- (void)enableEditingVTrack

Discussion

@abstract
允许 App 连接可视化埋点管理界面

@discussion
调用这个方法,允许 App 连接可视化埋点管理界面并设置可视化埋点。建议用户只在 DEBUG 编译模式下,打开该选项。

Declared In

SensorsAnalyticsSDK.h

– showUpWebView:WithRequest:

@abstract
将distinctId传递给当前的WebView

- (BOOL)showUpWebView:(id)webView WithRequest:(NSURLRequest *)request

Parameters

						webView

当前WebView,支持UIWebView和WKWebView

Return Value

YES:SDK已进行处理,NO:SDK没有进行处理

Discussion

@abstract
将distinctId传递给当前的WebView

@discussion
混合开发时,将distinctId传递给当前的WebView

Declared In

SensorsAnalyticsSDK.h

– showUpWebView:WithRequest:andProperties:

@abstract
将distinctId传递给当前的WebView

- (BOOL)showUpWebView:(id)webView WithRequest:(NSURLRequest *)request andProperties:(NSDictionary *)propertyDict

Parameters

						webView

当前WebView,支持UIWebView和WKWebView

						request

NSURLRequest

						propertyDict

NSDictionary 自定义扩展属性

Return Value

YES:SDK已进行处理,NO:SDK没有进行处理

Discussion

@abstract
将distinctId传递给当前的WebView

@discussion
混合开发时,将distinctId传递给当前的WebView

Declared In

SensorsAnalyticsSDK.h

– enableAutoTrack

@property

- (void)enableAutoTrack

Discussion

@property

@abstract
打开 SDK 自动追踪

@discussion
该功能自动追踪 App 的一些行为,例如 SDK 初始化、App 启动 / 关闭、进入页面 等等,具体信息请参考文档:
https://sensorsdata.cn/manual/ios_sdk.html
该功能默认关闭

Declared In

SensorsAnalyticsSDK.h

– identify:

@abstract
设置当前用户的distinctId

- (void)identify:(NSString *)distinctId

Parameters

						distinctId

当前用户的distinctId

Discussion

@abstract
设置当前用户的distinctId

@discussion
一般情况下,如果是一个注册用户,则应该使用注册系统内的user_id
如果是个未注册用户,则可以选择一个不会重复的匿名ID,如设备ID等
如果客户没有设置indentify,则使用SDK自动生成的匿名ID
SDK会自动将设置的distinctId保存到文件中,下次启动时会从中读取

Declared In

SensorsAnalyticsSDK.h

– track:withProperties:

@abstract
调用track接口,追踪一个带有属性的event

- (void)track:(NSString *)event withProperties:(NSDictionary *)propertyDict

Parameters

						event

event的名称

						propertieDict

event的属性

Discussion

@abstract
调用track接口,追踪一个带有属性的event

@discussion
propertyDict是一个Map。
其中的key是Property的名称,必须是NSString
value则是Property的内容,只支持 NSString,NSNumber,NSSet,NSDate这些类型
特别的,NSSet类型的value中目前只支持其中的元素是NSString

Declared In

SensorsAnalyticsSDK.h

– track:

@abstract
调用track接口,追踪一个无私有属性的event

- (void)track:(NSString *)event

Parameters

						event

event的名称

Discussion

@abstract
调用track接口,追踪一个无私有属性的event

Declared In

SensorsAnalyticsSDK.h

– trackTimer:

@abstract
初始化事件的计时器。

- (void)trackTimer:(NSString *)event

Parameters

						event

event的名称

Discussion

@abstract
初始化事件的计时器。

@discussion
若需要统计某个事件的持续时间,先在事件开始时调用 trackTimer:“Event” 记录事件开始时间,该方法并不会真正发
送事件;随后在事件结束时,调用 track:“Event” withProperties:properties,SDK 会追踪 “Event” 事件,并自动将事件持续时
间记录在事件属性 “event_duration” 中。

默认时间单位为毫秒,若需要以其他时间单位统计时长,请使用 trackTimer:withTimeUnit

多次调用 trackTimer:“Event” 时,事件 “Event” 的开始时间以最后一次调用时为准。

Declared In

SensorsAnalyticsSDK.h

– trackTimer:withTimeUnit:

@abstract
初始化事件的计时器,允许用户指定计时单位。

- (void)trackTimer:(NSString *)event withTimeUnit:(SensorsAnalyticsTimeUnit)timeUnit

Parameters

						event

event的名称

						timeUnit

计时单位,毫秒/秒/分钟/小时

Discussion

@abstract
初始化事件的计时器,允许用户指定计时单位。

@discussion
请参考 trackTimer

Declared In

SensorsAnalyticsSDK.h

– clearTrackTimer

@abstract
清除所有事件计时器

- (void)clearTrackTimer

Discussion

@abstract
清除所有事件计时器

Declared In

SensorsAnalyticsSDK.h

– trackSignUp:withProperties:

@abstract
提供一个接口,用来在用户注册的时候,用注册ID来替换用户以前的匿名ID

- (void)trackSignUp:(NSString *)newDistinctId withProperties:(NSDictionary *)propertyDict

Parameters

						newDistinctId

用户完成注册后生成的注册ID

						propertieDict

event的属性

Discussion

@abstract
提供一个接口,用来在用户注册的时候,用注册ID来替换用户以前的匿名ID

@discussion
这个接口是一个较为复杂的功能,请在使用前先阅读相关说明: http://www.sensorsdata.cn/manual/track_signup.html,并在必要时联系我们的技术支持人员。

Declared In

SensorsAnalyticsSDK.h

– trackSignUp:

@abstract
不带私有属性的trackSignUp,用来在用户注册的时候,用注册ID来替换用户以前的匿名ID

- (void)trackSignUp:(NSString *)newDistinctId

Parameters

						newDistinctId

用户完成注册后生成的注册ID

Discussion

@abstract
不带私有属性的trackSignUp,用来在用户注册的时候,用注册ID来替换用户以前的匿名ID

@discussion
这个接口是一个较为复杂的功能,请在使用前先阅读相关说明: http://www.sensorsdata.cn/manual/track_signup.html,并在必要时联系我们的技术支持人员。

Declared In

SensorsAnalyticsSDK.h

– trackInstallation:withProperties:

@abstract
用于在 App 首次启动时追踪渠道来源,并设置追踪渠道事件的属性。SDK会将渠道值填入事件属性 $utm_ 开头的一系列属性中。
使用该接口,必须在工程中引入 SafariService.framework

- (void)trackInstallation:(NSString *)event withProperties:(NSDictionary *)propertyDict

Parameters

						event

event的名称

						propertieDict

event的属性

Discussion

@abstract
用于在 App 首次启动时追踪渠道来源,并设置追踪渠道事件的属性。SDK会将渠道值填入事件属性 $utm_ 开头的一系列属性中。
使用该接口,必须在工程中引入 SafariService.framework

@discussion
propertyDict是一个Map。
其中的key是Property的名称,必须是NSString
value则是Property的内容,只支持 NSString,NSNumber,NSSet,NSDate这些类型
特别的,NSSet类型的value中目前只支持其中的元素是NSString

这个接口是一个较为复杂的功能,请在使用前先阅读相关说明: https://sensorsdata.cn/manual/track_installation.html,并在必要时联系我们的技术支持人员。

Declared In

SensorsAnalyticsSDK.h

– trackInstallation:

@abstract
用于在 App 首次启动时追踪渠道来源,SDK会将渠道值填入事件属性 $utm_ 开头的一系列属性中
使用该接口,必须在工程中引入 SafariService.framework

- (void)trackInstallation:(NSString *)event

Parameters

						event

event的名称

Discussion

@abstract
用于在 App 首次启动时追踪渠道来源,SDK会将渠道值填入事件属性 $utm_ 开头的一系列属性中
使用该接口,必须在工程中引入 SafariService.framework

@discussion
这个接口是一个较为复杂的功能,请在使用前先阅读相关说明: https://sensorsdata.cn/manual/track_installation.html,并在必要时联系我们的技术支持人员。

Declared In

SensorsAnalyticsSDK.h

– filterAutoTrackControllers:

@abstract
在AutoTrack时,用户可以设置哪些controlls不被AutoTrack

- (void)filterAutoTrackControllers:(NSArray *)controllers

Parameters

						controllers

controller'字符串'数组

Discussion

@abstract
在AutoTrack时,用户可以设置哪些controlls不被AutoTrack

Declared In

SensorsAnalyticsSDK.h

– getLastScreenUrl

@abstract
获取LastScreenUrl

- (NSString *)getLastScreenUrl

Return Value

LastScreenUrl

Discussion

@abstract
获取LastScreenUrl

Declared In

SensorsAnalyticsSDK.h

– getLastScreenTrackProperties

@abstract
获取LastScreenTrackProperties

- (NSDictionary *)getLastScreenTrackProperties

Return Value

LastScreenTrackProperties

Discussion

@abstract
获取LastScreenTrackProperties

Declared In

SensorsAnalyticsSDK.h

– trackViewScreen:withProperties:

@abstract
Track $AppViewScreen事件

- (void)trackViewScreen:(NSString *)url withProperties:(NSDictionary *)properties

Parameters

						url

当前页面url
@param 用户扩展属性

@return

Discussion

@abstract
Track $AppViewScreen事件

Declared In

SensorsAnalyticsSDK.h

– registerSuperProperties:

@abstract
用来设置每个事件都带有的一些公共属性

- (void)registerSuperProperties:(NSDictionary *)propertyDict

Parameters

						propertyDict

传入merge到公共属性的dict

Discussion

@abstract
用来设置每个事件都带有的一些公共属性

@discussion
当track的Properties,superProperties和SDK自动生成的automaticProperties有相同的key时,遵循如下的优先级:
track.properties > superProperties > automaticProperties
另外,当这个接口被多次调用时,是用新传入的数据去merge先前的数据,并在必要时进行merger
例如,在调用接口前,dict是@{@“a”:1, @“b”: “bbb”},传入的dict是@{@“b”: 123, @“c”: @“asd”},则merge后的结果是
@{“a”:1, @“b”: 123, @“c”: @“asd”},同时,SDK会自动将superProperties保存到文件中,下次启动时也会从中读取

Declared In

SensorsAnalyticsSDK.h

– unregisterSuperProperty:

@abstract
从superProperty中删除某个property

- (void)unregisterSuperProperty:(NSString *)property

Parameters

						property

待删除的property的名称

Discussion

@abstract
从superProperty中删除某个property

Declared In

SensorsAnalyticsSDK.h

– clearSuperProperties

@abstract
删除当前所有的superProperty

- (void)clearSuperProperties

Discussion

@abstract
删除当前所有的superProperty

Declared In

SensorsAnalyticsSDK.h

– currentSuperProperties

@abstract
拿到当前的superProperty的副本

- (NSDictionary *)currentSuperProperties

Return Value

当前的superProperty的副本

Discussion

@abstract
拿到当前的superProperty的副本

Declared In

SensorsAnalyticsSDK.h

– libVersion

@abstract
得到SDK的版本

- (NSString *)libVersion

Return Value

SDK的版本

Discussion

@abstract
得到SDK的版本

Declared In

SensorsAnalyticsSDK.h

– flush

@abstract
强制试图把数据传到对应的SensorsAnalytics服务器上

- (void)flush

Discussion

@abstract
强制试图把数据传到对应的SensorsAnalytics服务器上

@discussion
主动调用flush接口,则不论flushInterval和网络类型的限制条件是否满足,都尝试向服务器上传一次数据

Declared In

SensorsAnalyticsSDK.h

Copyright © 2016 qudian. All rights reserved. Updated: 2016-11-29

Generated by appledoc 2.2.1 (build 1334).