text:
# Record.FileFormat Property

The format that the recording will be saved - mp3 or wav.

**Namespace:** Bandwidth.Net.Xml.Verbs
**Assembly:** Bandwidth.Net (in Bandwidth.Net.dll) Version: 3.0.3

## Syntax

**C#**

``` C#
public string FileFormat { get; set; }
```

#### Property Value
Type: String

## See Also

#### Reference
Record Class
Bandwidth.Net.Xml.Verbs Namespace


text:
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8"/>
  <meta http-equiv="X-UA-Compatible" content="IE=edge"/>

  <title>Non-drawables (Scenery)</title>

  <style>
    canvas {
      border: 1px solid black;
    }
  </style>
</head>
<body>

<canvas id="canvas" width="768" height="848"></canvas>

<script type="text/javascript">

  var context = document.getElementById( 'canvas' ).getContext( '2d' );

  var zeroColor = '#000000';
  var offZeroColor = 'rgba(0,255,255,0.5)';

  // shared settings
  context.lineWidth = 100;

  /*---------------------------------------------------------------------------*
   * Arc with 0 radius as a 'join'
   *----------------------------------------------------------------------------*/

  // exactly 0
  context.beginPath();
  context.moveTo( 0, 128 );
  context.lineTo( 128, 128 );
  context.arc( 128, 128, 0, Math.PI, -Math.PI, true );
  context.lineTo( 128, 0 );
  context.strokeStyle = zeroColor;
  context.stroke();

  // just off of 0
  context.beginPath();
  context.moveTo( 0, 128 );
  context.lineTo( 128, 128 );
  context.arc( 128, 128, 0.01, Math.PI, -Math.PI / 2, true );
  context.lineTo( 128, 0 );
  context.strokeStyle = offZeroColor;
  context.stroke();

  /*---------------------------------------------------------------------------*
   * Line with 0 length as a 'join'
   *----------------------------------------------------------------------------*/

  // exactly 0
  context.beginPath();
  context.moveTo( 0, 256 );
  context.lineTo( 256, 256 );
  context.lineTo( 256, 256 );
  context.lineTo( 256, 0 );
  context.strokeStyle = zeroColor;
  context.stroke();

  // just off of 0
  context.beginPath();
  context.moveTo( 0, 256 );
  context.lineTo( 255.99, 256 );
  context.lineTo( 256, 255.99 );
  context.lineTo( 256, 0 );
  context.strokeStyle = offZeroColor;
  context.stroke();

  /*---------------------------------------------------------------------------*
   * Quadratic with all control points the same
   *----------------------------------------------------------------------------*/

  // exactly 0
  context.beginPath();
  context.moveTo( 0, 384 );
  context.lineTo( 384, 384 );
  context.quadraticCurveTo( 384, 384, 384, 384 );
  context.lineTo( 384, 0 );
  context.strokeStyle = zeroColor;
  context.stroke();

  // just off of 0
  context.beginPath();
  context.moveTo( 0, 384 );
  context.lineTo( 383.99, 384 );
  context.quadraticCurveTo( 384, 384, 384, 383.99 );
  context.lineTo( 384, 0 );
  context.strokeStyle = offZeroColor;
  context.stroke();

  /*---------------------------------------------------------------------------*
   * Cubic with all control points the same
   *----------------------------------------------------------------------------*/

  // exactly 0
  context.beginPath();
  context.moveTo( 0, 512 );
  context.lineTo( 512, 512 );
  context.bezierCurveTo( 512, 512, 512, 512, 512, 512 );
  context.lineTo( 512, 0 );
  context.strokeStyle = zeroColor;
  context.stroke();

  // just off of 0
  context.beginPath();
  context.moveTo( 0, 512 );
  context.lineTo( 511.99, 512 );
  context.bezierCurveTo( 511.999, 512, 512, 511.999, 512, 511.99 );
  context.lineTo( 512, 0 );
  context.strokeStyle = offZeroColor;
  context.stroke();

  /*---------------------------------------------------------------------------*
   * Arc with same start/end angle
   *----------------------------------------------------------------------------*/

  // exactly 0
  context.beginPath();
  context.moveTo( 0, 640 );
  context.lineTo( 640, 640 );
  context.arc( 320, 320, 320 * Math.sqrt( 2 ), Math.PI / 4, Math.PI / 4, false );
  context.lineTo( 640, 0 );
  context.strokeStyle = zeroColor;
  context.stroke();

  /*---------------------------------------------------------------------------*
   * Individual (non-joined) zero-length segments that hopefully don't show anything.
   *----------------------------------------------------------------------------*/

  // arc
  context.beginPath();
  context.moveTo( 128, 768 );
  context.arc( 128, 768, 0, Math.PI, -Math.PI, true );
  context.strokeStyle = zeroColor;
  context.stroke();

  // lineTo
  context.beginPath();
  context.moveTo( 256, 768 );
  context.lineTo( 256, 768 );
  context.strokeStyle = zeroColor;
  context.stroke();

  // quadratic
  context.beginPath();
  context.moveTo( 384, 768 );
  context.quadraticCurveTo( 384, 768, 384, 768 );
  context.strokeStyle = zeroColor;
  context.stroke();

  // cubic
  context.beginPath();
  context.moveTo( 384, 768 );
  context.bezierCurveTo( 384, 768, 384, 768, 384, 768 );
  context.strokeStyle = zeroColor;
  context.stroke();

</script>

</body>
</html>

redpajama_set_name: RedPajamaGithub


text:
<?php
/**
 * CodeIgniter Debug Bar
 *
 * @package     CodeIgniterDebugBar
 * @author      Anthony Tansens <atansens@gac-technology.com>
 * @license     http://opensource.org/licenses/MIT MIT
 * @since       Version 1.0
 * @filesource
 */
defined('BASEPATH') OR exit('No direct script access allowed');

use DebugBar\DataCollector\DataCollector;
use DebugBar\DataCollector\DataCollectorInterface;
use DebugBar\DataCollector\Renderable;

/**
 * IncludedFileCollector Class
 *
 * @package     CodeIgniterDebugBar
 * @subpackage  Libraries
 * @category    Collectors
 * @author      Anthony Tansens <atansens@gac-technology.com>
 */
class IncludedFileCollector extends DataCollector implements DataCollectorInterface, Renderable
{
    /**
     * {@inheritdoc}
     */
    public function collect()
    {
        $files = array();
        $data = get_included_files();
        $len = strlen(APPPATH);

        foreach ($data as $file_path) {
            // Include only APPPATH
            if (substr($file_path, 0, $len) === APPPATH && substr($file_path, 0, $len + 11) !== APPPATH.'third_party') {
                $file = substr($file_path, $len);
                $files[] = array(
                    'message' => "'" . APPPATH . $file . "',",
                    'is_string' => true,
                );
            }
        }

        return array(
            'messages' => $files,
            'count' => count($files),
        );
    }

    /**
     * {@inheritdoc}
     */
    public function getName()
    {
        return 'file';
    }

    /**
     * {@inheritdoc}
     */
    public function getWidgets()
    {
        return array(
            "file" => array(
                "icon" => "files-o",
                "widget" => "PhpDebugBar.Widgets.MessagesWidget",
                "map" => "file.messages",
                "default" => "{}"
            ),
            "file:badge" => array(
                "map" => "file.count",
                "default" => "null"
            )
        );
    }
}


text:
<link rel="import" href="../../../bower_components/polymer/polymer.html">
<link rel="import" href="../../shared/gr-confirm-dialog/gr-confirm-dialog.html">

<dom-module id="gr-confirm-rebase-dialog">
  <template>

    <gr-confirm-dialog
        confirm-label="Rebase"
        on-confirm="_handleConfirmTap"
        on-cancel="_handleCancelTap">

Confirm rebase

            Parent revision (optional)

          <input is="iron-input"
              type="text"
              id="parentInput"
              bind-value="{{base}}"
              placeholder="Change number">

          <input id="clearParent"
              type="checkbox"
              on-tap="_handleClearParentTap">

            Rebase on top of current branch (clear parent revision).

    </gr-confirm-dialog>
  </template>

</dom-module>


text:
#include <serenity.h>

static inline int
sn_stdaopen(sna *a snunused, va_list args snunused) {
	return 0;
}

static inline int
sn_stdaclose(sna *a snunused) {
	return 0;
}

static inline void*
sn_stdamalloc(sna *a snunused, int size) {
	return malloc(size);
}

static inline void*
sn_stdarealloc(sna *a snunused, void *ptr, int size) {
	return realloc(ptr,  size);
}

static inline void
sn_stdafree(sna *a snunused, void *ptr) {
	assert(ptr != NULL);
	free(ptr);
}

snaif sn_stda =
{
	.open    = sn_stdaopen,
	.close   = sn_stdaclose,
	.malloc  = sn_stdamalloc,
	.realloc = sn_stdarealloc,
	.free    = sn_stdafree
};


text:
from django.contrib import admin

from .models import Critique

class CritiqueAdmin(admin.ModelAdmin):
    fields = ("url", "message", "email", "user_agent", "created",)
    list_display = ("id", "url", "get_message", "email", "user_agent", "created",)
    list_filter = ("created",)
    readonly_fields = ("created",)
    search_fields = ("url", "email",)

    def get_message(self, obj):
        """Returns a truncated 'message' field."""
        return "{0}...".format(obj.message[:60])
    get_message.short_description = "Message"

admin.site.register(Critique, CritiqueAdmin)


text:
{% load i18n %}
{% load formtags %}

{{ text|safe }}

<form method="post" action="">

	    {% csrf_token %}
		{% show_fieldsetform form %}

		{% trans "If there are no free IP addresses to assign go to: " %}
		'{% trans "Manage public IP" %}'.

		<button type="submit" class="ok-button mid_button">{{ confirmation|safe }}</button>
		<button type="button" class="cancel-button mid_button">{% trans "Cancel" %}</button>

</form>


text:
package ru.stqa.frst.soap;

import net.webservicex.GeoIP;
import net.webservicex.GeoIPService;
import org.testng.annotations.Test;

import static org.testng.Assert.assertEquals;

/**
 * Created by user on 07.06.2016.
 */
@Test
public class GeoIdServiceTests {
  public void testMyIP() {
    GeoIP geoIP = new GeoIPService().getGeoIPServiceSoap12().getGeoIP("93.84.56.154");
  assertEquals(geoIP.getCountryCode(), "BLR");
  }
  @Test

    public void testInvalidIP() {
      GeoIP geoIP = new GeoIPService().getGeoIPServiceSoap12().getGeoIP("93.84.56.xxx");
      assertEquals(geoIP.getCountryCode(), "BLR");
    }
}


text:
- This Feed insert to XSOAR platform our, NucleonCyber, three type of indicators:
    - Ip
    - Url
    - File(Hashes)


text:
/*
 * Do not modify this file. This file is generated from the email-2010-12-01.normal.json service model.
 */
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;

using Amazon.Runtime;
using Amazon.Runtime.Internal;

namespace Amazon.SimpleEmail.Model
{
    ///
    /// Container for the parameters to the CreateReceiptFilter operation.
    /// Creates a new IP address filter.
    ///
    ///
    /// <para>
    /// For information about setting up IP address filters, see the Amazon
    /// SES Developer Guide.
    /// </para>
    ///
    /// <para>
    /// This action is throttled at one request per second.
    /// </para>
    ///
    public partial class CreateReceiptFilterRequest : AmazonSimpleEmailServiceRequest
    {
        private ReceiptFilter _filter;

