text:
'use strict';

Object.defineProperty(exports, '__esModule', {
  value: true
});

var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }

var _estraverse = require('estraverse');

var _estraverse2 = _interopRequireDefault(_estraverse);

var ESTRAVERSE_KEYS = {
  Super: [],
  JSXElement: []
};

/**
 * Utility for AST.
 */

var ASTUtil = (function () {
  function ASTUtil() {
    _classCallCheck(this, ASTUtil);
  }

  _createClass(ASTUtil, null, [{
    key: 'sanitize',

    /**
     * sanitize node.
     * change node type to `Identifier` and empty comment.
     * @param {ASTNode} node - target node.
     */
    value: function sanitize(node) {
      if (!node) return;
      node.type = 'Identifier';
      node.name = '_';
      node.leadingComments = [];
      node.trailingComments = [];
    }

    /**
     * traverse ast nodes.
     * @param {AST} ast - target AST.
     * @param {function(node: Object, parent: Object)} callback - this is called with each node.
     */
  }, {
    key: 'traverse',
    value: function traverse(ast, callback) {
      _estraverse2['default'].traverse(ast, {
        enter: function enter(node, parent) {
          callback.call(this, node, parent);
        },

        keys: ESTRAVERSE_KEYS
      });
    }

    /**
     * find file path in import declaration by name.
     * e.g. can find ``./foo/bar.js`` from ``import Bar from './foo/bar.js'`` by ``Bar``.
     * @param {AST} ast - target AST.
     * @param {string} name - identifier name.
     * @returns {string|null} file path.
     */
  }, {
    key: 'findPathInImportDeclaration',
    value: function findPathInImportDeclaration(ast, name) {
      var path = null;

      _estraverse2['default'].traverse(ast, {
        enter: function enter(node, parent) {
          if (node.type !== 'ImportDeclaration') return;

          var _iteratorNormalCompletion = true;
          var _didIteratorError = false;
          var _iteratorError = undefined;

          try {
            for (var _iterator = node.specifiers[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
              var spec = _step.value;

              var localName = spec.local.name;
              if (localName === name) {
                path = node.source.value;
                this['break']();
              }
            }
          } catch (err) {
            _didIteratorError = true;
            _iteratorError = err;
          } finally {
            try {
              if (!_iteratorNormalCompletion && _iterator['return']) {
                _iterator['return']();
              }
            } finally {
              if (_didIteratorError) {
                throw _iteratorError;
              }
            }
          }
        },

        keys: ESTRAVERSE_KEYS
      });

      return path;
    }

    /**
     * find VariableDeclaration node which has NewExpression.
     * @param {string} name - variable name.
     * @param {AST} ast - find in this ast.
     * @returns {ASTNode|null} found ast node.
     */
  }, {
    key: 'findVariableDeclarationAndNewExpressionNode',
    value: function findVariableDeclarationAndNewExpressionNode(name, ast) {
      if (!name) return null;

      var _iteratorNormalCompletion2 = true;
      var _didIteratorError2 = false;
      var _iteratorError2 = undefined;

      try {
        for (var _iterator2 = ast.body[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
          var node = _step2.value;

          if (node.type === 'VariableDeclaration' && node.declarations[0].init && node.declarations[0].init.type === 'NewExpression' && node.declarations[0].id.name === name) {
            return node;
          }
        }
      } catch (err) {
        _didIteratorError2 = true;
        _iteratorError2 = err;
      } finally {
        try {
          if (!_iteratorNormalCompletion2 && _iterator2['return']) {
            _iterator2['return']();
          }
        } finally {
          if (_didIteratorError2) {
            throw _iteratorError2;
          }
        }
      }

      return null;
    }

    /**
     * find ClassDeclaration node.
     * @param {string} name - class name.
     * @param {AST} ast - find in this ast.
     * @returns {ASTNode|null} found ast node.
     */
  }, {
    key: 'findClassDeclarationNode',
    value: function findClassDeclarationNode(name, ast) {
      if (!name) return null;

      var _iteratorNormalCompletion3 = true;
      var _didIteratorError3 = false;
      var _iteratorError3 = undefined;

      try {
        for (var _iterator3 = ast.body[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
          var node = _step3.value;

          if (node.type === 'ClassDeclaration' && node.id.name === name) return node;
        }
      } catch (err) {
        _didIteratorError3 = true;
        _iteratorError3 = err;
      } finally {
        try {
          if (!_iteratorNormalCompletion3 && _iterator3['return']) {
            _iterator3['return']();
          }
        } finally {
          if (_didIteratorError3) {
            throw _iteratorError3;
          }
        }
      }

      return null;
    }

    /**
     * find FunctionDeclaration node.
     * @param {string} name - function name.
     * @param {AST} ast - find in this ast.
     * @returns {ASTNode|null} found ast node.
     */
  }, {
    key: 'findFunctionDeclarationNode',
    value: function findFunctionDeclarationNode(name, ast) {
      if (!name) return null;

      var _iteratorNormalCompletion4 = true;
      var _didIteratorError4 = false;
      var _iteratorError4 = undefined;

      try {
        for (var _iterator4 = ast.body[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
          var node = _step4.value;

          if (node.type === 'FunctionDeclaration' && node.id.name === name) return node;
        }
      } catch (err) {
        _didIteratorError4 = true;
        _iteratorError4 = err;
      } finally {
        try {
          if (!_iteratorNormalCompletion4 && _iterator4['return']) {
            _iterator4['return']();
          }
        } finally {
          if (_didIteratorError4) {
            throw _iteratorError4;
          }
        }
      }

      return null;
    }

    /**
     * find VariableDeclaration node.
     * @param {string} name - variable name.
     * @param {AST} ast - find in this ast.
     * @returns {ASTNode|null} found ast node.
     */
  }, {
    key: 'findVariableDeclarationNode',
    value: function findVariableDeclarationNode(name, ast) {
      if (!name) return null;

      var _iteratorNormalCompletion5 = true;
      var _didIteratorError5 = false;
      var _iteratorError5 = undefined;

      try {
        for (var _iterator5 = ast.body[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {
          var node = _step5.value;

          if (node.type === 'VariableDeclaration' && node.declarations[0].id.name === name) return node;
        }
      } catch (err) {
        _didIteratorError5 = true;
        _iteratorError5 = err;
      } finally {
        try {
          if (!_iteratorNormalCompletion5 && _iterator5['return']) {
            _iterator5['return']();
          }
        } finally {
          if (_didIteratorError5) {
            throw _iteratorError5;
          }
        }
      }

      return null;
    }

    /**
     * create VariableDeclaration node which has NewExpression.
     * @param {string} name - variable name.
     * @param {string} className - class name.
     * @param {Object} loc - location.
     * @returns {ASTNode} created node.
     */
  }, {
    key: 'createVariableDeclarationAndNewExpressionNode',
    value: function createVariableDeclarationAndNewExpressionNode(name, className, loc) {
      var node = {
        type: 'VariableDeclaration',
        kind: 'let',
        loc: loc,
        declarations: [{
          type: 'VariableDeclarator',
          id: { type: 'Identifier', name: name },
          init: { type: 'NewExpression', callee: { type: 'Identifier', name: className } }
        }]
      };

      return node;
    }

    /**
     * flatten name of MemberExpression.
     * @param {ASTNode} memberExpression - MemberExpression Node.
     * @returns {string} flatten node name.
     */
  }, {
    key: 'flattenMemberExpression',
    value: function flattenMemberExpression(memberExpression) {
      var names = [];
      var object = memberExpression;
      while (object) {
        if (object.name) {
          names.push(object.name);
          break;
        } else {
          names.push(object.property.name);
          object = object.object;
        }
      }
      return names.reverse().join('.');
    }
  }]);

  return ASTUtil;
})();

exports['default'] = ASTUtil;
module.exports = exports['default'];


text:
Client PHP for accessing Gravity Forms Web API

## Installation
```bash
composer require garypegeot/gravity-forms-api-client
```

## Usage
```php
use GaryPEGEOT\GravityFormsAPI\Client;

$url = 'http://www.example.com';
$key = '123abcdef';
$secret = '12345789';
$client = new Client($url, $key, $secret);
$entries = $client->getFormEntries(1);
var_dump($entries);
```

redpajama_set_name: RedPajamaGithub


text:
package org.neo4j.server.rest.security;

/**
 * <p>
 * A runtime exception representing a failure to provide correct authentication
 * credentials.
 * </p>
 */
public class AuthenticationException extends RuntimeException
{

    private static final long serialVersionUID = 3662922094534872711L;

    private final String realm;

    public AuthenticationException( String msg, String realm )
    {
        super( msg );
        this.realm = realm;
    }

    public String getRealm()
    {
        return this.realm;
    }

}


text:
<?php

require_once dirname(__FILE__) . '/AbstractTest.php';

/**
 * Test case for bug #15.
 *
 * @category   PHP
 * @package    PHP_Depend
 * @subpackage Bugs
 * @author     Manuel Pichler <mapi@pdepend.org>
 * @copyright  2008-2012 Manuel Pichler. All rights reserved.
 * @license    http://www.opensource.org/licenses/bsd-license.php  BSD License
 * @version    Release: @package_version@
 * @link       https://pdepend.org
 *
 * @ticket 15
 * @covers stdClass
 * @group pdepend
 * @group pdepend::bugs
 * @group regressiontest
 */
class PHP_Depend_Bugs_ParserBug015Test extends PHP_Depend_Bugs_AbstractTest
{
    /**
     * Tests that the parser ignores backtick expressions.
     *
     * http://bugs.xplib.de/index.php?do=details&task_id=15&project=3
     *
     * @return void
     */
    public function testParserBacktickExpression()
    {
        $package = self::parseCodeResourceForTest()->current();
        $classes = $package->getClasses();
        $methods = $classes->current()->getMethods();

        self::assertEquals(
            array('classes' => 1, 'methods' => 1),
            array('classes' => $classes->count(), 'methods' => $methods->count())
        );
    }
}


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

import com.fasterxml.jackson.annotation.JsonProperty;
import org.hibernate.validator.constraints.NotEmpty;
import org.hyperledger.api.BCSAPI;
import org.hyperledger.connector.BCSAPIClient;
import org.hyperledger.dropwizard.HyperLedgerConfiguration;
import org.hyperledger.dropwizard.ManagedBCSAPI;
import org.hyperledger.jms.JMSConnectorFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class JMSConnectedHyperLedger implements HyperLedgerConfiguration {
    private static final Logger log = LoggerFactory.getLogger(JMSConnectedHyperLedger.class);

    @JsonProperty
    @NotEmpty
    private String brokerUrl;

    @JsonProperty
    private String username;

    @JsonProperty
    private String password;

    @Override
    public ManagedBCSAPI createBCSAPI() {
        return new ManagedBCSAPI() {
            BCSAPIClient api;// = new BCSAPIClient ();

            @Override
            public void start() throws Exception {
                log.info("Connecting to HyperLedger via JMS " + brokerUrl);
                api = new BCSAPIClient(new JMSConnectorFactory(username, password, brokerUrl));
                api.init();
            }

            @Override
            public void stop() throws Exception {
            }

            @Override
            public BCSAPI getBCSAPI() {
                return api;
            }
        };
    }

    public String getBrokerUrl() {
        return brokerUrl;
    }

    public void setBrokerUrl(String brokerUrl) {
        this.brokerUrl = brokerUrl;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}


text:
package cmd

import (
	"log"

	"github.com/spf13/cobra"
)

// groupsCmd represents the groups command
var groupsCmd = &cobra.Command{
	Use:   "groups",
	Short: "Get available device groups",
	Long:  `Get a list of device groups.`,
	Run: func(cmd *cobra.Command, args []string) {
		groups, err := domus.GetGroups()
		if err != nil {
			log.Fatal(err)
		}
		if len(groups) < 1 {
			log.Fatal("No groups found, are site and userid correct?")
		}
		output(outputFormat, groups)
	},
}

func init() {
	getCmd.AddCommand(groupsCmd)
}


text:
<template name="collapsible">

    {{#each items}}

          {{#if icon}}
            {{> icon name=icon.name backgroundColor=icon.backgroundColor textColor=icon.textColor}}
          {{/if}}
          {{title}}

{{content}}

    {{/each}}

</template>


text:
/* JSHint strict mode tweak */
/*jshint globalstrict: true, devel: true, browser: true */
/*global $, _, amplify, angular, ya, helpers, app */
'use strict';

app.directive('autofocus', function () {
  return {
    restrict: 'A',
    link: function (scope, element) {
      element[0].focus();
    }
  };
});

app.directive('bsDropdown', function ($compile) {
    return {
        restrict: 'E',
        scope: {
            items: '=dropdownData',
            doSelect: '&selectVal',
            selectedItem: '=preselectedItem'
        },
        link: function (scope, element, attrs) {
            var html = '';
            switch (attrs.menuType) {
                case "button":
                    html += '
<button class="btn button-label btn-info">Action</button><button class="btn btn-info dropdown-toggle" data-toggle="dropdown"></button>';
                    break;
                default:
                    html += '
Dropdown';
                    break;
            }
            html += '

{{item.name}}

';
            element.append($compile(html)(scope));
            for (var i = 0; i < scope.items.length; i++) {
                if (scope.items[i].id === scope.selectedItem) {
                    scope.bSelectedItem = scope.items[i];
                    break;
                }
            }
            scope.selectVal = function (item) {
                switch (attrs.menuType) {
                    case "button":
                        $('button.button-label', element).html(item.name);
                        break;
                    default:
                        $('a.dropdown-toggle', element).html(' ' + item.name);
                        break;
                }
                scope.doSelect({
                    selectedVal: item
                });
            };
            scope.selectVal(scope.bSelectedItem);
        }
    };
});


text:
<?php

namespace spec\PhpSpec\Util;

use PhpSpec\Exception\Example\SkippingException;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;

class MethodAnalyserSpec extends ObjectBehavior
{
    function it_identifies_empty_methods_as_empty()
    {
        $this->methodIsEmpty('spec\PhpSpec\Util\ExampleObject', 'emptyMethod')->shouldReturn(true);
        $this->methodIsEmpty('spec\PhpSpec\Util\ExampleObject', 'emptyMethod2')->shouldReturn(true);
    }

    function it_identifies_commented_methods_as_empty()
    {
        $this->methodIsEmpty('spec\PhpSpec\Util\ExampleObject', 'commentedMethod')->shouldReturn(true);
    }

    function it_identifies_methods_with_code_as_not_empty()
    {
        $this->methodIsEmpty('spec\PhpSpec\Util\ExampleObject', 'nonEmptyMethod')->shouldReturn(false);
    }

    function it_identifies_methods_without_standard_braces_as_non_empty()
    {
        $this->methodIsEmpty('spec\PhpSpec\Util\ExampleObject', 'nonEmptyOneLineMethod')->shouldReturn(false);
        $this->methodIsEmpty('spec\PhpSpec\Util\ExampleObject', 'nonEmptyOneLineMethod2')->shouldReturn(false);
        $this->methodIsEmpty('spec\PhpSpec\Util\ExampleObject', 'nonEmptyOneLineMethod3')->shouldReturn(false);
        $this->methodIsEmpty('spec\PhpSpec\Util\ExampleObject', 'nonEmptyMethod2')->shouldReturn(false);
    }

    function it_identifies_internal_classes_as_non_empty()
    {
        $this->methodIsEmpty('DateTimeZone', 'getOffset')->shouldReturn(false);
    }

    function it_identifies_methods_from_traits()
    {
        if (version_compare(PHP_VERSION, '5.4.0', '<')) {
            throw new SkippingException('Traits implemented since PHP 5.4');
        }

        $this->methodIsEmpty('spec\PhpSpec\Util\ExampleObjectUsingTrait', 'emptyMethodInTrait')->shouldReturn(true);
        $this->methodIsEmpty('spec\PhpSpec\Util\ExampleObjectUsingTrait', 'nonEmptyMethodInTrait')->shouldReturn(false);
    }

    function it_finds_the_real_declaring_class_of_a_method()
    {
        if (version_compare(PHP_VERSION, '5.4.0', '<')) {
            throw new SkippingException('Traits implemented since PHP 5.4');
        }

        $this->getMethodOwnerName('spec\PhpSpec\Util\ExampleObjectUsingTrait', 'emptyMethodInTrait')
            ->shouldReturn('spec\PhpSpec\Util\ExampleTrait');
    }
}

class ExampleObject
{
    public function emptyMethod() {}

    public function emptyMethod2()
    {}

    public function commentedMethod()
    {
        /**
         * this is a comment
         */

        // This is a comment

        /* this is a comment {} */
    }

    public function nonEmptyMethod()
    {
        /**
         * a comment to fool us
         */
        $variable = true;
        // another comment
    }

    public function nonEmptyMethod2() { return 'foo';
    }

    public function nonEmptyOneLineMethod() { return 'foo'; }

    public function nonEmptyOneLineMethod2()
    { return 'foo'; }

    public function nonEmptyOneLineMethod3() {
        return 'foo';
    }
}


text:
A JavaScript library that turns images into ascii art.

## Demo

Clone this repo and navigate to the `demo` directory in your browser, which contains file input and realtime webcam examples.

## How to use it

All you have to do is `new Asciify(image, options)`. This returns an `Asciify` instance which has the method `asciify()`, which computes and returns the output string.

### `new Asciify(image, options)`

#### `image`

| type | required? | description |
|------|-----------|-------------|
| `Image` or `HTMLCanvasElement` or `HTMLImageElement` or `HTMLVideoElement` | yes | The image to turn into ascii art. |

#### `options`

| type | required? |
|------|-----------|
| `Object` | no |

##### Properties of `options`

| key | type | required? | description | default |
|-----|------|-----------|-------------|---------|
| **`width`** | `Number` | no | The width of the output ascii art in characters. | `100` |
| **`map`** | `String` | no | A string describing which characters maps to which brightness. [More about this](#optionsmap) | `Asciify.maps.TEN` |
| **`resolutionY`** | `Number` | no | How much the image should be shrunk vertically to account for output line height | `0.6` |
| **`html`** | `Boolean` | no | Whether to output `"<br>"` and `" "` in place of `"\n"` and `" "`, respectively | `false` |
| **`transparencyAsWhite`** | `Boolean` | no | Whether to treat transparency as white; in other words, to draw the image on top of a white background then compute using that | `false` |

##### `options.map`

This is a string that defines which character should represent which brightness of the image. This string can be of any length. It starts with lowest brightness and ends with highest brightness.

These are some of the maps that Asciify comes with (note the spaces at the ends):

| name | map |
|------|-----|
| `Asciify.maps.TEN` | `"@#%*+=-:. "` |
| `Asciify.maps.FIVE` | `"@=:. "` |
| `Asciify.maps.TWO` | `"@ "` |

They are stored in `Asciify.maps`.

### `Asciify.defaults`

Asciify's defaults are stored here. You can change them here to be used in subsequent instances of `Asciify`.

## Examples

```javascript
let imageElem = document.getElementById("myimage")
let asc = new Asciify(imageElem, {
  width: 500,
  resolutionY: 1,
  map: " .:-=+*%#@" // inverted colors
})
let asciified = asc.asciify() // output
```

There are a file input example and a realtime webcam example in the `demo` directory.


text:
package org.springframework.boot.autoconfigure.mustache.web;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration;
import org.springframework.boot.autoconfigure.mustache.MustacheAutoConfiguration;
import org.springframework.boot.autoconfigure.mustache.MustacheResourceTemplateLoader;
import org.springframework.boot.autoconfigure.mustache.web.MustacheView;
import org.springframework.boot.autoconfigure.mustache.web.MustacheViewResolver;
import org.springframework.boot.autoconfigure.mustache.web.MustacheWebIntegrationTests.Application;
import org.springframework.boot.autoconfigure.web.DispatcherServletAutoConfiguration;
import org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration;
import org.springframework.boot.autoconfigure.web.ServerPropertiesAutoConfiguration;
import org.springframework.boot.context.embedded.EmbeddedWebApplicationContext;
import org.springframework.boot.test.IntegrationTest;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.boot.test.TestRestTemplate;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.stereotype.Controller;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.web.bind.annotation.RequestMapping;

import com.samskivert.mustache.Mustache;
import com.samskivert.mustache.Template;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

/**
 * Integration Tests for {@link MustacheAutoConfiguration}, {@link MustacheViewResolver}
 * and {@link MustacheView}.
 *
 * @author Dave Syer
 */
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = Application.class)
@IntegrationTest("server.port:0")
@WebAppConfiguration
public class MustacheWebIntegrationTests {

	@Autowired
	private EmbeddedWebApplicationContext context;
	private int port;

	@Before
	public void init() {
		this.port = this.context.getEmbeddedServletContainer().getPort();
	}

	@Test
	public void contextLoads() {
		String source = "Hello {{arg}}!";
		Template tmpl = Mustache.compiler().compile(source);
		Map<String, String> context = new HashMap<String, String>();
		context.put("arg", "world");
		assertEquals("Hello world!", tmpl.execute(context)); // returns "Hello world!"
	}

	@Test
	public void testHomePage() throws Exception {
		String body = new TestRestTemplate().getForObject(
				"http://localhost:" + this.port, String.class);
		assertTrue(body.contains("Hello World"));
	}

	@Test
	public void testPartialPage() throws Exception {
		String body = new TestRestTemplate().getForObject("http://localhost:" + this.port
				+ "/partial", String.class);
		assertTrue(body.contains("Hello World"));
	}

	@Target(ElementType.TYPE)
	@Retention(RetentionPolicy.RUNTIME)
	@Documented
	@Import({ EmbeddedServletContainerAutoConfiguration.class,
			ServerPropertiesAutoConfiguration.class,
			DispatcherServletAutoConfiguration.class,
			PropertyPlaceholderAutoConfiguration.class })
	protected @interface MinimalWebConfiguration {
	}

	@Configuration
	@MinimalWebConfiguration
	@Controller
	public static class Application {

		@RequestMapping("/")
		public String home(Map<String, Object> model) {
			model.put("time", new Date());
			model.put("message", "Hello World");
			model.put("title", "Hello App");
			return "home";
		}

		@RequestMapping("/partial")
		public String layout(Map<String, Object> model) {
			model.put("time", new Date());
			model.put("message", "Hello World");
			model.put("title", "Hello App");
			return "partial";
		}

		@Bean
		public MustacheViewResolver viewResolver() {
			MustacheViewResolver resolver = new MustacheViewResolver();
			resolver.setPrefix("classpath:/mustache-templates/");
			resolver.setSuffix(".html");
			resolver.setCompiler(Mustache.compiler().withLoader(
					new MustacheResourceTemplateLoader("classpath:/mustache-templates/",
							".html")));
			return resolver;
		}

		public static void main(String[] args) {
			SpringApplication.run(Application.class, args);
		}

	}

}


text:
.class public final Landroid/provider/CalendarContract$CalendarAlerts;
.super Ljava/lang/Object;
.source "CalendarContract.java"

# interfaces
.implements Landroid/provider/BaseColumns;
.implements Landroid/provider/CalendarContract$CalendarAlertsColumns;
.implements Landroid/provider/CalendarContract$EventsColumns;
.implements Landroid/provider/CalendarContract$CalendarColumns;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/provider/CalendarContract;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x19
    name = "CalendarAlerts"
.end annotation

# static fields
.field public static final CONTENT_URI:Landroid/net/Uri; = null

.field public static final CONTENT_URI_BY_INSTANCE:Landroid/net/Uri; = null

.field private static final DEBUG:Z = false

.field private static final SORT_ORDER_ALARMTIME_ASC:Ljava/lang/String; = "alarmTime ASC"

.field public static final TABLE_NAME:Ljava/lang/String; = "CalendarAlerts"

.field private static final WHERE_ALARM_EXISTS:Ljava/lang/String; = "event_id=? AND begin=? AND alarmTime=?"

.field private static final WHERE_FINDNEXTALARMTIME:Ljava/lang/String; = "alarmTime>=?"

.field private static final WHERE_RESCHEDULE_MISSED_ALARMS:Ljava/lang/String; = "state=0 AND alarmTime<? AND alarmTime>? AND end>=?"

# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 2212
    const-string v0, "content://com.android.calendar/calendar_alerts"

    invoke-static {v0}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v0

    sput-object v0, Landroid/provider/CalendarContract$CalendarAlerts;->CONTENT_URI:Landroid/net/Uri;

    .line 2238
    const-string v0, "content://com.android.calendar/calendar_alerts/by_instance"

    invoke-static {v0}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v0

    sput-object v0, Landroid/provider/CalendarContract$CalendarAlerts;->CONTENT_URI_BY_INSTANCE:Landroid/net/Uri;

    return-void
.end method

.method private constructor <init>()V
    .locals 0

    .prologue
    .line 2218
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static final alarmExists(Landroid/content/ContentResolver;JJJ)Z
    .locals 9
    .parameter "cr"
    .parameter "eventId"
    .parameter "begin"
    .parameter "alarmTime"

    .prologue
    const/4 v8, 0x1

    const/4 v5, 0x0

    .line 2403
    new-array v2, v8, [Ljava/lang/String;

    const-string v0, "alarmTime"

    aput-object v0, v2, v5

    .line 2404
    .local v2, projection:[Ljava/lang/String;
    sget-object v1, Landroid/provider/CalendarContract$CalendarAlerts;->CONTENT_URI:Landroid/net/Uri;

    const-string v3, "event_id=? AND begin=? AND alarmTime=?"

    const/4 v0, 0x3

    new-array v4, v0, [Ljava/lang/String;

    invoke-static {p1, p2}, Ljava/lang/Long;->toString(J)Ljava/lang/String;

    move-result-object v0

    aput-object v0, v4, v5

    invoke-static {p3, p4}, Ljava/lang/Long;->toString(J)Ljava/lang/String;

    move-result-object v0

    aput-object v0, v4, v8

    const/4 v0, 0x2

    invoke-static {p5, p6}, Ljava/lang/Long;->toString(J)Ljava/lang/String;

    move-result-object v5

    aput-object v5, v4, v0

    const/4 v5, 0x0

    move-object v0, p0

    invoke-virtual/range {v0 .. v5}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v6

    .line 2408
    .local v6, cursor:Landroid/database/Cursor;
    const/4 v7, 0x0

    .line 2410
    .local v7, found:Z
    if-eqz v6, :cond_0

    :try_start_0
    invoke-interface {v6}, Landroid/database/Cursor;->getCount()I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result v0

    if-lez v0, :cond_0

    .line 2411
    const/4 v7, 0x1

    .line 2414
    :cond_0
    if-eqz v6, :cond_1

    .line 2415
    invoke-interface {v6}, Landroid/database/Cursor;->close()V

    .line 2418
    :cond_1
    return v7

    .line 2414
    :catchall_0
    move-exception v0

    if-eqz v6, :cond_2

    .line 2415
    invoke-interface {v6}, Landroid/database/Cursor;->close()V

    .line 2414
    :cond_2
    throw v0
.end method

.method public static final findNextAlarmTime(Landroid/content/ContentResolver;J)J
    .locals 10
    .parameter "cr"
    .parameter "millis"

    .prologue
    const/4 v4, 0x1

    const/4 v5, 0x0

    .line 2278
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "alarmTime>="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0, p1, p2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v9

    .line 2281
    .local v9, selection:Ljava/lang/String;
    new-array v2, v4, [Ljava/lang/String;

    const-string v0, "alarmTime"

    aput-object v0, v2, v5

    .line 2282
    .local v2, projection:[Ljava/lang/String;
    sget-object v1, Landroid/provider/CalendarContract$CalendarAlerts;->CONTENT_URI:Landroid/net/Uri;

    const-string v3, "alarmTime>=?"

    new-array v4, v4, [Ljava/lang/String;

    invoke-static {p1, p2}, Ljava/lang/Long;->toString(J)Ljava/lang/String;

    move-result-object v0

    aput-object v0, v4, v5

    const-string v5, "alarmTime ASC"

    move-object v0, p0

    invoke-virtual/range {v0 .. v5}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v8

    .line 2286
    .local v8, cursor:Landroid/database/Cursor;
    const-wide/16 v6, -0x1

    .line 2288
    .local v6, alarmTime:J
    if-eqz v8, :cond_0

    :try_start_0
    invoke-interface {v8}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 2289
    const/4 v0, 0x0

    invoke-interface {v8, v0}, Landroid/database/Cursor;->getLong(I)J
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result-wide v6

    .line 2292
    :cond_0
    if-eqz v8, :cond_1

    .line 2293
    invoke-interface {v8}, Landroid/database/Cursor;->close()V

    .line 2296
    :cond_1
    return-wide v6

    .line 2292
    :catchall_0
    move-exception v0

    if-eqz v8, :cond_2

    .line 2293
    invoke-interface {v8}, Landroid/database/Cursor;->close()V

    .line 2292
    :cond_2
    throw v0
.end method

.method public static final insert(Landroid/content/ContentResolver;JJJJI)Landroid/net/Uri;
    .locals 6
    .parameter "cr"
    .parameter "eventId"
    .parameter "begin"
    .parameter "end"
    .parameter "alarmTime"
    .parameter "minutes"

    .prologue
    const/4 v5, 0x0

    .line 2251
    new-instance v2, Landroid/content/ContentValues;

    invoke-direct {v2}, Landroid/content/ContentValues;-><init>()V

    .line 2252
    .local v2, values:Landroid/content/ContentValues;
    const-string v3, "event_id"

    invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v4

    invoke-virtual {v2, v3, v4}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Long;)V

    .line 2253
    const-string v3, "begin"

    invoke-static {p3, p4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v4

    invoke-virtual {v2, v3, v4}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Long;)V

    .line 2254
    const-string v3, "end"

    invoke-static {p5, p6}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v4

    invoke-virtual {v2, v3, v4}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Long;)V

    .line 2255
    const-string v3, "alarmTime"

    invoke-static {p7, p8}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v4

    invoke-virtual {v2, v3, v4}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Long;)V

    .line 2256
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    .line 2257
    .local v0, currentTime:J
    const-string v3, "creationTime"

    invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v4

    invoke-virtual {v2, v3, v4}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Long;)V

    .line 2258
    const-string/jumbo v3, "receivedTime"

    invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v4

    invoke-virtual {v2, v3, v4}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 2259
    const-string/jumbo v3, "notifyTime"

    invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v4

    invoke-virtual {v2, v3, v4}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 2260
    const-string/jumbo v3, "state"

    invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v4

    invoke-virtual {v2, v3, v4}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 2261
    const-string/jumbo v3, "minutes"

    invoke-static {p9}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v4

    invoke-virtual {v2, v3, v4}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 2262
    sget-object v3, Landroid/provider/CalendarContract$CalendarAlerts;->CONTENT_URI:Landroid/net/Uri;

    invoke-virtual {p0, v3, v2}, Landroid/content/ContentResolver;->insert(Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri;

    move-result-object v3

    return-object v3
.end method

.method public static final rescheduleMissedAlarms(Landroid/content/ContentResolver;Landroid/content/Context;Landroid/app/AlarmManager;)V
    .locals 17
    .parameter "cr"
    .parameter "context"
    .parameter "manager"

    .prologue
    .line 2314
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v15

    .line 2315
    .local v15, now:J
    const-wide/32 v2, 0x5265c00

    sub-long v10, v15, v2

    .line 2316
    .local v10, ancient:J
    const/4 v2, 0x1

    new-array v4, v2, [Ljava/lang/String;

    const/4 v2, 0x0

    const-string v3, "alarmTime"

    aput-object v3, v4, v2

    .line 2322
    .local v4, projection:[Ljava/lang/String;
    sget-object v3, Landroid/provider/CalendarContract$CalendarAlerts;->CONTENT_URI:Landroid/net/Uri;

    const-string/jumbo v5, "state=0 AND alarmTime<? AND alarmTime>? AND end>=?"

    const/4 v2, 0x3

    new-array v6, v2, [Ljava/lang/String;

    const/4 v2, 0x0

    invoke-static/range {v15 .. v16}, Ljava/lang/Long;->toString(J)Ljava/lang/String;

    move-result-object v7

    aput-object v7, v6, v2

    const/4 v2, 0x1

    invoke-static {v10, v11}, Ljava/lang/Long;->toString(J)Ljava/lang/String;

    move-result-object v7

    aput-object v7, v6, v2

    const/4 v2, 0x2

    invoke-static/range {v15 .. v16}, Ljava/lang/Long;->toString(J)Ljava/lang/String;

    move-result-object v7

    aput-object v7, v6, v2

    const-string v7, "alarmTime ASC"

    move-object/from16 v2, p0

    invoke-virtual/range {v2 .. v7}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v12

    .line 2326
    .local v12, cursor:Landroid/database/Cursor;
    if-nez v12, :cond_0

    .line 2350
    :goto_0
    return-void

    .line 2335
    :cond_0
    const-wide/16 v8, -0x1

    .line 2337
    .local v8, alarmTime:J
    :cond_1
    :goto_1
    :try_start_0
    invoke-interface {v12}, Landroid/database/Cursor;->moveToNext()Z

    move-result v2

    if-eqz v2, :cond_2

    .line 2338
    const/4 v2, 0x0

    invoke-interface {v12, v2}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v13

    .line 2339
    .local v13, newAlarmTime:J
    cmp-long v2, v8, v13

    if-eqz v2, :cond_1

    .line 2343
    move-object/from16 v0, p1

    move-object/from16 v1, p2

    invoke-static {v0, v1, v13, v14}, Landroid/provider/CalendarContract$CalendarAlerts;->scheduleAlarm(Landroid/content/Context;Landroid/app/AlarmManager;J)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 2344
    move-wide v8, v13

    goto :goto_1

    .line 2348
    .end local v13           #newAlarmTime:J
    :catchall_0
    move-exception v2

    invoke-interface {v12}, Landroid/database/Cursor;->close()V

    throw v2

    :cond_2
    invoke-interface {v12}, Landroid/database/Cursor;->close()V

    goto :goto_0
.end method

.method public static scheduleAlarm(Landroid/content/Context;Landroid/app/AlarmManager;J)V
    .locals 4
    .parameter "context"
    .parameter "manager"
    .parameter "alarmTime"

    .prologue
    const/4 v3, 0x0

    .line 2374
    if-nez p1, :cond_0

    .line 2375
    const-string v2, "alarm"

    invoke-virtual {p0, v2}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object p1

    .end local p1
    check-cast p1, Landroid/app/AlarmManager;

    .line 2378
    .restart local p1
    :cond_0
    new-instance v0, Landroid/content/Intent;

    const-string v2, "android.intent.action.EVENT_REMINDER"

    invoke-direct {v0, v2}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 2379
    .local v0, intent:Landroid/content/Intent;
    sget-object v2, Landroid/provider/CalendarContract;->CONTENT_URI:Landroid/net/Uri;

    invoke-static {v2, p2, p3}, Landroid/content/ContentUris;->withAppendedId(Landroid/net/Uri;J)Landroid/net/Uri;

    move-result-object v2

    invoke-virtual {v0, v2}, Landroid/content/Intent;->setData(Landroid/net/Uri;)Landroid/content/Intent;

    .line 2380
    const-string v2, "alarmTime"

    invoke-virtual {v0, v2, p2, p3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;J)Landroid/content/Intent;

    .line 2381
    invoke-static {p0, v3, v0, v3}, Landroid/app/PendingIntent;->getBroadcast(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;

    move-result-object v1

    .line 2382
    .local v1, pi:Landroid/app/PendingIntent;
    invoke-virtual {p1, v3, p2, p3, v1}, Landroid/app/AlarmManager;->set(IJLandroid/app/PendingIntent;)V

    .line 2383
    return-void
.end method


text:
Build for local:
```zsh
go build ./cmd/raspilive
```

Build for Raspberry Pi:
```zsh
env GOOS=linux GOARCH=arm GOARM=6 go build ./cmd/raspilive
```

Go install command:
```zsh
go install github.com/jaredpetersen/raspilive/cmd/raspilive
```

Run tests:
```zsh
go test ./...
go test ./... -v
go test ./... -cover
```

Copy binary from localhost to the Raspberry Pi:
```zsh
scp raspilive pi@raspberrypi:/home/pi
```


text:
require 'spec_helper'

describe Autocomplete::UsersFinder do
  describe '#execute' do
    let!(:user1) { create(:user, username: 'johndoe') }
    let!(:user2) { create(:user, :blocked, username: 'notsorandom') }
    let!(:external_user) { create(:user, :external) }
    let!(:omniauth_user) { create(:omniauth_user, provider: 'twitter', extern_uid: '123456') }
    let(:current_user) { create(:user) }
    let(:params) { {} }

    let(:project) { nil }
    let(:group) { nil }

    subject { described_class.new(params: params, current_user: current_user, project: project, group: group).execute.to_a }

    context 'when current_user not passed or nil' do
      let(:current_user) { nil }

      it { is_expected.to match_array([]) }
    end

    context 'when project passed' do
      let(:project) { create(:project) }

      it { is_expected.to match_array([project.owner]) }

      context 'when author_id passed' do
        let(:params) { { author_id: user2.id } }

        it { is_expected.to match_array([project.owner, user2]) }
      end
    end

    context 'when group passed and project not passed' do
      let(:group) { create(:group, :public) }

      before do
        group.add_users([user1], GroupMember::DEVELOPER)
      end

      it { is_expected.to match_array([user1]) }
    end

    context 'when passed a subgroup', :nested_groups do
      let(:grandparent) { create(:group, :public) }
      let(:parent) { create(:group, :public, parent: grandparent) }
      let(:child) { create(:group, :public, parent: parent) }
      let(:group) { parent }

      let!(:grandparent_user) { create(:group_member, :developer, group: grandparent).user }
      let!(:parent_user) { create(:group_member, :developer, group: parent).user }
      let!(:child_user) { create(:group_member, :developer, group: child).user }

      it 'includes users from parent groups as well' do
        expect(subject).to match_array([grandparent_user, parent_user])
      end
    end

    it { is_expected.to match_array([user1, external_user, omniauth_user, current_user]) }

    context 'when filtered by search' do
      let(:params) { { search: 'johndoe' } }

      it { is_expected.to match_array([user1]) }
    end

    context 'when filtered by skip_users' do
      let(:params) { { skip_users: [omniauth_user.id, current_user.id] } }

      it { is_expected.to match_array([user1, external_user]) }
    end

    context 'when todos exist' do
      let!(:pending_todo1) { create(:todo, user: current_user, author: user1, state: :pending) }
      let!(:pending_todo2) { create(:todo, user: external_user, author: omniauth_user, state: :pending) }
      let!(:done_todo1) { create(:todo, user: current_user, author: external_user, state: :done) }
      let!(:done_todo2) { create(:todo, user: user1, author: external_user, state: :done) }

      context 'when filtered by todo_filter without todo_state_filter' do
        let(:params) { { todo_filter: true } }

        it { is_expected.to match_array([]) }
      end

      context 'when filtered by todo_filter with pending todo_state_filter' do
        let(:params) { { todo_filter: true, todo_state_filter: 'pending' } }

        it { is_expected.to match_array([user1]) }
      end

      context 'when filtered by todo_filter with done todo_state_filter' do
        let(:params) { { todo_filter: true, todo_state_filter: 'done' } }

        it { is_expected.to match_array([external_user]) }
      end
    end

    context 'when filtered by current_user' do
      let(:current_user) { user2 }
      let(:params) { { current_user: true } }

      it { is_expected.to match_array([user2, user1, external_user, omniauth_user]) }
    end

    context 'when filtered by author_id' do
      let(:params) { { author_id: user2.id } }

      it { is_expected.to match_array([user2, user1, external_user, omniauth_user, current_user]) }
    end
  end
end


text:
layout: page
title: Edge Sub Networks Party
date: 2016-05-24
author: Jacqueline Baxter
tags: weekly links, java
status: published
summary: Vivamus nulla lectus, varius id luctus a, ultricies quis.
banner: images/banner/wedding.jpg
booking:
  startDate: 03/12/2019
  endDate: 03/14/2019
  ctyhocn: LITBLHX
  groupCode: ESNP
published: true
---
Praesent eu urna porttitor, bibendum tortor ac, venenatis odio. Vestibulum ultrices mi in eros vehicula, id sodales ipsum pretium. In justo augue, mollis a finibus nec, ullamcorper auctor dolor. Praesent vehicula nibh id sapien iaculis, sit amet lobortis quam rhoncus. Integer gravida sem leo, quis eleifend erat semper non. Donec congue ligula ac hendrerit blandit. Morbi id dui tellus. Sed et tincidunt sem. Ut volutpat congue ligula et hendrerit.

* Praesent accumsan metus ac magna consectetur, quis congue risus fermentum
* Suspendisse vehicula ante a nunc porttitor, ac ultricies libero tristique.

Vestibulum non ligula est. Sed ornare felis sit amet sapien imperdiet, viverra consequat dolor pellentesque. Quisque iaculis sapien quis pharetra tincidunt. Praesent posuere augue at nunc mollis condimentum. Curabitur ac gravida velit, ut maximus nibh. Nam orci orci, bibendum ac turpis vel, maximus eleifend neque. In facilisis interdum mauris. Aenean in rutrum magna.


text:
using Microsoft.Extensions.Localization;

namespace Orchard.ContentManagement {
    public interface IUpdateModel {
        bool TryUpdateModel<TModel>(TModel model, string prefix, string[] includeProperties, string[] excludeProperties) where TModel : class;
        void AddModelError(string key, LocalizedString errorMessage);
    }
}


text:
typedef uint64_t GBAbsoluteTime;

static inline GBAbsoluteTime
GetCurrentTime()
{
    return mach_absolute_time();
}

static inline NSTimeInterval
SubtractTime( GBAbsoluteTime uiEndTime, GBAbsoluteTime uiStartTime )
{
	static NSTimeInterval convertion = 0.0;
	GBAbsoluteTime uiDifference = uiEndTime - uiStartTime;
	if( 0 == convertion )
	{
		mach_timebase_info_data_t kTimebase;
		kern_return_t kError = mach_timebase_info( &kTimebase );
		if( kError == 0  )
			convertion = 1e-9 * (NSTimeInterval) kTimebase.numer / (NSTimeInterval) kTimebase.denom;
    }
	return convertion * (NSTimeInterval) uiDifference;
}

#endif


text:
import moment from 'moment';
import { configure, addDecorator } from '@storybook/react';

addDecorator((story) => {
  moment.locale('zh-cn');
  return (story());
});

function loadStories() {
  require('../stories/Button');
  require('../stories/Form');
  require('../stories/ShortMessage');
  require('../stories/Message');
  require('../stories/Tipso');
  require('../stories/Loading');
  require('../stories/Card');
  require('../stories/Slider');
  require('../stories/Label');
  require('../stories/Switcher');
  require('../stories/CustomSelector');
  require('../stories/Dropdown');
}

configure(loadStories, module);


text:
- Minor system setup bug fixes.
- Bugfix: Not entering anything in the settings with now default to running the open file again.

## 1.1.0
---
### Removed
- TCC: Set flags...
### Added
- Settings option: TCC.flags
- Settings option: TCC.args

You can now set custom build and run settings for each workspace in the settings file.
If the settings are not set, it'll simply run or compile the currently open c file.

## 1.0.1 - 1.0.4
---
- Fixed readme installation guide
- Added build status for development branch
- Changelog created.
- Readme updated with license information
- Readme updated with command information

## 1.0.0
---
### Added
- TCC: Run
- TCC: Compile
- TCC: Set flags...


text:
<!DOCTYPE html>

    <meta http-equiv="refresh" content="0;URL=../../../libc/constant.IPOPT_RESERVED2.html">

Redirecting to ../../../libc/constant.IPOPT_RESERVED2.html...


text:
package com.safety.service;
import java.io.IOException;

import org.snmp4j.PDU;
import org.snmp4j.event.ResponseEvent;
import org.snmp4j.smi.OID;
import org.snmp4j.smi.VariableBinding;

import com.safety.util.OidHelper;
import com.safety.util.SnmpHelper;

public class SnmpCheckService {
	private SnmpHelper snmpHelper = null;
	private String addr = null;

	public SnmpCheckService(SnmpHelper snmpHelper, String addr) {
		this.snmpHelper = snmpHelper;
		this.addr = addr;
	}

	public ResponseEvent getSysInfo() throws IOException {
		PDU pdu = new PDU();
		OidHelper oidHelper = OidHelper.getOidHelper();
		String sysDesc = oidHelper.getOid("sysInfo", "SysDesc");
		String sysUptime = oidHelper.getOid("sysInfo", "sysUptime");
		pdu.add(new VariableBinding(new OID(sysDesc)));
		pdu.add(new VariableBinding(new OID(sysUptime)));
		pdu.setType(PDU.GET);
		ResponseEvent response = snmpHelper.sendMessage(pdu, addr);
		return response;
	}

	public ResponseEvent getCpuInfo() throws IOException{
		PDU pdu = new PDU();
		OidHelper oidHelper = OidHelper.getOidHelper();
		String ssCpuUser = oidHelper.getOid("cpuInfo", "ssCpuUser");
		String ssCpuSystem = oidHelper.getOid("cpuInfo", "ssCpuUser");
		String ssCpuIdle = oidHelper.getOid("cpuInfo", "ssCpuUser");
		pdu.add(new VariableBinding(new OID(ssCpuUser)));
		pdu.add(new VariableBinding(new OID(ssCpuSystem)));
		pdu.add(new VariableBinding(new OID(ssCpuIdle)));
		pdu.setType(PDU.GET);
		ResponseEvent response = snmpHelper.sendMessage(pdu, addr);
		return response;
	}
	public ResponseEvent getSwapAndDiskInfo() throws IOException{
		PDU pdu = new PDU();
		OidHelper oidHelper = OidHelper.getOidHelper();
		String memTotalReal = oidHelper.getOid("swapAndDisk", "memTotalReal");
		String memAvailReal = oidHelper.getOid("swapAndDisk", "memAvailReal");
		String memTotalFree = oidHelper.getOid("swapAndDisk", "memTotalFree");
		String dskTotal = oidHelper.getOid("swapAndDisk", "dskTotal");
		String dskAvail = oidHelper.getOid("swapAndDisk", "dskAvail");
		String dskUsed = oidHelper.getOid("swapAndDisk", "dskUsed");
		String dskPercent = oidHelper.getOid("swapAndDisk", "dskPercent");
		pdu.add(new VariableBinding(new OID(memTotalReal)));
		pdu.add(new VariableBinding(new OID(memAvailReal)));
		pdu.add(new VariableBinding(new OID(memTotalFree)));
		pdu.add(new VariableBinding(new OID(dskTotal)));
		pdu.add(new VariableBinding(new OID(dskAvail)));
		pdu.add(new VariableBinding(new OID(dskUsed)));
		pdu.add(new VariableBinding(new OID(dskPercent)));
		pdu.setType(PDU.GET);
		ResponseEvent response = snmpHelper.sendMessage(pdu, addr);
		return response;
	}
}


text:
<?php
    class view_controller
    {
        public static function client_administrator_list_servers()
        {
            include_once(ROOT_PATH."/views/client-administrator-list-servers.php");
        }
        public static function client_administrator_add_server()
        {
            include_once(ROOT_PATH."/views/client-administrator-add-server.php");
        }
        public static function client_administrator_option()
        {
            include_once(ROOT_PATH."/views/client-administrator-option.php");
        }
        public static function login_form()
        {
            include_once(ROOT_PATH."/views/login-form.php");
        }
        public static function edit_user_profile()
        {
            include_once(ROOT_PATH."/views/edit-user-profile.php");
        }
    }
?>


text:
package org.springframework.boot.autoconfigure.cloud;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import org.springframework.boot.autoconfigure.AutoConfigureOrder;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.cloud.Cloud;
import org.springframework.cloud.app.ApplicationInstanceInfo;
import org.springframework.cloud.config.java.CloudScan;
import org.springframework.cloud.config.java.CloudScanConfiguration;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.Profile;
import org.springframework.core.Ordered;

/**
 * {@link EnableAutoConfiguration Auto-configuration} for Spring Cloud Service Connectors.
 *

 * Activates when there is no bean of type {@link Cloud} and the "cloud" profile is
 * active.
 *

 * Once in effect, the auto-configuration is the equivalent of adding the
 * {@link CloudScan @CloudScan} annotation in one of the configuration file. Specifically,
 * it adds a bean for each service bound to the application and one for
 * {@link ApplicationInstanceInfo}.
 *
 * @author Ramnivas Laddad
 * @since 2.1.0
 */
@Configuration(proxyBeanMethods = false)
@Profile("cloud")
@AutoConfigureOrder(CloudServiceConnectorsAutoConfiguration.ORDER)
@ConditionalOnClass(CloudScanConfiguration.class)
@ConditionalOnMissingBean(Cloud.class)
@Import(CloudScanConfiguration.class)
public class CloudServiceConnectorsAutoConfiguration {

	// Cloud configuration needs to happen early (before data, mongo etc.)
	public static final int ORDER = Ordered.HIGHEST_PRECEDENCE + 20;

	private static final Log logger = LogFactory.getLog(CloudServiceConnectorsAutoConfiguration.class);

	public CloudServiceConnectorsAutoConfiguration() {
		logger.warn("Support for Spring Cloud Connectors has been deprecated in favor of Java CFEnv");
	}

}


text:
using System;
using System.IO;
using System.Drawing;

using Aspose.Cells;

namespace Aspose.Cells.Examples.CSharp.Articles.CopyShapesBetweenWorksheets
{
    public class CopyingPicture
    {
        public static void Run()
        {
            //Source directory
            string sourceDir = RunExamples.Get_SourceDirectory();

            //Output directory
            string outputDir = RunExamples.Get_OutputDirectory();

            // Create a workbook object
            // Open the template file
            Workbook workbook = new Workbook(sourceDir + "sampleCopyingPicture.xlsx");

            // Get the Picture from the "Picture" worksheet.
            Aspose.Cells.Drawing.Picture source = workbook.Worksheets["Sheet1"].Pictures[0];

            // Save Picture to Memory Stream
            MemoryStream ms = new MemoryStream(source.Data);

            // Copy the picture to the Result Worksheet
            workbook.Worksheets["Sheet2"].Pictures.Add(source.UpperLeftRow, source.UpperLeftColumn, ms, source.WidthScale, source.HeightScale);

            // Save the Worksheet
            workbook.Save(outputDir + "outputCopyingPicture.xlsx");

            Console.WriteLine("CopyingPicture executed successfully.");
        }
    }
}


text:
<?php
namespace Solleer\User\Authorize;
class User implements \Solleer\User\Authorizable {
    public function authorize($user, array $args): bool {
        if (!empty($user)) return true;
        else return false;
    }
}


text:
local M = {}

local log = require 'lumen.log'
local sched = require 'lumen.sched'
local messaging = require 'rong.lib.messaging'
local selector = require 'lumen.tasks.selector'

local EVENT_TRIGGER_EXCHANGE = {}

local view_merge = function(rong, vi)
  local now = sched.get_time()
  local view = rong.view
  for sid, si in pairs(vi) do
    log('BSW', 'DEBUG', 'Merging subscription: %s', tostring(sid))
    if not view[sid] then
      view:add(sid, si.filter, false)
      local sl = view[sid]
      sl.meta.last_seen = now
    end
  end
end

-- Process incomming token
local notif_merge = function (rong, notif)
  local now = sched.get_time()
  local inv = rong.inv
  local view, view_own = rong.view, rong.view.own

  local nid, reg = next(notif)
  local ni=inv[nid]
  if ni then
    if ni.meta.hops > reg.hops then
      ni.meta.hops = reg.hops
    end
  else
    log('BSW', 'DEBUG', 'Merging notification: %s (%s copies)',
      tostring(nid), tostring(reg.copies))
    inv:add(nid, reg.data, false)
    rong.messages.init_notification(nid) --FIXME refactor?
    local n = inv[nid]
    n.meta.hops = reg.hops
    n.meta.copies = reg.copies
    n.meta.init_time = reg.init_time
    n.meta.store_time = now

    -- signal arrival of new notification to subscriptions
    local matches=n.matches
    for sid, s in pairs(view_own) do
      if matches[s] then
        log('BSW', 'DEBUG', 'Singalling arrived notification: %s to %s',
          tostring(nid), tostring(sid))
        sched.signal(s, n)
      end
    end

    if n.target then
      if n.target == rong.conf.name then
        log('BSW', 'DEBUG', 'Purging notification on destination: %s (%i copies)',
          tostring(nid). n.meta.copies)
        inv:del(nid)
      end
    elseif n.meta.hops >= rong.conf.max_hop_count then
      log('BSW', 'DEBUG', 'Purging notification on hop count: %s (%i copies)',
          tostring(nid). n.meta.copies)
      inv:del(nid)
    elseif n.meta.copies == 0 then
      log('BSW', 'WARN', 'Purging notification on wait mode: %s', tostring(nid))
      inv:del(nid)
    end

    log('BSW', 'DEBUG', 'Buffer size verification: %i, inventory_size=%s',
      inv:len(), tostring(rong.conf.inventory_size))
    while inv:len() > rong.conf.inventory_size do
      local oldest, oldesttime = nil, math.huge
      for mid, m in pairs (inv) do
        if m.meta.init_time < oldesttime then
          oldest, oldesttime = mid, m.meta.init_time
        end
      end
      log('BSW', 'DEBUG', 'Purging notification on full buff: %s', tostring(oldest))
      inv:del(oldest)
    end

  end
end

--in a task to insure atomicity
sched.sigrun ( {EVENT_TRIGGER_EXCHANGE}, function (_, rong, view)
  local inv = rong.inv
  local encode_f, decode_f = assert(rong.conf.encode_f), assert(rong.conf.decode_f)

  if inv:len()==0 then
    log('BSW', 'DEBUG', 'Sender not connecting, nothing to offer')
    return
  end

  -- Open connection
  log('BSW', 'DEBUG', 'Sender connecting to: %s:%s',
    tostring(view.transfer_ip), tostring(view.transfer_port))
  local skt, err = selector.new_tcp_client(view.transfer_ip,view.transfer_port,
    nil, nil, 'line', 'stream', 5)

  if not skt then
    log('BSW', 'DEBUG', 'Sender failed to connect: %s', err)
    return
  end

  --sched.sleep(1)
  skt.stream:set_timeout(5,5)

  -- send summary vector
  local sv = {} -- summary vector
  for mid, m in pairs (inv) do
      if m.meta.copies>1 then
        sv[#sv+1] = mid
      end
  end
  local svs = assert(encode_f({sv = sv}))

  log('BSW', 'DEBUG', 'Sender SV: %i notifs, %i bytes',
    #sv, #svs+1)
  local ok, errsend, length = skt:send_sync(svs..'\n')
  if not ok then
    log('BSW', 'DEBUG', 'Sender SV send failed: %s', tostring(errsend))
    skt:close(); return
  end

  -- read request
  log('BSW', 'DEBUG', 'Sender REQ read started...')
  local reqs, errread = skt.stream:read()
  log('BSW', 'DEBUG', 'Sender REQ read finished: %s', tostring(reqs))
  if not reqs then
    log('BSW', 'DEBUG', 'Sender REQ read failed: %s', tostring(errread))
    skt:close(); return
  end

  -- send requested data
  local served_notif = {}
  local matching = messaging.select_matching( rong, view.subs )
  for _, mid in ipairs(matching) do
    local m = inv[mid]
    local out = {}
    out[mid] = {
      data = m.data,
      hops = m.meta.hops+1,
      copies = 0,
      init_time = m.meta.init_time,
    }
    local outs = assert(encode_f(out))
    served_notif[mid] = true
    log('BSW', 'DEBUG', 'Sender DATA direct delivery: %s, %i bytes', mid, #outs+1)
    local okdata, errsenddata, lengthdata = skt:send_sync(outs..'\n')
    if okdata then
      log('BSW', 'DEBUG', 'Sender DATA delivered directly %s', tostring(mid))
      --inv:del(mid)
    else
      log('BSW', 'DEBUG', 'Sender DATA direct delivery failed: %s', tostring(errsenddata))
    end
  end

  local req = assert(decode_f(reqs))
  for _, mid in ipairs (req.req) do
    local m = inv[mid]
    if not m then -- could've been deleted since offered
      log('BSW', 'DEBUG', 'Got Request but was removed since offer: %s', tostring(mid))
    elseif not served_notif[mid] then
      local out = {}
      local transfer_copies = math.floor(m.meta.copies/2)
      out[mid] = {
        data = m.data,
        hops = m.meta.hops+1,
        copies = transfer_copies,
        init_time = m.meta.init_time,
      }
      local outs = assert(encode_f(out))
      log('BSW', 'DEBUG', 'Sender DATA built: %s, %i bytes', mid, #outs+1)
      local okdata, errsenddata, lengthdata = skt:send_sync(outs..'\n')
      if okdata then
        m.meta.copies = m.meta.copies - transfer_copies
        log('BSW', 'DEBUG', 'Sender DATA transfered %i copies and kept %i for %s',
          transfer_copies, m.meta.copies, tostring(mid))
      else
        log('BSW', 'DEBUG', 'Sender DATA transfer failed: %s', tostring(errsenddata))
        break;
      end
      served_notif[mid]=true
    end
  end

  skt:close()
end)

-- Get handler for reading a transfer from socket
local get_receive_transfer_handler = function (rong)
  local inv = rong.inv
  local encode_f, decode_f = assert(rong.conf.encode_f), assert(rong.conf.decode_f)
  return function(_, skt, err)
    if skt==nil then
      log('BSW', 'ERROR', 'Socket error: %s', tostring(err))
      print(debug.traceback())
      os.exit()
    end

    log('BSW', 'DEBUG', 'Receiver accepted client: %s:%s', skt:getpeername())
    sched.run( function() -- removed, only single client
      --skt.stream:set_timeout(5,5)

      -- read summary vector
      local ssv, errread = skt.stream:read()
      if not ssv then
        log('BSW', 'DEBUG', 'Receiver SV read failed: %s', tostring(errread))
        skt:close(); return
      end
      local sv, parserr = decode_f(ssv)
      if not sv then
        log('BSW', 'DEBUG', 'Parse SV failed: %s', tostring(parserr))
        skt:close(); return
      end

       -- send request
      local req = {}
      for _, mid in ipairs(sv.sv) do
        if not inv[mid] then
          req[#req+1] = mid
        end
      end

      if #req == 0 then
        log('BSW', 'DEBUG', 'Receiver early close, nothing to request')
        skt:close(); return
      end

      local view_emit = {}
      local sreq = assert(encode_f({req = req}))

      log('BSW', 'DEBUG', 'Receiver REQ built: %i notifs, %i bytes',
        #req, #sreq+1)
      local ok, errsend, length = skt:send_sync(sreq..'\n')
      if not ok then
        log('BSW', 'DEBUG', 'Receiver REQ send failed: %s', tostring(errsend))
        skt:close(); return
      end

      -- receive data
      repeat
        local data, decoderr
        log('BSW', 'DEBUG', 'Receiver DATA read started...')
        local sdata, errdataread = skt.stream:read()
        log('BSW', 'DEBUG', 'Receiver DATA read finished')
        if sdata then
          data, decoderr = decode_f(sdata)
          if data then
            notif_merge(rong, data)
          else
            log('BSW', 'DEBUG', 'Parse DATA read failed: %s', tostring(decoderr))
          end
        elseif errdataread~='closed' then
          log('BSW', 'DEBUG', 'Receiver DATA read failed: %s', tostring(errdataread))
        end
      until not sdata or not data

      skt:close()
    end)
  end
end

local process_incoming_view = function (rong, view)
  view_merge( rong, view.subs )

  local conf = rong.conf
  local neighbor = rong.neighbor
  if neighbor[view.emitter] then
    -- restart timer
    log('BSW', 'DEBUG', 'Restarting neighborhood timer for: %s', tostring(view.emitter))
    sched.signal(neighbor[view.emitter])
  else
    -- create timer
    log('BSW', 'DEBUG', 'Creating neighborhood timer for: %s', tostring(view.emitter))
    local reg = {}
    neighbor[view.emitter] = reg
    reg.task = sched.run(function ()
      local waitd = {
        reg,
        timeout = conf.neighborhood_window or 2*conf.send_views_timeout
      }
      repeat
        local ev = sched.wait(waitd)
      until ev == nil -- exit on timeout
      log('BSW', 'DEBUG', 'Killing neighborhood timer for: %s', tostring(view.emitter))
      neighbor[view.emitter].task = nil
      neighbor[view.emitter] = nil
    end)

    sched.signal (EVENT_TRIGGER_EXCHANGE, rong, view)
  end
end

M.new = function(rong)
  local conf = rong.conf
  local inv = rong.inv
  local encode_f, decode_f = assert(rong.conf.encode_f), assert(rong.conf.decode_f)

  local msg = {}

  rong.neighbor = {}

  local tcp_server = selector.new_tcp_server(conf.listen_on_ip, conf.transfer_port, 'line', 'stream')
  conf.listen_on_ip, conf.transfer_port = tcp_server: getsockname()
  log('BSW', 'INFO', 'Accepting connections on: %s:%s',
    tostring(conf.listen_on_ip), tostring(conf.transfer_port))
  sched.sigrun({tcp_server.events.accepted}, get_receive_transfer_handler(rong))

  msg.broadcast_view = function ()
    local subs = {}
    for sid, s in pairs (rong.view.own) do
      local meta = s.meta
      local sr = {
        filter = s.filter,
        --p = meta.p,
      }
      subs[sid] = sr
    end
    local view_emit = {
      emitter = conf.name,
      transfer_ip = conf.listen_on_ip,
      transfer_port = conf.transfer_port,
      subs=subs,
    }

    local ms = assert(encode_f({view=view_emit})) --FIXME tamaño!
    log('BSW', 'DEBUG', 'Broadcast view %s: %i bytes', ms, #ms)

    rong.net:broadcast( ms )
  end

  msg.incomming = {
    view = process_incoming_view,
  }

  msg.init_subscription = function (sid)
    local now = sched.get_time()
    local s = assert(rong.view[sid])
    local meta = s.meta
    meta.init_time = now
  end

  msg.init_notification = function (nid)
    local now = sched.get_time()
    local n = assert(inv[nid])
    local meta = n.meta
    meta.init_time=now
    meta.store_time=now
    meta.last_seen=now
    meta.hops=0
    meta.copies = conf.start_copies

    log('BSW', 'DEBUG', 'Buffer size verification: %i, inventory_size=%s',
      inv:len(), tostring(rong.conf.inventory_size))
    while inv:len() > rong.conf.inventory_size do
      local oldest, oldesttime = nil, math.huge
      for mid, m in pairs (inv) do
        --if m.meta.init_time < oldesttime then
        --  oldest, oldesttime = mid, m.meta.init_time
        --end
        if m.meta.store_time < oldesttime then
          oldest, oldesttime = mid, m.meta.store_time
        end
      end
      log('BSW', 'DEBUG', 'Purging notification on full buffer: %s (%i copies)',
        tostring(oldest), inv[oldest].meta.copies)
      inv:del(oldest)
    end

    local neighbor = rong.neighbor
    for k, timer in pairs (neighbor) do
      timer.task:kill()
      neighbor[k].task = nil
      neighbor[k] = nil
    end

  end

  return msg
end

return M


text:
<!DOCTYPE html>

      <meta charset="utf-8">
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <meta name="description" content="">
      <meta name="author" content="">
      <link rel="shortcut icon" href="http://faviconist.com/icons/4a45c712f047ed6a88048f91bf336ce7/favicon.ico" />

      <title>The Portfolio Of Curtis Seaton</title>

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

      <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">

      <link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,400,300,600,700' rel='stylesheet' type='text/css'>
      <link href='http://fonts.googleapis.com/css?family=Dancing+Script:400,700' rel='stylesheet' type='text/css'>
      <link href='http://fonts.googleapis.com/css?family=Quicksand:300,400,700' rel='stylesheet' type='text/css'>
      <link href='http://fonts.googleapis.com/css?family=Raleway:400,300,500,600,200,700' rel='stylesheet' type='text/css'>

      <link href="dist/css/carousel.css" rel="stylesheet">
      <link href="dist/css/custom.css" rel="stylesheet">
      <link href="dist/css/custom-responsive.css" rel="stylesheet">

              <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                Toggle navigation

              </button>
              Code Me Curtis

Home

Portfolio

Blog

Contact

@CodeMeCurtis

            I love to build effective, modern & fast Web Applications, focused on the user's experience.

Past Work

Dinner Winner - Web Developer

Ruby on Rails

jQuery

AJAX

SASS

                This project consisited of a four person team spread over 6 days to build out ideal M.V.P. (Minimum Viable Product). I spent most of time working on both front and back end for customers and businesses accepting and offering deals. We used AJAX in the needed places to keep the most postive experience for the user. Utilizing the devise gem we were able to integrate custom fields, google Oauth, business, and customer logins.

                We integrated with the twilio API to send a text message to the customer when the resturant makes an offer. We also included a nice welcome email and offer accepted email using sendgrid and rails action mailers.

                <button>View Project Live</button>
                <button>View Project Code</button>

Tech Eyes - Lead Developer

PHP

jQuery

Magento

                At Tech Eyes my main goal was to increase the performance and SEO of the website, Being a start up I where many different hats like sales, IT, and shipping.
                I spent most of my time working on setting up the git workflow and manage outsourced freelancers, building features for magento eCommerce, and creating a custom inventory management system for drop shipping.

- Developed and Designed the original magento template

- Integrated Newsletter subscriptions

- Implemented and managed Analytics and Conversions

- Integrated social network channels, created custom facebook pages for contests

- Managed SEO (Bing and Google): using sitemaps, google shopping(Adwords) and Bing Ads

- Pushed site to top of searches and increased site visibility

- Increased Site performance and load time by 60%less

                <button>View Project Live</button>

National Blue Realty - Web Developer

PHP

jQuery

                This was a simple worpress customization for a client. The client already had the desired templat for wordpress so I created mutliple customizations mainly to the homepage. Using PHP and wordpress guidelines I was able to create some custom plugins to make the use of this template easier for the customer.

- Customize Wordpress template

- Successfully meet client demands

- Write documentation for client maintenance

                <button>View Project Live</button>

Hamilton Tree Service - Developer

PHP

Photoshop

                Hamilton tree was in a desperate need of a website redesign and I was their guy! The client was looking for quick changes and easy maintanence after the project so we went with wordpress. To keep costs down we went with a templated design and customizations. This project entitled a little more design work in the icons all throughout the website so it definetly tested my photoshop skills.

                We worked hard to make the webiste informative, we did not want the potentials clients having to make 4 or 5 clicks just to find out how much it will cost or what services are offered. I also developed a provided design for Hamilton's sister company EcoMulch

                <button>View Project Live</button>

Avalon MUA - Web Developer

PHP

jQuery

                This was a great quick project for a client of my partner. I was responsible for turning the provided design into a strong and powerful wordpress template for the client.

- Develop full featured wordpress template

- Optimize wordpress for fast load times

- Write clean and accessible code for SEO purposes

                <button>View Project Live</button>

Drop Me A Line

As an ambitious software engineer always hungry for growth, I strive for using open source technologies. I spent 4 years working with HTML & CSS and I have recently started focusing on user's experience and interface more.

I love to ride bikes, play ping pong, and talk code. I think I am one of the only engineers in the world that doesn't live off caffine but I will gladly join you for a hot chocolate anytime of the day.

            <button class="col-sm-12" type="submit">

                Contact / Hire Me

            </button>

© 2015 Code Me Curtis · Privacy · Terms


text:
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase
from grid.models import Grid, GridPackage
from package.models import Package, Category
import json

class PackageV1Tests(TestCase):
    def setUp(self):
        """
        Set up initial data, done through Python because fixtures break way too
        quickly with migrations and are terribly hard to maintain.
        """
        app = Category.objects.create(
            title='App',
            slug='app',
        )
        self.grid = Grid.objects.create(
            title='A Grid',
            slug='grid',
        )
        self.pkg1 = Package.objects.create(
            title='Package1',
            slug='package1',
            category=app,
            repo_url='https://github.com/pydanny/django-uni-form'
        )
        self.pkg2 = Package.objects.create(
            title='Package2',
            slug='package2',
            category=app,
            repo_url='https://github.com/cartwheelweb/packaginator'
        )
        GridPackage.objects.create(package=self.pkg1, grid=self.grid)
        GridPackage.objects.create(package=self.pkg2, grid=self.grid)
        user = User.objects.create_user('user', 'user@packaginator.com', 'user')
        self.pkg1.usage.add(user)

    def test_01_packages_usage(self):
        urlkwargs_pkg1 = {
            'api_name': 'v1',
            'resource_name': 'package',
            'pk': self.pkg1.slug,
        }
        url_pkg1 = reverse('api_dispatch_detail', kwargs=urlkwargs_pkg1)
        response_pkg1 = self.client.get(url_pkg1)
        # check that the request was successful
        self.assertEqual(response_pkg1.status_code, 200)
        # check that we have a usage_count equal to the one in the DB
        raw_json_pkg1 = response_pkg1.content
        pkg_1 = json.loads(raw_json_pkg1)
        usage_count_pkg1 = int(pkg_1['usage_count'])
        self.assertEqual(usage_count_pkg1, self.pkg1.usage.count())
        # do the same with pkg2
        urlkwargs_pkg2 = {
            'api_name': 'v1',
            'resource_name': 'package',
            'pk': self.pkg2.slug,
        }
        url_pkg2 = reverse('api_dispatch_detail', kwargs=urlkwargs_pkg2)
        response_pkg2 = self.client.get(url_pkg2)
        # check that the request was successful
        self.assertEqual(response_pkg2.status_code, 200)
        # check that we have a usage_count equal to the one in the DB
        raw_json_pkg2 = response_pkg2.content
        pkg_2 = json.loads(raw_json_pkg2)
        usage_count_pkg2 = int(pkg_2['usage_count'])
        self.assertEqual(usage_count_pkg2, self.pkg2.usage.count())


text:
/* Welcome to Compass.
 * In this file you should write your main styles. (or centralize your imports)
 * Import this file using the following HTML or equivalent:
 * <link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css" /> */
/* line 1, ../../views/styles/_site.scss */
body {
  position: absolute;
  height: 100%;
  width: 100%;
  background-image: url("/img/old_mathematics.png");
  background-repeat: repeat;
  padding-bottom: 0;
}

/* line 12, ../../views/styles/_site.scss */
.wrapper {
  position: relative;
}

/* line 16, ../../views/styles/_site.scss */
.jumbotron p {
  color: #555;
  font-size: 18px;
}

/* line 21, ../../views/styles/_site.scss */
.form-search {
  padding: 12px 0;
}

/* line 25, ../../views/styles/_site.scss */
#content {
  padding: 30px 0;
}

/* line 29, ../../views/styles/_site.scss */
.display-link {
  padding: 15px 0;
  font-size: 2.0rem;
}

/* line 34, ../../views/styles/_site.scss */
.footer {
  padding: 30px 0 0 0;
}
/* line 37, ../../views/styles/_site.scss */
.footer .container-fluid {
  border-top: 1px solid #888;
  text-align: left;
  font-size: 12px;
  padding-right: 0;
  padding-left: 0;
  margin-right: 20px;
  margin-left: 20px;
}
/* line 46, ../../views/styles/_site.scss */
.footer .container-fluid ul {
  list-style-type: none;
  margin: 0;
  padding: 20px 0;
}
/* line 52, ../../views/styles/_site.scss */
.footer .container-fluid .pull-left {
  text-align: left;
}
/* line 56, ../../views/styles/_site.scss */
.footer .container-fluid .pull-right {
  text-align: right;
}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using System.Diagnostics.CodeAnalysis;
using System.Threading;
using FluentAssertions;
using Microsoft.R.Components.Settings.Mirrors;
using Microsoft.UnitTests.Core.XUnit;

namespace Microsoft.VisualStudio.R.Package.Test.Repl {
    [ExcludeFromCodeCoverage]
    public class CranMirrorListTest {
        [Test]
        [Category.R.Package]
        public void CranMirrorList_DownloadTest() {
            ManualResetEventSlim evt = new ManualResetEventSlim();
            int eventCount = 0;

            CranMirrorList.DownloadComplete += (e, args) => {
                eventCount++;
                CranMirrorList.MirrorNames.Should().NotBeEmpty();
                CranMirrorList.MirrorUrls.Should().NotBeEmpty();
                CranMirrorList.UrlFromName(null).Should().Be(null);
                evt.Set();
            };

            CranMirrorList.Download();
            evt.Wait(10000);
            eventCount.Should().Be(1);

            CranMirrorList.Download();
            eventCount.Should().Be(2);
        }
    }
}


text:
// Licensed under MIT No Attribution, see LICENSE file at the root.
// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet.

using System;
using System.ComponentModel;
using System.Globalization;

namespace UnitsNet
{
    ///
    /// Is the base class for all attributes that are related to <see cref="QuantityTypeConverter{T}"/>
    ///
    [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
    public abstract class UnitAttributeBase : Attribute
    {
        ///
        /// The unit enum type, such as <see cref="UnitsNet.Units.LengthUnit" />
        ///
        public Enum? UnitType { get; set; }

        ///
        /// Initializes a new instance of the <see cref="UnitAttributeBase"/> class.
        ///
        /// <param name="unitType"></param>
        public UnitAttributeBase(object unitType)
        {
            UnitType = unitType as Enum;
        }
    }

    ///
    /// This attribute defines the default Unit to use if the string to convert only consists of digits
    ///
    public class DefaultUnitAttribute : UnitAttributeBase
    {
        ///
        /// Initializes a new instance of the <see cref="DefaultUnitAttribute"/> class.
        ///
        /// <param name="unitType">The unit the quantity gets when the string parsing dose only consist of digits</param>
        public DefaultUnitAttribute(object unitType) : base(unitType) { }
    }

    ///
    /// This attribute defines the Unit the quantity is converted to after it has been parsed.
    ///
    public class ConvertToUnitAttribute : DefaultUnitAttribute
    {
        ///
        /// Initializes a new instance of the <see cref="ConvertToUnitAttribute"/> class.
        ///
        /// <param name="unitType">The unit the quantity is converted to when parsing from string</param>
        public ConvertToUnitAttribute(object unitType) : base(unitType) { }
    }

    ///
    /// This attribute defines the unit the quantity has when converting to string
    ///
    public class DisplayAsUnitAttribute : DefaultUnitAttribute
    {
        ///
        /// The formating used when the quantity is converted to string. See <see cref="IQuantity.ToString(System.IFormatProvider)"/>
        ///
        public string Format { get; set; }

        ///
        /// Initializes a new instance of the <see cref="DisplayAsUnitAttribute"/> class.
        ///
        /// <param name="unitType">The unit the quantity should be displayed in</param>
        /// <param name="format">Formating string <see cref="IQuantity.ToString(System.IFormatProvider)"/> </param>
        public DisplayAsUnitAttribute(object unitType, string format = "") : base(unitType)
        {
            Format = format;
        }
    }

    ///
    /// <para>
    ///     Converts between IQuantity and string.
    ///     Implements a TypeConverter for IQuantitys. This allows eg the PropertyGrid to read and write properties of type IQuantity.
    /// </para>
    ///   <para>For basic understanding of TypeConverters consult the .NET documentation.</para>
    ///
    /// <typeparam name="TQuantity">Quantity value type, such as <see cref="Length"/> or <see cref="Mass"/>.</typeparam>
    /// <remarks>
    /// <para>
    ///     When a string is converted a Quantity the unit given by the string is used.
    ///     When no unit is given by the string the base unit is used.
    ///     The base unit can be overwritten by use of the <see cref="DefaultUnitAttribute"/>.
    ///     The converted Quantity can be forced to be in a certain unit by use of the <see cref="ConvertToUnitAttribute"/>.
    /// </para>
    /// <para>
    ///     The displayed unit can be forced to a certain unit by use of the <see cref="DisplayAsUnitAttribute"/>.
    ///     The <see cref="DisplayAsUnitAttribute"/> provides the possibility to format the displayed Quantity.
    /// </para>
    /// </remarks>
    /// <example>
    ///   <para>These examples show how to use this TypeConverter.</para>
    ///
    ///
    ///     [TypeConverter(typeof(UnitsNetTypeConverter{Length}))]
    ///     Units.Length PropertyName { get; set; }
    ///
    ///
    ///
    ///     [DisplayAsUnit(UnitsNet.Units.LengthUnit.Meter)]
    ///     [TypeConverter(typeof(UnitsNetTypeConverter{Length}))]
    ///     Units.Length Length { get; set; }
    ///
    ///
    ///
    ///     [DisplayAsUnit(UnitsNet.Units.LengthUnit.Meter, "g")]
    ///     [TypeConverter(typeof(UnitsNetTypeConverter{Length}))]
    ///     Units.Length Length { get; set; }
    ///
    ///
    ///
    ///     [ConvertToUnitAttribute(UnitsNet.Units.LengthUnit.Meter)]
    ///     [TypeConverter(typeof(UnitsNetTypeConverter{Length}))]
    ///     Units.Length Length { get; set; }
    ///
    ///
    ///
    ///     [DefaultUnitAttribute(UnitsNet.Units.LengthUnit.Meter)]
    ///     [TypeConverter(typeof(UnitsNetTypeConverter{Length}))]
    ///     Units.Length Length { get; set; }
    ///
    /// </example>
    public class QuantityTypeConverter<TQuantity> : TypeConverter where TQuantity : struct, IQuantity
    {
        ///
        ///     Returns true if sourceType if of type <see cref="string"/>
        ///
        /// <param name="context">An <see cref="System.ComponentModel.ITypeDescriptorContext"/> that provides a format context.</param>
        /// <param name="sourceType">A <see cref="System.Type"/> that represents the type you want to convert from.</param>
        /// <returns>true if this converter can perform the conversion; otherwise, false.</returns>
        public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
        {
            return (sourceType == typeof(string)) || base.CanConvertFrom(context, sourceType);
        }

        private static TAttribute? GetAttribute<TAttribute>(ITypeDescriptorContext? context) where TAttribute : UnitAttributeBase
        {
            if (context?.PropertyDescriptor is null) return null;

            var attribute = (TAttribute?)context.PropertyDescriptor.Attributes[typeof(TAttribute)];

            // Ensure the attribute's unit is compatible with this converter's quantity.
            if (attribute?.UnitType != null)
            {
                string converterQuantityName = default(TQuantity).QuantityInfo.Name;
                string attributeQuantityName = Quantity.From(1, attribute.UnitType).QuantityInfo.Name;
                if (converterQuantityName != attributeQuantityName)
                {
                    throw new ArgumentException($"The {attribute.GetType()}'s UnitType [{attribute.UnitType}] is not compatible with the converter's quantity [{converterQuantityName}].");
                }
            }

            return attribute;
        }

        ///
        ///     Converts the given object, when it is of type <see cref="string"/> to the type of this converter, using the specified context and culture information.
        ///
        /// <param name="context">An System.ComponentModel.ITypeDescriptorContext that provides a format context.</param>
        /// <param name="culture">The System.Globalization.CultureInfo to use as the current culture.</param>
        /// <param name="value">The System.Object to convert.</param>
        /// <returns>An <see cref="IQuantity"/> object.</returns>
        /// <exception cref="System.NotSupportedException">The conversion cannot be performed.</exception>
        /// <exception cref="ArgumentException">Unit value is not a know unit enum type.</exception>
        public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
        {
            if (value is string stringValue && !string.IsNullOrEmpty(stringValue))
            {
                IQuantity? quantity = null;

                if (double.TryParse(stringValue, NumberStyles.Any, culture, out double dvalue))
                {
                    var defaultUnit = GetAttribute<DefaultUnitAttribute>(context) ?? new DefaultUnitAttribute(default(TQuantity).Unit);
                    if(defaultUnit.UnitType != null)
                        quantity = Quantity.From(dvalue, defaultUnit.UnitType);
                }
                else
                {
                    quantity = Quantity.Parse(culture, typeof(TQuantity), stringValue);
                }

                if( quantity != null )
                {
                    ConvertToUnitAttribute? convertToUnit = GetAttribute<ConvertToUnitAttribute>(context);
                    if (convertToUnit != null && convertToUnit.UnitType != null)
                        quantity = quantity.ToUnit(convertToUnit.UnitType);

                    return quantity;
                }
            }

            return base.ConvertFrom(context, culture, value);
        }

        /// Returns true whether this converter can convert the <see cref="IQuantity"/> to string, using the specified context.
        /// <returns>true if this converter can perform the conversion; otherwise, false.</returns>
        /// <param name="context">An <see cref="T:System.ComponentModel.ITypeDescriptorContext" /> that provides a format context. </param>
        /// <param name="destinationType">A <see cref="T:System.Type" /> that represents the type you want to convert to. </param>
        public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
        {
            return (destinationType == typeof(string)) || base.CanConvertTo(context, destinationType);
        }

        /// Converts the given <see cref="IQuantity"/> object to <see cref="string"/>, using the specified context and culture information.
        /// <returns>An <see cref="T:System.Object" /> that represents the converted value.</returns>
        /// <param name="context">An <see cref="T:System.ComponentModel.ITypeDescriptorContext" /> that provides a format context. </param>
        /// <param name="culture">A <see cref="T:System.Globalization.CultureInfo" />. If null is passed, the current culture is assumed. </param>
        /// <param name="value">The <see cref="T:System.Object" /> to convert. </param>
        /// <param name="destinationType">The <see cref="T:System.Type" /> to convert the <paramref name="value" /> parameter to. </param>
        /// <exception cref="T:System.ArgumentNullException">The <paramref name="destinationType" /> parameter is null. </exception>
        /// <exception cref="T:System.NotSupportedException">The conversion cannot be performed. </exception>
        public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
        {
            DisplayAsUnitAttribute? displayAsUnit = GetAttribute<DisplayAsUnitAttribute>(context);

            if (value is IQuantity qvalue && destinationType == typeof(string) && displayAsUnit != null)
            {
                if (displayAsUnit.UnitType != null)
                    return qvalue.ToUnit(displayAsUnit.UnitType).ToString(displayAsUnit.Format, culture);
                else
                    return qvalue.ToString(displayAsUnit.Format, culture);
            }

            return base.ConvertTo(context, culture, value, destinationType);
        }
    }
}


text:
**【搭建vue开发环境】**

安装vue和vue-cli命令行工具

> npm install vue -g
>
> npm install vue-cli -g

在vue-project目录下初始化项目结构、安装依赖、运行

> vue init webpack vue-project
>
> cd vue-project
>
> npm install
>
> npm run dev

```shell
wenguangdeMacBook-Pro:vue-project wenguangpan$ npm run dev

> vue-project@1.0.0 dev /Users/wenguangpan/vue-project
> node build/dev-server.js

> Starting dev server...

 DONE  Compiled successfully in 2166ms                                 下午2:15:02

> Listening at http://localhost:8080
```

http://localhost:8080 看到运行结果,那到底它是怎样工作起来的呢?项目结构各文件有什么作用呢?

package.json有项目结构的描述。

> npm run build

```shell
wenguangdeMacBook-Pro:vue-project wenguangpan$ npm run build

> vue-project@1.0.0 build /Users/wenguangpan/vue-project
> node build/build.js

⠏ building for production...

... //省略

Build complete.

Tip: built files are meant to be served over an HTTP server.
Opening index.html over file:// won't work.
```

在dist目录下生成。

参考:[vuejs-templates/webpack](https://github.com/vuejs-templates/webpack)