text:
<?php

use kartik\growl\Growl;

$this->title = 'Внести данные';
$this->params['breadcrumbs'][] = ['label' => 'Общие показатели', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>

        <button class="btn btn-default btn-lg clear" data-toggle="modal" data-target=".modal_date">Внести
            данные
        </button>

    <?php
    if (Yii::$app->session->hasFlash('save') === true) {

        echo Growl::widget([
            'type' => Growl::TYPE_SUCCESS,
            'icon' => 'glyphicon glyphicon-floppy-disk',
            'body' => Yii::$app->session->getFlash('save')
        ]);
    }
    ?>

            Дата
            Директ
            Adwords

            Расход ( руб.)
            Клики
            Заявки
            Расход ( руб.)
            Клики
            Заявки

        <?php
        foreach ($dates as $date) {
            ?>

                <?php echo date('d.m.Y', strtotime($date->date)) ?>
                <?php echo $date->direct_rate ?>
                <?php echo $date->direct_click ?>
                <?php echo $date->direct_order ?>
                <?php echo $date->adwords_rate ?>
                <?php echo $date->adwords_click ?>
                <?php echo $date->adwords_order ?>

        <?php } ?>

                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>

Внести данные

                <?php

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

                <button type="button" class="btn btn-default" data-dismiss="modal">Отменить</button>
                <button type="submit" form="target-form" class="save btn btn-primary">Сохранить Данные</button>

redpajama_set_name: RedPajamaGithub


text:
layout: single
title: Annual Mad Hatters Tea Party
date: 2006-07-07 11:54
categories: Vancouver
---

The 13th Annual
MAD HATTER¹S TEA PARTY

This year, the colourful characters of Lewis Carroll's beloved Alice in Wonderland come alive in three Vancouver parks, offering old-fashioned participatory fun for all.

Children of all ages are welcome to dress as their favourite character, bring a picnic, and join Alice as she meets Humpty Dumpty (before his Great Fall), has tea with the Mad Hatter, plays croquet with the King and Queen of Hearts, and dances the Lobster Quadrille to the fantastic troubadour sounds of Toot-A-Lute.

Where: When:
Saturday, July 22 - Burrardview Park (2600 block Wall St)
Saturday, July 29 - Renfrew Park (22nd & Renfrew)
Sunday, July 30 - Trout Lake (east side of the lake)

All shows are noon to 3pm.

Join in the fun of one of Vancouver's truly most wonderful and imaginative family events!
Contact Gary Davis or Kathleen Wood @ 604-876-7979 for details

For more information including pictures please visit
http://www.communityartsworkshop.com


text:
var util = require('util');
var async = require('async');

var types = require('../types');
var utils = require('../utils.js');
var errors = require('../errors.js');

/** @module policies/loadBalancing */
/**
 * Base class for Load Balancing Policies
 * @constructor
 */
function LoadBalancingPolicy() {

}

/**
 * Initializes the load balancing policy, called after the driver obtained the information of the cluster.
 * @param {Client} client
 * @param {HostMap} hosts
 * @param {Function} callback
 */
LoadBalancingPolicy.prototype.init = function (client, hosts, callback) {
  this.client = client;
  this.hosts = hosts;
  callback();
};

//noinspection JSUnusedLocalSymbols
/**
 * Returns the distance assigned by this policy to the provided host.
 * @param {Host} host
 */
LoadBalancingPolicy.prototype.getDistance = function (host) {
  return types.distance.local;
};

/**
 * Returns an iterator with the hosts for a new query.
 * Each new query will call this method. The first host in the result will
 * then be used to perform the query.
 * @param {String} keyspace Name of the keyspace
 * @param queryOptions options evaluated for this execution
 * @param {Function} callback
 */
LoadBalancingPolicy.prototype.newQueryPlan = function (keyspace, queryOptions, callback) {
  callback(new Error('You must implement a query plan for the LoadBalancingPolicy class'));
};

/**
 * This policy yield nodes in a round-robin fashion.
 * @extends LoadBalancingPolicy
 * @constructor
 */
function RoundRobinPolicy() {
  this.index = 0;
}

util.inherits(RoundRobinPolicy, LoadBalancingPolicy);

/**
 * @param {String} keyspace Name of the keyspace
 * @param queryOptions options evaluated for this execution
 * @param {Function} callback
 */
RoundRobinPolicy.prototype.newQueryPlan = function (keyspace, queryOptions, callback) {
  if (!this.hosts) {
    callback(new Error('Load balancing policy not initialized'));
  }
  var hosts = this.hosts.values();
  var self = this;
  var counter = 0;

  var planIndex = self.index % hosts.length;
  self.index += 1;
  if (self.index >= utils.maxInt) {
    self.index = 0;
  }

  callback(null, {
    next: function () {
      if (++counter > hosts.length) {
        return {done: true};
      }
      return {value: hosts[planIndex++ % hosts.length], done: false};
    }
  });
};

/**
 * A data-center aware Round-robin load balancing policy.
 * This policy provides round-robin queries over the node of the local
 * data center. It also includes in the query plans returned a configurable
 * number of hosts in the remote data centers, but those are always tried
 * after the local nodes. In other words, this policy guarantees that no
 * host in a remote data center will be queried unless no host in the local
 * data center can be reached.
 * @param {?String} [localDc] local datacenter name.
 * @param {Number} [usedHostsPerRemoteDc] the number of host per remote datacenter that the policy will yield \
 * in a newQueryPlan after the local nodes.
 * @extends {LoadBalancingPolicy}
 * @constructor
 */
function DCAwareRoundRobinPolicy(localDc, usedHostsPerRemoteDc) {
  this.localDc = localDc;
  this.usedHostsPerRemoteDc = usedHostsPerRemoteDc || 0;
  this.index = 0;
  /** @type {Array} */
  this.localHostsArray = null;
  /** @type {Array} */
  this.remoteHostsArray = null;
}

util.inherits(DCAwareRoundRobinPolicy, LoadBalancingPolicy);

/**
 * Initializes the load balancing policy.
 * @param {Client} client
 * @param {HostMap} hosts
 * @param {Function} callback
 */
DCAwareRoundRobinPolicy.prototype.init = function (client, hosts, callback) {
  this.client = client;
  this.hosts = hosts;
  hosts.on('add', this._cleanHostCache.bind(this));
  hosts.on('remove', this._cleanHostCache.bind(this));
  if (!this.localDc) {
    //get the first alive local, it should be local on top
    var hostsArray = hosts.values();
    for (var i = 0; i < hostsArray.length; i++) {
      var h = hostsArray[i];
      if (h.datacenter) {
        this.localDc = h.datacenter;
        break;
      }
    }
    //this should never happen but it does not hurt
    if (!this.localDc) {
      return callback(new errors.DriverInternalError('Local datacenter could not be determined'));
    }
  }
  callback();
};

/**
 * Returns the distance depending on the datacenter.
 * @param {Host} host
 */
DCAwareRoundRobinPolicy.prototype.getDistance = function (host) {
  if (!host.datacenter) {
    return types.distance.ignored;
  }
  if (host.datacenter === this.localDc) {
    return types.distance.local;
  }
  return types.distance.remote;
};

DCAwareRoundRobinPolicy.prototype._cleanHostCache = function () {
  this.localHostsArray = null;
  this.remoteHostsArray = null;
};

DCAwareRoundRobinPolicy.prototype._sliceNodesByDc = function() {
  var hosts = this.hosts.values();
  if (this.remoteHostsArray) {
    //there were already calculated
    return;
  }
  //do a full lookup to cache the remote hosts by dc
  var remoteHostsByDc = {};
  this.localHostsArray = [];
  this.remoteHostsArray = [];
  hosts.forEach(function (h) {
    if (!h.datacenter) {
      //not a remote dc node
      return;
    }
    if (h.datacenter === this.localDc) {
      this.localHostsArray.push(h);
      return;
    }
    if (this.usedHostsPerRemoteDc === 0) {
      return;
    }
    var hostPerDc = remoteHostsByDc[h.datacenter];
    if (!hostPerDc) {
      remoteHostsByDc[h.datacenter] = hostPerDc = [];
    }
    if (hostPerDc.length < this.usedHostsPerRemoteDc) {
      hostPerDc.push(h);
      this.remoteHostsArray.push(h);
    }
  }, this);
};

/**
 * It returns an iterator that yields local nodes first and remotes nodes afterwards.
 * The amount of remote nodes returned will depend on the usedHostsPerRemoteDc
 * @param {String} keyspace Name of the keyspace
 * @param queryOptions
 * @param {Function} callback
 */
DCAwareRoundRobinPolicy.prototype.newQueryPlan = function (keyspace, queryOptions, callback) {
  if (!this.hosts) {
    callback(new Error('Load balancing policy not initialized'));
  }
  this.index += 1;
  if (this.index >= utils.maxInt) {
    this.index = 0;
  }
  this._sliceNodesByDc();
  var planLocalIndex = this.index;
  var planRemoteIndex = this.index;
  var counter = 0;
  var remoteCounter = 0;
  var self = this;
  callback(null, {
    next: function () {
      var host;
      if (counter++ < self.localHostsArray.length) {
        host = self.localHostsArray[planLocalIndex++ % self.localHostsArray.length];
        return { value: host, done: false };
      }
      if (remoteCounter++ < self.remoteHostsArray.length) {
        host = self.remoteHostsArray[planRemoteIndex++ % self.remoteHostsArray.length];
        return { value: host, done: false };
      }
      return { done: true };
    }
  });
};

/**
 * A wrapper load balancing policy that add token awareness to a child policy.
 * @param {LoadBalancingPolicy} childPolicy
 * @extends LoadBalancingPolicy
 * @constructor
 */
function TokenAwarePolicy (childPolicy) {
  if (!childPolicy) {
    throw new Error("You must specify a child load balancing policy");
  }
  this.childPolicy = childPolicy;
}

util.inherits(TokenAwarePolicy, LoadBalancingPolicy);

TokenAwarePolicy.prototype.init = function (client, hosts, callback) {
  this.client = client;
  this.hosts = hosts;
  this.childPolicy.init(client, hosts, callback);
};

TokenAwarePolicy.prototype.getDistance = function (host) {
  return this.childPolicy.getDistance(host);
};

/**
 * Returns the hosts to use for a new query.
 * The returned plan will first return replicas (whose HostDistance
 * for the child policy is local) for the query if it can determine
 * them is not.
 * Following what it will return the plan of the child policy.
 * @param {String} keyspace Name of the keyspace
 * @param queryOptions
 * @param {Function} callback
 */
TokenAwarePolicy.prototype.newQueryPlan = function (keyspace, queryOptions, callback) {
  var routingKey;
  if (queryOptions) {
    routingKey = queryOptions.routingKey;
  }
  var replicas;
  if (routingKey) {
    replicas = this.client.getReplicas(keyspace, routingKey);
  }
  if (!routingKey || !replicas) {
    return this.childPolicy.newQueryPlan(keyspace, queryOptions, callback);
  }
  var iterator = new TokenAwareIterator(keyspace, queryOptions, replicas, this.childPolicy);
  iterator.iterate(callback);
};

/**
 * An iterator that holds the context for the subsequent next() calls
 * @param {String} keyspace
 * @param queryOptions
 * @param {Array} replicas
 * @param childPolicy
 * @constructor
 * @ignore
 */
function TokenAwareIterator(keyspace, queryOptions, replicas, childPolicy) {
  this.keyspace = keyspace;
  this.replicas = replicas;
  this.childPolicy = childPolicy;
  this.queryOptions = queryOptions;
  this.childHosts = [];
  this.remoteReplicas = [];
  this.replicaMap = {};
  this.replicaIndex = 0;
  this.childIterator = null;
  this.remoteReplicasIterator = utils.arrayIterator(this.remoteReplicas);
}

TokenAwareIterator.prototype.iterate = function (callback) {
  //Load the child policy hosts
  var self = this;
  this.childPolicy.newQueryPlan(this.keyspace, this.queryOptions, function (err, iterator) {
    if (err) return callback(err);
    //get the iterator of the child policy in case is needed
    self.childIterator = iterator;
    callback(null, {next: self.computeNext.bind(self)});
  });
};

TokenAwareIterator.prototype.computeNext = function () {
  //return local replicas
  var host = this.nextLocalReplica();
  if (host) {
    return {value: host, done: !host};
  }
  //return child hosts
  var item = this.childIterator.next();
  if (!item.done) {
    if (this.replicaMap[item.value.address]) {
      return this.computeNext();
    }
    return item;
  }
  //return remote replicas
  item = this.remoteReplicasIterator.next();
  return item;
};

TokenAwareIterator.prototype.nextLocalReplica = function () {
  if (this.replicaIndex >= this.replicas.length) {
    return null;
  }
  var host = this.replicas[this.replicaIndex++];
  this.replicaMap[host.address] = true;
  if (this.childPolicy.getDistance(host) !== types.distance.local) {
    this.remoteReplicas.push(host);
    //get next
    return this.nextLocalReplica();
  }
  return host;
};

/**
 * Create a new policy that wraps the provided child policy but only "allow" hosts
 * from the provided while list.
 * @class
 * @classdesc
 * A load balancing policy wrapper that ensure that only hosts from a provided
 * white list will ever be returned.
 *

 * This policy wraps another load balancing policy and will delegate the choice
 * of hosts to the wrapped policy with the exception that only hosts contained
 * in the white list provided when constructing this policy will ever be
 * returned. Any host not in the while list will be considered ignored
 * and thus will not be connected to.
 *

 * This policy can be useful to ensure that the driver only connects to a
 * predefined set of hosts. Keep in mind however that this policy defeats
 * somewhat the host auto-detection of the driver. As such, this policy is only
 * useful in a few special cases or for testing, but is not optimal in general.
 * If all you want to do is limiting connections to hosts of the local
 * data-center then you should use DCAwareRoundRobinPolicy and *not* this policy
 * in particular.
 * @param {LoadBalancingPolicy} childPolicy the wrapped policy.
 * @param {Array.<string>}  whiteList the white listed hosts address in the format ipAddress:port.
 * Only hosts from this list may get connected
 * to (whether they will get connected to or not depends on the child policy).
 * @extends LoadBalancingPolicy
 * @constructor
 */
function WhiteListPolicy (childPolicy, whiteList) {
  if (!childPolicy) {
    throw new Error("You must specify a child load balancing policy");
  }
  if (!util.isArray(whiteList)) {
    throw new Error("You must provide the white list of host addresses");
  }
  this.childPolicy = childPolicy;
  var map = {};
  whiteList.forEach(function (address) {
    map[address] = true;
  });
  this.whiteList = map;
}

util.inherits(WhiteListPolicy, LoadBalancingPolicy);

WhiteListPolicy.prototype.init = function (client, hosts, callback) {
  this.childPolicy.init(client, hosts, callback);
};

/**
 * Uses the child policy to return the distance to the host if included in the white list.
 * Any host not in the while list will be considered ignored.
 * @param host
 */
WhiteListPolicy.prototype.getDistance = function (host) {
  if (!this._contains(host)) {
    return types.distance.ignored;
  }
  return this.childPolicy.getDistance(host);
};

/**
 * @param {Host} host
 * @returns {boolean}
 * @private
 */
WhiteListPolicy.prototype._contains = function (host) {
  return !!this.whiteList[host.address];
};

/**
 * Returns the hosts to use for a new query filtered by the white list.
 */
WhiteListPolicy.prototype.newQueryPlan = function (keyspace, queryOptions, callback) {
  var self = this;
  this.childPolicy.newQueryPlan(keyspace, queryOptions, function (err, iterator) {
    if (err) return callback(err);
    callback(null, self._filter(iterator));
  });
};

WhiteListPolicy.prototype._filter = function (childIterator) {
  var self = this;
  return {
    next: function () {
      var item = childIterator.next();
      if (!item.done && !self._contains(item.value)) {
        return this.next();
      }
      return item;
    }
  };
};

exports.DCAwareRoundRobinPolicy = DCAwareRoundRobinPolicy;
exports.LoadBalancingPolicy = LoadBalancingPolicy;
exports.RoundRobinPolicy = RoundRobinPolicy;
exports.TokenAwarePolicy = TokenAwarePolicy;
exports.WhiteListPolicy = WhiteListPolicy;


text:
from django.shortcuts import render

def index(request):
    return render(request, 'sweetheartsquad/index.html', {})

def stengine(request):
    return render(request, 'sweetheartsquad/stengine2.html', {})


text:
package uk.me.duncan_corps.pets4homes;

import java.util.List;
import java.util.Set;

import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.validator.GenericValidator;
import org.openqa.selenium.By;
import org.openqa.selenium.SearchContext;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;

import com.google.common.collect.Sets;

public class Refresh {
	private static final String PETS4HOMES_SCHEME_HOST = "https://www.pets4homes.co.uk/";
	private static final String PETS4HOMES_ACCOUNT_PATH = "account/";
	private static final String PETS4HOMES_LOG_IN_PATH = "login/";

	private static void usage(String... errors) {
		System.err.println(
				"Usage: java -jar pets4homes-refresh-1.0.0-jar-with-dependencies.jar <emailAddress> <password>");
		for (String error : errors) {
			System.err.println("Error: " + error);
		}
	}

	private static List<WebElement> finds(final SearchContext searchContext, final By by) {
		return searchContext.findElements(by);
	}

	private static WebElement find(final SearchContext searchContext, final By by) {
		return searchContext.findElement(by);
	}

	private static boolean currentUrlIs(WebDriver webDriver, String expectedUrl) {
		String actualUrl = webDriver.getCurrentUrl();

		return StringUtils.equals(expectedUrl, actualUrl);
	}

	private static boolean logIn(WebDriver webDriver, String emailValue, String passValue) {
		boolean loggedIn = false;
		List<WebElement> forms = finds(webDriver, By.tagName("form"));

		for (WebElement form : forms) {
			if (!loggedIn) {
				WebElement emailWebElement = find(form, By.name("email"));
				WebElement passWebElement = find(form, By.name("pass"));
				WebElement loginWebElement = find(form, By.name("login"));

				if (emailWebElement != null && passWebElement != null && loginWebElement != null) {
					emailWebElement.sendKeys(emailValue);
					passWebElement.sendKeys(passValue);
					loginWebElement.click();

					loggedIn = currentUrlIs(webDriver, PETS4HOMES_SCHEME_HOST + PETS4HOMES_ACCOUNT_PATH);
				}
			}
		}

		return loggedIn;
	}

	private static void refreshAdverts(WebDriver webDriver) {
		Set<String> aHrefs = Sets.newHashSet();
		boolean clicked;

		do {
			clicked = false;
			webDriver.get(PETS4HOMES_SCHEME_HOST + PETS4HOMES_ACCOUNT_PATH + "manage-adverts/");
			List<WebElement> aWebElements = finds(webDriver,
					By.cssSelector("div.manageadvert div.managebuttons a.btn"));

			for (WebElement aWebElement : aWebElements) {
				if (!clicked) {
					String aTitle = aWebElement.getAttribute("title");

					if (StringUtils.equals(aTitle, "Refreshes adverts last updated date")) {
						String aHref = aWebElement.getAttribute("href");

						if (!aHrefs.contains(aHref)) {
							aWebElement.click();
							aHrefs.add(aHref);
							clicked = true;
						}
					}
				}
			}
		} while (clicked);
	}

	public static void main(String[] arguments) throws InterruptedException {
		int exitStatus = 0;

		if (ArrayUtils.getLength(arguments) >= 2) {
			String emailValue = arguments[0];

			if (GenericValidator.isEmail(emailValue)) {
				String passValue = arguments[1];

				WebDriver webDriver = new HtmlUnitDriver(); // FirefoxDriver();
				webDriver.get(PETS4HOMES_SCHEME_HOST + PETS4HOMES_LOG_IN_PATH);

				final boolean loggedIn = logIn(webDriver, emailValue, passValue);

				if (loggedIn) {
					refreshAdverts(webDriver);
				}

				Thread.sleep(2000);
				webDriver.close();
				webDriver.quit();
			} else {
				usage("First argument is not an email address.");
				exitStatus = 2;
			}
		} else {
			usage();
			exitStatus = 1;
		}

		System.exit(exitStatus);
	}
}


text:
import * as Mongoose from 'mongoose';

import { IUser } from '../../models';

export interface IUserModel extends IUser, Mongoose.Document {
  _id: string;
}

const UserSchema: Mongoose.Schema = new Mongoose.Schema(
  {
    name: String,
  },
  {
    timestamps: true,
  },
);

export const User = Mongoose.model<IUserModel>('User', UserSchema);


text:
namespace SolutionsAI.DataInterface.Commands.Errors
{
    public enum CommandErrorLogSource
    {

    }
}


text:
package org.apache.camel.component.hashicorp.vault.integration.operations;

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

import org.apache.camel.EndpointInject;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

public class HashicorpProducerListSecretsIT extends HashicorpVaultBase {

    @EndpointInject("mock:result-write")
    private MockEndpoint mockWrite;

    @EndpointInject("mock:result-list")
    private MockEndpoint mockRead;

    @Test
    public void createSecretTest() throws InterruptedException {

        mockWrite.expectedMessageCount(2);
        mockRead.expectedMessageCount(1);
        Exchange exchange = template.request("direct:createSecret", new Processor() {
            @Override
            public void process(Exchange exchange) {
                HashMap map = new HashMap();
                map.put("integer", "30");
                exchange.getIn().setBody(map);
            }
        });
        exchange = template.request("direct:createSecret", new Processor() {
            @Override
            public void process(Exchange exchange) {
                HashMap map = new HashMap();
                map.put("secret", "30");
                exchange.getIn().setBody(map);
            }
        });
        exchange = template.request("direct:listSecrets", new Processor() {
            @Override
            public void process(Exchange exchange) {
            }
        });

        assertMockEndpointsSatisfied();
        Exchange ret = mockRead.getExchanges().get(0);
        assertNotNull(ret);
        assertTrue(ret.getMessage().getBody(List.class).contains("test"));
        assertEquals(1, ret.getMessage().getBody(List.class).size());
    }

    @Override
    protected RouteBuilder createRouteBuilder() {
        return new RouteBuilder() {
            @Override
            public void configure() {
                from("direct:createSecret")
                        .toF("hashicorp-vault://secret?operation=createSecret&token=RAW(%s)&host=%s&port=%s&scheme=http&secretPath=test",
                                service.token(), service.host(), service.port())
                        .to("mock:result-write");

                from("direct:listSecrets")
                        .toF("hashicorp-vault://secret?operation=listSecrets&token=RAW(%s)&host=%s&port=%s&scheme=http&secretPath=test",
                                service.token(), service.host(), service.port())
                        .to("mock:result-list");
            }
        };
    }
}


text:
@interface PSKFormatUtil : NSObject
// 常用的价格字符串格式化方法(默认:显示¥、显示小数点)
+ (NSString *)formatPrice:(NSNumber *)price;
// 常用的价格字符串格式化方法(默认:显示¥、显示小数点、显示元)
+ (NSString *)formatPriceWithUnit:(NSNumber *)price;
+ (NSString *)formatPrice:(NSNumber *)price showMoneyTag:(BOOL)isTagUsed showDecimalPoint:(BOOL) isDecimal useUnit:(BOOL)isUnitUsed;
//规范化:如果有小数点才显示两位,否则就不显示小数点
+ (NSString *)formatNumberValue:(NSNumber *)value;
+ (NSString *)formatFloatValue:(CGFloat)value;
// 规范化mac地址 xx:xx:xx:xx:xx:xx
+ (NSString *)formatMacAddress:(NSString *)macAddress;
// 格式化输出json到console(格式化失败返回empty)
+ (NSString *)formatPrintJsonStringOnConsole:(NSString *)jsonString;
@end


text:
/*================================================================================
  code generated by: java2cpp
  author: Zoran Angelov, mailto://baldzar@gmail.com
  class: android.app.TabActivity
================================================================================*/

#ifndef J2CPP_INCLUDE_IMPLEMENTATION

#ifndef J2CPP_ANDROID_APP_TABACTIVITY_HPP_DECL
#define J2CPP_ANDROID_APP_TABACTIVITY_HPP_DECL

namespace j2cpp { namespace android { namespace app { class Activity; } } }
namespace j2cpp { namespace android { namespace app { class ActivityGroup; } } }
namespace j2cpp { namespace android { namespace widget { class TabHost; } } }
namespace j2cpp { namespace android { namespace widget { class TabWidget; } } }
namespace j2cpp { namespace android { namespace content { class ComponentCallbacks; } } }
namespace j2cpp { namespace android { namespace content { class ContextWrapper; } } }
namespace j2cpp { namespace android { namespace content { class Context; } } }
namespace j2cpp { namespace android { namespace view { namespace LayoutInflater_ { class Factory; } } } }
namespace j2cpp { namespace android { namespace view { namespace View_ { class OnCreateContextMenuListener; } } } }
namespace j2cpp { namespace android { namespace view { namespace Window_ { class Callback; } } } }
namespace j2cpp { namespace android { namespace view { class ContextThemeWrapper; } } }
namespace j2cpp { namespace java { namespace lang { class String; } } }
namespace j2cpp { namespace java { namespace lang { class Object; } } }

#include <android/app/Activity.hpp>
#include <android/app/ActivityGroup.hpp>
#include <android/content/ComponentCallbacks.hpp>
#include <android/content/Context.hpp>
#include <android/content/ContextWrapper.hpp>
#include <android/view/ContextThemeWrapper.hpp>
#include <android/view/LayoutInflater.hpp>
#include <android/view/View.hpp>
#include <android/view/Window.hpp>
#include <android/widget/TabHost.hpp>
#include <android/widget/TabWidget.hpp>
#include <java/lang/Object.hpp>
#include <java/lang/String.hpp>

namespace j2cpp {

namespace android { namespace app {

	class TabActivity;
	class TabActivity
		: public object<TabActivity>
	{
	public:

		J2CPP_DECLARE_CLASS

		J2CPP_DECLARE_METHOD(0)
		J2CPP_DECLARE_METHOD(1)
		J2CPP_DECLARE_METHOD(2)
		J2CPP_DECLARE_METHOD(3)
		J2CPP_DECLARE_METHOD(4)
		J2CPP_DECLARE_METHOD(5)
		J2CPP_DECLARE_METHOD(6)
		J2CPP_DECLARE_METHOD(7)
		J2CPP_DECLARE_METHOD(8)
		J2CPP_DECLARE_METHOD(9)

		explicit TabActivity(jobject jobj)
		: object<TabActivity>(jobj)
		{
		}

		operator local_ref<android::app::Activity>() const;
		operator local_ref<android::app::ActivityGroup>() const;
		operator local_ref<android::content::ComponentCallbacks>() const;
		operator local_ref<android::content::ContextWrapper>() const;
		operator local_ref<android::content::Context>() const;
		operator local_ref<android::view::LayoutInflater_::Factory>() const;
		operator local_ref<android::view::View_::OnCreateContextMenuListener>() const;
		operator local_ref<android::view::Window_::Callback>() const;
		operator local_ref<android::view::ContextThemeWrapper>() const;
		operator local_ref<java::lang::Object>() const;

		TabActivity();
		void setDefaultTab(local_ref< java::lang::String >  const&);
		void setDefaultTab(jint);
		void onContentChanged();
		local_ref< android::widget::TabHost > getTabHost();
		local_ref< android::widget::TabWidget > getTabWidget();
	}; //class TabActivity

} //namespace app
} //namespace android

} //namespace j2cpp

#endif //J2CPP_ANDROID_APP_TABACTIVITY_HPP_DECL

#else //J2CPP_INCLUDE_IMPLEMENTATION

#ifndef J2CPP_ANDROID_APP_TABACTIVITY_HPP_IMPL
#define J2CPP_ANDROID_APP_TABACTIVITY_HPP_IMPL

namespace j2cpp {

android::app::TabActivity::operator local_ref<android::app::Activity>() const
{
	return local_ref<android::app::Activity>(get_jobject());
}

android::app::TabActivity::operator local_ref<android::app::ActivityGroup>() const
{
	return local_ref<android::app::ActivityGroup>(get_jobject());
}

android::app::TabActivity::operator local_ref<android::content::ComponentCallbacks>() const
{
	return local_ref<android::content::ComponentCallbacks>(get_jobject());
}

android::app::TabActivity::operator local_ref<android::content::ContextWrapper>() const
{
	return local_ref<android::content::ContextWrapper>(get_jobject());
}

android::app::TabActivity::operator local_ref<android::content::Context>() const
{
	return local_ref<android::content::Context>(get_jobject());
}

android::app::TabActivity::operator local_ref<android::view::LayoutInflater_::Factory>() const
{
	return local_ref<android::view::LayoutInflater_::Factory>(get_jobject());
}

android::app::TabActivity::operator local_ref<android::view::View_::OnCreateContextMenuListener>() const
{
	return local_ref<android::view::View_::OnCreateContextMenuListener>(get_jobject());
}

android::app::TabActivity::operator local_ref<android::view::Window_::Callback>() const
{
	return local_ref<android::view::Window_::Callback>(get_jobject());
}

android::app::TabActivity::operator local_ref<android::view::ContextThemeWrapper>() const
{
	return local_ref<android::view::ContextThemeWrapper>(get_jobject());
}

android::app::TabActivity::operator local_ref<java::lang::Object>() const
{
	return local_ref<java::lang::Object>(get_jobject());
}

android::app::TabActivity::TabActivity()
: object<android::app::TabActivity>(
	call_new_object<
		android::app::TabActivity::J2CPP_CLASS_NAME,
		android::app::TabActivity::J2CPP_METHOD_NAME(0),
		android::app::TabActivity::J2CPP_METHOD_SIGNATURE(0)
	>()
)
{
}

void android::app::TabActivity::setDefaultTab(local_ref< java::lang::String > const &a0)
{
	return call_method<
		android::app::TabActivity::J2CPP_CLASS_NAME,
		android::app::TabActivity::J2CPP_METHOD_NAME(1),
		android::app::TabActivity::J2CPP_METHOD_SIGNATURE(1),
		void
	>(get_jobject(), a0);
}

void android::app::TabActivity::setDefaultTab(jint a0)
{
	return call_method<
		android::app::TabActivity::J2CPP_CLASS_NAME,
		android::app::TabActivity::J2CPP_METHOD_NAME(2),
		android::app::TabActivity::J2CPP_METHOD_SIGNATURE(2),
		void
	>(get_jobject(), a0);
}

void android::app::TabActivity::onContentChanged()
{
	return call_method<
		android::app::TabActivity::J2CPP_CLASS_NAME,
		android::app::TabActivity::J2CPP_METHOD_NAME(6),
		android::app::TabActivity::J2CPP_METHOD_SIGNATURE(6),
		void
	>(get_jobject());
}

local_ref< android::widget::TabHost > android::app::TabActivity::getTabHost()
{
	return call_method<
		android::app::TabActivity::J2CPP_CLASS_NAME,
		android::app::TabActivity::J2CPP_METHOD_NAME(8),
		android::app::TabActivity::J2CPP_METHOD_SIGNATURE(8),
		local_ref< android::widget::TabHost >
	>(get_jobject());
}

local_ref< android::widget::TabWidget > android::app::TabActivity::getTabWidget()
{
	return call_method<
		android::app::TabActivity::J2CPP_CLASS_NAME,
		android::app::TabActivity::J2CPP_METHOD_NAME(9),
		android::app::TabActivity::J2CPP_METHOD_SIGNATURE(9),
		local_ref< android::widget::TabWidget >
	>(get_jobject());
}

J2CPP_DEFINE_CLASS(android::app::TabActivity,"android/app/TabActivity")
J2CPP_DEFINE_METHOD(android::app::TabActivity,0,"<init>","()V")
J2CPP_DEFINE_METHOD(android::app::TabActivity,1,"setDefaultTab","(Ljava/lang/String;)V")
J2CPP_DEFINE_METHOD(android::app::TabActivity,2,"setDefaultTab","(I)V")
J2CPP_DEFINE_METHOD(android::app::TabActivity,3,"onRestoreInstanceState","(Landroid/os/Bundle;)V")
J2CPP_DEFINE_METHOD(android::app::TabActivity,4,"onPostCreate","(Landroid/os/Bundle;)V")
J2CPP_DEFINE_METHOD(android::app::TabActivity,5,"onSaveInstanceState","(Landroid/os/Bundle;)V")
J2CPP_DEFINE_METHOD(android::app::TabActivity,6,"onContentChanged","()V")
J2CPP_DEFINE_METHOD(android::app::TabActivity,7,"onChildTitleChanged","(Landroid/app/Activity;Ljava/lang/CharSequence;)V")
J2CPP_DEFINE_METHOD(android::app::TabActivity,8,"getTabHost","()Landroid/widget/TabHost;")
J2CPP_DEFINE_METHOD(android::app::TabActivity,9,"getTabWidget","()Landroid/widget/TabWidget;")

} //namespace j2cpp

#endif //J2CPP_ANDROID_APP_TABACTIVITY_HPP_IMPL

#endif //J2CPP_INCLUDE_IMPLEMENTATION


text:
title: Python Blog 4
layout: post
author: marcus.liew
permalink: /python-blog-4/
source-id: 1pGd-96rbVx4luXmUGmhs0_mulQUd3x0GL74maFUWYIU
published: true
---

    Title
    Python Blog 4
    Date
    15/5/18

    Starting point:
    Midway through the topic: "Date and Time"

    Target for this lesson?
    To complete the lesson: "Date and Time"

    Did I reach my target?
(add details to "Lesson Review")
    I think I reached my target because I completed "Date and Time" and additionally  I have completed "Conditions and Control Flow"

    Lesson Review

    How did I learn? What strategies were effective?

    In this lesson I think I learnt well since I completed my target and more. The lessons, although difficult, were able to be completed without any major problems. However, as the lessons go on, the difficulty level rises. For example the variables become more and more obscure since the levels expect you to retain knowledge from previous lessons. A strategy that was effective was looking back on previous lessons to revise the knowledge.

    What limited my learning? Which habits do I need to work on?

    I think the fact that my target was too small limited my learning. This target limited my learning because it meant that I was aiming high enough. With a target like the one I had, I wouldn't push myself after I completed it. The habit I need to work on is not setting such a low target for myself. This will allow me to get through the lessons quicker.

    What will I change for next time? How will I improve my learning?

    Next time I will make my target to complete two lessons next time so I can push myself so hopefully I can get as many lessons as I can done before the term finishes. I will improve my learning by getting through the lessons quicker so I can complete as many as I can in a single hour.

![image alt text]({{ site.url }}/public/RiDCitsMMlYB5yHvI2RSQ_img_0.jpg)


text:
A simple C/C++ lib to generate QR code images

# Reference material

I followed the excellent tutorial here: http://www.thonky.com/qr-code-tutorial/introduction


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="
        http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.metaeffekt.core</groupId>
        <artifactId>ae-plugins</artifactId>
        <version>0.71.0</version>
        <relativePath>../</relativePath>
    </parent>

    <artifactId>ae-version-maven-plugin</artifactId>
    <packaging>maven-plugin</packaging>

    <dependencies>
        <dependency>
            <groupId>org.metaeffekt.core</groupId>
            <artifactId>ae-maven-kernel</artifactId>
            <version>${project.version}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
            <scope>compile</scope>
        </dependency>
        <!-- this is required to overwrite the version dragged in by the maven-core plugin -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>runtime</scope>
        </dependency>
    </dependencies>

    <!--
        <build>
            <plugins>
                <plugin>
                    <groupId>org.metaeffekt.core</groupId>
                    <artifactId>ae-inventory-maven-plugin</artifactId>
                </plugin>
            </plugins>
        </build>
    -->
</project>


text:
namespace osu.Game.Overlays.Dashboard.Friends
{
    public enum OnlineStatus
    {
        All,
        Online,
        Offline
    }
}


text:
import os,sys
from waflib import Utils,Options,Errors,Logs,Task,Node
from waflib.TaskGen import extension,before_method,after_method,feature
from waflib.Configure import conf
FRAG='''
#include <Python.h>
#ifdef __cplusplus
extern "C" {
#endif
	void Py_Initialize(void);
	void Py_Finalize(void);
#ifdef __cplusplus
}
#endif
int main(int argc, char **argv)
{
   (void)argc; (void)argv;
   Py_Initialize();
   Py_Finalize();
   return 0;
}
'''
INST='''
import sys, py_compile
py_compile.compile(sys.argv[1], sys.argv[2], sys.argv[3], True)
'''
DISTUTILS_IMP=['from distutils.sysconfig import get_config_var, get_python_lib']
@before_method('process_source')
@feature('py')
def feature_py(self):
	self.install_path=getattr(self,'install_path','${PYTHONDIR}')
	install_from=getattr(self,'install_from',None)
	if install_from and not isinstance(install_from,Node.Node):
		install_from=self.path.find_dir(install_from)
	self.install_from=install_from
	ver=self.env.PYTHON_VERSION
	if not ver:
		self.bld.fatal('Installing python files requires PYTHON_VERSION, try conf.check_python_version')
	if int(ver.replace('.',''))>31:
		self.install_32=True
@extension('.py')
def process_py(self,node):
	assert(getattr(self,'install_path')),'add features="py"'
	if self.install_path:
		if self.install_from:
			self.add_install_files(install_to=self.install_path,install_from=node,cwd=self.install_from,relative_trick=True)
		else:
			self.add_install_files(install_to=self.install_path,install_from=node,relative_trick=True)
	lst=[]
	if self.env.PYC:
		lst.append('pyc')
	if self.env.PYO:
		lst.append('pyo')
	if self.install_path:
		if self.install_from:
			pyd=Utils.subst_vars("%s/%s"%(self.install_path,node.path_from(self.install_from)),self.env)
		else:
			pyd=Utils.subst_vars("%s/%s"%(self.install_path,node.path_from(self.path)),self.env)
	else:
		pyd=node.abspath()
	for ext in lst:
		if self.env.PYTAG and not self.env.NOPYCACHE:
			name=node.name[:-3]
			pyobj=node.parent.get_bld().make_node('__pycache__').make_node("%s.%s.%s"%(name,self.env.PYTAG,ext))
			pyobj.parent.mkdir()
		else:
			pyobj=node.change_ext(".%s"%ext)
		tsk=self.create_task(ext,node,pyobj)
		tsk.pyd=pyd
		if self.install_path:
			self.add_install_files(install_to=os.path.dirname(pyd),install_from=pyobj,cwd=node.parent.get_bld(),relative_trick=True)
class pyc(Task.Task):
	color='PINK'
	def __str__(self):
		node=self.outputs[0]
		return node.path_from(node.ctx.launch_node())
	def run(self):
		cmd=[Utils.subst_vars('${PYTHON}',self.env),'-c',INST,self.inputs[0].abspath(),self.outputs[0].abspath(),self.pyd]
		ret=self.generator.bld.exec_command(cmd)
		return ret
class pyo(Task.Task):
	color='PINK'
	def __str__(self):
		node=self.outputs[0]
		return node.path_from(node.ctx.launch_node())
	def run(self):
		cmd=[Utils.subst_vars('${PYTHON}',self.env),Utils.subst_vars('${PYFLAGS_OPT}',self.env),'-c',INST,self.inputs[0].abspath(),self.outputs[0].abspath(),self.pyd]
		ret=self.generator.bld.exec_command(cmd)
		return ret
@feature('pyext')
@before_method('propagate_uselib_vars','apply_link')
@after_method('apply_bundle')
def init_pyext(self):
	self.uselib=self.to_list(getattr(self,'uselib',[]))
	if not'PYEXT'in self.uselib:
		self.uselib.append('PYEXT')
	self.env.cshlib_PATTERN=self.env.cxxshlib_PATTERN=self.env.macbundle_PATTERN=self.env.pyext_PATTERN
	self.env.fcshlib_PATTERN=self.env.dshlib_PATTERN=self.env.pyext_PATTERN
	try:
		if not self.install_path:
			return
	except AttributeError:
		self.install_path='${PYTHONARCHDIR}'
@feature('pyext')
@before_method('apply_link','apply_bundle')
def set_bundle(self):
	if Utils.unversioned_sys_platform()=='darwin':
		self.mac_bundle=True
@before_method('propagate_uselib_vars')
@feature('pyembed')
def init_pyembed(self):
	self.uselib=self.to_list(getattr(self,'uselib',[]))
	if not'PYEMBED'in self.uselib:
		self.uselib.append('PYEMBED')
@conf
def get_python_variables(self,variables,imports=None):
	if not imports:
		try:
			imports=self.python_imports
		except AttributeError:
			imports=DISTUTILS_IMP
	program=list(imports)
	program.append('')
	for v in variables:
		program.append("print(repr(%s))"%v)
	os_env=dict(os.environ)
	try:
		del os_env['MACOSX_DEPLOYMENT_TARGET']
	except KeyError:
		pass
	try:
		out=self.cmd_and_log(self.env.PYTHON+['-c','\n'.join(program)],env=os_env)
	except Errors.WafError:
		self.fatal('The distutils module is unusable: install "python-devel"?')
	self.to_log(out)
	return_values=[]
	for s in out.splitlines():
		s=s.strip()
		if not s:
			continue
		if s=='None':
			return_values.append(None)
		elif(s[0]=="'"and s[-1]=="'")or(s[0]=='"'and s[-1]=='"'):
			return_values.append(eval(s))
		elif s[0].isdigit():
			return_values.append(int(s))
		else:break
	return return_values
@conf
def test_pyembed(self,mode,msg='Testing pyembed configuration'):
	self.check(header_name='Python.h',define_name='HAVE_PYEMBED',msg=msg,fragment=FRAG,errmsg='Could not build a python embedded interpreter',features='%s %sprogram pyembed'%(mode,mode))
@conf
def test_pyext(self,mode,msg='Testing pyext configuration'):
	self.check(header_name='Python.h',define_name='HAVE_PYEXT',msg=msg,fragment=FRAG,errmsg='Could not build python extensions',features='%s %sshlib pyext'%(mode,mode))
@conf
def python_cross_compile(self,features='pyembed pyext'):
	features=Utils.to_list(features)
	if not('PYTHON_LDFLAGS'in self.environ or'PYTHON_PYEXT_LDFLAGS'in self.environ or'PYTHON_PYEMBED_LDFLAGS'in self.environ):
		return False
	for x in'PYTHON_VERSION PYTAG pyext_PATTERN'.split():
		if not x in self.environ:
			self.fatal('Please set %s in the os environment'%x)
		else:
			self.env[x]=self.environ[x]
	xx=self.env.CXX_NAME and'cxx'or'c'
	if'pyext'in features:
		flags=self.environ.get('PYTHON_PYEXT_LDFLAGS',self.environ.get('PYTHON_LDFLAGS'))
		if flags is None:
			self.fatal('No flags provided through PYTHON_PYEXT_LDFLAGS as required')
		else:
			self.parse_flags(flags,'PYEXT')
		self.test_pyext(xx)
	if'pyembed'in features:
		flags=self.environ.get('PYTHON_PYEMBED_LDFLAGS',self.environ.get('PYTHON_LDFLAGS'))
		if flags is None:
			self.fatal('No flags provided through PYTHON_PYEMBED_LDFLAGS as required')
		else:
			self.parse_flags(flags,'PYEMBED')
		self.test_pyembed(xx)
	return True
@conf
def check_python_headers(conf,features='pyembed pyext'):
	features=Utils.to_list(features)
	assert('pyembed'in features)or('pyext'in features),"check_python_headers features must include 'pyembed' and/or 'pyext'"
	env=conf.env
	if not env.CC_NAME and not env.CXX_NAME:
		conf.fatal('load a compiler first (gcc, g++, ..)')
	if conf.python_cross_compile(features):
		return
	if not env.PYTHON_VERSION:
		conf.check_python_version()
	pybin=env.PYTHON
	if not pybin:
		conf.fatal('Could not find the python executable')
	v='prefix SO LDFLAGS LIBDIR LIBPL INCLUDEPY Py_ENABLE_SHARED MACOSX_DEPLOYMENT_TARGET LDSHARED CFLAGS LDVERSION'.split()
	try:
		lst=conf.get_python_variables(["get_config_var('%s') or ''"%x for x in v])
	except RuntimeError:
		conf.fatal("Python development headers not found (-v for details).")
	vals=['%s = %r'%(x,y)for(x,y)in zip(v,lst)]
	conf.to_log("Configuration returned from %r:\n%s\n"%(pybin,'\n'.join(vals)))
	dct=dict(zip(v,lst))
	x='MACOSX_DEPLOYMENT_TARGET'
	if dct[x]:
		env[x]=conf.environ[x]=dct[x]
	env.pyext_PATTERN='%s'+dct['SO']
	num='.'.join(env.PYTHON_VERSION.split('.')[:2])
	conf.find_program([''.join(pybin)+'-config','python%s-config'%num,'python-config-%s'%num,'python%sm-config'%num],var='PYTHON_CONFIG',msg="python-config",mandatory=False)
	if env.PYTHON_CONFIG:
		all_flags=[['--cflags','--libs','--ldflags']]
		if sys.hexversion<0x2070000:
			all_flags=[[k]for k in all_flags[0]]
		xx=env.CXX_NAME and'cxx'or'c'
		if'pyembed'in features:
			for flags in all_flags:
				conf.check_cfg(msg='Asking python-config for pyembed %r flags'%' '.join(flags),path=env.PYTHON_CONFIG,package='',uselib_store='PYEMBED',args=flags)
			try:
				conf.test_pyembed(xx)
			except conf.errors.ConfigurationError:
				if dct['Py_ENABLE_SHARED']and dct['LIBDIR']:
					env.append_unique('LIBPATH_PYEMBED',[dct['LIBDIR']])
					conf.test_pyembed(xx)
				else:
					raise
		if'pyext'in features:
			for flags in all_flags:
				conf.check_cfg(msg='Asking python-config for pyext %r flags'%' '.join(flags),path=env.PYTHON_CONFIG,package='',uselib_store='PYEXT',args=flags)
			try:
				conf.test_pyext(xx)
			except conf.errors.ConfigurationError:
				if dct['Py_ENABLE_SHARED']and dct['LIBDIR']:
					env.append_unique('LIBPATH_PYEXT',[dct['LIBDIR']])
					conf.test_pyext(xx)
				else:
					raise
		conf.define('HAVE_PYTHON_H',1)
		return
	all_flags=dct['LDFLAGS']+' '+dct['CFLAGS']
	conf.parse_flags(all_flags,'PYEMBED')
	all_flags=dct['LDFLAGS']+' '+dct['LDSHARED']+' '+dct['CFLAGS']
	conf.parse_flags(all_flags,'PYEXT')
	result=None
	if not dct["LDVERSION"]:
		dct["LDVERSION"]=env.PYTHON_VERSION
	for name in('python'+dct['LDVERSION'],'python'+env.PYTHON_VERSION+'m','python'+env.PYTHON_VERSION.replace('.','')):
		if not result and env.LIBPATH_PYEMBED:
			path=env.LIBPATH_PYEMBED
			conf.to_log("\n\n# Trying default LIBPATH_PYEMBED: %r\n"%path)
			result=conf.check(lib=name,uselib='PYEMBED',libpath=path,mandatory=False,msg='Checking for library %s in LIBPATH_PYEMBED'%name)
		if not result and dct['LIBDIR']:
			path=[dct['LIBDIR']]
			conf.to_log("\n\n# try again with -L$python_LIBDIR: %r\n"%path)
			result=conf.check(lib=name,uselib='PYEMBED',libpath=path,mandatory=False,msg='Checking for library %s in LIBDIR'%name)
		if not result and dct['LIBPL']:
			path=[dct['LIBPL']]
			conf.to_log("\n\n# try again with -L$python_LIBPL (some systems don't install the python library in $prefix/lib)\n")
			result=conf.check(lib=name,uselib='PYEMBED',libpath=path,mandatory=False,msg='Checking for library %s in python_LIBPL'%name)
		if not result:
			path=[os.path.join(dct['prefix'],"libs")]
			conf.to_log("\n\n# try again with -L$prefix/libs, and pythonXY name rather than pythonX.Y (win32)\n")
			result=conf.check(lib=name,uselib='PYEMBED',libpath=path,mandatory=False,msg='Checking for library %s in $prefix/libs'%name)
		if result:
			break
	if result:
		env.LIBPATH_PYEMBED=path
		env.append_value('LIB_PYEMBED',[name])
	else:
		conf.to_log("\n\n### LIB NOT FOUND\n")
	if Utils.is_win32 or dct['Py_ENABLE_SHARED']:
		env.LIBPATH_PYEXT=env.LIBPATH_PYEMBED
		env.LIB_PYEXT=env.LIB_PYEMBED
	conf.to_log("Include path for Python extensions (found via distutils module): %r\n"%(dct['INCLUDEPY'],))
	env.INCLUDES_PYEXT=[dct['INCLUDEPY']]
	env.INCLUDES_PYEMBED=[dct['INCLUDEPY']]
	if env.CC_NAME=='gcc':
		env.append_value('CFLAGS_PYEMBED',['-fno-strict-aliasing'])
		env.append_value('CFLAGS_PYEXT',['-fno-strict-aliasing'])
	if env.CXX_NAME=='gcc':
		env.append_value('CXXFLAGS_PYEMBED',['-fno-strict-aliasing'])
		env.append_value('CXXFLAGS_PYEXT',['-fno-strict-aliasing'])
	if env.CC_NAME=="msvc":
		from distutils.msvccompiler import MSVCCompiler
		dist_compiler=MSVCCompiler()
		dist_compiler.initialize()
		env.append_value('CFLAGS_PYEXT',dist_compiler.compile_options)
		env.append_value('CXXFLAGS_PYEXT',dist_compiler.compile_options)
		env.append_value('LINKFLAGS_PYEXT',dist_compiler.ldflags_shared)
	conf.check(header_name='Python.h',define_name='HAVE_PYTHON_H',uselib='PYEMBED',fragment=FRAG,errmsg='Distutils not installed? Broken python installation? Get python-config now!')
@conf
def check_python_version(conf,minver=None):
	assert minver is None or isinstance(minver,tuple)
	pybin=conf.env.PYTHON
	if not pybin:
		conf.fatal('could not find the python executable')
	cmd=pybin+['-c','import sys\nfor x in sys.version_info: print(str(x))']
	Logs.debug('python: Running python command %r',cmd)
	lines=conf.cmd_and_log(cmd).split()
	assert len(lines)==5,"found %r lines, expected 5: %r"%(len(lines),lines)
	pyver_tuple=(int(lines[0]),int(lines[1]),int(lines[2]),lines[3],int(lines[4]))
	result=(minver is None)or(pyver_tuple>=minver)
	if result:
		pyver='.'.join([str(x)for x in pyver_tuple[:2]])
		conf.env.PYTHON_VERSION=pyver
		if'PYTHONDIR'in conf.env:
			pydir=conf.env.PYTHONDIR
		elif'PYTHONDIR'in conf.environ:
			pydir=conf.environ['PYTHONDIR']
		else:
			if Utils.is_win32:
				(python_LIBDEST,pydir)=conf.get_python_variables(["get_config_var('LIBDEST') or ''","get_python_lib(standard_lib=0) or ''"])
			else:
				python_LIBDEST=None
				(pydir,)=conf.get_python_variables(["get_python_lib(standard_lib=0, prefix=%r) or ''"%conf.env.PREFIX])
			if python_LIBDEST is None:
				if conf.env.LIBDIR:
					python_LIBDEST=os.path.join(conf.env.LIBDIR,'python'+pyver)
				else:
					python_LIBDEST=os.path.join(conf.env.PREFIX,'lib','python'+pyver)
		if'PYTHONARCHDIR'in conf.env:
			pyarchdir=conf.env.PYTHONARCHDIR
		elif'PYTHONARCHDIR'in conf.environ:
			pyarchdir=conf.environ['PYTHONARCHDIR']
		else:
			(pyarchdir,)=conf.get_python_variables(["get_python_lib(plat_specific=1, standard_lib=0, prefix=%r) or ''"%conf.env.PREFIX])
			if not pyarchdir:
				pyarchdir=pydir
		if hasattr(conf,'define'):
			conf.define('PYTHONDIR',pydir)
			conf.define('PYTHONARCHDIR',pyarchdir)
		conf.env.PYTHONDIR=pydir
		conf.env.PYTHONARCHDIR=pyarchdir
	pyver_full='.'.join(map(str,pyver_tuple[:3]))
	if minver is None:
		conf.msg('Checking for python version',pyver_full)
	else:
		minver_str='.'.join(map(str,minver))
		conf.msg('Checking for python version >= %s'%(minver_str,),pyver_full,color=result and'GREEN'or'YELLOW')
	if not result:
		conf.fatal('The python version is too old, expecting %r'%(minver,))
PYTHON_MODULE_TEMPLATE='''
import %s as current_module
version = getattr(current_module, '__version__', None)
if version is not None:
	print(str(version))
else:
	print('unknown version')
'''
@conf
def check_python_module(conf,module_name,condition=''):
	msg="Checking for python module %r"%module_name
	if condition:
		msg='%s (%s)'%(msg,condition)
	conf.start_msg(msg)
	try:
		ret=conf.cmd_and_log(conf.env.PYTHON+['-c',PYTHON_MODULE_TEMPLATE%module_name])
	except Exception:
		conf.end_msg(False)
		conf.fatal('Could not find the python module %r'%module_name)
	ret=ret.strip()
	if condition:
		conf.end_msg(ret)
		if ret=='unknown version':
			conf.fatal('Could not check the %s version'%module_name)
		from distutils.version import LooseVersion
		def num(*k):
			if isinstance(k[0],int):
				return LooseVersion('.'.join([str(x)for x in k]))
			else:
				return LooseVersion(k[0])
		d={'num':num,'ver':LooseVersion(ret)}
		ev=eval(condition,{},d)
		if not ev:
			conf.fatal('The %s version does not satisfy the requirements'%module_name)
	else:
		if ret=='unknown version':
			conf.end_msg(True)
		else:
			conf.end_msg(ret)
def configure(conf):
	v=conf.env
	if Options.options.pythondir:
		v.PYTHONDIR=Options.options.pythondir
	if Options.options.pythonarchdir:
		v.PYTHONARCHDIR=Options.options.pythonarchdir
	if Options.options.nopycache:
		v.NOPYCACHE=Options.options.nopycache
	conf.find_program('python',var='PYTHON',value=Options.options.python or sys.executable)
	v.PYFLAGS=''
	v.PYFLAGS_OPT='-O'
	v.PYC=getattr(Options.options,'pyc',1)
	v.PYO=getattr(Options.options,'pyo',1)
	try:
		v.PYTAG=conf.cmd_and_log(conf.env.PYTHON+['-c',"import imp;print(imp.get_tag())"]).strip()
	except Errors.WafError:
		pass
def options(opt):
	pyopt=opt.add_option_group("Python Options")
	pyopt.add_option('--nopyc',dest='pyc',action='store_false',default=1,help='Do not install bytecode compiled .pyc files (configuration) [Default:install]')
	pyopt.add_option('--nopyo',dest='pyo',action='store_false',default=1,help='Do not install optimised compiled .pyo files (configuration) [Default:install]')
	pyopt.add_option('--nopycache',dest='nopycache',action='store_true',help='Do not use __pycache__ directory to install objects [Default:auto]')
	pyopt.add_option('--python',dest="python",help='python binary to be used [Default: %s]'%sys.executable)
	pyopt.add_option('--pythondir',dest='pythondir',help='Installation path for python modules (py, platform-independent .py and .pyc files)')
	pyopt.add_option('--pythonarchdir',dest='pythonarchdir',help='Installation path for python extension (pyext, platform-dependent .so or .dylib files)')


text:
class Admin::Con::ScheduledSessionsController  < Admin::Con::CurrentConferenceController

  # handles the time zone convertion from local to UTC here
  # uses the tzinfo_timezone plugin and tzinfo gem

  active_scaffold :scheduled_sessions do | config |
    columns = [:submission, :track, :start_time_local, :end_time_local]
    config.list.columns =  columns
    config.show.columns = columns
    config.create.columns = [:submission, :track, :start_time]
    config.update.columns = [:submission, :track, :start_time]
    config.search.columns << :submission
    config.columns[:submission].ui_type = :select
    config.columns[:track].ui_type = :select
  end

  def conditions_for_collection
    if @current_conference
      ids = @current_conference.scheduled_sessions.collect{|s| s.id }
      if ids.size > 0
        return ['scheduled_sessions.id in (?)', ids]
      else
        return [ ]
      end
    end
  end

  def do_new
    @record = ScheduledSession.new
    apply_constraints_to_record(@record)
    if @current_conference
      @record.start_time = @current_conference.start_date.to_time
      @record.end_time = @record.start_time + (60 * 60)
    end
  end

  def before_create_save(record)
    convert_times_from_local_to_utc record
  end

  def before_update_save(record)
    convert_times_from_local_to_utc record
  end

  def convert_times_from_local_to_utc(record)

      if record.duration
        record.end_time = record.start_time + (record.duration * 60)
      end

      [:start_time, :end_time].each do |time|

        # now set the date portion to the same date
        # as the associated track

        record[time] = Time.utc( record.track.date.year,
                                  record.track.date.month,
                                  record.track.date.day,
                                  record[time].hour,
                                  record[time].min,
                                  record[time].sec,0)
      end

    # Convert the timezone before saving
    # doing this here instead of a callback
    # to ensure the conversion happens only ONCE

    [:start_time, :end_time].each do |time|
      # first convert from local to utc
      tz = ActiveSupport::TimeZone[ record.track.conference.time_zone ]
      record[time] = tz.local_to_utc record[time]
    end
  end

end


text:
<?php
namespace PhpEmber;

class AttributeInfo {

	/**
	 * @var string
	 */
	public $name;

	/**
	 * @var boolean
	 */
	public $required = false;

	/**
	 * @var string
	 */
	public $relatedType;

	/**
	 * @var string
	 */
	public $type;

	/**
	 * @var boolean
	 */
	public $sortable = false;

	/**
	 * @var boolean
	 */
	public $readable = true;

	/**
	 * @var boolean
	 */
	public $writable = false;

	/**
	 * @var string
	 */
	public $dateFormat = null;

	function __construct($name, $type = null, $relatedType = null) {
		$this->name = $name;
		$this->relatedType = $relatedType;
		$this->type = $type;
	}

}


text:
module Jekyll
  module Commands
    class Clean < Command
      class << self
        def init_with_program(prog)
          prog.command(:clean) do |c|
            c.syntax "clean [subcommand]"
            c.description "Clean the site " \
                  "(removes site output and metadata file) without building."

            add_build_options(c)

            c.action do |_, options|
              Jekyll::Commands::Clean.process(options)
            end
          end
        end

        def process(options)
          options = configuration_from_options(options)
          destination = options["destination"]
          metadata_file = File.join(options["source"], ".jekyll-metadata")
          sass_cache = ".sass-cache"

          remove(destination, :checker_func => :directory?)
          remove(metadata_file, :checker_func => :file?)
          remove(sass_cache, :checker_func => :directory?)
        end

        def remove(filename, checker_func: :file?)
          if File.public_send(checker_func, filename)
            Jekyll.logger.info "Cleaner:", "Removing #{filename}..."
            FileUtils.rm_rf(filename)
          else
            Jekyll.logger.info "Cleaner:", "Nothing to do for #{filename}."
          end
        end
      end
    end
  end
end


text:
package org.instantlogic.fabric.value.impl;

import org.instantlogic.fabric.Instance;
import org.instantlogic.fabric.model.Attribute;
import org.instantlogic.fabric.value.ReadOnlyAttributeValues;
import org.instantlogic.fabric.value.Values;

public class ReadOnlyAttributeValuesImpl<I extends Instance, Item extends Object>
	extends ReadOnlyAttributeValueImpl<I, Values<Item>>
	implements ReadOnlyAttributeValues<I, Item>{

	public ReadOnlyAttributeValuesImpl(I forInstance, Attribute<I, Values<Item>, ? extends Object> model) {
		super(forInstance, model);
	}

}


text:
'''
Copyright (c)2015 Rob "N3X15" Nelson

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

:author: Rob "N3X15" Nelson <nexisentertainment@gmail.com>
'''

from byond.basetypes import BYONDFileRef, BYONDList, BYONDString, BYONDValue
import pyparsing as pyp

class PPStackElement(object):
    def __init__(self, ends=[], toggles=[], blocking=False):
        self.blocking = blocking
        self.ends = ends
        self.toggles = toggles

    def isBlocking(self):
        return self.blocking

    def gotToken(self, name):
        if name in self.ends:
            return False  # Pop off stack
        if name in self.toggles:
            self.blocking = not self.blocking
        return True  # continue

class IfDefElement(PPStackElement):
    def __init__(self, state):
        super(PPStackElement, self).__init__(self, ends=['endif'], toggles=['else'], blocking=state)

class DreamSyntax(object):
    def __init__(self, list_only=False, simplify_lists=False):
        if list_only:
            self.syntax = self.buildListSyntax()
        else:
            self.syntax = self.buildSyntax()

        self.simplify_lists = simplify_lists

        #: Preprocessor defines.
        self.macros = {}

        #: Current #ifdef stack. (PPStackElement)
        self.ifstack = []

        self.atomContext = []

    def ParseString(self, filename):
        try:
            return self.syntax.parseString(string)
        except pyp.ParseException, err:
            print err.line
            print "-"*(err.column - 1) + "^"
            print err

    def buildSyntax(self):
        '''WIP'''
        dreamScript = pyp.Forward()

        # Constants
        singlelineString = pyp.QuotedString('"', '\\').setResultsName('string').setParseAction(self.makeString)
        fileRef = pyp.QuotedString("'", '\\').setResultsName('fileRef').setParseAction(self.makeFileRef)
        multilineString = pyp.QuotedString(quoteChar='{"', endQuoteChar='"}', multiline=True).setResultsName('string').setParseAction(self.makeString)
        number = pyp.Regex(r'\d+(\.\d*)?([eE]\d+)?').setResultsName('number').setParseAction(self.makeNumber)

        # Other symbols
        listStart = pyp.Suppress('list(')
        listEnd = pyp.Suppress(')')

        VAR_GLOBAL = pyp.Keyword('global')
        VAR_CONST = pyp.Keyword('const')
        SLASH = pyp.Literal('/')
        EQUAL = pyp.Literal('=')
        VAR = pyp.Keyword('var')

        #############################
        # Grammar
        #############################

        constant = singlelineString | fileRef | multilineString | number | dreamList

        #  Lists
        listElement = constant | (constant + EQUAL + constant)
        listElement = pyp.operatorPrecedence(listElement, [
                                ("=", 2, pyp.opAssoc.LEFT,),
                                ])
        listContents = pyp.delimitedList(listElement)
        dreamList << pyp.Group(listStart + listContents + listEnd)
        dreamList.setParseAction(self.handleList)

        #  Paths
        relpath = pyp.ident | relpath + SLASH + pyp.ident
        abspath = SLASH + relpath
        path = (abspath | relpath).setParseAction(self.handlePath)
        pathslash = path + SLASH

        #  Preprocessor stuff
        ppStatement = pyp.Forward()

        ppDefine = pyp.Keyword('#define') + pyp.ident.setResultsName('name') + pyp.restOfLine.setResultsName('value')
        ppDefine.setParseAction(self.handlePPDefine)
        ppUndef = pyp.Keyword('#undef') + pyp.ident.setResultsName('name')
        ppUndef.setParseAction(self.handlePPUndef)

        ppIfdef = (pyp.Keyword('#ifdef') + pyp.ident.setResultsName('name')).setParseAction(self.handlePPIfdef)
        ppIfndef = (pyp.Keyword('#ifndef') + pyp.ident.setResultsName('name')).setParseAction(self.handlePPIfndef)
        ppElse = (pyp.Keyword('#else') + pyp.ident.setResultsName('name')).setParseAction(self.handlePPElse)
        ppEndif = pyp.Keyword('#endif').setParseAction(self.handlePPElse)

        ppStatement = pyp.lineStart + (ppIfdef | ppIfndef | ppElse | ppEndif)

        # Var Declarations
        ##########################
        var_modifiers = pyp.ZeroOrMore(SLASH + (VAR_GLOBAL | VAR_CONST)).setResultsName('modifiers')
        var_assignment = EQUAL + constant
        varblock_inner_ref = pyp.ident.setResultsName('name') + pyp.Optional(var_assignment)
        var_argument = VAR + pyp.Optional(abspath) + SLASH + pyp.ident.setResultsName('name') + pyp.Optional(var_assignment)
        varblock_inner_decl = var_modifiers + pyp.Optional(abspath) + SLASH + varblock_inner_ref
        varblock_element = varblock_inner_decl | varblock_inner_ref
        varblock = VAR + pyp.indentedBlock(var_blockinner_decl)
        inline_vardecl = VAR + varblock_inner_decl
        vardecl = varblock | inline_vardecl

        # Proc Declarations
        PROC = pyp.Keyword('proc')
        proc_args = '(' + pyp.delimitedList(var_argument | pyp.ident.setResultsName('name')) + ')'
        procblock_proc = pyp.ident.setResultsName('name') + proc_args + pyp.indentedBlock(proc_instructions)
        procblock = PROC + pyp.indentedBlock(procblock_proc, [1])

        # Atom blocks
        atomdecl = pyp.Forward()
        atomdecl << path + pyp.indentedBlock(vardecl | atomdecl | procdecl , [1])

        return dreamScript

    def buildListSyntax(self):
        dreamList = pyp.Forward()

        # Literals
        singlelineString = pyp.QuotedString('"', '\\').setResultsName('string').setParseAction(self.makeListString)
        fileRef = pyp.QuotedString("'", '\\').setResultsName('fileRef').setParseAction(self.makeFileRef)
        multilineString = pyp.QuotedString(quoteChar='{"', endQuoteChar='"}', multiline=True).setResultsName('string').setParseAction(self.makeListString)
        number = pyp.Regex(r'\d+(\.\d*)?([eE]\d+)?').setResultsName('number').setParseAction(self.makeListNumber)

        # Other symbols
        listStart = pyp.Suppress('list(')
        listEnd = pyp.Suppress(')')

        # Grammar
        listConstant = singlelineString | fileRef | multilineString | number | dreamList
        listElement = listConstant | (listConstant + '=' + listConstant)
        listElement = pyp.operatorPrecedence(listElement, [
                                ("=", 2, pyp.opAssoc.LEFT,),
                                ])
        listContents = pyp.delimitedList(listElement)
        dreamList << pyp.Group(listStart + listContents + listEnd)
        dreamList.setParseAction(self.makeList)

        return dreamList

    def buildMapSyntax(self):
        '''Subset of grammar for DMM files.

           "aai" = (/obj/structure/sign/securearea{desc = "A warning sign which reads 'HIGH VOLTAGE'"; icon_state = "shock"; name = "HIGH VOLTAGE"; pixel_y = -32},/turf/space,/area)
        '''
        dreamList = pyp.Forward()

        # Literals
        singlelineString = pyp.QuotedString('"', '\\').setResultsName('string').setParseAction(self.makeListString)
        fileRef = pyp.QuotedString("'", '\\').setResultsName('fileRef').setParseAction(self.makeFileRef)
        multilineString = pyp.QuotedString(quoteChar='{"', endQuoteChar='"}', multiline=True).setResultsName('string').setParseAction(self.makeListString)
        number = pyp.Regex(r'\-?\d+(\.\d*)?([eE]\d+)?').setResultsName('number').setParseAction(self.makeListNumber)

        #  Paths
        relpath = pyp.ident | relpath + SLASH + pyp.ident
        abspath = SLASH + relpath
        path = (abspath | relpath).setParseAction(self.handlePath)
        pathslash = path + SLASH

        # Other symbols
        listStart = pyp.Suppress('list(')
        openParen = pyp.Suppress("(")
        closeParen = pyp.Suppress(')')

        # Grammar
        listConstant = singlelineString | fileRef | multilineString | number | dreamList | abspath
        listElement = listConstant | (listConstant + '=' + listConstant)
        listElement = pyp.operatorPrecedence(listElement, [
                                ("=", 2, pyp.opAssoc.LEFT,),
                                ])
        listContents = pyp.delimitedList(listElement)
        dreamList << pyp.Group(listStart + listContents + closeParen)
        dreamList.setParseAction(self.makeList)

        # DMM Atom definition
        atomDefProperty = pyp.ident + "=" + listConstant
        atomDefProperty = pyp.operatorPrecedence(atomDefProperty, [
                                ("=", 2, pyp.opAssoc.LEFT,),
                                ])
        atomDefPropertyListContents = pyp.delimitedList(listElement, delim=';')
        atomDefProperties = pyp.Suppress("{") + atomDefPropertyListContents + pyp.Suppress("}")
        atomDef = abspath | abspath + atomDefProperties

        # DMM Tile Definition
        tileDefListContents = pyp.delimitedList(atomDef)
        tileDefAtomList = openParen + tileDefListContents + closeParen
        tileDef = singlelineString + '=' + tileDefAtomList
        tileDef.setParseAction(self.makeTileDef)
        return tileDef

    def makeListString(self, s, l, t):
        return self.makeString(s, l, t, True)
    def makeString(self, s, l, toks, from_list=False):
        # print('makeString(%r)' % toks[0])
        if self.simplify_lists:
            return [toks[0]]
        return [BYONDString(toks[0])]

    def makeFileRef(self, s, l, toks):
        # print('makeFileRef(%r)' % toks[0])
        return [BYONDFileRef(toks[0])]

    def makeListNumber(self, s, l, t):
        return self.makeString(s, l, t, True)

    def makeNumber(self, s, l, toks, from_list=False):
        # print('makeNumber(%r)' % toks[0])
        return [BYONDValue(float(toks[0]))]

    def makeList(self, toks):
        # print('makeList')
        # for i in range(len(toks)):
        #   print('{} = {}'.format(i,toks[i]))
        toks = toks[0]
        print('makeList(%r)' % toks)
        if len(toks[0]) == 1:  # Constant, so a non-assoc list.
            l = []
            for tok in toks:
                l.append(tok[0][1])
            return l
        else:  # Associative
            l = {}
            for k, _, v in toks:
                l[k] = v
            return l

def ParseDreamList(string):
    return DreamSyntax(list_only=True, simplify_lists=True).ParseString(string)


text:
Security Issues
===============

If you think that you have found a security issue in Sylius, don't use the bug tracker and do not post it publicly.
Instead, all security issues must be sent to **security@sylius.com**.
Emails sent to this address are forwarded to the Sylius Core Team Members responsible for the framework's security.
Please do not reveal the issue publicly until the security fix is released and announced by Sylius.

.. note::

    We will not publish security releases during Saturday or Sunday,
    except for the vulnerabilities made public.


text:
/* NOTE: This file is autogenerated, do not edit this file directly.*/

#ifndef Charts_FadeInEffect_hpp
#define Charts_FadeInEffect_hpp

#include <TRCharts/Common.hpp>
#include <TRCodegenSupport/BaseObject.hpp>
#include <TRCharts/AnimationEffect.hpp>

namespace Charts
{

	class FadeInEffect;
	class Drawable;

	class GeneratedFadeInEffect : public CodegenSupport::BaseObject, public Charts::AnimationEffect
	{
	public:
		virtual ~GeneratedFadeInEffect(void);

		std::shared_ptr<FadeInEffect> getSharedPtr(void);

		std::shared_ptr<const FadeInEffect> getSharedPtr(void) const;

		virtual const std::vector<std::shared_ptr<Charts::Drawable>> & getDrawableList(void) const = 0;

		virtual void setDrawableList(const std::vector<std::shared_ptr<Charts::Drawable>> & value) = 0;

		virtual void apply(double position, double duration) const = 0;

	protected:
		GeneratedFadeInEffect(void);

	};
}

#include <TRCharts/Impl/FadeInEffectImpl.hpp>

#endif


text:
import Parchment from 'parchment';
import Quill from '../core/quill';
import Module from '../core/module';
import CodeBlock from '../formats/code';

class SyntaxCodeBlock extends CodeBlock {
  replaceWith(block) {
    this.domNode.textContent = this.domNode.textContent;
    this.attach();
    super.replaceWith(block);
  }

  highlight(highlight) {
    let text = this.domNode.textContent;
    if (this.cachedText !== text) {
      if (text.trim().length > 0 || this.cachedText == null) {
        this.domNode.innerHTML = highlight(text);
        this.domNode.normalize();
        this.attach();
      }
      this.cachedText = text;
    }
  }
}
SyntaxCodeBlock.className = 'ql-syntax';

let CodeToken = new Parchment.Attributor.Class('token', 'hljs', {
  scope: Parchment.Scope.INLINE
});

class Syntax extends Module {
  static register() {
    Quill.register(CodeToken, true);
    Quill.register(SyntaxCodeBlock, true);
  }

  constructor(quill, options) {
    super(quill, options);
    if (typeof this.options.highlight !== 'function') {
      throw new Error('Syntax module requires highlight.js. Please include the library on the page before Quill.');
    }
    let timer = null;
    this.quill.on(Quill.events.SCROLL_OPTIMIZE, () => {
      clearTimeout(timer);
      timer = setTimeout(() => {
        this.highlight();
        timer = null;
      }, this.options.interval);
    });
    this.highlight();
  }

  highlight() {
    if (this.quill.selection.composing) return;
    this.quill.update(Quill.sources.USER);
    let range = this.quill.getSelection();
    this.quill.scroll.descendants(SyntaxCodeBlock).forEach((code) => {
      code.highlight(this.options.highlight);
    });
    this.quill.update(Quill.sources.SILENT);
    if (range != null) {
      this.quill.setSelection(range, Quill.sources.SILENT);
    }
  }
}
Syntax.DEFAULTS = {
  highlight: (function() {
    if (window.hljs == null) return null;
    return function(text) {
      let result = window.hljs.highlightAuto(text);
      return result.value;
    };
  })(),
  interval: 1000
};

export { SyntaxCodeBlock as CodeBlock, CodeToken, Syntax as default};


text:
package de.uni_koblenz.schemex.util;

import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

/**
 * Helper-class for generating MD5-hashs
 * @author Mathias
 *
 */
public class Hash {

	/**
	 * Generating MD5 hash values
	 *
	 * @param _input string to be md5-hashed
	 * @return md5-hashed _input-string
	 * @throws NoSuchAlgorithmException
	 */
	public static String md5(String _input) {
		String hashtext = "";
		try {
			MessageDigest m = MessageDigest.getInstance("MD5");
			m.reset();
			m.update(_input.getBytes());
			byte[] digest = m.digest();
			BigInteger bigInt = new BigInteger(1,digest);
			hashtext = bigInt.toString(16);
			// fill up with zeros to get a string with length 32
			while(hashtext.length() < 32 ){
			  hashtext = "0"+hashtext;
			}

		}
		catch (NoSuchAlgorithmException e) {
			hashtext = "MD5 not found";
		}
		return hashtext;
	}

}


text:
@echo off
rem
rem
rem  #############################################################
rem  ##                                                         ##
rem  ##  linkgui.bat  --  link the TINKER programs for FFE use  ##
rem  ##           (Intel Fortran for Windows Version)           ##
rem  ##                                                         ##
rem  #############################################################
rem
rem
rem  Create a variable with the static libraries to link against;
rem  Change "javalib" to reflect location of the Java library
rem
set javalib="C:\Program Files\Java\jdk1.6.0_22\lib\jvm.lib"
rem
rem  Link using Intel compiler suite and compatibility library
rem
ifort /libs:static alchemy.obj tinker.lib %javalib%
ifort /libs:static analyze.obj tinker.lib %javalib%
ifort /libs:static anneal.obj tinker.lib %javalib%
ifort /libs:static archive.obj tinker.lib %javalib%
ifort /libs:static bar.obj tinker.lib %javalib%
ifort /libs:static correlate.obj tinker.lib %javalib%
ifort /libs:static crystal.obj tinker.lib %javalib%
ifort /libs:static diffuse.obj tinker.lib %javalib%
ifort /libs:static distgeom.obj tinker.lib %javalib%
ifort /libs:static document.obj tinker.lib %javalib%
ifort /libs:static dynamic.obj tinker.lib %javalib%
ifort /libs:static gda.obj tinker.lib %javalib%
ifort /libs:static intedit.obj tinker.lib %javalib%
ifort /libs:static intxyz.obj tinker.lib %javalib%
ifort /libs:static minimize.obj tinker.lib %javalib%
ifort /libs:static minirot.obj tinker.lib %javalib%
ifort /libs:static minrigid.obj tinker.lib %javalib%
ifort /libs:static molxyz.obj tinker.lib %javalib%
ifort /libs:static monte.obj tinker.lib %javalib%
ifort /libs:static newton.obj tinker.lib %javalib%
ifort /libs:static newtrot.obj tinker.lib %javalib%
ifort /libs:static nucleic.obj tinker.lib %javalib%
ifort /libs:static optimize.obj tinker.lib %javalib%
ifort /libs:static optirot.obj tinker.lib %javalib%
ifort /libs:static optrigid.obj tinker.lib %javalib%
ifort /libs:static path.obj tinker.lib %javalib%
ifort /libs:static pdbxyz.obj tinker.lib %javalib%
ifort /libs:static polarize.obj tinker.lib %javalib%
ifort /libs:static prmedit.obj tinker.lib %javalib%
ifort /libs:static protein.obj tinker.lib %javalib%
ifort /libs:static pss.obj tinker.lib %javalib%
ifort /libs:static pssrigid.obj tinker.lib %javalib%
ifort /libs:static pssrot.obj tinker.lib %javalib%
ifort /libs:static radial.obj tinker.lib %javalib%
ifort /libs:static saddle.obj tinker.lib %javalib%
ifort /libs:static scan.obj tinker.lib %javalib%
ifort /libs:static sniffer.obj tinker.lib %javalib%
ifort /libs:static spacefill.obj tinker.lib %javalib%
ifort /libs:static spectrum.obj tinker.lib %javalib%
ifort /libs:static superpose.obj tinker.lib %javalib%
ifort /libs:static sybylxyz.obj tinker.lib %javalib%
ifort /libs:static testgrad.obj tinker.lib %javalib%
ifort /libs:static testhess.obj tinker.lib %javalib%
ifort /libs:static testpair.obj tinker.lib %javalib%
ifort /libs:static testpol.obj tinker.lib %javalib%
ifort /libs:static testrot.obj tinker.lib %javalib%
ifort /libs:static timer.obj tinker.lib %javalib%
ifort /libs:static timerot.obj tinker.lib %javalib%
ifort /libs:static torsfit.obj tinker.lib %javalib%
ifort /libs:static valence.obj tinker.lib %javalib%
ifort /libs:static vibbig.obj tinker.lib %javalib%
ifort /libs:static vibrate.obj tinker.lib %javalib%
ifort /libs:static vibrot.obj tinker.lib %javalib%
ifort /libs:static xtalfit.obj tinker.lib %javalib%
ifort /libs:static xtalmin.obj tinker.lib %javalib%
ifort /libs:static xyzedit.obj tinker.lib %javalib%
ifort /libs:static xyzint.obj tinker.lib %javalib%
ifort /libs:static xyzpdb.obj tinker.lib %javalib%
ifort /libs:static xyzsybyl.obj tinker.lib %javalib%


text:
package eu.amidst.core.exponentialfamily;

import eu.amidst.core.Main;
import eu.amidst.core.datastream.DataInstance;
import eu.amidst.core.datastream.DataStream;
import eu.amidst.core.io.BayesianNetworkLoader;
import eu.amidst.core.models.BayesianNetwork;
import eu.amidst.core.utils.BayesianNetworkSampler;
import org.junit.Assert;
import org.junit.Test;

import java.io.IOException;

/**
 * Created by Hanen on 06/02/15.
 */

public class BaseDistributionMultinomialParentsTest {

    // TODO: Consider smoothing method!!!!

    @Test
    public void testingProbabilities_MultinomialMultinomialParents() throws IOException, ClassNotFoundException  {

        BayesianNetwork testnet = BayesianNetworkLoader.loadFromFile("../networks/dataWeka/asia.bn");

        //Here we had to modify the CPT of the variable E because no smoothing is considered yet
        //Multinomial_MultinomialParents distE = testnet.getConditionalDistribution(testnet.getVariables().getVariableByName("E"));
        //distE.getMultinomial(0).setProbabilities(new double[]{0.9, 0.1});
        //distE.getMultinomial(1).setProbabilities(new double[]{0.9, 0.1});
        //distE.getMultinomial(2).setProbabilities(new double[]{0.9, 0.1});
        //distE.getMultinomial(3).setProbabilities(new double[]{0.1, 0.9});

        if (Main.VERBOSE) System.out.println(testnet.toString());

        if (Main.VERBOSE) System.out.println("\nMultinomial_MultinomialParents probabilities comparison \n ");

        //Sampling
        BayesianNetworkSampler sampler = new BayesianNetworkSampler(testnet);
        sampler.setSeed(0);
        DataStream<DataInstance> data = sampler.sampleToDataStream(10000);

        //Compare predictions between distributions and EF distributions.

        EF_BayesianNetwork ef_testnet = new EF_BayesianNetwork(testnet);

        for(DataInstance e: data) {
            double ef_logProb = 0, logProb = 0;
                for (EF_ConditionalDistribution ef_dist : ef_testnet.getDistributionList()) {
                    ef_logProb += ef_dist.computeLogProbabilityOf(e);
                }

            logProb = testnet.getLogProbabiltyOf(e);

            //if (Main.VERBOSE) System.out.println("Distributions: "+ logProb + " = EF-Distributions: "+ ef_logProb);
            Assert.assertEquals(logProb, ef_logProb, 0.0001);

        }
    }

    @Test
    public void testingProbabilities_NormalMultinomialParents() throws IOException, ClassNotFoundException  {

        BayesianNetwork testnet = BayesianNetworkLoader.loadFromFile("../networks/simulated/Normal_MultinomialParents.bn");

        if (Main.VERBOSE) System.out.println(testnet.toString());
        if (Main.VERBOSE) System.out.println("\nNormal_MultinomialParents probabilities comparison \n ");

        //Sampling
        BayesianNetworkSampler sampler = new BayesianNetworkSampler(testnet);
        sampler.setSeed(0);
        DataStream<DataInstance> data = sampler.sampleToDataStream(10000);

        //Compare predictions between distributions and EF distributions.

        EF_BayesianNetwork ef_testnet = new EF_BayesianNetwork(testnet);

        for(DataInstance e: data){
            double ef_logProb = 0,logProb = 0;
            for(EF_ConditionalDistribution ef_dist: ef_testnet.getDistributionList()){
                ef_logProb += ef_dist.computeLogProbabilityOf(e);
            }
            logProb = testnet.getLogProbabiltyOf(e);
            //if (Main.VERBOSE) System.out.println("Distributions: "+ logProb + " = EF-Distributions: "+ ef_logProb);
            Assert.assertEquals(logProb, ef_logProb, 0.0001);

        }
    }

    @Test
    public void testingProbabilities_NormalMultinomialNormalParents() throws IOException, ClassNotFoundException  {

        BayesianNetwork testnet = BayesianNetworkLoader.loadFromFile("../networks/simulated/Normal_MultinomialNormalParents.bn");

        if (Main.VERBOSE) System.out.println(testnet.toString());

        if (Main.VERBOSE) System.out.println("\nNormal_MultinomialNormalParents probabilities comparison \n ");

        //Sampling
        BayesianNetworkSampler sampler = new BayesianNetworkSampler(testnet);
        sampler.setSeed(0);
        DataStream<DataInstance> data = sampler.sampleToDataStream(10000);

        //Compare predictions between distributions and EF distributions.

        EF_BayesianNetwork ef_testnet = new EF_BayesianNetwork(testnet);

        for(DataInstance e: data){
            double ef_logProb = 0,logProb = 0;
            for(EF_ConditionalDistribution ef_dist: ef_testnet.getDistributionList()){
                ef_logProb += ef_dist.computeLogProbabilityOf(e);
            }

            logProb = testnet.getLogProbabiltyOf(e);

            //if (Main.VERBOSE) System.out.println("Distributions: "+ logProb + " = EF-Distributions: "+ ef_logProb);
            Assert.assertEquals(logProb, ef_logProb, 0.0001);

        }
    }

}


text:
//
//  @file SCLFlicManager.h
//  @framework fliclib
//
//  Created by Anton Meier on 2014-06-18.
//  Copyright (c) 2016 Shortcut Labs. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreBluetooth/CoreBluetooth.h>
#import "SCLFlicButton.h"

/*!
 *  @enum SCLFlicManagerBluetoothState
 *
 *  @discussion These enums represents the different possible states that the manager can be in at any given time.
 *              The manager needs to be in the SCLFlicManagerBluetoothStatePoweredOn state in order for it to perform
 *              any kind of communication with a flic.
 *
 */
typedef NS_ENUM(NSInteger, SCLFlicManagerBluetoothState) {
    /**
     * This state is the desired state that is needed when communicating with a flic.
     */
    SCLFlicManagerBluetoothStatePoweredOn = 0,
    /**
     * This state means that the manager is currently powered off and will not be able to perform any bluetooth related tasks.
     * This will for example be the case when bluetooth is turned off on the iOS device.
     */
    SCLFlicManagerBluetoothStatePoweredOff,
    /**
     * The manager is resetting and will most likely switch to the powered on state shortly.
     */
    SCLFlicManagerBluetoothStateResetting,
    /**
     * The manager was not able to turn on because the iOS device that it is currently running on does not support Bluetooth Low Energy.
     */
    SCLFlicManagerBluetoothStateUnsupported,
    /**
     * The manager was not able to turn on because the app is not authorized to to use Bluetooth Low Energy.
     */
    SCLFlicManagerBluetoothStateUnauthorized,
    /**
     * The manager is in an unknown state, it will most likely change shortly.
     */
    SCLFlicManagerBluetoothStateUnknown,
};

@protocol SCLFlicManagerDelegate;

/*!
 *  @class SCLFlicManager
 *
 *  @discussion     An instance of this class is required in order to perform any bluetooth LE communication with
 *                  the flic. The object will keep track of all the flics that are associated to the specific iOS device.
 *                  It is important to mention that the SCLFlicManager does not support the regular state preservation
 *                  and restoration protocol for view controllers, meaning that it does not support NSCoding.
 *                  Instead, all of the state preservation will be taken cared of for you by the manager.
 *                  Simply reinstantiate it using the initWithDelegate:appID:appSecret:andRestoreState: method
 *                  and collect the associated flic objects using the knownButtons: method.
 *
 */
@interface SCLFlicManager : NSObject {

}

/*!
 *  @property delegate
 *
 *  @discussion     The delegate object that will receive all the flic related events. See the definition of the
 *                  SCLFlicManagerDelegate to see what callbacks are available.
 *
 */
@property(weak, nonatomic, nullable) id<SCLFlicManagerDelegate> delegate;

/*!
 *  @property defaultButtonDelegate
 *
 *  @discussion     The default delegate that will be assigned to all buttons both when they are grabbed, but also during state
 *                  restoration. This is not required since the button delegates can be set manually. If you decide to set them
 *                  manually then you have to also remember to set them on on every application restoration when the manager
 *                  sends the flicManagerDidRestoreState callback.
 *
 */
@property(weak, nonatomic, nullable) id<SCLFlicButtonDelegate> defaultButtonDelegate;

/*!
 *  @property bluetoothState
 *
 *  @discussion     The current bluetoothState of the flic manager. A bluetoothDidChangeState event will be generated
 *                  on the SCLFlicManagerDelegate whenever this state has changed. When the flic manager is initialized
 *                  the state will be SCLFlicManagerBluetoothStateUnknown by default. You will not be able to do any
 *                  bluetooth related tasks until the manager properly changes to SCLFlicManagerBluetoothStateOn.
 *
 */
@property (nonatomic, readonly) SCLFlicManagerBluetoothState bluetoothState;

/*!
 *  @property enabled
 *
 *  @discussion     This is a flag that lets you know if the manager is enabled for Bluetooth LE communication. This can be toggled on/off using the
 *                  enable and disable. When This property is set to NO, then no Bluetooth LE communication
 *                  will be allowed. This means that no communication with a flic can be made.
 */
@property (readonly, getter=isEnabled) BOOL enabled;

/*!
 *  @method sharedManager
 *
 *  @discussion     Use this to access the manager singleton. This will only work if a call to configureWithDelegate:appID:appSecret:backgroundExecution:
 *                  has been made once this app session, otherwise nil will be returned.
 */
+ (instancetype _Nullable) sharedManager;

/*!
 *  @method configureWithDelegate:defaultButtonDelegate:appID:appSecret:backgroundExecution:
 *
 *  @discussion     The initialization call to use when you want to create a manager. This will initiate a SCLFlicManager and do the proper
 *                  preparation needed in order to start the bluetooth communication with flic buttons. The BOOL restore included
 *                  in the initialization call decides whether a brand new manager will be created or if it should be created and restored to
 *                  the last known state of the most previous manager created by the same app. If you choose to create a new manager then any old
 *                  manager (if existing) will be irreversibly cleared. Using more than one manager in the same application is not supported.
 *

 *                  When choosing the restore option all settings on the manager will be restored. This will also recreate all SCLFlicButtons
 *                  that had previously been used with this manager unless they had been manually removed using the forgetButton:
 *                  method. All the flic objects that had a pending connection before will be set to the same state after restoration. When the
 *                  restoration process is complete the manager will call the flicManagerDidRestoreState: method of its delegate
 *                  object. At that point it is recommended that you call knownButtons: in order to collect all the flic objects and
 *                  re-set their delegate.
 *
 *  @param delegate         The delegate that all callbacks will be sent to.
 *  @param buttonDelegate   This delegate will automatically be set to new buttons and old buttons on app restoration.
 *  @param appID            This is the App-ID string that the developer is required to have in order to use the fliclib framework.
 *  @param appSecret        This is the App-Secret string that the developer is required to have in order to use the fliclib framework.
 *  @param bExecution       Flag that specifies if want to configure the Flic manager to support background execution. If YES, then you also
 *                          have to check the "Uses Bluetooth LE accessories" option under your projects Background Modes settings.
 *
 */

+ (instancetype _Nullable) configureWithDelegate:(id<SCLFlicManagerDelegate> _Nullable) delegate defaultButtonDelegate: (id<SCLFlicButtonDelegate> _Nullable) buttonDelegate appID: (NSString * _Nonnull) appID appSecret: (NSString * _Nonnull) appSecret backgroundExecution: (BOOL) bExecution;

/*!
 *  @method knownButtons:
 *
 *  @discussion     All buttons that have ever been added to the manager and not manually been forgotten/removed.
 *
 *  @return         Dictionary containing the SCLFlicButton objects. The keys are of NSUUID type that represent the buttonIdentifier
 *                  of the SCLFlicButton instance.
 *
 */
- (NSDictionary<NSUUID *, SCLFlicButton *> * _Nonnull) knownButtons;

/*!
 *  @method forgetButton:
 *
 *  @discussion     This will attempt to completely remove the flic button from the manager and clear the SCLFlicButton instance. If the flic
 *                  is connected when this method is called then it will also be disconnected first. Remember to clear all your references
 *                  to this particular button instance so that it properly gets cleared from memory.
 *
 *  @param button   The button that you wish to destroy.
 *
 */
- (void) forgetButton:(SCLFlicButton * _Nonnull) button;

/*!
 *  @method disable
 *
 *  @discussion     This will disable all bluetooth communication and disconnect all currently connected buttons and pending connections.
 *                  You will not be able to do any communication with a flic until you call enable.
 *
 */
- (void) disable;

/*!
 *  @method enable
 *
 *  @discussion     This will enable the bluetooth communication after it has previously been disabled. It will not however reconnect any buttons,
 *                  that will have to be handled manually. This is unless you have the flic(s) configured to be in KeepAlive mode,
 *                  in which case the connect will automatically be sent.
 *
 */
- (void) enable;

/*!
 *  @method grabFlicFromFlicAppWithCallbackUrlScheme:
 *
 *  @discussion         This will launch the Flic app and allow the user to select the Flic button to assign to this App.
 *
 *  @param scheme       This is the callback URL that you have registered in your Plist file and want the Flic app to return
 *                      the grabbed Flic to. Remember that this is only the scheme name that you have registered, and NOT a
 *                      full URL.
 *
 */
- (void) grabFlicFromFlicAppWithCallbackUrlScheme: (NSString * _Nonnull) scheme;

/*!
 *  @method handleOpenURL:
 *
 *  @discussion     Call this method with the URL returned from the Flic app. A callback will be sent if a button can be created.
 *
 *  @param url      This is the full url that was returned from the Flic app.
 *
 *  @return         If this url can be handled by the flic manager or not.
 *
 */
- (BOOL) handleOpenURL: (NSURL * _Nonnull) url;

/*!
 *  @method onLocationChange
 *
 *  @discussion     Call this method on significant location changes. This will go through all pending connections and make sure that they are in the
 *                  proper state. This is needed since we can not rely on Apple to take care of that to 100%.
 *
 */
- (void) onLocationChange;

@end

/*!
 *  @protocol SCLFlicManagerDelegate
 *
 *  @discussion     The delegate of a SCLFlicManager instance must adopt the SCLFlicManagerDelegate protocol. There are no
 *                  required delegate methods, but flicManagerDidChangeBluetoothState is highly recommended.
 *
 */
@protocol SCLFlicManagerDelegate <NSObject>

@required

/*!
 *  @method flicManager:didGrabFlicButton:withError:
 *
 *  @param manager      The manager providing this information.
 *  @param button       The SCLFlicButton object that was grabbed from the Flic app
 *  @param error        In case something went wrong while grabbing the Flic this parameter will explain the error.
 *
 *  @discussion         This delegate method is called every time the a new Flic button is grabbed from the Flic App.
 *
 */
- (void) flicManager:(SCLFlicManager * _Nonnull) manager didGrabFlicButton:(SCLFlicButton * _Nullable) button withError: (NSError * _Nullable) error;

@optional

/*!
 *  @method flicManager:didChangeBluetoothState:
 *
 *  @param manager      The flic manager providing this information.
 *  @param state        The state that the manager changed to that caused the callback. Notice that there is no guarantee that it has not changed since!
 *
 *  @discussion         If the bluetooth state on the iOS device or the flicManager changes for any reason, then this delegate method will be called
 *                      letting you that something happened. A parameter state will be included, but it is a good practice to always read
 *                      the most current value of the bluetoothState property on the manager to get info about the current state, since
 *                      there is a chance that the state could have changed again while the callback was sent. If the state changes to
 *                      SCLFlicManagerBluetoothStatePoweredOn then all the previous connections and pending connections will be set back to
 *                      pending again.
 *
 */
- (void) flicManager:(SCLFlicManager * _Nonnull) manager didChangeBluetoothState: (SCLFlicManagerBluetoothState) state;

/*!
 *  @method flicManagerDidRestoreState:
 *
 *  @param manager      The flic manager providing this information.
 *
 *  @discussion         This delegate method will be called after the manager has been properly restored after being terminated by
 *                      the system. All the flic buttons that that you had prior to being terminated have been restored as well and
 *                      this is a good time to collect all the SCLFlicButton objects by using the knownButtons: method in
 *                      order to properly restore the rest of your application. Do not forget to re-set the delegate on all buttons.
 *
 */
- (void) flicManagerDidRestoreState:(SCLFlicManager * _Nonnull) manager;

/*!
 *  @method flicManager:didForgetButton:error:
 *
 *  @param manager              The flic manager providing this information.
 *  @param buttonIdentifier     The buttonIdentifier of the SCLFlicButton object that was cleared
 *  @param error                In case there was an error
 *
 *  @discussion         This callback will be made when a flic has been properly forgotten/removed, unless there was an error. Remember
 *                      to also remove your references in case you still have any.
 *
 */
- (void) flicManager:(SCLFlicManager * _Nonnull) manager didForgetButton:(NSUUID * _Nonnull) buttonIdentifier error:(NSError * _Nullable)error;

@end