        ///
        /// Gets and sets the property Filter.
        /// <para>
        /// A data structure that describes the IP address filter to create, which consists of
        /// a name, an IP address range, and whether to allow or block mail from it.
        /// </para>
        ///
        public ReceiptFilter Filter
        {
            get { return this._filter; }
            set { this._filter = value; }
        }

        // Check to see if Filter property is set
        internal bool IsSetFilter()
        {
            return this._filter != null;
        }

    }
}


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

<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<TITLE>
Log4jLogger (Yax - an XProc (XML Pipeline) Implementation 0.11.0-SNAPSHOT API)
</TITLE>

<META NAME="date" CONTENT="2008-03-04">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

de.opsdesign.yax.log

Class Log4jLogger

java.lang.Object
  de.opsdesign.yax.log.Logger
      de.opsdesign.yax.log.Log4jLogger

All Implemented Interfaces:
LogListener

public class Log4jLogger
extends Logger

Constructor Summary

Log4jLogger()

Method Summary

 void
log(java.lang.String message)

          Notifies all loggers (LogListeners) to log an INFO message.

 void
log(java.lang.String message,
    int severity)

          Notifies all loggers (LogListeners) to log a message with a particular severity.

 void
log(YaxEvent yaxEvent)

          Notifies all loggers (LogListeners) to log an elaborated message (for exceptions et al).

Methods inherited from class de.opsdesign.yax.log.Logger

getLogMessage, getSeverityLabel, isAntLogger

Methods inherited from class java.lang.Object

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

Constructor Detail

Log4jLogger

public Log4jLogger()

Method Detail

log

public void log(java.lang.String message)

Description copied from interface: LogListener

Notifies all loggers (LogListeners) to log an INFO message.
 This signature is for normal INFO messages.
 (The severity will be set to the default INFO).

Specified by:
log in interface LogListener
Overrides:
log in class Logger

Parameters:
message - message to log

log

public void log(java.lang.String message,
                int severity)

Description copied from interface: LogListener

Notifies all loggers (LogListeners) to log a message with a particular severity.
 This signature is deditated for messages with a severity other than INFO.

Specified by:
log in interface LogListener
Overrides:
log in class Logger

Parameters:
message - message to log
severity - log severity(Log.ERROR,-WARN,-INFO,-VERBOSE or -DEBUG)

log

public void log(YaxEvent yaxEvent)

Description copied from interface: LogListener

Notifies all loggers (LogListeners) to log an elaborated message (for exceptions et al).
 This signature is deditated especially for exceptions and
 events with elaborated log requirements.

Specified by:
log in interface LogListener
Overrides:
log in class Logger

Parameters:
yaxEvent - consist of all relevant event information
                  (also complete information about message exception)

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

Copyright © 2008 OPS Design GmbH. All Rights Reserved.


text:
"""
   author : Akshay Vilekar

   Load the dialog box and choose file

"""

## imports

import tkFileDialog
import tkMessageBox
import tkSimpleDialog
import os

# global variable filename
infilename = ''

def encrypt():
     global infilename

     ## open the temporary file and deal with it
     filep  = open('.filename.temp','r')
     infilename =filep.read()
     filep.close()

     #####

     if infilename != '' or infilename != None :
         password = tkSimpleDialog.askstring('pass',"Enter password"
                                            ,show="*")
         ## release the canons
         cmd = "openssl aes-256-cbc -in " + str(infilename) + " -out " +str(infilename) + ".enc " + " -k " + str(password)
         o = os.system(cmd)
         ## remove unencrypted file
         cmd1 = 'rm ' + infilename
         o1 = os.system(cmd1)
     else:
           tkMessageBox.showerror('error',"Please select a file")

###################################################################

def decrypt():
    filep = open('.filename.temp','r')
    infilename = filep.read()
    filep.close()

     #####

    if infilename != '' or infilename != None :
         password = tkSimpleDialog.askstring('pass',"Enter password to decrypt",show="*")
         ## release the canons
         cmd = "openssl aes-256-cbc -d -in " + str(infilename) + ".enc "  + " -out " +str(infilename) + " -k " + str(password)
         o = os.system(cmd)
         if o != 0 :
              decrypt()
         os.remove('.filename.temp')
         os.remove(infilename + '.enc')
    else:
         tkMessageBox.showerror('error',"Please select a file")

##################################################################
def load():

    ## Open file box and select file(file object)
    input_file  =  tkFileDialog.askopenfilename()

    ## set the input filename in encrypt.py to this value
    global infilename
    filep = open('.filename.temp','w')
    filep.write(str(input_file))
    filep.close()

########################################################


text:
from __future__ import unicode_literals

from django.db import migrations, models
import django.utils.timezone

class Migration(migrations.Migration):

    dependencies = [
        ('importing', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='ReadonlyProviderLog',
            fields=[
            ],
            options={
                'indexes': [],
                'proxy': True,
            },
            bases=('importing.providerlog',),
        ),
        migrations.AlterField(
            model_name='providerlog',
            name='content_type',
            field=models.CharField(default='application/txt', max_length=32),
        ),
        migrations.AlterField(
            model_name='providerlog',
            name='is_valid',
            field=models.BooleanField(default=False),
        ),
        migrations.AlterField(
            model_name='providerlog',
            name='received_time',
            field=models.DateTimeField(default=django.utils.timezone.now),
        ),
    ]


text:
package com.navercorp.pinpoint.profiler.context.storage;

import com.navercorp.pinpoint.bootstrap.context.TraceId;
import com.navercorp.pinpoint.profiler.context.DefaultSpanChunkFactory;
import com.navercorp.pinpoint.profiler.context.Span;
import com.navercorp.pinpoint.profiler.context.SpanChunkFactory;
import com.navercorp.pinpoint.profiler.context.SpanEvent;
import com.navercorp.pinpoint.profiler.context.id.DefaultTraceRoot;
import com.navercorp.pinpoint.profiler.context.id.DefaultTraceId;
import com.navercorp.pinpoint.profiler.context.id.TraceRoot;
import com.navercorp.pinpoint.profiler.sender.CountingDataSender;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

public class BufferedStorageTest {

    private final String agentId = "agentId";
    private final long agentStartTime = System.currentTimeMillis();

    private final CountingDataSender countingDataSender = new CountingDataSender();
    private TraceRoot internalTraceId;

    @Before
    public void before() {
        countingDataSender.stop();
        internalTraceId = newInternalTraceId();
    }

    private TraceRoot newInternalTraceId() {
        TraceId traceId = new DefaultTraceId(agentId, agentStartTime, 100);
        return new DefaultTraceRoot(traceId, agentId, agentStartTime, 100);
    }

    @Test
    public void testStore_Noflush() throws Exception {
        BufferedStorage bufferedStorage = newBufferedStorage(10);

        Span span = new Span(internalTraceId);
        SpanEvent spanEvent = new SpanEvent();
        bufferedStorage.store(spanEvent);
        bufferedStorage.store(spanEvent);

        Assert.assertEquals(0, countingDataSender.getTotalCount());
    }

    @Test
    public void testStore_flush() throws Exception {
        BufferedStorage bufferedStorage = newBufferedStorage(1);

        Span span = new Span(internalTraceId);
        SpanEvent spanEvent = new SpanEvent();
        bufferedStorage.store(spanEvent);
        bufferedStorage.store(spanEvent);

        Assert.assertEquals(2, countingDataSender.getSenderCounter());
        Assert.assertEquals(2, countingDataSender.getTotalCount());

        Assert.assertEquals(2, countingDataSender.getSpanChunkCounter());
        Assert.assertEquals(0, countingDataSender.getSpanCounter());
    }

    @Test
    public void testStore_spanFlush() throws Exception {
        BufferedStorage bufferedStorage = newBufferedStorage(10);

        Span span = new Span(internalTraceId);
        bufferedStorage.store(span);
        bufferedStorage.store(span);
        bufferedStorage.store(span);

        Assert.assertEquals(3, countingDataSender.getSenderCounter());
        Assert.assertEquals(3, countingDataSender.getTotalCount());

        Assert.assertEquals(3, countingDataSender.getSpanCounter());
        Assert.assertEquals(0, countingDataSender.getSpanChunkCounter());
    }

    @Test
    public void testStore_spanLastFlush() throws Exception {
        BufferedStorage bufferedStorage = newBufferedStorage(10);

        Span span = new Span(internalTraceId);
        SpanEvent spanEvent = new SpanEvent();
        bufferedStorage.store(spanEvent);
        bufferedStorage.store(spanEvent);
        bufferedStorage.store(span);

        Assert.assertEquals(1, countingDataSender.getSenderCounter());
        Assert.assertEquals(1, countingDataSender.getTotalCount());

        Assert.assertEquals(1, countingDataSender.getSpanCounter());
        Assert.assertEquals(0, countingDataSender.getSpanChunkCounter());
    }

    @Test
    public void testStore_manual_flush() throws Exception {
        BufferedStorage bufferedStorage = newBufferedStorage(10);

        Span span = new Span(internalTraceId);
        SpanEvent spanEvent = new SpanEvent();
        bufferedStorage.store(spanEvent);
        bufferedStorage.store(spanEvent);
        bufferedStorage.flush();

        Assert.assertEquals(1, countingDataSender.getSenderCounter());
        Assert.assertEquals(1, countingDataSender.getTotalCount());

        Assert.assertEquals(0, countingDataSender.getSpanCounter());
        Assert.assertEquals(1, countingDataSender.getSpanChunkCounter());
    }

    private BufferedStorage newBufferedStorage(int bufferSize) {
        SpanChunkFactory spanChunkFactory = new DefaultSpanChunkFactory(internalTraceId);
        return new BufferedStorage(spanChunkFactory, countingDataSender, bufferSize);
    }
}


text:
var fs        = require('fs'),
    gulp      = require('gulp'),
    concat    = require('gulp-concat'),
    uglify    = require('gulp-uglify'),
    header    = require('gulp-header'),
    jshint    = require('gulp-jshint'),
    sass      = require('gulp-sass'),
    rename    = require('gulp-rename'),
    plumber   = require('gulp-plumber'),
    gutil     = require('gulp-util'),
    minifyCSS = require('gulp-minify-css'),
    htmlmin   = require('gulp-html-minifier'),
    replace   = require('gulp-replace'),
    wrap      = require('gulp-wrap'),
    meta      = require('./package.json'),
    config;

    try {
        config = require('./config.json');
    } catch (error) {
        config = { googleAnalyticsId: null };
    }

    var jsDir   = './web/js/',
        cssDir  = './web/css/',
        sassDir = './src/sass/',
        expose  = [],
        dependencies = [
            './bower_components/angular/angular.js',
            './bower_components/angular-route/angular-route.js',
            './bower_components/angular-cookies/angular-cookies.js',
            './bower_components/angular-bootstrap-colorpicker/js/bootstrap-colorpicker-module.js',
            './bower_components/createjs-soundjs/lib/soundjs-0.6.1.min.js',
            './bower_components/tom32i-event-emitter.js/dist/event-emitter.min.js',
            './bower_components/tom32i-option-resolver.js/dist/option-resolver.min.js',
            './bower_components/tom32i-gamepad.js/dist/gamepad.src.js',
            './bower_components/tom32i-key-mapper.js/dist/key-mapper.src.js',
            './bower_components/tom32i-asset-loader.js/dist/asset-loader.min.js'
        ],
        recipes = {
            server: require('./recipes/server.json'),
            client: require('./recipes/client.json')
        },
        banner = [
          '/*!',
          ' * <%= name %> <%= version %>',
          ' * <%= homepage %>',
          ' * <%= license %>',
          ' */\n\n'
        ].join('\n');

