answer
stringlengths
15
1.25M
using System; using IEC61850.Client; using System.Collections.Generic; namespace example3 { class MainClass { public static void Main (string[] args) { IedConnection con = new IedConnection (); string hostname; if (args.Length > 0) hostname = args[0]; else hostname = "localhost"; Console.WriteLine("Connect to " + hostname); try { <API key> parameters = con.<API key>(); parameters.SetRemoteAddresses(1,1, new byte[] {0x00, 0x01, 0x02, 0x03}); con.ConnectTimeout = 10000; con.Connect(hostname, 102); List<string> serverDirectory = con.GetServerDirectory(false); foreach (string entry in serverDirectory) { Console.WriteLine("LD: " + entry); } con.Release(); } catch (<API key> e) { Console.WriteLine(e.Message); } } } }
<?php /** * Definitions for a census */ class <API key> extends <API key> implements <API key> { /** * When did this census occur. * * @return string */ public function censusDate() { return '16 JAN 1851'; } /** * The columns of the census. * * @return <API key>[] */ public function columns() { return array( new <API key>($this, 'Noms', 'Noms de famille'), new <API key>($this, 'Prénoms', ''), new <API key>($this, 'Professions', ''), new <API key>($this, 'Garçons', ''), new <API key>($this, 'Hommes', 'Hommes mariés'), new <API key>($this, 'Veufs', ''), new <API key>($this, 'Filles', ''), new <API key>($this, 'Femmes', 'Femmes mariées'), new <API key>($this, 'Veuves', ''), new <API key>($this, 'Âge', 'Âge'), new <API key>($this, 'Fr', 'Français d’origine'), new <API key>($this, 'Nat', 'Naturalisés français'), new <API key>($this, 'Etr', 'Étrangers (indiquer leur pays d’origine)'), ); } }
# This file is part of Indico. # Indico is free software; you can redistribute it and/or # published by the Free Software Foundation; either version 3 of the # Indico is distributed in the hope that it will be useful, but # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU from __future__ import unicode_literals from indico.core import signals from indico.util.i18n import _ from indico.web.flask.util import url_for from indico.web.menu import SideMenuSection, SideMenuItem @signals.menu.sections.connect_via('admin-sidemenu') def _sidemenu_sections(sender, **kwargs): yield SideMenuSection('security', _("Security"), 90, icon='shield') yield SideMenuSection('user_management', _("User Management"), 60, icon='users') yield SideMenuSection('customization', _("Customization"), 50, icon='wrench') yield SideMenuSection('integration', _("Integration"), 40, icon='earth') @signals.menu.items.connect_via('admin-sidemenu') def _sidemenu_items(sender, **kwargs): yield SideMenuItem('general', _('General Settings'), url_for('admin.adminList'), 100, icon='settings') yield SideMenuItem('storage', _('Disk Storage'), url_for('admin.adminSystem'), 70, icon='stack') yield SideMenuItem('ip_domains', _('IP Domains'), url_for('admin.domainList'), section='security') yield SideMenuItem('ip_acl', _('IP-based ACL'), url_for('admin.<API key>'), section='security') yield SideMenuItem('layout', _('Layout'), url_for('admin.adminLayout'), section='customization') yield SideMenuItem('homepage', _('Homepage'), url_for('admin.updateNews'), section='customization') yield SideMenuItem('protection', _('Protection'), url_for('admin.adminProtection'), section='security')
package com.lh64.randomdungeon.actors.buffs; import com.lh64.randomdungeon.actors.Char; import com.lh64.randomdungeon.items.rings.RingOfElements.Resistance; import com.lh64.randomdungeon.ui.BuffIndicator; public class Paralysis extends FlavourBuff { private static final float DURATION = 10f; @Override public boolean attachTo( Char target ) { if (super.attachTo( target )) { target.paralysed = true; return true; } else { return false; } } @Override public void detach() { super.detach(); unfreeze( target ); } @Override public int icon() { return BuffIndicator.PARALYSIS; } @Override public String toString() { return "Paralysed"; } public static float duration( Char ch ) { Resistance r = ch.buff( Resistance.class ); return r != null ? r.durationFactor() * DURATION : DURATION; } public static void unfreeze( Char ch ) { if (ch.buff( Paralysis.class ) == null && ch.buff( Frost.class ) == null) { ch.paralysed = false; } } }
#include "simulator/simulator.hpp" #include <functional> #include "catch.hpp" #ifdef __GNUC__ // for CATCH's CHECK macro #pragma GCC diagnostic ignored "-Wparentheses" #endif using namespace std::placeholders; using namespace sim; using asio::ip::make_address_v4; using asio::ip::address_v4; using duration = chrono::<API key>::duration; using chrono::duration_cast; using chrono::milliseconds; int num_lookups = 0; void on_name_lookup(boost::system::error_code const& ec , asio::ip::tcp::resolver::results_type ips) { ++num_lookups; int millis = int(duration_cast<milliseconds>(chrono::<API key>::now() .time_since_epoch()).count()); std::vector<address_v4> expect = { make_address_v4("1.2.3.4") , make_address_v4("1.2.3.5") , make_address_v4("1.2.3.6") , make_address_v4("1.2.3.7") }; auto expect_it = expect.begin(); for (auto const ip : ips) { assert(ip.endpoint().address() == *expect_it); assert(ip.endpoint().port() == 8080); ++expect_it; } assert(expect_it == expect.end()); } void <API key>(boost::system::error_code const& ec , asio::ip::tcp::resolver::results_type ips) { ++num_lookups; assert(ec == boost::system::error_code(asio::error::host_not_found)); int millis = int(duration_cast<milliseconds>(chrono::<API key>::now() .time_since_epoch()).count()); } struct sim_config : sim::default_config { duration hostname_lookup( asio::ip::address const& requestor , std::string hostname , std::vector<asio::ip::address>& result , boost::system::error_code& ec) { if (hostname == "test.com") { result = { make_address_v4("1.2.3.4") , make_address_v4("1.2.3.5") , make_address_v4("1.2.3.6") , make_address_v4("1.2.3.7") }; return duration_cast<duration>(chrono::milliseconds(50)); } return default_config::hostname_lookup(requestor, hostname, result, ec); } }; TEST_CASE("resolve multiple IPv4 addresses", "[resolver]") { sim_config cfg; simulation sim(cfg); chrono::<API key>::time_point start = chrono::<API key>::now(); num_lookups = 0; asio::io_context ios(sim, make_address_v4("40.30.20.10")); asio::ip::tcp::resolver resolver(ios); resolver.async_resolve("test.com", "8080" , std::bind(&on_name_lookup, _1, _2)); sim.run(); int millis = int(duration_cast<milliseconds>(chrono::<API key>::now() - start).count()); CHECK(millis == 50); CHECK(num_lookups == 1); } TEST_CASE("resolve non-existent hostname", "[resolver]") { sim_config cfg; simulation sim(cfg); chrono::<API key>::time_point start = chrono::<API key>::now(); num_lookups = 0; asio::io_context ios(sim, make_address_v4("40.30.20.10")); asio::ip::tcp::resolver resolver(ios); resolver.async_resolve("non-existent.com", "8080" , std::bind(&<API key>, _1, _2)); sim.run(); int millis = int(duration_cast<milliseconds>(chrono::<API key>::now() - start).count()); CHECK(millis == 100); CHECK(num_lookups == 1); } TEST_CASE("lookups resolve serially, compounding the latency", "[resolver]") { sim_config cfg; simulation sim(cfg); chrono::<API key>::time_point start = chrono::<API key>::now(); num_lookups = 0; asio::io_context ios(sim, make_address_v4("40.30.20.10")); asio::ip::tcp::resolver resolver(ios); resolver.async_resolve("non-existent.com", "8080", std::bind(&<API key>, _1, _2)); resolver.async_resolve("non-existent.com", "8080", std::bind(&<API key>, _1, _2)); sim.run(); int millis = int(duration_cast<milliseconds>(chrono::<API key>::now() - start).count()); CHECK(millis == 200); CHECK(num_lookups == 2); } TEST_CASE("resolve an IP address", "[resolver]") { sim_config cfg; simulation sim(cfg); chrono::<API key>::time_point start = chrono::<API key>::now(); num_lookups = 0; asio::io_context ios(sim, make_address_v4("40.30.20.10")); asio::ip::tcp::resolver resolver(ios); resolver.async_resolve("10.10.10.10", "8080" , [](boost::system::error_code const& ec, asio::ip::tcp::resolver::results_type ips) { ++num_lookups; std::vector<address_v4> expect = { make_address_v4("10.10.10.10") }; auto expect_it = expect.begin(); for (auto const ip : ips) { assert(ip.endpoint().address() == *expect_it); assert(ip.endpoint().port() == 8080); ++expect_it; } assert(expect_it == expect.end()); }); sim.run(); int millis = int(duration_cast<milliseconds>(chrono::<API key>::now() - start).count()); CHECK(millis == 0); CHECK(num_lookups == 1); }
from .base import * import os import pwd import sys DEBUG=True TEMPLATE_DEBUG = DEBUG def get_username(): return pwd.getpwuid( os.getuid() )[ 0 ] CONDA_ENV_PATH = os.getenv("CONDA_ENV_PATH") ENV_NAME = os.path.split(CONDA_ENV_PATH)[1] DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': '%s_db' % ENV_NAME, # Or path to database file if using sqlite3. 'USER': get_username(), # Not used with sqlite3. 'PASSWORD': '', # Not used witis oracle 'HOST': os.getenv("CONDA_ENV_PATH") + '/var/postgressocket', # Set to empty string for localhost. Not used with sqlite3. 'PORT': '', # Set to empty string for default. Not used with sqlite3. 'TEST_NAME' : 'dev_db' }, } SESSION_COOKIE_NAME = '%s_sessionid' % ENV_NAME CSRF_COOKIE_NAME = '%scsrftoken' % ENV_NAME STATIC_ROOT = '%s/deployment/static' % BASE_DIR MEDIA_ROOT = '%s/var/media/' % CONDA_ENV_PATH FLOWJS_PATH = MEDIA_ROOT + 'flow' LOGIN_REDIRECT_URL = '/%s/#/projects/list' % ENV_NAME LOGIN_URL = '/%s/login' % ENV_NAME LOGOUT_REDIRECT_URL = '/%s/login' % ENV_NAME WEBSERVICES_NAME='%s/api' % ENV_NAME <API key> = {"1.02" :"%s/var/INCHI-1-BIN/linux/64bit/inchi-1" % CONDA_ENV_PATH} SESSION_CACHE_ALIAS= ENV_NAME CACHES = { "default": { "BACKEND": "django_redis.cache.RedisCache", "LOCATION": "redis://127.0.0.1:6379/1", "OPTIONS": { "CLIENT_CLASS": "django_redis.client.DefaultClient", } }, ENV_NAME: { "BACKEND": "django_redis.cache.RedisCache", "LOCATION": "redis://127.0.0.1:6379/1", "OPTIONS": { "CLIENT_CLASS": "django_redis.client.DefaultClient", } } } ES_PREFIX = ENV_NAME STATIC_URL = '/%s/static/' % ENV_NAME STATICFILES_DIRS = ( '%s/src/ng-chem' % BASE_DIR, '%s/src/ng-chem/dist' % BASE_DIR, ) #Add a template dir so that the html content of index.html can be brought in as a static template when in production so login is handled by Django - see base.py in <API key> (Index() view) TEMPLATE_DIRS = ( '%s/src/ng-chem/' % BASE_DIR, ) #Set to 'DEBUG' to view all SQL DEBUG_SQL = 'INFO' LOGGING = { 'version': 1, 'formatters': { 'verbose': { 'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s' }, 'simple': { 'format': '%(levelname)s %(message)s' }, }, 'handlers': { 'console': { #Logging is sent out to standard out 'level': 'DEBUG', 'class': 'logging.StreamHandler', 'formatter': 'simple' }, }, 'loggers': { 'django': { 'handlers': ['console'], 'level': DEBUG_SQL, 'propagate': True, }, }, } for app in INSTALLED_APPS: LOGGING["loggers"][app] = { 'handlers': ['console'], 'level': 'DEBUG', 'propagate': True, } Q_CLUSTER = { 'name': 'DJRedis', 'workers': 12, 'timeout': None, 'django_redis': ENV_NAME, 'catch_up' : False } ROOT_URLCONF = 'deployment.urls_v2' <API key> = ENV_NAME try: from .secret import * except ImportError: print "No Secret settings, using default secret key which is insecure" try: import django_webauth INSTALLED_APPS = list(INSTALLED_APPS) + ["django_webauth",] except ImportError: pass for key, field in <API key>["schema"].items(): field["export_name"] = "%s:%s:%s" % (ID_PREFIX, ENV_NAME, field["knownBy"])
Ext.define('Hrproject.view.mobileview.login.Change<API key>, { extend : 'Ext.app.ViewController', alias : 'controller.change<API key>, <API key> : function(btn, opts) { debugger; var form = btn.up().up(); if (form.isValid()) { var formData = form.getValues(); delete formData.reTypeNewPassword; var entMask = new Ext.LoadMask({ msg : 'Updating...', target : this.getView() }).show(); Ext.Ajax.request({ timeout : 180000, url : "secure/PasswordGenerator/changePassword", method : 'PUT', waitMsg : 'Updating...', entMask : entMask, jsonData : formData, me : this, success : function(response, sender) { debugger; var responseText = Ext.JSON.decode(response.responseText); if (responseText.response.success) { Ext.Msg.alert("Info", responseText.response.message); sender.me.onResetClick(); } else { Ext.Msg.alert("Info", responseText.response.message); } sender.entMask.hide(); }, failure : function(response, sender) { debugger; Ext.Msg.alert("ERROR", "Cannot connect to server"); sender.entMask.hide(); } }); } }, onResetClick : function(btn, opts) { debugger; this.getView().getForm().reset(); } });
using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Sockets; using System.Text; using System.Threading; namespace Dache.Core.Communication { <summary> Implementation of auto discover manager based on Multicast UDP. </summary> public class <API key> : <API key> { private const string MESSAGE_SEPARATOR = " "; private const int THREAD_WAIT_TIME_MS = 100; private readonly IPAddress _ipAddress; private readonly UdpClient _udpClient; private IPEndPoint remoteEndPoint; private bool running; public <API key>(IPAddress ipAddress, int multicastPort) { this._ipAddress = ipAddress; this.remoteEndPoint = new IPEndPoint(_ipAddress, multicastPort); this._udpClient = new UdpClient(); } public void Run() { _udpClient.JoinMulticastGroup(_ipAddress); while (running) { // reading incoming message bytes were received if (_udpClient.Available > 0) { Byte[] data = _udpClient.Receive(ref remoteEndPoint); ParseMessage(data, remoteEndPoint.Address.ToString()); } Thread.Sleep(THREAD_WAIT_TIME_MS); } } public void TryStop() { running = false; } <summary> Parse the message given in the data buffer. </summary> <param name="data">Bytes containing the message to be parsed</param> <param name="remoteIp">Ip adderess of the remote cache host</param> private void ParseMessage(byte[] data, string remoteIp) { var dataString = Encoding.Unicode.GetString(data); var messageParts = dataString.Split(new string[] { MESSAGE_SEPARATOR }, StringSplitOptions.RemoveEmptyEntries); if (messageParts.Length > 0) { switch (messageParts[0]) { case "HELO": // add the new cache host to the list break; case "BYE": // remove cache host in the list break; } } } } }
#include <common.h> #include <asm/io.h> #include <i2c.h> #include "fti2c010.h" #ifndef <API key> #define <API key> 5000 #endif #ifndef <API key> #define <API key> 0 #endif #ifndef <API key> #define <API key> clk_get_rate("I2C") #endif #ifndef <API key> #define <API key> 10 #endif /* 7-bit dev address + 1-bit read/write */ #define I2C_RD(dev) ((((dev) << 1) & 0xfe) | 1) #define I2C_WR(dev) (((dev) << 1) & 0xfe) struct fti2c010_chip { struct fti2c010_regs *regs; }; static struct fti2c010_chip chip_list[] = { { .regs = (struct fti2c010_regs *)<API key>, }, #ifdef <API key> { .regs = (struct fti2c010_regs *)<API key>, }, #endif #ifdef <API key> { .regs = (struct fti2c010_regs *)<API key>, }, #endif #ifdef <API key> { .regs = (struct fti2c010_regs *)<API key>, }, #endif }; static int fti2c010_reset(struct fti2c010_chip *chip) { ulong ts; int ret = -1; struct fti2c010_regs *regs = chip->regs; writel(CR_I2CRST, &regs->cr); for (ts = get_timer(0); get_timer(ts) < <API key>; ) { if (!(readl(&regs->cr) & CR_I2CRST)) { ret = 0; break; } } if (ret) printf("fti2c010: reset timeout\n"); return ret; } static int fti2c010_wait(struct fti2c010_chip *chip, uint32_t mask) { int ret = -1; uint32_t stat, ts; struct fti2c010_regs *regs = chip->regs; for (ts = get_timer(0); get_timer(ts) < <API key>; ) { stat = readl(&regs->sr); if ((stat & mask) == mask) { ret = 0; break; } } return ret; } static unsigned int set_i2c_bus_speed(struct fti2c010_chip *chip, unsigned int speed) { struct fti2c010_regs *regs = chip->regs; unsigned int clk = <API key>; unsigned int gsr = 0; unsigned int tsr = 32; unsigned int div, rate; for (div = 0; div < 0x3ffff; ++div) { /* SCLout = PCLK/(2*(COUNT + 2) + GSR) */ rate = clk / (2 * (div + 2) + gsr); if (rate <= speed) break; } writel(TGSR_GSR(gsr) | TGSR_TSR(tsr), &regs->tgsr); writel(CDR_DIV(div), &regs->cdr); return rate; } /* * Initialization, must be called once on start up, may be called * repeatedly to change the speed and slave addresses. */ static void fti2c010_init(struct i2c_adapter *adap, int speed, int slaveaddr) { struct fti2c010_chip *chip = chip_list + adap->hwadapnr; if (adap->init_done) return; #ifdef <API key> /* Call board specific i2c bus reset routine before accessing the * environment, which might be in a chip on that bus. For details * about this problem see doc/I2C_Edge_Conditions. */ i2c_init_board(); #endif /* master init */ fti2c010_reset(chip); set_i2c_bus_speed(chip, speed); /* slave init, don't care */ #ifdef <API key> /* Call board specific i2c bus reset routine AFTER the bus has been * initialized. Use either this callpoint or i2c_init_board; * which is called before fti2c010_init operations. * For details about this problem see doc/I2C_Edge_Conditions. */ i2c_board_late_init(); #endif } /* * Probe the given I2C chip address. Returns 0 if a chip responded, * not 0 on failure. */ static int fti2c010_probe(struct i2c_adapter *adap, u8 dev) { struct fti2c010_chip *chip = chip_list + adap->hwadapnr; struct fti2c010_regs *regs = chip->regs; int ret; /* 1. Select slave device (7bits Address + 1bit R/W) */ writel(I2C_WR(dev), &regs->dr); writel(CR_ENABLE | CR_TBEN | CR_START, &regs->cr); ret = fti2c010_wait(chip, SR_DT); if (ret) return ret; /* 2. Select device register */ writel(0, &regs->dr); writel(CR_ENABLE | CR_TBEN, &regs->cr); ret = fti2c010_wait(chip, SR_DT); return ret; } static void to_i2c_addr(u8 *buf, uint32_t addr, int alen) { int i, shift; if (!buf || alen <= 0) return; /* MSB first */ i = 0; shift = (alen - 1) * 8; while (alen buf[i] = (u8)(addr >> shift); shift -= 8; } } static int fti2c010_read(struct i2c_adapter *adap, u8 dev, uint addr, int alen, uchar *buf, int len) { struct fti2c010_chip *chip = chip_list + adap->hwadapnr; struct fti2c010_regs *regs = chip->regs; int ret, pos; uchar paddr[4] = { 0 }; to_i2c_addr(paddr, addr, alen); /* * Phase A. Set register address */ /* A.1 Select slave device (7bits Address + 1bit R/W) */ writel(I2C_WR(dev), &regs->dr); writel(CR_ENABLE | CR_TBEN | CR_START, &regs->cr); ret = fti2c010_wait(chip, SR_DT); if (ret) return ret; /* A.2 Select device register */ for (pos = 0; pos < alen; ++pos) { uint32_t ctrl = CR_ENABLE | CR_TBEN; writel(paddr[pos], &regs->dr); writel(ctrl, &regs->cr); ret = fti2c010_wait(chip, SR_DT); if (ret) return ret; } /* * Phase B. Get register data */ /* B.1 Select slave device (7bits Address + 1bit R/W) */ writel(I2C_RD(dev), &regs->dr); writel(CR_ENABLE | CR_TBEN | CR_START, &regs->cr); ret = fti2c010_wait(chip, SR_DT); if (ret) return ret; /* B.2 Get register data */ for (pos = 0; pos < len; ++pos) { uint32_t ctrl = CR_ENABLE | CR_TBEN; uint32_t stat = SR_DR; if (pos == len - 1) { ctrl |= CR_NAK | CR_STOP; stat |= SR_ACK; } writel(ctrl, &regs->cr); ret = fti2c010_wait(chip, stat); if (ret) break; buf[pos] = (uchar)(readl(&regs->dr) & 0xFF); } return ret; } static int fti2c010_write(struct i2c_adapter *adap, u8 dev, uint addr, int alen, u8 *buf, int len) { struct fti2c010_chip *chip = chip_list + adap->hwadapnr; struct fti2c010_regs *regs = chip->regs; int ret, pos; uchar paddr[4] = { 0 }; to_i2c_addr(paddr, addr, alen); /* * Phase A. Set register address * * A.1 Select slave device (7bits Address + 1bit R/W) */ writel(I2C_WR(dev), &regs->dr); writel(CR_ENABLE | CR_TBEN | CR_START, &regs->cr); ret = fti2c010_wait(chip, SR_DT); if (ret) return ret; /* A.2 Select device register */ for (pos = 0; pos < alen; ++pos) { uint32_t ctrl = CR_ENABLE | CR_TBEN; writel(paddr[pos], &regs->dr); writel(ctrl, &regs->cr); ret = fti2c010_wait(chip, SR_DT); if (ret) return ret; } /* * Phase B. Set register data */ for (pos = 0; pos < len; ++pos) { uint32_t ctrl = CR_ENABLE | CR_TBEN; if (pos == len - 1) ctrl |= CR_STOP; writel(buf[pos], &regs->dr); writel(ctrl, &regs->cr); ret = fti2c010_wait(chip, SR_DT); if (ret) break; } return ret; } static unsigned int <API key>(struct i2c_adapter *adap, unsigned int speed) { struct fti2c010_chip *chip = chip_list + adap->hwadapnr; int ret; fti2c010_reset(chip); ret = set_i2c_bus_speed(chip, speed); return ret; } /* * Register i2c adapters */ <API key>(i2c_0, fti2c010_init, fti2c010_probe, fti2c010_read, fti2c010_write, <API key>, <API key>, <API key>, 0) #ifdef <API key> <API key>(i2c_1, fti2c010_init, fti2c010_probe, fti2c010_read, fti2c010_write, <API key>, <API key>, <API key>, 1) #endif #ifdef <API key> <API key>(i2c_2, fti2c010_init, fti2c010_probe, fti2c010_read, fti2c010_write, <API key>, <API key>, <API key>, 2) #endif #ifdef <API key> <API key>(i2c_3, fti2c010_init, fti2c010_probe, fti2c010_read, fti2c010_write, <API key>, <API key>, <API key>, 3) #endif
#include <openrct2-ui/interface/Viewport.h> #include <openrct2-ui/interface/Widget.h> #include <openrct2-ui/windows/Window.h> #include <openrct2/Context.h> #include <openrct2/Game.h> #include <openrct2/Input.h> #include <openrct2/actions/<API key>.hpp> #include <openrct2/audio/audio.h> #include <openrct2/drawing/Drawing.h> #include <openrct2/localisation/Localisation.h> #include <openrct2/ride/RideData.h> #include <openrct2/ride/Track.h> #include <openrct2/sprites.h> #include <openrct2/windows/Intent.h> #pragma region Widgets static constexpr const rct_string_id WINDOW_TITLE = <API key>; static constexpr const int32_t WH = 200; static constexpr const int32_t WW = 166; // clang-format off enum { WIDX_BACKGROUND, WIDX_TITLE, WIDX_CLOSE, <API key>, <API key> = 6, WIDX_MAZE_MOVE_MODE, WIDX_MAZE_FILL_MODE, <API key> = 23, <API key>, <API key>, <API key>, <API key>, WIDX_MAZE_ENTRANCE = 29, WIDX_MAZE_EXIT, }; static rct_widget <API key>[] = { WINDOW_SHIM(WINDOW_TITLE, WW, WH), MakeWidget({ 3, 17}, {160, 55}, WWT_GROUPBOX, WindowColour::Primary , <API key> ), MakeWidget({ 0, 0}, { 1, 1}, WWT_EMPTY, WindowColour::Primary ), MakeWidget({ 0, 0}, { 1, 1}, WWT_EMPTY, WindowColour::Primary ), MakeWidget({35, 29}, { 32, 32}, WWT_FLATBTN, WindowColour::Secondary, <API key>, <API key> ), MakeWidget({67, 29}, { 32, 32}, WWT_FLATBTN, WindowColour::Secondary, <API key>, <API key> ), MakeWidget({99, 29}, { 32, 32}, WWT_FLATBTN, WindowColour::Secondary, <API key>, <API key> ), MakeWidget({ 0, 0}, { 1, 1}, WWT_EMPTY, WindowColour::Primary ), MakeWidget({ 0, 0}, { 1, 1}, WWT_EMPTY, WindowColour::Primary ), MakeWidget({ 0, 0}, { 1, 1}, WWT_EMPTY, WindowColour::Primary ), MakeWidget({ 0, 0}, { 1, 1}, WWT_EMPTY, WindowColour::Primary ), MakeWidget({ 0, 0}, { 1, 1}, WWT_EMPTY, WindowColour::Primary ), MakeWidget({ 0, 0}, { 1, 1}, WWT_EMPTY, WindowColour::Primary ), MakeWidget({ 0, 0}, { 1, 1}, WWT_EMPTY, WindowColour::Primary ), MakeWidget({ 0, 0}, { 1, 1}, WWT_EMPTY, WindowColour::Primary ), MakeWidget({ 0, 0}, { 1, 1}, WWT_EMPTY, WindowColour::Primary ), MakeWidget({ 0, 0}, { 1, 1}, WWT_EMPTY, WindowColour::Primary ), MakeWidget({ 0, 0}, { 1, 1}, WWT_EMPTY, WindowColour::Primary ), MakeWidget({ 0, 0}, { 1, 1}, WWT_EMPTY, WindowColour::Primary ), MakeWidget({ 0, 0}, { 1, 1}, WWT_EMPTY, WindowColour::Primary ), MakeWidget({ 0, 0}, { 1, 1}, WWT_EMPTY, WindowColour::Primary ), MakeWidget({ 3, 80}, {160, 87}, WWT_GROUPBOX, WindowColour::Primary , <API key> ), MakeWidget({83, 96}, { 45, 29}, WWT_FLATBTN, WindowColour::Secondary, <API key>, <API key>), MakeWidget({83, 125}, { 45, 29}, WWT_FLATBTN, WindowColour::Secondary, <API key>, <API key>), MakeWidget({38, 125}, { 45, 29}, WWT_FLATBTN, WindowColour::Secondary, <API key>, <API key>), MakeWidget({38, 96}, { 45, 29}, WWT_FLATBTN, WindowColour::Secondary, <API key>, <API key>), MakeWidget({ 3, 168}, {160, 28}, WWT_GROUPBOX, WindowColour::Primary ), MakeWidget({ 9, 178}, { 70, 12}, WWT_BUTTON, WindowColour::Secondary, <API key>, <API key> ), MakeWidget({87, 178}, { 70, 12}, WWT_BUTTON, WindowColour::Secondary, <API key>, <API key> ), MakeWidget({ 0, 0}, { 1, 1}, WWT_EMPTY, WindowColour::Primary ), MakeWidget({ 0, 0}, { 1, 1}, WWT_EMPTY, WindowColour::Primary ), { WIDGETS_END } }; #pragma endregion #pragma region Events static void <API key>(rct_window *w); static void <API key>(rct_window *w, rct_widgetindex widgetIndex); static void <API key>(rct_window *w); static void <API key>(rct_window *w, rct_widgetindex widgetIndex, rct_widget *widget); static void <API key>(rct_window *w); static void <API key>(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords); static void <API key>(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords); static void <API key>(rct_window *w); static void <API key>(rct_window *w, rct_drawpixelinfo *dpi); // 0x993F6C static <API key> <API key>([](auto& events) { events.close = &<API key>; events.mouse_up = &<API key>; events.resize = &<API key>; events.mouse_down = &<API key>; events.update = &<API key>; events.tool_update = &<API key>; events.tool_down = &<API key>; events.invalidate = &<API key>; events.paint = &<API key>; }); // clang-format on #pragma endregion static void <API key>(int32_t direction); /** * * rct2: 0x006CB481 */ rct_window* <API key>() { rct_window* w = window_create( ScreenCoordsXY(0, 29), 166, 200, &<API key>, <API key>, WF_NO_AUTO_CLOSE); w->widgets = <API key>; w->enabled_widgets = (1ULL << WIDX_CLOSE) | (1ULL << <API key>) | (1ULL << WIDX_MAZE_MOVE_MODE) | (1ULL << WIDX_MAZE_FILL_MODE) | (1ULL << <API key>) | (1ULL << <API key>) | (1ULL << <API key>) | (1ULL << <API key>) | (1ULL << WIDX_MAZE_ENTRANCE) | (1ULL << WIDX_MAZE_EXIT); <API key>(w); w->number = _currentRideIndex; <API key>(w); show_gridlines(); return w; } /** * * rct2: 0x006CD811 */ static void <API key>(rct_window* w) { <API key>(); <API key>(0); <API key>(); gMapSelectFlags &= ~<API key>; gMapSelectFlags &= ~<API key>; // In order to cancel the yellow arrow correctly the // selection tool should be cancelled. tool_cancel(); hide_gridlines(); auto ride = get_ride(_currentRideIndex); if (ride != nullptr) { if (ride->overall_view.isNull()) { int32_t savedPausedState = gGamePaused; gGamePaused = 0; ride_action_modify(ride, <API key>, <API key> | <API key>); gGamePaused = savedPausedState; } else { auto intent = Intent(WC_RIDE); intent.putExtra(<API key>, ride->id); context_open_intent(&intent); } } } static void <API key>(rct_window* w, rct_widgetindex widgetIndex) { if (tool_set(w, widgetIndex, TOOL_CROSSHAIR)) return; <API key> = widgetIndex == WIDX_MAZE_ENTRANCE ? <API key> : <API key>; <API key> = static_cast<uint8_t>(w->number); <API key> = 0; input_set_flag(INPUT_FLAG_6, true); <API key>(); if (<API key> != <API key>) { <API key> = <API key>; } <API key> = <API key>; <API key>(); } /** * * rct2: 0x006CD461 */ static void <API key>(rct_window* w, rct_widgetindex widgetIndex) { switch (widgetIndex) { case WIDX_CLOSE: window_close(w); break; case WIDX_MAZE_ENTRANCE: case WIDX_MAZE_EXIT: <API key>(w, widgetIndex); break; case <API key>: case <API key>: case <API key>: case <API key>: <API key>(((widgetIndex - <API key>) - <API key>()) & 3); break; } } /** * * rct2: 0x006CD623 */ static void <API key>(rct_window* w) { uint64_t disabledWidgets = 0; if (<API key> == <API key>) { disabledWidgets |= ((1ULL << <API key>) | (1ULL << WIDX_MAZE_MOVE_MODE) | (1ULL << WIDX_MAZE_FILL_MODE) | (1ULL << <API key>) | (1ULL << <API key>) | (1ULL << <API key>) | (1ULL << <API key>)); } else if (<API key> == <API key>) { disabledWidgets = (1ULL << <API key>) | (1ULL << <API key>) | (1ULL << <API key>) | (1ULL << <API key>); } // Set and invalidate the changed widgets uint64_t <API key> = w->disabled_widgets; if (<API key> == disabledWidgets) return; for (rct_widgetindex i = 0; i < 64; i++) { if ((disabledWidgets & (1ULL << i)) != (<API key> & (1ULL << i))) { widget_invalidate(w, i); } } w->disabled_widgets = disabledWidgets; } static void <API key>(uint8_t <API key>) { if (<API key> == <API key>) { tool_cancel(); } <API key> = <API key>; <API key>(); } /** * * rct2: 0x006CD48C */ static void <API key>(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget) { switch (widgetIndex) { case <API key>: <API key>(<API key>); break; case WIDX_MAZE_MOVE_MODE: <API key>(<API key>); break; case WIDX_MAZE_FILL_MODE: <API key>(<API key>); break; } } /** * * rct2: 0x006CD767 */ static void <API key>(rct_window* w) { auto ride = get_ride(_currentRideIndex); if (ride == nullptr || ride->status != RIDE_STATUS_CLOSED) { window_close(w); return; } switch (<API key>) { case <API key>: if (!<API key>(w, <API key>)) { window_close(w); return; } break; case <API key>: if (!<API key>(w, WIDX_MAZE_ENTRANCE) && !<API key>(w, WIDX_MAZE_EXIT)) { <API key> = <API key>; <API key>(); } break; } switch (<API key>) { case <API key>: case <API key>: case <API key>: if ((input_test_flag(<API key>)) && gCurrentToolWidget.<API key> == <API key>) { tool_cancel(); } break; } sub_6C94D8(); } /** * * rct2: 0x006CD63E */ static void <API key>(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords) { switch (widgetIndex) { case <API key>: <API key>(screenCoords); break; case WIDX_MAZE_ENTRANCE: case WIDX_MAZE_EXIT: <API key>(screenCoords); break; } } /** * * rct2: 0x006C825F */ static void <API key>(const ScreenCoordsXY& screenCoords, rct_window* w) { <API key>(); <API key>(); gMapSelectFlags &= ~<API key>; gMapSelectFlags &= ~<API key>; CoordsXYZD <API key> = <API key>(screenCoords); if (<API key>.isNull()) return; if (<API key> == INVALID_DIRECTION) return; ride_id_t rideIndex = <API key>; auto <API key> = <API key>( <API key>, direction_reverse(<API key>.direction), rideIndex, <API key>, <API key> == <API key>); <API key>.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { if (result->Error != GameActions::Status::Ok) return; OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); auto ride = get_ride(rideIndex); if (ride != nullptr && <API key>(ride)) { tool_cancel(); if (ride_type_has_flag(ride->type, <API key>)) <API key>(<API key>); } else { <API key> = <API key> ^ 1; <API key>(<API key>); gCurrentToolWidget.widget_index = (<API key> == <API key>) ? WIDX_MAZE_ENTRANCE : WIDX_MAZE_EXIT; <API key>(); } }); auto res = GameActions::Execute(&<API key>); } /** * * rct2: 0x006CD65D */ static void <API key>(rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords) { switch (widgetIndex) { case <API key>: <API key>(screenCoords); break; case WIDX_MAZE_ENTRANCE: case WIDX_MAZE_EXIT: <API key>(screenCoords, w); break; } } /** * * rct2: 0x006CD435 */ static void <API key>(rct_window* w) { auto ride = get_ride(_currentRideIndex); auto ft = Formatter::Common(); if (ride != nullptr) { ft.Increment(4); ride->FormatNameTo(ft); } else { ft.Increment(4); ft.Add<rct_string_id>(STR_NONE); } } /** * * rct2: 0x006CD45B */ static void <API key>(rct_window* w, rct_drawpixelinfo* dpi) { window_draw_widgets(w, dpi); } /** * * rct2: 0x006CD887 */ void <API key>() { rct_window* w; w = <API key>(<API key>); if (w == nullptr) return; uint64_t pressedWidgets = w->pressed_widgets; // Unpress all the mode buttons pressedWidgets &= ~EnumToFlag(<API key>); pressedWidgets &= ~EnumToFlag(WIDX_MAZE_MOVE_MODE); pressedWidgets &= ~EnumToFlag(WIDX_MAZE_FILL_MODE); pressedWidgets &= ~EnumToFlag(WIDX_MAZE_ENTRANCE); pressedWidgets &= ~EnumToFlag(WIDX_MAZE_EXIT); switch (<API key>) { case <API key>: if (gCurrentToolWidget.widget_index == WIDX_MAZE_ENTRANCE) { pressedWidgets |= EnumToFlag(WIDX_MAZE_ENTRANCE); } else { pressedWidgets |= EnumToFlag(WIDX_MAZE_EXIT); } break; case <API key>: pressedWidgets |= EnumToFlag(<API key>); break; case <API key>: pressedWidgets |= EnumToFlag(WIDX_MAZE_MOVE_MODE); break; case <API key>: pressedWidgets |= EnumToFlag(WIDX_MAZE_FILL_MODE); break; } w->pressed_widgets = pressedWidgets; w->Invalidate(); } /** * * rct2: 0x006CD4AB */ static void <API key>(int32_t direction) { int32_t x, y, z, flags, mode; <API key> = 0; <API key> = 0; gMapSelectFlags &= ~<API key>; <API key>(); x = _currentTrackBegin.x + (<API key>[direction].x / 2); y = _currentTrackBegin.y + (<API key>[direction].y / 2); z = _currentTrackBegin.z; switch (<API key>) { case <API key>: mode = <API key>; flags = <API key>; break; case <API key>: mode = <API key>; flags = <API key> | <API key>; break; default: case <API key>: mode = <API key>; flags = <API key>; break; } money32 cost = maze_set_track(x, y, z, flags, false, direction, _currentRideIndex, mode); if (cost == MONEY32_UNDEFINED) { return; } _currentTrackBegin.x = x; _currentTrackBegin.y = y; if (<API key> != <API key>) { OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, { x, y, z }); } }
class CreatePhotos < ActiveRecord::Migration def self.up create_table :photos do |t| t.column :width, :integer t.column :height, :integer t.column :data, :binary t.column :thumb, :binary t.timestamps end add_reference :photos, :people, :null => false add_index :photos, :person_id end def self.down drop_table :photos end end
#include <libopencm3/stm32/adc.h> #include <libopencm3/stm32/rcc.h> #include <libopencm3/stm32/dma.h> #include "common.h" #include "devo.h" #include <stdlib.h> #include <stdio.h> unsigned ADC_Read(unsigned channel); volatile u16 adc_array_raw[NUM_ADC_CHANNELS]; #define WINDOW_SIZE 10 #define SAMPLE_COUNT NUM_ADC_CHANNELS * WINDOW_SIZE * <API key> static volatile u16 <API key>[SAMPLE_COUNT]; void ADC_Init(void) { <API key>(&RCC_APB2ENR, _RCC_APB2ENR_ADCEN); /* Make sure the ADC doesn't run during config. */ adc_off(_ADC); <API key>(&RCC_APB2RSTR, <API key>); <API key>(&RCC_APB2RSTR, <API key>); rcc_set_adcpre(<API key>); /* We configure to scan the entire group each time conversion is requested. */ <API key>(_ADC); <API key>(_ADC); <API key>(_ADC); <API key>(_ADC); <API key>(_ADC); /* We want to read the temperature sensor, so we have to enable it. */ <API key>(_ADC); <API key>(_ADC, <API key>); adc_power_on(_ADC); <API key>(_ADC); adc_calibration(_ADC); //Build a RNG seed using ADC 14, 16, 17 for(int i = 0; i < 8; i++) { u32 seed; seed = ((ADC_Read(16) & 0x03) << 2) | (ADC_Read(17) & 0x03); //Get 2bits of RNG from Temp and Vref seed ^= ADC_Read(adc_chan_sel[NUM_ADC_CHANNELS-1]) << i; //Get a couple more random bits from Voltage sensor rand32_r(0, seed); } //This is important. We're using the temp value as a buffer because otherwise the channel data //Can bleed into the voltage-sense data. //By disabling the temperature, we always read a consistent value <API key>(_ADC); printf("RNG Seed: %08x\n", (int)rand32()); /* Enable DMA clock */ <API key>(&RCC_AHBENR, _RCC_AHBENR_DMAEN); /* no reconfig for every ADC group conversion */ <API key>(_DMA, _DMA_CHANNEL); /* the memory pointer has to be increased, and the peripheral not */ <API key>(_DMA, _DMA_CHANNEL); /* ADC_DR is only 16bit wide in this mode */ <API key>(_DMA, _DMA_CHANNEL, DMA_CCR_PSIZE_16BIT); /*destination memory is also 16 bit wide */ dma_set_memory_size(_DMA, _DMA_CHANNEL, DMA_CCR_MSIZE_16BIT); /* direction is from ADC to memory */ <API key>(_DMA, _DMA_CHANNEL); /* get the data from the ADC data register */ <API key>(_DMA, _DMA_CHANNEL,(u32) &ADC_DR(_ADC)); /* put everything in this array */ <API key>(_DMA, _DMA_CHANNEL, (u32) &<API key>); /* we convert only 3 values in one adc-group */ <API key>(_DMA, _DMA_CHANNEL, SAMPLE_COUNT); /* we want an interrupt after the adc is finished */ //<API key>(_DMA, _DMA_CHANNEL); /* dma ready to go. waiting til the peripheral gives the first data */ dma_enable_channel(_DMA, _DMA_CHANNEL); adc_enable_dma(_ADC); <API key>(_ADC, NUM_ADC_CHANNELS, (u8 *)adc_chan_sel); <API key>(_ADC); <API key>(_ADC); } unsigned ADC_Read(unsigned channel) { u8 channel_array[1]; /* Select the channel we want to convert. 16=temperature_sensor. */ channel_array[0] = channel; <API key>(_ADC, 1, channel_array); /* * If the ADC_CR2_ON bit is already set -> setting it another time * starts the conversion. */ <API key>(_ADC); /* Wait for end of conversion. */ while (! adc_eoc(_ADC)) ; return adc_read_regular(_ADC); } void ADC_StartCapture() { //while (!(ADC_SR(_ADC) & ADC_SR_EOC)); <API key>(_ADC); } #if 0 void _DMA_ISR() { ADC_Filter(); medium_priority_cb(); /* clear the interrupt flag */ DMA_IFCR(_DMA) |= _DMA_IFCR_CGIF; } #endif void ADC_Filter() { for (int i = 0; i < NUM_ADC_CHANNELS; i++) { u32 result = 0; int idx = i; for(int j = 0; j < WINDOW_SIZE * <API key>; j++) { result += <API key>[idx]; idx += NUM_ADC_CHANNELS; } result /= <API key> * WINDOW_SIZE; adc_array_raw[i] = result; } } void ADC_ScanChannels() { u32 lastms = 0; u16 max[NUM_ADC_CHANNELS]; u16 min[NUM_ADC_CHANNELS]; for (int i = 0; i < NUM_ADC_CHANNELS; i++) { max[i] = 0; min[i] = 0xffff; } while(1) { if(<API key>()) PWR_Shutdown(); ADC_Filter(); for(int i = 0; i < NUM_ADC_CHANNELS; i++) { u32 x = adc_array_raw[i]; if (x > max[i]) max[i] = x; if (x < min[i]) min[i] = x; } u32 ms = CLOCK_getms(); if((ms % 100) == 0 && ms != lastms) { lastms = ms; printf("max:"); for(int i = 0; i < NUM_ADC_CHANNELS; i++) printf(" %04x", max[i]); printf(" %d\n", max[NUM_ADC_CHANNELS-1]); printf("min:"); for(int i = 0; i < NUM_ADC_CHANNELS; i++) printf(" %04x", min[i]); printf(" %d\n", min[NUM_ADC_CHANNELS-1]); printf(" "); for(int i = 0; i < NUM_ADC_CHANNELS; i++) printf(" %04x", adc_array_raw[i]); printf(" %d\n\n", adc_array_raw[NUM_ADC_CHANNELS-1]); memset(max, 0, sizeof(max)); memset(min, 0xFF, sizeof(min)); } } }
<?php /** * Gen * @category iCMS * @package <API key> * @author zhangchi */ class DefaultManageGen extends BaseManageGen implements IBaseManageGen { /** * * @return string */ public function Gen() { $result = ""; $manageUserId = Control::GetManageUserId(); if ($manageUserId <= 0) { $self_url=urlencode($_SERVER["PHP_SELF"]."?".$_SERVER['QUERY_STRING']); Control::GoUrl(RELATIVE_PATH . "/default.php?mod=manage&a=login&url=$self_url"); } else { $module = Control::GetRequest("mod", ""); switch ($module) { case "common": $commonManageGen = new CommonManageGen(); $result = $commonManageGen->Gen(); break; case "manage_user": $manageUserManageGen = new ManageUserManageGen(); $result = $manageUserManageGen->Gen(); break; case "manage_user_group": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "<API key>": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "upload_file": $uploadFileManageGen = new UploadFileManageGen(); $result = $uploadFileManageGen->Gen(); break; case "channel": $channelManageGen = new ChannelManageGen(); $result = $channelManageGen->Gen(); break; case "channel_template": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "user": $userManageGen = new UserManageGen(); $result = $userManageGen->Gen(); break; case "user_info": $userInfoManageGen = new UserInfoManageGen(); $result = $userInfoManageGen->Gen(); break; case "user_album": $userAlbumManageGen = new UserAlbumManageGen(); $result = $userAlbumManageGen->Gen(); break; case "user_group": $userGroupManageGen = new UserGroupManageGen(); $result = $userGroupManageGen->Gen(); break; case "user_favorite": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "user_level": $userLevelManageGen = new UserLevelManageGen(); $result = $userLevelManageGen->Gen(); break; case "user_album_type": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "user_order": $userOrderManageGen = new UserOrderManageGen(); $result = $userOrderManageGen->Gen(); break; case "user_order_product": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "user_order_pay": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "user_order_send": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "user_popedom": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "user_role": $userRoleManageGen = new UserRoleManageGen(); $result = $userRoleManageGen->Gen(); break; case "document_news": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "document_news_pic": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "source": $sourceManageGen = new SourceManageGen(); $result = $sourceManageGen->Gen(); break; case "set_template": self::SetTemplate(); break; case "site": $siteManageGen = new SiteManageGen(); $result = $siteManageGen->Gen(); break; case "site_config": $siteConfigManageGen = new SiteConfigManageGen(); $result = $siteConfigManageGen->Gen(); break; case "site_filter": $siteFilterManageGen = new SiteFilterManageGen(); $result = $siteFilterManageGen->Gen(); break; case "site_ad": $siteAdManageGen = new SiteAdManageGen(); $result = $siteAdManageGen->Gen(); break; case "site_ad_content": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "site_content": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "site_tag": $siteTagManageGen = new SiteTagManageGen(); $result = $siteTagManageGen->Gen(); break; case "manage_menu_of_user": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "forum": $forumManageGen = new ForumManageGen(); $result = $forumManageGen->Gen(); break; case "forum_topic": $forumTopicManageGen = new ForumTopicManageGen(); $result = $forumTopicManageGen->Gen(); break; case "forum_post": $forumPostManageGen = new ForumPostManageGen(); $result = $forumPostManageGen->Gen(); break; case "custom_form": $customFormManageGen = new CustomFormManageGen(); $result = $customFormManageGen->Gen(); break; case "custom_form_field": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "custom_form_record": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "custom_form_content": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "forum_topic_type": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "vote": $voteManageGen = new VoteManageGen(); $result = $voteManageGen->Gen(); break; case "vote_item": $voteItemManageGen = new VoteItemManageGen(); $result = $voteItemManageGen->Gen(); break; case "vote_select_item": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "product": $productManageGen = new ProductManageGen(); $result = $productManageGen->Gen(); break; case "product_param": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "product_param_type": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "<API key>": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "<API key>": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "product_brand": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "product_price": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "product_pic": $productPicManageGen = new ProductPicManageGen(); $result = $productPicManageGen->Gen(); break; case "activity": $activityManageGen = new ActivityManageGen(); $result = $activityManageGen->Gen(); break; case "activity_user": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "activity_class": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "information": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "pic_slider": $picSliderManageGen = new PicSliderManageGen(); $result = $picSliderManageGen->Gen(); break; case "ftp": $ftpManageGen = new FtpManageGen(); $result = $ftpManageGen->Gen(); break; case "newspaper": $newspaperManageGen = new NewspaperManageGen(); $result = $newspaperManageGen->Gen(); break; case "newspaper_page": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "newspaper_article": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "<API key>": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "comment": $commentManageGen = new CommentManageGen(); $result = $commentManageGen->Gen(); break; case "task": $commentManageGen = new TaskManageGen(); $result = $commentManageGen->Gen(); break; case "interface": $interfaceManageGen = new InterfaceManageGen(); $result = $interfaceManageGen->Gen(); break; case "visit": $visitManageGen = new VisitManageGen(); $result = $visitManageGen->Gen(); break; case "template_library": $templateLibraryGen = new <API key>(); $result = $templateLibraryGen->Gen(); break; case "<API key>": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "<API key>": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "<API key>": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "exam_question_class": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "exam_question": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "exam_user_paper": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "exam_user_answer": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "lottery": $lotteryManageGen = new LotteryManageGen(); $result = $lotteryManageGen->Gen(); break; case "lottery_set": $lotterySetManageGen = new LotterySetManageGen(); $result = $lotterySetManageGen->Gen(); break; case "lottery_award_user": $<API key> = new <API key>(); $result = $<API key>->Gen(); break; case "league": $leagueManageGen = new LeagueManageGen(); $result = $leagueManageGen->Gen(); break; case "match": $matchManageGen = new MatchManageGen(); $result = $matchManageGen->Gen(); break; case "team": $teamManageGen = new TeamManageGen(); $result = $teamManageGen->Gen(); break; case "member": $memberManageGen = new MemberManageGen(); $result = $memberManageGen->Gen(); break; case "stadium": $stadiumManageGen = new StadiumManageGen(); $result = $stadiumManageGen->Gen(); break; case "goal": $goalManageGen = new GoalManageGen(); $result = $goalManageGen->Gen(); break; case "red_yellow_card": $goalManageGen = new <API key>(); $result = $goalManageGen->Gen(); break; case "member_change": $goalManageGen = new <API key>(); $result = $goalManageGen->Gen(); break; case "other_event": $goalManageGen = new OtherEventManageGen(); $result = $goalManageGen->Gen(); break; case "del_all_cache": parent::DelAllCache(); break; default : $result = self::GenDefault(); break; } } return $result; } private function GenDefault() { //is login $manageUserId = Control::GetManageUserId(); if ($manageUserId <= 0) { die(); } $manageUserName = Control::GetManageUserName(); $clientIp = Control::GetIp(); $tempContent = Template::Load("manage/default.html","common"); parent::ReplaceFirst($tempContent); $tempContent = str_ireplace("{manage_user_id}", $manageUserId, $tempContent); $tempContent = str_ireplace("{manage_user_name}", $manageUserName, $tempContent); $tempContent = str_ireplace("{client_ip_address}", $clientIp, $tempContent); //<API key> $tagId = "<API key>"; $<API key> = new <API key>(); $<API key> = new <API key>(); $<API key> = $<API key>-><API key>($manageUserId); $<API key> = $<API key>->GetList($<API key>); Template::ReplaceList($tempContent, $<API key>, $tagId); $tempContent = str_ireplace("{<API key>}", count($<API key>), $tempContent); $<API key> = Template::Load("manage/<API key>.html","common"); $tempContent = str_ireplace("{<API key>}", $<API key>, $tempContent); $<API key> = Template::Load("manage/<API key>.html","common"); $tempContent = str_ireplace("{<API key>}", $<API key>, $tempContent); $<API key> = Template::Load("manage/<API key>.html","common"); $tempContent = str_ireplace("{<API key>}", $<API key>, $tempContent); $<API key> = Template::Load("manage/<API key>.html","common"); $tempContent = str_ireplace("{<API key>}", $<API key>, $tempContent); $<API key> = Template::Load("manage/<API key>.html","common"); $tempContent = str_ireplace("{<API key>}", $<API key>, $tempContent); $<API key> = Template::Load("manage/manage_menu_of_task.html","common"); $tempContent = str_ireplace("{manage_menu_of_task}", $<API key>, $tempContent); $<API key> = Template::Load("manage/<API key>.html","common"); $tempContent = str_ireplace("{<API key>}", $<API key>, $tempContent); $tagId = "select_site"; $siteManageData = new SiteManageData(); $arrSiteList = $siteManageData->GetListForSelect($manageUserId); Template::ReplaceList($tempContent, $arrSiteList, $tagId); parent::ReplaceEnd($tempContent); return $tempContent; } private function SetTemplate(){ $templateName = Control::GetRequest("tn", "default"); Control::<API key>($templateName); } } ?>
body { margin: 0px; } div { background-repeat: no-repeat; } .raw_image { width: 100%; height: 100%; } .preload { display: none; } div.main_container { } .form_sketch { border-color: transparent; background-color: transparent; } .u0_original { background-image: url('../passo-2.<API key>/u0_original.png'); } .u0_container { position:absolute; left:10px; top:151px; width:690px; height:250px; } #u0_img { position:absolute; left:-3px; top:-3px; width:696px; height:256px; } .u1 { position:absolute; left:2px; top:117px; width:686px; height:16px; ; ; ; font-family:Arial; text-align:left; word-wrap:break-word; } .u0 { position:absolute; left:10px; top:151px; width:690px; height:250px } .u2 { position:absolute; left:179px; top:190px; width:140px; height:25px; ; ; text-align: left;; font-family:'Verdana'; font-size: 13px; color:#000000; font-style:normal; font-weight:normal; text-decoration:none; } .u3 { position:absolute; left:34px; top:195px; width:130px; height:16px; ; ; ; font-family:Arial; text-align:left; word-wrap:break-word; } .u4 { position:absolute; left:25px; top:161px; width:163px; height:16px; ; ; ; font-family:Arial; text-align:left; word-wrap:break-word; } .u5_line { background-image: url('../passo-2.<API key>/u5_line.png'); } .u5_line { position:absolute; left:47px; top:116px; width:104px; height:5px; } .u5 { position:absolute; left:47px; top:116px; width:104px; height:5px } .u6_original { background-image: url('../passo-2.<API key>/u6_original.png'); } .u6_container { position:absolute; left:16px; top:103px; width:30px; height:30px; } #u6_img { position:absolute; left:-3px; top:-3px; width:36px; height:36px; } .u7 { position:absolute; left:2px; top:6px; width:26px; height:19px; ; ; ; font-family:Arial; text-align:left; word-wrap:break-word; } .u6 { position:absolute; left:16px; top:103px; width:30px; height:30px } .u8_original { background-image: url('../passo-2.<API key>/u8_original.png'); } .u8_container { position:absolute; left:151px; top:103px; width:30px; height:30px; } #u8_img { position:absolute; left:-3px; top:-3px; width:36px; height:36px; } .u9 { position:absolute; left:2px; top:7px; width:26px; height:16px; ; ; ; font-family:Arial; text-align:left; word-wrap:break-word; } .u8 { position:absolute; left:151px; top:103px; width:30px; height:30px } .u10 { position:absolute; left:50px; top:103px; width:100px; height:13px; ; ; ; font-family:Arial; text-align:left; word-wrap:break-word; } .u11 { position:absolute; left:185px; top:121px; width:94px; height:10px; ; ; ; font-family:Arial; text-align:left; word-wrap:break-word; } .u12 { position:absolute; left:185px; top:103px; width:100px; height:13px; ; ; ; font-family:Arial; text-align:left; word-wrap:break-word; } .u13_line { background-image: url('../passo-2.<API key>/u13_line.png'); } .u13_line { position:absolute; left:182px; top:116px; width:104px; height:5px; } .u13 { position:absolute; left:182px; top:116px; width:104px; height:5px } .u14_original { background-image: url('../passo-2.<API key>/u6_original.png'); } .u14_container { position:absolute; left:287px; top:103px; width:30px; height:30px; } #u14_img { position:absolute; left:-3px; top:-3px; width:36px; height:36px; } .u15 { position:absolute; left:2px; top:6px; width:26px; height:19px; ; ; ; font-family:Arial; text-align:left; word-wrap:break-word; } .u14 { position:absolute; left:287px; top:103px; width:30px; height:30px } .u16_original { background-image: url('../passo-2.<API key>/u6_original.png'); } .u16_container { position:absolute; left:572px; top:102px; width:30px; height:30px; } #u16_img { position:absolute; left:-3px; top:-3px; width:36px; height:36px; } .u17 { position:absolute; left:2px; top:6px; width:26px; height:19px; ; ; ; font-family:Arial; text-align:left; word-wrap:break-word; } .u16 { position:absolute; left:572px; top:102px; width:30px; height:30px } .u18 { position:absolute; left:321px; top:102px; width:110px; height:13px; ; ; ; font-family:Arial; text-align:left; word-wrap:break-word; } .u19 { position:absolute; left:609px; top:100px; width:81px; height:13px; ; ; ; font-family:Arial; text-align:left; word-wrap:break-word; } .u20_line { background-image: url('../passo-2.<API key>/u20_line.png'); } .u20_line { position:absolute; left:317px; top:116px; width:120px; height:5px; } .u20 { position:absolute; left:317px; top:116px; width:120px; height:5px } .u21_line { background-image: url('../passo-2.<API key>/u21_line.png'); } .u21_line { position:absolute; left:602px; top:115px; width:95px; height:5px; } .u21 { position:absolute; left:602px; top:115px; width:95px; height:5px } .u22_original { background-image: url('../passo-2.<API key>/u6_original.png'); } .u22_container { position:absolute; left:438px; top:102px; width:30px; height:30px; } #u22_img { position:absolute; left:-3px; top:-3px; width:36px; height:36px; } .u23 { position:absolute; left:2px; top:6px; width:26px; height:19px; ; ; ; font-family:Arial; text-align:left; word-wrap:break-word; } .u22 { position:absolute; left:438px; top:102px; width:30px; height:30px } .u24 { position:absolute; left:472px; top:101px; width:100px; height:13px; ; ; ; font-family:Arial; text-align:left; word-wrap:break-word; } .u25_line { background-image: url('../passo-2.<API key>/u25_line.png'); } .u25_line { position:absolute; left:468px; top:115px; width:104px; height:5px; } .u25 { position:absolute; left:468px; top:115px; width:104px; height:5px } .u26_line { background-image: url('../footer_files/u34_line.png'); } .u26_line { position:absolute; left:10px; top:414px; width:690px; height:3px; } .u26 { position:absolute; left:10px; top:414px; width:690px; height:3px } .u27 { position:absolute; left:91px; top:434px; width:480px; height:15px; ; ; ; font-family:Arial; text-align:left; word-wrap:break-word; } .u29_original { background-image: url('../passo-2.<API key>/u29_original.png'); } .u29_container { position:absolute; left:400px; top:170px; width:200px; height:110px; } #u29_img { position:absolute; left:-3px; top:-3px; width:206px; height:116px; } .u30 { position:absolute; left:2px; top:2px; width:196px; height:105px; ; ; ; font-family:Arial; text-align:left; word-wrap:break-word; } .u29 { position:absolute; left:400px; top:170px; width:200px; height:110px } .u31_original { background-image: url('../passo-2.<API key>/u31_original.png'); } .u31_container { position:absolute; left:250px; top:229px; width:70px; height:21px; } #u31_img { position:absolute; left:-3px; top:-3px; width:76px; height:27px; } .u32 { position:absolute; left:2px; top:4px; width:66px; height:13px; ; ; ; font-family:Arial; text-align:left; word-wrap:break-word; } .u31 { position:absolute; left:250px; top:229px; width:70px; height:21px } .u33 { position:absolute; left:10px; top:10px; width:342px; height:29px; ; ; ; font-family:Arial; text-align:left; word-wrap:break-word; } .u34 { position:absolute; left:368px; top:0px; width:93px; height:16px; ; ; ; font-family:Arial; text-align:left; word-wrap:break-word; } .u35 { position:absolute; left:467px; top:0px; width:130px; height:16px; ; ; ; font-family:Arial; text-align:left; word-wrap:break-word; } .u36 { position:absolute; left:674px; top:0px; width:30px; height:16px; ; ; ; font-family:Arial; text-align:left; word-wrap:break-word; } .u37 { position:absolute; left:606px; top:0px; width:60px; height:16px; ; ; ; font-family:Arial; text-align:left; word-wrap:break-word; } .u38_line { background-image: url('../<API key>/u88_line.png'); } .u38_line { position:absolute; left:12px; top:74px; width:690px; height:3px; } .u38 { position:absolute; left:12px; top:74px; width:690px; height:3px } .u39 { position:absolute; left:51px; top:50px; width:579px; height:19px; ; ; ; font-family:Arial; text-align:left; word-wrap:break-word; }
package de.dingedb.dingedb; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.Menu; import android.view.MenuItem; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_main, menu); return true; } @Override public boolean <API key>(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. //Kais Kommentar // Tims Kommentar // Michaels Kommi int id = item.getItemId(); //noinspection <API key> if (id == R.id.action_settings) { return true; } return super.<API key>(item); } }
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC '- <head> <title>Twisted Documentation: Twisted Web code examples</title> <link href="../howto/stylesheet.css" rel="stylesheet" type="text/css"/> </head> <body bgcolor="white"> <h1 class="title">Twisted Web code examples</h1> <div class="toc"><ol><li><a href="#auto0">twisted.web.client</a></li><li><a href="#auto1">XML-RPC</a></li><li><a href="#auto2">Virtual hosts and proxies</a></li><li><a href="#auto3">.rpys and ResourceTemplate</a></li><li><a href="#auto4">Miscellaneous</a></li></ol></div> <div class="content"> <span/> <h2>twisted.web.client<a name="auto0"/></h2> <ul> <li><a href="getpage.py" shape="rect">getpage.py</a> - use <code>twisted.web.client.getPage</code> to download a web page.</li> <li><a href="dlpage.py" shape="rect">dlpage.py</a> - add callbacks to <code>twisted.web.client.downloadPage</code> to display errors that occur when downloading a web page</li> </ul> <h2>XML-RPC<a name="auto1"/></h2> <ul> <li><a href="xmlrpc.py" shape="rect">xmlrpc.py</a> XML-RPC server with several methods, including echoing, faulting, returning deferreds and failed deferreds</li> <li><a href="xmlrpcclient.py" shape="rect">xmlrpcclient.py</a> - use <code>twisted.web.xmlrpc.Proxy</code> to call remote XML-RPC methods</li> <li><a href="advogato.py" shape="rect">advogato.py</a> - use <code>twisted.web.xmlrpc</code> to post a diary entry to advogato.org; requires an advogato account</li> </ul> <h2>Virtual hosts and proxies<a name="auto2"/></h2> <ul> <li><a href="proxy.py" shape="rect">proxy.py</a> - use <code>twisted.web.proxy.Proxy</code> to make the simplest proxy</li> <li><a href="logging-proxy.py" shape="rect">logging-proxy.py</a> - example of subclassing the core classes of <code>twisted.web.proxy</code> to log requests through a proxy</li> <li><a href="reverse-proxy.py" shape="rect">reverse-proxy.py</a> - use <code>twisted.web.proxy.<API key></code> to make any HTTP request to the proxy port get applied to a specified website</li> <li><a href="rootscript.py" shape="rect">rootscript.py</a> - example use of <code>twisted.web.vhost.NameVirtualHost</code></li> <li><a href="web.py" shape="rect">web.py</a> - an example of both using the <code>processors</code> attribute to set how certain file types are treated and using <code>twisted.web.vhost.<API key></code> to reverse proxy</li> </ul> <h2>.rpys and ResourceTemplate<a name="auto3"/></h2> <ul> <li><a href="hello.rpy.py" shape="rect">hello.rpy.py</a> - use <code>twisted.web.static</code> to create a static resource to serve</li> <li><a href="fortune.rpy.py" shape="rect">fortune.rpy.py</a> - create a resource that returns the output of a process run on the server</li> <li><a href="lj.rpy.py" shape="rect">lj.rpy.py</a> - use <code>twisted.web.microdom</code>, <code>twisted.web.domhelpers</code>, and chained callbacks to extract and display parts of a livejournal user's rss page</li> <li><a href="report.rpy.py" shape="rect">report.rpy.py</a> - display various properties of a resource, including path, host, and port</li> <li><a href="users.rpy.py" shape="rect">users.rpy.py</a> - use <code>twisted.web.distrib</code> to publish user directories as for a &quot;community web site&quot;</li> <li><a href="simple.rtl" shape="rect">simple.rtl</a> - example use of <code>twisted.web.resource.ResourceTemplate</code></li> </ul> <h2>Miscellaneous<a name="auto4"/></h2> <ul> <li><a href="webguard.py" shape="rect">webguard.py</a> - pairing <code>twisted.web</code> with <code>twisted.cred</code> to guard resources against unauthenticated users</li> <li><a href="silly-web.py" shape="rect">silly-web.py</a> - bare-bones distributed web setup with a master and slave using <code>twisted.web.distrib</code> and <code>twisted.spread.pb</code></li> <li><a href="soap.py" shape="rect">soap.py</a> - use <code>twisted.web.soap</code> to publish SOAP methods</li> </ul> </div> <p><a href="../howto/index.html">Index</a></p> <span class="version">Version: 13.0.0</span> </body> </html>
import java.io.IOException; /** * Consumer #1 * @author allengordon * */ public class ProcessData { public static final int NEWLINE = 0x0A; public static final int EOL = 0x0D; public static final int MATE2BYTES = 49; public ProcessData() throws IOException, <API key> { Configs fxC = Configs.getInstance(); fxC.sampleCtr = 0; fxC.Ib = ""; fxC.Is = ""; fxC.Pitot = new Float[fxC.numFX]; fxC.Pbtot = new Float[fxC.numFX]; fxC.Pstot = new Float[fxC.numFX]; fxC.Iitot = new int[fxC.numFX]; fxC.Ibtot = new int[fxC.numFX]; fxC.Istot = new int[fxC.numFX]; fxC.Ii = new int[fxC.numFX]; fxC.Vacin = new int[fxC.numFX]; fxC.Vacout = new String[fxC.numFX]; for (int i = 0; i < fxC.numFX; i++) { fxC.Pitot[i] = fxC.Pbtot[i] = fxC.Pstot[i] = (float) 0.0; fxC.Vacin[i] = 0; fxC.Vacout[i] = "0"; fxC.Iitot[i] = fxC.Istot[i] = fxC.Ibtot[i] = 0; fxC.Pstot[i] = fxC.Pbtot[i] = (float) 0.0; } } public String processMateData(Configs fxC, String[] str) { /* * get device type from first character if numeric -> MX charge * controller otherwise alpha -> FX or battery */ String retVal = ""; //= Long.toString(timeStamp) + " "; fxC.splitData = str; try { if (Character.isDigit(fxC.splitData[0].charAt(0))) { // numeric -> FX inverter /* * for (int i=0; i < splitData.length; i++) { * System.out.print(splitData[i]); } System.out.println(); */ retVal += decodeFXdata(fxC, fxC.splitData); } else { // alpha -> uppercase == MX // lowercasee == flexmate retVal += decodeMXdata(fxC, fxC.splitData); } } catch (<API key> e) { /* TODO error handler */ e.printStackTrace(); } return retVal; } /** * FX Data index description 0 ID numeric character 1 fxC.Ii inverter current, * ascfxC.Ii numeric 2 Ic charger current, ascfxC.Ii numerfxC.Iic 3 Ib buy current, * ascfxC.Ii numeric 4 Vi AC input voltage, ascfxC.Ii numeric 5 Vo AC output voltage * 6 Is Sell current 7 Op_Mode Operating Mode 8 Error Error Mode 9 AC_Mode * 10 Vb battery voltage 11 Misc miscellaneous 12 warning mode 13 Sum check * sum * * @return decoded FX data * * */ static String decodeFXdata(Configs fxC, String[] string) throws <API key> { fxC.splitData = string; float Vbatt; String interpData = ""; for (int index = 0; index < fxC.splitData.length; index++) { switch (index) { case 0: // FX ID interpData += fxC.splitData[index]; break; case 1: // Inverter current fxC.Ii interpData += fxC.splitData[index]; break; case 2: interpData += fxC.splitData[index]; break; case 3: // inverter buy current Ib interpData += fxC.splitData[index]; break; case 4: // fxC.Vacin interpData += fxC.splitData[index]; break; case 5: /* * fxC.Vacout, 230 volt system? */ if ((Integer.parseInt(fxC.splitData[11]) & 0x1) == 1) { interpData += Integer.parseInt(fxC.splitData[index]) * 2; } else { interpData += fxC.splitData[index]; } break; case 6: // sell current Is interpData += fxC.splitData[index]; break; case 7: int tmp = Integer.parseInt(fxC.splitData[7]); int tmpIndex; String tmpStr = ""; for (tmpIndex = 0; tmpIndex < 100; tmpIndex++) { switch (tmp) { case 0: tmpStr = "Inv Off"; break; case 1: tmpStr = "Search"; break; case 2: tmpStr = "Inv On"; break; case 3: tmpStr = "Charge"; break; case 4: tmpStr = "Silent"; break; case 5: tmpStr = "Float"; break; case 6: tmpStr = "EQ"; break; case 7: tmpStr = "Charger Off"; break; case 8: tmpStr = "Support"; case 9: tmpStr = "Sell Enabled"; break; case 10: tmpStr = "Pass Thru"; break; case 90: tmpStr = "FX Error"; break; case 91: tmpStr = "AGS Error"; break; case 92: tmpStr = "Comm Error"; break; default: tmpStr = "Unknown Op Mode"; break; } } interpData += tmpStr; break; case 8: // error mode String tmpErrStr = ""; for (int bitshift = 0; bitshift < 8; bitshift++) { if ((Integer.parseInt(fxC.splitData[8]) >> bitshift & 0x1) == 1) { switch (bitshift) { case 0: tmpErrStr = "Low AC output"; break; case 1: tmpErrStr = "Stacking Error"; break; case 2: tmpErrStr = "Over Temp"; break; case 3: tmpErrStr = "Low Battery"; break; case 4: tmpErrStr = "Phase Loss"; break; case 5: tmpErrStr = "High Battery"; break; case 6: tmpErrStr = "Shorted Output"; break; case 7: tmpErrStr = "Back Feed"; break; default: tmpErrStr = "Unknown error"; break; } } } interpData += tmpErrStr; break; case 9: // AC mode String tmpACStr = ""; if (fxC.splitData[9].equals("00")) { tmpACStr = "No AC"; } else if (fxC.splitData[9].equals("01")) { tmpACStr = "AC Drop"; } else if (fxC.splitData[9].equals("02")) { tmpACStr = "AC Use"; } else { tmpACStr = "Unknown AC state"; } interpData += tmpACStr; break; case 10: /** * battery voltage convert to float, divide by 10, return a * string representation of the floating point result to 1 * decimal place */ fxC.Vbatt = (float)(Float.parseFloat(fxC.splitData[index])/10.0); interpData += String.valueOf(fxC.Vbatt); break; case 11: if ((Integer.parseInt(fxC.splitData[11]) & 0x1) == 1) { interpData += "230V "; } if ((Integer.parseInt(fxC.splitData[11]) >> 7 & 0x1) == 1) { interpData += "AUX Output ON "; } break; case 12: // warning String tmpWarnStr = ""; for (int bitshift = 0; bitshift < 8; bitshift++) { if ((Integer.parseInt(fxC.splitData[12]) >> bitshift & 0x1) == 1) { switch (bitshift) { case 0: tmpWarnStr = "AC Input Freq High"; break; case 1: tmpWarnStr = "AC Input Freq Low"; break; case 2: tmpWarnStr = "Input VAC High"; break; case 3: tmpWarnStr = "Input VAC Low"; break; case 4: tmpWarnStr = "Buy Amps > input size"; break; case 5: tmpWarnStr = "Temp Sensor Failed"; break; case 6: tmpWarnStr = "Comm Error"; break; case 7: tmpWarnStr = "Fan Failure"; break; default: tmpWarnStr = "Unknown Warning"; break; } } } interpData += tmpWarnStr; break; case 13: // check sum, shouldn't be needed break; default: // all others break; } interpData += ","; } interpData += "\n\t" + DoFXCalcs.doFXCalcs(fxC); return interpData; } /* * MX Data 0 ID [0] ascii numberic character 1 xx unused 2 Ic [2] charger current 3 Ipv [3] PV current 4 Vpv [4] PV voltage 5 KWH [5] daily kwh 6 Ic' [6] tenths of charger current--note only one char is used here 7 Aux [7] aux mode 8 Error[8] 9 Chgr_mode [9] charger mode 10 Vb [10] battery voltage 11 Ah [11] daily amp hours 12 xx unused 13 sum [12] chksum */ static String decodeMXdata(Configs fxC, String[] str) { String [] splitData = str; String interpData = ""; for (int index = 0; index < splitData.length; index++) { switch (index) { case 0: interpData += splitData[index]; break; case 1: // not used case 2: // charger current, amp interpData += splitData[index]; break; case 3: // PV current interpData += splitData[index]; break; case 4: // PV FPanel Voltage interpData += splitData[index]; break; case 5: // daily PV KWH /** * convert to float, divide by 10, return a string * representation of the floating point result to 1 decimal * place */ Float dataFloatValue = Float.parseFloat(splitData[index]); dataFloatValue /= 10.f; interpData += Float.toString(dataFloatValue); break; case 6: // tenths of amps for charger current // add to splitData[2] for total charger current interpData += splitData[index]; break; case 7: // Aux mode int tmp = Integer.parseInt(splitData[index]); // int tmpIndex; String tmpStr = ""; // for (tmpIndex = 0; tmpIndex < 11; tmpIndex++) { switch (tmp) { case 0: tmpStr = "Aux Mode Disabled"; break; case 1: tmpStr = "Diversion"; break; case 2: tmpStr = "Remote"; break; case 3: tmpStr = "Manual"; break; case 4: tmpStr = "Fent Fan"; break; case 5: tmpStr = "PV Trigger"; break; case 6: tmpStr = "Float"; break; case 7: tmpStr = "Error Output"; break; case 8: tmpStr = "Night Light"; break; case 9: tmpStr = "PWM Diversion"; break; case 10: tmpStr = "Low Battery"; break; } interpData += tmpStr; case 8: // Error modes String tmpErrStr = ""; for (int bitshift = 0; bitshift < 8; bitshift++) { if ((Integer.parseInt(splitData[8]) >> bitshift & 0x1) == 1) { switch (bitshift) { case 0: case 1: case 2: case 3: case 4: case 5: tmpErrStr = ""; break; case 6: tmpErrStr = "Shorted Battery Sensor"; break; case 7: tmpErrStr = "Too Hot"; break; default: tmpErrStr = "Unknown Error"; break; } } } interpData += tmpErrStr; break; case 9: // Charger mode tmp = Integer.parseInt(splitData[index]); tmpStr = ""; for (int tmpIndex = 0; tmpIndex < 5; tmpIndex++) { switch (tmp) { case 0: tmpStr = "Silent"; break; case 1: tmpStr = "Float"; break; case 2: tmpStr = "Bulk"; break; case 3: tmpStr = "Absorb"; break; case 4: tmpStr = "EQ"; break; default: tmpStr = "Unknown Charger Mode"; break; } } interpData += tmpStr; break; case 10: // battery voltage x 10 /** * convert to float, divide by 10, return a string * representation of the floating point result to 1 decimal * place */ dataFloatValue = Float.parseFloat(splitData[index]); dataFloatValue /= 10.f; interpData += Float.toString(dataFloatValue); break; case 11: // Charge controller Daily AH interpData += splitData[index]; break; case 12: // unused case 13: // check sum interpData += ""; break; default: // all others interpData += "Unknown Charger mode"; break; } interpData += ","; } interpData += "\n\t" + DoMXCalcs.doMXCalcs(fxC); return interpData; } /* TODO - add decode for flexmax battery data, and MATE3 */ }
/* Authors: Keith Whitwell <keith@tungstengraphics.com> */ #include "fo_context.h" /* This looks like a lot of work at the moment - we're keeping a * duplicate copy of the state up-to-date. * * This can change in two ways: * - With constant state objects we would only need to save a pointer, * not the whole object. * - By adding a callback in the state tracker to re-emit state. The * state tracker knows the current state already and can re-emit it * without additional complexity. * * This works as a proof-of-concept, but a final version will have * lower overheads. */ /* Bring the software pipe uptodate with current state. * * With constant state objects we would probably just send all state * to both rasterizers all the time??? */ void failover_state_emit( struct failover_context *failover ) { if (failover->dirty & FO_NEW_BLEND) failover->sw->bind_blend_state( failover->sw, failover->blend->sw_state ); if (failover->dirty & FO_NEW_BLEND_COLOR) failover->sw->set_blend_color( failover->sw, &failover->blend_color ); if (failover->dirty & FO_NEW_CLIP) failover->sw->set_clip_state( failover->sw, &failover->clip ); if (failover->dirty & <API key>) failover->sw-><API key>( failover->sw, failover->depth_stencil->sw_state ); if (failover->dirty & FO_NEW_STENCIL_REF) failover->sw->set_stencil_ref( failover->sw, &failover->stencil_ref ); if (failover->dirty & FO_NEW_FRAMEBUFFER) failover->sw-><API key>( failover->sw, &failover->framebuffer ); if (failover->dirty & <API key>) failover->sw->bind_fs_state( failover->sw, failover->fragment_shader->sw_state ); if (failover->dirty & <API key>) failover->sw->bind_vs_state( failover->sw, failover->vertex_shader->sw_state ); if (failover->dirty & FO_NEW_STIPPLE) failover->sw->set_polygon_stipple( failover->sw, &failover->poly_stipple ); if (failover->dirty & FO_NEW_RASTERIZER) failover->sw-><API key>( failover->sw, failover->rasterizer->sw_state ); if (failover->dirty & FO_NEW_SCISSOR) failover->sw->set_scissor_state( failover->sw, &failover->scissor ); if (failover->dirty & FO_NEW_VIEWPORT) failover->sw->set_viewport_state( failover->sw, &failover->viewport ); if (failover->dirty & FO_NEW_SAMPLER) { failover->sw-><API key>( failover->sw, failover->num_samplers, failover->sw_sampler_state ); failover->sw-><API key>(failover->sw, failover->num_vertex_samplers, failover-><API key>); } if (failover->dirty & FO_NEW_TEXTURE) { failover->sw-><API key>( failover->sw, failover->num_textures, failover->texture ); failover->sw-><API key>(failover->sw, failover->num_vertex_textures, failover->vertex_textures); } if (failover->dirty & <API key>) { failover->sw->set_vertex_buffers( failover->sw, failover->num_vertex_buffers, failover->vertex_buffers ); } if (failover->dirty & <API key>) { failover->sw->set_vertex_elements( failover->sw, failover->num_vertex_elements, failover->vertex_elements ); } failover->dirty = 0; }
package org.tomaximo.tuuyouclass; import java.awt.BorderLayout; import java.awt.Container; import java.awt.Cursor; import java.awt.Font; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.<API key>; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Timer; import java.util.TimerTask; import javax.swing.BorderFactory; import javax.swing.Box; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTextField; import javax.swing.JToggleButton; import javax.swing.ScrollPaneConstants; import javax.swing.SwingConstants; import javax.swing.text.<API key>; import org.shoukaiseki.characterdetector.CharacterEncoding; import org.shoukaiseki.characterdetector.utf.UnicodeReader; import org.shoukaiseki.constantlib.<API key>; import org.shoukaiseki.gui.flowlayout.ModifiedFlowLayout; import org.shoukaiseki.gui.jtextpane.JTextPaneDoc; import org.tomaximo.kks.ImpKksGui; public class KonntenntuOut extends JFrame implements ScrollPaneConstants { private boolean windowclose = true; private static JTextPaneDoc textPane; private JLabel jl; public KonntenntuOut() throws <API key> { this(true); } public KonntenntuOut(boolean windowclose) throws <API key> { this.windowclose=windowclose; textPane = new JTextPaneDoc(); textPane.setCursor(new Cursor(Cursor.TEXT_CURSOR)); textPane.setText("!"); textPane.setFont(new Font("", Font.BOLD, 13)); textPane.setLayout(new ModifiedFlowLayout()); Container c = getContentPane(); // c.setLayout(new BorderLayout()); JScrollPane jsp = new JScrollPane(textPane); jsp.<API key>(<API key>); jl = new JLabel("!", SwingConstants.LEFT); JLabel jl1 = new JLabel( "java -version " + System.getProperty("java.version") + " Chiang Kai-shek(shoukaiseki) <jiang28555@gmail.com> " + " 2012-02-20 Tokyo japan ",SwingConstants.CENTER); // jl1.setBorder(BorderFactory.createEtchedBorder());// jl1.setFont(new Font(" ", Font.BOLD, 13)); // Box box = Box.createVerticalBox(); // // box.add(jl1); // box.add(Box.createVerticalStrut(8)); // Box box2 = Box.createHorizontalBox(); box2.add(new JLabel(":", SwingConstants.LEFT)); box2.add(Box.<API key>(8)); box2.add(jl); box2.add(Box.<API key>(8)); // box2.add(jb_insert); jsp.setBorder(BorderFactory.createEtchedBorder()); c.add(jl1, BorderLayout.NORTH); c.add(jsp, BorderLayout.CENTER); c.add(box2, BorderLayout.SOUTH); this.setSize(700, 500); // frame,window this.setLocation(200, 150); this.setVisible(true); this.setTitle("!"); if (windowclose) { this.<API key>(EXIT_ON_CLOSE); } textPane.cleanText(); } /** * @param args * @throws IOException * @throws <API key> */ public static void main(String[] args) throws IOException, <API key> { KonntenntuOut kks = new KonntenntuOut(); } public void println(String konntenntu) { println(konntenntu, false); } public void println(String konntenntu,boolean b) { try { textPane.addLastLine(konntenntu, b); } catch (<API key> e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
<!DOCTYPE html PUBLIC "- <html xmlns="http: <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.6"/> <title>Walicxe3D: /home/meithan/Desktop/walicxe3d Directory Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">Walicxe3D &#160;<span id="projectnumber">0.1</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.6 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="annotated.html"><span>Data&#160;Types&#160;List</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Pages</a></div> <!-- iframe showing the search results (closed by default) --> <div id="<API key>"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="<API key>.html">Desktop</a></li><li class="navelem"><a class="el" href="<API key>.html">walicxe3d</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">walicxe3d Directory Reference</div> </div> </div><!--header <div class="contents"> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="subdirs"></a> Directories</h2></td></tr> <tr class="memitem:<API key>"><td class="memItemLeft" align="right" valign="top">directory &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="<API key>.html">source</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Mon Mar 9 2015 15:54:57 for Walicxe3D by & <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.6 </small></address> </body> </html>
#include "model_dip_sqr.hpp" Ising2dDipSqr::Ising2dDipSqr( const unsigned int& size, const bool& periodic, const double& J, const double& g, const double& B, const double& T, const unsigned int& <API key>, const string& cwd ) : SystemModel( true, B, T, cwd ), J( J ), g( g ), N( size* size ), size( size ), <API key>( <API key> ), fsize_ordered_phase( false ), k_range( 2 * M_PI ), k_points( 201 ), sf_measurements( 0 ) { // wrong use of the model? if ( !periodic ) { cout << "Model: WARNING - Non-periodic boundary conditions" << " are not supported!" << endl; } if ( size % 2 != 0 ) { cout << "Model: WARNING - Size must be a multiple of 2!" << endl; } // set up two dimensional NxN array: spin[line][column] spin.resize( size ); for ( unsigned int line = 0; line < size; line++ ) { spin[line].resize( size ); } // set up an array for the precalculated interaction coeffs: effint[dl][dc] effint.resize( ( size / 2 ) + 1 ); //cout << "gate1" << endl; for ( unsigned int dl = 0; dl < ( size / 2 ) + 1; ++dl ) { effint[dl].resize( ( size / 2 ) + 1 ); for ( unsigned int dc = 0; dc < ( size / 2 ) + 1; ++dc ) { effint[dl][dc] = 0; } } // calculate the effective interaction strengths ofstream effint_log; effint_log.open( ( cwd + "effint.log" ).c_str() ); if ( !effint_log.is_open() ) { cout << "ERROR while opening effective interaction log file in " << cwd << endl; exit( 1 ); } ostream_setup( effint_log ); effint[1][0] = J;// nearest neighbour interaction for ( unsigned int dl = 0; dl < ( size / 2 ) + 1; ++dl ) { for ( unsigned int dc = 0; dc < dl + 1; ++dc ) { effint[dl][dc] += calc_effint_dipdip( dl, dc, 1000 ); effint[dc][dl] = effint[dl][dc]; effint_log << "effint[" << dl << "][" << dc << "] = " << effint[dl][dc] << endl; } } effint_log.close(); // set up an array for the structure factor sf_sum.resize( k_points ); for ( unsigned int line = 0; line < k_points; line++ ) { sf_sum[line].resize( k_points ); } // set up a black and white palette pal.push_back( png::color( 0, 0, 0 ) ); pal.push_back( png::color( 255, 255, 255 ) ); } Ising2dDipSqr::~Ising2dDipSqr() { // custom destructor, because we need to write // the structure factor to the logfile first // write structure factor to file ofstream sf_log; sf_log.open( ( cwd + "sf.log" ).c_str() ); if ( !sf_log.is_open() ) { cout << "ERROR while opening structure factor log file in " << cwd << endl; exit( 1 ); } ostream_setup( sf_log ); for ( unsigned int line = 0; line < k_points; line++ ) { for ( unsigned col = 0; col < k_points; col++ ) { double kx = line * k_range / ( k_points - 1 ) - k_range / 2.0; double ky = col * k_range / ( k_points - 1 ) - k_range / 2.0; sf_log << kx << ' ' << ky << ' ' << sf_sum[line][col] / sf_measurements / N << endl; } } sf_log.close(); // write plotting script ofstream sf_plot; sf_plot.open( ( cwd + "sf_plot.pyx" ).c_str() ); if ( !sf_plot.is_open() ) { cout << "ERROR while creating structure factor pyxplot file in " << cwd << endl; exit( 1 ); } sf_plot << "\ set terminal pdf \n\ set output 'structure_factor.pdf' \n\ set title 'Structure factor $S(\\vec k)$' \n\ set size 15 square \n\ set samples grid 201x201 \n\ set colourmap rgb(1-c1):(1-c1):(1-c1) \n\ set tics out \n\ set grid x y \n\ set xlabel \"$k_x$\" \n\ set xtics (\"$\\pi$\" pi, \"$\\frac{3\\pi}{4}$\" 3*pi/4, \ \"$\\frac{\\pi}{2}$\" pi/2, \"$\\frac{\\pi}{4}$\" pi/4, \ \"0\" 0, \\ \n\ \"$-\\pi$\" -pi, \"$-\\frac{3\\pi}{4}$\" -3*pi/4, \ \"$-\\frac{\\pi}{2}$\" -pi/2, \"$-\\frac{\\pi}{4}$\" -pi/4) \n\ set mxtics pi/8 \n\ set ylabel \"$k_y$\" \n\ set ytics (\"$\\pi$\" pi, \"$\\frac{3\\pi}{4}$\" 3*pi/4, \ \"$\\frac{\\pi}{2}$\" pi/2, \"$\\frac{\\pi}{4}$\" pi/4, \ \"0\" 0, \\ \n\ \"$-\\pi$\" -pi, \"$-\\frac{3\\pi}{4}$\" -3*pi/4, \ \"$-\\frac{\\pi}{2}$\" -pi/2, \"$-\\frac{\\pi}{4}$\" -pi/4) \n\ set mytics pi/8 \n\ plot [-pi:pi][-pi:pi] 'sf.log' with colourmap notitle"; sf_plot.close(); } double Ising2dDipSqr::calc_effint_dipdip( const int& dl_seed, const int& dc_seed, const int& system_clones ) { // calculate <API key> with a seed spin that is dl lines and dc columns // far away + all of its copies on a system_clones large system with periodic boundaries // system_clones = 1 --> 3x3; 2 --> 5x5; 3 --> 7x7; ... double result = 0; //uint count = 0; for ( long int dl = dl_seed - system_clones * size; dl < ( system_clones + 1 )*size; dl += size ) { for ( long int dc = dc_seed - system_clones * size; dc < ( system_clones + 1 )*size; dc += size ) { double r = sqrt( dl * dl + dc * dc ); if ( r == 0 ) { continue; // no interaction with itself ... } result += g / ( r * r * r ); //cout << dl << ' ' << dc << ' ' << ' ' << dl*dl+dc*dc << ' ' // << r << ' ' << result << endl; //count++; //if (count == 100) exit(0); /*if ((dl_seed == 1) && (dc_seed == 0)) { cout << g / (r*r*r) << endl; }*/ } } return result; } png::image< png::index_pixel > Ising2dDipSqr::get_image() const { png::image< png::index_pixel > image( size, size ); image.set_palette( pal ); for ( size_t line = 0; line < image.get_height(); ++line ) { for ( size_t col = 0; col < image.get_width(); ++col ) { if ( spin[line][col].get() == 1 ) { image[line][col] = png::index_pixel( 1 ); } else if ( spin[line][col].get() == -1 ) { image[line][col] = png::index_pixel( 0 ); } } } return image; } bool Ising2dDipSqr::prepare_striped( const unsigned int& stripe_width ) { if ( ( stripe_width == 0 ) || ( stripe_width > spin.size() ) ) { return false; } else { for ( int line = 0; line < size; line++ ) { for ( int col = 0; col < size; col++ ) { if ( ( col / stripe_width ) % 2 == 0 ) { spin[line][col].set( -1 ); } else { spin[line][col].set( 1 ); } } } return true; } } bool Ising2dDipSqr::prepare( const char& mode ) { switch ( mode ) { case 'r': // completely random state ... for ( int line = 0; line < size; line++ ) { for ( int col = 0; col < size; col++ ) { if ( gsl_rng_uniform_int( rng, 2 ) == 0 ) { spin[line][col].flip(); } } } break; case 'u': // sets all spins up for ( int line = 0; line < size; line++ ) { for ( int col = 0; col < size; col++ ) { spin[line][col].set( +1 ); } } break; case 'd': // sets all spins down for ( int line = 0; line < size; line++ ) { for ( int col = 0; col < size; col++ ) { spin[line][col].set( -1 ); } } break; case 'c': // checkerboard (afm ground state) for ( int line = 0; line < size; line++ ) { for ( int col = 0; col < size; col++ ) { if ( ( line + col ) % 2 == 0 ) { spin[line][col].set( -1 ); } else { spin[line][col].set( 1 ); } } } break; case 's': { // striped (automatically try to find ground state) unsigned int optimal_width = 1; prepare_striped( 1 ); double optimal_energy = h(); for ( unsigned int width = 2; width < spin.size(); width++ ) { prepare_striped( width ); if ( optimal_energy > h() ) { optimal_width = width; optimal_energy = h(); } } prepare_striped( optimal_width ); } break; default: if ( isdigit( mode ) ) { // striped with user defined width return prepare_striped( atoi( &mode ) ); } else { // unknown mode? return false; } } return true; } void Ising2dDipSqr::<API key>() { // find a random spin to flip int flip_line = gsl_rng_uniform_int( rng, size ); int flip_col = gsl_rng_uniform_int( rng, size ); // flip it! spin[flip_line][flip_col].flip(); // calculate energy difference double deltaH = - 2.0 * B * spin[flip_line][flip_col].get(); //cout << " " << deltaH << endl; for ( int line = 0; line < size; line++ ) { for ( int col = 0; col < size; col++ ) { int dl = min( abs( flip_line - line ), size - abs( flip_line - line ) ); int dc = min( abs( flip_col - col ), size - abs( flip_col - col ) ); deltaH += - 2.0 * effint[dl][dc] * ( spin[flip_line][flip_col] * spin[line][col] ); } } if ( deltaH > 0.0 ) { // accept the new state? if ( gsl_rng_uniform( rng ) > exp( - deltaH / T ) ) { // new state rejected ... reverting! spin[flip_line][flip_col].flip(); } } } void Ising2dDipSqr::mcstep() { for ( unsigned long int n = 1; n <= N; n++ ) { <API key>(); } time++; } void Ising2dDipSqr::mcstep_dry( const unsigned int& k_max ) { for ( unsigned int k = 0; k < k_max; k++ ) { mcstep(); } time = 0; if ( <API key> == 2 ) { // try do determine if the system is in the ordered phase unsigned int msmall_count = 0, mlarge_count = 0; for ( unsigned int k = 0; k < k_max; k++ ) { mcstep(); if ( abs( M() ) < N / 2 ) { msmall_count++; } else { mlarge_count++; } } if ( mlarge_count > msmall_count ) { fsize_ordered_phase = true; cout << "assuming ordered phase @ T = " << T << endl; } else { cout << "assuming disordered phase @ T = " << T << endl; } time = 0; } } double Ising2dDipSqr::H() const { // measures the system's energy double H = 0; // <API key> between S_i and S_j for ( int iline = 0; iline < size; iline++ ) { for ( int icol = 0; icol < size; icol++ ) { for ( int jline = 0; jline < size; jline++ ) { for ( int jcol = 0; jcol < size; jcol++ ) { int dl = min( abs( jline - iline ), size - abs( jline - iline ) ); int dc = min( abs( jcol - icol ), size - abs( jcol - icol ) ); H += - effint[dl][dc] * ( spin[iline][icol] * spin[jline][jcol] ); } } } } // TODO: double counting correction? H /= 2; // energy in external magnetic field if ( B != 0 ) { for ( int line = 0; line < size; line++ ) { for ( int col = 0; col < size; col++ ) { H += - B * spin[line][col].get(); } } } /*double oldH = H_old(); if (abs(1 - (H / oldH)) > 0.01) { cout << "H = " << H << " <--/--> oldH = " << oldH << endl; exit(1); }*/ return H; } double Ising2dDipSqr::h() const { // measures the system's energy per spin return H() / N; } unsigned long int Ising2dDipSqr::t() const { // measures the system's time in lattice sweeps (MC time units) return time; } int Ising2dDipSqr::M() const { // measures the system's magnetization int M = 0; for ( int line = 0; line < size; line++ ) { for ( int col = 0; col < size; col++ ) { M += spin[line][col].get(); } } // finite size corrections to the magnetization if ( ( <API key> == 1 ) || ( ( <API key> == 2 ) && fsize_ordered_phase ) ) { M = abs( M ); } return M; } double Ising2dDipSqr::m() const { // measures the system's magnetization per spin return double( M() ) / N; } vector<double> Ising2dDipSqr::ss_corr() const { // TODO: think about it ... // measure spin-spin correlations vector<double> result; vector<unsigned int> samples; result.resize( spin.size(), 0 ); samples.resize( spin.size(), 0 ); for ( int i = 0; i < size; i++ ) { for ( int j = 0; j < size; j++ ) { result[abs( int( i - j ) )] += spin[i][i] * spin[i][j]; result[abs( int( i - j ) )] += spin[i][i] * spin[j][i]; samples[abs( int( i - j ) )] += 2; } } for ( int d = 0; d < size; d++ ) { result[d] /= samples[d]; } return result; } unsigned int Ising2dDipSqr::spin_count() const { // returns the total number of spins in the system return N; } void Ising2dDipSqr::special_perbin( unsigned int& mode ) { // the only special thing we want to do is to calculate the structure factor if ( mode != 0 ) { sf_calc(); } } void Ising2dDipSqr::sf_calc() { // calculate the structure factor function for ( unsigned int line = 0; line < k_points; line++ ) { for ( unsigned int col = 0; col < k_points; col++ ) { double kx = line * k_range / ( k_points - 1 ) - k_range / 2.0; double ky = col * k_range / ( k_points - 1 ) - k_range / 2.0; sf_sum[line][col] += sf_k_calc( kx, ky ); } } sf_measurements++; } double Ising2dDipSqr::sf_k_calc( double& kx, double& ky ) { // calculate the structure factor sf(k) for a specific k complex<double> z( 0.0, 0.0 ); complex<double> i( 0.0, 1.0 ); complex<double> kr( 0.0, 0.0 ); for ( int y = 0; y < size; y++ ) { for ( int x = 0; x < size; x++ ) { z += double( spin[y][x].get() ) * exp( i * ( kx * x + ky * y ) ); } } return abs( z ) * abs( z ); }
title: 'DevOps : Quelques outils intéressants' author: Deimos type: post date: 2013-02-23T11:00:46+00:00 url: /2013/02/23/<API key>/ categories: - Developement - Hi-Tech - Linux - Web tags: - Developement - Hi-Tech - Linux - Web Lorsque j’étais au FOSDEM de cette année, j’ai eu un sacré personnage qui est venu me voir au Stand Puppet, que j’ai eu à côté de moi dans diverses présentations et qui est du genre a a voir une grande g…. Bref, même s’il l’ouvre un peu beaucoup à mon goût, il ne dit pas que des bêtises. Je suis tombé sur un slide qu'il a fait et que je trouve assez pertinent, j'ai donc décidé de vous le faire partager : <iframe src="//www.slideshare.net/slideshow/embed_code/key/CzC1d00a6dq7zw" width="595" height="485" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="border:1px solid
# ([C++](Cpp.md)) [C++ Core Guidelines](CppCoreGuidelines.md) The [C++ Core Guidelines](CppCoreGuidelines.md) are (from [1]): > The C++ Core Guidelines are a set of tried-and-true guidelines, rules, and best practices about coding in C++ ## External links * [C++ Core Guidelines GitHub](https://github.com/isocpp/CppCoreGuidelines) description * [Microsoft Visual Studio's article how to enable the C++ Core Guidelines warnings](https://docs.microsoft.com/en-us/visualstudio/code-quality/<API key>) ## [References](CppReferences.md) * [1] [https:
#include <stdbool.h> #include <stdint.h> #include "platform.h" #if defined(USE_VTX_RTC6705) && defined(USE_VTX_CONTROL) #include "common/maths.h" #include "common/utils.h" #include "config/feature.h" #include "drivers/max7456.h" #include "drivers/time.h" #include "drivers/vtx_rtc6705.h" #include "io/vtx.h" #include "io/vtx_rtc6705.h" #include "io/vtx_string.h" #if defined(USE_CMS) || defined(USE_VTX_COMMON) const char * rtc6705PowerNames[] = { "OFF", "MIN", "MAX" }; #endif #ifdef USE_VTX_COMMON static vtxVTable_t rtc6705VTable; // Forward static vtxDevice_t vtxRTC6705 = { .vTable = &rtc6705VTable, }; #endif static void <API key>(vtxDevice_t *vtxDevice, uint8_t band, uint8_t channel); static void <API key>(vtxDevice_t *vtxDevice, uint16_t frequency); bool vtxRTC6705Init(void) { vtxRTC6705.capability.bandCount = <API key>, vtxRTC6705.capability.channelCount = <API key>, vtxRTC6705.capability.powerCount = <API key>, vtxRTC6705.frequencyTable = <API key>(); vtxRTC6705.bandNames = vtxStringBandNames(); vtxRTC6705.bandLetters = <API key>(); vtxRTC6705.channelNames = <API key>(); vtxRTC6705.powerNames = rtc6705PowerNames, vtxCommonSetDevice(&vtxRTC6705); vtxInit(); return true; } bool vtxRTC6705CanUpdate(void) { #if defined(<API key>) && defined(<API key>) && defined(<API key>) if (featureIsEnabled(FEATURE_OSD)) { return !<API key>(); } #endif return true; } #ifdef RTC6705_POWER_PIN static void vtxRTC6705Configure(vtxDevice_t *vtxDevice) { rtc6705SetRFPower(vtxDevice->powerIndex); <API key>(vtxDevice, vtxDevice->band, vtxDevice->channel); } static void <API key>(vtxDevice_t *vtxDevice) { while (!vtxRTC6705CanUpdate()); rtc6705Enable(); delay(<API key>); vtxRTC6705Configure(vtxDevice); } #endif static void vtxRTC6705Process(vtxDevice_t *vtxDevice, timeUs_t now) { UNUSED(vtxDevice); UNUSED(now); } #ifdef USE_VTX_COMMON // Interface to common VTX API static vtxDevType_e <API key>(const vtxDevice_t *vtxDevice) { UNUSED(vtxDevice); return VTXDEV_RTC6705; } static bool vtxRTC6705IsReady(const vtxDevice_t *vtxDevice) { return vtxDevice != NULL; } static void <API key>(vtxDevice_t *vtxDevice, uint8_t band, uint8_t channel) { while (!vtxRTC6705CanUpdate()); if (band >= 1 && band <= <API key> && channel >= 1 && channel <= <API key>) { if (vtxDevice->powerIndex > 0) { vtxDevice->band = band; vtxDevice->channel = channel; <API key>(vtxDevice, <API key>(vtxDevice, band, channel)); } } } static void <API key>(vtxDevice_t *vtxDevice, uint8_t index) { while (!vtxRTC6705CanUpdate()); #ifdef RTC6705_POWER_PIN if (index == 0) { // power device off if (vtxDevice->powerIndex > 0) { // on, power it off vtxDevice->powerIndex = index; rtc6705Disable(); return; } else { // already off } } else { // change rf power and maybe turn the device on first if (vtxDevice->powerIndex == 0) { // if it's powered down, power it up, wait and configure channel, band and power. vtxDevice->powerIndex = index; <API key>(vtxDevice); return; } else { // if it's powered up, just set the rf power vtxDevice->powerIndex = index; rtc6705SetRFPower(index); } } #else vtxDevice->powerIndex = MAX(index, <API key>); rtc6705SetRFPower(index); #endif } static void <API key>(vtxDevice_t *vtxDevice, uint8_t onoff) { UNUSED(vtxDevice); UNUSED(onoff); } static void <API key>(vtxDevice_t *vtxDevice, uint16_t frequency) { if (frequency >= <API key> && frequency <= <API key>) { frequency = constrain(frequency, <API key>, <API key>); vtxDevice->frequency = frequency; rtc6705SetFrequency(frequency); } } static bool <API key>(const vtxDevice_t *vtxDevice, uint8_t *pBand, uint8_t *pChannel) { *pBand = vtxDevice->band; *pChannel = vtxDevice->channel; return true; } static bool <API key>(const vtxDevice_t *vtxDevice, uint8_t *pIndex) { *pIndex = vtxDevice->powerIndex; return true; } static bool <API key>(const vtxDevice_t *vtxDevice, uint8_t *pOnOff) { UNUSED(vtxDevice); UNUSED(pOnOff); return false; } static bool vtxRTC6705GetFreq(const vtxDevice_t *vtxDevice, uint16_t *pFrequency) { *pFrequency = vtxDevice->frequency; return true; } static vtxVTable_t rtc6705VTable = { .process = vtxRTC6705Process, .getDeviceType = <API key>, .isReady = vtxRTC6705IsReady, .setBandAndChannel = <API key>, .setPowerByIndex = <API key>, .setPitMode = <API key>, .setFrequency = <API key>, .getBandAndChannel = <API key>, .getPowerIndex = <API key>, .getPitMode = <API key>, .getFrequency = vtxRTC6705GetFreq, }; #endif // VTX_COMMON #endif // VTX_RTC6705
def sqrt_value(x): import numpy as np y = np.sqrt(x) print('The original value is: ', x) print('The root of value is: ', y) print(' print('Scipt complete') return
set serveroutput on; declare v_nome varchar2(100); v_idade number; begin v_nome := 'Nome do fulano'; v_idade:= 30; dbms_output.put_line('Nome: ' || v_nome || ' Idade:' || v_idade); end; declare v_nome varchar2(100) := 'Nome completo'; v_idade number:=20; v_email varchar2(100):='nome@dominio.com.br'; begin if v_idade < 18 then dbms_output.put_line ('Idade não permitida'); --elsif instr(v_email,'@')=0 then elsif v_email not like '%@%' then dbms_output.put_line ('Email inválido'); elsif instr(v_nome,' ')=0 or length(v_nome)<5 then dbms_output.put_line ('Nome inválido'); else dbms_output.put_line ('Nome :' || v_nome); dbms_output.put_line ('Idade :' || v_idade); dbms_output.put_line ('Email :' || v_email); end if; end; declare v_n1 number := 10; v_n2 number := 15; v_n3 number := 13; v_n4 number := 0; v_n5 number := 40; v_media number; begin v_media := trunc((v_n1+v_n2+v_n3+v_n4+v_n5)/5); dbms_output.put_line ('Com trunc ' || v_media); dbms_output.put_line ('Sem trunc ' || (v_n1+v_n2+v_n3+v_n4+v_n5)/5); end; declare v_ini number:=53; begin for x in v_ini..v_ini+100 loop if mod(x,2) = 0 then dbms_output.put_line (x || ' é par'); else dbms_output.put_line (x || ' é ímpar'); end if; v_ini:=v_ini+1; end loop; end; -- 5) Desenvolver um Bloco PL/SQL que receba um nome, caso o nome exceda 30 caracteres exiba somente o sobrenome. declare v_nome_completo varchar2(100); begin v_nome_completo:='aaaa bbbb cccc ddddd eeeee ffffffff ggggggggg'; if length(v_nome_completo)>30 then dbms_output.put_line (substr(v_nome_completo,instr(v_nome_completo,' ',-1)+1)); end if; end; -- 6) Desenvolver um Bloco PL/SQL que exiba a seguinte mensagem de texto: -- 'Hoje' || <sysdate> || ', estamos no seguinte dia da semana:' || <dia da semana> alter session set nls_language='brazilian portuguese'; begin dbms_output.put_line('Hoje' || sysdate || ', estamos no seguinte dia da semana:' || to_char(sysdate,'day month dd d hh24:mi:ss')); end; alter session set nls_language='english'; declare v_data date; begin v_data := to_date('28/03/2017','dd/mm/yyyy'); for x in 1..365 loop --if trim(to_char(v_data,'day'))='sábado' or trim(to_char(v_data,'day'))='domingo' then if to_char(v_data,'d')=7 or to_char(v_data,'d')=1 then dbms_output.put_line( v_data || ' é ' || to_char(v_data,'day')); end if; v_data:=v_data+1; end loop; end; select length(to_char(sysdate,'day')) from dual;
# Iterates through each directory from here, looking for files with the .tex # extension and puts the resulting PDF into the pdf directory
package com.mfedarko.m_physics; import android.os.Bundle; import android.app.Activity; import android.content.Intent; import android.view.Menu; import android.view.MenuItem; public class MotionTermsActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.<API key>); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.<API key>, menu); return true; } public boolean <API key>(MenuItem item) { switch(item.getItemId()) { case R.id.menu_credits: Intent i1 = new Intent(<API key>(), CreditsActivity.class); startActivity(i1); return true; default: return super.<API key>(item); } } }
SHELL = /bin/sh include ../configure.in include ../compile_rules.in TYPEDEFLIB = libcooptypedef.a TYPEDEFOBJ = page.o cwrapper.o constants.o svd.o basicutils.o sort.o sortrev.o string.o arguments.o function.o particle.o species.o cosmology.o wrapper.o default: $(TYPEDEFLIB) $(TYPEDEFLIB): $(TYPEDEFOBJ) ar -r $@ $? Test: $(TYPEDEFOBJ) test.o $(FC) $(FFLAGS) $(INCLUDE) -o $@ $(TYPEDEFOBJ) test.o $(LINK) clean: rm -f *.o *.*~ *.mod \#* *.a Makefile~ Test test.o :wrapper.o wrapper.o :cosmology.o cosmology.o :species.o page.o species.o :particle.o particle.o :function.o function.o :arguments.o arguments.o :string.o string.o :basicutils.o basicutils.o :svd.o svd.o :constants.o constants.o : ../include/constants.h
package DataAccess.Util; import java.util.List; /** * * @author Hugo */ public interface IUtil { String getActualMonthName(); int getActualMonth(); List<Integer> getMonthsTrans(int userId); String getMonthName(int monthValue); }
<?php class ModelDesignLayout extends Model { public function addLayout($data) { $this->event->trigger('pre.admin.layout.add', $data); $this->db->query("INSERT INTO " . DB_PREFIX . "layout SET name = '" . $this->db->escape($data['name']) . "'"); $layout_id = $this->db->getLastId(); if (isset($data['layout_route'])) { foreach ($data['layout_route'] as $layout_route) { $this->db->query("INSERT INTO " . DB_PREFIX . "layout_route SET layout_id = '" . (int)$layout_id . "', store_id = '" . (int)$layout_route['store_id'] . "', route = '" . $this->db->escape($layout_route['route']) . "'"); } } if (isset($data['layout_module'])) { foreach ($data['layout_module'] as $layout_module) { $this->db->query("INSERT INTO " . DB_PREFIX . "layout_module SET layout_id = '" . (int)$layout_id . "', code = '" . $this->db->escape($layout_module['code']) . "', position = '" . $this->db->escape($layout_module['position']) . "', sort_order = '" . (int)$layout_module['sort_order'] . "'"); } } $this->event->trigger('post.admin.layout.add', $layout_id); return $layout_id; } public function editLayout($layout_id, $data) { $this->event->trigger('pre.admin.layout.edit', $data); $this->db->query("UPDATE " . DB_PREFIX . "layout SET name = '" . $this->db->escape($data['name']) . "' WHERE layout_id = '" . (int)$layout_id . "'"); $this->db->query("DELETE FROM " . DB_PREFIX . "layout_route WHERE layout_id = '" . (int)$layout_id . "'"); if (isset($data['layout_route'])) { foreach ($data['layout_route'] as $layout_route) { $this->db->query("INSERT INTO " . DB_PREFIX . "layout_route SET layout_id = '" . (int)$layout_id . "', store_id = '" . (int)$layout_route['store_id'] . "', route = '" . $this->db->escape($layout_route['route']) . "'"); } } $this->db->query("DELETE FROM " . DB_PREFIX . "layout_module WHERE layout_id = '" . (int)$layout_id . "'"); if (isset($data['layout_module'])) { foreach ($data['layout_module'] as $layout_module) { $this->db->query("INSERT INTO " . DB_PREFIX . "layout_module SET layout_id = '" . (int)$layout_id . "', code = '" . $this->db->escape($layout_module['code']) . "', position = '" . $this->db->escape($layout_module['position']) . "', sort_order = '" . (int)$layout_module['sort_order'] . "'"); } } $this->event->trigger('post.admin.layout.edit', $layout_id); } public function deleteLayout($layout_id) { $this->event->trigger('pre.admin.layout.delete', $layout_id); $this->db->query("DELETE FROM " . DB_PREFIX . "layout WHERE layout_id = '" . (int)$layout_id . "'"); $this->db->query("DELETE FROM " . DB_PREFIX . "layout_route WHERE layout_id = '" . (int)$layout_id . "'"); $this->db->query("DELETE FROM " . DB_PREFIX . "layout_module WHERE layout_id = '" . (int)$layout_id . "'"); $this->db->query("DELETE FROM " . DB_PREFIX . "category_to_layout WHERE layout_id = '" . (int)$layout_id . "'"); $this->db->query("DELETE FROM " . DB_PREFIX . "product_to_layout WHERE layout_id = '" . (int)$layout_id . "'"); $this->db->query("DELETE FROM " . DB_PREFIX . "<API key> WHERE layout_id = '" . (int)$layout_id . "'"); $this->event->trigger('post.admin.layout.delete', $layout_id); } public function getLayout($layout_id) { $query = $this->db->query("SELECT DISTINCT * FROM " . DB_PREFIX . "layout WHERE layout_id = '" . (int)$layout_id . "'"); return $query->row; } public function getLayouts($data = array()) { $sql = "SELECT * FROM " . DB_PREFIX . "layout"; $sort_data = array('name'); if (isset($data['sort']) && in_array($data['sort'], $sort_data)) { $sql .= " ORDER BY " . $data['sort']; } else { $sql .= " ORDER BY name"; } if (isset($data['order']) && ($data['order'] == 'DESC')) { $sql .= " DESC"; } else { $sql .= " ASC"; } if (isset($data['start']) || isset($data['limit'])) { if ($data['start'] < 0) { $data['start'] = 0; } if ($data['limit'] < 1) { $data['limit'] = 20; } $sql .= " LIMIT " . (int)$data['start'] . "," . (int)$data['limit']; } $query = $this->db->query($sql); return $query->rows; } public function getLayoutRoutes($layout_id) { $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "layout_route WHERE layout_id = '" . (int)$layout_id . "'"); return $query->rows; } public function getLayoutModules($layout_id) { $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "layout_module WHERE layout_id = '" . (int)$layout_id . "'"); return $query->rows; } public function getTotalLayouts() { $query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "layout"); return $query->row['total']; } }
<?php namespace pocketmine\block; use pocketmine\item\Item; use pocketmine\item\Tool; use pocketmine\math\AxisAlignedBB; use pocketmine\Player; class Slab extends Transparent { const STONE = 0; const SANDSTONE = 1; const WOODEN = 2; const COBBLESTONE = 3; const BRICK = 4; const STONE_BRICK = 5; const QUARTZ = 6; const NETHER_BRICK = 7; const PURPUR_BLOCK = 8; protected $id = self::SLAB; public function __construct($meta = 0) { $this->meta = $meta; } public function getHardness() { return 2; } public function getName(): string { static $names = [ 0 => "Stone", 1 => "Sandstone", 2 => "Wooden", 3 => "Cobblestone", 4 => "Brick", 5 => "Stone Brick", 6 => "Quartz", 7 => "Purpur", ]; return (($this->meta & 0x08) > 0 ? "Upper " : "") . $names[$this->meta & 0x07] . " Slab"; } public function getBurnChance(): int { $type = $this->meta & 0x07; if ($type == self::WOODEN) { return 5; } return 0; } public function getBurnAbility(): int { $type = $this->meta & 0x07; if ($type == self::WOODEN) { return 5; } return 0; } protected function <API key>() { if (($this->meta & 0x08) > 0) { return new AxisAlignedBB( $this->x, $this->y + 0.5, $this->z, $this->x + 1, $this->y + 1, $this->z + 1 ); } else { return new AxisAlignedBB( $this->x, $this->y, $this->z, $this->x + 1, $this->y + 0.5, $this->z + 1 ); } } public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null) { $this->meta &= 0x07; if ($face === 0) { if ($target->getId() === self::SLAB and ($target->getDamage() & 0x08) === 0x08 and ($target->getDamage() & 0x07) === ($this->meta & 0x07)) { $this->getLevel()->setBlock($target, Block::get(Item::DOUBLE_SLAB, $this->meta), true); return true; } elseif ($block->getId() === self::SLAB and ($block->getDamage() & 0x07) === ($this->meta & 0x07)) { $this->getLevel()->setBlock($block, Block::get(Item::DOUBLE_SLAB, $this->meta), true); return true; } else { $this->meta |= 0x08; } } elseif ($face === 1) { if ($target->getId() === self::SLAB and ($target->getDamage() & 0x08) === 0 and ($target->getDamage() & 0x07) === ($this->meta & 0x07)) { $this->getLevel()->setBlock($target, Block::get(Item::DOUBLE_SLAB, $this->meta), true); return true; } elseif ($block->getId() === self::SLAB and ($block->getDamage() & 0x07) === ($this->meta & 0x07)) { $this->getLevel()->setBlock($block, Block::get(Item::DOUBLE_SLAB, $this->meta), true); return true; } //TODO: check for collision } else { if ($block->getId() === self::SLAB) { if (($block->getDamage() & 0x07) === ($this->meta & 0x07)) { $this->getLevel()->setBlock($block, Block::get(Item::DOUBLE_SLAB, $this->meta), true); return true; } return false; } else { if ($fy > 0.5) { $this->meta |= 0x08; } } } if ($block->getId() === self::SLAB and ($target->getDamage() & 0x07) !== ($this->meta & 0x07)) { return false; } $this->getLevel()->setBlock($block, $this, true, true); return true; } public function getDrops(Item $item): array { if ($item->isPickaxe() >= 1) { return [ [$this->id, $this->meta & 0x07, 1], ]; } else { return []; } } public function getToolType() { return Tool::TYPE_PICKAXE; } }
package com.mobc3.platform.backend.commons.architecture.pseudocdn; import java.io.*; import javax.annotation.*; public class <API key> { private String publicKeyFilename; private String publishingRoot; private String mapping; @PostConstruct public void init() throws IOException { PseudoCdnServlet.getInstance().setProperties(this); } public void <API key>(String publicKeyFilename) { this.publicKeyFilename = publicKeyFilename; } public String <API key>() { return publicKeyFilename; } public void setPublishingRoot(String publishingRoot) { this.publishingRoot = publishingRoot; } public String getPublishingRoot() { return publishingRoot; } public void setMapping(String mapping) { this.mapping = mapping; } public String getMapping() { return mapping; } }
<!DOCTYPE html> <!-- Generated for mars-sim by st.pa. --> <html lang="en"> <head> <meta charset="UTF-8"> <title>Mars Simulation Project - Generated help file - Process "manufacture electrostatic precipitator"</title> <link rel="stylesheet" href="../msp.css"> </head> <body> <TT> <h2>Process : "Manufacture Electrostatic Precipitator"</h2> 1. Description : <p><ul><li></li></ul></p><br/>2. Characteristics : <table> <tr> <td>Required&nbsp;Building&nbsp;Tech&nbsp;Level&nbsp;&nbsp;&nbsp;</td> <td>3</td> </tr> <tr> <td>Required&nbsp;Skill&nbsp;Level</td> <td>3</td> </tr> <tr> <td>Work&nbsp;Time&nbsp;in&nbsp;millisols</td> <td>300.0</td> </tr> <tr> <td>Time&nbsp;in&nbsp;millisols</td> <td>200.0</td> </tr> <tr> <td>Power&nbsp;Requirement</td> <td>0.5</td> </tr> </table> <br/> 3. Process Inputs : <p><table><ul> <tr> <td><li></td> <td><a href="../parts/parts.html">Part</a></td> <td>&nbsp;&nbsp;&nbsp;</td> <td>2.0</td> <td>&nbsp;&nbsp;&nbsp;</td> <td><a href="../parts/part_steel_sheet.html">Steel&nbsp;Sheet</a></td> <td></li></td> </tr> <tr> <td><li></td> <td><a href="../parts/parts.html">Part</a></td> <td>&nbsp;&nbsp;&nbsp;</td> <td>1.0</td> <td>&nbsp;&nbsp;&nbsp;</td> <td><a href="../parts/<API key>.html">Electrical&nbsp;Wire</a></td> <td></li></td> </tr> <tr> <td><li></td> <td><a href="../parts/parts.html">Part</a></td> <td>&nbsp;&nbsp;&nbsp;</td> <td>3.0</td> <td>&nbsp;&nbsp;&nbsp;</td> <td><a href="../parts/part_wire_connector.html">Wire&nbsp;Connector</a></td> <td></li></td> </tr> <tr> <td><li></td> <td><a href="../parts/parts.html">Part</a></td> <td>&nbsp;&nbsp;&nbsp;</td> <td>1.0</td> <td>&nbsp;&nbsp;&nbsp;</td> <td><a href="../parts/<API key>.html">Small&nbsp;Transformer</a></td> <td></li></td> </tr> <tr> <td><li></td> <td><a href="../parts/parts.html">Part</a></td> <td>&nbsp;&nbsp;&nbsp;</td> <td>2.0</td> <td>&nbsp;&nbsp;&nbsp;</td> <td><a href="../parts/part_steel_pipe.html">Steel&nbsp;Pipe</a></td> <td></li></td> </tr> </table></p> <br/> 4. Process Outputs : <p><table><ul> <tr> <td><li></td> <td><a href="../parts/parts.html">Part</a></td> <td>&nbsp;&nbsp;&nbsp;</td> <td>1.0</td> <td>&nbsp;&nbsp;&nbsp;</td> <td><a href="../parts/<API key>.html">Electrostatic&nbsp;Precipitator</a></td> <td></li></td> </tr> </ul></table></p> <br/><hr><a href="../processes/processes.html">Back To Processes Overview</a></br></br> </TT> </body> </html>
<?php $NAME='<API key> WebShell- ID 310'; $TAGCLEAR='if (ereg(\'^[[:blank:]]*cd[[:blank:]]+([^;]+)$\', $command, $regs))'; $TAGBASE64='aWYgKGVyZWcoXCdeW1s6Ymxhbms6XV0qY2RbWzpibGFuazpdXSsoW147XSspJFwnLCAkY29tbWFuZCwgJHJlZ3MpKQ=='; $TAGHEX='6966202865726567285c275e5b5b3a626c616e6b3a5d5d2a63645b5b3a626c616e6b3a5d5d2b285b5e3b5d2b29245c272c2024636f6d6d616e642c2024726567732929'; $TAGHEXPHP=''; $TAGURI='if+%28ereg%28%5C%27%5E%5B%5B%3Ablank%3A%5D%5D%2Acd%5B%5B%3Ablank%3A%5D%5D%2B%28%5B%5E%3B%5D%2B%29%24%5C%27%2C+%24command%2C+%24regs%29%29'; $TAGCLEAR2=''; $TAGBASE642=''; $TAGHEX2=''; $TAGHEXPHP2=''; $TAGURI2=''; $DATEADD='09/09/2019'; $LINK='Webexploitscan.org'; $ACTIVED='1'; $VSTATR='WebShell';
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_202-release) on Mon Dec 02 22:38:42 GMT 2019 --> <title>T-Index</title> <meta name="date" content="2019-12-02"> <link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style"> <script type="text/javascript" src="../script.js"></script> </head> <body> <script type="text/javascript"><! try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="T-Index"; } } catch(err) { } </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <div class="topNav"><a name="navbar.top"> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../overview-summary.html">Overview</a></li> <li>Package</li> <li>Class</li> <li><a href="../overview-tree.html">Tree</a></li> <li><a href="../deprecated-list.html">Deprecated</a></li> <li class="navBarCell1Rev">Index</li> <li><a href="../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="index-16.html">Prev Letter</a></li> <li><a href="index-18.html">Next Letter</a></li> </ul> <ul class="navList"> <li><a href="../index.html?index-files/index-17.html" target="_top">Frames</a></li> <li><a href="index-17.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip.navbar.top"> </a></div> <div class="contentContainer"><a href="index-1.html">A</a>&nbsp;<a href="index-2.html">B</a>&nbsp;<a href="index-3.html">C</a>&nbsp;<a href="index-4.html">D</a>&nbsp;<a href="index-5.html">E</a>&nbsp;<a href="index-6.html">F</a>&nbsp;<a href="index-7.html">G</a>&nbsp;<a href="index-8.html">H</a>&nbsp;<a href="index-9.html">I</a>&nbsp;<a href="index-10.html">L</a>&nbsp;<a href="index-11.html">M</a>&nbsp;<a href="index-12.html">N</a>&nbsp;<a href="index-13.html">O</a>&nbsp;<a href="index-14.html">P</a>&nbsp;<a href="index-15.html">R</a>&nbsp;<a href="index-16.html">S</a>&nbsp;<a href="index-17.html">T</a>&nbsp;<a href="index-18.html">U</a>&nbsp;<a href="index-19.html">W</a>&nbsp;<a href="index-20.html">Z</a>&nbsp;<a name="I:T"> </a> <h2 class="title">T</h2> <dl> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/activity/LineFragment.html#tabLayout">tabLayout</a></span> - Variable in class org.thecosmicfrog.luasataglance.activity.<a href="../org/thecosmicfrog/luasataglance/activity/LineFragment.html" title="class in org.thecosmicfrog.luasataglance.activity">LineFragment</a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/view/<API key>.html#tableRowStops">tableRowStops</a></span> - Variable in class org.thecosmicfrog.luasataglance.view.<a href="../org/thecosmicfrog/luasataglance/view/<API key>.html" title="class in org.thecosmicfrog.luasataglance.view"><API key></a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/ExampleUnitTest.html#testAThing--">testAThing()</a></span> - Method in class org.thecosmicfrog.luasataglance.<a href="../org/thecosmicfrog/luasataglance/ExampleUnitTest.html" title="class in org.thecosmicfrog.luasataglance">ExampleUnitTest</a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/service/<API key>.html#<API key>"><API key></a></span> - Variable in class org.thecosmicfrog.luasataglance.service.<a href="../org/thecosmicfrog/luasataglance/service/<API key>.html" title="class in org.thecosmicfrog.luasataglance.service"><API key></a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/widget/StopForecastWidget.html#<API key>"><API key></a></span> - Variable in class org.thecosmicfrog.luasataglance.widget.<a href="../org/thecosmicfrog/luasataglance/widget/StopForecastWidget.html" title="class in org.thecosmicfrog.luasataglance.widget">StopForecastWidget</a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/service/<API key>.html#<API key>"><API key></a></span> - Variable in class org.thecosmicfrog.luasataglance.service.<a href="../org/thecosmicfrog/luasataglance/service/<API key>.html" title="class in org.thecosmicfrog.luasataglance.service"><API key></a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/widget/StopForecastWidget.html#<API key>"><API key></a></span> - Variable in class org.thecosmicfrog.luasataglance.widget.<a href="../org/thecosmicfrog/luasataglance/widget/StopForecastWidget.html" title="class in org.thecosmicfrog.luasataglance.widget">StopForecastWidget</a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/service/<API key>.html#<API key>"><API key></a></span> - Variable in class org.thecosmicfrog.luasataglance.service.<a href="../org/thecosmicfrog/luasataglance/service/<API key>.html" title="class in org.thecosmicfrog.luasataglance.service"><API key></a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/widget/StopForecastWidget.html#<API key>"><API key></a></span> - Variable in class org.thecosmicfrog.luasataglance.widget.<a href="../org/thecosmicfrog/luasataglance/widget/StopForecastWidget.html" title="class in org.thecosmicfrog.luasataglance.widget">StopForecastWidget</a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/service/<API key>.html#<API key>"><API key></a></span> - Variable in class org.thecosmicfrog.luasataglance.service.<a href="../org/thecosmicfrog/luasataglance/service/<API key>.html" title="class in org.thecosmicfrog.luasataglance.service"><API key></a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/widget/StopForecastWidget.html#<API key>"><API key></a></span> - Variable in class org.thecosmicfrog.luasataglance.widget.<a href="../org/thecosmicfrog/luasataglance/widget/StopForecastWidget.html" title="class in org.thecosmicfrog.luasataglance.widget">StopForecastWidget</a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/service/<API key>.html#<API key>"><API key></a></span> - Variable in class org.thecosmicfrog.luasataglance.service.<a href="../org/thecosmicfrog/luasataglance/service/<API key>.html" title="class in org.thecosmicfrog.luasataglance.service"><API key></a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/widget/StopForecastWidget.html#<API key>"><API key></a></span> - Variable in class org.thecosmicfrog.luasataglance.widget.<a href="../org/thecosmicfrog/luasataglance/widget/StopForecastWidget.html" title="class in org.thecosmicfrog.luasataglance.widget">StopForecastWidget</a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/service/<API key>.html#<API key>"><API key></a></span> - Variable in class org.thecosmicfrog.luasataglance.service.<a href="../org/thecosmicfrog/luasataglance/service/<API key>.html" title="class in org.thecosmicfrog.luasataglance.service"><API key></a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/widget/StopForecastWidget.html#<API key>"><API key></a></span> - Variable in class org.thecosmicfrog.luasataglance.widget.<a href="../org/thecosmicfrog/luasataglance/widget/StopForecastWidget.html" title="class in org.thecosmicfrog.luasataglance.widget">StopForecastWidget</a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/service/<API key>.html#<API key>"><API key></a></span> - Variable in class org.thecosmicfrog.luasataglance.service.<a href="../org/thecosmicfrog/luasataglance/service/<API key>.html" title="class in org.thecosmicfrog.luasataglance.service"><API key></a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/widget/StopForecastWidget.html#<API key>"><API key></a></span> - Variable in class org.thecosmicfrog.luasataglance.widget.<a href="../org/thecosmicfrog/luasataglance/widget/StopForecastWidget.html" title="class in org.thecosmicfrog.luasataglance.widget">StopForecastWidget</a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/service/<API key>.html#<API key>"><API key></a></span> - Variable in class org.thecosmicfrog.luasataglance.service.<a href="../org/thecosmicfrog/luasataglance/service/<API key>.html" title="class in org.thecosmicfrog.luasataglance.service"><API key></a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/widget/StopForecastWidget.html#<API key>"><API key></a></span> - Variable in class org.thecosmicfrog.luasataglance.widget.<a href="../org/thecosmicfrog/luasataglance/widget/StopForecastWidget.html" title="class in org.thecosmicfrog.luasataglance.widget">StopForecastWidget</a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/service/<API key>.html#<API key>"><API key></a></span> - Variable in class org.thecosmicfrog.luasataglance.service.<a href="../org/thecosmicfrog/luasataglance/service/<API key>.html" title="class in org.thecosmicfrog.luasataglance.service"><API key></a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/widget/StopForecastWidget.html#<API key>"><API key></a></span> - Variable in class org.thecosmicfrog.luasataglance.widget.<a href="../org/thecosmicfrog/luasataglance/widget/StopForecastWidget.html" title="class in org.thecosmicfrog.luasataglance.widget">StopForecastWidget</a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/service/<API key>.html#<API key>"><API key></a></span> - Variable in class org.thecosmicfrog.luasataglance.service.<a href="../org/thecosmicfrog/luasataglance/service/<API key>.html" title="class in org.thecosmicfrog.luasataglance.service"><API key></a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/widget/StopForecastWidget.html#<API key>"><API key></a></span> - Variable in class org.thecosmicfrog.luasataglance.widget.<a href="../org/thecosmicfrog/luasataglance/widget/StopForecastWidget.html" title="class in org.thecosmicfrog.luasataglance.widget">StopForecastWidget</a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/service/<API key>.html#<API key>"><API key></a></span> - Variable in class org.thecosmicfrog.luasataglance.service.<a href="../org/thecosmicfrog/luasataglance/service/<API key>.html" title="class in org.thecosmicfrog.luasataglance.service"><API key></a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/widget/StopForecastWidget.html#<API key>"><API key></a></span> - Variable in class org.thecosmicfrog.luasataglance.widget.<a href="../org/thecosmicfrog/luasataglance/widget/StopForecastWidget.html" title="class in org.thecosmicfrog.luasataglance.widget">StopForecastWidget</a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/service/<API key>.html#<API key>"><API key></a></span> - Variable in class org.thecosmicfrog.luasataglance.service.<a href="../org/thecosmicfrog/luasataglance/service/<API key>.html" title="class in org.thecosmicfrog.luasataglance.service"><API key></a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/widget/StopForecastWidget.html#<API key>"><API key></a></span> - Variable in class org.thecosmicfrog.luasataglance.widget.<a href="../org/thecosmicfrog/luasataglance/widget/StopForecastWidget.html" title="class in org.thecosmicfrog.luasataglance.widget">StopForecastWidget</a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/service/<API key>.html#TEXTVIEW_STOP_NAME">TEXTVIEW_STOP_NAME</a></span> - Variable in class org.thecosmicfrog.luasataglance.service.<a href="../org/thecosmicfrog/luasataglance/service/<API key>.html" title="class in org.thecosmicfrog.luasataglance.service"><API key></a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/service/<API key>.html#<API key>"><API key></a></span> - Variable in class org.thecosmicfrog.luasataglance.service.<a href="../org/thecosmicfrog/luasataglance/service/<API key>.html" title="class in org.thecosmicfrog.luasataglance.service"><API key></a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/widget/StopForecastWidget.html#<API key>"><API key></a></span> - Variable in class org.thecosmicfrog.luasataglance.widget.<a href="../org/thecosmicfrog/luasataglance/widget/StopForecastWidget.html" title="class in org.thecosmicfrog.luasataglance.widget">StopForecastWidget</a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/activity/LineFragment.html#<API key>"><API key></a></span> - Variable in class org.thecosmicfrog.luasataglance.activity.<a href="../org/thecosmicfrog/luasataglance/activity/LineFragment.html" title="class in org.thecosmicfrog.luasataglance.activity">LineFragment</a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/view/<API key>.html#textViewDirection">textViewDirection</a></span> - Variable in class org.thecosmicfrog.luasataglance.view.<a href="../org/thecosmicfrog/luasataglance/view/<API key>.html" title="class in org.thecosmicfrog.luasataglance.view"><API key></a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/activity/FaresActivity.html#<API key>"><API key></a></span> - Variable in class org.thecosmicfrog.luasataglance.activity.<a href="../org/thecosmicfrog/luasataglance/activity/FaresActivity.html" title="class in org.thecosmicfrog.luasataglance.activity">FaresActivity</a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/activity/FaresActivity.html#textViewFaresPeak">textViewFaresPeak</a></span> - Variable in class org.thecosmicfrog.luasataglance.activity.<a href="../org/thecosmicfrog/luasataglance/activity/FaresActivity.html" title="class in org.thecosmicfrog.luasataglance.activity">FaresActivity</a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/activity/<API key>.html#<API key>"><API key></a></span> - Variable in class org.thecosmicfrog.luasataglance.activity.<a href="../org/thecosmicfrog/luasataglance/activity/<API key>.html" title="class in org.thecosmicfrog.luasataglance.activity"><API key></a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/activity/<API key>.html#<API key>"><API key></a></span> - Variable in class org.thecosmicfrog.luasataglance.activity.<a href="../org/thecosmicfrog/luasataglance/activity/<API key>.html" title="class in org.thecosmicfrog.luasataglance.activity"><API key></a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/activity/<API key>.html#<API key>"><API key></a></span> - Variable in class org.thecosmicfrog.luasataglance.activity.<a href="../org/thecosmicfrog/luasataglance/activity/<API key>.html" title="class in org.thecosmicfrog.luasataglance.activity"><API key></a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/activity/<API key>.html#<API key>"><API key></a></span> - Variable in class org.thecosmicfrog.luasataglance.activity.<a href="../org/thecosmicfrog/luasataglance/activity/<API key>.html" title="class in org.thecosmicfrog.luasataglance.activity"><API key></a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/view/StatusCardView.html#textViewStatus">textViewStatus</a></span> - Variable in class org.thecosmicfrog.luasataglance.view.<a href="../org/thecosmicfrog/luasataglance/view/StatusCardView.html" title="class in org.thecosmicfrog.luasataglance.view">StatusCardView</a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/view/StatusCardView.html#textViewStatusTitle">textViewStatusTitle</a></span> - Variable in class org.thecosmicfrog.luasataglance.view.<a href="../org/thecosmicfrog/luasataglance/view/StatusCardView.html" title="class in org.thecosmicfrog.luasataglance.view">StatusCardView</a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/activity/<API key>.html#textViewStopName">textViewStopName</a></span> - Variable in class org.thecosmicfrog.luasataglance.activity.<a href="../org/thecosmicfrog/luasataglance/activity/<API key>.html" title="class in org.thecosmicfrog.luasataglance.activity"><API key></a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/view/<API key>.html#textViewStopNames">textViewStopNames</a></span> - Variable in class org.thecosmicfrog.luasataglance.view.<a href="../org/thecosmicfrog/luasataglance/view/<API key>.html" title="class in org.thecosmicfrog.luasataglance.view"><API key></a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/view/<API key>.html#textViewStopTimes">textViewStopTimes</a></span> - Variable in class org.thecosmicfrog.luasataglance.view.<a href="../org/thecosmicfrog/luasataglance/view/<API key>.html" title="class in org.thecosmicfrog.luasataglance.view"><API key></a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/view/TutorialCardView.html#textViewTutorial">textViewTutorial</a></span> - Variable in class org.thecosmicfrog.luasataglance.view.<a href="../org/thecosmicfrog/luasataglance/view/TutorialCardView.html" title="class in org.thecosmicfrog.luasataglance.view">TutorialCardView</a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/activity/LineFragment.html#timerTaskReload">timerTaskReload</a></span> - Variable in class org.thecosmicfrog.luasataglance.activity.<a href="../org/thecosmicfrog/luasataglance/activity/LineFragment.html" title="class in org.thecosmicfrog.luasataglance.activity">LineFragment</a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/activity/<API key>.html#timerTaskReload">timerTaskReload</a></span> - Variable in class org.thecosmicfrog.luasataglance.activity.<a href="../org/thecosmicfrog/luasataglance/activity/<API key>.html" title="class in org.thecosmicfrog.luasataglance.activity"><API key></a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/object/Tram.html#toString--">toString()</a></span> - Method in class org.thecosmicfrog.luasataglance.object.<a href="../org/thecosmicfrog/luasataglance/object/Tram.html" title="class in org.thecosmicfrog.luasataglance.object">Tram</a></dt> <dd>&nbsp;</dd> <dt><a href="../org/thecosmicfrog/luasataglance/object/Tram.html" title="class in org.thecosmicfrog.luasataglance.object"><span class="typeNameLink">Tram</span></a> - Class in <a href="../org/thecosmicfrog/luasataglance/object/package-summary.html">org.thecosmicfrog.luasataglance.object</a></dt> <dd>&nbsp;</dd> <dt><a href="../org/thecosmicfrog/luasataglance/object/Tram.html" title="class in org.thecosmicfrog.luasataglance.object"><span class="typeNameLink">Tram</span></a> - Class in <a href="../org/thecosmicfrog/luasataglance/object/package-summary.html">org.thecosmicfrog.luasataglance.object</a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/object/Tram.html#Tram-java.lang.String-java.lang.String-java.lang.String-">Tram(String, String, String)</a></span> - Constructor for class org.thecosmicfrog.luasataglance.object.<a href="../org/thecosmicfrog/luasataglance/object/Tram.html" title="class in org.thecosmicfrog.luasataglance.object">Tram</a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/api/ApiTimes.html#trams">trams</a></span> - Variable in class org.thecosmicfrog.luasataglance.api.<a href="../org/thecosmicfrog/luasataglance/api/ApiTimes.html" title="class in org.thecosmicfrog.luasataglance.api">ApiTimes</a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/util/Constant.html#TUTORIAL_FAVOURITES">TUTORIAL_FAVOURITES</a></span> - Static variable in class org.thecosmicfrog.luasataglance.util.<a href="../org/thecosmicfrog/luasataglance/util/Constant.html" title="class in org.thecosmicfrog.luasataglance.util">Constant</a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/util/Constant.html#<API key>"><API key></a></span> - Static variable in class org.thecosmicfrog.luasataglance.util.<a href="../org/thecosmicfrog/luasataglance/util/Constant.html" title="class in org.thecosmicfrog.luasataglance.util">Constant</a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/util/Constant.html#<API key>"><API key></a></span> - Static variable in class org.thecosmicfrog.luasataglance.util.<a href="../org/thecosmicfrog/luasataglance/util/Constant.html" title="class in org.thecosmicfrog.luasataglance.util">Constant</a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/util/Analytics.html#<API key>.content.Context-java.lang.String-java.lang.String-">tutorialBegin(Context, String, String)</a></span> - Static method in class org.thecosmicfrog.luasataglance.util.<a href="../org/thecosmicfrog/luasataglance/util/Analytics.html" title="class in org.thecosmicfrog.luasataglance.util">Analytics</a></dt> <dd>&nbsp;</dd> <dt><a href="../org/thecosmicfrog/luasataglance/view/TutorialCardView.html" title="class in org.thecosmicfrog.luasataglance.view"><span class="typeNameLink">TutorialCardView</span></a> - Class in <a href="../org/thecosmicfrog/luasataglance/view/package-summary.html">org.thecosmicfrog.luasataglance.view</a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/view/TutorialCardView.html#<API key>.content.Context-">TutorialCardView(Context)</a></span> - Constructor for class org.thecosmicfrog.luasataglance.view.<a href="../org/thecosmicfrog/luasataglance/view/TutorialCardView.html" title="class in org.thecosmicfrog.luasataglance.view">TutorialCardView</a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/view/TutorialCardView.html#<API key>.content.Context-android.util.AttributeSet-">TutorialCardView(Context, AttributeSet)</a></span> - Constructor for class org.thecosmicfrog.luasataglance.view.<a href="../org/thecosmicfrog/luasataglance/view/TutorialCardView.html" title="class in org.thecosmicfrog.luasataglance.view">TutorialCardView</a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../org/thecosmicfrog/luasataglance/view/TutorialCardView.html#<API key>.content.Context-android.util.AttributeSet-int-">TutorialCardView(Context, AttributeSet, int)</a></span> - Constructor for class org.thecosmicfrog.luasataglance.view.<a href="../org/thecosmicfrog/luasataglance/view/TutorialCardView.html" title="class in org.thecosmicfrog.luasataglance.view">TutorialCardView</a></dt> <dd>&nbsp;</dd> </dl> <a href="index-1.html">A</a>&nbsp;<a href="index-2.html">B</a>&nbsp;<a href="index-3.html">C</a>&nbsp;<a href="index-4.html">D</a>&nbsp;<a href="index-5.html">E</a>&nbsp;<a href="index-6.html">F</a>&nbsp;<a href="index-7.html">G</a>&nbsp;<a href="index-8.html">H</a>&nbsp;<a href="index-9.html">I</a>&nbsp;<a href="index-10.html">L</a>&nbsp;<a href="index-11.html">M</a>&nbsp;<a href="index-12.html">N</a>&nbsp;<a href="index-13.html">O</a>&nbsp;<a href="index-14.html">P</a>&nbsp;<a href="index-15.html">R</a>&nbsp;<a href="index-16.html">S</a>&nbsp;<a href="index-17.html">T</a>&nbsp;<a href="index-18.html">U</a>&nbsp;<a href="index-19.html">W</a>&nbsp;<a href="index-20.html">Z</a>&nbsp;</div> <div class="bottomNav"><a name="navbar.bottom"> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../overview-summary.html">Overview</a></li> <li>Package</li> <li>Class</li> <li><a href="../overview-tree.html">Tree</a></li> <li><a href="../deprecated-list.html">Deprecated</a></li> <li class="navBarCell1Rev">Index</li> <li><a href="../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="index-16.html">Prev Letter</a></li> <li><a href="index-18.html">Next Letter</a></li> </ul> <ul class="navList"> <li><a href="../index.html?index-files/index-17.html" target="_top">Frames</a></li> <li><a href="index-17.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip.navbar.bottom"> </a></div> </body> </html>
package venio.mods.veniocraft.common.blocks; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import venio.mods.veniocraft.common.creativetabs.VenioTabs; /** * * @author Danis * */ public class BlockCopperOre extends Block{ /** * * @param id * @param mat */ public BlockCopperOre(int id,Material mat){ super(id,mat); setCreativeTab(VenioTabs.veniocraftTabMisc); } public void registerIcons(IconRegister iconreg){ this.blockIcon=iconreg.registerIcon("veniocraft:"+getUnlocalizedName2()+"Texture"); } }
// Get Information about Building Locations from Database using AJAX $(document).ready(function() { // draw items onto the map var query = "action=layoutItems&parentType=Building&parentID=0"; $.post("handler.php",query,function(result) { $.each(result, function(i, val) { if(val.itemType=="Building") { $(".mapContent").append("<div alt='building"+val.itemID+"' id='layoutItemID"+val.layoutItemID+"' class='building building"+val.itemID+"' style='\ width: " + val.width + "px; height: " + val.height + "px;position:absolute; top: " + val.posY + "px; left: " + val.posX + "px' ><span>" + val.itemName + "</span></div>"); } else if(val.itemType=="Cabinet") { $(".mapContent").append("<div alt='cabinet"+val.itemID+"' id='layoutItemID"+val.layoutItemID+"' class='cabinet cabinet"+val.itemID+"' style='\ cursor:pointer;width: " + val.width + "px; height: " + val.height + "px;position:absolute; top: " + val.posY + "px; left: " + val.posX + "px' ><span>Cabinet: " + val.itemName + "</span></div>"); } }); },"json"); $(".building").live('click',function(ev) { leftPos=(ev.pageX+10); topPos=(ev.pageY-50); // if we're about to flow off the page move the object back left if((leftPos+300) > $(document).width()) leftPos=$(document).width()-320; $("#hoverName").css("position","absolute"); $("#hoverName").css("left",leftPos+"px"); $("#hoverName").css("top",topPos+"px"); var buildingID = $(this).attr("alt").replace('building',''); $("#hoverName").hide(); $.post("handler.php", "action=getBuildingMenu&buildingID=" + buildingID, function(buildingMenu) { $("#menus").css("position","absolute"); $("#menus").css("left",$("#hoverName").css("left")); $("#menus").css("top",$("#hoverName").css("top")); $("#menus").html(buildingMenu); $("#menus").slideDown('fast'); $('.floors').sortable({ handle : 'img', update : function () { var sequence = $(this).sortable('toArray'); $.ajax ({ type: "POST", url: "buildings.php?action=savefloors&data="+sequence, async: false, success: function(responce) { if(responce!=1) alert("ERROR: Unable to save new floor order\nPlease report this on the RackSmith forum"); } }) } }); }); }); $(".cabinet").live('click',function(ev) { leftPos=(ev.pageX+10); topPos=(ev.pageY-50); // if we're about to flow off the page move the object back left if((leftPos+300) > $(document).width()) leftPos=$(document).width()-320; $("#hoverName").css("position","absolute"); $("#hoverName").css("left",leftPos+"px"); $("#hoverName").css("top",topPos+"px"); /* Position of current building, used to position hover off the side */ leftPos=(ev.pageX+10); topPos=(ev.pageY-50); var cabinetID = $(this).attr("alt").replace('cabinet',''); $("#hoverName").hide(); $.post("handler.php", "action=getCabinetMenu&cabinetID=" + cabinetID, function(cabinetMenu) { $("#menus").css("position","absolute"); $("#menus").css("left",$("#hoverName").css("left")); $("#menus").css("top",$("#hoverName").css("top")); $("#menus").html(cabinetMenu); $("#menus").slideDown('fast'); }); }); // Close the menu $(".closeContextMenu, .mapContent").live('click',function () { $("#menus").html(""); $("#menus").hide(); }); $(".mapContent .building, .mapContent .cabinet").live('mouseover mouseout',function(ev) { /* If theres no main menu for a building shown we can display our hover name */ if($("#menus").is(':hidden') != "") { if (ev.type == 'mouseover') { $("#hoverName").show(); leftPos=(ev.pageX+10); topPos=(ev.pageY-50); // if we're about to flow off the page move the object back left if((leftPos+300) > $(document).width()) leftPos=$(document).width()-320; $("#hoverName").css("position","absolute"); $("#hoverName").css("left",leftPos+"px"); $("#hoverName").css("top",topPos+"px"); var itemName = '<div class="popupMenu" > ' + '<div class="title"> ' + '<table><thead> ' + '<tr><th align="left" >' + $(this).html() + '</th></tr> ' + '</thead></table> ' + '</div> ' + '</div>'; $("#hoverName").html(itemName); } else { $("#hoverName").html(""); $("#hoverName").hide(); } } }); // floor edit and save are duplicated within buildinglayout.js $(".floorEdit").live('click', function() { id = $(this).attr("href").replace(/[^0-9]/g, ''); currentValue = $("#floor" + id).html(); if($("#floor" + id + " input").length <=0) $("#floor" + id).html("<input type='text' value='" + currentValue + "'/><input class='floorSave' type='submit' value='save' />"); }); $(".floorSave").live('click', function() { id = $(this).closest("tr").find(".floorEdit").attr("href").replace(/[^0-9]/g, ''); newValue = $(this).parent().find("input[type=text]").val(); $.post("handler.php", {action: "editFloor", floorID: id, name: newValue} ); $("#floor" + id).html(newValue); $("#buildingMenuFloor" + id).html(newValue); }); }); function AddFloor(buildingID) { var query = 'action=insertFloor&building=' + buildingID; query += '&name=' + $('.addFloor input#name').val(); query += '&notes=' + $('.addFloor input#notes').val(); // Send new Floor $.post('handler.php',query,function() { var query4 = "action=getBuildingMenu&buildingID=" + buildingID; $.post("handler.php", query4,function(result4) { $("#menus").html(result4); $('.floors').sortable({ handle : 'img', update : function () { var sequence = $(this).sortable('toArray'); $.ajax ({ type: "POST", url: "buildings.php?action=savefloors&data="+sequence, async: false, success: function(responce) { if(responce!=1) alert("ERROR: Unable to save new floor order\nPlease report this on the RackSmith forum"); } }) } }); }); }); }
<?php namespace App\Console\Commands; use Illuminate\Console\Command; class MakeCSV extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'blueprint:csv'; /** * The console command description. * * @var string */ protected $description = 'Command description'; /** * Create a new command instance. * * @return void */ public function __construct() { parent::__construct(); } /** * Execute the console command. * * @return mixed */ public function handle() { } }
<?php require '../../storage/ProjectStorage.php'; require '../../bean/ProjectBean.php'; require '../../jsonConverter/ToJsonConverter.php'; require '../../jsonConverter/FromJsonConverter.php'; require '../../librairies/pimple/pimple.php'; require '../../storage/database/db.php'; class ProjectsDbTest extends <API key> { private $container; protected function setUp() { $container = new Pimple(); /* @var $storage ProjectStorage */ $storage = new ProjectStorage(); $container["storageProject"] = $storage; $container["db"] = dbconnect("../../storage/database/connect_info_test.php"); $GLOBALS["TDTM"]["container"] = $container; } /** * Test create a project * * @test */ public function testCreateProject() { /* @var $storage ProjectStorage */ $storage = $GLOBALS["TDTM"]["container"]["storageProject"]; $project = new ProjectBean(); $project->setDescription("test !!!"); $project->setEndtime("10/10/2013"); $project->setStarttime("10/10/2013"); $project->setName("test"); try { $storage->createProject($project); } catch (Exception $e) { $this->fail('Project not created'); } } }
package ch.ethz.dcg.miniplayer; public interface PlayerEventListener { public void onSongCompleted(); }
// Project ProjectForge Community Edition // This community edition is free software; you can redistribute it and/or // This community edition is distributed in the hope that it will be useful, // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General package org.projectforge.framework.i18n; import java.text.MessageFormat; import java.util.HashSet; import java.util.Locale; import java.util.Objects; import java.util.Optional; import java.util.ResourceBundle; import java.util.Set; import org.projectforge.framework.persistence.user.api.<API key>; /** * ThreadLocal context. * * @author Kai Reinhard (k.reinhard@micromata.de) */ public class I18nHelper { private static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(I18nHelper.class); private static final Set<String> BUNDLE_NAMES = new HashSet<>(); private static I18nService i18nService; public static void addBundleName(String bundleName) { BUNDLE_NAMES.add(bundleName); } public static Set<String> getBundleNames() { return BUNDLE_NAMES; } public static I18nService getI18nService() { return i18nService; } static void setI18nService(final I18nService i18nService) { I18nHelper.i18nService = i18nService; } public static String getLocalizedMessage(final I18nKeyAndParams i18nKeyAndParams) { return getLocalizedMessage(i18nKeyAndParams.getKey(), i18nKeyAndParams.getParams()); } public static String getLocalizedMessage(final String i18nKey, final Object... params) { return getLocalizedMessage(<API key>.getLocale(), i18nKey, params); } public static String getLocalizedMessage(final Locale locale, final String i18nKey, final Object... params) { final String localized = getLocalizedString(locale, i18nKey); return (params == null || params.length == 0) ? localized : MessageFormat.format(localized, params); } private static String getLocalizedString(final Locale locale, final String i18nKey) { try { final Optional<String> translation = BUNDLE_NAMES.stream() .map(bundleName -> getLocalizedString(bundleName, locale, i18nKey)) .filter(Objects::nonNull) .findFirst(); if (translation.isPresent()) { return translation.get(); } } catch (final Exception ex) { // <API key> or <API key> log.warn("Resource key '" + i18nKey + "' not found for locale '" + locale + "'"); } return "???" + i18nKey + "???"; } private static String getLocalizedString(final String bundleName, final Locale locale, final String i18nKey) { try { final ResourceBundle bundle = getResourceBundle(bundleName, locale); if (bundle.containsKey(i18nKey)) { return bundle.getString(i18nKey); } else { return i18nService.getAdditionalString(i18nKey, locale); } } catch (final Exception ex) { log.warn("Resource key '" + i18nKey + "' not found for locale '" + locale + "'"); } return null; } /** * Use-ful for using the locale of another user (e. g. the receiver of an e-mail). * * @param locale If null, then the context user's locale is assumed. */ private static ResourceBundle getResourceBundle(final String bundleName, final Locale locale) { return (locale != null) ? ResourceBundle.getBundle(bundleName, locale) : ResourceBundle.getBundle(bundleName); } }
<?php session_start(); if (isset($_SESSION['authenticated'])){ //It's all good! } else { header('Location: login.php'); }
<!DOCTYPE HTML PUBLIC "- <!--NewPage <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_20) on Thu Jul 15 12:58:56 CEST 2010 --> <TITLE> Uses of Class org.maltparser.parser.TransitionSystem (MaltParser 1.4.1) </TITLE> <META NAME="date" CONTENT="2010-07-15"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.maltparser.parser.TransitionSystem (MaltParser 1.4.1)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <A NAME="navbar_top"></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../org/maltparser/parser/TransitionSystem.html" title="class in org.maltparser.parser"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <b>MaltParser 1.4.1</b></EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?org/maltparser/parser//<API key>.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="TransitionSystem.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <! if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <HR> <CENTER> <H2> <B>Uses of Class<br>org.maltparser.parser.TransitionSystem</B></H2> </CENTER> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Packages that use <A HREF="../../../../org/maltparser/parser/TransitionSystem.html" title="class in org.maltparser.parser">TransitionSystem</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.maltparser.parser"><B>org.maltparser.parser</B></A></TD> <TD>The top package for Single Malt Parser.&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.maltparser.parser.algorithm.covington"><B>org.maltparser.parser.algorithm.covington</B></A></TD> <TD>Implements the Covington deterministic parsing algorithms.&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.maltparser.parser.algorithm.nivre"><B>org.maltparser.parser.algorithm.nivre</B></A></TD> <TD>Implements the Nivre deterministic parsing algorithms.&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.maltparser.parser.algorithm.planar"><B>org.maltparser.parser.algorithm.planar</B></A></TD> <TD>&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.maltparser.parser.algorithm.stack"><B>org.maltparser.parser.algorithm.stack</B></A></TD> <TD>Implements the Stack parsing algorithms.&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.maltparser.parser.algorithm.twoplanar"><B>org.maltparser.parser.algorithm.twoplanar</B></A></TD> <TD>&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.maltparser.parser"></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../org/maltparser/parser/TransitionSystem.html" title="class in org.maltparser.parser">TransitionSystem</A> in <A HREF="../../../../org/maltparser/parser/package-summary.html">org.maltparser.parser</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="<API key>"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../org/maltparser/parser/package-summary.html">org.maltparser.parser</A> that return <A HREF="../../../../org/maltparser/parser/TransitionSystem.html" title="class in org.maltparser.parser">TransitionSystem</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../org/maltparser/parser/TransitionSystem.html" title="class in org.maltparser.parser">TransitionSystem</A></CODE></FONT></TD> <TD><CODE><B>ParserState.</B><B><A HREF="../../../../org/maltparser/parser/ParserState.html#getTransitionSystem()">getTransitionSystem</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../org/maltparser/parser/TransitionSystem.html" title="class in org.maltparser.parser">TransitionSystem</A></CODE></FONT></TD> <TD><CODE><B><API key>.</B><B><A HREF="../../../../org/maltparser/parser/<API key>.html#<API key>()"><API key></A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a transition system</TD> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="<API key>"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../org/maltparser/parser/package-summary.html">org.maltparser.parser</A> with parameters of type <A HREF="../../../../org/maltparser/parser/TransitionSystem.html" title="class in org.maltparser.parser">TransitionSystem</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected &nbsp;void</CODE></FONT></TD> <TD><CODE><B>ParserState.</B><B><A HREF="../../../../org/maltparser/parser/ParserState.html#setTransitionSystem(org.maltparser.parser.TransitionSystem)">setTransitionSystem</A></B>(<A HREF="../../../../org/maltparser/parser/TransitionSystem.html" title="class in org.maltparser.parser">TransitionSystem</A>&nbsp;transitionSystem)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.maltparser.parser.algorithm.covington"></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../org/maltparser/parser/TransitionSystem.html" title="class in org.maltparser.parser">TransitionSystem</A> in <A HREF="../../../../org/maltparser/parser/algorithm/covington/package-summary.html">org.maltparser.parser.algorithm.covington</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="<API key>"> <TH ALIGN="left" COLSPAN="2">Subclasses of <A HREF="../../../../org/maltparser/parser/TransitionSystem.html" title="class in org.maltparser.parser">TransitionSystem</A> in <A HREF="../../../../org/maltparser/parser/algorithm/covington/package-summary.html">org.maltparser.parser.algorithm.covington</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;class</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/maltparser/parser/algorithm/covington/NonProjective.html" title="class in org.maltparser.parser.algorithm.covington">NonProjective</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;class</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/maltparser/parser/algorithm/covington/Projective.html" title="class in org.maltparser.parser.algorithm.covington">Projective</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="<API key>"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../org/maltparser/parser/algorithm/covington/package-summary.html">org.maltparser.parser.algorithm.covington</A> that return <A HREF="../../../../org/maltparser/parser/TransitionSystem.html" title="class in org.maltparser.parser">TransitionSystem</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../org/maltparser/parser/TransitionSystem.html" title="class in org.maltparser.parser">TransitionSystem</A></CODE></FONT></TD> <TD><CODE><B><API key>.</B><B><A HREF="../../../../org/maltparser/parser/algorithm/covington/<API key>.html#<API key>()"><API key></A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../org/maltparser/parser/TransitionSystem.html" title="class in org.maltparser.parser">TransitionSystem</A></CODE></FONT></TD> <TD><CODE><B><API key>.</B><B><A HREF="../../../../org/maltparser/parser/algorithm/covington/<API key>.html#<API key>()"><API key></A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.maltparser.parser.algorithm.nivre"></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../org/maltparser/parser/TransitionSystem.html" title="class in org.maltparser.parser">TransitionSystem</A> in <A HREF="../../../../org/maltparser/parser/algorithm/nivre/package-summary.html">org.maltparser.parser.algorithm.nivre</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="<API key>"> <TH ALIGN="left" COLSPAN="2">Subclasses of <A HREF="../../../../org/maltparser/parser/TransitionSystem.html" title="class in org.maltparser.parser">TransitionSystem</A> in <A HREF="../../../../org/maltparser/parser/algorithm/nivre/package-summary.html">org.maltparser.parser.algorithm.nivre</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;class</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/maltparser/parser/algorithm/nivre/ArcEager.html" title="class in org.maltparser.parser.algorithm.nivre">ArcEager</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;class</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/maltparser/parser/algorithm/nivre/ArcStandard.html" title="class in org.maltparser.parser.algorithm.nivre">ArcStandard</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="<API key>"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../org/maltparser/parser/algorithm/nivre/package-summary.html">org.maltparser.parser.algorithm.nivre</A> that return <A HREF="../../../../org/maltparser/parser/TransitionSystem.html" title="class in org.maltparser.parser">TransitionSystem</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../org/maltparser/parser/TransitionSystem.html" title="class in org.maltparser.parser">TransitionSystem</A></CODE></FONT></TD> <TD><CODE><B><API key>.</B><B><A HREF="../../../../org/maltparser/parser/algorithm/nivre/<API key>.html#<API key>()"><API key></A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../org/maltparser/parser/TransitionSystem.html" title="class in org.maltparser.parser">TransitionSystem</A></CODE></FONT></TD> <TD><CODE><B><API key>.</B><B><A HREF="../../../../org/maltparser/parser/algorithm/nivre/<API key>.html#<API key>()"><API key></A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.maltparser.parser.algorithm.planar"></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../org/maltparser/parser/TransitionSystem.html" title="class in org.maltparser.parser">TransitionSystem</A> in <A HREF="../../../../org/maltparser/parser/algorithm/planar/package-summary.html">org.maltparser.parser.algorithm.planar</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="<API key>"> <TH ALIGN="left" COLSPAN="2">Subclasses of <A HREF="../../../../org/maltparser/parser/TransitionSystem.html" title="class in org.maltparser.parser">TransitionSystem</A> in <A HREF="../../../../org/maltparser/parser/algorithm/planar/package-summary.html">org.maltparser.parser.algorithm.planar</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;class</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/maltparser/parser/algorithm/planar/Planar.html" title="class in org.maltparser.parser.algorithm.planar">Planar</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="<API key>"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../org/maltparser/parser/algorithm/planar/package-summary.html">org.maltparser.parser.algorithm.planar</A> that return <A HREF="../../../../org/maltparser/parser/TransitionSystem.html" title="class in org.maltparser.parser">TransitionSystem</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../org/maltparser/parser/TransitionSystem.html" title="class in org.maltparser.parser">TransitionSystem</A></CODE></FONT></TD> <TD><CODE><B><API key>.</B><B><A HREF="../../../../org/maltparser/parser/algorithm/planar/<API key>.html#<API key>()"><API key></A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.maltparser.parser.algorithm.stack"></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../org/maltparser/parser/TransitionSystem.html" title="class in org.maltparser.parser">TransitionSystem</A> in <A HREF="../../../../org/maltparser/parser/algorithm/stack/package-summary.html">org.maltparser.parser.algorithm.stack</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="<API key>"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../org/maltparser/parser/algorithm/stack/package-summary.html">org.maltparser.parser.algorithm.stack</A> that return <A HREF="../../../../org/maltparser/parser/TransitionSystem.html" title="class in org.maltparser.parser">TransitionSystem</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../org/maltparser/parser/TransitionSystem.html" title="class in org.maltparser.parser">TransitionSystem</A></CODE></FONT></TD> <TD><CODE><B><API key>.</B><B><A HREF="../../../../org/maltparser/parser/algorithm/stack/<API key>.html#<API key>()"><API key></A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../org/maltparser/parser/TransitionSystem.html" title="class in org.maltparser.parser">TransitionSystem</A></CODE></FONT></TD> <TD><CODE><B>StackProjFactory.</B><B><A HREF="../../../../org/maltparser/parser/algorithm/stack/StackProjFactory.html#<API key>()"><API key></A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../org/maltparser/parser/TransitionSystem.html" title="class in org.maltparser.parser">TransitionSystem</A></CODE></FONT></TD> <TD><CODE><B><API key>.</B><B><A HREF="../../../../org/maltparser/parser/algorithm/stack/<API key>.html#<API key>()"><API key></A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.maltparser.parser.algorithm.twoplanar"></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../org/maltparser/parser/TransitionSystem.html" title="class in org.maltparser.parser">TransitionSystem</A> in <A HREF="../../../../org/maltparser/parser/algorithm/twoplanar/package-summary.html">org.maltparser.parser.algorithm.twoplanar</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="<API key>"> <TH ALIGN="left" COLSPAN="2">Subclasses of <A HREF="../../../../org/maltparser/parser/TransitionSystem.html" title="class in org.maltparser.parser">TransitionSystem</A> in <A HREF="../../../../org/maltparser/parser/algorithm/twoplanar/package-summary.html">org.maltparser.parser.algorithm.twoplanar</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;class</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/maltparser/parser/algorithm/twoplanar/TwoPlanar.html" title="class in org.maltparser.parser.algorithm.twoplanar">TwoPlanar</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="<API key>"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../org/maltparser/parser/algorithm/twoplanar/package-summary.html">org.maltparser.parser.algorithm.twoplanar</A> that return <A HREF="../../../../org/maltparser/parser/TransitionSystem.html" title="class in org.maltparser.parser">TransitionSystem</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../org/maltparser/parser/TransitionSystem.html" title="class in org.maltparser.parser">TransitionSystem</A></CODE></FONT></TD> <TD><CODE><B><API key>.</B><B><A HREF="../../../../org/maltparser/parser/algorithm/twoplanar/<API key>.html#<API key>()"><API key></A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <HR> <A NAME="navbar_bottom"></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="<API key>"></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../org/maltparser/parser/TransitionSystem.html" title="class in org.maltparser.parser"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <b>MaltParser 1.4.1</b></EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?org/maltparser/parser//<API key>.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="TransitionSystem.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <! if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <HR> Copyright 2007-2010 Johan Hall, Jens Nilsson and Joakim Nivre. </BODY> </HTML>
pub enum ColorName { Black, Blue, Red, Purple, Green, Cyan, Yellow, White, } pub fn number_to_color(num: u8) -> ColorName { match num { 0 => ColorName::Black, 1 => ColorName::Blue, 2 => ColorName::Red, 3 => ColorName::Purple, 4 => ColorName::Green, 5 => ColorName::Cyan, 6 => ColorName::Yellow, _ => ColorName::White, } } pub struct Color { blue: bool, red: bool, green: bool, pub value: u8, } fn trf(val: bool) -> u16 { if val { 4095 } else { 0 } } impl Color { pub fn new(name: ColorName) -> Color { let value = name as u8; Color { blue: (value & 1) > 0, red: (value & 2) > 0, green: (value & 4) > 0, value: value, } } pub fn to_array(&self) -> [u16; 3] { [trf(self.blue), trf(self.red), trf(self.green)] } }
#include <libstm8/l/tim.h> void timer_set_mode(uint16_t timer_peripheral, uint8_t alignment, uint8_t direction) { uint8_t cr1 = TIM_CR1(timer_peripheral); cr1 &= ~(TIM_CR1_DIR | (TIM_CR1_CMS_MASK << TIM_CR1_CMS_SHIFT)); cr1 |= ((uint8_t) direction) | ((uint8_t) alignment); TIM_CR1(timer_peripheral) = cr1; } void timer_set_prescaler (uint16_t timer_peripheral, uint16_t value) { switch (timer_peripheral) { case TIM1_BASE: TIM1_PSCRH = (uint8_t) (value >> 8); TIM1_PSCRL = (uint8_t) (value & 0xFF); break; case TIM4_BASE: TIM4_PSCR = (uint8_t) (value & 0xFF); break; default: TIM_PSCR(timer_peripheral) = (uint8_t) (value & 0xFF); break; } } void timer_set_period (uint16_t timer_peripheral, uint16_t period) { switch (timer_peripheral) { case TIM1_BASE: TIM1_ARRH = (uint8_t) (period >> 8); TIM1_ARRL = (uint8_t) (period & 0xFF); break; case TIM4_BASE: TIM4_ARR = (uint8_t) (period & 0xFF); break; default: TIM_ARRH(timer_peripheral) = (uint8_t) (period >> 8); TIM_ARRL(timer_peripheral) = (uint8_t) (period & 0xFF); break; } } void <API key> (uint16_t timer_peripheral, uint8_t value) { if (timer_peripheral == TIM1_BASE) { TIM1_RCR = value; } } void <API key> (uint16_t timer_peripheral) { TIM_CR1(timer_peripheral) |= TIM_CR1_ARPE; } void <API key> (uint16_t timer_peripheral) { TIM_CR1(timer_peripheral) &= ~TIM_CR1_ARPE; } void timer_set_oc_mode (uint16_t timer_peripheral, enum tim_oc_id oc_id, enum tim_oc_mode oc_mode) { if (timer_peripheral == TIM4_BASE) { return; } else if (timer_peripheral == TIM1_BASE) { switch (oc_id) { case TIM_OC1: case TIM_OC1N: TIM1_CCMR1 &= ~(TIM_CCMR1_OC1M_MASK << <API key>); TIM1_CCMR1 |= (uint8_t) oc_mode; break; case TIM_OC2: case TIM_OC2N: TIM1_CCMR2 &= ~(TIM_CCMR2_OC2M_MASK << <API key>); TIM1_CCMR2 |= (uint8_t) oc_mode; break; case TIM_OC3: case TIM_OC3N: TIM1_CCMR3 &= ~(TIM_CCMR3_OC3M_MASK << <API key>); TIM1_CCMR3 |= (uint8_t) oc_mode; break; case TIM_OC4: TIM1_CCMR4 &= ~(TIM_CCMR4_OC4M_MASK << <API key>); TIM1_CCMR4 |= (uint8_t) oc_mode; break; } } else /* TIM2,3,5 */ { switch (oc_id) { case TIM_OC1: case TIM_OC1N: TIM_CCMR1(timer_peripheral) &= ~(TIM_CCMR1_OC1M_MASK << <API key>); TIM_CCMR1(timer_peripheral) |= (uint8_t) oc_mode; break; case TIM_OC2: case TIM_OC2N: TIM_CCMR2(timer_peripheral) &= ~(TIM_CCMR2_OC2M_MASK << <API key>); TIM_CCMR2(timer_peripheral) |= (uint8_t) oc_mode; break; } } } void <API key> (uint32_t timer_peripheral, enum tim_oc_id oc_id) { if (timer_peripheral == TIM4_BASE) { return; } else if (timer_peripheral == TIM1_BASE) { switch (oc_id) { case TIM_OC1: case TIM_OC1N: TIM1_CCMR1 |= TIM_CCMR1_OC1PE; break; case TIM_OC2: case TIM_OC2N: TIM1_CCMR2 |= TIM_CCMR2_OC2PE; break; case TIM_OC3: case TIM_OC3N: TIM1_CCMR3 |= TIM_CCMR3_OC3PE; break; case TIM_OC4: TIM1_CCMR4 |= TIM_CCMR4_OC4PE; break; } } else /* TIM2,3,5 */ { switch (oc_id) { case TIM_OC1: case TIM_OC1N: TIM_CCMR1(timer_peripheral) |= TIM_CCMR1_OC1PE; break; case TIM_OC2: case TIM_OC2N: TIM_CCMR2(timer_peripheral) |= TIM_CCMR2_OC2PE; break; } } } void <API key> (uint32_t timer_peripheral, enum tim_oc_id oc_id) { if (timer_peripheral == TIM4_BASE) { return; } else if (timer_peripheral == TIM1_BASE) { switch (oc_id) { case TIM_OC1: case TIM_OC1N: TIM1_CCMR1 &= ~TIM_CCMR1_OC1PE; break; case TIM_OC2: case TIM_OC2N: TIM1_CCMR2 &= ~TIM_CCMR2_OC2PE; break; case TIM_OC3: case TIM_OC3N: TIM1_CCMR3 &= ~TIM_CCMR3_OC3PE; break; case TIM_OC4: TIM1_CCMR4 &= ~TIM_CCMR4_OC4PE; break; } } else /* TIM2,3,5 */ { switch (oc_id) { case TIM_OC1: case TIM_OC1N: TIM_CCMR1(timer_peripheral) &= ~TIM_CCMR1_OC1PE; break; case TIM_OC2: case TIM_OC2N: TIM_CCMR2(timer_peripheral) &= ~TIM_CCMR2_OC2PE; break; } } } void timer_set_oc_value (uint16_t timer_peripheral, enum tim_oc_id oc_id, uint16_t value) { if (timer_peripheral == TIM4_BASE) { return; } else if (timer_peripheral == TIM1_BASE) { switch (oc_id) { case TIM_OC1: case TIM_OC1N: TIM1_CCR1H = (uint8_t) (value >> 8); TIM1_CCR1L = (uint8_t) (value & 0xFF); break; case TIM_OC2: case TIM_OC2N: TIM1_CCR2H = (uint8_t) (value >> 8); TIM1_CCR2L = (uint8_t) (value & 0xFF); break; case TIM_OC3: case TIM_OC3N: TIM1_CCR3H = (uint8_t) (value >> 8); TIM1_CCR3L = (uint8_t) (value & 0xFF); break; case TIM_OC4: TIM1_CCR4H = (uint8_t) (value >> 8); TIM1_CCR4L = (uint8_t) (value & 0xFF); break; } } else /* TIM2,3,5 */ { switch (oc_id) { case TIM_OC1: case TIM_OC1N: TIM_CCR1H(timer_peripheral) = (uint8_t) (value >> 8); TIM_CCR1L(timer_peripheral) = (uint8_t) (value & 0xFF); break; case TIM_OC2: case TIM_OC2N: TIM_CCR2H(timer_peripheral) = (uint8_t) (value >> 8); TIM_CCR2L(timer_peripheral) = (uint8_t) (value & 0xFF); break; } } } /* TODO: Probably I must fix `enum tim_oc_id' to save offset in CCER1:CCER2 16 bits register. */ void <API key> (uint16_t timer_peripheral, enum tim_oc_id oc_id) { if (timer_peripheral == TIM4_BASE) { return; } else if (timer_peripheral == TIM1_BASE) { switch (oc_id) { case TIM_OC1: TIM1_CCER1 |= TIM_CCER1_CC1E; break; case TIM_OC1N: TIM1_CCER1 |= TIM_CCER1_CC1NE; break; case TIM_OC2: TIM1_CCER1 |= TIM_CCER1_CC2E; break; case TIM_OC2N: TIM1_CCER1 |= TIM_CCER1_CC2NE; break; case TIM_OC3: TIM1_CCER2 |= TIM_CCER2_CC3E; break; case TIM_OC3N: TIM1_CCER2 |= TIM_CCER2_CC3NE; break; case TIM_OC4: TIM1_CCER2 |= TIM_CCER2_CC4E; break; } } else /* TIM2,3,5 */ { switch (oc_id) { case TIM_OC1: TIM_CCER1(timer_peripheral) |= TIM_CCER1_CC1E; break; case TIM_OC1N: TIM_CCER1(timer_peripheral) |= TIM_CCER1_CC1NE; break; case TIM_OC2: TIM_CCER1(timer_peripheral) |= TIM_CCER1_CC2E; break; case TIM_OC2N: TIM_CCER1(timer_peripheral) |= TIM_CCER1_CC2NE; break; } } } void <API key> (uint16_t timer_peripheral, enum tim_oc_id oc_id) { if (timer_peripheral == TIM4_BASE) { return; } else if (timer_peripheral == TIM1_BASE) { switch (oc_id) { case TIM_OC1: TIM1_CCER1 &= ~TIM_CCER1_CC1E; break; case TIM_OC1N: TIM1_CCER1 &= ~TIM_CCER1_CC1NE; break; case TIM_OC2: TIM1_CCER1 &= ~TIM_CCER1_CC2E; break; case TIM_OC2N: TIM1_CCER1 &= ~TIM_CCER1_CC2NE; break; case TIM_OC3: TIM1_CCER2 &= ~TIM_CCER2_CC3E; break; case TIM_OC3N: TIM1_CCER2 &= ~TIM_CCER2_CC3NE; break; case TIM_OC4: TIM1_CCER2 &= ~TIM_CCER2_CC4E; break; } } else /* TIM2,3,5 */ { switch (oc_id) { case TIM_OC1: TIM_CCER1(timer_peripheral) &= ~TIM_CCER1_CC1E; break; case TIM_OC1N: TIM_CCER1(timer_peripheral) &= ~TIM_CCER1_CC1NE; break; case TIM_OC2: TIM_CCER1(timer_peripheral) &= ~TIM_CCER1_CC2E; break; case TIM_OC2N: TIM_CCER1(timer_peripheral) &= ~TIM_CCER1_CC2NE; break; } } } void <API key> (uint16_t timer_peripheral) { if (timer_peripheral == TIM4_BASE) { return; } else if (timer_peripheral == TIM1_BASE) { TIM1_BKR |= TIM_BKR_MOE; } else /* TIM2,3,5 */ { TIM_BKR(timer_peripheral) |= TIM_BKR_MOE; } } void <API key> (uint16_t timer_peripheral) { if (timer_peripheral == TIM4_BASE) { return; } else if (timer_peripheral == TIM1_BASE) { TIM1_BKR &= ~TIM_BKR_MOE; } else /* TIM2,3,5 */ { TIM_BKR(timer_peripheral) &= ~TIM_BKR_MOE; } } void <API key> (uint16_t timer_peripheral) { TIM_CR1(timer_peripheral) |= TIM_CR1_CEN; } void <API key> (uint16_t timer_peripheral) { TIM_CR1(timer_peripheral) &= ~TIM_CR1_CEN; }
/** * @file fb_hal_lpc.c * @author Andreas Krebs <kubi@krebsworld.de> * @date 2008 * * @brief Hier sind ausschliesslich die <API key> aber <API key> Routinen fuer den 89LPC922 * * */ #include <P89LPC922.h> #include "fb_hal_lpc.h" unsigned char telegramm[23]; unsigned char telpos; // Zeiger auf naechste Position im Array Telegramm unsigned char cs; // checksum __code unsigned char __at 0x1C00 userram[255]; /// Bereich im Flash fuer User-RAM __code unsigned char __at 0x1D00 eeprom[255]; /// Bereich im Flash fuer EEPROM bit parity_ok; /// Parity Bit des letzten empfangenen Bytes OK bit interrupted; /// Wird durch interrupt-routine gesetzt. So kann eine andere Routine pruefen, ob sie unterbrochen wurde /** * RTC starten, base in ms * * */ void start_rtc(unsigned char base) { unsigned long rtcval=0; unsigned char n; for (n=0;n<base;n++) rtcval+=7373; //rtcval=7373*base; rtcval=rtcval>>7; // 7 bit prescaler ( /128 ) RTCH=(rtcval>>8); RTCL=rtcval; RTCCON=0x61; // ... und starten } /** * RTC stoppen * * */ void stop_rtc(void) { RTCCON=0x60; } /** * * * * @return */ unsigned char get_byte(void) { bit rbit,parity,ph; unsigned char n,m,fbb; EX1=0; // Interrupt 1 sperren ET1=0; // Interrupt von Timer 1 sperren set_timer1(380); // Timer setzen um 1. Bit zu treffen (320-440) #ifdef HAND REFRESH //refresh #endif ph=0; // Paritybit wird aus empfangenem Byte berechnet parity_ok=0; while(!TF1); // warten auf Timer 1 set_timer1(360); // Timer 1 neu setzen fuer 2.Bit (300-420) rbit=FBINC; // 1.Bit einlesen for(m=0;m<5;m++) rbit&=FBINC; // zur Steigerung der Fehlertoleranz mehrfach lesen fbb=rbit; if(rbit) ph=!ph; // Paritybit berechnen //for(n=1;n<8;n++) { // 2. bis 8. Bit for (n=2;n!=0;n=n<<1) { while(!TF1); set_timer1(350); // Timer 1 setzen fuer Position 2.-9.Bit (342-359) rbit=FBINC; for(m=0;m<5;m++) rbit&=FBINC; // zur Steigerung der Fehlertoleranz mehrfach lesen //fbb|=rbit<<n; if (rbit) fbb+=n; if(rbit) ph=!ph; // Paritybit berechnen } while(!TF1); TR1=0; parity=FBINC; // Paritybit lesen for(m=0;m<5;m++) parity&=FBINC; // zur Steigerung der Fehlertoleranz mehrfach lesen if(parity==ph) parity_ok=1; return (fbb); } /** * Byte vom Bus empfangen, wird durch negative Flanke am INT1 Eingang getriggert * * liest ein Byte und prueft das Parity-bit * wenn OK wird das Byte in das Array Telegramm an die Position telpos abgelegt * anschliessend wird der time-out Zaehler gestartet, wenn waehrend 370us nichts empfangen wird * dann ist das Telegramm komplett uebertragen worden * * */ void ext_int0(void) interrupt 2 { unsigned char fbbh; TR1=0; EX1=0; // Interrupt 1 sperren ET1=0; // Interrupt von Timer 1 sperren fbbh=get_byte(); // Byte vom Bus empfangen sysdelay(200); set_timer1(1350); // Timer 1 starten fuer Timeout 370us -> signalisiert Telegrammende (1350) if(parity_ok) // wenn Parity OK { if (telpos!=0 || (fbbh&0xF0)!=0xC0) telegramm[telpos]=fbbh; // keine ACK oder NACK als telegramm speichern if(telpos==0) cs=0; cs^=fbbh; // Checksum durch EXOR der einzelnen Telegramm-Bytes bilden telpos++; ET1=1; } else { // bei fehlerhaften Bytes alles verwerfen telpos=0; ET1=0; TR1=0; TF1=0; cs=0; } //ET1=1; // Interrupt fuer Timer 1 freigeben IE1=0; // Interrupt 0 request zuruecksetzen EX1=1; // Interrupt 0 wieder freigeben interrupted=1; // teilt anderen Routinen mit, dass sie unterbrochen wurden } /** * * \param fbsb * * @return */ bit sendbyte(unsigned char fbsb) { unsigned char n,m; bit sendbit,parity,error; parity=1; error=0; FBOUTC=1; // Startbit senden sysdelay(95); // 35us FBOUTC=0; for(n=0;n<8;n++) // 8 Datenbits senden { set_timer1(215); // 69us Pause if(((fbsb>>n)&0x01)==1) sendbit=0; else sendbit=1; while(!TF1); // Warten bis 69us Pause fretig ist FBOUTC=sendbit; // Bit senden set_timer1(100); //35us Haltezeit fuer Bit if(!sendbit) { // wenn logische 1 gesendet wird, auf Kollision pruefen parity=!parity; for(m=0;m<5;m++) if(!FBINC) error=1; } if(error) break; while(!TF1); // Warten bis 35us abgelaufen FBOUTC=0; } if(!error) { sysdelay(212); // 69 us Pause vor Parity-Bit FBOUTC=parity; sysdelay(95); // 35us fuer Parity-Bit FBOUTC=0; } TR1=0; return (error); } void sysdelay(unsigned int deltime) { TR1=0; // Timer 1 anhalten deltime=0xFFFF-deltime; TH1=deltime>>8; // Timer 1 setzen TL1=deltime; TF1=0; TR1=1; while(!TF1); // warten auf Timer 1 TR1=0; } /** * Timer 0 stoppen, setzen und starten (Timer wird mit CCLK/2 betrieben) * * * \param deltime */ void set_timer0(unsigned int deltime) { TR0=0; // Timer 0 anhalten deltime=0xFFFF-deltime; TH0=deltime>>8; // Timer 0 setzen TL0=deltime; TF0=0; TR0=1; // Timer 0 starten } /** * Timer 1 stoppen, setzen und starten (Timer wird mit CCLK/2 betrieben) * * * \param deltime */ void set_timer1(unsigned int deltime) { TR1=0; // Timer 1 anhalten deltime=0xFFFF-deltime; TH1=deltime>>8; // Timer 1 setzen TL1=deltime; TF1=0; // Ueberlauf-Flag zuruecksetzen TR1=1; // Timer 1 starten } /* void calibrate(void) { unsigned int t; unsigned char n; for (n=0;n<50;n++) { TR0=0; TH0=0; TL0=0; TASTER=0; while(P1_4); TR0=1; while(!P1_4); while(P1_4); TR0=0; t=TH0*256+TL0; if (t<500) { if (t>385) TRIM+=1; if (t<383) TRIM-=1; } t=0; while(!P1_4); START_WRITECYCLE WRITE_BYTE(0x00,0x30,TRIM) STOP_WRITECYCLE } } */ /** * Alle Hardware Einstellungen zuruecksetzen * * * */ void restart_hw(void) { DIVM=0; // Taktferquenz nicht teilen -> volles Tempo P1M1=0x14; // Port 1 auf quasi-bidirektional, // ausser P1.2(T0 als PWM Ausgang)=open-drain, // P1.3 open drain (muss sein), // P1.4(INT1)=Input only, P1.6(FBOUTC) push-pull P1M2=0x4C; FBOUTC=0; // Bus-Ausgang auf low TMOD=0x11; // Timer 0 und Timer 1 als 16-Bit Timer TAMOD=0x00; TR0=0; // Timer 0 (zur Verwendung in app) zunaechst stoppen TR1=0; // Timer 1 (Empfangs-Timeout, nicht in app verwenden!) zunaechst stoppen RTCH=0x0E; // Real Time Clock auf 65ms laden RTCL=0xA0; // (RTC ist ein down-counter mit 128 bit prescaler und osc-clock) RTCCON=0x61; // ... und starten interrupted=0; // wird durch die interrupt-routine auf 1 gesetzt IEN0=0x00; IEN1=0x00; ET1=0; // Interrupt von Timer 1 sperren EX0=0; // Externen Interrupt 0 sperren EX1=1; // Externen Interrupt 1 freigeben EA=1; // Interrupts prinzipiell freigeben IP0=0x0C; IP0H=0x0C; IP1=0x00; IP1H=0x00; IT1=1; // Interrupt 1 flankengetriggert=1 pegelgetriggert=0 }
{% extends "base.html" %} {% block content %} <div class="content-title"> {% block content_title %} {% endblock %} <p>{{ TAGLINE }}</p> </div> <div class="posts"> {% for article in articles_page.object_list %} {% if not article.unlisted or article.category == category %} <div class="post"> <h1 class="post-title" style="display: inline"> <a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" title="Permalink to {{ article.title|striptags }}">{{ article.title }}</a> </h1> <span class="post-date" style="display: inline">{{ article.locale_date }}</span> <span class="headline" style="display: block">{{ article.headline }}</span> </div> {% endif %} {% endfor %} </div> {% include 'pagination.html' %} {% endblock content %}
// <auto-generated> // This code was generated by a tool. // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> namespace Abide.Tag.Guerilla.Generated { using System; using Abide.HaloLibrary; using Abide.Tag; <summary> Represents the generated <API key> tag block. </summary> public sealed class <API key> : Block { <summary> Initializes a new instance of the <see cref="<API key>"/> class. </summary> public <API key>() { this.Fields.Add(new ShortIntegerField("Cluster*")); this.Fields.Add(new ShortIntegerField("Surface Reference Count*")); this.Fields.Add(new LongIntegerField("First Surface Reference Index*")); } <summary> Gets and returns the name of the <API key> tag block. </summary> public override string BlockName { get { return "<API key>"; } } <summary> Gets and returns the display name of the <API key> tag block. </summary> public override string DisplayName { get { return "<API key>"; } } <summary> Gets and returns the maximum number of elements allowed of the <API key> tag block. </summary> public override int MaximumElementCount { get { return 65536; } } <summary> Gets and returns the alignment of the <API key> tag block. </summary> public override int Alignment { get { return 4; } } } }
.tab-content{ margin-top: 20px; } .shiny-progress .progress { top: 0px; height:3px; } .shiny-progress .progress-text { position: absolute; right: 10px; height: 24px; width: 480px; background-color: #eef8ff; margin: 0px; padding: 2px 3px; opacity: 0.85; }
// Get the common arduino functions #include "Arduino.h" #include "Spi.h" SPI::SPI() { // initialize the SPI pins pinMode(SCK_PIN, OUTPUT); pinMode(MOSI_PIN, OUTPUT); pinMode(MISO_PIN, INPUT); pinMode(SS_PIN, OUTPUT); // enable SPI Master, MSB, SPI mode 0, FOSC/4 mode(0); } void SPI::mode(byte config) { byte tmp; // enable SPI master with configuration byte specified SPCR = 0; SPCR = (config & 0x7F) | (1<<SPE) | (1<<MSTR); tmp = SPSR; tmp = SPDR; } byte SPI::transfer(byte value) { SPDR = value; while (!(SPSR & (1<<SPIF))) ; return SPDR; } byte SPI::transfer(byte value, byte period) { SPDR = value; if (period > 0) delayMicroseconds(period); while (!(SPSR & (1<<SPIF))) ; return SPDR; } SPI Spi = SPI();
#ifndef ERT_RANKING_TABLE_H #define ERT_RANKING_TABLE_H #ifdef __cplusplus extern "C" { #endif #include <stdbool.h> #include <ert/util/perm_vector.h> #include <ert/enkf/<API key>.hpp> typedef struct <API key> ranking_table_type; void <API key>( ranking_table_type * table, int ens_size); ranking_table_type * ranking_table_alloc(int ens_size) ; void ranking_table_free( ranking_table_type * table ); void <API key>( ranking_table_type * ranking_table , bool sort_increasing , const char * ranking_key , const char * user_key , const char * key_index , enkf_fs_type * fs , const <API key> * config_node , int step); bool <API key>( const ranking_table_type * ranking_table , const char * ranking_key ); bool <API key>( const ranking_table_type * ranking_table , const char * ranking_key ); bool <API key>( const ranking_table_type * ranking_table , const char * ranking_key, const char * filename ); void <API key>( ranking_table_type * ranking_table , const <API key> * misfit_ensemble , const stringlist_type * obs_keys , const int_vector_type * steps, const char * ranking_key); int <API key>( const ranking_table_type * ranking_table ); const perm_vector_type * <API key>( const ranking_table_type * ranking_table , const char * ranking_key); #ifdef __cplusplus } #endif #endif
sudo apt-get update sudo apt-get -y install build-essential xorg-dev \ python-dev python-virtualenv python-numpy \ python-pygame libglu1-mesa-dev cmake uuid-dev \ liblapack-dev mercurial libboost-all-dev \ libatlas-base-dev subversion gfortran libxml2-dev\ liblog4cpp5-dev python-numpy python-scipy easy_install msrflux virtualenv
// <auto-generated> // This code was generated by a tool. // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> namespace ABC.Debug.Properties { [global::System.Runtime.CompilerServices.<API key>()] [global::System.CodeDom.Compiler.<API key>( "Microsoft.VisualStudio.Editors.SettingsDesigner.<API key>", "11.0.0.0" )] internal sealed partial class Settings : global::System.Configuration.<API key> { private static Settings defaultInstance = ((Settings)(global::System.Configuration.<API key>.Synchronized( new Settings() ))); public static Settings Default { get { return defaultInstance; } } } }
package ru.lightstar.clinic.servlet; import ru.lightstar.clinic.ClinicService; import ru.lightstar.clinic.exception.ServiceException; import ru.lightstar.clinic.model.Client; import ru.lightstar.clinic.persistence.RoleService; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; /** * Servlet used to show clients (probably filtered somehow). * * @author LightStar * @since 0.0.1 */ public class ShowClients extends ClinicServlet { /** * {@inheritDoc} */ public ShowClients() { super(); } /** * {@inheritDoc} */ ShowClients(final ClinicService clinicService, final RoleService roleService) { super(clinicService, roleService); } /** * {@inheritDoc} */ @Override protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException { super.doGet(request, response); final String filterType = request.getParameter("filterType"); final String filterName = request.getParameter("filterName"); Client[] clients; if (filterType != null && filterType.equals("client") && filterName != null && !filterName.isEmpty()) { try { clients = new Client[]{this.clinicService.findClientByName(filterName)}; } catch(ServiceException e) { clients = new Client[]{}; } } else if (filterType != null && filterType.equals("pet") && filterName != null && !filterName.isEmpty()) { clients = this.clinicService.<API key>(filterName); } else { clients = this.clinicService.getAllClients(); } request.setAttribute("clients", clients); request.<API key>("/WEB-INF/view/ShowClients.jsp").forward(request, response); } }
/* % # CBRAIN Project # */ /* % # Main Stylesheet # */ /* Main BODY of the HTML document */ body { background: white; color: #484848; font-family: Verdana, sans-serif; font-size: 12px; margin: 0; min-width: 90em; padding: 0; max-height: 100%; line-height: 18px; } /* % Heading formats */ h1, h2, h3, h4 { font-family: "Trebuchet MS", Verdana, sans-serif; } h1 { margin-top: 5px; margin-bottom: 5px; margin-left: 2px; margin-right: 2px; padding: 1em; text-align: center; font-size: 24px; } h2 { font-size: 20px; padding-top: 10px; padding-bottom: 10px; padding-left: 15px; margin-bottom: 15px; margin-top: 10px; margin-right: 0em; margin-left: 0em; border-bottom: 2px solid #bbbbbb; color: #444; } h3 { font-size: 16px; padding-top: 10px; padding-bottom: 10px; padding-left: 15px; margin-bottom: 15px; margin-top: 10px; margin-right: 0em; margin-left: 0em; border-bottom: 2px solid #bbbbbb; color: #444; } h4 { font-size: 12px; padding-left: 0px; margin-top: 0em; margin-bottom: 0.5em; margin-right: 0em; margin-left: 0em; padding-bottom: 0em; padding-top: 0em; color: #000; border-bottom: 1px solid #666; } h5 { font-size: 11px; padding-left: 0px; margin-top: 0em; margin-bottom: 0.5em; margin-right: 0em; margin-left: 0em; padding-bottom: 0em; padding-top: 0em; color: #000; } /* % they never overlap. */ .display_block { /* default for divs */ .display_inline { /* default for spans */ /* % General tables for reports, etc, with CBRAIN colors */ /* background: white; */ /* % Support for vertical text labels. */ /* % The following styles proudly brought to you by Pierre Rioux, */ /* % after MUCH trial and error! */ /* Use this on whatever contains the DIV with .vertical_text The DIV's height is set to 20em, which is just enough for a name such as "Failed PostProcess Prerequisites". You can override the vertical size of the DIV using style="height: 35em" in the DIV element's attributes. */ .<API key> { vertical-align: bottom; /* will position the .vertical_text DIV at the bottom */ height: 20em; } /* Use this to encapsulate text written from bottom up, sideways. The DIV's width is set to 1.5 em, which is just enough for one line of text. */ div.vertical_text { display: block; white-space: nowrap; width: 1.5em; height: auto; margin: auto; text-align: left; /* background-color: pink; */ transform: translate(0%, 100%) rotate(-90deg) translate(0%, 0%); transform-origin: 0% 0%; -webkit-transform: translate(0%, 100%) rotate(-90deg) translate(0%, 0%); -<API key>: 0% 0%; -moz-transform: translate(0%, 100%) rotate(-90deg) translate(0%, 0%); -<API key>: 0% 0%; -o-transform: translate(0%, 100%) rotate(-90deg) translate(0%, 0%); -o-transform-origin: 0% 0%; -ms-transform: translate(0%, 100%) rotate(-90deg) translate(0%, 0%); -ms-transform-origin: 0% 0%; } /* Use this on whatever contains the DIV with .down_vertical_text */ .<API key> { vertical-align: top; /* will position the DIV at the top */ height: 20em; } div.down_vertical_text { display: block; white-space: nowrap; width: 1.5em; height: auto; margin: auto; text-align: left; /* background-color: pink; */ transform: translate(0%, -100%) rotate(90deg) translate(0%, 0%); transform-origin: 0% 100%; -webkit-transform: translate(0%, -100%) rotate(90deg) translate(0%, 0%); -<API key>: 0% 100%; -moz-transform: translate(0%, -100%) rotate(90deg) translate(0%, 0%); -<API key>: 0% 100%; -o-transform: translate(0%, -100%) rotate(90deg) translate(0%, 0%); -o-transform-origin: 0% 100%; -ms-transform: translate(0%, -100%) rotate(90deg) translate(0%, 0%); -ms-transform-origin: 0% 100%; } div.down_vertical_text2 { display: block; white-space: nowrap; width: 1.5em; height: auto; margin: auto; text-align: right; direction: rtl; /* background-color: pink; */ transform: translate(-100%, 0%) rotate(-90deg) translate(0%, 0%); transform-origin: 100% 0%; -webkit-transform: translate(-100%, 0%) rotate(-90deg) translate(0%, 0%); -<API key>: 100% 0%; -moz-transform: translate(-100%, 0%) rotate(-90deg) translate(0%, 0%); -<API key>: 100% 0%; -o-transform: translate(-100%, 0%) rotate(-90deg) translate(0%, 0%); -o-transform-origin: 100% 0%; -ms-transform: translate(-100%, 0%) rotate(-90deg) translate(0%, 0%); -ms-transform-origin: 100% 0%; } /* % Resource List Table Styles */ /* % These are usually used on pretty tables of data */ /* % These will add up to or override the default table layout above */ .resource_list { border: 0px; border-collapse: collapse; margin-top: 0.8em; width: 100%; } .resource_list th { border: 0px; background-color: #0471B4; text-align: center; text-indent: 0px; font-family: Verdana; font-weight: bold; font-size: 11px; color: #ffffff; white-space: nowrap; } .resource_list th a { color: #ffffff; text-decoration: none; } .resource_list th a:link { color: #ffffff; text-decoration: none; } .resource_list td { border: 0px; text-align: center; padding-left: 1em; padding-right: 1em; white-space: nowrap; } table.resource_list td.checkbox { text-align: center; } table.resource_list td.left_align { text-align: left; } table.resource_list tr.subtitle { background-color: #05A3D6; } table.resource_list th.subtitle { background-color: #E7E7E7; color: #444444; } table.resource_list td.subtitle { background-color: #05A3D6; } table.resource_list tr.subtitle_bordered { background-color: #0471B4; border: 2px solid #0471B4; } .index_block { display: inline-block; } .sort_header { border-bottom: thin solid white; } .order_icon { color: #ffffff; } /* % Simpler table than the default; used mostly */ /* % in tasks forms, for historical reasons. */ table.simple { border: 0px; } table.simple tr { border: 1px; text-align: left; } table.simple td { border: 0px; text-align: left; padding: 1px 0.5em 1px 0.5em; } table.bordered { border: solid 1px black; margin: 2px; } /* % Styles for exception logs */ .<API key>{ color: black; } .exception_header { font-size: 2em; font-weight: bold; } .exception_message { font-size: 1.5em; } .exception_spaced { margin: 0.5em; } /* % General styles for text */ .warning { color: red; } h1.warning { font-size: 14px; line-height: 1.1em; padding: 0; margin: 0; } .loading_message { text-align: center; color: red; } .no_wrap { white-space: nowrap !important; } .wrap { white-space: normal !important; } .<API key> { padding-left: 1em !important; padding-right: 1em !important; } .left { text-align: left !important; } .right { text-align: right !important; } .left_align { text-align: left; } .right_align { text-align: right; } .centered { text-align: center !important; } .small { font-size: 0.8em; } .alone_per_line { display: block; clear: both; } .hidden { display: none; } .short_paragraphs { max-width: 30em; white-space: normal; } .medium_paragraphs { max-width: 60em; white-space: normal; } .field_explanation { font-size: 0.8em; line-height: 1.5em; max-width: 30em; white-space: normal; } .delete_icon { color: red; font-weight: bold; text-decoration: none; } .bold_icon { font-weight: bold; text-decoration: none; } .highlight_in_situ { font-weight: bold; color: purple; } .float_left { float: left; } .cmd-flag { color: #0471b4; } /* % General styles for definition lists */ dt { font-weight: bold; } dd { width: 60em; } /* % General Links formatting */ a { color: #000; text-decoration: underline; } .action_link { color: blue !important; text-decoration: none !important; } .task_help_link { color: blue; text-decoration: none; font-size: 0.7em; vertical-align: +1px; } .error_link { color: red !important; } .no_decorations { text-decoration: none; } /* % General box layouts for miscellaneous content */ .whole_width { width: 100%; } .whole_width > table { width: 100%; } .generalbox { display: table-cell; width: auto; margin-left: 1em; margin-right: 1em; margin-bottom: 1em; padding: 1em; background-color: #F6F6F6; color: #505050; line-height: 1.5em; border: 1px solid #E4E4E4; } /* % General box layouts for account information */ .notesbox { padding: 1em; background-color: #F6F6F6; color: #505050; line-height: 1.5em; border: 1px solid #E4E4E4; width: 800px; margin: 1px; } .groupentry { border: 1px solid black; width: auto; margin-left: 0; margin-right: 1em; padding-left: 1em; padding-right: 1em; background-color: #E6E6E6; color: black; } /* % Rails Log Viewer */ #log_contents { resize: both; /* supported by Safari, Chrome and Firefox */ height: 40em; overflow: auto; background-color: black; color: white; } .log_refresh { display: table-cell; vertical-align: middle; padding-right: 1em; border-right: 1px solid gray; } .log_filters { display: table-cell; vertical-align: middle; padding-left: 1em; } .log_started { color: #00FFFF; /* cyan */ font-weight: bold; } .log_parameters { color: yellow; } .log_processing { color: orange; /* orangey */ font-weight: bold; } .log_completed_fast { color: green; } .log_completed_slow { color: yellow; } .<API key> { color: red; } .<API key> { color: white; background-color: red; font-weight: bold; } .log_user { color: lime; } .log_browser { color: lime; } .log_alternating_1 { color: skyblue; } .log_alternating_2 { color: coral; } /* % Preformated Plain Text Styles */ pre { overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */ white-space: pre-wrap; /* css-3 */ white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */ white-space: -pre-wrap; /* Opera 4-6 */ text-align: left; white-space: -o-pre-wrap; /* Opera 7 */ word-wrap: break-word; /* Internet Explorer 5.5+ */ } .standard_out { max-width: 1600px; } .ssh_key { max-width: 80em; font-size: 0.7em; line-height: 1.3em; } .script_preview { border: solid black; background-color: #EEEEEE; padding-left: 0.2em; padding-right: 0.2em; } /* % Format for flash messages (notice/system/error) */ .flash_notice { z-index: 0; border: 2px solid green; padding-top: 1em; padding-bottom: 1em; padding-left: 1em; padding-right: 1em; margin-bottom: 2px; margin-top: 2px; background-color: #ddffdd; } .flash_system { z-index: 0; border: 2px solid #00ffff; padding-top: 1em; padding-bottom: 1em; padding-left: 1em; padding-right: 1em; margin-bottom: 2px; margin-top: 2px; background-color: #ddeeff; } .flash_error { z-index: 0; border: 2px solid red; padding-top: 1em; padding-bottom: 1em; padding-left: 1em; padding-right: 1em; margin-bottom: 2px; margin-top: 2px; background-color: #ffeeee; } /* % ActiveRecord Validation Messages */ .field_with_errors { padding: 2px; background-color: red; display: inline-table; } .errorExplanation { width: 400px; border: 2px solid red; padding: 7px; padding-bottom: 12px; margin-bottom: 20px; background-color: #f0f0f0; color: #000; } .errorExplanation h2 { text-align: left; font-weight: bold; padding: 5px 5px 5px 15px; font-size: 12px; margin: -7px; width: auto; background-color: #c00; color: #fff; } .errorExplanation p { color: #000; margin-bottom: 0; padding: 5px; } .errorExplanation ul li { font-size: 12px; list-style: square; color: #000; } /* % Documentation popups */ .help_document_popup > div { width: 100%; height: 100%; } .help_document_popup > button { margin-bottom: 10px; } /* % Tool launch bar (userfiles index) */ .launch_bar { border: 2px solid #0471B4; margin: 5px; padding: 5px; position: relative; text-align: right; } .launch_bar span { display: inline-block; margin: 0px 5px; } .launch_bar span.info { display: block; float: left; font-weight: bold; margin-top: 5px; } /* % File upload progress dialog */ .no_close .<API key> { display: none; } .progress_dialog { min-height: 100% !important; } .progress_dialog .bar { position: relative; text-align: center; } .progress_dialog .label { position: absolute; top: 4px; width: 100%; } /* % Account Section of Application Layout */ .account { background: #0471B4; /* can be overridden in .<API key> later in this file */ color: #fff; height:1.8em; font-size: 0.9em; padding: 2px 2px 0px 6px; margin: 0px; } .account a { color: #fff; padding: 0 1em 0 0.8em; font-weight: bold; text-decoration: none; } .home_credits { display: inline; } .loggedas { float: right; margin-right: 0.5em; } .last_updated { margin-right: 0.6em; color: #83b4d1; font-weight: bold; } /* Special coloring of the account section's background, based on GIT branch name */ /* These should all be named .<API key> where NNNN is a branch name */ .<API key> { /* used by devlopment team, obviously */ background: #AA04B4; } .<API key> { background: #0471B4; /* same as in .account */ } .<API key> { background: #0471B4; /* same as in .account */ } .<API key> { /* when not deployed using GIT */ background: #0471B4; /* same as in .account */ } /* % Menu Section of Application Layout */ #header { height: 6em; margin: 0px; background-color: #05A3D6; position: relative; } #header h1 { color: white; display: inline-block; margin: 0; padding: 0.5em; vertical-align: top; } #header h1 a { color: white; } #header a:hover { color: #222; background: #F1F1F1; } #loading_image { display: inline; margin: 0.5em 0 0 0; padding: 0; } #cbsearch { padding: 1em 1em 0 0; text-align: right; float: right; vertical-align: top; } #main-menu { position: absolute; bottom: 0px; font-size: 11px; } .main_menu_left { left:6px; } #main-menu ul { margin: 0; padding: 0; } #main-menu li { float: left; list-style-type: none; margin: 0; padding: 0; white-space: nowrap; } #main-menu li a { display: block; text-decoration: none; font-weight: bold; margin: 0; padding: 4px 10px 4px 10px; } #main-menu li a:hover { background: gray; color: #fff; } #main-menu li a:hover, a:active { background: #ffffff none repeat scroll 0 0; color: #555555; } .selected a { background-color: white; color: #05A3D6; } .unselected a { color: white; } #active_project_div { white-space: nowrap; } #active_project_div h1 { color: #000; } #header_project_menu { color: #F33; padding-left: 0.5em; padding-right: 0.5em; } #project_menu_items { padding: 0 1em 0 1em; } #header_project_menu span { padding: 0; } /* % Project buttons */ .project_button { display: block; float: left; text-align: center; text-decoration: none; color: white; padding: 0.4em; margin: 2em ; width: 18em; height: 9em; border: 0.4em gray solid; border-radius: 1em; -moz-border-radius: 1em; cursor: pointer; } .project_button h4{ color: white; font-weight: bold; border-bottom: none; margin-bottom: 0; font-family: Verdana, sans-serif; padding-bottom: 4px; } .project_button hr { margin-top: 0; } .<API key> { font-size: 10px; color: white; font-weight: bold; text-decoration: none; position: absolute; bottom: 1px; } .<API key> { font-style: italic; line-height: 1.2em; } .project_details { font-size: 0.8em; } .project_edit_button { left: 5px; } .<API key> { right: 5px; } .<API key> { color: #d41c1c; } .system_project { background: #d41c1c; } .system_project:active { background: #d41c1c; } .<API key> { color: #af0b0b; } .everyone_project { background: #af0b0b; } .everyone_project:active { background: #af0b0b; } .site_project_point { color: #8c0953; } .site_project { background: #8c0953; } .site_project:active { background: #8c0953; } .user_project_point { color: #500d75; } .user_project { background: #500d75; } .user_project:active { background: #500d75; } .<API key> { color: #098c09; } .shared_project { background: #098c09; } .shared_project:active { background: #098c09; } .<API key> { color: #076969; } .personal_project { background: #076969; } .personal_project:active { background: #076969; } .<API key> { color: #70a30a; } .invisible_project { background: #70a30a; } .invisible_project:active { background: #70a30a; } .empty_project_point { color: #16a916; } .empty_project { background: #16a916; } .empty_project:active { background: #16a916; } .giant{ margin-top: 0.3em; font-size: 4em; } .<API key> { border: 3px solid #05A3D6; background-color: #F1F1F1; padding: 0.2em 1em 1em 1em; margin-top: 0.2em; text-align: left; max-height: 15em; overflow-y: auto; white-space: nowrap; } .<API key> a{ font-size: 0.7em; color: #222!important; } .<API key> { border: 0px; width: 100%; border-collapse: collapse; margin-top: 0.8em; } .<API key> > table { width: 100%; } .<API key> > table > tbody { display: none; } /* % JQuery UI overrides */ .ui-dialog { border: 2px solid !important; } .license_agreement { width: 50%; display: inline-block; } .bold_text { font-weight: bold; } .center_text { text-align: center; } .em_text { font-style: italic; } /* % Main Content Section of Application Layout */ .main-content { background-color: #FFFFFF; margin: 0; padding: 1em; } /* % Footer Section of Application Layout */ .footer { clear: both; border-top: 2px solid #e4e4e4; font-size: 0.9em; color: #aaa; text-align: center; background: #ffffff; vertical-align: bottom; } .footer a { font-size: 0.9em; color: #aaa; } /* % Footer Section of Credits Layout */ .credits_footer { clear: both; vertical-align: bottom; } .credits_footer a { color: white; text-decoration: none; } .site_logos { float: right; margin-right: 2em; height: 100px; border: 0; } .canarie_logo { float: left; margin-left: 2em; height: 100px; } /* Box for credits */ .credit_box { margin-left: 1em; margin-right: 1em; margin-bottom: 1em; padding-bottom: 1em; background-color: #f6f6f6; color: #505050; line-height: 1.5em; border: 1px solid #e4e4e4; padding:6px; width: 50%; } .box_spacer { min-width: 1em; display: table-cell; } /* Session view (login) */ .logintable { border: 1px; margin-left: auto; margin-right: auto; padding-top: 1em; padding-left: 1em; padding-right: 1em; padding-bottom: 1em; } .logintable td { border: 0px; font-size: 1em; color: #0471B4; text-align: right; padding-top: 0.5em; padding-left: 2em; padding-right: 2em; padding-bottom: 0.5em; margin: 0px; } .logintable td.field { text-align: left; padding: 2px; } .logintable tr { margin: 1px; } #request_password { padding-right: 12em; } /* % Welcome page */ .<API key> { border: 0px; background-color: #E4E4E4; width: 100%; } .<API key> td { padding: 0.4em 1em 0.5em 1em; font-weight: bold; border: 0px; text-align: left; } .exception_report { border: 2px solid red; background: #ffeeee; padding: 3px; } /* % Generic Menu Bar */ .menu_bar { padding-top: 0.2em; padding-bottom: 0.2em; margin-left: 0; margin-right: auto; } /* % Active Filters Bar */ .active_status { display: table; margin-top: 0.8em; width: 100%; } .<API key> { display: inline; text-align: left; white-space: nowrap; padding-right: 2em; float: left; } /* not used */ .<API key> { display: inline; text-align: right; white-space: nowrap; padding-left: 2em; float: right; } .active_label { font-weight: bold; } /* % Pagination Bar */ .pagination { width: 100%; display: table; padding: 0; margin-right: 0; margin-left: 0; margin-top: 0.8em; } .<API key> { width: 1%; display: table-cell; text-align: left; font-weight: bold; white-space: nowrap; padding-right: 2em; } .<API key> { width: 1%; display: table-cell; text-align: right; font-weight: bold; white-space: nowrap; padding-left: 2em; } .pagination_center, .page_links { display: table-cell; text-align: center; white-space: nowrap; clear: both; } /* % Userfiles Index File Manager */ .<API key> { padding: 0 1em; display: table-row; } .<API key> { padding: 0 1em; display: table-row; } #userfiles_table td.type_icon, #userfiles_table th.type_icon { max-width: 12px; } #userfiles_table td.type_icon > .ui-icon { background-image: url(../images/ui-black-icons.png); } /* % Show page table formatting */ .show_table { border-collapse: collapse; border: none; width: 100%; } .show_table th { background: none; font-weight: bold; border: none; color: black; text-align: left; white-space: nowrap; width: 20%; } .show_table td { color: black; border: none; margin: 0; padding: 5px 0; text-align: left; white-space: nowrap; } .show_table td.subheader { background-color: #eeeeee; } .show_table th.checkbox_label { text-align: right; } .show_table_edit{ font-size: 0.9em; } .<API key>{ color: blue; } .show_table_error { color: red; } .show_table_error a { color: red; } /* % Generic Sidebar Content */ .sidebar { white-space: nowrap; font-size: 0.9em; padding: 5px; margin-top: 5px; margin-left: 5px; margin-right: 5px; margin-bottom: 5px; background-color: #f6f6f6; border: 1px solid #dddddd; } /* % Userfiles Sidebar Content */ .view_options { font-weight: bold; line-height: 1.7em; padding: 0 1em 0 1em; white-space: nowrap; } /* % Sidebar Filter Content (Tasks or Userfiles) */ #<API key> { white-space: nowrap; } .filter_menu { padding: 0; margin-left: 0px; text-align: left; } .filter_menu li { list-style-type: none; margin-left: 0px; font-weight: bold; } .custom_filter li { font-weight: bold; } /* current_filters is an ID because the element is modified with AJAX */ #current_filters ul { padding-left: 0; color: #0471B4; } .<API key> { color: #0471B4; margin-right: 0.5em; } /* current_filters is an ID because the element is modified with AJAX */ #current_filters a { text-decoration: none; color: blue; } /* % Task Show and Edit */ th.<API key> { text-align: center; } .<API key> { clear: both; margin-right: auto; margin-left: 0px; width: 100%; } .<API key> td { text-align: left; margin-right: 0em; } /* Show task parameters */ .task-show > table { border: 0; } .tsk-sw-hdr, .tsk-sw-name, .tsk-sw-val { background: inherit; border: 0; text-align: left; } .tsk-sw-hdr { font-family: sans-serif; font-size: 1.1em; font-weight: bold; padding: 30px 5px 10px 5px; text-align: left; } .tsk-sw-name { padding-right: 40px; } .tsk-sw-param > tr > .tsk-sw-hdr { padding-top: 5px; } .tsk-sw-param > tr > .tsk-sw-val { font-family: monospace; } /* Edit task parameters */ .task-params > ul { list-style: none; padding-left: 20px; padding: 0; } .task-params > ul > li { margin-bottom: 30px; margin-top: 10px; } /* label */ .tsk-prm-lbl { display: block; font-size: 1.1em; font-weight: bold; margin-bottom: 5px; margin-left: 25px; } .tsk-prm-lbl > .required { color: red; } .tsk-prm.flag > .tsk-prm-lbl { margin-left: 30px; } /* optional */ .tsk-prm-opt, .tsk-prm-chk { display: none; } .tsk-prm-opt-lbl, .tsk-prm-chk-lbl { background: #ffffff; border: 1px solid #888888; display: inline-block; float: left; height: 22px; width: 22px; } .tsk-prm-opt-lbl { border-right: 0; } .tsk-prm-opt-lbl > .tsk-prm-opt-icon, .tsk-prm-chk-lbl > .tsk-prm-chk-icon { background-image: url("images/<API key>.png"); margin-left: 3px; margin-top: 2px; visibility: hidden; } .tsk-prm-opt:checked + .tsk-prm-opt-lbl, .tsk-prm-opt[checked=checked] + .tsk-prm-opt-lbl, .tsk-prm-chk:checked + .tsk-prm-chk-lbl, .tsk-prm-chk[checked=checked] + .tsk-prm-chk-lbl { background: #0471b4; } .tsk-prm-opt:checked + .tsk-prm-opt-lbl > .tsk-prm-opt-icon, .tsk-prm-opt[checked=checked] + .tsk-prm-opt-lbl > .tsk-prm-opt-icon, .tsk-prm-chk:checked + .tsk-prm-chk-lbl > .tsk-prm-chk-icon, .tsk-prm-chk[checked=checked] + .tsk-prm-chk-lbl > .tsk-prm-chk-icon { visibility: visible; } /* input */ .tsk-prm-in, .tsk-prm-sel { background: #ffffff; border: 1px solid #888888; color: #000000; display: block; font-family: monospace; font-size: 15px; margin-left: 23px; min-height: 18px; padding: 2px 5px; position: relative; width: auto; } .tsk-prm.string > .tsk-prm-in, .tsk-prm.string > .tsk-prm-list > li > .tsk-prm-in { width: 600px; } .tsk-prm.number > .tsk-prm-in, .tsk-prm.number > .tsk-prm-list > li > .tsk-prm-in, .tsk-prm-sel { min-width: 175px; } /* selection */ .tsk-prm-sel-lbl { overflow: hidden; white-space: nowrap; } .tsk-prm-sel-lbl.disabled { color: #888888; font-style: italic; } .tsk-prm-sel > .tsk-prm-sel-icon { background-image: url("images/<API key>.png"); float: right; margin-top: 2px; } .tsk-prm-sel-opt { border: 1px solid #888888; display: none; left: -1px; list-style: none; max-height: 200px; overflow-y: auto; padding: 0; position: absolute; top: 22px; min-width: 185px; z-index: 501; } .tsk-prm-sel-opt > li { background: #ffffff; color: #000000; display: block; font-family: monospace; font-size: 15px; padding: 4px 5px; width: auto; } .tsk-prm-sel-opt > li:hover { background: #fff3d3; } .tsk-prm-sel-opt > li:active { background: #ffe49a; } /* list */ .tsk-prm-list { list-style: none; margin-left: 23px; padding: 0; } .tsk-prm-list > li { margin-bottom: 3px; } .tsk-prm-list > li > .tsk-prm-in { display: inline-block; margin-left: 0; } .tsk-prm-list > li > .tsk-prm-add, .tsk-prm-list > li > .tsk-prm-rm { background-image: url("images/<API key>.png"); display: inline-block; cursor: pointer; position: relative; top: 3px; } .tsk-prm-add:hover, .tsk-prm-rm:hover { background-color: #dddddd; } .tsk-prm-add:active, .tsk-prm-rm:active { background-color: #ffffff; } /* description */ .tsk-prm-desc { display: block; margin-top: 5px; margin-left: 25px; max-width: 600px; } .tsk-prm.flag > .tsk-prm-desc { margin-left: 30px; } /* % Userfiles Content Subclasses */ .plain_file_list { max-width: 950px; margin-left: 0px; } #<API key> { border: 0.2em solid #6699CC; padding: 0.5em; margin-top: 1em; margin-left: 1em; } img { border: none; } /* % Tasks Index */ #tasks_div { width: 100%; padding-right: 1em; } #tasks_table { width: auto; } #tasks_table td.expand, #tasks_table th.expand { max-width: 12px; } #tasks_table td.expand > .ui-icon { background-image: url(../images/ui-black-icons.png); } #tasks_table td.expand > .batch-btn, #tasks_table tr.batch > td.type { cursor: pointer; } #tasks_table tr.batch:nth-child(odd) { background-color: #cde6f4; } #tasks_table tr.batch:nth-child(even) { background-color: #e3f2fb; } #tasks_table tr.task.unavailable:nth-child(odd) { background-color: #fcd1de; } #tasks_table tr.task.unavailable:nth-child(even) { background-color: #fee5ec; } /* % Styles for Data Provider Browse page */ .<API key> { vertical-align: middle; padding: 0 0.5em 0 0.5em; } .<API key> { width: 2em; height: 2em; border-radius: 4px; -moz-border-radius: 4px; } /* % Styles for Data Provider Report page */ #dp_report_table tr.severity-trivial { background-color: #c9f3f3; } #dp_report_table tr.severity-minor { background-color: #cef9ce; } #dp_report_table tr.severity-major { background-color: #fff1e6; } #dp_report_table tr.severity-critical { background-color: #ffd3d3; } /* % Styles for Filtering Columns Headers */ /* % Used in Task Index or Data Provider Browser */ .filter_list { border: 2px solid #0471B4; margin-top: 0; color: #222; padding: 1.2em 1.2em 0 1.2em; background-color: #F1F1F1; /* #eee;*/ text-align: left; max-height: 30em; overflow: auto; } .filter_list ul { padding-left: 1.5em; } .filter_list li a:link { color: #222; } .filter_list li a:hover { background: #B9B9B9; color: #0060A9; } .filter_list li a.filter_zero { color: #ccc; } .hover_dropdown { position: absolute; z-index: 999; } .resource_header { border-top: 0; margin: 0; padding: 1em; background-color: #0471B4; text-align: left; } /* % Message Styles For Main Layout */ .<API key> { border-collapse: collapse; border: 0; clear: both; width: 100%; } .<API key> td:first-child { text-align: left; } .<API key> td { border: 0; font-size: 1em; font-weight: bold; padding: 0.2em 0.4em; text-align: right; } .<API key> td:last-child { font-weight: normal; } .<API key> tr { border-width: 2px; } .<API key> tr.notice_display { background-color: #ddffdd; border-color: green; } .<API key> tr.error_display { background-color: #ffeeee; border-color: red; } .<API key> tr.system_display { background-color: #ddeeff; border-color: blue; } .<API key> tr.message_read { border-style: none; } .<API key> tr.message_unread { border-style: solid; } /* % Message Index */ #message_table th.critical > .dt-hdr { font-size: 1.8em; padding-right: 0.5em; } #message_table td.critical { font-weight: bold; padding-left: 1em; } #message_table tr.notice_display.message_read:hover, #message_table tr.notice_display.message_unread:hover, #message_table tr.system_display.message_read:hover, #message_table tr.system_display.message_unread:hover, #message_table tr.error_display.message_read:hover, #message_table tr.error_display.message_unread:hover { background: #fff3d3; } #message_table tr.notice_display.message_read:active, #message_table tr.notice_display.message_unread:active, #message_table tr.system_display.message_read:active, #message_table tr.system_display.message_unread:active, #message_table tr.error_display.message_read:active, #message_table tr.error_display.message_unread:active { background: #ffe49a; } #message_table tr.notice_display.message_read { background: #c3f6b3; } #message_table tr.notice_display.message_unread { background: #5cdd5c; } #message_table tr.system_display.message_read { background: #b6c7f0; } #message_table tr.system_display.message_unread { background: #5f7ec6; } #message_table tr.error_display.message_read { background: #ff8f8f; } #message_table tr.error_display.message_unread { background: #ff6b6b; } #message_table td.operations { text-align: right; } /* % Table for user checkboxes for Groups and Sites */ .button_table { width: 100px; } .button_table td { padding: 4px; } .button_div { display:inline-block; margin: 0.2em; } .button_inner_div { max-height:20em; overflow-y: auto; padding-left: 1.5em; padding-right: 1.5em; } /* % Notes and Help Text Styles */ #<API key> { max-width: 60em; position: absolute; background-color: white; border: 0.2em solid #0471B4; padding: 1em; } /* % xstooltip Styles */ .html_tool_tip { display: none; position: absolute; top: 0; left: 0; z-index: 9999; background-color: #FFFFCC; font: normal 8pt sans-serif; color: black; padding: 5px; border: 1px solid black; } .white_bg { background-color: white; } /* % Extra Toolkit element styling */ .button.grayed-out { opacity: 0.6; filter: alpha(opacity=60); } /* % Z Toolkit element styling */ .button { z-index: 500; } .<API key> { display: inline-block; z-index: 501; } .<API key> > .drop_down_menu { position: absolute; z-index: 501; border: solid; border-width: 1px; padding: 5px; background: #f8f8f8; } .dropmenu_info { width: 30em; } #new_model .<API key> { display: none; } #new_model .ui-button-text { padding: .4em 1em; } /* % QC styling */ .qc_table { border-spacing: 0.5em; } .qc_panel { padding: 1em; border: 0.2em solid #05A3D6; } /* % Calendar styling */ #calendar table { border-collapse: collapse; width: 100%; } #calendar td, #calendar th { font-family: "Lucida Grande",arial,helvetica,sans-serif; font-size: 10px; padding: 6px; border: 1px solid #999; } #calendar th { background: #DDD; color: #666; text-align: center; width: 14.2857142857143%; } #calendar td { background: #FFF; color: #777; height: 80px; vertical-align: top; font-size: 16px; } #calendar .notmonth { color: #CCC; } #calendar #month { margin: 0; padding-top: 10px; padding-bottom: 10px; text-align: center; } #calendar #month a, #calendar #month a:hover { text-decoration: none; padding: 0 10px; color: #999; } #calendar .today { background-color: #D7F2FF; } #calendar ul { margin: 0; margin-top: 5px; padding: 0; list-style: none; } #calendar li { margin: 0; padding: 0; font-size: 11px; text-align: center; } /* % Date range styling */ .<API key> { width: 9.5em; } .<API key> { width: auto; white-space: nowrap; padding: 0 0.4em 0 0.4em; } .<API key> select { width: 10em; } .<API key> { width: 100%; padding: 3px; border: black 1px solid; background-color: #dddddd; display: table; } /* % Report Generator Styles */ .<API key> td select { width: 100%; resize: both; } /* % Jquery Confirmation UI styling */ .<API key> { background-color: pink !important; font-weight: bold !important; border: 3px solid red !important; } .no-close .<API key> { display: none; }
'use strict'; (function() { angular .module('app') .directive('formBlock', formBlockDirective); function formBlockDirective() { return { restrict: 'E', scope: { block: '=', remove: '&' }, bindToController: true, transclude: false, controller: 'formBlockController as vm', link: link, templateUrl: '/js/templates/form-block.template.html' }; function link(scope, elem, attrs, vm) { } } }());
/* HOME SCREEN */ .home .main-icon { margin: 10% 0px 20px 0px; } #sideMenu { padding-top: 20px; } /* FLOAT BUTTON */ .bottom-space { margin-bottom: 80px; } .btn-floating.second { margin-right: -10px; width: 45px; height: 45px; line-height: 58px; } .btn-floating.third { bottom: 45px; left: 87px; width: 45px; height: 45px; line-height: 58px; } /* MODAL */ .modal.fullscreen { max-height: 100% !important; } /* TAGS */ .chip .icon { float: left; font-size: 16px; line-height: 32px; padding-right: 5px; } .chip.tiny { height: 20px; padding: 0 10px; line-height: 20px; font-size: x-small; } .chip.tiny .icon { line-height: 20px; } .chip.clear { color: rgba(0,0,0,0.87); margin: 0px; padding: 0px; background-color: transparent; } /* ONE LINE COLLECTION */ .collection.one-line .avatar { min-height: 63px; }
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.<API key>(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var core_1 = require('@angular/core'); var common_1 = require('@angular/common'); var forms_1 = require('@angular/forms'); var <API key> = new core_1.Provider(forms_1.NG_VALUE_ACCESSOR, { useExisting: core_1.forwardRef(function () { return ToggleButton; }), multi: true }); var ToggleButton = (function () { function ToggleButton() { this.onLabel = 'Yes'; this.offLabel = 'No'; this.onChange = new core_1.EventEmitter(); this.checked = false; this.onModelChange = function () { }; this.onModelTouched = function () { }; } ToggleButton.prototype.getIconClass = function () { var baseClass = 'ui-button-icon-left fa fa-fw'; return baseClass + ' ' + (this.checked ? this.onIcon : this.offIcon); }; ToggleButton.prototype.toggle = function (event) { if (!this.disabled) { this.checked = !this.checked; this.onModelChange(this.checked); this.onModelTouched(); this.onChange.emit({ originalEvent: event, checked: this.checked }); } }; ToggleButton.prototype.writeValue = function (value) { this.checked = value; }; ToggleButton.prototype.registerOnChange = function (fn) { this.onModelChange = fn; }; ToggleButton.prototype.registerOnTouched = function (fn) { this.onModelTouched = fn; }; __decorate([ core_1.Input(), __metadata('design:type', String) ], ToggleButton.prototype, "onLabel", void 0); __decorate([ core_1.Input(), __metadata('design:type', String) ], ToggleButton.prototype, "offLabel", void 0); __decorate([ core_1.Input(), __metadata('design:type', String) ], ToggleButton.prototype, "onIcon", void 0); __decorate([ core_1.Input(), __metadata('design:type', String) ], ToggleButton.prototype, "offIcon", void 0); __decorate([ core_1.Input(), __metadata('design:type', Boolean) ], ToggleButton.prototype, "disabled", void 0); __decorate([ core_1.Input(), __metadata('design:type', Object) ], ToggleButton.prototype, "style", void 0); __decorate([ core_1.Input(), __metadata('design:type', String) ], ToggleButton.prototype, "styleClass", void 0); __decorate([ core_1.Output(), __metadata('design:type', core_1.EventEmitter) ], ToggleButton.prototype, "onChange", void 0); ToggleButton = __decorate([ core_1.Component({ selector: 'p-toggleButton', template: "\n <div [ngClass]=\"{'ui-button ui-togglebutton ui-widget ui-state-default ui-corner-all': true, 'ui-button-text-only': (!onIcon&&!offIcon), '<API key>': (onIcon&&offIcon),\n 'ui-state-active': checked, 'ui-state-hover': hover&&!disabled, 'ui-state-disabled': disabled}\" [ngStyle]=\"style\" [class]=\"styleClass\" \n (click)=\"toggle($event)\" (mouseenter)=\"hover=true\" (mouseleave)=\"hover=false\">\n <span *ngIf=\"onIcon||offIcon\" [class]=\"getIconClass()\"></span>\n <span class=\"ui-button-text <API key>\">{{checked ? onLabel : offLabel}}</span>\n </div>\n ", providers: [<API key>] }), __metadata('design:paramtypes', []) ], ToggleButton); return ToggleButton; }()); exports.ToggleButton = ToggleButton; var ToggleButtonModule = (function () { function ToggleButtonModule() { } ToggleButtonModule = __decorate([ core_1.NgModule({ imports: [common_1.CommonModule], exports: [ToggleButton], declarations: [ToggleButton] }), __metadata('design:paramtypes', []) ], ToggleButtonModule); return ToggleButtonModule; }()); exports.ToggleButtonModule = ToggleButtonModule; //# sourceMappingURL=togglebutton.js.map
# -*- coding: utf-8 -*- from flask import request, abort from views.baseapi import BaseApiBlueprint, BaseApiCallback class MonsterBlueprint(BaseApiBlueprint): @property def datamapper(self): return self.basemapper.monster @property def campaignmapper(self): return self.basemapper.campaign def <API key>(self, user_id): return [None] + [ c.id for c in self.campaignmapper.getByDmUserId(user_id) ] @BaseApiCallback('index') @BaseApiCallback('overview') @BaseApiCallback('show') @BaseApiCallback('new') @BaseApiCallback('edit') @BaseApiCallback('api_list') @BaseApiCallback('api_get') @BaseApiCallback('api_copy') @BaseApiCallback('api_post') @BaseApiCallback('api_patch') @BaseApiCallback('api_delete') @BaseApiCallback('api_recompute') def adminOrDmOnly(self, *args, **kwargs): if not self.checkRole(['admin', 'dm']): abort(403) @BaseApiCallback('raw') def adminOnly(self, *args, **kwargs): if not self.checkRole(['admin']): abort(403) @BaseApiCallback('api_list.objects') def <API key>(self, objs): if self.checkRole(['admin']): return campaign_ids = self.<API key>( request.user.id ) objs[:] = [ obj for obj in objs if obj.user_id == request.user.id \ or obj.campaign_id in campaign_ids ] @BaseApiCallback('api_copy.original') @BaseApiCallback('api_get.object') def <API key>(self, obj): if self.checkRole(['admin']): return campaign_ids = self.<API key>( request.user.id ) if obj.user_id != request.user.id \ and obj.campaign_id not in campaign_ids: abort(403) @BaseApiCallback('api_patch.object') @BaseApiCallback('api_delete.object') def adminOrOwnedSingle(self, obj): if self.checkRole(['admin']): return if obj.user_id is None: obj.user_id = request.user.id elif obj.user_id != request.user.id: abort(403) @BaseApiCallback('api_post.object') @BaseApiCallback('api_copy.object') def setOwner(self, obj): obj.user_id = request.user.id @BaseApiCallback('api_copy.object') def changeName(self, obj, *args, **kwargs): obj.name += " (Copy)" def get_blueprint(basemapper, config): return '/monster', MonsterBlueprint( 'monster', __name__, basemapper, config, template_folder='templates' )
package com.sk89q.craftbook.circuits.gates.world.items; import org.bukkit.Server; import com.sk89q.craftbook.ChangedSign; import com.sk89q.craftbook.circuits.ic.ChipState; import com.sk89q.craftbook.circuits.ic.IC; import com.sk89q.craftbook.circuits.ic.ICFactory; import com.sk89q.craftbook.circuits.ic.SelfTriggeredIC; public class SorterST extends Sorter implements SelfTriggeredIC { public SorterST(Server server, ChangedSign sign, ICFactory factory) { super(server, sign, factory); } @Override public String getTitle() { return "Self-Triggered Sorter"; } @Override public String getSignTitle() { return "SORTER ST"; } @Override public boolean isActive() { return true; } @Override public void think(ChipState state) { state.setOutput(0, sort()); } public static class Factory extends Sorter.Factory { public Factory(Server server) { super(server); } @Override public IC create(ChangedSign sign) { return new SorterST(getServer(), sign, this); } } }
// This file is part of Mystery Dungeon eXtended. // Mystery Dungeon eXtended is free software: you can redistribute it and/or modify // (at your option) any later version. // Mystery Dungeon eXtended is distributed in the hope that it will be useful, // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the using System; using System.Collections.Generic; using System.Text; using System.Net; using System.Net.Sockets; using PMDCP.Core; using System.Threading; namespace PMDCP.Sockets.Gnp { public class GnpClient { private const int MaxUDPSize = 0x10000; EndPoint destinationEndPoint; Socket socket; bool listening = false; public Socket Socket { get { return socket; } } public event EventHandler<<API key>> DataReceived; public GnpClient(Socket socket) { this.socket = socket; StartReceivingLoop(); } public GnpClient(EndPoint destinationEndPoint) { this.destinationEndPoint = destinationEndPoint; Initialize(); Connect(destinationEndPoint); } public GnpClient() { Initialize(); } private void Initialize() { socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); } public void Listen(EndPoint endPoint) { socket.Bind(endPoint); listening = true; StartReceivingLoop(); } public void Listen(IPAddress ipAddress, int port) { IPEndPoint iep = new IPEndPoint(ipAddress, port); Listen(iep); } public void Listen(int port) { Listen(IPAddress.Any, port); } private void StartReceivingLoop() { byte[] buffer = new byte[MaxUDPSize]; EndPoint tempRemoteEP; tempRemoteEP = new IPEndPoint(IPAddress.Any, 0); socket.BeginReceiveFrom(buffer, 0, buffer.Length, SocketFlags.None, ref tempRemoteEP, new AsyncCallback(<API key>), buffer); } private void Connect(EndPoint destinationEndPoint) { socket.Connect(destinationEndPoint); StartReceivingLoop(); } private void <API key>(IAsyncResult result) { EndPoint remoteEndPoint = new IPEndPoint(IPAddress.Any, 0); ; int bytesReceived = socket.EndReceiveFrom(result, ref remoteEndPoint); byte[] buffer = (byte[])result.AsyncState; if (bytesReceived < MaxUDPSize) { byte[] newBuffer = new byte[bytesReceived]; Buffer.BlockCopy(buffer, 0, newBuffer, 0, bytesReceived); ProcessIncomingData(newBuffer, remoteEndPoint); } IPEndPoint ipEndPoint = (IPEndPoint)remoteEndPoint; remoteEndPoint = new IPEndPoint(ipEndPoint.Address, 0); socket.BeginReceiveFrom(buffer, 0, buffer.Length, SocketFlags.None, ref remoteEndPoint, new AsyncCallback(<API key>), buffer); } public void Send(byte[] data, EndPoint remoteEndPoint) { socket.SendTo(data, remoteEndPoint); //socket.SendTo(data, 0, data.Length, SocketFlags.None, remoteEndPoint, new AsyncCallback(SendCallback), buffer); } public void Send(byte[] data) { Send(data, this.destinationEndPoint); } private void ProcessIncomingData(byte[] data, EndPoint remoteEndPoint) { string val = ByteEncoder.ByteArrayToString(data); if (DataReceived != null) { DataReceived(this, new <API key>(data, null, val, remoteEndPoint)); } } public void InjectData(byte[] data, EndPoint remoteEndPoint) { ProcessIncomingData(data, remoteEndPoint); } } }
//Author : Pierre-Aime IMBERT //mosaicgui.imbert@gmail.com //GPLv3 licence package mosaic_gui; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Point; import java.awt.Rectangle; import java.awt.RenderingHints; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.awt.event.MouseEvent; import java.awt.image.BufferedImage; import java.awt.image.<API key>; import java.io.File; import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logger; import javax.imageio.ImageIO; import javax.swing.JButton; import javax.swing.JPanel; import javax.swing.event.MouseInputAdapter; public class Cropping extends JPanel { BufferedImage thumbnail=null; Dimension size; Rectangle clip; public Cropping(BufferedImage image) { this.thumbnail = image; size = new Dimension(thumbnail.getWidth(), thumbnail.getHeight()); } protected void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2 = (Graphics2D)g; g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON); int x = (getWidth() - size.width)/2; int y = (getHeight() - size.height)/2; g2.drawImage(thumbnail, x, y, this); if(clip == null) { createClip(); } g2.setPaint(Color.red); g2.draw(clip); } public void setClip(int x, int y) { int x0 = (getWidth() - size.width)/2; int y0 = (getHeight() - size.height)/2; if(x < x0 || x + clip.width > x0 + size.width || y < y0 || y + clip.height > y0 + size.height) return; clip.setLocation(x, y); repaint(); } public Dimension getPreferredSize() { return size; } private void createClip() { clip = new Rectangle(thumbnail.getWidth()/4, thumbnail.getHeight()/4); clip.x = getWidth()/6; clip.y = getWidth()/6; } private void clipImage() { BufferedImage clipped = null; try { int w = clip.width; int h = clip.height; int x0 = (getWidth() - size.width)/2; int y0 = (getHeight() - size.height)/2; int x = clip.x - x0; int y = clip.y - y0; clipped = thumbnail.getSubimage(x, y, w, h); } catch(<API key> rfe) { System.out.println("raster format error: " + rfe.getMessage()); return; } Mosaic_GUI.f.removeAll(); Mosaic_GUI.f.revalidate(); Mosaic_GUI.f.repaint(); Mosaic_GUI.f.dispose(); File outputfile = new File(System.getProperty("user.home")+"\\thumbnail.png"); try { ImageIO.write(clipped, "png", outputfile); } catch (IOException ex) { Logger.getLogger(Mosaic_GUI.class.getName()).log(Level.SEVERE, null, ex); } } JPanel getUIPanel() { JButton validclip = new JButton(); if (Mosaic_GUI.lang==1) validclip.setText("Rogner"); else if (Mosaic_GUI.lang==2) validclip.setText("Crop"); validclip.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { clipImage(); } }); JPanel panel = new JPanel(); panel.addKeyListener(new KeyListener() { @Override public void keyTyped(KeyEvent e) { } @Override public void keyPressed(KeyEvent e) { int keyCode = e.getKeyCode(); switch( keyCode ) { case KeyEvent.VK_UP: if(clip.y>0) { clip.height=clip.height-2; if(clip.height<1) { clip.height=1; } repaint(); } break; case KeyEvent.VK_DOWN: if(clip.y+clip.height<thumbnail.getHeight()) { clip.height=clip.height+2; if(clip.y+clip.height>thumbnail.getHeight()) { clip.height=clip.height-2; } repaint(); } break; case KeyEvent.VK_LEFT: if(clip.x>0) { clip.width=clip.width-2; if(clip.width<1) { clip.width=1; } repaint(); } break; case KeyEvent.VK_RIGHT : if(clip.x+clip.width<thumbnail.getWidth()) { clip.width=clip.width+2; if(clip.x+clip.width>thumbnail.getWidth()) { clip.width=clip.width-2; } repaint(); } break; } } @Override public void keyReleased(KeyEvent e) { } }); panel.setFocusable(true); panel.<API key>(); panel.add(validclip); return panel; } } class ClipMover extends MouseInputAdapter { Cropping cropping; Point offset; boolean dragging; public ClipMover(Cropping c) { cropping = c; offset = new Point(); dragging = false; } public void mousePressed(MouseEvent e) { Point p = e.getPoint(); if(cropping.clip.contains(p)) { offset.x = p.x - cropping.clip.x; offset.y = p.y - cropping.clip.y; dragging = true; } } public void mouseReleased(MouseEvent e) { dragging = false; } public void mouseDragged(MouseEvent e) { if(dragging) { int x = e.getX() - offset.x; int y = e.getY() - offset.y; cropping.setClip(x, y); } } }
#include "CRdmOperate.h" #include "JSONObject.h" #include "JSONArray.h" static CRdmOperate * rdmOperate = 0; CRdmOperate::CRdmOperate() { } CRdmOperate::~CRdmOperate() { } CRdmOperate * CRdmOperate::getInstance() { if (0 == rdmOperate) { rdmOperate = new CRdmOperate(); } return rdmOperate; } string CRdmOperate::getOperate(string strId) { string strOperate; JSONObject jsonRoot; JSONObject jsonControl; jsonRoot.put("result", 0); jsonControl.put("count", 0); jsonRoot.put("control", jsonControl); strOperate = jsonRoot.toString(); jsonRoot.release(); return strOperate; }
// Decompiled with JetBrains decompiler // Type: Wb.Lpw.Platform.Protocol.Reward.<API key> // Assembly: Wb.Lpw.Protocol, Version=2.13.83.0, Culture=neutral, PublicKeyToken=null // MVID: <API key> // Assembly location: C:\Users\CGA Computer\Desktop\LEGO Universe Stuff\LOCO Server\Unity Web Player Extractor\Saved Files\LOCO Server.unity3d_unpacked\Wb.Lpw.Protocol.dll using System; using Wb.Lpw.Platform.Protocol; namespace Wb.Lpw.Platform.Protocol.Reward { [Serializable] public class <API key> : PlayerPublicParams { public int MinutesOffset; } }
// Decompiled with JetBrains decompiler // Type: Wb.Lpw.Platform.Protocol.LogCodes.GameServer.ControlServerLink.Report.Error // Assembly: Wb.Lpw.Protocol, Version=2.13.83.0, Culture=neutral, PublicKeyToken=null // MVID: <API key> // Assembly location: C:\Users\CGA Computer\Desktop\LEGO Universe Stuff\LOCO Server\Unity Web Player Extractor\Saved Files\LOCO Server.unity3d_unpacked\Wb.Lpw.Protocol.dll using Wb.Lpw.Platform.Protocol.LogCodes; namespace Wb.Lpw.Platform.Protocol.LogCodes.GameServer.ControlServerLink.Report { public abstract class Error { public static LogCode DefaultError = new LogCode("GameServer", "ControlServerLink", "Report", Severity.Error, "DefaultError", 628319); public static LogCode Connection = new LogCode("GameServer", "ControlServerLink", "Report", Severity.Error, "Connection", 628322); } }
#include <linux/module.h> #include <linux/kernel.h> static int myinit(void) { pr_info("warn_on init\n"); WARN_ON("warn_on do it"); pr_info("warn_on after\n"); return 0; } static void myexit(void) { pr_info("warn_on cleanup\n"); } module_init(myinit) module_exit(myexit) MODULE_LICENSE("GPL");
package examples.chapter03.item12; import java.util.Collections; import java.util.Set; import java.util.TreeSet; public class WordList { public static void main(String[] args) { String[] args2 = {"An", "Unordered", "String", "!"}; Set<String> s = new TreeSet<String>(); Collections.addAll(s, args2); System.out.println(s); } }
#ifndef _PLGBUFFERGROUP_H #define _PLGBUFFERGROUP_H #include "Math/hsGeometry3.h" #include "plVertCoder.h" class PLASMA_DLL plGBufferCell { public: unsigned int fVtxStart, fColorStart, fLength; public: plGBufferCell() : fVtxStart(0), fColorStart(0), fLength(0) { } plGBufferCell(const plGBufferCell& init) : fVtxStart(init.fVtxStart), fColorStart(init.fColorStart), fLength(init.fLength) { } void read(hsStream* S); void write(hsStream* S); void prcWrite(pfPrcHelper* prc); void prcParse(const pfPrcTag* tag); }; class PLASMA_DLL plGBufferTriangle { public: unsigned short fIndex1, fIndex2, fIndex3, fSpanIndex; hsVector3 fCenter; public: plGBufferTriangle() : fIndex1(0), fIndex2(0), fIndex3(0), fSpanIndex(0) { } plGBufferTriangle(const plGBufferTriangle& init) : fIndex1(init.fIndex1), fIndex2(init.fIndex2), fIndex3(init.fIndex3), fSpanIndex(init.fSpanIndex), fCenter(init.fCenter) { } void read(hsStream* S); void write(hsStream* S); void prcWrite(pfPrcHelper* prc); void prcParse(const pfPrcTag* tag); }; class PLASMA_DLL plGBufferVertex { public: hsVector3 fPos, fNormal; int fSkinIdx; float fSkinWeights[3]; unsigned int fColor; hsVector3 fUVWs[10]; public: plGBufferVertex() : fSkinIdx(0), fColor(0) { fSkinWeights[0] = 0.0f; fSkinWeights[1] = 0.0f; fSkinWeights[2] = 0.0f; } }; class PLASMA_DLL plGBufferGroup { public: enum Formats { kUVCountMask = 0xF, kSkinNoWeights = 0x0, kSkin1Weight = 0x10, kSkin2Weights = 0x20, kSkin3Weights = 0x30, kSkinWeightMask = 0x30, kSkinIndices = 0x40, kEncoded = 0x80 }; enum GeometryStorage { kStoreUncompressed = 0, kStoreCompV1 = 0x1, kStoreCompV2 = 0x2, kStoreCompV3 = 0x3, kStoreCompTypeMask = 0x3, kStoreIsDirty = 0x4 }; protected: unsigned int fFormat, fStride, fLiteStride, fGBuffStorageType; std::vector<unsigned int> fVertBuffSizes, fIdxBuffCounts, fCompGBuffSizes; std::vector<unsigned char*> fVertBuffStorage; std::vector<unsigned short*> fIdxBuffStorage; std::vector<std::vector<plGBufferCell> > fCells; std::vector<unsigned char*> fCompGBuffStorage; unsigned int ICalcVertexSize(unsigned int& lStride); bool <API key>(PlasmaVer ver) const; public: plGBufferGroup(unsigned char fmt) : fGBuffStorageType(kStoreUncompressed) { setFormat(fmt); } ~plGBufferGroup(); void read(hsStream* S); void write(hsStream* S); void prcWrite(pfPrcHelper* prc); void prcParse(const pfPrcTag* tag); std::vector<plGBufferVertex> getVertices(size_t idx, size_t start = 0, size_t count = (size_t)-1) const; std::vector<unsigned short> getIndices(size_t idx, size_t start = 0, size_t count = (size_t)-1, size_t offset = 0) const; std::vector<plGBufferCell> getCells(size_t idx) const { return fCells[idx]; } unsigned int getFormat() const { return fFormat; } size_t getSkinWeights() const { return (fFormat & kSkinWeightMask) >> 4; } size_t getNumUVs() const { return (fFormat & kUVCountMask); } bool getHasSkinIndices() const { return (fFormat & kSkinIndices) != 0; } void addVertices(const std::vector<plGBufferVertex>& verts); void addIndices(const std::vector<unsigned short>& indices); void addCells(const std::vector<plGBufferCell>& cells) { fCells.push_back(cells); } void setFormat(unsigned int format); void setSkinWeights(size_t skinWeights); void setNumUVs(size_t numUVs); void setHasSkinIndices(bool hasSI); void delVertices(size_t idx); void delIndices(size_t idx); void delCells(size_t idx) { fCells.erase(fCells.begin() + idx); } void clearVertices(); void clearIndices(); void clearCells() { fCells.clear(); } size_t getNumVertBuffers() const { return fVertBuffStorage.size(); } size_t getNumIdxBuffers() const { return fIdxBuffStorage.size(); } const unsigned char* <API key>(size_t idx) const { return fVertBuffStorage[idx]; } const unsigned short* getIdxBufferStorage(size_t idx) const { return fIdxBuffStorage[idx]; } unsigned char* <API key>(size_t idx) { return fVertBuffStorage[idx]; } unsigned short* getMutableIdxBuffer(size_t idx) { return fIdxBuffStorage[idx]; } size_t getVertBufferSize(size_t idx) const { return fVertBuffSizes[idx]; } size_t getIdxBufferCount(size_t idx) const { return fIdxBuffCounts[idx]; } unsigned int getStride() const { return fStride; } }; #endif
AssaultCube Reloaded Launcher == This is the official auto-updater launcher for AssaultCube Reloaded. It can check for updates when you launch ACR. You can also launch it in an interactive mode, with which you can download or update AssaultCube Reloaded.
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // Eigen is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // Alternatively, you can redistribute it and/or // published by the Free Software Foundation; either version 2 of // Eigen is distributed in the hope that it will be useful, but WITHOUT ANY // You should have received a copy of the GNU Lesser General Public #ifndef EIGEN_LDLT_H #define EIGEN_LDLT_H namespace internal { template<typename MatrixType, int UpLo> struct LDLT_Traits; } /** \ingroup cholesky_Module * * \class LDLT * * \brief Robust Cholesky decomposition of a matrix with pivoting * * \param MatrixType the type of the matrix of which to compute the LDL^T Cholesky decomposition * * Perform a robust Cholesky decomposition of a positive semidefinite or negative semidefinite * matrix \f$ A \f$ such that \f$ A = P^TLDL^*P \f$, where P is a permutation matrix, L * is lower triangular with a unit diagonal and D is a diagonal matrix. * * The decomposition uses pivoting to ensure stability, so that L will have * zeros in the bottom right rank(A) - n submatrix. Avoiding the square root * on D also stabilizes the computation. * * Remember that Cholesky decompositions are not rank-revealing. Also, do not use a Cholesky * decomposition to determine whether a system of equations has a solution. * * \sa MatrixBase::ldlt(), class LLT */ /* THIS PART OF THE DOX IS CURRENTLY DISABLED BECAUSE INACCURATE BECAUSE OF BUG IN THE DECOMPOSITION CODE * Note that during the decomposition, only the upper triangular part of A is considered. Therefore, * the strict lower part does not have to store correct values. */ template<typename _MatrixType, int _UpLo> class LDLT { public: typedef _MatrixType MatrixType; enum { RowsAtCompileTime = MatrixType::RowsAtCompileTime, ColsAtCompileTime = MatrixType::ColsAtCompileTime, Options = MatrixType::Options & ~RowMajorBit, // these are the options for the TmpMatrixType, we need a ColMajor matrix here! <API key> = MatrixType::<API key>, <API key> = MatrixType::<API key>, UpLo = _UpLo }; typedef typename MatrixType::Scalar Scalar; typedef typename NumTraits<typename MatrixType::Scalar>::Real RealScalar; typedef typename MatrixType::Index Index; typedef Matrix<Scalar, RowsAtCompileTime, 1, Options, <API key>, 1> TmpMatrixType; typedef Transpositions<RowsAtCompileTime, <API key>> TranspositionType; typedef PermutationMatrix<RowsAtCompileTime, <API key>> PermutationType; typedef internal::LDLT_Traits<MatrixType, UpLo> Traits; /** \brief Default Constructor. * * The default constructor is useful in cases in which the user intends to * perform decompositions via LDLT::compute(const MatrixType&). */ LDLT() : m_matrix(), m_transpositions(), m_isInitialized(false) {} /** \brief Default Constructor with memory preallocation * * Like the default constructor but with preallocation of the internal data * according to the specified problem \a size. * \sa LDLT() */ LDLT(Index size) : m_matrix(size, size), m_transpositions(size), m_temporary(size), m_isInitialized(false) {} LDLT(const MatrixType &matrix) : m_matrix(matrix.rows(), matrix.cols()), m_transpositions(matrix.rows()), m_temporary(matrix.rows()), m_isInitialized(false) { compute(matrix); } /** \returns a view of the upper triangular matrix U */ inline typename Traits::MatrixU matrixU() const { eigen_assert(m_isInitialized && "LDLT is not initialized."); return Traits::getU(m_matrix); } /** \returns a view of the lower triangular matrix L */ inline typename Traits::MatrixL matrixL() const { eigen_assert(m_isInitialized && "LDLT is not initialized."); return Traits::getL(m_matrix); } /** \returns the permutation matrix P as a transposition sequence. */ inline const TranspositionType&transpositionsP() const { eigen_assert(m_isInitialized && "LDLT is not initialized."); return m_transpositions; } /** \returns the coefficients of the diagonal matrix D */ inline Diagonal<const MatrixType> vectorD(void) const { eigen_assert(m_isInitialized && "LDLT is not initialized."); return m_matrix.diagonal(); } /** \returns true if the matrix is positive (semidefinite) */ inline bool isPositive(void) const { eigen_assert(m_isInitialized && "LDLT is not initialized."); return m_sign == 1; } #ifdef EIGEN2_SUPPORT inline bool isPositiveDefinite() const { return isPositive(); } #endif /** \returns true if the matrix is negative (semidefinite) */ inline bool isNegative(void) const { eigen_assert(m_isInitialized && "LDLT is not initialized."); return m_sign == -1; } /** \returns a solution x of \f$ A x = b \f$ using the current decomposition of A. * * This function also supports in-place solves using the syntax <tt>x = decompositionObject.solve(x)</tt> . * * \<API key> * * More precisely, this method solves \f$ A x = b \f$ using the decomposition \f$ A = P^T L D L^* P \f$ * by solving the systems \f$ P^T y_1 = b \f$, \f$ L y_2 = y_1 \f$, \f$ D y_3 = y_2 \f$, * \f$ L^* y_4 = y_3 \f$ and \f$ P x = y_4 \f$ in succession. If the matrix \f$ A \f$ is singular, then * \f$ D \f$ will also be singular (all the other matrices are invertible). In that case, the * least-square solution of \f$ D y_3 = y_2 \f$ is computed. This does not mean that this function * computes the least-square solution of \f$ A x = b \f$ is \f$ A \f$ is singular. * * \sa MatrixBase::ldlt() */ template<typename Rhs> inline const internal::solve_retval<LDLT, Rhs> solve(const MatrixBase<Rhs> &b) const { eigen_assert(m_isInitialized && "LDLT is not initialized."); eigen_assert(m_matrix.rows() == b.rows() && "LDLT::solve(): invalid number of rows of the right hand side matrix b"); return internal::solve_retval<LDLT, Rhs>(*this, b.derived()); } #ifdef EIGEN2_SUPPORT template<typename OtherDerived, typename ResultType> bool solve(const MatrixBase<OtherDerived> &b, ResultType *result) const { *result = this->solve(b); return true; } #endif template<typename Derived> bool solveInPlace(MatrixBase<Derived> &bAndX) const; LDLT&compute(const MatrixType &matrix); /** \returns the internal LDLT decomposition matrix * * TODO: document the storage layout */ inline const MatrixType&matrixLDLT() const { eigen_assert(m_isInitialized && "LDLT is not initialized."); return m_matrix; } MatrixType reconstructedMatrix() const; inline Index rows() const { return m_matrix.rows(); } inline Index cols() const { return m_matrix.cols(); } protected: /** \internal * Used to compute and store the Cholesky decomposition A = L D L^* = U^* D U. * The strict upper part is used during the decomposition, the strict lower * part correspond to the coefficients of L (its diagonal is equal to 1 and * is not stored), and the diagonal entries correspond to D. */ MatrixType m_matrix; TranspositionType m_transpositions; TmpMatrixType m_temporary; int m_sign; bool m_isInitialized; }; namespace internal { template<int UpLo> struct ldlt_inplace; template<> struct ldlt_inplace<Lower> { template<typename MatrixType, typename TranspositionType, typename Workspace> static bool unblocked(MatrixType &mat, TranspositionType &transpositions, Workspace &temp, int *sign = 0) { typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::RealScalar RealScalar; typedef typename MatrixType::Index Index; eigen_assert(mat.rows() == mat.cols()); const Index size = mat.rows(); if (size <= 1) { transpositions.setIdentity(); if (sign) *sign = real(mat.coeff(0, 0)) > 0 ? 1 : -1; return true; } RealScalar cutoff = 0, biggest_in_corner; for (Index k = 0; k < size; ++k) { // Find largest diagonal element Index <API key>; biggest_in_corner = mat.diagonal().tail(size - k).cwiseAbs().maxCoeff(&<API key>); <API key> += k; if (k == 0) { // The biggest overall is the point of reference to which further diagonals // are compared; if any diagonal is negligible compared // to the largest overall, the algorithm bails. cutoff = abs(NumTraits<Scalar>::epsilon() * biggest_in_corner); if (sign) *sign = real(mat.diagonal().coeff(<API key>)) > 0 ? 1 : -1; } // Finish early if the matrix is not full rank. if (biggest_in_corner < cutoff) { for (Index i = k; i < size; i++) transpositions.coeffRef(i) = i; break; } transpositions.coeffRef(k) = <API key>; if (k != <API key>) { // apply the transposition while taking care to consider only // the lower triangular part Index s = size - <API key> - 1; // trailing size after the biggest element mat.row(k).head(k).swap(mat.row(<API key>).head(k)); mat.col(k).tail(s).swap(mat.col(<API key>).tail(s)); std::swap(mat.coeffRef(k, k), mat.coeffRef(<API key>, <API key>)); for (int i = k + 1; i < <API key>; ++i) { Scalar tmp = mat.coeffRef(i, k); mat.coeffRef(i, k) = conj(mat.coeffRef(<API key>, i)); mat.coeffRef(<API key>, i) = conj(tmp); } if (NumTraits<Scalar>::IsComplex) mat.coeffRef(<API key>, k) = conj(mat.coeff(<API key>, k)); } // partition the matrix: // A00 | - | - // lu = A10 | A11 | - // A20 | A21 | A22 Index rs = size - k - 1; Block<MatrixType, Dynamic, 1> A21(mat, k + 1, k, rs, 1); Block<MatrixType, 1, Dynamic> A10(mat, k, 0, 1, k); Block<MatrixType, Dynamic, Dynamic> A20(mat, k + 1, 0, rs, k); if (k > 0) { temp.head(k) = mat.diagonal().head(k).asDiagonal() * A10.adjoint(); mat.coeffRef(k, k) -= (A10 * temp.head(k)).value(); if (rs > 0) A21.noalias() -= A20 * temp.head(k); } if ((rs > 0) && (abs(mat.coeffRef(k, k)) > cutoff)) A21 /= mat.coeffRef(k, k); } return true; } }; template<> struct ldlt_inplace<Upper> { template<typename MatrixType, typename TranspositionType, typename Workspace> static EIGEN_STRONG_INLINE bool unblocked(MatrixType &mat, TranspositionType &transpositions, Workspace &temp, int *sign = 0) { Transpose<MatrixType> matt(mat); return ldlt_inplace<Lower>::unblocked(matt, transpositions, temp, sign); } }; template<typename MatrixType> struct LDLT_Traits<MatrixType, Lower> { typedef const TriangularView<const MatrixType, UnitLower> MatrixL; typedef const TriangularView<const typename MatrixType::AdjointReturnType, UnitUpper> MatrixU; inline static MatrixL getL(const MatrixType &m) { return m; } inline static MatrixU getU(const MatrixType &m) { return m.adjoint(); } }; template<typename MatrixType> struct LDLT_Traits<MatrixType, Upper> { typedef const TriangularView<const typename MatrixType::AdjointReturnType, UnitLower> MatrixL; typedef const TriangularView<const MatrixType, UnitUpper> MatrixU; inline static MatrixL getL(const MatrixType &m) { return m.adjoint(); } inline static MatrixU getU(const MatrixType &m) { return m; } }; } // end namespace internal /** Compute / recompute the LDLT decomposition A = L D L^* = U^* D U of \a matrix */ template<typename MatrixType, int _UpLo> LDLT<MatrixType, _UpLo>&LDLT<MatrixType, _UpLo>::compute(const MatrixType &a) { eigen_assert(a.rows() == a.cols()); const Index size = a.rows(); m_matrix = a; m_transpositions.resize(size); m_isInitialized = false; m_temporary.resize(size); internal::ldlt_inplace<UpLo>::unblocked(m_matrix, m_transpositions, m_temporary, &m_sign); m_isInitialized = true; return *this; } namespace internal { template<typename _MatrixType, int _UpLo, typename Rhs> struct solve_retval<LDLT<_MatrixType, _UpLo>, Rhs> : solve_retval_base<LDLT<_MatrixType, _UpLo>, Rhs> { typedef LDLT<_MatrixType, _UpLo> LDLTType; <API key>(LDLTType, Rhs) template<typename Dest> void evalTo(Dest &dst) const { eigen_assert(rhs().rows() == dec().matrixLDLT().rows()); // dst = P b dst = dec().transpositionsP() * rhs(); // dst = L^-1 (P b) dec().matrixL().solveInPlace(dst); // dst = D^-1 (L^-1 P b) // more precisely, use pseudo-inverse of D (see bug 241) using std::abs; using std::max; typedef typename LDLTType::MatrixType MatrixType; typedef typename LDLTType::Scalar Scalar; typedef typename LDLTType::RealScalar RealScalar; const Diagonal<const MatrixType> vectorD = dec().vectorD(); RealScalar tolerance = (max)(vectorD.array().abs().maxCoeff() * NumTraits<Scalar>::epsilon(), RealScalar(1) / NumTraits<RealScalar>::highest()); // motivated by LAPACK's xGELSS for (Index i = 0; i < vectorD.size(); ++i) { if (abs(vectorD(i)) > tolerance) dst.row(i) /= vectorD(i); else dst.row(i).setZero(); } // dst = L^-T (D^-1 L^-1 P b) dec().matrixU().solveInPlace(dst); // dst = P^-1 (L^-T D^-1 L^-1 P b) = A^-1 b dst = dec().transpositionsP().transpose() * dst; } }; } /** \internal use x = ldlt_object.solve(x); * * This is the \em in-place version of solve(). * * \param bAndX represents both the right-hand side matrix b and result x. * * \returns true always! If you need to check for existence of solutions, use another decomposition like LU, QR, or SVD. * * This version avoids a copy when the right hand side matrix b is not * needed anymore. * * \sa LDLT::solve(), MatrixBase::ldlt() */ template<typename MatrixType, int _UpLo> template<typename Derived> bool LDLT<MatrixType, _UpLo>::solveInPlace(MatrixBase<Derived> &bAndX) const { eigen_assert(m_isInitialized && "LDLT is not initialized."); const Index size = m_matrix.rows(); eigen_assert(size == bAndX.rows()); bAndX = this->solve(bAndX); return true; } /** \returns the matrix represented by the decomposition, * i.e., it returns the product: P^T L D L^* P. * This function is provided for debug purpose. */ template<typename MatrixType, int _UpLo> MatrixType LDLT<MatrixType, _UpLo>::reconstructedMatrix() const { eigen_assert(m_isInitialized && "LDLT is not initialized."); const Index size = m_matrix.rows(); MatrixType res(size, size); res.setIdentity(); res = transpositionsP() * res; // L^* P res = matrixU() * res; // D(L^*P) res = vectorD().asDiagonal() * res; // L(DL^*P) res = matrixL() * res; // P^T (LDL^*P) res = transpositionsP().transpose() * res; return res; } /** \cholesky_module * \returns the Cholesky decomposition with full pivoting without square root of \c *this */ template<typename MatrixType, unsigned int UpLo> inline const LDLT<typename SelfAdjointView<MatrixType, UpLo>::PlainObject, UpLo> SelfAdjointView<MatrixType, UpLo>::ldlt() const { return LDLT<PlainObject, UpLo>(m_matrix); } /** \cholesky_module * \returns the Cholesky decomposition with full pivoting without square root of \c *this */ template<typename Derived> inline const LDLT<typename MatrixBase<Derived>::PlainObject> MatrixBase<Derived>::ldlt() const { return LDLT<PlainObject>(derived()); } #endif // EIGEN_LDLT_H
package tupa; import java.io.Serializable; import javafx.beans.property.IntegerProperty; import javafx.beans.property.<API key>; import javafx.beans.property.<API key>; import javafx.beans.property.StringProperty; /** * * @author Marianne */ public class Maali implements Serializable { private static int laskuri; private int id; private Pelaaja maalintekija; private Pelaaja syottaja; private Ottelu ottelu; private int aika; //taulukkoattribuutut private transient IntegerProperty taulukkoaika = new <API key>(); private transient StringProperty <API key> = new <API key>(); private transient StringProperty taulukkosyottaja = new <API key>(); private transient StringProperty taulukkojoukkue = new <API key>(); Maali(){ laskuri++; id = laskuri; } Maali(Ottelu ottelu){ this.ottelu = ottelu; laskuri++; id = laskuri; } public void asetaID(int id){ this.id = id; } public int annaID(){ return id; } public void asetaTiedot(int aika, Pelaaja maalintekija, Pelaaja syottaja){ this.aika = aika; this.maalintekija = maalintekija; this.maalintekija.annaKaikkiMaalit().add(this); this.syottaja = syottaja; this.syottaja.annaKaikkiMaalit().add(this); this.ottelu.annaMaalit().add(this); } public void asetaAika(int aika){ this.aika = aika; } public int annaAika(){ return aika; } public Pelaaja annaMaalinTekija(){ return maalintekija; } public Pelaaja annaSyottaja(){ return syottaja; } public void asetaMaalinTekija(Pelaaja maalintekija){ this.maalintekija = maalintekija; this.maalintekija.annaKaikkiMaalit().add(this); } public void asetaSyottaja(Pelaaja syottaja){ this.syottaja = syottaja; this.syottaja.annaKaikkiMaalit().add(this); } public Ottelu annaOttelu(){ return ottelu; } public StringProperty <API key>() { return <API key>; } public void <API key>() { this.<API key> = new <API key>(this.annaMaalinTekija().toString()); } public StringProperty <API key>() { return taulukkosyottaja; } public void <API key>() { this.taulukkosyottaja = new <API key>(this.annaSyottaja().toString()); } public StringProperty <API key>() { return taulukkojoukkue; } public void <API key>() { if(annaMaalinTekija().equals("Oma maali")){ this.taulukkojoukkue = new <API key>("-"); } else{ this.taulukkojoukkue = new <API key>(this.annaMaalinTekija().annaJoukkue().toString()); } } public IntegerProperty <API key>() { return taulukkoaika; } public void asetaTaulukkoaika() { this.taulukkoaika = new <API key>(this.annaAika()); } }
#ifndef TMX_PARSER_H #define TMX_PARSER_H #include <string> #include "map.h" #include "tinyxml2.h" #include "<API key>.h" #include "xml-exception.h" #include "<API key>.h" namespace tmx { /*! \brief A TMX parser that retrieves information from XML using Tinyxml2 library. */ class Parser { public: /*! \brief Main function. Parse the given TMX XML file into a TMX object representation. \param filePath The path of the XML file. */ static tmx::Map parseFile(std::string filePath); private: /*! \brief Load the XML file into a XML document. \param tmxDoc The XMLDocument where the XML must be loaded. \param filePath The path of the XML file. */ static void loadFile(tinyxml2::XMLDocument & tmxDoc, std::string filePath); /*! \brief A tool function that retrieve the full directory path of a given file. \param filePath The file path. */ static std::string getFileDirectory(std::string filePath); /*! \brief Extracts numbers from the given CSV. \param data The string that contains the CSV. \return A vector of numbers found in data. */ static std::vector<unsigned int> parseCsv(std::string data); }; } #endif /* TMX_PARSER_H */
from ipywidgets import DOMWidget, register from traitlets import Bool, Dict, Instance, Integer, Unicode, observe, Float from aipython.searchProblem import <API key> from ... import __version__ from .searchjsonbridge import (<API key>, <API key>, <API key>) @register class SearchBuilder(DOMWidget): """A Jupyter widget that allows for visual creation of an explicit search problem. See the accompanying frontend file: `js/src/search/SearchBuilder.ts` """ _view_name = Unicode('SearchBuilder').tag(sync=True) _model_name = Unicode('SearchBuilderModel').tag(sync=True) _view_module = Unicode('aispace2').tag(sync=True) _model_module = Unicode('aispace2').tag(sync=True) <API key> = Unicode(__version__).tag(sync=True) <API key> = Unicode(__version__).tag(sync=True) # The explicit search problem that is synced to the frontend. graph = Instance(klass=<API key>, allow_none=True).tag(sync=True, from_json=<API key>, to_json=<API key>) # True if the visualization should show edge costs. show_edge_costs = Bool(True).tag(sync=True) # True if a node's heuristic value should be shown. <API key> = Bool(False).tag(sync=True) text_size = Integer(12).tag(sync=True) line_width = Float(1.0).tag(sync=True) detail_level = Integer(2).tag(sync=True) def __init__(self, search_problem=None): super().__init__() self.graph = search_problem def py_code(self, need_positions=False): """Prints the search problem represented by Python code. """ print(<API key>(self.graph, need_positions))
<!DOCTYPE html PUBLIC "- <html> <head> <title>Singular 2-0-4 Manual: 5.1.81 nameof</title> <meta name="description" content="Singular 2-0-4 Manual: 5.1.81 nameof"> <meta name="keywords" content="Singular 2-0-4 Manual: 5.1.81 nameof"> <meta name="resource-type" content="document"> <meta name="distribution" content="global"> <meta name="Generator" content="texi2html"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <style type="text/css"> <! a.summary-letter {text-decoration: none} blockquote.smallquotation {font-size: smaller} div.display {margin-left: 3.2em} div.example {margin-left: 3.2em} div.lisp {margin-left: 3.2em} div.smalldisplay {margin-left: 3.2em} div.smallexample {margin-left: 3.2em} div.smalllisp {margin-left: 3.2em} pre.display {font-family: serif} pre.format {font-family: serif} pre.menu-comment {font-family: serif} pre.menu-preformatted {font-family: serif} pre.smalldisplay {font-family: serif; font-size: smaller} pre.smallexample {font-size: smaller} pre.smallformat {font-family: serif; font-size: smaller} pre.smalllisp {font-size: smaller} span.nocodebreak {white-space:pre} span.nolinebreak {white-space:pre} span.roman {font-family:serif; font-weight:normal} span.sansserif {font-family:sans-serif; font-weight:normal} ul.no-bullet {list-style: none} </style> </head> <body lang="en" background="../singular_images/Mybg.png"> <a name="nameof"></a> <table border="0" cellpadding="0" cellspacing="0"> <tr valign="top"> <td align="left"> <table class="header" cellpadding="1" cellspacing="1" border="0"> <tr valign="top" align="left"> <td valign="middle" align="left"> <a href="index.htm"><img src="../singular_images/<API key>.png" width="50" border="0" alt="Top"></a> </td> </tr> <tr valign="top" align="left"> <td valign="middle" align="left"><a href="mult.html#mult" title="Previous section in reading order"><img src="../singular_images/a_left.png" border="0" alt="Back: 5.1.80 mult" align="middle"></a></td> </tr> <tr valign="top" align="left"> <td valign="middle" align="left"><a href="names.html#names" title="Next section in reading order"><img src="../singular_images/a_right.png" border="0" alt="Forward: 5.1.82 names" align="middle"></a></td> </tr> <tr valign="top" align="left"> <td valign="middle" align="left"><a href="<API key>.html#<API key>" title="Beginning of this chapter or previous chapter"><img src="../singular_images/a_leftdouble.png" border="0" alt="FastBack: 5 Functions and system variables" align="middle"></a></td> </tr> <tr valign="top" align="left"> <td valign="middle" align="left"><a href="Tricks-and-pitfalls.html#Tricks-and-pitfalls" title="Next chapter"><img src="../singular_images/a_rightdouble.png" border="0" alt="FastForward: 6 Tricks and pitfalls" align="middle"></a></td> </tr> <tr valign="top" align="left"> <td valign="middle" align="left"><a href="Functions.html#Functions" title="Up section"><img src="../singular_images/a_up.png" border="0" alt="Up: 5.1 Functions" align="middle"></a></td> </tr> <tr valign="top" align="left"> <td valign="middle" align="left"><a href="index.htm#Preface" title="Cover (top) of document"><img src="../singular_images/a_top.png" border="0" alt="Top: 1 Preface" align="middle"></a></td> </tr> <tr valign="top" align="left"> <td valign="middle" align="left"><a href="sing_toc.htm#SEC_Contents" title="Table of contents"><img src="../singular_images/a_tableofcon.png" border="0" alt="Contents: Table of Contents" align="middle"></a></td> </tr> <tr valign="top" align="left"> <td valign="middle" align="left"><a href="Index.html#Index" title="Index"><img src="../singular_images/a_index.png" border="0" alt="Index: F Index" align="middle"></a></td> </tr> <tr valign="top" align="left"> <td valign="middle" align="left"><a href="sing_abt.htm#SEC_About" title="About (help)"><img src="../singular_images/a_help.png" border="0" alt="About: About This Document" align="middle"></a></td> </tr> </table> </td> <td align="left"> <a name="nameof-1"></a> <h3 class="subsection">5.1.81 nameof</h3> <a name="index-nameof"></a> <dl compact="compact"> <dt><code><strong>Syntax:</strong></code></dt> <dd><p><code>nameof (</code> expression <code>)</code> </p></dd> <dt><code><strong>Type:</strong></code></dt> <dd><p>string </p></dd> <dt><code><strong>Purpose:</strong></code></dt> <dd><p>returns the name of an expression as string. </p></dd> <dt><code><strong>Example:</strong></code></dt> <dd><div class="smallexample"> <pre class="smallexample"> int i=9; string s=nameof(i); s; &rarr; i nameof(s); &rarr; s nameof(i+1); //returns the empty string: &rarr; nameof(basering); &rarr; basering basering; &rarr; ? `basering` is undefined &rarr; ? error occurred in line 7: ` basering;` ring r; nameof(basering); &rarr; r </pre></div> </dd> </dl> <p>See <a href="names.html#names">names</a>; <a href="reservedName.html#reservedName">reservedName</a>; <a href="typeof.html#typeof">typeof</a>. </p></td> </tr> </table> <hr> <table class="header" cellpadding="1" cellspacing="1" border="0"> <tr><td valign="middle" align="left"> <a href="index.htm"><img src="../singular_images/<API key>.png" width="50" border="0" alt="Top"></a> </td> <td valign="middle" align="left"><a href="mult.html#mult" title="Previous section in reading order"><img src="../singular_images/a_left.png" border="0" alt="Back: 5.1.80 mult" align="middle"></a></td> <td valign="middle" align="left"><a href="names.html#names" title="Next section in reading order"><img src="../singular_images/a_right.png" border="0" alt="Forward: 5.1.82 names" align="middle"></a></td> <td valign="middle" align="left"><a href="<API key>.html#<API key>" title="Beginning of this chapter or previous chapter"><img src="../singular_images/a_leftdouble.png" border="0" alt="FastBack: 5 Functions and system variables" align="middle"></a></td> <td valign="middle" align="left"><a href="Tricks-and-pitfalls.html#Tricks-and-pitfalls" title="Next chapter"><img src="../singular_images/a_rightdouble.png" border="0" alt="FastForward: 6 Tricks and pitfalls" align="middle"></a></td> <td valign="middle" align="left"><a href="Functions.html#Functions" title="Up section"><img src="../singular_images/a_up.png" border="0" alt="Up: 5.1 Functions" align="middle"></a></td> <td valign="middle" align="left"><a href="index.htm#Preface" title="Cover (top) of document"><img src="../singular_images/a_top.png" border="0" alt="Top: 1 Preface" align="middle"></a></td> <td valign="middle" align="left"><a href="sing_toc.htm#SEC_Contents" title="Table of contents"><img src="../singular_images/a_tableofcon.png" border="0" alt="Contents: Table of Contents" align="middle"></a></td> <td valign="middle" align="left"><a href="Index.html#Index" title="Index"><img src="../singular_images/a_index.png" border="0" alt="Index: F Index" align="middle"></a></td> <td valign="middle" align="left"><a href="sing_abt.htm#SEC_About" title="About (help)"><img src="../singular_images/a_help.png" border="0" alt="About: About This Document" align="middle"></a></td> </tr></table> <font size="-1"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; User manual for <a href="http: generated by <a href="http: </font> </body> </html>
package com.aurel.track.item; import java.util.ArrayList; import java.util.List; import com.aurel.track.accessControl.AccessBeans; import com.aurel.track.admin.customize.treeConfig.field.FieldDesignBL; import com.aurel.track.admin.project.ProjectBL; import com.aurel.track.admin.user.person.PersonBL; import com.aurel.track.beans.TWorkItemBean; import com.aurel.track.fieldType.constants.SystemFields; import com.aurel.track.fieldType.runtime.base.WorkItemContext; import com.aurel.track.item.action.IPluginItemAction; import com.aurel.track.item.action.ItemActionUtil; import com.aurel.track.item.action.<API key>; import com.aurel.track.json.JSONUtility; import com.aurel.track.plugin.<API key>; import com.aurel.track.prop.ApplicationBean; import com.aurel.track.screen.SystemActions; import com.aurel.track.toolbar.ToolbarItem; public class ToolbarBL { public static List<ToolbarItem> getPrintItemToolbar(ApplicationBean appBean,Integer personID, WorkItemContext workItemContext,String forwardAction){ TWorkItemBean workItem=workItemContext.getWorkItemBean(); boolean originator=false; Integer projectID=workItem.getProjectID(); boolean projectActive = ProjectBL.projectIsActive(projectID); originator=workItem.getOriginatorID().equals(personID); List<ToolbarItem> list=new ArrayList<ToolbarItem>(); boolean allowedToChange = AccessBeans.isAllowedToChange(workItem,personID); boolean allowedToCreate = AccessBeans.isAllowedToCreate(personID,workItem.getProjectID(), workItem.getListTypeID()); ToolbarItem item; int[] actions=new int[]{SystemActions.EDIT, SystemActions.COPY,SystemActions.MOVE, SystemActions.CHANGE_STATUS,SystemActions.NEW_CHILD,SystemActions.NEW_LINKED_ITEM }; for (int i = 0; i < actions.length; i++) { item=new ToolbarItem(); item.setId(ToolbarItem.ITEM_ACTION); int action = actions[i]; <API key> actionDescriptor= ItemActionUtil.getDescriptor(action + ""); boolean condition=true; if(actionDescriptor.getTheClassName()!=null){ IPluginItemAction itemActionPlugin=ItemActionUtil.getPlugin(actionDescriptor.getTheClassName()); condition=itemActionPlugin.isEnabled(personID, workItem, allowedToChange, allowedToCreate,appBean.getEdition()); } if (action==SystemActions.MOVE || action==SystemActions.NEW_CHILD || action==SystemActions.NEW_LINKED_ITEM) { item.setMore(true); } item.setCondition(condition); item.setCssClass(actionDescriptor.getCssClass()); item.setTooltipKey(actionDescriptor.getTooltipKey()); item.setLabelKey(actionDescriptor.getLabelKey()); item.setImageInactive(actionDescriptor.getImageInactive()); StringBuilder sb=new StringBuilder(); sb.append("{"); JSONUtility.appendIntegerValue(sb,"actionID",actions[i],true); sb.append("}"); item.setJsonData(sb.toString()); list.add(item); } //sibling item=new ToolbarItem(); item.setId(ToolbarItem.SIBLING); item.setMore(true); item.setCondition(allowedToCreate&&enabledAddSibling(workItem,allowedToChange, allowedToCreate, appBean.getEdition(),personID)); Integer parentID=null; if(workItem!=null){ parentID=workItem.getSuperiorworkitem(); } item.setCssClass("<API key>"); item.setTooltipKey("common.btn.addSibling.tt"); item.setLabelKey("common.btn.addSibling"); item.setImageInactive("addSibling-inactive.png"); StringBuilder sb=new StringBuilder(); sb.append("{"); JSONUtility.appendIntegerValue(sb,"parentID",parentID); JSONUtility.appendIntegerValue(sb,"actionID",+SystemActions.NEW_CHILD,true); sb.append("}"); item.setJsonData(sb.toString()); list.add(item); //chooseParent item=new ToolbarItem(); item.setId(ToolbarItem.CHOOSE_PARENT); item.setMore(true); item.setCondition(enableSetParent(appBean,allowedToChange,personID,projectActive)); item.setCssClass("itemAction_parent"); item.setTooltipKey("common.btn.chooseParent.tt"); item.setLabelKey("common.btn.chooseParent"); item.setImageInactive("parent-inactive.gif"); list.add(item); //print item=new ToolbarItem(); item.setId(ToolbarItem.PRINT); item.setMore(true); item.setCondition(true); item.setCssClass("itemAction_print"); item.setTooltipKey("common.btn.printIssue.tt"); item.setLabelKey("common.btn.printIssue"); item.setImageInactive("printIssue.gif"); list.add(item); //print with children //TODO fix me if (ItemBL.hasChildren(workItem.getObjectID())) { item=new ToolbarItem(); item.setMore(true); item.setId(ToolbarItem.PRINT_WITH_CHILDREN); item.setCondition(true); item.setCssClass("itemAction_printwc"); item.setTooltipKey("common.btn.<API key>.tt"); item.setLabelKey("common.btn.<API key>"); item.setImageInactive("printIssue.gif"); list.add(item); } //accessLevel boolean <API key> = FieldDesignBL.isDeprecated(SystemFields.INTEGER_ACCESSLEVEL); if (!<API key> && originator && projectActive && allowedToChange) { item=new ToolbarItem(); item.setId(ToolbarItem.ACCESS_LEVEL); item.setMore(true); item.setCondition(true); if(workItem.isAccessLevelFlag()){ item.setCssClass("itemAction_unlock"); item.setTooltipKey("common.btn.unlock.tt"); item.setLabelKey("common.btn.unlock"); item.setImageInactive("unlock-inactive.gif"); }else{ item.setCssClass("itemAction_lock"); item.setTooltipKey("common.btn.lock.tt"); item.setLabelKey("common.btn.lock"); item.setImageInactive("lock-inactive.gif"); } list.add(item); } boolean admin=PersonBL.isProjectAdmin(personID, workItem.getProjectID()); if(admin){ if(workItem.isArchived()){ //archive item=new ToolbarItem(); item.setId(ToolbarItem.ARCHIVE); item.setMore(true); item.setCondition(true); item.setCssClass("<API key>"); item.setTooltipKey("common.btn.unarchive.tt"); item.setLabelKey("common.btn.unarchive"); list.add(item); }else{ if(workItem.isDeleted()){ item=new ToolbarItem(); item.setId(ToolbarItem.DELETE); item.setMore(true); item.setCondition(true); item.setCssClass("itemAction_undelete"); item.setTooltipKey("common.btn.undelete.tt"); item.setLabelKey("common.btn.undelete"); list.add(item); }else{ item=new ToolbarItem(); item.setId(ToolbarItem.ARCHIVE); item.setMore(true); item.setCondition(true); item.setCssClass("itemAction_archive"); item.setTooltipKey("common.btn.archive.tt"); item.setLabelKey("common.btn.archive"); list.add(item); item=new ToolbarItem(); item.setId(ToolbarItem.DELETE); item.setMore(true); item.setCondition(true); item.setCssClass("itemAction_delete"); item.setTooltipKey("common.btn.delete.tt"); item.setLabelKey("common.btn.delete"); list.add(item); } } } //mail item=new ToolbarItem(); item.setId(ToolbarItem.MAIL); item.setCondition(allowedToChange); item.setCssClass("itemAction_email"); item.setTooltipKey("common.btn.sendEmail"); item.setLabelKey("common.btn.sendEmail"); item.setImageInactive("email-inactive.gif"); list.add(item); //back item=new ToolbarItem(); item.setId(ToolbarItem.BACK); if(forwardAction!=null&&forwardAction.length()>0&&!forwardAction.equals("null")){ item.setCondition(true); }else{ item.setCondition(false); } item.setCssClass("itemAction_back"); item.setTooltipKey("common.btn.back.tt"); item.setLabelKey("common.btn.back"); item.setImageInactive("backward-inactive.gif"); list.add(item); return list; } public static List<ToolbarItem> getEditToolbars(ApplicationBean appBean,Integer personID, TWorkItemBean workItem,String forwardAction,Integer actionID){ boolean create=(workItem.getObjectID()==null); Integer projectID=workItem.getProjectID(); boolean projectActive = ProjectBL.projectIsActive(projectID); List<ToolbarItem> list=new ArrayList<ToolbarItem>(); ToolbarItem item; //save item=new ToolbarItem(); item.setId(ToolbarItem.SAVE); item.setCondition(true); item.setCssClass("itemAction_save"); item.setTooltipKey("common.btn.save"); item.setLabelKey("common.btn.save"); item.setImageInactive("save-inactive.gif"); list.add(item); //reset //cancel item=new ToolbarItem(); item.setId(ToolbarItem.CANCEL); item.setCondition(true); item.setCssClass("itemAction_cancel"); item.setTooltipKey("common.btn.cancel"); item.setLabelKey("common.btn.cancel"); item.setImageInactive("cancel-inactive.gif"); list.add(item); //printitem if(actionID.intValue()==SystemActions.EDIT||actionID.intValue()==SystemActions.NEW){ //attachments //chooseParent item=new ToolbarItem(); item.setId(ToolbarItem.CHOOSE_PARENT); item.setCondition(enableSetParent(appBean,true,personID,projectActive)); String titleChooseParent="chooseParent.title"; item.setCssClass("itemAction_parent"); item.setTooltipKey("common.btn.chooseParent.tt"); item.setLabelKey("common.btn.chooseParent"); item.setImageInactive("parent-inactive.gif"); list.add(item); } if(actionID.intValue()==SystemActions.EDIT){ //print item=new ToolbarItem(); item.setId(ToolbarItem.PRINT); item.setCondition(true); item.setCssClass("itemAction_print"); item.setTooltipKey("common.btn.printIssue.tt"); item.setLabelKey("common.btn.printIssue"); item.setImageInactive("printIssue.gif"); list.add(item); //mail item=new ToolbarItem(); item.setId(ToolbarItem.MAIL); item.setCondition(true); item.setCssClass("itemAction_email"); item.setTooltipKey("common.btn.sendEmail"); item.setLabelKey("common.btn.sendEmail"); item.setImageInactive("email-inactive.gif"); list.add(item); } return list; } private static boolean enableSetParent(ApplicationBean appBean,boolean allowedToChange,Integer personID,boolean projectActive){ return allowedToChange && appBean.getEdition()>=2 && projectActive; } private static boolean enabledAddSibling(TWorkItemBean workItem,boolean allowedToChange, boolean allowedToCreate, int appEdition, Integer personID){ if (workItem==null || workItem.getSuperiorworkitem()==null) { return false; } TWorkItemBean workItemBeanParent = null; try { workItemBeanParent = ItemBL.loadWorkItem(workItem.getSuperiorworkitem()); } catch (ItemLoaderException e) { } if (workItemBeanParent!=null) { <API key> <API key> = new <API key>(); return <API key>.isEnabled(personID, workItemBeanParent, allowedToChange, allowedToCreate, appEdition); } return false; } }
#include <tsload/mempool.h> #include <tsload/hashmap.h> #include <genmodsrc.h> #include <stdio.h> const char* var_namespace = NULL; mp_cache_t var_cache; DECLARE_HASH_MAP(var_hash_map, B_FALSE, modvar_t, VARHASHSIZE, v_name, v_next, { modvar_name_t* vn = (modvar_name_t*) key; unsigned ns_hash = 0; if(vn->ns != NULL) ns_hash = hm_string_hash(vn->ns, VARHASHMASK); return ns_hash ^ hm_string_hash(vn->name, VARHASHMASK); }, { modvar_name_t* vn1 = (modvar_name_t*) key1; modvar_name_t* vn2 = (modvar_name_t*) key2; if((vn1->ns != NULL && vn2->ns == NULL) || (vn1->ns == NULL && vn2->ns != NULL)) return B_FALSE; if(vn1->ns != NULL && vn2->ns != NULL && strcmp(vn1->ns, vn2->ns) != 0) return B_FALSE; return strcmp(vn1->name, vn2->name) == 0; } ) modvar_t* modvar_create_impl(int nametype, const char* name) { modvar_t* var = mp_cache_alloc(&var_cache); if(var == NULL) return NULL; aas_init(&var->v_name.ns); if(var_namespace) { aas_copy(&var->v_name.ns, var_namespace); } /* To save allocations, modvar_create() passes name directly to var->name and sets nametype.*/ if(likely(nametype == AAS_STATIC)) aas_set_impl(&var->v_name.name, name); else aas_copy(aas_init(&var->v_name.name), name); var->v_type = VAR_UNKNOWN; var->v_next = NULL; if(hash_map_insert(&var_hash_map, var) != HASH_MAP_OK) { fprintf(stderr, "WARNING: variable '%s' already exists in namespace '%s'\n", var->v_name.name, (var_namespace == NULL) ? "(global)" : var_namespace); modvar_destroy(var); return NULL; } return var; } void modvar_destroy(modvar_t* var) { switch(var->v_type) { case VAR_STRING: aas_free(&var->v_value.str); break; case VAR_GENERATOR: { mod_valgen_t* vg = &var->v_value.gen; if(vg->dtor) vg->dtor(vg->arg); } break; case VAR_STRING_LIST: { int i; mod_strlist_t* sl = &var->v_value.sl; for(i = 0; i < sl->sl_count; ++i) { aas_free(&sl->sl_list[i]); } mp_free(sl->sl_list); } break; } aas_free(&var->v_name.ns); aas_free(&var->v_name.name); mp_cache_free(&var_cache, var); } modvar_t* modvar_printf(modvar_t* var, const char* fmtstr, ...) { va_list va; if(var == NULL) return NULL; va_start(va, fmtstr); aas_vprintf(&var->v_value.str, fmtstr, va); va_end(va); var->v_type = VAR_STRING; return var; } modvar_t* modvar_set_gen(modvar_t* var, <API key> valgen, modsrc_dtor_func dtor, void* arg) { mod_valgen_t* vg; if(var == NULL) return NULL; vg = &var->v_value.gen; vg->valgen = valgen; vg->dtor = dtor; vg->arg = arg; var->v_type = VAR_GENERATOR; return var; } modvar_t* modvar_set_strlist(modvar_t* var, int count) { mod_strlist_t* sl; int i; if(var == NULL) return NULL; sl = &var->v_value.sl; sl->sl_count = count; sl->sl_list = mp_malloc(count * sizeof(char*)); for(i = 0; i < count; ++i) { aas_init(&sl->sl_list[i]); } var->v_type = VAR_STRING_LIST; return var; } modvar_t* modvar_add_string(modvar_t* var, int i, const char* str) { mod_strlist_t* sl; if(var == NULL || var->v_type != VAR_STRING_LIST) return NULL; sl = &var->v_value.sl; if(i > sl->sl_count) return NULL; aas_copy(&sl->sl_list[i], str); return var; } modvar_t* modvar_get(const char* name) { modvar_name_t vn; modvar_t* var; /* Variables kept in var hash table should use autostrings but in our case we only need search criteria, so hack our way by using direct values of constant strings. */ vn.ns = (char*) var_namespace; vn.name = (char*) name; /* Search in local namespace */ var = hash_map_find(&var_hash_map, &vn); if(var != NULL) return var; /* Try global namespace */ vn.ns = NULL; return hash_map_find(&var_hash_map, &vn); } const char* modvar_get_string(const char* name) { modvar_t* var = modvar_get(name); if(var == NULL || var->v_type != VAR_STRING) return NULL; return var->v_value.str; } void* modvar_get_arg(const char* name) { modvar_t* var = modvar_get(name); if(var == NULL || var->v_type != VAR_GENERATOR) return NULL; return var->v_value.gen.arg; } mod_valgen_t* modvar_get_valgen(const char* name) { modvar_t* var = modvar_get(name); if(var == NULL || var->v_type != VAR_GENERATOR) return NULL; return &var->v_value.gen; } mod_strlist_t* modvar_get_strlist(const char* name) { modvar_t* var = modvar_get(name); if(var == NULL || var->v_type != VAR_STRING_LIST) return NULL; return &var->v_value.sl; } int modvar_unset(const char* name) { modvar_t* var = modvar_get(name); if(var == NULL) return MODVAR_NOTFOUND; hash_map_remove(&var_hash_map, var); modvar_destroy(var); return MODVAR_OK; } boolean_t modvar_is_set(const char* name) { modvar_t* var = modvar_get(name); if(var == NULL) return B_TRUE; return B_FALSE; } static int modvar_dump(hm_item_t* object, void* arg) { modvar_t* var = (modvar_t*) object; if(var->v_name.ns != NULL) fprintf(stdout, "%s:", var->v_name.ns); fputs(var->v_name.name, stdout); switch(var->v_type) { case VAR_UNKNOWN: fputs(" [unknown]\n", stdout); break; case VAR_STRING: fprintf(stdout, "=%s\n", var->v_value.str); break; case VAR_STRING_LIST: fputs(" [stringlist]\n", stdout); break; case VAR_GENERATOR: fputs(" [generator]\n", stdout); break; default: fputs(" [???]\n", stdout); break; } return HM_WALKER_CONTINUE; } void modsrc_dump_vars(void) { hash_map_walk(&var_hash_map, modvar_dump, NULL); } int modsrc_init(void) { mp_cache_init(&var_cache, modvar_t); hash_map_init(&var_hash_map, "var_hash_map"); return 0; } static int <API key>(hm_item_t* object, void* arg) { modvar_destroy((modvar_t*) object); return HM_WALKER_REMOVE | HM_WALKER_CONTINUE; } void modsrc_fini(void) { hash_map_walk(&var_hash_map, <API key>, NULL); hash_map_destroy(&var_hash_map); mp_cache_destroy(&var_cache); }
<?php $proper_name = 'Counseling Check In'; $version = '3.1.1'; $import_sql = false; $image_dir = true;
/* Declare Elf Archer */ var ELF_WISP = function( char_w,char_h,object_No,max_w,max_h,belong,loc_x,loc_y ){ MINION.call(this,char_w,char_h,object_No,max_w,max_h,belong,loc_x,loc_y); /* constructor */ this.src_frame_w = 320; this.src_frame_h = 320; this.picture_frame = 6; // Adjust size this.scale = 1; this.boundary_x = max_w; this.boundary_y = max_h; this.direction = -1; // Stop this.vx = 0; this.vy = 0; // Recording previous x,y location this.pre_x = loc_x; this.pre_y = loc_y; this.x_unit = char_w; this.y_unit = char_h; this.object_No = object_No; // Use for detective ( Convenience to distinguish ) // sound effect var summon = new Howl({ src: ['elf/elf_wisp_summon.mp3'], loop: false }); summon.play(); this.sound = new Howl({ src: ['elf/elf_wisp_walking.mp3'], loop: true, volume: 0.5 }); this.atk_sound = new Howl({ src: ['elf/elf_wisp_attack.mp3'], loop: true, volume: 0.1 }); // Health Bar this.hp = new HealthBar((3/2)*char_w*this.scale,10); // this.hp_unit = Math.ceil(((3/2)*char_w*this.scale)/100); this.hp_unit = (((3/2)*char_w*this.scale)/100); /* Using belong to choose the target (distinguish different players) texture */ if(belong == 'p1'){ /* setting path to p1 image */ this.image_url = "minion/elf/elf_wisp.png"; } else{ /* FIXME: setting path to p2 image */ this.image_url = "minion/elf/elf_wisp_p2.png"; } var texture = new PIXI.Texture(PIXI.BaseTexture.fromImage(this.image_url)); texture.frame = (new PIXI.Rectangle(0,0,this.src_frame_w,this.src_frame_h)); var result = new PIXI.Sprite(texture); result.width = char_w*this.scale; result.height = char_h*this.scale; result.x = 0; result.y = 0; this.basic_velocity_x = 0.5; this.basic_velocity_y = 0.5; this.velocity_rate = 3; this.obj = result; /* Setting character direction in image source location */ this.left = 2; this.right = 0; this.top = 2; this.down = 0; this.left_top = 2; this.left_down = 2; this.right_top = 0; this.right_down = 0; this.left_atk = 3; this.right_atk = 1; } ELF_WISP.prototype = Object.create(MINION.prototype); ELF_WISP.prototype.constructor = ELF_WISP;
<?php defined('_JEXEC') or die; $com_path = JPATH_SITE . '/components/com_content/'; require_once $com_path . 'helpers/route.php'; JModelLegacy::addIncludePath($com_path . '/models', 'ContentModel'); /** * Helper for <API key> * * @package Joomla.Site * @subpackage <API key> * * @since 1.6 */ abstract class <API key> { /** * Get a list of articles from a specific category * * @param \Joomla\Registry\Registry &$params object holding the models parameters * * @return mixed * * @since 1.6 */ public static function getList(&$params) { // Get an instance of the generic articles model $articles = JModelLegacy::getInstance('Articles', 'ContentModel', array('ignore_request' => true)); // Set application parameters in model $app = JFactory::getApplication(); $appParams = $app->getParams(); $articles->setState('params', $appParams); // Set the filters based on the module params $articles->setState('list.start', 0); $articles->setState('list.limit', (int) $params->get('count', 0)); $articles->setState('filter.published', 1); // Access filter $access = !JComponentHelper::getParams('com_content')->get('show_noauth'); $authorised = JAccess::get<API key>(JFactory::getUser()->get('id')); $articles->setState('filter.access', $access); // Prep for Normal or Dynamic Modes $mode = $params->get('mode', 'normal'); switch ($mode) { case 'dynamic' : $option = $app->input->get('option'); $view = $app->input->get('view'); if ($option === 'com_content') { switch ($view) { case 'category' : $catids = array($app->input->getInt('id')); break; case 'categories' : $catids = array($app->input->getInt('id')); break; case 'article' : if ($params->get('<API key>', 1)) { $article_id = $app->input->getInt('id'); $catid = $app->input->getInt('catid'); if (!$catid) { // Get an instance of the generic article model $article = JModelLegacy::getInstance('Article', 'ContentModel', array('ignore_request' => true)); $article->setState('params', $appParams); $article->setState('filter.published', 1); $article->setState('article.id', (int) $article_id); $item = $article->getItem(); $catids = array($item->catid); } else { $catids = array($catid); } } else { // Return right away if <API key> option is off return; } break; case 'featured' : default: // Return right away if not on the category or article views return; } } else { // Return right away if not on a com_content page return; } break; case 'normal' : default: $catids = $params->get('catid'); $articles->setState('filter.category_id.include', (bool) $params->get('<API key>', 1)); break; } // Category filter if ($catids) { if ($params->get('<API key>', 0) && (int) $params->get('levels', 0) > 0) { // Get an instance of the generic categories model $categories = JModelLegacy::getInstance('Categories', 'ContentModel', array('ignore_request' => true)); $categories->setState('params', $appParams); $levels = $params->get('levels', 1) ? $params->get('levels', 1) : 9999; $categories->setState('filter.get_children', $levels); $categories->setState('filter.published', 1); $categories->setState('filter.access', $access); $additional_catids = array(); foreach ($catids as $catid) { $categories->setState('filter.parentId', $catid); $recursive = true; $items = $categories->getItems($recursive); if ($items) { foreach ($items as $category) { $condition = (($category->level - $categories->getParent()->level) <= $levels); if ($condition) { $additional_catids[] = $category->id; } } } } $catids = array_unique(array_merge($catids, $additional_catids)); } $articles->setState('filter.category_id', $catids); } // Ordering $articles->setState('list.ordering', $params->get('article_ordering', 'a.ordering')); $articles->setState('list.direction', $params->get('<API key>', 'ASC')); // New Parameters $articles->setState('filter.featured', $params->get('show_front', 'show')); $articles->setState('filter.author_id', $params->get('created_by', "")); $articles->setState('filter.author_id.include', $params->get('<API key>, 1)); $articles->setState('filter.author_alias', $params->get('created_by_alias', "")); $articles->setState('filter.author_alias.include', $params->get('<API key>, 1)); $excluded_articles = $params->get('excluded_articles', ''); if ($excluded_articles) { $excluded_articles = explode("\r\n", $excluded_articles); $articles->setState('filter.article_id', $excluded_articles); // Exclude $articles->setState('filter.article_id.include', false); } $date_filtering = $params->get('date_filtering', 'off'); if ($date_filtering !== 'off') { $articles->setState('filter.date_filtering', $date_filtering); $articles->setState('filter.date_field', $params->get('date_field', 'a.created')); $articles->setState('filter.start_date_range', $params->get('start_date_range', '1000-01-01 00:00:00')); $articles->setState('filter.end_date_range', $params->get('end_date_range', '9999-12-31 23:59:59')); $articles->setState('filter.relative_date', $params->get('relative_date', 30)); } // Filter by language $articles->setState('filter.language', $app->getLanguageFilter()); $items = $articles->getItems(); // Display options $show_date = $params->get('show_date', 0); $show_date_field = $params->get('show_date_field', 'created'); $show_date_format = $params->get('show_date_format', 'Y-m-d H:i:s'); $show_category = $params->get('show_category', 0); $show_hits = $params->get('show_hits', 0); $show_author = $params->get('show_author', 0); $show_introtext = $params->get('show_introtext', 0); $introtext_limit = $params->get('introtext_limit', 100); // Find current Article ID if on an article page $option = $app->input->get('option'); $view = $app->input->get('view'); if ($option === 'com_content' && $view === 'article') { $active_article_id = $app->input->getInt('id'); } else { $active_article_id = 0; } // Prepare data for display using display options foreach ($items as &$item) { $item->slug = $item->id . ':' . $item->alias; $item->catslug = $item->catid . ':' . $item->category_alias; if ($access || in_array($item->access, $authorised)) { // We know that user has the privilege to view the article $item->link = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language)); } else { $app = JFactory::getApplication(); $menu = $app->getMenu(); $menuitems = $menu->getItems('link', 'index.php?option=com_users&view=login'); if (isset($menuitems[0])) { $Itemid = $menuitems[0]->id; } elseif ($app->input->getInt('Itemid') > 0) { // Use Itemid from requesting page only if there is no existing menu $Itemid = $app->input->getInt('Itemid'); } $item->link = JRoute::_('index.php?option=com_users&view=login&Itemid=' . $Itemid); } // Used for styling the active article $item->active = $item->id == $active_article_id ? 'active' : ''; $item->displayDate = ''; if ($show_date) { $item->displayDate = JHTML::_('date', $item->$show_date_field, $show_date_format); } if ($item->catid) { $item->displayCategoryLink = JRoute::_(ContentHelperRoute::getCategoryRoute($item->catid)); $item-><API key> = $show_category ? '<a href="' . $item->displayCategoryLink . '">' . $item->category_title . '</a>' : ''; } else { $item-><API key> = $show_category ? $item->category_title : ''; } $item->displayHits = $show_hits ? $item->hits : ''; $item->displayAuthorName = $show_author ? $item->author : ''; if ($show_introtext) { $item->introtext = JHtml::_('content.prepare', $item->introtext, '', '<API key>.content'); $item->introtext = self::_cleanIntrotext($item->introtext); } $item->displayIntrotext = $show_introtext ? self::truncate($item->introtext, $introtext_limit) : ''; $item->displayReadmore = $item-><API key>; } return $items; } /** * Strips unnecessary tags from the introtext * * @param string $introtext introtext to sanitize * * @return mixed|string * * @since 1.6 */ public static function _cleanIntrotext($introtext) { $introtext = str_replace('<p>', ' ', $introtext); $introtext = str_replace('</p>', ' ', $introtext); $introtext = strip_tags($introtext, '<a><em><strong>'); $introtext = trim($introtext); return $introtext; } /** * Method to truncate introtext * * The goal is to get the proper length plain text string with as much of * the html intact as possible with all tags properly closed. * * @param string $html The content of the introtext to be truncated * @param integer $maxLength The maximum number of charactes to render * * @return string The truncated string * * @since 1.6 */ public static function truncate($html, $maxLength = 0) { $baseLength = strlen($html); // First get the plain text string. This is the rendered text we want to end up with. $ptString = JHtml::_('string.truncate', $html, $maxLength, $noSplit = true, $allowHtml = false); for ($maxLength; $maxLength < $baseLength;) { // Now get the string if we allow html. $htmlString = JHtml::_('string.truncate', $html, $maxLength, $noSplit = true, $allowHtml = true); // Now get the plain text from the html string. $<API key> = JHtml::_('string.truncate', $htmlString, $maxLength, $noSplit = true, $allowHtml = false); // If the new plain text string matches the original plain text string we are done. if ($ptString == $<API key>) { return $htmlString; } // Get the number of html tag characters in the first $maxlength characters $diffLength = strlen($ptString) - strlen($<API key>); // Set new $maxlength that adjusts for the html tags $maxLength += $diffLength; if ($baseLength <= $maxLength || $diffLength <= 0) { return $htmlString; } } return $html; } /** * Groups items by field * * @param array $list list of items * @param string $fieldName name of field that is used for grouping * @param string $<API key> ordering direction * @param null $fieldNameToKeep field name to keep * * @return array * * @since 1.6 */ public static function groupBy($list, $fieldName, $<API key>, $fieldNameToKeep = null) { $grouped = array(); if (!is_array($list)) { if ($list == '') { return $grouped; } $list = array($list); } foreach ($list as $key => $item) { if (!isset($grouped[$item->$fieldName])) { $grouped[$item->$fieldName] = array(); } if (is_null($fieldNameToKeep)) { $grouped[$item->$fieldName][$key] = $item; } else { $grouped[$item->$fieldName][$key] = $item->$fieldNameToKeep; } unset($list[$key]); } $<API key>($grouped); return $grouped; } /** * Groups items by date * * @param array $list list of items * @param string $type type of grouping * @param string $<API key> ordering direction * @param string $month_year_format date format to use * * @return array * * @since 1.6 */ public static function groupByDate($list, $type = 'year', $<API key>, $month_year_format = 'F Y') { $grouped = array(); if (!is_array($list)) { if ($list == '') { return $grouped; } $list = array($list); } foreach ($list as $key => $item) { switch ($type) { case 'month_year' : $month_year = JString::substr($item->created, 0, 7); if (!isset($grouped[$month_year])) { $grouped[$month_year] = array(); } $grouped[$month_year][$key] = $item; break; case 'year' : default: $year = JString::substr($item->created, 0, 4); if (!isset($grouped[$year])) { $grouped[$year] = array(); } $grouped[$year][$key] = $item; break; } unset($list[$key]); } $<API key>($grouped); if ($type === 'month_year') { foreach ($grouped as $group => $items) { $date = new JDate($group); $formatted_group = $date->format($month_year_format); $grouped[$formatted_group] = $items; unset($grouped[$group]); } } return $grouped; } }
package adams.core.option; import adams.env.Environment; import adams.flow.control.Flow; import adams.flow.control.Tee; import adams.flow.control.Trigger; import adams.flow.sink.Console; import adams.flow.sink.Null; import adams.flow.source.ForLoop; import adams.flow.source.Start; import adams.flow.transformer.MathExpression; import adams.flow.transformer.PassThrough; import junit.framework.Test; import junit.framework.TestSuite; /** * Tests the CompactFlowProducer/Consumer classes. * * @author fracpete (fracpete at waikato dot ac dot nz) */ public class <API key> extends <API key> { /** * Initializes the test. * * @param name the name of the test */ public <API key>(String name) { super(name); } /** * Returns a default producer. * * @return the producer */ @Override protected OptionProducer getProducer() { return new CompactFlowProducer(); } /** * Returns a default consumer. * * @return the consumer */ @Override protected OptionConsumer getConsumer() { return new CompactFlowConsumer(); } /** * Tests a deeply nested option handler. */ public void testProduceDeep() { Flow flow = new Flow(); flow.add(new Start()); Tee tee = new Tee(); tee.add(new PassThrough()); tee.add(new Console()); flow.add(tee); Trigger trigger = new Trigger(); trigger.add(new ForLoop()); trigger.add(new MathExpression()); trigger.add(new Null()); flow.add(trigger); performTest(flow, getProducer(), getConsumer()); } /** * Ignored */ public void testProduceDeep2() { } /** * Returns a test suite. * * @return the test suite */ public static Test suite() { return new TestSuite(<API key>.class); } /** * Runs the test from commandline. * * @param args ignored */ public static void main(String[] args) { Environment.setEnvironmentClass(Environment.class); runTest(suite()); } }
<?php // This program is free software: you can redistribute it and/or modify // (at your option) any later version. // This program is distributed in the hope that it will be useful, // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the namespace Studip\Mobile; $<API key> = $GLOBALS['<API key>']; require_once( $GLOBALS['<API key>'] . "/lib/DbCalendarMonth.class.php" ); class calendarModel { static function getMonthDates($user_id, $timestamp) { $_calendar = \Calendar::getInstance($user_id); $cal = new \DbCalendarMonth($_calendar, $timestamp, null, \Calendar::getBindSeminare($user_id) ); $start_stamp = $cal->getStart(); $end_stamp = $cal->getEnd(); $daily_seconds = 86400; //secound of a single day $monthDates = array(); $act_stamp = $start_stamp; $i=0; while ($act_stamp <= $end_stamp) { $event = $cal->getEventsOfDay($act_stamp); if ($event!= NULL) { foreach ($event as $key => $value) { if (($value != NULL) && (is_object($value))) { //if is type of CalendarEvent .... if (is_a($value, 'CalendarEvent') || is_a($value, 'SeminarEvent')) { if ($value->getPermission() >= 2) { $monthDates[$i][$key]["title"] = $value->getTitle (); $monthDates[$i][$key]["start"] = date("G:i", $value->getStart()); $monthDates[$i][$key]["end"] = date("G:i", $value->getEnd()); $monthDates[$i][$key]["description"] = $value->getDescription(); $monthDates[$i][$key]["duration"] = date('H:i', $value->getDuration()); $monthDates[$i][$key]["location"] = $value->getLocation(); } } } else { $monthDates[$i][$key] = NULL; } } } else { $monthDates[$i] = NULL; } $i++; $act_stamp += $daily_seconds; } // var_dump($monthDates);exit(); return $monthDates; } static function getMonthDayCounts($monthevents) { $MonthDayCounts = array(); foreach ($monthevents as $key => $value) { $MonthDayCounts[$key] = count($value); } return $MonthDayCounts; } static function <API key>($user_id, $timestamp) { $monthevents = calendarModel::getMonthDates($user_id, $timestamp); $MonthDayCounts = array(); foreach ($monthevents as $key => $value) { $MonthDayCounts[$key] = count($value); } return $MonthDayCounts; } static function getDayDates($user_id, $weekday) { //get current semester $semdata = new \SemesterData(); $current_semester = $semdata-><API key>(); $current_semester_id = $current_semester['semester_id']; return \<API key>::getEntries($user_id, $current_semester, 0800 ,2000,array($weekday-1),false); } static function getCalendarEvents($user_id, $month, $year) { $db = \DBManager::get(); $query ="SELECT * FROM calendar_events WHERE message.message_id = '$msg_id' AND message_user.user_id <> message.autor_id AND message_user.deleted = '0' LIMIT 0,1"; $result = $db->query($query); foreach ($result as $row) { $items[] = array( 'id' => $row['message_id'], 'title' => $row['subject'], 'author' => $row['vorname'] . ' ' . $row['nachname'], 'author_id' => $row['autor_id'], 'message' => $row['message'], 'mkdate' => $row['mkdate'], 'receiver' => get_fullname($row['receiver']) ); } } }
#!/usr/bin/python3 # -!- encoding:utf8 -!- from subprocess import call from ...fs.fs import <API key> from ...fs.fs import <API key> from ...fs.fs import dump_heatmap_grid from ...fs.fs import dump_heatmap_psd from ...printer.printer import print_progress baseurl = 'https://download.data.grandlyon.com/wfs/grandlyon' params = { 'SERVICE': 'WFS', 'VERSION': '2.0.0', 'outputformat': 'GEOJSON', 'maxfeatures': '1000000000', 'request': 'GetFeature', 'typename': 'adr_voie_lieu.adraxevoie', 'SRSNAME': 'urn:ogc:def:crs:EPSG::4171' } def <API key>(): # build url url = baseurl + '?' for key, value in params.items(): url += key + '=' + value + '&' url = url[:-1] # call wget print('[process_streets.py]> retrieving data...') call(['wget', '-O', <API key>(), url]) print('[data_processor.py]> done !') def split_on_commune(data): # split data structure using 'nomcommune' field streets = data['features'] communes = {} total = len(streets) i = 0 print('[process_streets.py]> processing %s streets...' % total) for street in streets: i += 1 if i % 100 == 0: print_progress(i, total) commune = street['properties']['nomcommune'] if commune not in communes.keys(): communes[commune] = [] # add street to commune communes[commune].append({ 'nom': street['properties']['nom'], 'coordinates': street['geometry']['coordinates'] }) print('[process_streets.py]> done !') return communes def create_files(communes): # creating ouput files for commune, data in communes.items(): print('[process_streets.py]> writing psd file for %s...' % commune, end='') dump_heatmap_psd(commune, data) print('done !') print('[process_streets.py]> writing grid file for %s...' % commune, end='') coordinates = [] for elem in data: coordinates += elem['coordinates'] dump_heatmap_grid(commune, coordinates) print('done !') def process_streets(): # load streets data streets = <API key>() # split on communes communes = split_on_commune(streets) # create output files create_files(communes) def update_streets_data(): # download data <API key>() # process data process_streets()
extern void <API key>(void); extern void <API key>(void);
/* INFO ** ** INFO */ /* Get or set globals */ var g = g || {}; (function () { 'use strict'; var MODULE_NAME = 'vt100'; function VT100(parameters) { this._context = parameters.context; this._width = parameters.width; this._height = parameters.height; this._colors = { background : '#222222', foreground : '#7FF29F', glow : '#C2FFD3', glowSize : 4, font : 'VT323', fontSize : '17pt', }; } VT100.prototype.render = function (buffer) { var width = this._width, height = this._height, colors = this._colors, context = this._context; /* Draw background */ context.fillStyle = colors.background; context.fillRect(0, 0, width, height); /* Draw text */ context.fillStyle = colors.foreground; context.shadowBlur = colors.glowSize; context.shadowColor = colors.glow; /* Distort rendered image */ context.putImageData(barrel( { frontBuffer: context.getImageData(0, 0, width, height), backBuffer : context.createImageData(width, height), width : width, height : height }), 0, 0); }; /* Export objects to globals */ g[MODULE_NAME] = { VT100: VT100, }; })();
<!-- AUTO-GENERATED FILE! Do not edit this directly --> <!-- File auto-generated on Sun Apr 04 21:31:44 CEST 2021. See docs/translations/translations.tpl.md --> # AuthMe Translations The following translations are available in AuthMe. Set `messagesLanguage` to the language code in your config.yml to use the language, or use another language code to start a new translation. Code | Language | Translated | &nbsp; - | [en](https: [bg](https: [br](https: [cz](https: [de](https: [eo](https: [es](https: [et](https: [eu](https: [fi](https: [fr](https: [gl](https: [hu](https: [id](https: [it](https: [ko](https: [lt](https: [nl](https: [pl](https: [pt](https: [ro](https: [ru](https: [si](https: [sk](https: [sr](https: [tr](https: [uk](https: [vn](https: [zhcn](https: [zhhk](https: [zhmc](https: [zhtw](https: This page was automatically generated on the [AuthMe/AuthMeReloaded repository](https://github.com/AuthMe/AuthMeReloaded/tree/master/docs/) on Sun Apr 04 21:31:44 CEST 2021
source ${prefix}/func.sh; if [ "$grub_platform" = "efi" ]; then map -f -g "${grubfm_file}"; else to_g4d_path "${grubfm_file}"; if [ -n "${g4d_path}" ]; then set g4d_cmd="map --mem (rd)+1 (fd0);map --hook;configfile (fd0)/menu.lst"; to_g4d_menu "set file=${g4d_path}\x0amap %file% (0xff) || map --mem %file% (0xff)\x0amap --hook\x0achainloader (0xff)\x0aboot"; linux ${prefix}/grub.exe --config-file=${g4d_cmd}; initrd (rd); else set <API key>=1; linux16 ${prefix}/memdisk iso raw; initrd16 "${grubfm_file}"; fi; boot; fi;
#include <config.h> #include "dnsio_tcp.h" #include "conf.h" #include "dnswire.h" #include "dnspacket.h" #include "socks.h" #include "proxy.h" #include <gdnsd/alloc.h> #include <gdnsd/log.h> #include <gdnsd/misc.h> #include <gdnsd/net.h> #include <netdb.h> #include <unistd.h> #include <fcntl.h> #include <string.h> #include <pthread.h> #include <netinet/in_systm.h> #include <netinet/in.h> #include <netinet/ip.h> #include <netinet/tcp.h> #include <sys/uio.h> #include <math.h> #include <ev.h> #include <urcu-qsbr.h> // libev prio map: // +2: thread async stop watcher (highest prio) // +1: conn check/read watchers (only 1 per conn active at any time) // 0: thread timeout watcher // -1: thread accept watcher // -2: thread idle watcher (lowest prio) // Size of our read buffer. We always attempt filling it on a read if TCP // buffers have anything avail, and then drain all full requests from it and // move any remaining partial request to the bottom before reading again. // It's sized to fit several typical requests, and also such that "struct conn" // comes in just a little under a 4K page in size on x86_64/Linux (and thus // probably is no more than 1 page on all reasonable targets). If the rest of // the structure grows later, this may need adjustment. There's a static // assert about this below the definition of "struct conn". This is just an // efficiency hack of course. #define TCP_READBUF 3840U #if __STDC_VERSION__ >= 201112L // C11 _Static_assert(TCP_READBUF >= (DNS_RECV_SIZE + 2U), "TCP readbuf fits >= 1 maximal req"); _Static_assert(TCP_READBUF >= sizeof(proxy_hdr_t), "TCP readbuf >= PROXY header"); #endif // TCP timeout timers may fire up to this many seconds late (even relative to // the ev_now of the loop, which may already be slightly-late) to be more // efficient at batching expiries and to deal better with timing edge cases. #define TIMEOUT_FUDGE 0.25 typedef union { struct { // These two must be adjacent, as a single send() points at them as if // they're one buffer. uint16_t pktbuf_size_hdr; pkt_t pkt; }; uint8_t pktbuf_raw[sizeof(uint16_t) + sizeof(pkt_t)]; } tcp_pkt_t; // Ensure no padding between pktbuf_size_hdr and pkt, above #if __STDC_VERSION__ >= 201112L // C11 _Static_assert(_Alignof(pkt_t) <= _Alignof(uint16_t), "No padding for pkt"); #endif struct conn; typedef struct conn conn_t; // per-thread state typedef struct { // These pointers and values are fixed for the life of the thread: dnspacket_stats_t* stats; dnsp_ctx_t* pctx; struct ev_loop* loop; conn_t** churn; // save conn_t allocations from previously-closed conns tcp_pkt_t* tpkt; double server_timeout; size_t max_clients; unsigned churn_alloc; bool do_proxy; bool tcp_pad; // The rest below will mutate: ev_io accept_watcher; ev_prepare prep_watcher; ev_idle idle_watcher; ev_async stop_watcher; ev_timer timeout_watcher; conn_t* connq_head; // doubly-linked-list, most-idle at head conn_t* connq_tail; // last element, least-idle size_t num_conns; // count of all conns, also len of connq list size_t check_mode_conns; // conns using check_watcher at present unsigned churn_count; // number of conn_t cached in "churn" bool grace_mode; // final 5s grace mode flag bool rcu_is_online; } thread_t; // per-connection state struct conn { conn_t* next; // doubly-linked-list conn_t* prev; // doubly-linked-list thread_t* thr; ev_io read_watcher; ev_check check_watcher; ev_tstamp idle_start; gdnsd_anysin_t sa; bool need_proxy_init; dso_state_t dso; // shared w/ dnspacket layer size_t readbuf_head; size_t readbuf_bytes; union { proxy_hdr_t proxy_hdr; uint8_t readbuf[TCP_READBUF]; }; }; // See above at definition of TCP_READBUF #if __STDC_VERSION__ >= 201112L // C11 _Static_assert(sizeof(conn_t) <= 4096U, "TCP conn <= 4KB"); #endif static pthread_mutex_t registry_lock = <API key>; static thread_t** registry = NULL; static size_t registry_size = 0; static size_t registry_init = 0; void dnsio_tcp_init(size_t num_threads) { registry_size = num_threads; registry = xcalloc_n(registry_size, sizeof(*registry)); } void <API key>(void) { pthread_mutex_lock(&registry_lock); gdnsd_assert(registry_size == registry_init); for (size_t i = 0; i < registry_init; i++) { thread_t* thr = registry[i]; if (thr) { ev_async* stop_watcher = &thr->stop_watcher; ev_async_send(thr->loop, stop_watcher); } } <API key>(&registry_lock); } F_NONNULL static void register_thread(thread_t* thr) { pthread_mutex_lock(&registry_lock); gdnsd_assert(registry_init < registry_size); registry[registry_init++] = thr; <API key>(&registry_lock); } F_NONNULL static void unregister_thread(const thread_t* thr) { pthread_mutex_lock(&registry_lock); for (unsigned i = 0; i < registry_init; i++) { if (registry[i] == thr) { registry[i] = NULL; break; } } <API key>(&registry_lock); } // Assert all the things we assume about connection tracking sanity. They're // not always true while things are under manipulation, but they should all be // true once a given set of manipulations are complete. F_NONNULL static void connq_assert_sane(const thread_t* thr) { if (!thr->num_conns) { gdnsd_assert(!thr->connq_head); gdnsd_assert(!thr->connq_tail); } else { gdnsd_assert(thr->num_conns <= thr->max_clients); gdnsd_assert(thr->connq_head); gdnsd_assert(thr->connq_tail); gdnsd_assert(!thr->connq_head->prev); gdnsd_assert(!thr->connq_tail->next); #ifndef NDEBUG size_t ct = 0; conn_t* c = thr->connq_head; while (c) { ct++; if (c != thr->connq_tail) gdnsd_assert(c->next); if (c != thr->connq_head) gdnsd_assert(c->prev); c = c->next; } gdnsd_assert(ct == thr->num_conns); #endif } } // This adjust the timer to the next connq_head expiry or stops it if no // connections are left in the queue. when in either shutdown phase, we do not // update the timer, but we will stop it. F_NONNULL static void connq_adjust_timer(thread_t* thr) { connq_assert_sane(thr); ev_timer* tmo = &thr->timeout_watcher; if (thr->connq_head) { if (likely(!thr->grace_mode)) { ev_tstamp next_interval = thr->server_timeout + TIMEOUT_FUDGE - (ev_now(thr->loop) - thr->connq_head->idle_start); if (next_interval < TIMEOUT_FUDGE) next_interval = TIMEOUT_FUDGE; tmo->repeat = next_interval; ev_timer_again(thr->loop, tmo); } } else { gdnsd_assert(!thr->num_conns); ev_timer_stop(thr->loop, tmo); } } // Pull a connection out of the queue and adjust everything else for sanity. // This could be to destroy it, or could be to move it to the tail. Does not // touch the value of the next or prev pointers of the conn, but does touch the // neighbors reachable through them. F_NONNULL static void connq_pull_conn(thread_t* thr, const conn_t* conn) { connq_assert_sane(thr); gdnsd_assert(thr->num_conns); thr->num_conns if (conn->next) { gdnsd_assert(conn != thr->connq_tail); conn->next->prev = conn->prev; } else { gdnsd_assert(conn == thr->connq_tail); thr->connq_tail = conn->prev; } if (conn->prev) { gdnsd_assert(conn != thr->connq_head); conn->prev->next = conn->next; } else { gdnsd_assert(conn == thr->connq_head); thr->connq_head = conn->next; connq_adjust_timer(thr); } connq_assert_sane(thr); } // Closes and destroys a connection, and optionally manages it out of the queue F_NONNULL static void connq_destruct_conn(thread_t* thr, conn_t* conn, const bool rst, const bool manage_queue) { gdnsd_assert(thr->num_conns); ev_io* read_watcher = &conn->read_watcher; ev_io_stop(thr->loop, read_watcher); ev_check* check_watcher = &conn->check_watcher; if (ev_is_active(check_watcher)) { ev_check_stop(thr->loop, check_watcher); gdnsd_assert(thr->check_mode_conns); thr->check_mode_conns } const int fd = read_watcher->fd; if (rst) { const struct linger lin = { .l_onoff = 1, .l_linger = 0 }; if (setsockopt(read_watcher->fd, SOL_SOCKET, SO_LINGER, &lin, sizeof(lin))) log_neterr("setsockopt(%s, SO_LINGER, {1, 0}) failed: %s", logf_anysin(&conn->sa), logf_errno()); } if (close(fd)) log_neterr("close(%s) failed: %s", logf_anysin(&conn->sa), logf_errno()); if (manage_queue) connq_pull_conn(thr, conn); if (thr->churn_count < thr->churn_alloc) { memset(conn, 0, sizeof(*conn)); thr->churn[thr->churn_count++] = conn; } else { free(conn); } } // Append a new connection at the tail of the idle list and set its idle_start F_NONNULL static void <API key>(thread_t* thr, conn_t* conn) { connq_assert_sane(thr); // This element is not part of the linked list yet gdnsd_assert(thr->connq_head != conn); gdnsd_assert(thr->connq_tail != conn); gdnsd_assert(!conn->next); gdnsd_assert(!conn->prev); // accept() handler is gone when in grace phase gdnsd_assert(!thr->grace_mode); conn->idle_start = ev_now(thr->loop); thr->num_conns++; // If there's no existing head, the conn list was empty before this one, so // it's a very simple case to handle: if (!thr->connq_head) { gdnsd_assert(thr->num_conns == 1); gdnsd_assert(!thr->connq_tail); thr->connq_head = thr->connq_tail = conn; connq_adjust_timer(thr); return; } // Otherwise we append to the tail of the list gdnsd_assert(thr->connq_tail); gdnsd_assert(!thr->connq_tail->next); conn->prev = thr->connq_tail; conn->next = NULL; thr->connq_tail->next = conn; thr->connq_tail = conn; connq_assert_sane(thr); // If we've just maxed out the connection count, we have to kill a conn ungracefully. // Arguably, we could do smarter things sooner for DSO clients (e.g. on // reaching X% of max connection count, send the most-idle DSO session a // zero inactivity unidirectional keepalive, or a retrydelay), but it's // tricky to think through the implications here given mixed clients // (fairness between DSO and non-DSO, whether the most-idle DSO is anywhere // near the most-idle end of the list, etc) if (thr->num_conns == thr->max_clients) { stats_own_inc(&conn->thr->stats->tcp.close_s_kill); log_neterr("TCP DNS conn from %s reset by server: killed due to thread connection load (most-idle)", logf_anysin(&thr->connq_head->sa)); connq_destruct_conn(thr, thr->connq_head, true, true); } } // Called when a connection completes a transaction (reads a legit request, and // writes the full response to the TCP layer), causing us to reset its idleness F_NONNULL static void connq_refresh_conn(thread_t* thr, conn_t* conn) { connq_assert_sane(thr); gdnsd_assert(!conn->need_proxy_init); conn->idle_start = ev_now(thr->loop); // If this is the only connection, just adjust the timer if (thr->num_conns == 1) { gdnsd_assert(conn == thr->connq_head); gdnsd_assert(conn == thr->connq_tail); connq_adjust_timer(thr); return; } // If we're already at the tail, nothing left to do if (conn == thr->connq_tail) return; // Otherwise, pull it (which will adjust timer if the conn pulled was the // head) and place it at the tail connq_pull_conn(thr, conn); conn->prev = thr->connq_tail; conn->next = NULL; thr->connq_tail->next = conn; thr->connq_tail = conn; thr->num_conns++; // connq_pull_conn decrements, but we're re-inserting here connq_assert_sane(thr); } // Expects response data to already be in conn->pktbuf, of size resp_size. // Used for writing normal responses, and also for DSO unidirectionals F_NONNULL static bool conn_write_packet(thread_t* thr, conn_t* conn, size_t resp_size) { gdnsd_assert(resp_size); tcp_pkt_t* tpkt = thr->tpkt; tpkt->pktbuf_size_hdr = htons((uint16_t)resp_size); const size_t resp_send_size = resp_size + 2U; const ev_io* readw = &conn->read_watcher; const ssize_t send_rv = send(readw->fd, tpkt->pktbuf_raw, resp_send_size, 0); if (unlikely(send_rv < (ssize_t)resp_send_size)) { if (send_rv < 0 && !ERRNO_WOULDBLOCK) log_debug("TCP DNS conn from %s reset by server: failed while writing: %s", logf_anysin(&conn->sa), logf_errno()); else log_debug("TCP DNS conn from %s reset by server: cannot buffer whole response", logf_anysin(&conn->sa)); stats_own_inc(&thr->stats->tcp.sendfail); stats_own_inc(&thr->stats->tcp.close_s_err); connq_destruct_conn(thr, conn, true, true); return true; } return false; } // DSO unidirectional send of KeepAlive with KA=inf + Inact=0 F_NONNULL static void conn_send_dso_uni(thread_t* thr, conn_t* conn) { uint8_t* buf = thr->tpkt->pkt.raw; // For DSO uni, the 12 byte header is all zero except the opcode memset(buf, 0, 12U); buf[2] = DNS_OPCODE_DSO << 3; size_t offset = 12; // Construct DSO Keepalive pkt w/ KA=info + Inact=0 gdnsd_put_una16(htons(DNS_DSO_KEEPALIVE), &buf[offset]); offset += 2; gdnsd_put_una16(htons(8U), &buf[offset]); offset += 2; gdnsd_put_una32(0xFFFFFFFFU, &buf[offset]); offset += 4; gdnsd_put_una32(0, &buf[offset]); offset += 4; gdnsd_assert(offset == 24U); // Add crypto padding if configured for the listener if (thr->tcp_pad) { const unsigned pad_dlen = PAD_BLOCK_SIZE - offset - 4U; gdnsd_put_una16(htons(DNS_DSO_PADDING), &buf[offset]); offset += 2U; gdnsd_put_una16(htons(pad_dlen), &buf[offset]); offset += 2U; memset(&buf[offset], 0, pad_dlen); offset += pad_dlen; gdnsd_assert(offset == PAD_BLOCK_SIZE); } // write response, may tear down connection if no immediate full write conn_write_packet(thr, conn, offset); } F_NONNULL static void timeout_handler(struct ev_loop* loop V_UNUSED, ev_timer* t, const int revents V_UNUSED) { gdnsd_assert(revents == EV_TIMER); thread_t* thr = t->data; gdnsd_assert(thr); connq_assert_sane(thr); // Timer never fires unless there are connections, in all cases conn_t* conn = thr->connq_head; gdnsd_assert(conn); // End of the 5s final shutdown phase: immediately close all connections and let the thread exit if (unlikely(thr->grace_mode)) { log_debug("TCP DNS thread shutdown: immediately dropping (RST) %zu delinquent connections while exiting", thr->num_conns); while (conn) { conn_t* next_conn = conn->next; connq_destruct_conn(thr, conn, true, false); // no queue mgmt stats_own_inc(&thr->stats->tcp.close_s_err); conn = next_conn; } // Stop ourselves, we should be the only remaining active watcher ev_timer* tmo = &thr->timeout_watcher; ev_timer_stop(thr->loop, tmo); thr->connq_head = NULL; thr->connq_tail = NULL; thr->num_conns = 0; return; // eventloop will end now, and shortly after the whole thread } // Normal runtime timer fire for real conn expiry, expire from head of idle // list until we find an unexpired one (if any) const double cutoff = ev_now(thr->loop) - thr->server_timeout; while (conn && conn->idle_start <= cutoff) { conn_t* next_conn = conn->next; log_debug("TCP DNS conn from %s reset by server: timeout", logf_anysin(&conn->sa)); stats_own_inc(&conn->thr->stats->tcp.close_s_ok); // Note final "manage_queue" argument is false. connq_destruct_conn(thr, conn, true, false); thr->num_conns conn = next_conn; } // Manual queue management, since we only pulled from the head if (!conn) { gdnsd_assert(!thr->num_conns); thr->connq_head = thr->connq_tail = NULL; } else { gdnsd_assert(thr->num_conns); conn->prev = NULL; thr->connq_head = conn; } connq_adjust_timer(thr); } F_NONNULL static void stop_handler(struct ev_loop* loop, ev_async* w, int revents V_UNUSED) { gdnsd_assert(revents == EV_ASYNC); thread_t* thr = w->data; gdnsd_assert(thr); gdnsd_assert(!thr->grace_mode); // this handler stops itself on grace entry connq_assert_sane(thr); // Stop the accept() watcher and the async watcher for this stop handler ev_async* stop_watcher = &thr->stop_watcher; ev_async_stop(loop, stop_watcher); ev_io* accept_watcher = &thr->accept_watcher; ev_io_stop(loop, accept_watcher); // If there are no active connections, the thread's timeout watcher should // be inactive as well, and so the two watchers we stopped above were the // only ones keeping the loop running, and we can just return now without // going through all our graceful behaviors for live connections. if (!thr->num_conns) { ev_timer* tw V_UNUSED = &thr->timeout_watcher; gdnsd_assert(!ev_is_active(tw)); return; } log_debug("TCP DNS thread shutdown: gracefully requesting clients to close %zu remaining conns when able and waiting up to 5s", thr->num_conns); // Switch thread state to the "graceful" shutdown phase thr->grace_mode = true; // Inform dnspacket layer we're in graceful shutdown phase (zero timeouts) <API key>(thr->pctx); // send unidirectional KeepAlive w/ inactivity=0 to all DSO clients conn_t* conn = thr->connq_head; gdnsd_assert(conn); while (conn) { conn_t* next_conn = conn->next; if (conn->dso.estab) conn_send_dso_uni(thr, conn); conn = next_conn; } // Up until now, the timeout watcher was firing dynamically according to // connection idleness, always pointing at the expiry point of the // head-most (most-idle) connection in the queue. Now it is reset to fire // once 5 seconds from now to end our grace period and exit the thread. // However, we won't bother if there's no clients left (it's possible in // the case that they're all DSO connections, and they all experienced a // write failure of their unidirectional keepalive above, causing // termination). if (thr->num_conns) { // Start the timer for the final 5s, if any clients are left (some may // get closed above if we fail to write DSO unidirectionals to them). ev_timer* tmo = &thr->timeout_watcher; tmo->repeat = 5.0; ev_timer_again(thr->loop, tmo); } else { ev_timer* tw V_UNUSED = &thr->timeout_watcher; gdnsd_assert(!ev_is_active(tw)); } } // Checks the status of the next request in the buffer, if any, and takes a few // sanitizing actions along the way. // TLDR: -1 == killed conn, 0 == need more read, 1+ == size of full req avail F_NONNULL static ssize_t conn_check_next_req(thread_t* thr, conn_t* conn) { // No bytes, just ensure head is reset to zero and ask for more reading if (!conn->readbuf_bytes) { conn->readbuf_head = 0; return 0; } // If even 1 byte is available, we can already pre-check for egregious // oversize, but we need two bytes for full sanity. size_t req_size = conn->readbuf[conn->readbuf_head]; req_size <<= 8; bool undersized = false; if (conn->readbuf_bytes > 1) { req_size += conn->readbuf[conn->readbuf_head + 1]; if (unlikely(req_size < 12U)) undersized = true; } if (unlikely(undersized || req_size > DNS_RECV_SIZE)) { log_debug("TCP DNS conn from %s reset by server while reading: bad TCP request length", logf_anysin(&conn->sa)); stats_own_inc(&thr->stats->tcp.recvfail); stats_own_inc(&thr->stats->tcp.close_s_err); connq_destruct_conn(thr, conn, true, true); return -1; } // If we don't have a full request buffered, move any legitimate (so far) // partial req to the bottom (if necc) and ask for more reading. if (conn->readbuf_bytes < (req_size + 2U)) { if (conn->readbuf_head) { memmove(conn->readbuf, &conn->readbuf[conn->readbuf_head], conn->readbuf_bytes); conn->readbuf_head = 0; } return 0; } return (ssize_t)req_size; } // Assumes a full request packet (starting with the 12 byte DNS header) is // available starting at "conn->readbuf[conn->readbuf_head + 2U]" and the // length indicated by the 2-byte length prefix from TCP DNS is indicated in // max). Will copy out the request, process it, write a response, and then // manage the read buffer state and the check/read watcher states. F_NONNULL static void conn_respond(thread_t* thr, conn_t* conn, const size_t req_size) { gdnsd_assert(req_size >= 12U && req_size <= DNS_RECV_SIZE); tcp_pkt_t* tpkt = thr->tpkt; // Move 1 full request from readbuf to pkt, advancing head and decrementing bytes memcpy(tpkt->pkt.raw, &conn->readbuf[conn->readbuf_head + 2U], req_size); const size_t req_bufsize = req_size + 2U; conn->readbuf_head += req_bufsize; conn->readbuf_bytes -= req_bufsize; // Bring RCU online (or quiesce) and generate an answer if (!thr->rcu_is_online) { thr->rcu_is_online = true; rcu_thread_online(); } else { rcu_quiescent_state(); } conn->dso.last_was_ka = false; size_t resp_size = process_dns_query(thr->pctx, &conn->sa, &tpkt->pkt, &conn->dso, req_size); if (!resp_size) { log_debug("TCP DNS conn from %s reset by server: dropped invalid query", logf_anysin(&conn->sa)); stats_own_inc(&thr->stats->tcp.close_s_err); connq_destruct_conn(thr, conn, true, true); return; } ev_io* readw = &conn->read_watcher; ev_check* checkw = &conn->check_watcher; // We only make one attempt to send the whole response, and do not accept // EAGAIN. This is incorrect in theory, but it makes sense in practice for // our use-case: a reasonable client shouldn't be stuffing requests at us // so fast that its own TCP receive window and/or our reasonable output // buffers can't handle the resulting responses, and if some fault is // responsible then we need to tear down anyways. gdnsd_assert(resp_size <= MAX_RESPONSE_BUF); if (conn_write_packet(thr, conn, resp_size)) return; // writer ended up destroying conn // We don't refresh timeout if this txn was just a DSO KA if (!conn->dso.last_was_ka) connq_refresh_conn(thr, conn); // Check status of next readbuf req, decide which watcher should be active const ssize_t ccnr_rv = conn_check_next_req(thr, conn); if (ccnr_rv < 0) return; if (!ccnr_rv) { // No full req available, need to hit the read_handler next if (ev_is_active(checkw)) { ev_check_stop(thr->loop, checkw); gdnsd_assert(!ev_is_active(readw)); ev_io_start(thr->loop, readw); gdnsd_assert(thr->check_mode_conns); thr->check_mode_conns } else { gdnsd_assert(ev_is_active(readw)); } } else { // Full req available, need to hit the check_handler next if (ev_is_active(readw)) { ev_io_stop(thr->loop, readw); gdnsd_assert(!ev_is_active(checkw)); ev_check_start(thr->loop, checkw); thr->check_mode_conns++; } else { gdnsd_assert(ev_is_active(checkw)); } } } F_NONNULL static void check_handler(struct ev_loop* loop V_UNUSED, ev_check* w, const int revents V_UNUSED) { gdnsd_assert(revents == EV_CHECK); conn_t* conn = w->data; gdnsd_assert(conn); thread_t* thr = conn->thr; gdnsd_assert(thr); gdnsd_assert(!conn->need_proxy_init); // We only arrive here if we have a legit-sized fully-buffered request gdnsd_assert(conn->readbuf_bytes > 2U); const size_t req_size = (((size_t)conn->readbuf[conn->readbuf_head + 0] << 8U) + (size_t)conn->readbuf[conn->readbuf_head + 1]); gdnsd_assert(req_size >= 12U && req_size <= DNS_RECV_SIZE); gdnsd_assert(conn->readbuf_bytes >= (req_size + 2U)); conn_respond(thr, conn, req_size); } // This does the actual recv() call and immediate post-processing (incl conn // termination on EOF or error). // rv true means caller should return immediately (connection closed or read // gave no new bytes and wants to block in the eventloop again). rv false // means one or more new bytes were added to the readbuf. F_NONNULL static bool conn_do_recv(thread_t* thr, conn_t* conn) { gdnsd_assert(conn->readbuf_bytes < sizeof(conn->readbuf)); const size_t wanted = sizeof(conn->readbuf) - conn->readbuf_bytes; const ssize_t recvrv = recv(conn->read_watcher.fd, &conn->readbuf[conn->readbuf_bytes], wanted, 0); if (recvrv == 0) { // (EOF) if (conn->readbuf_bytes) { log_debug("TCP DNS conn from %s closed by client while reading: unexpected EOF", logf_anysin(&conn->sa)); stats_own_inc(&thr->stats->tcp.recvfail); stats_own_inc(&thr->stats->tcp.close_s_err); } else { log_debug("TCP DNS conn from %s closed by client while idle (ideal close)", logf_anysin(&conn->sa)); stats_own_inc(&thr->stats->tcp.close_c); } connq_destruct_conn(thr, conn, false, true); return true; } if (recvrv < 0) { // negative return -> errno if (!ERRNO_WOULDBLOCK) { log_debug("TCP DNS conn from %s reset by server: error while reading: %s", logf_anysin(&conn->sa), logf_errno()); stats_own_inc(&thr->stats->tcp.recvfail); stats_own_inc(&thr->stats->tcp.close_s_err); connq_destruct_conn(thr, conn, true, true); } return true; } size_t pktlen = (size_t)recvrv; gdnsd_assert(pktlen <= wanted); gdnsd_assert((conn->readbuf_bytes + pktlen) <= sizeof(conn->readbuf)); conn->readbuf_bytes += pktlen; return false; } F_NONNULL static void read_handler(struct ev_loop* loop V_UNUSED, ev_io* w, const int revents V_UNUSED) { gdnsd_assert(revents == EV_READ); conn_t* conn = w->data; gdnsd_assert(conn); thread_t* thr = conn->thr; gdnsd_assert(thr); if (conn_do_recv(thr, conn)) return; // no new bytes or conn closed gdnsd_assert(conn->readbuf_bytes); if (conn->need_proxy_init) { conn->need_proxy_init = false; const size_t consumed = proxy_parse(&conn->sa, &conn->proxy_hdr, conn->readbuf_bytes); gdnsd_assert(consumed <= conn->readbuf_bytes); if (!consumed) { log_neterr("PROXY parse fail from %s, resetting connection", logf_anysin(&conn->sa)); stats_own_inc(&thr->stats->tcp.proxy_fail); stats_own_inc(&thr->stats->tcp.close_s_err); connq_destruct_conn(thr, conn, true, true); return; } conn->readbuf_bytes -= consumed; conn->readbuf_head += consumed; } const ssize_t ccnr_rv = conn_check_next_req(thr, conn); if (ccnr_rv < 1) // ccnr either closed on err or wants us to read more return; conn_respond(thr, conn, (size_t)ccnr_rv); } F_NONNULL static void accept_handler(struct ev_loop* loop, ev_io* w, const int revents V_UNUSED) { gdnsd_assert(revents == EV_READ); thread_t* thr = w->data; gdnsd_anysin_t sa; memset(&sa, 0, sizeof(sa)); sa.len = GDNSD_ANYSIN_MAXLEN; const int sock = accept4(w->fd, &sa.sa, &sa.len, SOCK_NONBLOCK | SOCK_CLOEXEC); if (unlikely(sock < 0)) { if (ERRNO_WOULDBLOCK || errno == EINTR) { // Simple retryable failures, do nothing } else if ((errno == ENFILE || errno == EMFILE) && thr->connq_head) { // If we ran out of fds and there's an idle one we can close, try // to do that, just like we do when we hit our internal limits stats_own_inc(&thr->stats->tcp.acceptfail); stats_own_inc(&thr->stats->tcp.close_s_kill); log_neterr("TCP DNS conn from %s reset by server: attempting to" " free resources because: accept4() failed: %s", logf_anysin(&thr->connq_head->sa), logf_errno()); connq_destruct_conn(thr, thr->connq_head, true, true); } else { // For all other errnos (or E[MN]FILE without a conn to kill, // because we're not actually the offending thread...), just do a // ratelimited log output and bump the stat. stats_own_inc(&thr->stats->tcp.acceptfail); log_neterr("TCP DNS: accept4() failed: %s", logf_errno()); } return; } log_debug("Received TCP DNS connection from %s", logf_anysin(&sa)); conn_t* conn; if (thr->churn_count) conn = thr->churn[--thr->churn_count]; else conn = xcalloc(sizeof(*conn)); memcpy(&conn->sa, &sa, sizeof(sa)); stats_own_inc(&thr->stats->tcp.conns); if (thr->do_proxy) { stats_own_inc(&thr->stats->tcp.proxy); conn->need_proxy_init = true; } conn->thr = thr; <API key>(thr, conn); ev_io* read_watcher = &conn->read_watcher; ev_io_init(read_watcher, read_handler, sock, EV_READ); ev_set_priority(read_watcher, 1); read_watcher->data = conn; ev_io_start(loop, read_watcher); ev_check* check_watcher = &conn->check_watcher; ev_check_init(check_watcher, check_handler); ev_set_priority(check_watcher, 1); check_watcher->data = conn; // Always optimistically attempt to read a req at conn start. Even if // TCP_DEFER_ACCEPT and SO_ACCEPTFILTER are both unavailable, there's a // chance that under load the request data is already present. read_handler(loop, read_watcher, EV_READ); } F_NONNULL static void idle_handler(struct ev_loop* loop V_UNUSED, ev_idle* w V_UNUSED, const int revents V_UNUSED) { gdnsd_assert(revents == EV_IDLE); // no-op, just here for the side-effect of nonblocking loop iterations } F_NONNULL static void prep_handler(struct ev_loop* loop V_UNUSED, ev_prepare* w V_UNUSED, int revents V_UNUSED) { thread_t* thr = w->data; gdnsd_assert(thr); ev_idle* iw = &thr->idle_watcher; if (thr->check_mode_conns) { if (!ev_is_active(iw)) { ev_idle_start(thr->loop, iw); ev_unref(thr->loop); } if (thr->rcu_is_online) rcu_quiescent_state(); } else { if (ev_is_active(iw)) { ev_ref(thr->loop); ev_idle_stop(thr->loop, iw); } if (thr->rcu_is_online) { thr->rcu_is_online = false; rcu_thread_offline(); } } } #ifndef SOL_IPV6 #define SOL_IPV6 IPPROTO_IPV6 #endif #ifndef SOL_IP #define SOL_IP IPPROTO_IP #endif #ifndef SOL_TCP #define SOL_TCP IPPROTO_TCP #endif #ifndef IPV6_MIN_MTU #define IPV6_MIN_MTU 1280 #endif void <API key>(dns_thread_t* t) { const dns_addr_t* addrconf = t->ac; gdnsd_assert(addrconf); const gdnsd_anysin_t* sa = &addrconf->addr; const bool isv6 = sa->sa.sa_family == AF_INET6 ? true : false; gdnsd_assert(isv6 || sa->sa.sa_family == AF_INET); bool need_bind = false; if (t->sock == -1) { // not acquired via replace t->sock = socket(sa->sa.sa_family, SOCK_STREAM | SOCK_NONBLOCK | SOCK_CLOEXEC, IPPROTO_TCP); if (t->sock < 0) log_fatal("Failed to create IPv%c TCP socket: %s", isv6 ? '6' : '4', logf_errno()); need_bind = true; } sockopt_bool_fatal(TCP, sa, t->sock, SOL_SOCKET, SO_REUSEADDR, 1); // We need SO_REUSEPORT for functional reasons sockopt_bool_fatal(TCP, sa, t->sock, SOL_SOCKET, SO_REUSEPORT, 1); #ifdef SO_REUSEPORT_LB // If BSD's SO_REUSEPORT_LB is available, try to upgrade to that for better // balancing, but merely warn on failure because it's new and there could // be a compiletime vs runtime diff. sockopt_bool_warn(TCP, sa, t->sock, SOL_SOCKET, SO_REUSEPORT_LB, 1); #endif sockopt_bool_fatal(TCP, sa, t->sock, SOL_TCP, TCP_NODELAY, 1); #ifdef TCP_DEFER_ACCEPT // Clamp TCP_DEFER_ACCEPT timeout to no more than 30s int defaccept_timeout = (int)addrconf->tcp_timeout; if (defaccept_timeout > 30) defaccept_timeout = 30; sockopt_int_fatal(TCP, sa, t->sock, SOL_TCP, TCP_DEFER_ACCEPT, defaccept_timeout); #endif #ifdef TCP_FASTOPEN // This is non-fatal for now because many OSes may require tuning/config to // allow this to work, but we do want to default it on in cases where it // works out of the box correctly. sockopt_int_warn(TCP, sa, t->sock, SOL_TCP, TCP_FASTOPEN, (int)addrconf->tcp_fastopen); #endif if (isv6) { sockopt_bool_fatal(TCP, sa, t->sock, SOL_IPV6, IPV6_V6ONLY, 1); // as with our default <API key>, assume minimum MTU only to // avoid IPv6 mtu/frag loss issues. Clamping to min mtu should // commonly set MSS to 1220. #if defined IPV6_USE_MIN_MTU sockopt_bool_fatal(TCP, sa, t->sock, SOL_IPV6, IPV6_USE_MIN_MTU, 1); #elif defined IPV6_MTU // This sockopt doesn't have matching get+set; get needs a live // connection and reports the connection's path MTU, so we have to just // set it here blindly... const int min_mtu = IPV6_MIN_MTU; if (setsockopt(t->sock, SOL_IPV6, IPV6_MTU, &min_mtu, sizeof(min_mtu)) == -1) log_fatal("Failed to set IPV6_MTU on TCP socket: %s", logf_errno()); #endif } if (need_bind) socks_bind_sock("TCP DNS", t->sock, sa); } static void set_accf(const dns_addr_t* addrconf V_UNUSED, const int sock V_UNUSED) { #ifdef SO_ACCEPTFILTER struct accept_filter_arg afa_exist; struct accept_filter_arg afa_want; socklen_t afa_exist_size = sizeof(afa_exist); memset(&afa_exist, 0, sizeof(afa_exist)); memset(&afa_want, 0, sizeof(afa_want)); strcpy(afa_want.af_name, addrconf->tcp_proxy ? "dataready" : "dnsready"); const int getrv = getsockopt(sock, SOL_SOCKET, SO_ACCEPTFILTER, &afa_exist, &afa_exist_size); if (getrv && errno != EINVAL) { // If no existing filter is installed (or not listening), the retval is // EINVAL, but any other weird error should log and stop related option // processing here log_err("Failed to get current SO_ACCEPTFILTER on TCP socket %s: %s", logf_anysin(&addrconf->addr), logf_errno()); } else { // If getsockopt failed with EINVAL we're in a fresh state, so just // install the desired filter. If getsockopt succeeded and the filter // didn't match, we'll need to first clear the existing filter out if (getrv || afa_exist_size != sizeof(afa_want) || memcmp(&afa_want, &afa_exist, sizeof(afa_want))) { if (!getrv) if (setsockopt(sock, SOL_SOCKET, SO_ACCEPTFILTER, NULL, 0)) log_err("Failed to clear existing '%s' SO_ACCEPTFILTER on TCP socket %s: %s", afa_exist.af_name, logf_anysin(&addrconf->addr), logf_errno()); if (setsockopt(sock, SOL_SOCKET, SO_ACCEPTFILTER, &afa_want, sizeof(afa_want))) { log_err("Failed to install '%s' SO_ACCEPTFILTER on TCP socket %s: %s", afa_want.af_name, logf_anysin(&addrconf->addr), logf_errno()); // If we failed at "dnsready" for the non-proxy case, try // "dataready" just in case that one happens to be loaded; // it's better than nothing and matches what we get on Linux // with just TCP_DEFER_ACCEPT if (!addrconf->tcp_proxy) { strcpy(afa_want.af_name, "dataready"); if (setsockopt(sock, SOL_SOCKET, SO_ACCEPTFILTER, &afa_want, sizeof(afa_want))) log_err("Failed to install '%s' SO_ACCEPTFILTER on TCP socket %s: %s", afa_want.af_name, logf_anysin(&addrconf->addr), logf_errno()); } } } } #endif } void* dnsio_tcp_start(void* thread_asvoid) { <API key>("gdnsd-io-tcp"); const dns_thread_t* t = thread_asvoid; gdnsd_assert(!t->is_udp); const dns_addr_t* addrconf = t->ac; thread_t thr = { 0 }; const int backlog = (int)(addrconf->tcp_backlog ? addrconf->tcp_backlog : SOMAXCONN); if (listen(t->sock, backlog) == -1) log_fatal("Failed to listen(s, %i) on TCP socket %s: %s", backlog, logf_anysin(&addrconf->addr), logf_errno()); set_accf(addrconf, t->sock); <API key>(<API key>, NULL); // These are fixed values for the life of the thread based on config: thr.server_timeout = (double)(addrconf->tcp_timeout * 2); thr.max_clients = addrconf-><API key>; thr.do_proxy = addrconf->tcp_proxy; thr.tcp_pad = addrconf->tcp_pad; // Set up the conn_t churn buffer, which saves some per-new-connection // memory allocation churn by saving up to sqrt(max_clients) old conn_t // storage for reuse thr.churn_alloc = lrint(floor(sqrt(addrconf-><API key>))); gdnsd_assert(thr.churn_alloc >= 4U); // because tcp_cpt min is 16U thr.churn = xmalloc_n(thr.churn_alloc, sizeof(*thr.churn)); thr.tpkt = xcalloc(sizeof(*thr.tpkt)); ev_idle* idle_watcher = &thr.idle_watcher; ev_idle_init(idle_watcher, idle_handler); ev_set_priority(idle_watcher, -2); idle_watcher->data = &thr; ev_io* accept_watcher = &thr.accept_watcher; ev_io_init(accept_watcher, accept_handler, t->sock, EV_READ); ev_set_priority(accept_watcher, -1); accept_watcher->data = &thr; ev_timer* timeout_watcher = &thr.timeout_watcher; ev_timer_init(timeout_watcher, timeout_handler, 0, thr.server_timeout); ev_set_priority(timeout_watcher, 0); timeout_watcher->data = &thr; ev_prepare* prep_watcher = &thr.prep_watcher; ev_prepare_init(prep_watcher, prep_handler); prep_watcher->data = &thr; ev_async* stop_watcher = &thr.stop_watcher; ev_async_init(stop_watcher, stop_handler); ev_set_priority(stop_watcher, 2); stop_watcher->data = &thr; struct ev_loop* loop = ev_loop_new(EVFLAG_AUTO); if (!loop) log_fatal("ev_loop_new() failed"); thr.loop = loop; ev_async_start(loop, stop_watcher); ev_io_start(loop, accept_watcher); ev_prepare_start(loop, prep_watcher); ev_unref(loop); // prepare should not hold a ref, but should run to the end // register_thread() hooks us into the ev_async-based shutdown-handling // code, therefore we must have thr.loop and thr.stop_watcher initialized // and ready before we register here register_thread(&thr); // dnspacket_ctx_init() is what releases threads through the startup gates, // and main.c's call to <API key>() waits for all threads to // have reached this point before entering the main runtime loop. // Therefore, this must happen after register_thread() above, to ensure // that all tcp threads are properly registered with the shutdown handler // before we begin processing possible future shutdown events. thr.pctx = <API key>(&thr.stats, addrconf->tcp_pad, addrconf->tcp_timeout); rcu_register_thread(); thr.rcu_is_online = true; ev_run(loop, 0); <API key>(); unregister_thread(&thr); ev_loop_destroy(loop); <API key>(thr.pctx); for (unsigned i = 0; i < thr.churn_count; i++) free(thr.churn[i]); free(thr.churn); free(thr.tpkt); return NULL; }
Ext.define('Traccar.view.dialog.Login', { extend: 'Traccar.view.dialog.Base', alias: 'widget.login', requires: [ 'Traccar.view.dialog.LoginController' ], controller: 'login', header: false, closable: false, items: { xtype: 'form', reference: 'form', autoEl: { tag: 'form', method: 'POST', action: 'fake-login.html', target: 'submitTarget' }, items: [{ xtype: 'image', src: 'logo.svg', alt: Strings.loginLogo, width: 180, height: 48, style: { display: 'block', margin: '10px auto 25px' } }, { xtype: 'combobox', name: 'language', fieldLabel: Strings.loginLanguage, store: 'Languages', displayField: 'name', valueField: 'code', editable: false, submitValue: false, listeners: { select: 'onSelectLanguage' }, reference: 'languageField' }, { xtype: 'textfield', name: 'email', reference: 'userField', fieldLabel: Strings.userEmail, allowBlank: false, enableKeyEvents: true, listeners: { specialKey: 'onSpecialKey', afterrender: 'onAfterRender' }, inputAttrTpl: ['autocomplete="on" autocapitalize="none"'] }, { xtype: 'textfield', name: 'password', reference: 'passwordField', fieldLabel: Strings.userPassword, inputType: 'password', allowBlank: false, enableKeyEvents: true, listeners: { specialKey: 'onSpecialKey' }, inputAttrTpl: ['autocomplete="on"'] }, { xtype: 'checkboxfield', inputValue: true, uncheckedValue: false, reference: 'rememberField', fieldLabel: Strings.userRemember }, { xtype: 'component', html: '<iframe id="submitTarget" name="submitTarget" style="display:none"></iframe>' }, { xtype: 'component', html: '<input type="submit" id="submitButton" style="display:none">' }] }, buttons: [{ text: Strings.loginRegister, handler: 'onRegisterClick', reference: 'registerButton' }, { text: Strings.loginLogin, handler: 'onLoginClick' }] });
package com.godsandtowers.sprites; public interface Upgradeable { public String getName(); public String getUpgradeName(int id); public int[] getUpgradeIDs(); public long getUpgradeCost(int id); public float getBaseValue(int id); public float getUpgradedValue(int id); public void upgrade(int id); public int getUpgradeCount(int id); }
require "spec_helper" describe "monit::check::process" do context "with no parameters" do let(:title) { "postgres" } it "generates a basic config snippet" do should contain_file("/etc/monit/conf.d/postgres.monitrc").with({ "ensure" => "present", "owner" => "root", "group" => "root", "mode" => "0400", "notify" => "Service[monit]", }). with_content(/check process postgres/). without_content(/depends on/) end end context "with parameters and pidfile" do let(:title) { "background-worker" } let(:params) do { :pidfile => "/var/run/workerz.pid", :start => "/usr/local/bin/background start", :stop => "/bin/kill -9 2342", :start_extras => "as uid appworker and gid application", :stop_extras => "and using the sum", # pure noise words, ignored by monit :depends => "systemd-database", :customlines => [ "group workers" ] } end it "includes the parameters in the config" do should contain_file("/etc/monit/conf.d/background-worker.monitrc").with({ "ensure" => "present", "owner" => "root", "group" => "root", "mode" => "0400", "notify" => "Service[monit]", "content" => %r!check process background-worker with pidfile "/var/run/workerz.pid" start program = "/usr/local/bin/background start" as uid appworker and gid application stop program = "/bin/kill -9 2342" and using the sum depends on systemd-database group workers!m }) end end context "with parameters and matching" do let(:title) { "irc-bot" } let(:params) do { :matching => "hubot -a irc -n botsy", :start => "/usr/local/bin/hubot -a irc -n botsy", :stop => "/bin/kill -9 2342", :start_extras => "and" } end it "includes the parameters in the config" do should contain_file("/etc/monit/conf.d/irc-bot.monitrc").with({ "ensure" => "present", "owner" => "root", "group" => "root", "mode" => "0400", "notify" => "Service[monit]", "content" => %r!check process irc-bot matching "hubot -a irc -n botsy" start program = "/usr/local/bin/hubot -a irc -n botsy" and stop program = "/bin/kill -9 2342" !m, }) end end end
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <link rel="stylesheet" href="menu.css"/> </head> <body class="panel"> <div class="panel-section <API key>"> <img class="icon-section-header" id="icon" src="../data/on_32.png"/> <div class="text-section-header">noturno</div> <label class="switch"> <input type="checkbox" id="toggle-switch"> <span class="slider round"></span> </label> </div> <div class="panel-section panel-section-tabs"> <div id="display-tab-button" class="<API key> selected">Dashboard</div> <div class="<API key>"></div> <div id="settings-tab-button" class="<API key>">Settings</div> </div> <div class="tab-content" id="display-tab" style="display:block;"> <div class="proxy-info"> <div class="card"> <p class="card-category" id="type-info"></p> <h3 class="card-title" id="host-info"></h3> <h3 class="card-subtitle" id="port-info"></h3> </div> </div> </div> <div class="tab-content" id="settings-tab"> <form id="settings-form" class="browser-style"> <div class="panel-section <API key>"> <div class="<API key>"> <select id="type" title="Proxy protocol"> <option value="" disabled selected>Protocol</option> <option value="http">HTTP</option> <option value="https">HTTPS</option> <option value="socks4">SOCKS4</option> <option value="socks">SOCKS5</option> </select> </div> <div class="<API key>"> <input type="text" id="host" placeholder="Host" title="Proxy server hostname"> </div> <div class="<API key>"> <input type="text" id="port" placeholder="Port" title="Proxy server port"> </div> <span class="text-error" id="error-type"></span> <span class="text-error" id="error-host"></span> <span class="text-error" id="error-port"></span> <div class="<API key>"> <button type="submit" class="browser-style default save">Save</button> </div> </div> </form> </div> <script src="menu.js"></script> </body> </html>
package jkcemu.tools.debugger; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import java.awt.event.WindowEvent; import java.util.EventObject; import javax.swing.JLabel; import javax.swing.JSeparator; import javax.swing.JTextField; import jkcemu.base.HexDocument; public class InputBreakpointDlg extends <API key> { private HexDocument docBegPort; private HexDocument docEndPort; private JTextField fldBegPort; private JTextField fldEndPort; public InputBreakpointDlg( DebugFrm debugFrm, AbstractBreakpoint breakpoint ) { super( debugFrm, "Eingabetor", breakpoint ); // Fensterinhalt setLayout( new GridBagLayout() ); GridBagConstraints gbc = new GridBagConstraints( 0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets( 5, 5, 0, 5 ), 0, 0 ); add( new JLabel( "Eingabeadresse (8 oder 16 Bit):" ), gbc ); this.docBegPort = new HexDocument( 4 ); this.fldBegPort = new JTextField( this.docBegPort, "", 4 ); gbc.anchor = GridBagConstraints.WEST; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.weightx = 1.0; gbc.gridx++; add( this.fldBegPort, gbc ); gbc.fill = GridBagConstraints.NONE; gbc.weightx = 0.0; gbc.insets.bottom = 5; gbc.gridx = 0; gbc.gridy++; add( new JLabel( "Bis Eingabeadresse (optional):" ), gbc ); this.docEndPort = new HexDocument( 4 ); this.fldEndPort = new JTextField( this.docEndPort, "", 4 ); gbc.anchor = GridBagConstraints.WEST; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.weightx = 1.0; gbc.gridx++; add( this.fldEndPort, gbc ); gbc.fill = GridBagConstraints.HORIZONTAL; gbc.weightx = 1.0; gbc.insets.top = 10; gbc.gridwidth = GridBagConstraints.REMAINDER; gbc.gridx = 0; gbc.gridy++; add( new JSeparator(), gbc ); gbc.anchor = GridBagConstraints.CENTER; gbc.fill = GridBagConstraints.NONE; gbc.weightx = 0.0; gbc.insets.top = 5; gbc.gridy++; add( <API key>(), gbc ); // Vorbelegungen if( breakpoint != null ) { if( breakpoint instanceof InputBreakpoint ) { InputBreakpoint bp = (InputBreakpoint) breakpoint; int n = (bp.get8Bit() ? 2 : 4); this.docBegPort.setValue( bp.getBegPort(), n ); int endPort = bp.getEndPort(); if( endPort >= 0 ) { this.docEndPort.setValue( endPort, n ); } } } // Fenstergroesse und -position pack(); setParentCentered(); setResizable( true ); // Sonstiges this.fldBegPort.setColumns( 0 ); this.fldEndPort.setColumns( 0 ); this.fldBegPort.addActionListener( this ); this.fldEndPort.addActionListener( this ); } @Override protected boolean doAction( EventObject e ) { boolean rv = false; if( e != null ) { Object src = e.getSource(); if( src != null ) { if( src == this.fldBegPort ) { rv = true; this.fldEndPort.requestFocus(); } else if( src == this.fldEndPort ) { rv = true; doApprove(); } } } if( !rv ) { rv = super.doAction( e ); } return rv; } @Override protected void doApprove() { String fldName = "Ausgabeadresse"; try { boolean is8Bit = false; int begPort = this.docBegPort.intValue() & 0xFFFF; String begText = this.fldBegPort.getText(); if( begText != null ) { if( begText.trim().length() < 3 ) { is8Bit = true; begPort &= 0xFF; } } int endPort = -1; Integer tmpEndPort = this.docEndPort.getInteger(); if( tmpEndPort != null ) { endPort = tmpEndPort.intValue() & 0xFFFF; if( is8Bit ) { endPort &= 0xFF; } } approveBreakpoint( new InputBreakpoint( this.debugFrm, is8Bit, begPort, endPort ) ); } catch( <API key> ex ) { showInvalidFmt( fldName ); } } @Override public void windowOpened( WindowEvent e ) { if( this.fldBegPort != null ) this.fldBegPort.requestFocus(); } }
<?php namespace shonflower\Http\Requests; use shonflower\Http\Requests\Request; class <API key> extends Request { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return [ 'nombre' => 'required', 'nombre_categoria' => 'required' ]; } }
title: Conflict on Yavin 4 (<API key>) category: tournament # Conflict on Yavin 4 * Planet: Yavin 4 * Start date: 2017-08-31 * End date: 2017-09-06 ## Rewards * Carbonite II League: A "[Carbonite Conflict Crate (<API key>)](<API key>.html)" * Carbonite I League: 2 "[Carbonite Conflict Crates (<API key>)](<API key>.html)" * Durasteel I League: A "[Durasteel Conflict Crate (<API key>)](<API key>.html)" * Durasteel II League: 2 "[Durasteel Conflict Crates (<API key>)](<API key>.html)" * Bronzium II League: A "[Bronzium Conflict Crate (<API key>)](<API key>.html)" * Bronzium I League: 2 "[Bronzium Conflict Crates (<API key>)](<API key>.html)" * Obsidian League: A "[Obsidian Conflict Crate (<API key>)](<API key>.html)" * Ultra Chrome League: A "[Ultra Chrome Conflict Crate (<API key>)](<API key>.html)"
# coding=utf-8 # This file is part of the GW DetChar python package. # GW DetChar is free software: you can redistribute it and/or modify # (at your option) any later version. # GW DetChar is distributed in the hope that it will be useful, # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the """Unit tests for gwdetchar.nagios """ import os import json import shutil from .. import core __author__ = 'Alex Urban <alexander.urban@ligo.org>' def test_write_status(tmpdir): outdir = str(tmpdir) nagiosfile = os.path.join(outdir, 'nagios.json') core.write_status( 'This is a test success message', 0, timeout=42, tmessage='This is a test timeout message', nagiosfile=nagiosfile, ) # test output with open(nagiosfile, 'r') as fobj: status = json.load(fobj) assert isinstance(status['created_gps'], int) assert isinstance(status['status_intervals'], list) assert len(status['status_intervals']) == 2 # clean up shutil.rmtree(outdir, ignore_errors=True)
#include "Parameters.h" #include <stdlib.h> Parameters* Parameters::instance = NULL; Parameters::Parameters() { g_window.width = 1200; g_window.height = 600; g_window.major = 3; g_window.minor = 2; g_window.msaa_factor = 1; // multisampling level g_window.<API key> = true; // fixed sample locations for msaa <API key>.p = gk::TVec2<float>(0, 0); <API key>.mag = 1; g_capture.enabled = false; g_capture.count = 0; g_capture.frame = 0; g_geometry.affine.identity(); g_geometry.pingpong = 1; g_geometry.freeze = false; g_geometry.scale[0] = 512; g_geometry.scale[1] = 512; g_geometry.scale[2] = 512; g_camera.fovy = 45.f; g_camera.znear = 0.01f; g_camera.zfar = 10000.f; g_camera.exposure = 3.f; g_mouse = MOUSE_GEOMETRY; g_draw_cells = false; g_draw_triangles = true; g_culling = true; //g_fromtexture = true; g_solid_wireframe = true; g_controls = false; g_gui = true; //g_radial_length = true; //g_textured_data = false; g_auto_refine = true; g_triangle_normals = false; g_curv_dir = 0; g_curv_val = 1; g_lvl = 2; g_ground_truth = 1; g_adaptive_geom = true; g_radius_show = true; g_curvradius = 8.0; g_curvmin = -0.5; g_curvmax = 0.5; g_scale = 10.0; g_tessel = 1.0; //g_isosurface = 0; g_export = false; g_compute_min_max = true; g_sizetex = 0; g_time_elapsed = 0; } Parameters* Parameters::getInstance() { if (instance == NULL) instance = new Parameters(); return instance; }
<!DOCTYPE HTML PUBLIC "- <!--NewPage <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_33) on Fri Aug 03 11:43:01 PDT 2012 --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE> Uses of Class com.hp.hpl.jena.sparql.expr.E_StrLang (Apache Jena ARQ) </TITLE> <META NAME="date" CONTENT="2012-08-03"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class com.hp.hpl.jena.sparql.expr.E_StrLang (Apache Jena ARQ)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <A NAME="navbar_top"></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../com/hp/hpl/jena/sparql/expr/E_StrLang.html" title="class in com.hp.hpl.jena.sparql.expr"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../../index.html?com/hp/hpl/jena/sparql/expr//class-useE_StrLang.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="E_StrLang.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <! if(window==top) { document.writeln('<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <HR> <CENTER> <H2> <B>Uses of Class<br>com.hp.hpl.jena.sparql.expr.E_StrLang</B></H2> </CENTER> No usage of com.hp.hpl.jena.sparql.expr.E_StrLang <P> <HR> <A NAME="navbar_bottom"></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="<API key>"></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../com/hp/hpl/jena/sparql/expr/E_StrLang.html" title="class in com.hp.hpl.jena.sparql.expr"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../../index.html?com/hp/hpl/jena/sparql/expr//class-useE_StrLang.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="E_StrLang.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <! if(window==top) { document.writeln('<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <HR> Licenced under the Apache License, Version 2.0 </BODY> </HTML>
<?php define( 'SECURITY_CONST', true ); define( 'SYS_PATH', realpath( dirname( __FILE__ ) ) ); require_once 'core/autoload.php'; require_once 'core/input.php'; require_once 'core/request.php'; require_once 'core/route.php'; require_once 'core/view.php'; class Launcher { const LIBRARY = 'library'; const CONFIG = 'config'; const CONTROLLER = 'controller'; const VIEW = 'view'; static private $_application = null; /** Method: run Run an application. Parameters: $application - (string) Directory of the application. $config - (string) Name of the configuration. */ static public function run( $application, $config = null ) { !isset( self::$_application ) or exit( 'Multiple Launcher Access Denied' ); self::$_application = $application; $ds = DIRECTORY_SEPARATOR; $cwd = dirname( $_SERVER[ 'SCRIPT_FILENAME' ] ); // Register autoload function to load following classes Autoload::initialize(); // Set autoload directories (controller, app & sys library) Autoload::register( array( $cwd.$ds.$application.$ds.self::CONTROLLER, $cwd.$ds.$application.$ds.self::LIBRARY, SYS_PATH.$ds.self::LIBRARY ) ); // Set the default view directory View::directory( $cwd.$ds.$application.$ds.self::VIEW ); // Load the configuration file if ( isset( $config ) ) { require_once $cwd.$ds.$application.$ds.self::CONFIG.$ds.$config.'.php'; } // Retrieve the request and process it $path = Input::path(); $request = new Request( $path ); echo $request->toString(); } }
package org.ijsberg.iglu.sample.configuration; public interface NotifierInterface { }