var onError = function (err) {
    gutil.beep();
    console.log(err.toString());
    this.emit('end');
};

gulp.task('jshint', function() {
    return gulp.src('src/**/*.js')
        .pipe(jshint())
        .pipe(jshint.reporter());
});

gulp.task('front-expose', function() {
    for (var i = expose.length - 1; i >= 0; i--) {
        gulp.src(expose[i]).pipe(gulp.dest(recipes.client.path));
    }

    return gulp.src(dependencies)
        .pipe(concat('dependencies.js'))
        .pipe(uglify())
        .pipe(gulp.dest(recipes.client.path));
});

gulp.task('front-full', function() {
    return gulp.src(recipes.client.files)
        .pipe(concat(recipes.client.name))
        .pipe(wrap('(function(){\n"use strict";\n<%= contents %>\n})();'))
        .pipe(header(banner, meta))
        .pipe(gulp.dest(recipes.client.path));
});

gulp.task('front-min', function(){
    return gulp.src(recipes.client.files)
        .pipe(concat(recipes.client.name))
        .pipe(uglify())
        .pipe(wrap('(function(){\n"use strict";\n<%= contents %>\n})();'))
        .pipe(header(banner, meta))
        .pipe(gulp.dest(recipes.client.path));
});

gulp.task('ga', function() {
    var source = gulp.src('./src/client/views/index.html');

    if (typeof(config.googleAnalyticsId) !== 'undefined' && config.googleAnalyticsId) {
        var tag = fs.readFileSync('./src/client/views/google.analytics.html').toString()
            .replace('GoogleAnalyticsToken', config.googleAnalyticsId);

        source.pipe(replace('<!-- Google Analytics -->', tag));
    }

    return source
        .pipe(htmlmin({collapseWhitespace: true}))
        .pipe(gulp.dest('./web'));
});

gulp.task('views', function() {
    return gulp.src('src/client/views/*/**/*.html')
        .pipe(htmlmin({collapseWhitespace: true}))
        .pipe(gulp.dest(jsDir + 'views'));
});

gulp.task('server', function() {
    return gulp.src(recipes.server.files)
        .pipe(concat(recipes.server.name))
        .pipe(gulp.dest(recipes.server.path));
});

gulp.task('sass-full', function() {
    return gulp.src(sassDir + 'style.scss')
        .pipe(plumber({ errorHandler: onError }))
        .pipe(sass())
        .pipe(rename('style.css'))
        .pipe(gulp.dest(cssDir));
});

gulp.task('sass-min', function() {
    return gulp.src(sassDir + 'style.scss')
        .pipe(plumber({ errorHandler: onError }))
        .pipe(sass())
        .pipe(minifyCSS())
        .pipe(rename('style.css'))
        .pipe(gulp.dest(cssDir));
});

gulp.task('copy-stress-test', function() {
    return gulp.src('src/client/stressTest.js')
        .pipe(gulp.dest(recipes.client.path));
});

gulp.task('watch', ['dev'], function () {
    gulp.watch('src/shared/**/*.js', ['jshint', 'server', 'front-full']);
    gulp.watch('src/client/**/*.js', ['jshint', 'front-full']);
    gulp.watch('src/server/**/*.js', ['jshint', 'server']);
    gulp.watch('src/client/views/*/*.html', ['views']);
    gulp.watch('src/client/views/*.html', ['ga']);
    gulp.watch('src/client/stressTest.js', ['copy-stress-test']);
    gulp.watch('src/sass/**/*.scss', ['sass-full']);
});

gulp.task('default', ['jshint', 'server', 'front-expose', 'ga', 'views', 'front-min', 'sass-min']);
gulp.task('dev', ['jshint', 'server', 'front-expose', 'copy-stress-test', 'ga', 'views', 'front-full', 'sass-full']);


text:
define({
  "_widgetLabel": "Lista slojeva",
  "titleBasemap": "Pozadinske mape",
  "titleLayers": "Operativni slojevi",
  "labelLayer": "Ime sloja",
  "itemZoomTo": "Uveličaj na",
  "itemTransparency": "Prozirnost",
  "itemTransparent": "Prozirno",
  "itemOpaque": "Neprozirno",
  "itemMoveUp": "Pomeri se na gore",
  "itemMoveDown": "Pomeri se na dole",
  "itemDesc": "Opis",
  "itemDownload": "Preuzmi",
  "itemToAttributeTable": "Prikaži u tabeli atributa",
  "itemShowItemDetails": "Prikaži detalje stavke",
  "empty": "prazno",
  "removePopup": "Onemogući iskačuće prozore",
  "enablePopup": "Omogući iskačuće prozore",
  "turnAllLayersOff": "Isključi sve slojeve",
  "turnAllLayersOn": "Uključi sve slojeve",
  "expandAllLayers": "Razvij sve slojeve",
  "collapseAlllayers": "Skupi sve slojeve",
  "turnAllLabelsOff": "Isključi sve oznake",
  "turnAllLabelsOn": "Uključi sve oznake",
  "showLabels": "Prikaži oznake",
  "hideLables": "Sakrij oznake"
});


text:
package http_response

import (
	"fmt"
	"io/ioutil"
	"net/http"
	"net/http/httptest"
	"testing"
	"time"

	"github.com/influxdata/telegraf/internal"
	"github.com/influxdata/telegraf/testutil"

	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
)

func setUpTestMux() http.Handler {
	mux := http.NewServeMux()
	mux.HandleFunc("/redirect", func(w http.ResponseWriter, req *http.Request) {
		http.Redirect(w, req, "/good", http.StatusMovedPermanently)
	})
	mux.HandleFunc("/good", func(w http.ResponseWriter, req *http.Request) {
		fmt.Fprintf(w, "hit the good page!")
	})
	mux.HandleFunc("/jsonresponse", func(w http.ResponseWriter, req *http.Request) {
		fmt.Fprintf(w, "\"service_status\": \"up\", \"healthy\" : \"true\"")
	})
	mux.HandleFunc("/badredirect", func(w http.ResponseWriter, req *http.Request) {
		http.Redirect(w, req, "/badredirect", http.StatusMovedPermanently)
	})
	mux.HandleFunc("/mustbepostmethod", func(w http.ResponseWriter, req *http.Request) {
		if req.Method != "POST" {
			http.Error(w, "method wasn't post", http.StatusMethodNotAllowed)
			return
		}
		fmt.Fprintf(w, "used post correctly!")
	})
	mux.HandleFunc("/musthaveabody", func(w http.ResponseWriter, req *http.Request) {
		body, err := ioutil.ReadAll(req.Body)
		req.Body.Close()
		if err != nil {
			http.Error(w, "couldn't read request body", http.StatusBadRequest)
			return
		}
		if string(body) == "" {
			http.Error(w, "body was empty", http.StatusBadRequest)
			return
		}
		fmt.Fprintf(w, "sent a body!")
	})
	mux.HandleFunc("/twosecondnap", func(w http.ResponseWriter, req *http.Request) {
		time.Sleep(time.Second * 2)
		return
	})
	return mux
}

func TestHeaders(t *testing.T) {
	ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		cHeader := r.Header.Get("Content-Type")
		assert.Equal(t, "Hello", r.Host)
		assert.Equal(t, "application/json", cHeader)
		w.WriteHeader(http.StatusOK)
	}))
	defer ts.Close()

	h := &HTTPResponse{
		Address:         ts.URL,
		Method:          "GET",
		ResponseTimeout: internal.Duration{Duration: time.Second * 2},
		Headers: map[string]string{
			"Content-Type": "application/json",
			"Host":         "Hello",
		},
	}
	var acc testutil.Accumulator
	err := h.Gather(&acc)
	require.NoError(t, err)

	value, ok := acc.IntField("http_response", "http_response_code")
	require.True(t, ok)
	require.Equal(t, http.StatusOK, value)
}

func TestFields(t *testing.T) {
	mux := setUpTestMux()
	ts := httptest.NewServer(mux)
	defer ts.Close()

	h := &HTTPResponse{
		Address:         ts.URL + "/good",
		Body:            "{ 'test': 'data'}",
		Method:          "GET",
		ResponseTimeout: internal.Duration{Duration: time.Second * 20},
		Headers: map[string]string{
			"Content-Type": "application/json",
		},
		FollowRedirects: true,
	}

	var acc testutil.Accumulator
	err := h.Gather(&acc)
	require.NoError(t, err)

	value, ok := acc.IntField("http_response", "http_response_code")
	require.True(t, ok)
	require.Equal(t, http.StatusOK, value)
}

func TestRedirects(t *testing.T) {
	mux := setUpTestMux()
	ts := httptest.NewServer(mux)
	defer ts.Close()

	h := &HTTPResponse{
		Address:         ts.URL + "/redirect",
		Body:            "{ 'test': 'data'}",
		Method:          "GET",
		ResponseTimeout: internal.Duration{Duration: time.Second * 20},
		Headers: map[string]string{
			"Content-Type": "application/json",
		},
		FollowRedirects: true,
	}
	var acc testutil.Accumulator
	err := h.Gather(&acc)
	require.NoError(t, err)

	value, ok := acc.IntField("http_response", "http_response_code")
	require.True(t, ok)
	require.Equal(t, http.StatusOK, value)

	h = &HTTPResponse{
		Address:         ts.URL + "/badredirect",
		Body:            "{ 'test': 'data'}",
		Method:          "GET",
		ResponseTimeout: internal.Duration{Duration: time.Second * 20},
		Headers: map[string]string{
			"Content-Type": "application/json",
		},
		FollowRedirects: true,
	}
	acc = testutil.Accumulator{}
	err = h.Gather(&acc)
	require.Error(t, err)

	value, ok = acc.IntField("http_response", "http_response_code")
	require.False(t, ok)
}

func TestMethod(t *testing.T) {
	mux := setUpTestMux()
	ts := httptest.NewServer(mux)
	defer ts.Close()

	h := &HTTPResponse{
		Address:         ts.URL + "/mustbepostmethod",
		Body:            "{ 'test': 'data'}",
		Method:          "POST",
		ResponseTimeout: internal.Duration{Duration: time.Second * 20},
		Headers: map[string]string{
			"Content-Type": "application/json",
		},
		FollowRedirects: true,
	}
	var acc testutil.Accumulator
	err := h.Gather(&acc)
	require.NoError(t, err)

	value, ok := acc.IntField("http_response", "http_response_code")
	require.True(t, ok)
	require.Equal(t, http.StatusOK, value)

	h = &HTTPResponse{
		Address:         ts.URL + "/mustbepostmethod",
		Body:            "{ 'test': 'data'}",
		Method:          "GET",
		ResponseTimeout: internal.Duration{Duration: time.Second * 20},
		Headers: map[string]string{
			"Content-Type": "application/json",
		},
		FollowRedirects: true,
	}
	acc = testutil.Accumulator{}
	err = h.Gather(&acc)
	require.NoError(t, err)

	value, ok = acc.IntField("http_response", "http_response_code")
	require.True(t, ok)
	require.Equal(t, http.StatusMethodNotAllowed, value)

	//check that lowercase methods work correctly
	h = &HTTPResponse{
		Address:         ts.URL + "/mustbepostmethod",
		Body:            "{ 'test': 'data'}",
		Method:          "head",
		ResponseTimeout: internal.Duration{Duration: time.Second * 20},
		Headers: map[string]string{
			"Content-Type": "application/json",
		},
		FollowRedirects: true,
	}
	acc = testutil.Accumulator{}
	err = h.Gather(&acc)
	require.NoError(t, err)

	value, ok = acc.IntField("http_response", "http_response_code")
	require.True(t, ok)
	require.Equal(t, http.StatusMethodNotAllowed, value)
}

func TestBody(t *testing.T) {
	mux := setUpTestMux()
	ts := httptest.NewServer(mux)
	defer ts.Close()

	h := &HTTPResponse{
		Address:         ts.URL + "/musthaveabody",
		Body:            "{ 'test': 'data'}",
		Method:          "GET",
		ResponseTimeout: internal.Duration{Duration: time.Second * 20},
		Headers: map[string]string{
			"Content-Type": "application/json",
		},
		FollowRedirects: true,
	}
	var acc testutil.Accumulator
	err := h.Gather(&acc)
	require.NoError(t, err)

	value, ok := acc.IntField("http_response", "http_response_code")
	require.True(t, ok)
	require.Equal(t, http.StatusOK, value)

	h = &HTTPResponse{
		Address:         ts.URL + "/musthaveabody",
		Method:          "GET",
		ResponseTimeout: internal.Duration{Duration: time.Second * 20},
		Headers: map[string]string{
			"Content-Type": "application/json",
		},
		FollowRedirects: true,
	}
	acc = testutil.Accumulator{}
	err = h.Gather(&acc)
	require.NoError(t, err)

	value, ok = acc.IntField("http_response", "http_response_code")
	require.True(t, ok)
	require.Equal(t, http.StatusBadRequest, value)
}

func TestStringMatch(t *testing.T) {
	mux := setUpTestMux()
	ts := httptest.NewServer(mux)
	defer ts.Close()

	h := &HTTPResponse{
		Address:             ts.URL + "/good",
		Body:                "{ 'test': 'data'}",
		Method:              "GET",
		ResponseStringMatch: "hit the good page",
		ResponseTimeout:     internal.Duration{Duration: time.Second * 20},
		Headers: map[string]string{
			"Content-Type": "application/json",
		},
		FollowRedirects: true,
	}
	var acc testutil.Accumulator
	err := h.Gather(&acc)
	require.NoError(t, err)

	value, ok := acc.IntField("http_response", "http_response_code")
	require.True(t, ok)
	require.Equal(t, http.StatusOK, value)
	value, ok = acc.IntField("http_response", "response_string_match")
	require.True(t, ok)
	require.Equal(t, 1, value)
	_, ok = acc.FloatField("http_response", "response_time")
	require.True(t, ok)
}

func TestStringMatchJson(t *testing.T) {
	mux := setUpTestMux()
	ts := httptest.NewServer(mux)
	defer ts.Close()

	h := &HTTPResponse{
		Address:             ts.URL + "/jsonresponse",
		Body:                "{ 'test': 'data'}",
		Method:              "GET",
		ResponseStringMatch: "\"service_status\": \"up\"",
		ResponseTimeout:     internal.Duration{Duration: time.Second * 20},
		Headers: map[string]string{
			"Content-Type": "application/json",
		},
		FollowRedirects: true,
	}
	var acc testutil.Accumulator
	err := h.Gather(&acc)
	require.NoError(t, err)

	value, ok := acc.IntField("http_response", "http_response_code")
	require.True(t, ok)
	require.Equal(t, http.StatusOK, value)
	value, ok = acc.IntField("http_response", "response_string_match")
	require.True(t, ok)
	require.Equal(t, 1, value)
	_, ok = acc.FloatField("http_response", "response_time")
	require.True(t, ok)
}

func TestStringMatchFail(t *testing.T) {
	mux := setUpTestMux()
	ts := httptest.NewServer(mux)
	defer ts.Close()

	h := &HTTPResponse{
		Address:             ts.URL + "/good",
		Body:                "{ 'test': 'data'}",
		Method:              "GET",
		ResponseStringMatch: "hit the bad page",
		ResponseTimeout:     internal.Duration{Duration: time.Second * 20},
		Headers: map[string]string{
			"Content-Type": "application/json",
		},
		FollowRedirects: true,
	}

	var acc testutil.Accumulator
	err := h.Gather(&acc)
	require.NoError(t, err)

	value, ok := acc.IntField("http_response", "http_response_code")
	require.True(t, ok)
	require.Equal(t, http.StatusOK, value)
	value, ok = acc.IntField("http_response", "response_string_match")
	require.True(t, ok)
	require.Equal(t, 0, value)
	_, ok = acc.FloatField("http_response", "response_time")
	require.True(t, ok)
}

func TestTimeout(t *testing.T) {
	if testing.Short() {
		t.Skip("Skipping test with sleep in short mode.")
	}

	mux := setUpTestMux()
	ts := httptest.NewServer(mux)
	defer ts.Close()

	h := &HTTPResponse{
		Address:         ts.URL + "/twosecondnap",
		Body:            "{ 'test': 'data'}",
		Method:          "GET",
		ResponseTimeout: internal.Duration{Duration: time.Millisecond},
		Headers: map[string]string{
			"Content-Type": "application/json",
		},
		FollowRedirects: true,
	}
	var acc testutil.Accumulator
	err := h.Gather(&acc)
	require.NoError(t, err)

	ok := acc.HasIntField("http_response", "http_response_code")
	require.False(t, ok)
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>Templinio example</title>

    <link rel="stylesheet" type="text/css" href="templinio.css">

Example of Templinio Timeline


text:
using System.Collections.Generic;
using ShareFile.Api.Client.Extensions;

namespace ShareFile.Api.Client.Security.Authentication.OAuth2
{
    public class OAuthAuthorizationCode : OAuthResponseBase
    {
        public string Code { get; set; }
        public string State { get; set; }

        public override void Fill(IDictionary<string, string> values)
        {
            string value;
            if (values.TryRemoveValue("code", out value))
            {
                Code = value;
            }
            if (values.TryRemoveValue("state", out value))
            {
                State = value;
            }

            base.Fill(values);
        }

        public static OAuthAuthorizationCode CreateFromDictionary(IDictionary<string, string> values)
        {
            var authorizationCode = new OAuthAuthorizationCode();
            authorizationCode.Fill(values);
            return authorizationCode;
        }
    }
}


text:
package history

import (
	"os"
	"testing"
	"time"

	assert "github.com/stretchr/testify/require"
	"go.skia.org/infra/go/eventbus"
	"go.skia.org/infra/go/testutils"

	"github.com/skia-dev/glog"
	"go.skia.org/infra/golden/go/digeststore"
	"go.skia.org/infra/golden/go/mocks"
	"go.skia.org/infra/golden/go/storage"
	"go.skia.org/infra/golden/go/types"
)

const TEST_DATA_DIR = "testdata"

func BenchmarkHistory(b *testing.B) {
	assert.Nil(b, os.MkdirAll(TEST_DATA_DIR, 0755))
	defer testutils.RemoveAll(b, TEST_DATA_DIR)

	digestStore, err := digeststore.New(TEST_DATA_DIR)
	assert.Nil(b, err)

	tileStore := mocks.GetTileStoreFromEnv(b)
	storages := &storage.Storage{
		TileStore:   tileStore,
		DigestStore: digestStore,
		EventBus:    eventbus.New(nil),
	}

	tile, err := tileStore.Get(0, -1)
	assert.Nil(b, err)

	assert.Nil(b, Init(storages, 0))

	// Gather the runtimes of the testname/digest lookup.
	runtimes := make([]int64, 0, 1000000)
	timeIt := func(testName, digest string) (bool, error) {
		startTime := time.Now().UnixNano()
		_, found, err := digestStore.Get(testName, digest)
		runtimes = append(runtimes, (time.Now().UnixNano()-startTime)/1000)
		return found, err
	}

	b.ResetTimer()
	tileLen := tile.LastCommitIndex() + 1
	for _, trace := range tile.Traces {
		testName := trace.Params()[types.PRIMARY_KEY_FIELD]
		gTrace := trace.(*types.GoldenTrace)
		for _, digest := range gTrace.Values[:tileLen] {
			if digest != types.MISSING_DIGEST {
				found, err := timeIt(testName, digest)
				assert.Nil(b, err)
				assert.True(b, found)
			}
		}
	}

	var avg int64 = 0
	for _, val := range runtimes {
		avg += val
	}
	glog.Infof("Average lookup time: %.3fus", float64(avg)/float64(len(runtimes)))
	glog.Infof("Number of lookups  : %d", len(runtimes))
}


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

<TITLE>
Uses of Class TGridded
</TITLE>

<META NAME="date" CONTENT="2011-05-30">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style">

      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Class
TGridded

Uses of TGridded in <Unnamed>

Subclasses of TGridded in <Unnamed>

 class
GroundHole

          Represents a hole in the ground that Things in the game can fall through and die.

 class
TBGBlock

          Represents a TBlock that can be walked through

 class
TBlock

 class
TColoredBlock

          Represents a Gridded Thing that has Color.

 class
TPipe

          A long green thing with a hole in the top.

Methods in <Unnamed> with parameters of type TGridded

 void
TGridded.addAdjacent(TGridded other)

          add other to the list of adjacent blocks

 void
GroundHole.addAdjacent(TGridded other)

 byte
TGridded.getDirection(TGridded othergrid)

          determines the direction othergrid is relative to this

 byte
TPipe.getDirection(TGridded othergrid)

 void
TGridded.removeAdjacent(TGridded other)

          remove other from the list of adjacent blocks

 void
GroundHole.removeAdjacent(TGridded other)

      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes


text:
macorlett.github.io
===================

A Portfolio of my work hosted by Github.com

##About the project
So this website is basically a way for me to achive a few things. First it's the website that I'm going to use to display my current and future pieces of work in the form of case studies. Secound, It will provide me with a playground in order to experiment with new ideas and techniques that I may have about web design. Thirdly, It is providing me with the opertunity to learn Jerkll.

###This still to be done.
the following is a list of tasks yet to be completed for this site.

- [ ] Add a 'thank' page/popup for contact form
- [ ] Add a custom 404 page
- [ ] Design and build a template page for case studies
- [ ] write and build first case study
- [x] Design custom social icons
- [x] Add social icons to navigation bar
- [x] Make pages more mobile friendly
- [ ] Create and upload a favicon
- [ ] Optimize the html, css and javescript
- [x] add navigation bar
- [x] add scrollit.js and headroom.js


text:
package parameter

trait InlineModifier {
  inline def defInline(inline x: Int): Unit
}


text:
using System;
using Skybrud.Social.Google.Exceptions;
using Skybrud.Social.Json;

namespace Skybrud.Social.Google.Analytics.Responses {

    public class AnalyticsResponse {

        public static JsonObject Validate(JsonObject obj) {

            // Shoduln't be NULL
            if (obj == null) throw new ArgumentNullException("obj");

            // Attempt to get the error object
            JsonObject error = obj.GetObject("error");

            // Throw an exception based on the error response
            if (error != null) {
                throw new GoogleApiException(error.GetInt32("code"), error.GetString("message"));
            }

            // Just return the JSON object
            return obj;

        }

        public static JsonObject Validate(string response) {
            return Validate(JsonObject.ParseJson(response));
        }

    }

}


text:
package transferiface

import (
	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/request"
	"github.com/aws/aws-sdk-go/service/transfer"
)

// TransferAPI provides an interface to enable mocking the
// transfer.Transfer service client's API operation,
// paginators, and waiters. This make unit testing your code that calls out
// to the SDK's service client's calls easier.
//
// The best way to use this interface is so the SDK's service client's calls
// can be stubbed out for unit testing your code with the SDK without needing
// to inject custom request handlers into the SDK's request pipeline.
//
//    // myFunc uses an SDK service client to make a request to
//    // AWS Transfer for SFTP.
//    func myFunc(svc transferiface.TransferAPI) bool {
//        // Make svc.CreateServer request
//    }
//
//    func main() {
//        sess := session.New()
//        svc := transfer.New(sess)
//
//        myFunc(svc)
//    }
//
// In your _test.go file:
//
//    // Define a mock struct to be used in your unit tests of myFunc.
//    type mockTransferClient struct {
//        transferiface.TransferAPI
//    }
//    func (m *mockTransferClient) CreateServer(input *transfer.CreateServerInput) (*transfer.CreateServerOutput, error) {
//        // mock response/functionality
//    }
//
//    func TestMyFunc(t *testing.T) {
//        // Setup Test
//        mockSvc := &mockTransferClient{}
//
//        myfunc(mockSvc)
//
//        // Verify myFunc's functionality
//    }
//
// It is important to note that this interface will have breaking changes
// when the service model is updated and adds new API operations, paginators,
// and waiters. Its suggested to use the pattern above for testing, or using
// tooling to generate mocks to satisfy the interfaces.
type TransferAPI interface {
	CreateServer(*transfer.CreateServerInput) (*transfer.CreateServerOutput, error)
	CreateServerWithContext(aws.Context, *transfer.CreateServerInput, ...request.Option) (*transfer.CreateServerOutput, error)
	CreateServerRequest(*transfer.CreateServerInput) (*request.Request, *transfer.CreateServerOutput)

	CreateUser(*transfer.CreateUserInput) (*transfer.CreateUserOutput, error)
	CreateUserWithContext(aws.Context, *transfer.CreateUserInput, ...request.Option) (*transfer.CreateUserOutput, error)
	CreateUserRequest(*transfer.CreateUserInput) (*request.Request, *transfer.CreateUserOutput)

	DeleteServer(*transfer.DeleteServerInput) (*transfer.DeleteServerOutput, error)
	DeleteServerWithContext(aws.Context, *transfer.DeleteServerInput, ...request.Option) (*transfer.DeleteServerOutput, error)
	DeleteServerRequest(*transfer.DeleteServerInput) (*request.Request, *transfer.DeleteServerOutput)

	DeleteSshPublicKey(*transfer.DeleteSshPublicKeyInput) (*transfer.DeleteSshPublicKeyOutput, error)
	DeleteSshPublicKeyWithContext(aws.Context, *transfer.DeleteSshPublicKeyInput, ...request.Option) (*transfer.DeleteSshPublicKeyOutput, error)
	DeleteSshPublicKeyRequest(*transfer.DeleteSshPublicKeyInput) (*request.Request, *transfer.DeleteSshPublicKeyOutput)

	DeleteUser(*transfer.DeleteUserInput) (*transfer.DeleteUserOutput, error)
	DeleteUserWithContext(aws.Context, *transfer.DeleteUserInput, ...request.Option) (*transfer.DeleteUserOutput, error)
	DeleteUserRequest(*transfer.DeleteUserInput) (*request.Request, *transfer.DeleteUserOutput)

	DescribeServer(*transfer.DescribeServerInput) (*transfer.DescribeServerOutput, error)
	DescribeServerWithContext(aws.Context, *transfer.DescribeServerInput, ...request.Option) (*transfer.DescribeServerOutput, error)
	DescribeServerRequest(*transfer.DescribeServerInput) (*request.Request, *transfer.DescribeServerOutput)

	DescribeUser(*transfer.DescribeUserInput) (*transfer.DescribeUserOutput, error)
	DescribeUserWithContext(aws.Context, *transfer.DescribeUserInput, ...request.Option) (*transfer.DescribeUserOutput, error)
	DescribeUserRequest(*transfer.DescribeUserInput) (*request.Request, *transfer.DescribeUserOutput)

	ImportSshPublicKey(*transfer.ImportSshPublicKeyInput) (*transfer.ImportSshPublicKeyOutput, error)
	ImportSshPublicKeyWithContext(aws.Context, *transfer.ImportSshPublicKeyInput, ...request.Option) (*transfer.ImportSshPublicKeyOutput, error)
	ImportSshPublicKeyRequest(*transfer.ImportSshPublicKeyInput) (*request.Request, *transfer.ImportSshPublicKeyOutput)

	ListServers(*transfer.ListServersInput) (*transfer.ListServersOutput, error)
	ListServersWithContext(aws.Context, *transfer.ListServersInput, ...request.Option) (*transfer.ListServersOutput, error)
	ListServersRequest(*transfer.ListServersInput) (*request.Request, *transfer.ListServersOutput)

	ListTagsForResource(*transfer.ListTagsForResourceInput) (*transfer.ListTagsForResourceOutput, error)
	ListTagsForResourceWithContext(aws.Context, *transfer.ListTagsForResourceInput, ...request.Option) (*transfer.ListTagsForResourceOutput, error)
	ListTagsForResourceRequest(*transfer.ListTagsForResourceInput) (*request.Request, *transfer.ListTagsForResourceOutput)

	ListUsers(*transfer.ListUsersInput) (*transfer.ListUsersOutput, error)
	ListUsersWithContext(aws.Context, *transfer.ListUsersInput, ...request.Option) (*transfer.ListUsersOutput, error)
	ListUsersRequest(*transfer.ListUsersInput) (*request.Request, *transfer.ListUsersOutput)

	StartServer(*transfer.StartServerInput) (*transfer.StartServerOutput, error)
	StartServerWithContext(aws.Context, *transfer.StartServerInput, ...request.Option) (*transfer.StartServerOutput, error)
	StartServerRequest(*transfer.StartServerInput) (*request.Request, *transfer.StartServerOutput)

	StopServer(*transfer.StopServerInput) (*transfer.StopServerOutput, error)
	StopServerWithContext(aws.Context, *transfer.StopServerInput, ...request.Option) (*transfer.StopServerOutput, error)
	StopServerRequest(*transfer.StopServerInput) (*request.Request, *transfer.StopServerOutput)

	TagResource(*transfer.TagResourceInput) (*transfer.TagResourceOutput, error)
	TagResourceWithContext(aws.Context, *transfer.TagResourceInput, ...request.Option) (*transfer.TagResourceOutput, error)
	TagResourceRequest(*transfer.TagResourceInput) (*request.Request, *transfer.TagResourceOutput)

	TestIdentityProvider(*transfer.TestIdentityProviderInput) (*transfer.TestIdentityProviderOutput, error)
	TestIdentityProviderWithContext(aws.Context, *transfer.TestIdentityProviderInput, ...request.Option) (*transfer.TestIdentityProviderOutput, error)
	TestIdentityProviderRequest(*transfer.TestIdentityProviderInput) (*request.Request, *transfer.TestIdentityProviderOutput)

	UntagResource(*transfer.UntagResourceInput) (*transfer.UntagResourceOutput, error)
	UntagResourceWithContext(aws.Context, *transfer.UntagResourceInput, ...request.Option) (*transfer.UntagResourceOutput, error)
	UntagResourceRequest(*transfer.UntagResourceInput) (*request.Request, *transfer.UntagResourceOutput)

	UpdateServer(*transfer.UpdateServerInput) (*transfer.UpdateServerOutput, error)
	UpdateServerWithContext(aws.Context, *transfer.UpdateServerInput, ...request.Option) (*transfer.UpdateServerOutput, error)
	UpdateServerRequest(*transfer.UpdateServerInput) (*request.Request, *transfer.UpdateServerOutput)

	UpdateUser(*transfer.UpdateUserInput) (*transfer.UpdateUserOutput, error)
	UpdateUserWithContext(aws.Context, *transfer.UpdateUserInput, ...request.Option) (*transfer.UpdateUserOutput, error)
	UpdateUserRequest(*transfer.UpdateUserInput) (*request.Request, *transfer.UpdateUserOutput)
}

var _ TransferAPI = (*transfer.Transfer)(nil)


text:
module Coolsms
  class RestApi
    # http://www.coolsms.co.kr/SMS_API
    class Send < RestApi
      NECESSARY_PARAMS = [:from, :to, :text]
      OPTIONAL_PARAMS = [
        :type,
        :image, :image_encoding,
        :refname,
        :country,
        :datetime,
        :subject,
        :charset,
        :srk,
        :mode,
        :extension,
        :delay,
        :force_sms,
        :os_platform,
        :dev_lang,
        :sdk_version,
        :app_version
      ]

      attr_accessor *(NECESSARY_PARAMS + OPTIONAL_PARAMS)

      class << self
        def conn
          @conn ||= Faraday.new(url: url) do |conn|
            conn.use Coolsms::RestApi::FaradayErrorHandler
            conn.response :json
            conn.use :instrumentation
            conn.use Faraday::Response::RaiseError
            conn.adapter Coolsms.faraday_adapter || Faraday.default_adapter
          end
        end
      end

      def initialize(text, from, *to)
        self.text = text
        self.from = Coolsms.number_strip(from)
        self.to = to
      end

      def to_params
        params = auth_params
        NECESSARY_PARAMS.each do |param|
          params.update(param => send(param))
        end
        OPTIONAL_PARAMS.each do |param|
          params.update(param => send(param)) if send(param)
        end

        to = Array(params[:to]).flatten
        to = to.map do |num|
          split= num.split(',')
          split.map { |num2| Coolsms.number_strip(num2) }
        end.flatten.uniq.join(',')
        params[:to] = to

        params
      end

      def call
        conn.post '/sms/1.5/send', to_query
      end
    end
  end
end


text:
package com.itelg.docker.cawandu.composer.container;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.zkoss.zk.ui.event.Events;
import org.zkoss.zk.ui.select.annotation.Listen;
import org.zkoss.zk.ui.select.annotation.Wire;
import org.zkoss.zul.Combobox;
import org.zkoss.zul.ComboitemRenderer;
import org.zkoss.zul.ListModelList;
import org.zkoss.zul.Listbox;
import org.zkoss.zul.Listcell;
import org.zkoss.zul.Listitem;
import org.zkoss.zul.ListitemRenderer;
import org.zkoss.zul.Menuitem;
import org.zkoss.zul.Menupopup;
import org.zkoss.zul.Menuseparator;
import org.zkoss.zul.Textbox;

import com.itelg.docker.cawandu.composer.TabComposer;
import com.itelg.docker.cawandu.composer.zk.WireArg;
import com.itelg.docker.cawandu.composer.zk.events.ImagePulledEvent;
import com.itelg.docker.cawandu.domain.container.Container;
import com.itelg.docker.cawandu.domain.container.ContainerFilter;
import com.itelg.docker.cawandu.domain.container.ContainerState;
import com.itelg.docker.cawandu.domain.image.UpdateState;
import com.itelg.docker.cawandu.service.ContainerService;
import com.itelg.docker.cawandu.service.ImageService;
import com.itelg.zkoss.helper.combobox.ComboboxHelper;
import com.itelg.zkoss.helper.i18n.Labels;
import com.itelg.zkoss.helper.listbox.ListboxHelper;
import com.itelg.zkoss.helper.listbox.ListcellHelper;

import de.jaggl.utils.events.zk.annotations.Processing;

@Component
@Scope("request")
public class ContainerListComposer extends TabComposer
{
    private static final long serialVersionUID = 1714597547432917497L;

    @Autowired
    private transient ContainerService containerService;

    @Autowired
    private transient ImageService imageService;

    @Wire
    private Listbox containerListbox;

    @Wire
    private Combobox stateCombobox;

    @Wire
    private Textbox nameTextbox;

    @Wire
    private Textbox idTextbox;

    @Wire
    private Textbox imageNameTextbox;

    @WireArg("filter")
    private ContainerFilter filter;

    @Override
    protected void afterCompose()
    {
        initFilter();
        initListbox();
        refreshListbox();
        setTitle(buildTitle());
    }

    private void initFilter()
    {
        ComboboxHelper.setDefaultItem(stateCombobox, "Show all");
        ComboboxHelper.init(stateCombobox, ContainerState.values(), filter.getState(), (ComboitemRenderer<ContainerState>) (item, status, index) ->
        {
            item.setValue(status);
            item.setLabel(Labels.getLabel(status));
        });

        nameTextbox.setValue(filter.getName());
        idTextbox.setValue(filter.getId());
        imageNameTextbox.setValue(filter.getImageName());
    }

    private void initListbox()
    {
        containerListbox.setItemRenderer(new ContainerListitemRenderer());
        containerListbox.getPaginal().setAutohide(false);
    }

    @Processing(ImagePulledEvent.class)
    private void refreshListbox()
    {
        containerListbox.setModel(new ListModelList<>(containerService.getContainersByFilter(filter)));
        ListboxHelper.hideIfEmpty(containerListbox, "No containers found");
    }

    private String buildTitle()
    {
        String title = "Container";
        List<String> filterProperties = new ArrayList<>();

        if (filter.getState() != null)
        {
            filterProperties.add("State: " + Labels.getLabel(filter.getState()));
        }

        if (StringUtils.isNotBlank(filter.getName()))
        {
            filterProperties.add("Name: " + filter.getName());
        }

        if (StringUtils.isNotBlank(filter.getId()))
        {
            filterProperties.add("ID: " + filter.getId());
        }

        if (StringUtils.isNotBlank(filter.getImageName()))
        {
            filterProperties.add("Image-Name: " + filter.getImageName());
        }

        if (!filterProperties.isEmpty())
        {
            title += " (" + StringUtils.join(filterProperties, ", ") + ")";
        }

        return title;
    }

    private class ContainerListitemRenderer implements ListitemRenderer<Container>
    {
        @Override
        public void render(Listitem item, Container container, int index) throws Exception
        {
            Menupopup popup = new Menupopup();
            getSelf().appendChild(popup);
            item.setContext(popup);
            item.setPopup(popup);
            item.setValue(container);

            Menuitem startContainerMenuitem = new Menuitem("Start container");
            startContainerMenuitem.setParent(popup);
            startContainerMenuitem.setIconSclass("z-icon-play");
            startContainerMenuitem.setDisabled(!container.isStartable());
            startContainerMenuitem.addEventListener(Events.ON_CLICK, event ->
            {
                containerService.startContainer(container);
                refreshListbox();
                showNotification("Container started");
            });

            Menuitem restartContainerMenuitem = new Menuitem("Restart container");
            restartContainerMenuitem.setParent(popup);
            restartContainerMenuitem.setIconSclass("z-icon-fast-forward");
            restartContainerMenuitem.setDisabled(!container.isRestartable());
            restartContainerMenuitem.addEventListener(Events.ON_CLICK, event ->
            {
                containerService.restartContainer(container);
                refreshListbox();
                showNotification("Container restarted");
            });

            Menuitem stopContainerMenuitem = new Menuitem("Stop container");
            stopContainerMenuitem.setParent(popup);
            stopContainerMenuitem.setIconSclass("z-icon-stop");
            stopContainerMenuitem.setDisabled(!container.isStoppable());
            stopContainerMenuitem.addEventListener(Events.ON_CLICK, event ->
            {
                containerService.stopContainer(container);
                refreshListbox();
                showNotification("Container stopped");
            });

            Menuitem removeContainerMenuitem = new Menuitem("Remove container");
            removeContainerMenuitem.setParent(popup);
            removeContainerMenuitem.setIconSclass("z-icon-times");
            removeContainerMenuitem.setDisabled(!container.isRemovable());
            removeContainerMenuitem.addEventListener(Events.ON_CLICK, event ->
            {
                containerService.removeContainer(container);
                refreshListbox();
                showNotification("Container removed");
            });

            Menuitem killContainerMenuitem = new Menuitem("Kill & remove container");
            killContainerMenuitem.setParent(popup);
            killContainerMenuitem.setIconSclass("z-icon-flash");
            killContainerMenuitem.setDisabled(!container.isKillable());
            killContainerMenuitem.addEventListener(Events.ON_CLICK, event ->
            {
                containerService.killContainer(container);
                refreshListbox();
                showNotification("Container killed");
            });

            popup.appendChild(new Menuseparator());

            Menuitem updateContainerMenuitem = new Menuitem("Update container");
            updateContainerMenuitem.setParent(popup);
            updateContainerMenuitem.setIconSclass("z-icon-caret-up");
            updateContainerMenuitem.setDisabled(!container.hasUpdate());
            updateContainerMenuitem.addEventListener(Events.ON_CLICK, event ->
            {
                containerService.recreateContainer(container);
                refreshListbox();
                showNotification("Container updated");
            });

            Menuitem switchTagMenuitem = new Menuitem("Switch tag");
            switchTagMenuitem.setParent(popup);
            switchTagMenuitem.setIconSclass("z-icon-sort");
            switchTagMenuitem.setDisabled(!container.isTagSwitchable());
            switchTagMenuitem.addEventListener(Events.ON_CLICK, event ->
            {
                org.zkoss.zk.ui.Component composer = ContainerSwitchTagComposer.show(container);
                composer.addEventListener(Events.ON_CLOSE, closeEvent ->
                {
                    if (closeEvent.getData() != null)
                    {
                        refreshListbox();
                        showNotification("Tag swiched");
                    }
                });
            });

            Menuitem pullImageContainerMenuitem = new Menuitem("Pull image");
            pullImageContainerMenuitem.setParent(popup);
            pullImageContainerMenuitem.setIconSclass("z-icon-download");
            pullImageContainerMenuitem.setDisabled(!container.isImagePullable());
            pullImageContainerMenuitem.addEventListener(Events.ON_CLICK, event ->
            {
                UpdateState state = imageService.pullImage(container.getImageName());

                if (state == UpdateState.PULLED)
                {
                    showNotification("New version pulled");
                    refreshListbox();
                }
                else if (state == UpdateState.NO_UPDATE)
                {
                    showNotification("No update available");
                }
                else if (state == UpdateState.NO_ACCESS)
                {
                    showWarning("No access to private repository!");
                }
                else
                {
                    showWarning("Unknown error");
                }
            });

            Menuitem recreateContainerMenuitem = new Menuitem("Recreate container");
            recreateContainerMenuitem.setParent(popup);
            recreateContainerMenuitem.setIconSclass("z-icon-repeat");
            recreateContainerMenuitem.setDisabled(container.isSwarmTask());
            recreateContainerMenuitem.addEventListener(Events.ON_CLICK, event ->
            {
                containerService.recreateContainer(container);
                refreshListbox();
                showNotification("Container recreated");
            });

            popup.appendChild(new Menuseparator());

            Menuitem renameContainerMenuitem = new Menuitem("Rename container");
            renameContainerMenuitem.setParent(popup);
            renameContainerMenuitem.setIconSclass("z-icon-edit");
            renameContainerMenuitem.setDisabled(container.isSwarmTask());
            renameContainerMenuitem.addEventListener(Events.ON_CLICK, event ->
            {
                org.zkoss.zk.ui.Component composer = ContainerRenameComposer.show(container);
                composer.addEventListener(Events.ON_CLOSE, closeEvent ->
                {
                    if (closeEvent.getData() != null)
                    {
                        refreshListbox();
                        showNotification("Container renamed");
                    }
                });
            });

            new Listcell(container.getId()).setParent(item);

            Listcell stateListcell = new Listcell(Labels.getLabel(container.getState()));
            stateListcell.setParent(item);
            stateListcell.setStyle("background-color: " + container.getState().getColor());

            new Listcell(container.getName()).setParent(item);
            Listcell imageNameListcell = new Listcell(container.getImageName());
            imageNameListcell.setParent(item);

            if (StringUtils.isBlank(container.getImageName()))
            {
                imageNameListcell.setStyle("color: red;");
                imageNameListcell.setLabel("Unknown (Image-ID: " + container.getImageId() + ")");
                imageNameListcell.setTooltiptext("Wrong config! Add image-label or tag image");
            }
            else if (container.hasUpdate())
            {
                imageNameListcell.setStyle("color: #00CC00;");
                imageNameListcell.setTooltiptext("Update available");
            }
            else
            {
                imageNameListcell.setTooltiptext("No update available");
            }

            ListcellHelper.buildDateTimeListcell(container.getCreated()).setParent(item);
        }
    }

    @Listen("onClick = #searchSubmitButton; onSelect = #stateCombobox; onOK = #nameTextbox,#idTextbox,#imageNameTextbox")
    public void onExecuteFilter()
    {
        filter.setState(stateCombobox.getSelectedItem().getValue());
        filter.setName(nameTextbox.getValue().trim());
        filter.setId(idTextbox.getValue().trim());
        filter.setImageName(imageNameTextbox.getValue().trim());

        refreshListbox();
        setTitle(buildTitle());
    }

    @Listen("onClick = #searchResetButton")
    public void onResetFilter()
    {
        stateCombobox.setSelectedIndex(0);
        nameTextbox.setValue("");
        idTextbox.setValue("");
        imageNameTextbox.setValue("");
        onExecuteFilter();
    }

    public static void show()
    {
        show(new ContainerFilter());
    }

    public static void show(ContainerFilter filter)
    {
        show("/container/list.zul", Collections.singletonMap("filter", filter));
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- BEGIN_INCLUDE(manifest) -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="uobikiemukot.yaft"
        android:versionCode="4"
        android:versionName="1.0">

    <!-- This is the platform API where NativeActivity was introduced. -->
    <uses-sdk android:minSdkVersion="9" />
    <uses-sdk android:targetSdkVersion="17" />

	<!-- yaft doesn't require any permission,
		but internal shell may call commands that require following permission (su, ssh, etc..) -->
	<uses-permission android:name="android.permission.INTERNET" />
	<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
	<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
	<uses-permission android:name="android.permission.ACCESS_SUPERUSER" />

    <!-- This .apk has no Java code itself, so set hasCode to false. -->
    <application android:label="@string/app_name" android:hasCode="false">

        <!-- Our activity is the built-in NativeActivity framework class.
             This will take care of integrating with our NDK code. -->
        <activity android:name="android.app.NativeActivity"
                android:label="@string/app_name"
                android:configChanges="orientation|keyboardHidden">
            <!-- Tell NativeActivity the name of or .so -->
            <meta-data android:name="android.app.lib_name"
                    android:value="yaft" />
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>
<!-- END_INCLUDE(manifest) -->


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

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>HttpUtil</title>
<meta name="date" content="2019-06-04">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

您的浏览器已禁用 JavaScript。

概览

程序包

类

使用

树

已过时

索引

帮助

上一个类

下一个类

框架

无框架

所有类

概要:

嵌套 |

字段 |

构造器 |

方法

详细资料:

字段 |

构造器 |

方法

com.jeecg.weibo.util

类 HttpUtil

java.lang.Object

com.jeecg.weibo.util.HttpUtil

public class HttpUtil
extends java.lang.Object

构造器概要

构造器

构造器和说明

HttpUtil()

方法概要

方法

限定符和类型
方法和说明

static com.alibaba.fastjson.JSONObject
httpRequest(java.lang.String requestUrl,
           java.lang.String requestMethod,
           java.lang.String outputStr)

发起https请求并获取结果

static com.alibaba.fastjson.JSONArray
httpRequestArr(java.lang.String requestUrl,
              java.lang.String requestMethod,
              java.lang.String outputStr)

发起https请求并获取结果

static com.alibaba.fastjson.JSONObject
httpUploadRequest(java.lang.String requestUrl,
                 java.lang.String requestMethod,
                 java.lang.String outputStr)

发起https请求并获取结果

从类继承的方法 java.lang.Object

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

构造器详细资料

HttpUtil

public HttpUtil()

方法详细资料

httpRequest

public static com.alibaba.fastjson.JSONObject httpRequest(java.lang.String requestUrl,
                                          java.lang.String requestMethod,
                                          java.lang.String outputStr)

发起https请求并获取结果

参数:

requestUrl - 请求地址

requestMethod - 请求方式(GET、POST)

outputStr - 提交的数据

返回:

JSONObject(通过JSONObject.get(key)的方式获取json对象的属性值)

httpRequestArr

public static com.alibaba.fastjson.JSONArray httpRequestArr(java.lang.String requestUrl,
                                            java.lang.String requestMethod,
                                            java.lang.String outputStr)

发起https请求并获取结果

参数:

requestUrl - 请求地址

requestMethod - 请求方式(GET、POST)

outputStr - 提交的数据

返回:

JSONObject(通过JSONObject.get(key)的方式获取json对象的属性值)

httpUploadRequest

public static com.alibaba.fastjson.JSONObject httpUploadRequest(java.lang.String requestUrl,
                                                java.lang.String requestMethod,
                                                java.lang.String outputStr)

发起https请求并获取结果

参数:

requestUrl - 请求地址

requestMethod - 请求方式(GET、POST)

outputStr - 提交的数据

返回:

JSONObject(通过JSONObject.get(key)的方式获取json对象的属性值)

概览

程序包

类

使用

树

已过时

索引

帮助

上一个类

下一个类

框架

无框架

所有类

概要:

嵌套 |

字段 |

构造器 |

方法

详细资料:

字段 |

构造器 |

方法


text:
<?php
/**
 * Created by PhpStorm.
 * User: joeldg
 * Date: 1/7/18
 * Time: 1:00 AM
 */
namespace Bowhead\Util;
/**
 * Class Coinigy
 * $coinigy_api = new Coinigy();
 * $coinigy_api->exchanges();
 * $coinigy_api->markets('OK');
 *
 *  Originally from here https://github.com/coinigy/api/blob/master/example_v1.php
 *  I have added a few things below, but kept the original for the most part.
 *  Most especially I fixed the crazy spacing and formatting in the orginal file and added phpdoc blocks
 *
 */
class Coinigy
{
    use \Bowhead\Traits\Config;

    /**
     * @var string
     */
    private $coinigy_api_key;

    /**
     * @var string
     */
    private $coinigy_api_secret;

    /**
     * @var string
     */
    private $endpoint;

    /**
     * Coinigy constructor.
     */
    function __construct()
    {
        //see API docs for more info
        $this->coinigy_api_key = \Bowhead\Traits\Config::bowhead_config('COINIGY_API');
        $this->coinigy_api_secret = \Bowhead\Traits\Config::bowhead_config('COINIGY_SEC');
        $this->endpoint = 'https://api.coinigy.com/api/v1/'; //with trailing slash
    }

    public function userInfo()
    {
        $post_arr = array();
        $result = $this->doWebRequest('userInfo', $post_arr);
        return $result;
    }

    public function accounts()
    {
        $post_arr = array();
        $result = $this->doWebRequest('accounts', $post_arr);
        return $result;
    }

    public function activity()
    {
        $post_arr = array();
        $result = $this->doWebRequest('activity', $post_arr);
        return $result;
    }

    /**
     * @param $auth_ids
     */
    public function balances($auth_ids)
    {
        $post_arr = array();
        $post_arr["auth_ids"] = $auth_ids;

        $result = $this->doWebRequest('balances', $post_arr);
        return $result;
    }

    public function pushNotifications()
    {
        $post_arr = array();
        $result = $this->doWebRequest('pushNotifications', $post_arr);
        return $result;
    }

    public function user_orders()
    {
        $post_arr = array();
        $result = $this->doWebRequest('orders', $post_arr);
        return $result;
    }

    public function alerts()
    {
        $post_arr = array();
        $result = $this->doWebRequest('alerts', $post_arr);
        return $result;
    }

    public function exchanges()
    {
        $post_arr = array();
        $result = $this->doWebRequest('exchanges', $post_arr);
        return $result;
    }

    /**
     * @param $exchange_code
     */
    public function markets($exchange_code)
    {
        $post_arr = array();
        $post_arr["exchange_code"] = $exchange_code;

        $result = $this->doWebRequest('markets', $post_arr);
        return $result;
    }

    /**
     * @param $exchange_code
     * @param $exchange_market
     */
    public function history($exchange_code, $exchange_market)
    {
        $post_arr = array();
        $post_arr["exchange_code"] = $exchange_code;
        $post_arr["exchange_market"] = $exchange_market;
        $post_arr["type"] = "history";

        $result = $this->doWebRequest('data', $post_arr);
        return $result;
    }

    /**
     * @param $exchange_code
     * @param $exchange_market
     */
    public function asks($exchange_code, $exchange_market)
    {
        $post_arr = array();
        $post_arr["exchange_code"] = $exchange_code;
        $post_arr["exchange_market"] = $exchange_market;
        $post_arr["type"] = "asks";

        $result = $this->doWebRequest('data', $post_arr);
        return $result;
    }

    /**
     * @param $exchange_code
     * @param $exchange_market
     */
    public function bids($exchange_code, $exchange_market)
    {
        $post_arr = array();
        $post_arr["exchange_code"] = $exchange_code;
        $post_arr["exchange_market"] = $exchange_market;
        $post_arr["type"] = "bids";

        $result = $this->doWebRequest('data', $post_arr);
        return $result;
    }

    //asks + bids + history
    /**
     * @param $exchange_code
     * @param $exchange_market
     */
    public function data($exchange_code, $exchange_market)
    {
        $post_arr = array();
        $post_arr["exchange_code"] = $exchange_code;
        $post_arr["exchange_market"] = $exchange_market;
        $post_arr["type"] = "all";

        $result = $this->doWebRequest('data', $post_arr);
        return $result;
    }

    //asks + bids
    /**
     * @param $exchange_code
     * @param $exchange_market
     */
    public function orders($exchange_code, $exchange_market)
    {

        $post_arr = array();
        $post_arr["exchange_code"] = $exchange_code;
        $post_arr["exchange_market"] = $exchange_market;
        $post_arr["type"] = "orders";

        $result = $this->doWebRequest('data', $post_arr);

        return $result;
    }

    public function newsFeed()
    {
        $post_arr = array();

        $result = $this->doWebRequest('newsFeed', $post_arr);
        return $result;
    }

    public function orderTypes()
    {
        $post_arr = array();
        $result = $this->doWebRequest('orderTypes', $post_arr);
        return $result;
    }

    /**
    ////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////
    //////////////////////                      ////////////////////////////////////////
    /////////////            ACTION METHODS         ////////////////////////////////////
    /////////////////////                       ////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////
    //*/

    /**
     * @param $auth_id
     */
    public function refreshBalance($auth_id)
    {

        $post_arr = array();
        $post_arr["auth_id"] = $auth_id;

        $result = $this->doWebRequest('refreshBalance', $post_arr);
        return $result;
    }

    /**
     * @param $exchange_code
     * @param $exchange_market
     * @param $alert_price
     */
    public function addAlert($exchange_code, $exchange_market, $alert_price)
    {
        $post_arr = array();
        $post_arr["exch_code"] = $exchange_code;
        $post_arr["market_name"] = $exchange_market;
        $post_arr["alert_price"] = $alert_price;

        $result = $this->doWebRequest('addAlert', $post_arr);
        return $result;
    }

    /**
     * @param $delete_alert_id
     */
    public function deleteAlert($delete_alert_id)
    {
        $post_arr = array();
        $post_arr["alert_id"] = $delete_alert_id;

        $result = $this->doWebRequest('deleteAlert', $post_arr);
        return $result;
    }

    /**
     * @param $order_auth_id
     * @param $order_exch_id
     * @param $order_mkt_id
     * @param $order_type_id
     * @param $price_type_id
     * @param $limit_price
     * @param $stop_price
     * @param $order_quantity
     */
    public function addOrder($order_auth_id, $order_exch_id, $order_mkt_id, $order_type_id, $price_type_id, $limit_price, $stop_price, $order_quantity)
    {
        $post_arr = array();
        $post_arr["auth_id"] = $order_auth_id;
        $post_arr["exch_id"] = $order_exch_id;
        $post_arr["mkt_id"] = $order_mkt_id;
        $post_arr["order_type_id"] = $order_type_id;
        $post_arr["price_type_id"] = $price_type_id;
        $post_arr["limit_price"] =$limit_price;
        $post_arr["stop_price"] = $stop_price;
        $post_arr["order_quantity"] = $order_quantity;

        $result = $this->doWebRequest('addOrder', $post_arr);
        return $result;

    }

    /**
     * @param $cancel_order_id
     */
    public function cancelOrder($cancel_order_id)
    {
        $post_arr = array();
        $post_arr["internal_order_id"] = $cancel_order_id;

        $result = $this->doWebRequest('cancelOrder', $post_arr);
        return $result;

    }

    /**
     * @param $method
     * @param $post_arr
     *
     * @return bool|mixed
     */
    private function doWebRequest($method, $post_arr)
    {

        $url = $this->endpoint.$method;

        $headers = array('X-API-KEY: ' . $this->coinigy_api_key,
            'X-API-SECRET: ' . $this->coinigy_api_secret);

        // our curl handle (initialize if required)
        static $ch = null;
        if (is_null($ch)) {
            $ch = curl_init();
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; Bowhead; '.php_uname('s').'; PHP/'.phpversion().')');
        }

        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $post_arr);
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE);
        $res = curl_exec($ch);

        if ($res === false)  {
            echo "CURL Failed - Check URL";
            return false;
        }

        $dec = json_decode($res, 1);
        if (!$dec) {
            echo "Invalid JSON returned - Redirect to Login";
            return false;
        }

        return $dec;

    }

    /**
     * @param $result
     */
    private function output_result($result)
    {
        if($result)
        {
            if(isset($result->error))
                $this->pre($result->error);
            elseif(isset($result))
                $this->pre($result);
        }
    }

    /**
     * @param $array
     */
    private function pre($array) {
        echo "<pre>".print_r($array, true)."</pre>";
    }

}


text:
/*
    Leola Programming Language
    Author: Tony Sparks
    See license.txt
*/
package leola.vm.compiler;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.File;
import java.io.IOException;
import java.util.Stack;

/**
 * {@link DebugSymbols} contains information regarding local variables within a particular scope.
 *
 * @author Tony
 *
 */
public class DebugSymbols {

    /**
     * Local variable
     *
     * @author Tony
     *
     */
    private static class LocalVar {

        /**
         * The reference/name of the variable
         */
        String symbol;

        /**
         * The starting and ending program counter
         * that encompasses the scope.  That is, this
         * local variable only lives within these
         * instructions
         */
        int startpc, endpc;

        LocalVar(String symbol, int startpc, int endpc) {
            this.symbol = symbol;
            this.startpc = startpc;
            this.endpc = endpc;
        }

    }

    /**
     * All of the local variables for
     * a {@link Bytecode}
     */
    private LocalVar[] locvars;

    /**
     * Number of lexical scopes within a
     * {@link Bytecode}
     */
    private Stack<Integer> scopes;

    /**
     * The actual number of local
     * variables
     */
    private int index;

    private String source;
    private File sourceFile;

    /**
     *
     */
    public DebugSymbols() {
        this.scopes = new Stack<Integer>();
        this.locvars = new LocalVar[10];
        this.index = 0;
    }

    public DebugSymbols(LocalVar[] vars) {
        this.locvars = vars;
        this.index = vars.length;
        this.scopes = new Stack<Integer>();
    }

    /**
     * @return the source
     */
    public String getSource() {
        return source;
    }

    /**
     * @param source the source to set
     */
    public void setSource(String source) {
        this.source = source;
    }

    /**
     * @param sourceFile the sourceFile to set
     */
    public void setSourceFile(File sourceFile) {
        this.sourceFile = sourceFile;
    }

    /**
     * @return the sourceFile
     */
    public File getSourceFile() {
        return sourceFile;
    }

    /**
     * Stores a symbol starting at an instruction location (program counter).
     *
     * @param reference
     * @param startpc
     * @return the index at which the symbol is stored
     */
    public int store(String reference, int startpc) {
        /* Expand the array if we have reached our local limit
         */
        if ( index >= this.locvars.length ) {
            LocalVar[] newarray = new LocalVar[locvars.length  << 1];
            System.arraycopy(this.locvars, 0, newarray, 0, this.locvars.length);
            this.locvars = newarray;
        }

        this.locvars[index] = new LocalVar(reference, startpc, -1);
        return this.index++;
    }

    /**
     * Starts a new scope for local variables
     *
     * @param startpc
     */
    public void startScope(int startpc) {
        scopes.push(startpc);
    }

    /**
     * Ends the lexical scope for the local variable
     *
     * @param endpc
     */
    public void endScope(int endpc) {
        int pc = scopes.pop();
        for (int i = 0; i < locvars.length; i++) {
            if(locvars[i]!=null) {
                if (locvars[i].endpc < 0 && locvars[i].startpc >= pc) {
                    locvars[i].endpc = endpc;
                }
            }
        }
    }

    /**
     * Retrieves a symbol for a local variable
     *
     * @param index
     * @param pc the instruction location (program counter)
     * @return the reference name at the supplied index and program counter
     */
    public String getSymbol(int index, int pc) {
        for (int i = 0; i < this.index && locvars[i].startpc <= pc; i++) {

            /* is variable active? */
            if (pc < locvars[i].endpc || locvars[i].endpc == -1 ) {
                index--;
                if (index < 0)
                    return locvars[i].symbol;
            }
        }
        return null;  /* not found */
    }

    /**
     * @return the number of debug symbols
     */
    public int getSize() {
        return this.index;
    }

    /**
     * Reads the from {@link DataInput} stream and constructs a {@link DebugSymbols}.
     *
     * @param input
     * @return
     * @throws IOException
     */
    public static DebugSymbols read(DataInput input) throws IOException {
        int len = input.readInt();
        LocalVar[] vars = new LocalVar[len];
        for(int i = 0; i < len; i++) {
            int strLen = input.readInt();
            byte[] s = new byte[strLen];
            input.readFully(s);
            String symbol = new String(s);

            int startpc = input.readInt();
            int endpc = input.readInt();
            vars[i] = new LocalVar(symbol, startpc, endpc);
        }

        return new DebugSymbols(vars);
    }

    /**
     * Serializes the {@link DebugSymbols}
     * @param output
     * @throws IOException
     */
    public void write(DataOutput output) throws IOException {
        output.writeInt(this.index);
        for(int i = 0; i < this.index; i++) {
            LocalVar var = this.locvars[i];
            output.writeInt(var.symbol.length());
            output.write(var.symbol.getBytes());

            output.writeInt(var.startpc);
            output.writeInt(var.endpc);
        }
    }
}


text:
select i_brand_id brand_id, i_brand brand,t_hour,t_minute,
 	sum(ext_price) ext_price
 from item, (select ws_ext_sales_price as ext_price,
                        ws_sold_date_sk as sold_date_sk,
                        ws_item_sk as sold_item_sk,
                        ws_sold_time_sk as time_sk
                 from web_sales,date_dim
                 where d_date_sk = ws_sold_date_sk
                   and d_moy=12
                   and d_year=2000
                 union all
                 select cs_ext_sales_price as ext_price,
                        cs_sold_date_sk as sold_date_sk,
                        cs_item_sk as sold_item_sk,
                        cs_sold_time_sk as time_sk
                 from catalog_sales,date_dim
                 where d_date_sk = cs_sold_date_sk
                   and d_moy=12
                   and d_year=2000
                 union all
                 select ss_ext_sales_price as ext_price,
                        ss_sold_date_sk as sold_date_sk,
                        ss_item_sk as sold_item_sk,
                        ss_sold_time_sk as time_sk
                 from store_sales,date_dim
                 where d_date_sk = ss_sold_date_sk
                   and d_moy=12
                   and d_year=2000
                 ) tmp,time_dim
 where
   sold_item_sk = i_item_sk
   and i_manager_id=1
   and time_sk = t_time_sk
   and (t_meal_time = 'breakfast' or t_meal_time = 'dinner')
 group by i_brand, i_brand_id,t_hour,t_minute
 order by ext_price desc, i_brand_id
 ;

-- end query 1 in stream 0 using template query71.tpl


text:
using System;
using OpenCvSharp;
using OpenCvSharp.CPlusPlus;
using SampleBase;

namespace CppStyleSamplesCS
{
    /// <summary>
    /// DFT, inverse DFT
    /// http://stackoverflow.com/questions/19761526/how-to-do-inverse-dft-in-opencv
    /// </summary>
    class DFT : ISample
    {
        public void Run()
        {
            Mat img = Cv2.ImRead(FilePath.Image.Lenna, LoadMode.GrayScale);

            // expand input image to optimal size
            Mat padded = new Mat();
            int m = Cv2.GetOptimalDFTSize(img.Rows);
            int n = Cv2.GetOptimalDFTSize(img.Cols); // on the border add zero values
            Cv2.CopyMakeBorder(img, padded, 0, m - img.Rows, 0, n - img.Cols, BorderType.Constant, Scalar.All(0));

            // Add to the expanded another plane with zeros
            Mat paddedF32 = new Mat();
            padded.ConvertTo(paddedF32, MatType.CV_32F);
            Mat[] planes = { paddedF32, Mat.Zeros(padded.Size(), MatType.CV_32F) };
            Mat complex = new Mat();
            Cv2.Merge(planes, complex);

            // this way the result may fit in the source matrix
            Mat dft = new Mat();
            Cv2.Dft(complex, dft);

            // compute the magnitude and switch to logarithmic scale
            // => log(1 + sqrt(Re(DFT(I))^2 + Im(DFT(I))^2))
            Mat[] dftPlanes;
            Cv2.Split(dft, out dftPlanes);  // planes[0] = Re(DFT(I), planes[1] = Im(DFT(I))

            // planes[0] = magnitude
            Mat magnitude = new Mat();
            Cv2.Magnitude(dftPlanes[0], dftPlanes[1], magnitude);

            magnitude += Scalar.All(1);  // switch to logarithmic scale
            Cv2.Log(magnitude, magnitude);

            // crop the spectrum, if it has an odd number of rows or columns
            Mat spectrum = magnitude[
                new Rect(0, 0, magnitude.Cols & -2, magnitude.Rows & -2)];

            // rearrange the quadrants of Fourier image  so that the origin is at the image center
            int cx = spectrum.Cols / 2;
            int cy = spectrum.Rows / 2;

            Mat q0 = new Mat(spectrum, new Rect(0, 0, cx, cy));   // Top-Left - Create a ROI per quadrant
            Mat q1 = new Mat(spectrum, new Rect(cx, 0, cx, cy));  // Top-Right
            Mat q2 = new Mat(spectrum, new Rect(0, cy, cx, cy));  // Bottom-Left
            Mat q3 = new Mat(spectrum, new Rect(cx, cy, cx, cy)); // Bottom-Right

            // swap quadrants (Top-Left with Bottom-Right)
            Mat tmp = new Mat();
            q0.CopyTo(tmp);
            q3.CopyTo(q0);
            tmp.CopyTo(q3);

            // swap quadrant (Top-Right with Bottom-Left)
            q1.CopyTo(tmp);
            q2.CopyTo(q1);
            tmp.CopyTo(q2);

            // Transform the matrix with float values into a
            Cv2.Normalize(spectrum, spectrum, 0, 1, NormType.MinMax);

            // Show the result
            Cv2.ImShow("Input Image"       , img);
            Cv2.ImShow("Spectrum Magnitude", spectrum);

            // calculating the idft
            Mat inverseTransform = new Mat();
            Cv2.Dft(dft, inverseTransform, DftFlag2.Inverse | DftFlag2.RealOutput);
            Cv2.Normalize(inverseTransform, inverseTransform, 0, 1, NormType.MinMax);
            Cv2.ImShow("Reconstructed by Inverse DFT", inverseTransform);
            Cv2.WaitKey();
        }
    }
}


text:
<?php

namespace app\models;

use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use app\models\RegistroCanciones;

/**
 * CancionesSearch represents the model behind the search form about `app\models\RegistroCanciones`.
 */
class CancionesSearch extends RegistroCanciones
{
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['canpk'], 'integer'],
            [['cannombre', 'canartista'], 'safe'],
            [['cangrabación', 'canaprobación'], 'boolean'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function scenarios()
    {
        // bypass scenarios() implementation in the parent class
        return Model::scenarios();
    }

    /**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
    public function search($params)
    {
        $query = RegistroCanciones::find();

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        $query->andFilterWhere([
            'canpk' => $this->canpk,
            'cangrabación' => $this->cangrabación,
            'canaprobación' => $this->canaprobación,
        ]);

        $query->andFilterWhere(['like', 'cannombre', $this->cannombre])
            ->andFilterWhere(['like', 'canartista', $this->canartista]);

        return $dataProvider;
    }
}


text: Flux/React learning


text:
<?php
	echo "MODULE NOT FOUND::Feature under development.";
?>