code stringlengths 3 1.01M | repo_name stringlengths 5 116 | path stringlengths 3 311 | language stringclasses 30 values | license stringclasses 15 values | size int64 3 1.01M |
|---|---|---|---|---|---|
----------------------------------
-- Area: Valkurm Dunes
-- NM: Valkurm Emperor
-----------------------------------
-----------------------------------
-- onMobDeath
-----------------------------------
function onMobDeath(mob,killer)
-- Set VE's Window Open Time
SetServerVariable("[POP]Valkurm_Emperor", os.time(t) + 3600); -- 1 hour
DeterMob(mob:getID(), true);
-- Set PH back to normal, then set to respawn spawn
PH = GetServerVariable("[PH]Valkurm_Emperor");
SetServerVariable("[PH]Valkurm_Emperor", 0);
DeterMob(PH, false);
SpawnMob(PH, '', GetMobRespawnTime(PH));
end;
-----------------------------------
-- onMobDespawn
-----------------------------------
function OnMobDespawn(mob)
SetServerVariable("[POP]Valkurm_Emperor", os.time(t) + 3600); -- 1 hour
DeterMob(mob:getID(), true);
-- Set PH back to normal, then set to respawn spawn
PH = GetServerVariable("[PH]Valkurm_Emperor");
SetServerVariable("[PH]Valkurm_Emperor", 0);
DeterMob(PH, false);
SpawnMob(PH, '', GetMobRespawnTime(PH));
end;
| ffxinfinity/ffxinfinity | FFXI Server-Development/Build Files/scripts/zones/Valkurm_Dunes/mobs/Valkurm_Emperor.lua | Lua | gpl-3.0 | 1,084 |
#region using directives
using System.Collections.Generic;
using POGOProtos.Inventory;
#endregion
namespace PokemonGo.RocketBot.Logic.Event
{
public class EggsListEvent : IEvent
{
public float PlayerKmWalked { get; set; }
public List<EggIncubator> Incubators { get; set; }
public object UnusedEggs { get; set; }
}
} | vietcv88/test_project | PokemonGo.RocketBot.Logic/Event/EggsListEvent.cs | C# | gpl-3.0 | 357 |
const preferenceManager = require('../utils/preference-manager');
const logout = () => {
preferenceManager.deleteCredentials();
};
module.exports = {
logout,
};
| AutolabJS/autolabcli | lib/model/exit.js | JavaScript | gpl-3.0 | 167 |
package com.fastaccess.ui.modules.intro;
import android.support.annotation.NonNull;
import com.fastaccess.ui.base.mvp.presenter.BasePresenter;
/**
* Created by Kosh on 06 Nov 2016, 12:31 PM
*/
public class IntroPagePresenter extends BasePresenter<IntroPageMvp.View> implements IntroPageMvp.Presenter {
protected IntroPagePresenter(@NonNull IntroPageMvp.View view) {
super(view);
}
public static IntroPagePresenter with(@NonNull IntroPageMvp.View view) {
return new IntroPagePresenter(view);
}
}
| k0shk0sh/Fast-Access-Floating-Toolbox- | app/src/main/java/com/fastaccess/ui/modules/intro/IntroPagePresenter.java | Java | gpl-3.0 | 534 |
/* -*- mode: C -*-
*
* File: rec-sex-parser.c
* Date: Tue Jan 12 18:01:37 2010
*
* GNU recutils - Sexy parser
*
*/
/* Copyright (C) 2010, 2011, 2012 Jose E. Marchesi */
/* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <rec-sex-parser.h>
#include "rec-sex-tab.h"
/*#include "rec-sex-lex.h" */
/*
* Data types
*/
struct rec_sex_parser_s
{
char *in; /* String to be parsed. */
size_t index; /* Index in in_str. */
void *scanner; /* Flex scanner. */
bool case_insensitive;
rec_sex_ast_t ast;
};
/*
* Public functions
*/
rec_sex_parser_t
rec_sex_parser_new (void)
{
rec_sex_parser_t new;
new = malloc (sizeof (struct rec_sex_parser_s));
if (new)
{
new->in = NULL;
new->index = 0;
new->case_insensitive = false;
/* Initialize the sexy scanner. */
sexlex_init (&(new->scanner));
sexset_extra (new, new->scanner);
}
return new;
}
void *
rec_sex_parser_scanner (rec_sex_parser_t parser)
{
return parser->scanner;
}
void
rec_sex_parser_destroy (rec_sex_parser_t parser)
{
if (parser->scanner)
{
sexlex_destroy (parser->scanner);
}
free (parser->in);
free (parser);
}
rec_sex_ast_t
rec_sex_parser_ast (rec_sex_parser_t parser)
{
return parser->ast;
}
void
rec_sex_parser_set_ast (rec_sex_parser_t parser,
rec_sex_ast_t ast)
{
parser->ast = ast;
}
bool
rec_sex_parser_case_insensitive (rec_sex_parser_t parser)
{
return parser->case_insensitive;
}
void
rec_sex_parser_set_case_insensitive (rec_sex_parser_t parser,
bool case_insensitive)
{
parser->case_insensitive = case_insensitive;
}
void
rec_sex_parser_set_in (rec_sex_parser_t parser,
const char *str)
{
if (parser->in)
{
free (parser->in);
parser->in = NULL;
}
parser->in = strdup (str);
parser->index = 0;
}
int
rec_sex_parser_getc (rec_sex_parser_t parser)
{
int res;
res = -1;
if ((parser->in)
&& (parser->index < strlen (parser->in)))
{
res = parser->in[parser->index++];
}
return res;
}
bool
rec_sex_parser_run (rec_sex_parser_t parser,
const char *expr)
{
int res;
rec_sex_parser_set_in (parser, expr);
if (!sexparse (parser))
{
res = true;
}
else
{
/* Parse error. */
res = false;
}
return res;
}
void
rec_sex_parser_print_ast (rec_sex_parser_t parser)
{
rec_sex_ast_print (parser->ast);
}
/* End of rec-sex-parser.c */
| sidthekidder/recutils | src/rec-sex-parser.c | C | gpl-3.0 | 3,266 |
<div class="social-login">
<a ng-click="facebookLogin()" class="button oauth-login facebook-login">
<img src="/img/icon-facebook.png"
alt="{{ 'user.login.facebook.icon' | translate }}" />
<span translate="user.login.facebook">
</a>
<<<<<<< HEAD
<!--<a ng-click="twitterLogin()" class="button oauth-login twitter-login">
<img src="/img/icon-twitter.png" alt="twitter icon" />
{{ message }} with Twitter
</a>-->
<!--<div class="col-md-4">
<a ng-click="linkedinLogin()" class="btn btn-default social-login-btn linkedin-login-btn">
<img src="/img/icon-linkedin.png" alt="linkedin icon" />
{{ message }} with LinkedIn
=======
<a ng-click="twitterLogin()" class="button oauth-login twitter-login">
<img src="/img/icon-twitter.png"
alt="{{ 'user.login.twitter.icon' | translate }}" />
<span translate="user.login.twitter">
</a>
<!--
<a ng-click="linkedinLogin()" class="button oauth-login linkedin-login">
<img src="/img/icon-linkedin.png"
alt="{{ 'user.login.linkedin.icon' | translate }}" />
<span translate="user.login.linkedin">
>>>>>>> 08501d0eeefc8c97a93ec86e14ff06258e2abcef
</a>
-->
</div>
| werdnanoslen/walt-madison | public/templates/social-login.html | HTML | gpl-3.0 | 1,193 |
//
// Created by sascha on 24.05.19.
//
#include <libpq-fe.h>
#include <regex>
#include "matador/sql/database_error.hpp"
#include "matador/db/postgresql/postgresql_connection.hpp"
#include "matador/db/postgresql/postgresql_statement.hpp"
#include "matador/db/postgresql/postgresql_exception.hpp"
#include "matador/db/postgresql/postgresql_result.hpp"
namespace matador {
namespace postgresql {
postgresql_connection::postgresql_connection()
:is_open_(false)
{}
postgresql_connection::~postgresql_connection()
{
close();
}
bool postgresql_connection::is_open() const
{
return is_open_;
}
unsigned long postgresql_connection::last_inserted_id()
{
return 0;
}
void postgresql_connection::open(const std::string &dns)
{
if (is_open_) {
return;
}
static const std::regex DNS_RGX("(.+?)(?::(.+?))?@([^:]+?)(?::([1-9][0-9]*?))?/(.+)");
std::smatch what;
if (!std::regex_match(dns, what, DNS_RGX)) {
throw std::logic_error("mysql:connect invalid dns: " + dns);
}
const std::string user = what[1].str();
const std::string passwd = what[2].str();
const std::string host = what[3].str();
std::string port = "5432";
if (what[4].matched) {
port = what[4].str();
}
db_ = what[5].str();
std::string connection("user=" + user + " password=" + passwd + " host=" + host + " dbname=" + db_ + " port=" + port);
conn_ = PQconnectdb(connection.c_str());
if (PQstatus(conn_) == CONNECTION_BAD) {
std::string msg = PQerrorMessage(conn_);
PQfinish(conn_);
throw database_error(msg, "postgresql", "42000");
}
is_open_ = true;
}
void postgresql_connection::close()
{
if (is_open_) {
PQfinish(conn_);
is_open_ = false;
}
}
detail::result_impl *postgresql_connection::execute(const matador::sql &sql)
{
std::string stmt = dialect_.direct(sql);
return execute_internal(stmt);
}
detail::result_impl *postgresql_connection::execute(const std::string &stmt)
{
return execute_internal(stmt);
}
detail::statement_impl *postgresql_connection::prepare(const matador::sql &stmt)
{
return new postgresql_statement(*this, stmt);
}
void postgresql_connection::begin()
{
// TODO: check result
std::unique_ptr<postgresql_result> res(execute_internal("START TRANSACTION;"));
}
void postgresql_connection::commit()
{
// TODO: check result
std::unique_ptr<postgresql_result> res(execute_internal("COMMIT;"));
}
void postgresql_connection::rollback()
{
// TODO: check result
std::unique_ptr<postgresql_result> res(execute_internal("ROLLBACK;"));
}
std::string postgresql_connection::type() const
{
return "postgresql";
}
std::string postgresql_connection::client_version() const
{
return "";
}
std::string postgresql_connection::server_version() const
{
return "";
}
bool postgresql_connection::exists(const std::string &tablename)
{
std::string stmt("SELECT 1 FROM information_schema.tables WHERE table_schema = 'public' AND table_name = '" + tablename + "'");
std::unique_ptr<postgresql_result> res(execute_internal(stmt));
return res->result_rows() == 1;
}
std::vector<field> postgresql_connection::describe(const std::string &table)
{
std::string stmt(
"SELECT ordinal_position, column_name, udt_name, data_type, is_nullable, column_default FROM information_schema.columns WHERE table_schema='public' AND table_name='" + table + "'");
std::unique_ptr<postgresql_result> res(execute_internal(stmt));
std::vector<field> fields;
if (res->result_rows() == 0) {
return fields;
}
do {
field f;
char *end = nullptr;
f.index(strtoul(res->column(0), &end, 10) - 1);
f.name(res->column(1));
f.type(dialect_.string_type(res->column(2)));
end = nullptr;
f.not_null(strtoul(res->column(4), &end, 10) == 0);
f.default_value(res->column(5));
fields.push_back(f);
} while(res->fetch());
return fields;
}
PGconn *postgresql_connection::handle() const
{
return conn_;
}
basic_dialect *postgresql_connection::dialect()
{
return &dialect_;
}
postgresql_result* postgresql_connection::execute_internal(const std::string &stmt)
{
PGresult *res = PQexec(conn_, stmt.c_str());
throw_database_error(res, conn_, "postgresql", stmt);
return new postgresql_result(res);
}
}
}
extern "C"
{
MATADOR_POSTGRESQL_API matador::connection_impl* create_database()
{
return new matador::postgresql::postgresql_connection();
}
MATADOR_POSTGRESQL_API void destroy_database(matador::connection_impl *db)
{
delete db;
}
}
| zussel/matador | src/db/postgresql/postgresql_connection.cpp | C++ | gpl-3.0 | 4,468 |
/*
* This file is part of Cleanflight.
*
* Cleanflight is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Cleanflight is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#define TARGET_BOARD_IDENTIFIER "FF35"
#define USBD_PRODUCT_STRING "FURIOUS F35-LIGHTNING"
#define LED0 PC10 // Blue LED
// #define LED1 PC10 // Red LED
// #define LED2 PC10 // Green LED
#define BEEPER PA1
#define BEEPER_INVERTED
#define USE_DSHOT
// MPU interrupt
#define USE_EXTI
#define GYRO_INT_EXTI PC4
#define USE_MPU_DATA_READY_SIGNAL
#define MPU9250_CS_PIN PC0
#define MPU9250_SPI_BUS BUS_SPI3
#define USE_IMU_MPU9250
#define IMU_MPU9250_ALIGN CW180_DEG
#define USE_MAG
#define USE_MAG_MPU9250
#define MAG_I2C_BUS BUS_I2C1
#define USE_BARO
#define USE_BARO_BMP280
#define BMP280_CS_PIN PC5
#define BMP280_SPI_BUS BUS_SPI3
#define USE_MAX7456
#define MAX7456_CS_PIN PA4
#define MAX7456_SPI_BUS BUS_SPI1
#define USE_VCP
// #define VBUS_SENSING_PIN PA9
#define USE_UART_INVERTER
#define USE_UART1
#define UART1_RX_PIN PA10
#define UART1_TX_PIN PA9
#define USE_UART2
#define UART2_RX_PIN PA3
#define UART2_TX_PIN PA2
#define USE_UART3
#define UART3_RX_PIN PB11
#define UART3_TX_PIN PB10
#define INVERTER_PIN_UART3_RX PA8
#define USE_UART4
#define UART4_RX_PIN PC11
#define UART4_TX_PIN PA0
#define USE_UART5
#define UART5_RX_PIN PD2
#define UART5_TX_PIN PC12
#define USE_UART6
#define UART6_RX_PIN PC7
#define UART6_TX_PIN PC6
#define USE_SOFTSERIAL1
#define SOFTSERIAL_1_RX_PIN PA3 // shared with UART2 RX
#define SOFTSERIAL_1_TX_PIN PA2 // shared with UART2 TX
#define SERIAL_PORT_COUNT 8 //VCP, UART1, UART2, UART3, UART4, UART5, UART6
#define USE_SPI
#define USE_SPI_DEVICE_1
#define SPI1_NSS_PIN NONE
#define SPI1_SCK_PIN PA5
#define SPI1_MISO_PIN PA6
#define SPI1_MOSI_PIN PA7
#define USE_SPI_DEVICE_2
#define SPI2_NSS_PIN NONE
#define SPI2_SCK_PIN PB13
#define SPI2_MISO_PIN PB14
#define SPI2_MOSI_PIN PB15
#define USE_SPI_DEVICE_3
#define SPI3_NSS_PIN PA15
#define SPI3_SCK_PIN PB3
#define SPI3_MISO_PIN PB4
#define SPI3_MOSI_PIN PB5
#define USE_I2C
#define USE_I2C_DEVICE_1
#define I2C1_SCL PB6
#define I2C1_SDA PB7
#define BOARD_HAS_VOLTAGE_DIVIDER
#define USE_ADC
#define ADC_CHANNEL_1_PIN PC3
#define ADC_CHANNEL_2_PIN PC2
#define ADC_CHANNEL_3_PIN PC1
#define AIRSPEED_ADC_CHANNEL ADC_CHN_1
#define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
#define VBAT_ADC_CHANNEL ADC_CHN_3
#define USE_PITOT_MS4525
#define PITOT_I2C_BUS BUS_I2C1
#define TEMPERATURE_I2C_BUS BUS_I2C1
#define BNO055_I2C_BUS BUS_I2C1
#define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_VBAT | FEATURE_CURRENT_METER | FEATURE_OSD | FEATURE_GPS | FEATURE_TELEMETRY)
#define CURRENT_METER_SCALE 250
// Number of available PWM outputs
#define MAX_PWM_OUTPUT_PORTS 6
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
#define TARGET_IO_PORTA 0xffff
#define TARGET_IO_PORTB 0xffff
#define TARGET_IO_PORTC 0xffff
#define TARGET_IO_PORTD (BIT(2))
| AlienFlightINAV/inav | src/main/target/FF_F35_LIGHTNING/target.h | C | gpl-3.0 | 4,077 |
/* pngset.c - storage of image information into info struct
*
* libpng 1.2.5 - October 3, 2002
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
* The functions here are used during reads to store data from the file
* into the info struct, and during writes to store application data
* into the info struct for writing into the file. This abstracts the
* info struct and allows us to change the structure in the future.
*/
#define PNG_INTERNAL
#include <png/png.h>
#if defined(PNG_bKGD_SUPPORTED)
void PNGAPI
png_set_bKGD(png_structp png_ptr, png_infop info_ptr, png_color_16p background)
{
png_debug1(1, "in %s storage function\n", "bKGD");
if (png_ptr == NULL || info_ptr == NULL)
return;
png_memcpy(&(info_ptr->background), background, sizeof(png_color_16));
info_ptr->valid |= PNG_INFO_bKGD;
}
#endif
#if defined(PNG_cHRM_SUPPORTED)
#ifdef PNG_FLOATING_POINT_SUPPORTED
void PNGAPI
png_set_cHRM(png_structp png_ptr, png_infop info_ptr,
double white_x, double white_y, double red_x, double red_y,
double green_x, double green_y, double blue_x, double blue_y)
{
png_debug1(1, "in %s storage function\n", "cHRM");
if (png_ptr == NULL || info_ptr == NULL)
return;
if (white_x < 0.0 || white_y < 0.0 ||
red_x < 0.0 || red_y < 0.0 ||
green_x < 0.0 || green_y < 0.0 ||
blue_x < 0.0 || blue_y < 0.0)
{
png_warning(png_ptr,
"Ignoring attempt to set negative chromaticity value");
return;
}
if (white_x > 21474.83 || white_y > 21474.83 ||
red_x > 21474.83 || red_y > 21474.83 ||
green_x > 21474.83 || green_y > 21474.83 ||
blue_x > 21474.83 || blue_y > 21474.83)
{
png_warning(png_ptr,
"Ignoring attempt to set chromaticity value exceeding 21474.83");
return;
}
info_ptr->x_white = (float)white_x;
info_ptr->y_white = (float)white_y;
info_ptr->x_red = (float)red_x;
info_ptr->y_red = (float)red_y;
info_ptr->x_green = (float)green_x;
info_ptr->y_green = (float)green_y;
info_ptr->x_blue = (float)blue_x;
info_ptr->y_blue = (float)blue_y;
#ifdef PNG_FIXED_POINT_SUPPORTED
info_ptr->int_x_white = (png_fixed_point)(white_x*100000.+0.5);
info_ptr->int_y_white = (png_fixed_point)(white_y*100000.+0.5);
info_ptr->int_x_red = (png_fixed_point)( red_x*100000.+0.5);
info_ptr->int_y_red = (png_fixed_point)( red_y*100000.+0.5);
info_ptr->int_x_green = (png_fixed_point)(green_x*100000.+0.5);
info_ptr->int_y_green = (png_fixed_point)(green_y*100000.+0.5);
info_ptr->int_x_blue = (png_fixed_point)( blue_x*100000.+0.5);
info_ptr->int_y_blue = (png_fixed_point)( blue_y*100000.+0.5);
#endif
info_ptr->valid |= PNG_INFO_cHRM;
}
#endif
#ifdef PNG_FIXED_POINT_SUPPORTED
void PNGAPI
png_set_cHRM_fixed(png_structp png_ptr, png_infop info_ptr,
png_fixed_point white_x, png_fixed_point white_y, png_fixed_point red_x,
png_fixed_point red_y, png_fixed_point green_x, png_fixed_point green_y,
png_fixed_point blue_x, png_fixed_point blue_y)
{
png_debug1(1, "in %s storage function\n", "cHRM");
if (png_ptr == NULL || info_ptr == NULL)
return;
if (white_x < 0 || white_y < 0 ||
red_x < 0 || red_y < 0 ||
green_x < 0 || green_y < 0 ||
blue_x < 0 || blue_y < 0)
{
png_warning(png_ptr,
"Ignoring attempt to set negative chromaticity value");
return;
}
if (white_x > (double) PNG_MAX_UINT || white_y > (double) PNG_MAX_UINT ||
red_x > (double) PNG_MAX_UINT || red_y > (double) PNG_MAX_UINT ||
green_x > (double) PNG_MAX_UINT || green_y > (double) PNG_MAX_UINT ||
blue_x > (double) PNG_MAX_UINT || blue_y > (double) PNG_MAX_UINT)
{
png_warning(png_ptr,
"Ignoring attempt to set chromaticity value exceeding 21474.83");
return;
}
info_ptr->int_x_white = white_x;
info_ptr->int_y_white = white_y;
info_ptr->int_x_red = red_x;
info_ptr->int_y_red = red_y;
info_ptr->int_x_green = green_x;
info_ptr->int_y_green = green_y;
info_ptr->int_x_blue = blue_x;
info_ptr->int_y_blue = blue_y;
#ifdef PNG_FLOATING_POINT_SUPPORTED
info_ptr->x_white = (float)(white_x/100000.);
info_ptr->y_white = (float)(white_y/100000.);
info_ptr->x_red = (float)( red_x/100000.);
info_ptr->y_red = (float)( red_y/100000.);
info_ptr->x_green = (float)(green_x/100000.);
info_ptr->y_green = (float)(green_y/100000.);
info_ptr->x_blue = (float)( blue_x/100000.);
info_ptr->y_blue = (float)( blue_y/100000.);
#endif
info_ptr->valid |= PNG_INFO_cHRM;
}
#endif
#endif
#if defined(PNG_gAMA_SUPPORTED)
#ifdef PNG_FLOATING_POINT_SUPPORTED
void PNGAPI
png_set_gAMA(png_structp png_ptr, png_infop info_ptr, double file_gamma)
{
double gamma;
png_debug1(1, "in %s storage function\n", "gAMA");
if (png_ptr == NULL || info_ptr == NULL)
return;
/* Check for overflow */
if (file_gamma > 21474.83)
{
png_warning(png_ptr, "Limiting gamma to 21474.83");
gamma=21474.83;
}
else
gamma=file_gamma;
info_ptr->gamma = (float)gamma;
#ifdef PNG_FIXED_POINT_SUPPORTED
info_ptr->int_gamma = (int)(gamma*100000.+.5);
#endif
info_ptr->valid |= PNG_INFO_gAMA;
if(gamma == 0.0)
png_warning(png_ptr, "Setting gamma=0");
}
#endif
void PNGAPI
png_set_gAMA_fixed(png_structp png_ptr, png_infop info_ptr, png_fixed_point
int_gamma)
{
png_fixed_point gamma;
png_debug1(1, "in %s storage function\n", "gAMA");
if (png_ptr == NULL || info_ptr == NULL)
return;
if (int_gamma > (png_fixed_point) PNG_MAX_UINT)
{
png_warning(png_ptr, "Limiting gamma to 21474.83");
gamma=PNG_MAX_UINT;
}
else
{
if (int_gamma < 0)
{
png_warning(png_ptr, "Setting negative gamma to zero");
gamma=0;
}
else
gamma=int_gamma;
}
#ifdef PNG_FLOATING_POINT_SUPPORTED
info_ptr->gamma = (float)(gamma/100000.);
#endif
#ifdef PNG_FIXED_POINT_SUPPORTED
info_ptr->int_gamma = gamma;
#endif
info_ptr->valid |= PNG_INFO_gAMA;
if(gamma == 0)
png_warning(png_ptr, "Setting gamma=0");
}
#endif
#if defined(PNG_hIST_SUPPORTED)
void PNGAPI
png_set_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_16p hist)
{
int i;
png_debug1(1, "in %s storage function\n", "hIST");
if (png_ptr == NULL || info_ptr == NULL)
return;
if (info_ptr->num_palette == 0)
{
png_warning(png_ptr,
"Palette size 0, hIST allocation skipped.");
return;
}
#ifdef PNG_FREE_ME_SUPPORTED
png_free_data(png_ptr, info_ptr, PNG_FREE_HIST, 0);
#endif
/* Changed from info->num_palette to 256 in version 1.2.1 */
png_ptr->hist = (png_uint_16p)png_malloc_warn(png_ptr,
(png_uint_32)(256 * sizeof (png_uint_16)));
if (png_ptr->hist == NULL)
{
png_warning(png_ptr, "Insufficient memory for hIST chunk data.");
return;
}
for (i = 0; i < info_ptr->num_palette; i++)
png_ptr->hist[i] = hist[i];
info_ptr->hist = png_ptr->hist;
info_ptr->valid |= PNG_INFO_hIST;
#ifdef PNG_FREE_ME_SUPPORTED
info_ptr->free_me |= PNG_FREE_HIST;
#else
png_ptr->flags |= PNG_FLAG_FREE_HIST;
#endif
}
#endif
void PNGAPI
png_set_IHDR(png_structp png_ptr, png_infop info_ptr,
png_uint_32 width, png_uint_32 height, int bit_depth,
int color_type, int interlace_type, int compression_type,
int filter_type)
{
int rowbytes_per_pixel;
png_debug1(1, "in %s storage function\n", "IHDR");
if (png_ptr == NULL || info_ptr == NULL)
return;
/* check for width and height valid values */
if (width == 0 || height == 0)
png_error(png_ptr, "Image width or height is zero in IHDR");
if (width > PNG_MAX_UINT || height > PNG_MAX_UINT)
png_error(png_ptr, "Invalid image size in IHDR");
/* check other values */
if (bit_depth != 1 && bit_depth != 2 && bit_depth != 4 &&
bit_depth != 8 && bit_depth != 16)
png_error(png_ptr, "Invalid bit depth in IHDR");
if (color_type < 0 || color_type == 1 ||
color_type == 5 || color_type > 6)
png_error(png_ptr, "Invalid color type in IHDR");
if (((color_type == PNG_COLOR_TYPE_PALETTE) && bit_depth > 8) ||
((color_type == PNG_COLOR_TYPE_RGB ||
color_type == PNG_COLOR_TYPE_GRAY_ALPHA ||
color_type == PNG_COLOR_TYPE_RGB_ALPHA) && bit_depth < 8))
png_error(png_ptr, "Invalid color type/bit depth combination in IHDR");
if (interlace_type >= PNG_INTERLACE_LAST)
png_error(png_ptr, "Unknown interlace method in IHDR");
if (compression_type != PNG_COMPRESSION_TYPE_BASE)
png_error(png_ptr, "Unknown compression method in IHDR");
#if defined(PNG_MNG_FEATURES_SUPPORTED)
/* Accept filter_method 64 (intrapixel differencing) only if
* 1. Libpng was compiled with PNG_MNG_FEATURES_SUPPORTED and
* 2. Libpng did not read a PNG signature (this filter_method is only
* used in PNG datastreams that are embedded in MNG datastreams) and
* 3. The application called png_permit_mng_features with a mask that
* included PNG_FLAG_MNG_FILTER_64 and
* 4. The filter_method is 64 and
* 5. The color_type is RGB or RGBA
*/
if((png_ptr->mode&PNG_HAVE_PNG_SIGNATURE)&&png_ptr->mng_features_permitted)
png_warning(png_ptr,"MNG features are not allowed in a PNG datastream\n");
if(filter_type != PNG_FILTER_TYPE_BASE)
{
if(!((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) &&
(filter_type == PNG_INTRAPIXEL_DIFFERENCING) &&
((png_ptr->mode&PNG_HAVE_PNG_SIGNATURE) == 0) &&
(color_type == PNG_COLOR_TYPE_RGB ||
color_type == PNG_COLOR_TYPE_RGB_ALPHA)))
png_error(png_ptr, "Unknown filter method in IHDR");
if(png_ptr->mode&PNG_HAVE_PNG_SIGNATURE)
png_warning(png_ptr, "Invalid filter method in IHDR");
}
#else
if(filter_type != PNG_FILTER_TYPE_BASE)
png_error(png_ptr, "Unknown filter method in IHDR");
#endif
info_ptr->width = width;
info_ptr->height = height;
info_ptr->bit_depth = (png_byte)bit_depth;
info_ptr->color_type =(png_byte) color_type;
info_ptr->compression_type = (png_byte)compression_type;
info_ptr->filter_type = (png_byte)filter_type;
info_ptr->interlace_type = (png_byte)interlace_type;
if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
info_ptr->channels = 1;
else if (info_ptr->color_type & PNG_COLOR_MASK_COLOR)
info_ptr->channels = 3;
else
info_ptr->channels = 1;
if (info_ptr->color_type & PNG_COLOR_MASK_ALPHA)
info_ptr->channels++;
info_ptr->pixel_depth = (png_byte)(info_ptr->channels * info_ptr->bit_depth);
/* check for overflow */
rowbytes_per_pixel = (info_ptr->pixel_depth + 7) >> 3;
if ( width > PNG_MAX_UINT/rowbytes_per_pixel - 64)
{
png_warning(png_ptr,
"Width too large to process image data; rowbytes will overflow.");
info_ptr->rowbytes = (png_size_t)0;
}
else
info_ptr->rowbytes = (info_ptr->width * info_ptr->pixel_depth + 7) >> 3;
}
#if defined(PNG_oFFs_SUPPORTED)
void PNGAPI
png_set_oFFs(png_structp png_ptr, png_infop info_ptr,
png_int_32 offset_x, png_int_32 offset_y, int unit_type)
{
png_debug1(1, "in %s storage function\n", "oFFs");
if (png_ptr == NULL || info_ptr == NULL)
return;
info_ptr->x_offset = offset_x;
info_ptr->y_offset = offset_y;
info_ptr->offset_unit_type = (png_byte)unit_type;
info_ptr->valid |= PNG_INFO_oFFs;
}
#endif
#if defined(PNG_pCAL_SUPPORTED)
void PNGAPI
png_set_pCAL(png_structp png_ptr, png_infop info_ptr,
png_charp purpose, png_int_32 X0, png_int_32 X1, int type, int nparams,
png_charp units, png_charpp params)
{
png_uint_32 length;
int i;
png_debug1(1, "in %s storage function\n", "pCAL");
if (png_ptr == NULL || info_ptr == NULL)
return;
length = png_strlen(purpose) + 1;
png_debug1(3, "allocating purpose for info (%lu bytes)\n", length);
info_ptr->pcal_purpose = (png_charp)png_malloc_warn(png_ptr, length);
if (info_ptr->pcal_purpose == NULL)
{
png_warning(png_ptr, "Insufficient memory for pCAL purpose.");
return;
}
png_memcpy(info_ptr->pcal_purpose, purpose, (png_size_t)length);
png_debug(3, "storing X0, X1, type, and nparams in info\n");
info_ptr->pcal_X0 = X0;
info_ptr->pcal_X1 = X1;
info_ptr->pcal_type = (png_byte)type;
info_ptr->pcal_nparams = (png_byte)nparams;
length = png_strlen(units) + 1;
png_debug1(3, "allocating units for info (%lu bytes)\n", length);
info_ptr->pcal_units = (png_charp)png_malloc_warn(png_ptr, length);
if (info_ptr->pcal_units == NULL)
{
png_warning(png_ptr, "Insufficient memory for pCAL units.");
return;
}
png_memcpy(info_ptr->pcal_units, units, (png_size_t)length);
info_ptr->pcal_params = (png_charpp)png_malloc_warn(png_ptr,
(png_uint_32)((nparams + 1) * sizeof(png_charp)));
if (info_ptr->pcal_params == NULL)
{
png_warning(png_ptr, "Insufficient memory for pCAL params.");
return;
}
info_ptr->pcal_params[nparams] = NULL;
for (i = 0; i < nparams; i++)
{
length = png_strlen(params[i]) + 1;
png_debug2(3, "allocating parameter %d for info (%lu bytes)\n", i, length);
info_ptr->pcal_params[i] = (png_charp)png_malloc_warn(png_ptr, length);
if (info_ptr->pcal_params[i] == NULL)
{
png_warning(png_ptr, "Insufficient memory for pCAL parameter.");
return;
}
png_memcpy(info_ptr->pcal_params[i], params[i], (png_size_t)length);
}
info_ptr->valid |= PNG_INFO_pCAL;
#ifdef PNG_FREE_ME_SUPPORTED
info_ptr->free_me |= PNG_FREE_PCAL;
#endif
}
#endif
#if defined(PNG_READ_sCAL_SUPPORTED) || defined(PNG_WRITE_sCAL_SUPPORTED)
#ifdef PNG_FLOATING_POINT_SUPPORTED
void PNGAPI
png_set_sCAL(png_structp png_ptr, png_infop info_ptr,
int unit, double width, double height)
{
png_debug1(1, "in %s storage function\n", "sCAL");
if (png_ptr == NULL || info_ptr == NULL)
return;
info_ptr->scal_unit = (png_byte)unit;
info_ptr->scal_pixel_width = width;
info_ptr->scal_pixel_height = height;
info_ptr->valid |= PNG_INFO_sCAL;
}
#else
#ifdef PNG_FIXED_POINT_SUPPORTED
void PNGAPI
png_set_sCAL_s(png_structp png_ptr, png_infop info_ptr,
int unit, png_charp swidth, png_charp sheight)
{
png_uint_32 length;
png_debug1(1, "in %s storage function\n", "sCAL");
if (png_ptr == NULL || info_ptr == NULL)
return;
info_ptr->scal_unit = (png_byte)unit;
length = png_strlen(swidth) + 1;
png_debug1(3, "allocating unit for info (%d bytes)\n", length);
info_ptr->scal_s_width = (png_charp)png_malloc(png_ptr, length);
png_memcpy(info_ptr->scal_s_width, swidth, (png_size_t)length);
length = png_strlen(sheight) + 1;
png_debug1(3, "allocating unit for info (%d bytes)\n", length);
info_ptr->scal_s_height = (png_charp)png_malloc(png_ptr, length);
png_memcpy(info_ptr->scal_s_height, sheight, (png_size_t)length);
info_ptr->valid |= PNG_INFO_sCAL;
#ifdef PNG_FREE_ME_SUPPORTED
info_ptr->free_me |= PNG_FREE_SCAL;
#endif
}
#endif
#endif
#endif
#if defined(PNG_pHYs_SUPPORTED)
void PNGAPI
png_set_pHYs(png_structp png_ptr, png_infop info_ptr,
png_uint_32 res_x, png_uint_32 res_y, int unit_type)
{
png_debug1(1, "in %s storage function\n", "pHYs");
if (png_ptr == NULL || info_ptr == NULL)
return;
info_ptr->x_pixels_per_unit = res_x;
info_ptr->y_pixels_per_unit = res_y;
info_ptr->phys_unit_type = (png_byte)unit_type;
info_ptr->valid |= PNG_INFO_pHYs;
}
#endif
void PNGAPI
png_set_PLTE(png_structp png_ptr, png_infop info_ptr,
png_colorp palette, int num_palette)
{
png_debug1(1, "in %s storage function\n", "PLTE");
if (png_ptr == NULL || info_ptr == NULL)
return;
/*
* It may not actually be necessary to set png_ptr->palette here;
* we do it for backward compatibility with the way the png_handle_tRNS
* function used to do the allocation.
*/
#ifdef PNG_FREE_ME_SUPPORTED
png_free_data(png_ptr, info_ptr, PNG_FREE_PLTE, 0);
#endif
/* Changed in libpng-1.2.1 to allocate 256 instead of num_palette entries,
in case of an invalid PNG file that has too-large sample values. */
png_ptr->palette = (png_colorp)png_zalloc(png_ptr, (uInt)256,
sizeof (png_color));
if (png_ptr->palette == NULL)
png_error(png_ptr, "Unable to malloc palette");
png_memcpy(png_ptr->palette, palette, num_palette * sizeof (png_color));
info_ptr->palette = png_ptr->palette;
info_ptr->num_palette = png_ptr->num_palette = (png_uint_16)num_palette;
#ifdef PNG_FREE_ME_SUPPORTED
info_ptr->free_me |= PNG_FREE_PLTE;
#else
png_ptr->flags |= PNG_FLAG_FREE_PLTE;
#endif
info_ptr->valid |= PNG_INFO_PLTE;
}
#if defined(PNG_sBIT_SUPPORTED)
void PNGAPI
png_set_sBIT(png_structp png_ptr, png_infop info_ptr,
png_color_8p sig_bit)
{
png_debug1(1, "in %s storage function\n", "sBIT");
if (png_ptr == NULL || info_ptr == NULL)
return;
png_memcpy(&(info_ptr->sig_bit), sig_bit, sizeof (png_color_8));
info_ptr->valid |= PNG_INFO_sBIT;
}
#endif
#if defined(PNG_sRGB_SUPPORTED)
void PNGAPI
png_set_sRGB(png_structp png_ptr, png_infop info_ptr, int intent)
{
png_debug1(1, "in %s storage function\n", "sRGB");
if (png_ptr == NULL || info_ptr == NULL)
return;
info_ptr->srgb_intent = (png_byte)intent;
info_ptr->valid |= PNG_INFO_sRGB;
}
void PNGAPI
png_set_sRGB_gAMA_and_cHRM(png_structp png_ptr, png_infop info_ptr,
int intent)
{
#if defined(PNG_gAMA_SUPPORTED)
#ifdef PNG_FLOATING_POINT_SUPPORTED
float file_gamma;
#endif
#ifdef PNG_FIXED_POINT_SUPPORTED
png_fixed_point int_file_gamma;
#endif
#endif
#if defined(PNG_cHRM_SUPPORTED)
#ifdef PNG_FLOATING_POINT_SUPPORTED
float white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y;
#endif
#ifdef PNG_FIXED_POINT_SUPPORTED
png_fixed_point int_white_x, int_white_y, int_red_x, int_red_y, int_green_x,
int_green_y, int_blue_x, int_blue_y;
#endif
#endif
png_debug1(1, "in %s storage function\n", "sRGB_gAMA_and_cHRM");
if (png_ptr == NULL || info_ptr == NULL)
return;
png_set_sRGB(png_ptr, info_ptr, intent);
#if defined(PNG_gAMA_SUPPORTED)
#ifdef PNG_FLOATING_POINT_SUPPORTED
file_gamma = (float).45455;
png_set_gAMA(png_ptr, info_ptr, file_gamma);
#endif
#ifdef PNG_FIXED_POINT_SUPPORTED
int_file_gamma = 45455L;
png_set_gAMA_fixed(png_ptr, info_ptr, int_file_gamma);
#endif
#endif
#if defined(PNG_cHRM_SUPPORTED)
#ifdef PNG_FIXED_POINT_SUPPORTED
int_white_x = 31270L;
int_white_y = 32900L;
int_red_x = 64000L;
int_red_y = 33000L;
int_green_x = 30000L;
int_green_y = 60000L;
int_blue_x = 15000L;
int_blue_y = 6000L;
png_set_cHRM_fixed(png_ptr, info_ptr,
int_white_x, int_white_y, int_red_x, int_red_y, int_green_x, int_green_y,
int_blue_x, int_blue_y);
#endif
#ifdef PNG_FLOATING_POINT_SUPPORTED
white_x = (float).3127;
white_y = (float).3290;
red_x = (float).64;
red_y = (float).33;
green_x = (float).30;
green_y = (float).60;
blue_x = (float).15;
blue_y = (float).06;
png_set_cHRM(png_ptr, info_ptr,
white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y);
#endif
#endif
}
#endif
#if defined(PNG_iCCP_SUPPORTED)
void PNGAPI
png_set_iCCP(png_structp png_ptr, png_infop info_ptr,
png_charp name, int compression_type,
png_charp profile, png_uint_32 proflen)
{
png_charp new_iccp_name;
png_charp new_iccp_profile;
png_debug1(1, "in %s storage function\n", "iCCP");
if (png_ptr == NULL || info_ptr == NULL || name == NULL || profile == NULL)
return;
new_iccp_name = (png_charp)png_malloc(png_ptr, png_strlen(name)+1);
png_strcpy(new_iccp_name, name);
new_iccp_profile = (png_charp)png_malloc(png_ptr, proflen);
png_memcpy(new_iccp_profile, profile, (png_size_t)proflen);
png_free_data(png_ptr, info_ptr, PNG_FREE_ICCP, 0);
info_ptr->iccp_proflen = proflen;
info_ptr->iccp_name = new_iccp_name;
info_ptr->iccp_profile = new_iccp_profile;
/* Compression is always zero but is here so the API and info structure
* does not have to change if we introduce multiple compression types */
info_ptr->iccp_compression = (png_byte)compression_type;
#ifdef PNG_FREE_ME_SUPPORTED
info_ptr->free_me |= PNG_FREE_ICCP;
#endif
info_ptr->valid |= PNG_INFO_iCCP;
}
#endif
#if defined(PNG_TEXT_SUPPORTED)
void PNGAPI
png_set_text(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
int num_text)
{
int ret;
ret=png_set_text_2(png_ptr, info_ptr, text_ptr, num_text);
if (ret)
png_error(png_ptr, "Insufficient memory to store text");
}
int /* PRIVATE */
png_set_text_2(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
int num_text)
{
int i;
png_debug1(1, "in %s storage function\n", (png_ptr->chunk_name[0] == '\0' ?
"text" : (png_const_charp)png_ptr->chunk_name));
if (png_ptr == NULL || info_ptr == NULL || num_text == 0)
return(0);
/* Make sure we have enough space in the "text" array in info_struct
* to hold all of the incoming text_ptr objects.
*/
if (info_ptr->num_text + num_text > info_ptr->max_text)
{
if (info_ptr->text != NULL)
{
png_textp old_text;
int old_max;
old_max = info_ptr->max_text;
info_ptr->max_text = info_ptr->num_text + num_text + 8;
old_text = info_ptr->text;
info_ptr->text = (png_textp)png_malloc_warn(png_ptr,
(png_uint_32)(info_ptr->max_text * sizeof (png_text)));
if (info_ptr->text == NULL)
{
png_free(png_ptr, old_text);
return(1);
}
png_memcpy(info_ptr->text, old_text, (png_size_t)(old_max *
sizeof(png_text)));
png_free(png_ptr, old_text);
}
else
{
info_ptr->max_text = num_text + 8;
info_ptr->num_text = 0;
info_ptr->text = (png_textp)png_malloc_warn(png_ptr,
(png_uint_32)(info_ptr->max_text * sizeof (png_text)));
if (info_ptr->text == NULL)
return(1);
#ifdef PNG_FREE_ME_SUPPORTED
info_ptr->free_me |= PNG_FREE_TEXT;
#endif
}
png_debug1(3, "allocated %d entries for info_ptr->text\n",
info_ptr->max_text);
}
for (i = 0; i < num_text; i++)
{
png_size_t text_length,key_len;
png_size_t lang_len,lang_key_len;
png_textp textp = &(info_ptr->text[info_ptr->num_text]);
if (text_ptr[i].key == NULL)
continue;
key_len = png_strlen(text_ptr[i].key);
if(text_ptr[i].compression <= 0)
{
lang_len = 0;
lang_key_len = 0;
}
else
#ifdef PNG_iTXt_SUPPORTED
{
/* set iTXt data */
if (text_ptr[i].lang != NULL)
lang_len = png_strlen(text_ptr[i].lang);
else
lang_len = 0;
if (text_ptr[i].lang_key != NULL)
lang_key_len = png_strlen(text_ptr[i].lang_key);
else
lang_key_len = 0;
}
#else
{
png_warning(png_ptr, "iTXt chunk not supported.");
continue;
}
#endif
if (text_ptr[i].text == NULL || text_ptr[i].text[0] == '\0')
{
text_length = 0;
#ifdef PNG_iTXt_SUPPORTED
if(text_ptr[i].compression > 0)
textp->compression = PNG_ITXT_COMPRESSION_NONE;
else
#endif
textp->compression = PNG_TEXT_COMPRESSION_NONE;
}
else
{
text_length = png_strlen(text_ptr[i].text);
textp->compression = text_ptr[i].compression;
}
textp->key = (png_charp)png_malloc_warn(png_ptr,
(png_uint_32)(key_len + text_length + lang_len + lang_key_len + 4));
if (textp->key == NULL)
return(1);
png_debug2(2, "Allocated %lu bytes at %x in png_set_text\n",
(png_uint_32)(key_len + lang_len + lang_key_len + text_length + 4),
(int)textp->key);
png_memcpy(textp->key, text_ptr[i].key,
(png_size_t)(key_len));
*(textp->key+key_len) = '\0';
#ifdef PNG_iTXt_SUPPORTED
if (text_ptr[i].compression > 0)
{
textp->lang=textp->key + key_len + 1;
png_memcpy(textp->lang, text_ptr[i].lang, lang_len);
*(textp->lang+lang_len) = '\0';
textp->lang_key=textp->lang + lang_len + 1;
png_memcpy(textp->lang_key, text_ptr[i].lang_key, lang_key_len);
*(textp->lang_key+lang_key_len) = '\0';
textp->text=textp->lang_key + lang_key_len + 1;
}
else
#endif
{
#ifdef PNG_iTXt_SUPPORTED
textp->lang=NULL;
textp->lang_key=NULL;
#endif
textp->text=textp->key + key_len + 1;
}
if(text_length)
png_memcpy(textp->text, text_ptr[i].text,
(png_size_t)(text_length));
*(textp->text+text_length) = '\0';
#ifdef PNG_iTXt_SUPPORTED
if(textp->compression > 0)
{
textp->text_length = 0;
textp->itxt_length = text_length;
}
else
#endif
{
textp->text_length = text_length;
#ifdef PNG_iTXt_SUPPORTED
textp->itxt_length = 0;
#endif
}
info_ptr->text[info_ptr->num_text]= *textp;
info_ptr->num_text++;
png_debug1(3, "transferred text chunk %d\n", info_ptr->num_text);
}
return(0);
}
#endif
#if defined(PNG_tIME_SUPPORTED)
void PNGAPI
png_set_tIME(png_structp png_ptr, png_infop info_ptr, png_timep mod_time)
{
png_debug1(1, "in %s storage function\n", "tIME");
if (png_ptr == NULL || info_ptr == NULL ||
(png_ptr->mode & PNG_WROTE_tIME))
return;
png_memcpy(&(info_ptr->mod_time), mod_time, sizeof (png_time));
info_ptr->valid |= PNG_INFO_tIME;
}
#endif
#if defined(PNG_tRNS_SUPPORTED)
void PNGAPI
png_set_tRNS(png_structp png_ptr, png_infop info_ptr,
png_bytep trans, int num_trans, png_color_16p trans_values)
{
png_debug1(1, "in %s storage function\n", "tRNS");
if (png_ptr == NULL || info_ptr == NULL)
return;
if (trans != NULL)
{
/*
* It may not actually be necessary to set png_ptr->trans here;
* we do it for backward compatibility with the way the png_handle_tRNS
* function used to do the allocation.
*/
#ifdef PNG_FREE_ME_SUPPORTED
png_free_data(png_ptr, info_ptr, PNG_FREE_TRNS, 0);
#endif
/* Changed from num_trans to 256 in version 1.2.1 */
png_ptr->trans = info_ptr->trans = (png_bytep)png_malloc(png_ptr,
(png_uint_32)256);
png_memcpy(info_ptr->trans, trans, (png_size_t)num_trans);
#ifdef PNG_FREE_ME_SUPPORTED
info_ptr->free_me |= PNG_FREE_TRNS;
#else
png_ptr->flags |= PNG_FLAG_FREE_TRNS;
#endif
}
if (trans_values != NULL)
{
png_memcpy(&(info_ptr->trans_values), trans_values,
sizeof(png_color_16));
if (num_trans == 0)
num_trans = 1;
}
info_ptr->num_trans = (png_uint_16)num_trans;
info_ptr->valid |= PNG_INFO_tRNS;
}
#endif
#if defined(PNG_sPLT_SUPPORTED)
void PNGAPI
png_set_sPLT(png_structp png_ptr,
png_infop info_ptr, png_sPLT_tp entries, int nentries)
{
png_sPLT_tp np;
int i;
np = (png_sPLT_tp)png_malloc_warn(png_ptr,
(info_ptr->splt_palettes_num + nentries) * sizeof(png_sPLT_t));
if (np == NULL)
{
png_warning(png_ptr, "No memory for sPLT palettes.");
return;
}
png_memcpy(np, info_ptr->splt_palettes,
info_ptr->splt_palettes_num * sizeof(png_sPLT_t));
png_free(png_ptr, info_ptr->splt_palettes);
info_ptr->splt_palettes=NULL;
for (i = 0; i < nentries; i++)
{
png_sPLT_tp to = np + info_ptr->splt_palettes_num + i;
png_sPLT_tp from = entries + i;
to->name = (png_charp)png_malloc(png_ptr,
png_strlen(from->name) + 1);
png_strcpy(to->name, from->name);
to->entries = (png_sPLT_entryp)png_malloc(png_ptr,
from->nentries * sizeof(png_sPLT_t));
png_memcpy(to->entries, from->entries,
from->nentries * sizeof(png_sPLT_t));
to->nentries = from->nentries;
to->depth = from->depth;
}
info_ptr->splt_palettes = np;
info_ptr->splt_palettes_num += nentries;
info_ptr->valid |= PNG_INFO_sPLT;
#ifdef PNG_FREE_ME_SUPPORTED
info_ptr->free_me |= PNG_FREE_SPLT;
#endif
}
#endif /* PNG_sPLT_SUPPORTED */
#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
void PNGAPI
png_set_unknown_chunks(png_structp png_ptr,
png_infop info_ptr, png_unknown_chunkp unknowns, int num_unknowns)
{
png_unknown_chunkp np;
int i;
if (png_ptr == NULL || info_ptr == NULL || num_unknowns == 0)
return;
np = (png_unknown_chunkp)png_malloc_warn(png_ptr,
(info_ptr->unknown_chunks_num + num_unknowns) *
sizeof(png_unknown_chunk));
if (np == NULL)
{
png_warning(png_ptr, "Out of memory while processing unknown chunk.");
return;
}
png_memcpy(np, info_ptr->unknown_chunks,
info_ptr->unknown_chunks_num * sizeof(png_unknown_chunk));
png_free(png_ptr, info_ptr->unknown_chunks);
info_ptr->unknown_chunks=NULL;
for (i = 0; i < num_unknowns; i++)
{
png_unknown_chunkp to = np + info_ptr->unknown_chunks_num + i;
png_unknown_chunkp from = unknowns + i;
png_strcpy((png_charp)to->name, (png_charp)from->name);
to->data = (png_bytep)png_malloc(png_ptr, from->size);
if (to->data == NULL)
png_warning(png_ptr, "Out of memory while processing unknown chunk.");
else
{
png_memcpy(to->data, from->data, from->size);
to->size = from->size;
/* note our location in the read or write sequence */
to->location = (png_byte)(png_ptr->mode & 0xff);
}
}
info_ptr->unknown_chunks = np;
info_ptr->unknown_chunks_num += num_unknowns;
#ifdef PNG_FREE_ME_SUPPORTED
info_ptr->free_me |= PNG_FREE_UNKN;
#endif
}
void PNGAPI
png_set_unknown_chunk_location(png_structp png_ptr, png_infop info_ptr,
int chunk, int location)
{
if(png_ptr != NULL && info_ptr != NULL && chunk >= 0 && chunk <
(int)info_ptr->unknown_chunks_num)
info_ptr->unknown_chunks[chunk].location = (png_byte)location;
}
#endif
#if defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \
defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED)
void PNGAPI
png_permit_empty_plte (png_structp png_ptr, int empty_plte_permitted)
{
/* This function is deprecated in favor of png_permit_mng_features()
and will be removed from libpng-2.0.0 */
png_debug(1, "in png_permit_empty_plte, DEPRECATED.\n");
if (png_ptr == NULL)
return;
png_ptr->mng_features_permitted = (png_byte)
((png_ptr->mng_features_permitted & (~(PNG_FLAG_MNG_EMPTY_PLTE))) |
((empty_plte_permitted & PNG_FLAG_MNG_EMPTY_PLTE)));
}
#endif
#if defined(PNG_MNG_FEATURES_SUPPORTED)
png_uint_32 PNGAPI
png_permit_mng_features (png_structp png_ptr, png_uint_32 mng_features)
{
png_debug(1, "in png_permit_mng_features\n");
if (png_ptr == NULL)
return (png_uint_32)0;
png_ptr->mng_features_permitted =
(png_byte)(mng_features & PNG_ALL_MNG_FEATURES);
return (png_uint_32)png_ptr->mng_features_permitted;
}
#endif
#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
void PNGAPI
png_set_keep_unknown_chunks(png_structp png_ptr, int keep, png_bytep
chunk_list, int num_chunks)
{
png_bytep new_list, p;
int i, old_num_chunks;
if (num_chunks == 0)
{
if(keep == HANDLE_CHUNK_ALWAYS || keep == HANDLE_CHUNK_IF_SAFE)
png_ptr->flags |= PNG_FLAG_KEEP_UNKNOWN_CHUNKS;
else
png_ptr->flags &= ~PNG_FLAG_KEEP_UNKNOWN_CHUNKS;
if(keep == HANDLE_CHUNK_ALWAYS)
png_ptr->flags |= PNG_FLAG_KEEP_UNSAFE_CHUNKS;
else
png_ptr->flags &= ~PNG_FLAG_KEEP_UNSAFE_CHUNKS;
return;
}
if (chunk_list == NULL)
return;
old_num_chunks=png_ptr->num_chunk_list;
new_list=(png_bytep)png_malloc(png_ptr,
(png_uint_32)(5*(num_chunks+old_num_chunks)));
if(png_ptr->chunk_list != NULL)
{
png_memcpy(new_list, png_ptr->chunk_list,
(png_size_t)(5*old_num_chunks));
png_free(png_ptr, png_ptr->chunk_list);
png_ptr->chunk_list=NULL;
}
png_memcpy(new_list+5*old_num_chunks, chunk_list,
(png_size_t)(5*num_chunks));
for (p=new_list+5*old_num_chunks+4, i=0; i<num_chunks; i++, p+=5)
*p=(png_byte)keep;
png_ptr->num_chunk_list=old_num_chunks+num_chunks;
png_ptr->chunk_list=new_list;
#ifdef PNG_FREE_ME_SUPPORTED
png_ptr->free_me |= PNG_FREE_LIST;
#endif
}
#endif
#if defined(PNG_READ_USER_CHUNKS_SUPPORTED)
void PNGAPI
png_set_read_user_chunk_fn(png_structp png_ptr, png_voidp user_chunk_ptr,
png_user_chunk_ptr read_user_chunk_fn)
{
png_debug(1, "in png_set_read_user_chunk_fn\n");
png_ptr->read_user_chunk_fn = read_user_chunk_fn;
png_ptr->user_chunk_ptr = user_chunk_ptr;
}
#endif
#if defined(PNG_INFO_IMAGE_SUPPORTED)
void PNGAPI
png_set_rows(png_structp png_ptr, png_infop info_ptr, png_bytepp row_pointers)
{
png_debug1(1, "in %s storage function\n", "rows");
if (png_ptr == NULL || info_ptr == NULL)
return;
if(info_ptr->row_pointers && (info_ptr->row_pointers != row_pointers))
png_free_data(png_ptr, info_ptr, PNG_FREE_ROWS, 0);
info_ptr->row_pointers = row_pointers;
if(row_pointers)
info_ptr->valid |= PNG_INFO_IDAT;
}
#endif
void PNGAPI
png_set_compression_buffer_size(png_structp png_ptr, png_uint_32 size)
{
if(png_ptr->zbuf)
png_free(png_ptr, png_ptr->zbuf);
png_ptr->zbuf_size = (png_size_t)size;
png_ptr->zbuf = (png_bytep)png_malloc(png_ptr, size);
png_ptr->zstream.next_out = png_ptr->zbuf;
png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
}
void PNGAPI
png_set_invalid(png_structp png_ptr, png_infop info_ptr, int mask)
{
if (png_ptr && info_ptr)
info_ptr->valid &= ~(mask);
}
#ifndef PNG_1_0_X
#ifdef PNG_ASSEMBLER_CODE_SUPPORTED
/* this function was added to libpng 1.2.0 and should always exist by default */
void PNGAPI
png_set_asm_flags (png_structp png_ptr, png_uint_32 asm_flags)
{
png_uint_32 settable_asm_flags;
png_uint_32 settable_mmx_flags;
settable_mmx_flags =
#ifdef PNG_HAVE_ASSEMBLER_COMBINE_ROW
PNG_ASM_FLAG_MMX_READ_COMBINE_ROW |
#endif
#ifdef PNG_HAVE_ASSEMBLER_READ_INTERLACE
PNG_ASM_FLAG_MMX_READ_INTERLACE |
#endif
#ifdef PNG_HAVE_ASSEMBLER_READ_FILTER_ROW
PNG_ASM_FLAG_MMX_READ_FILTER_SUB |
PNG_ASM_FLAG_MMX_READ_FILTER_UP |
PNG_ASM_FLAG_MMX_READ_FILTER_AVG |
PNG_ASM_FLAG_MMX_READ_FILTER_PAETH |
#endif
0;
/* could be some non-MMX ones in the future, but not currently: */
settable_asm_flags = settable_mmx_flags;
if (!(png_ptr->asm_flags & PNG_ASM_FLAG_MMX_SUPPORT_COMPILED) ||
!(png_ptr->asm_flags & PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU))
{
/* clear all MMX flags if MMX isn't supported */
settable_asm_flags &= ~settable_mmx_flags;
png_ptr->asm_flags &= ~settable_mmx_flags;
}
/* we're replacing the settable bits with those passed in by the user,
* so first zero them out of the master copy, then logical-OR in the
* allowed subset that was requested */
png_ptr->asm_flags &= ~settable_asm_flags; /* zero them */
png_ptr->asm_flags |= (asm_flags & settable_asm_flags); /* set them */
}
#endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */
#ifdef PNG_ASSEMBLER_CODE_SUPPORTED
/* this function was added to libpng 1.2.0 */
void PNGAPI
png_set_mmx_thresholds (png_structp png_ptr,
png_byte mmx_bitdepth_threshold,
png_uint_32 mmx_rowbytes_threshold)
{
png_ptr->mmx_bitdepth_threshold = mmx_bitdepth_threshold;
png_ptr->mmx_rowbytes_threshold = mmx_rowbytes_threshold;
}
#endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */
#endif /* ?PNG_1_0_X */
| Halajohn/kiwin | src/png/pngset.c | C | gpl-3.0 | 36,436 |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# beta.1 Dailymotion
# Version 0.1 (10.12.2014)
#------------------------------------------------------------
# License: GPL (http://www.gnu.org/licenses/gpl-3.0.html)
# Gracias a la librería plugintools de Jesús (www.mimediacenter.info)
import os
import sys
import urllib
import urllib2
import re
import shutil
import zipfile
import time
import xbmc
import xbmcgui
import xbmcaddon
import xbmcplugin
import plugintools
import json
import math
home = xbmc.translatePath(os.path.join('special://home/addons/plugin.video.arena+/', ''))
tools = xbmc.translatePath(os.path.join('special://home/addons/plugin.video.arena+/resources/tools', ''))
addons = xbmc.translatePath(os.path.join('special://home/addons/', ''))
resources = xbmc.translatePath(os.path.join('special://home/addons/plugin.video.arena+/resources', ''))
art = xbmc.translatePath(os.path.join('special://home/addons/plugin.video.arena+/art', ''))
tmp = xbmc.translatePath(os.path.join('special://home/addons/plugin.video.arena+/tmp', ''))
playlists = xbmc.translatePath(os.path.join('special://home/addons/playlists', ''))
icon = art + 'icon.png'
fanart = 'fanart.jpg'
def dailym_getplaylist(url):
plugintools.log("beta.1.dailymotion_playlists "+url)
# Fetch video list from Dailymotion playlist user
data = plugintools.read(url)
#plugintools.log("data= "+data)
# Extract items from feed
pattern = ""
matches = plugintools.find_multiple_matches(data,'{"(.*?)}')
pattern = '{"(.*?)},{'
for entry in matches:
plugintools.log("entry="+entry)
title = plugintools.find_single_match(entry,'name":"(.*?)"')
title = title.replace("\u00e9" , "é")
title = title.replace("\u00e8" , "è")
title = title.replace("\u00ea" , "ê")
title = title.replace("\u00e0" , "à")
plugintools.log("title= "+title)
id_playlist = plugintools.find_single_match(entry,'id":"(.*?)",')
if id_playlist:
plugintools.log("id_playlist= "+id_playlist)
return id_playlist
def dailym_getvideo(url):
plugintools.log("beta.1.dailymotion_videos "+url)
# Fetch video list from Dailymotion feed
data = plugintools.read(url)
#plugintools.log("data= "+data)
# Extract items from feed
pattern = ""
matches = plugintools.find_multiple_matches(data,'{"(.*?)}')
pattern = '{"(.*?)},{'
for entry in matches:
plugintools.log("entry= "+entry)
# Not the better way to parse XML, but clean and easy
title = plugintools.find_single_match(entry,'title":"(.*?)"')
title = title.replace("\u00e9" , "é")
title = title.replace("\u00e8" , "è")
title = title.replace("\u00ea" , "ê")
title = title.replace("\u00e0" , "à")
video_id = plugintools.find_single_match(entry,'id":"(.*?)",')
if video_id:
plugintools.log("video_id= "+video_id)
return video_id
def dailym_pl(params):
plugintools.log("dailym_pl "+repr(params))
pl = params.get("url")
data = plugintools.read(pl)
plugintools.log("playlist= "+data)
dailym_vid = plugintools.find_multiple_matches(data, '{(.*?)}')
for entry in dailym_vid:
plugintools.log("entry= "+entry)
title = plugintools.find_single_match(entry, '"title":"(.*?)",')
title = title.replace('"', "")
title = title.replace('\*', "")
video_id = plugintools.find_single_match(entry, '"id":"(.*?)",')
thumbnail = "https://api.dailymotion.com/thumbnail/video/"+video_id+""
if thumbnail == "":
thumbnail = 'http://image-parcours.copainsdavant.com/image/750/1925508253/4094834.jpg'
url = "plugin://plugin.video.dailymotion_com/?url="+video_id+"&mode=playVideo"
print 'url',url
plugintools.add_item(action="play", title=title, url=url, folder = False, fanart='http://image-parcours.copainsdavant.com/image/750/1925508253/4094834.jpg',thumbnail=thumbnail,isPlayable = True)
| iptvgratis/TUPLAY | resources/tools/dailymotion.py | Python | gpl-3.0 | 4,151 |
# coding: utf-8
{
'!langcode!': 'es',
'!langname!': 'Español',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"actualice" es una expresión opcional como "campo1=\'nuevo_valor\'". No se puede actualizar o eliminar resultados de un JOIN',
'%d days ago': 'hace %d días',
'%d hours ago': 'hace %d horas',
'%d minutes ago': 'hace %d minutos',
'%d months ago': '%d months ago',
'%d seconds ago': 'hace %d segundos',
'%d weeks ago': 'hace %d semanas',
'%s %%{row} deleted': '%s %%{fila} %%{eliminada}',
'%s %%{row} updated': '%s %%{fila} %%{actualizada}',
'%s selected': '%s %%{seleccionado}',
'%Y-%m-%d': '%d/%m/%Y',
'%Y-%m-%d %H:%M:%S': '%d/%m/%Y %H:%M:%S',
'(something like "it-it")': '(algo como "eso-eso")',
'1 day ago': 'ayer',
'1 hour ago': 'hace una hora',
'1 minute ago': 'hace un minuto',
'1 second ago': 'hace 1 segundo',
'1 week ago': 'hace una semana',
'@markmin\x01**not available** (requires the Python [[guppy http://pypi.python.org/pypi/guppy/ popup]] library)': '**not available** (requires the Python [[guppy http://pypi.python.org/pypi/guppy/ popup]] library)',
'@markmin\x01``**not available**``:red (requires the Python [[guppy http://pypi.python.org/pypi/guppy/ popup]] library)': '``**not available**``:red (requires the Python [[guppy http://pypi.python.org/pypi/guppy/ popup]] library)',
'@markmin\x01An error occured, please [[reload %s]] the page': 'Ha ocurrido un error, por favor [[recargar %s]] la página',
'@markmin\x01Cache contains items up to **%(hours)02d** %%{hour(hours)} **%(min)02d** %%{minute(min)} **%(sec)02d** %%{second(sec)} old.': 'Cache contains items up to **%(hours)02d** %%{hour(hours)} **%(min)02d** %%{minute(min)} **%(sec)02d** %%{second(sec)} old.',
'@markmin\x01Hit Ratio: **%(ratio)s%%** (**%(hits)s** %%{hit(hits)} and **%(misses)s** %%{miss(misses)})': 'Hit Ratio: **%(ratio)s%%** (**%(hits)s** %%{hit(hits)} and **%(misses)s** %%{miss(misses)})',
'@markmin\x01Hit Ratio: **%(ratio)s%%** (**%(hits)s** %%{hit(hits)} and **%(misses)s** %%{miss(misses})': 'Hit Ratio: **%(ratio)s%%** (**%(hits)s** %%{hit(hits)} and **%(misses)s** %%{miss(misses})',
'@markmin\x01Number of entries: **%s**': 'Number of entries: **%s**',
'@markmin\x01RAM contains items up to **%(hours)02d** %%{hour(hours)} **%(min)02d** %%{minute(min)} **%(sec)02d** %%{second(sec)} old.': 'RAM contains items up to **%(hours)02d** %%{hour(hours)} **%(min)02d** %%{minute(min)} **%(sec)02d** %%{second(sec)} old.',
'A new version of web2py is available': 'Hay una nueva versión de web2py disponible',
'A new version of web2py is available: %s': 'Hay una nueva versión de web2py disponible: %s',
'About': 'Acerca de',
'about': 'acerca de',
'About application': 'Acerca de la aplicación',
'Access Control': 'Control de Acceso',
'additional code for your application': 'código adicional para su aplicación',
'admin disabled because no admin password': 'admin deshabilitado por falta de contraseña',
'admin disabled because not supported on google app engine': 'admin deshabilitado, no es soportado en GAE',
'admin disabled because unable to access password file': 'admin deshabilitado, imposible acceder al archivo con la contraseña',
'Admin is disabled because insecure channel': 'Admin deshabilitado, el canal no es seguro',
'Admin is disabled because unsecure channel': 'Admin deshabilitado, el canal no es seguro',
'Administrative interface': 'Interfaz administrativa',
'Administrative Interface': 'Interfaz Administrativa',
'Administrator Password:': 'Contraseña del Administrador:',
'Ajax Recipes': 'Recetas AJAX',
'An error occured, please %s the page': 'Ha ocurrido un error, por favor %s la página',
'and rename it (required):': 'y renómbrela (requerido):',
'and rename it:': ' y renómbrelo:',
'Aplicar cambios': 'Aplicar cambios',
'appadmin': 'appadmin',
'appadmin is disabled because insecure channel': 'admin deshabilitado, el canal no es seguro',
'application "%s" uninstalled': 'aplicación "%s" desinstalada',
'application compiled': 'aplicación compilada',
'application is compiled and cannot be designed': 'la aplicación está compilada y no puede ser modificada',
'Apply changes': 'Aplicar cambios',
'Are you sure you want to delete file "%s"?': '¿Está seguro que desea eliminar el archivo "%s"?',
'Are you sure you want to delete this object?': '¿Está seguro que desea borrar este objeto?',
'Are you sure you want to uninstall application "%s"': '¿Está seguro que desea desinstalar la aplicación "%s"',
'Are you sure you want to uninstall application "%s"?': '¿Está seguro que desea desinstalar la aplicación "%s"?',
'ATTENTION: Login requires a secure (HTTPS) connection or running on localhost.': 'ATENCION: Inicio de sesión requiere una conexión segura (HTTPS) o localhost.',
'ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.': 'ATENCION: NO EJECUTE VARIAS PRUEBAS SIMULTANEAMENTE, NO SON THREAD SAFE.',
'ATTENTION: you cannot edit the running application!': 'ATENCION: no puede modificar la aplicación que está ejecutandose!',
'Authentication': 'Autenticación',
'Available Databases and Tables': 'Bases de datos y tablas disponibles',
'Buy this book': 'Compra este libro',
'Cache': 'Caché',
'cache': 'caché',
'Cache Keys': 'Llaves de la Caché',
'cache, errors and sessions cleaned': 'caché, errores y sesiones eliminados',
'Cambie la contraseña': 'Cambie la contraseña',
'Cannot be empty': 'No puede estar vacío',
'Cannot compile: there are errors in your app. Debug it, correct errors and try again.': 'No se puede compilar: hay errores en su aplicación. Depure, corrija errores y vuelva a intentarlo.',
'cannot create file': 'no es posible crear archivo',
'cannot upload file "%(filename)s"': 'no es posible subir archivo "%(filename)s"',
'Change Password': 'Cambie la Contraseña',
'Change password': 'Cambie la contraseña',
'change password': 'cambie la contraseña',
'check all': 'marcar todos',
'Check to delete': 'Marque para eliminar',
'clean': 'limpiar',
'Clear CACHE?': '¿Limpiar CACHÉ?',
'Clear DISK': 'Limpiar DISCO',
'Clear RAM': 'Limpiar RAM',
'Click on the link %(link)s to reset your password': 'Pulse en el enlace %(link)s para reiniciar su contraseña',
'click to check for upgrades': 'haga clic para buscar actualizaciones',
'Client IP': 'IP del Cliente',
'Community': 'Comunidad',
'compile': 'compilar',
'compiled application removed': 'aplicación compilada eliminada',
'Components and Plugins': 'Componentes y Plugins',
'Controller': 'Controlador',
'Controllers': 'Controladores',
'controllers': 'controladores',
'Copyright': 'Copyright',
'Correo electrónico inválido': 'Correo electrónico inválido',
'create file with filename:': 'cree archivo con nombre:',
'Create new application': 'Cree una nueva aplicación',
'create new application:': 'nombre de la nueva aplicación:',
'Created By': 'Creado Por',
'Created On': 'Creado En',
'crontab': 'crontab',
'Current request': 'Solicitud en curso',
'Current response': 'Respuesta en curso',
'Current session': 'Sesión en curso',
'currently saved or': 'actualmente guardado o',
'customize me!': '¡Adáptame!',
'data uploaded': 'datos subidos',
'Database': 'Base de datos',
'Database %s select': 'selección en base de datos %s',
'database administration': 'administración base de datos',
'Database Administration (appadmin)': 'Database Administration (appadmin)',
'Date and Time': 'Fecha y Hora',
'db': 'bdd',
'DB Model': 'Modelo BDD',
'defines tables': 'define tablas',
'Delete': 'Eliminar',
'delete': 'eliminar',
'delete all checked': 'eliminar marcados',
'Delete:': 'Eliminar:',
'Demo': 'Demostración',
'Deploy on Google App Engine': 'Despliegue en Google App Engine',
'Deployment Recipes': 'Recetas de despliegue',
'Description': 'Descripción',
'design': 'diseño',
'DESIGN': 'DISEÑO',
'Design for': 'Diseño por',
'DISK': 'DISCO',
'Disk Cache Keys': 'Llaves de Caché en Disco',
'Disk Cleared': 'Disco limpiado',
'Documentation': 'Documentación',
"Don't know what to do?": '¿No sabe que hacer?',
'done!': '¡hecho!',
'Download': 'Descargas',
'E-mail': 'Correo electrónico',
'edit': 'editar',
'EDIT': 'EDITAR',
'Edit': 'Editar',
'Edit application': 'Editar aplicación',
'edit controller': 'editar controlador',
'Edit current record': 'Edite el registro actual',
'Edit Profile': 'Editar Perfil',
'edit profile': 'editar perfil',
'Edit This App': 'Edite esta App',
'Editing file': 'Editando archivo',
'Editing file "%s"': 'Editando archivo "%s"',
'Email and SMS': 'Correo electrónico y SMS',
'Email sent': 'Correo electrónico enviado',
'Email verification': 'Verificación de correo',
'Email verified': 'Corre verificado',
'enter a number between %(min)g and %(max)g': 'introduzca un número entre %(min)g y %(max)g',
'enter a value': 'Introduce un valor',
'enter an integer between %(min)g and %(max)g': 'introduzca un entero entre %(min)g y %(max)g',
'enter from %(min)g to %(max)g characters': 'escribe de %(min)g a %(max)g caracteres',
'Error logs for "%(app)s"': 'Bitácora de errores en "%(app)s"',
'errors': 'errores',
'Errors': 'Errores',
'Errors in form, please check it out.': 'Hay errores en el formulario, por favor comprúebelo.',
'Este correo electrónico ya tiene una cuenta': 'Este correo electrónico ya tiene una cuenta',
'export as csv file': 'exportar como archivo CSV',
'exposes': 'expone',
'extends': 'extiende',
'failed to reload module': 'la recarga del módulo ha fallado',
'FAQ': 'FAQ',
'file': 'archivo',
'file "%(filename)s" created': 'archivo "%(filename)s" creado',
'file "%(filename)s" deleted': 'archivo "%(filename)s" eliminado',
'file "%(filename)s" uploaded': 'archivo "%(filename)s" subido',
'file "%(filename)s" was not deleted': 'archivo "%(filename)s" no fué eliminado',
'file "%s" of %s restored': 'archivo "%s" de %s restaurado',
'file ## download': 'file ',
'file changed on disk': 'archivo modificado en el disco',
'file does not exist': 'archivo no existe',
'file saved on %(time)s': 'archivo guardado %(time)s',
'file saved on %s': 'archivo guardado %s',
'First name': 'Nombre',
'Forgot username?': '¿Olvidó el nombre de usuario?',
'Forms and Validators': 'Formularios y validadores',
'Free Applications': 'Aplicaciones Libres',
'Functions with no doctests will result in [passed] tests.': 'Funciones sin doctests equivalen a pruebas [aceptadas].',
'Graph Model': 'Graph Model',
'Group %(group_id)s created': 'Grupo %(group_id)s creado',
'Group ID': 'ID de Grupo',
'Group uniquely assigned to user %(id)s': 'Grupo asignado únicamente al usuario %(id)s',
'Groups': 'Grupos',
'Hello World': 'Hola Mundo',
'help': 'ayuda',
'Home': 'Inicio',
'How did you get here?': '¿Cómo llegaste aquí?',
'htmledit': 'htmledit',
'Impersonate': 'Suplantar',
'import': 'importar',
'Import/Export': 'Importar/Exportar',
'includes': 'incluye',
'Index': 'Índice',
'Inicio de sesión': 'Inicio de sesión',
'insert new': 'inserte nuevo',
'insert new %s': 'inserte nuevo %s',
'Installed applications': 'Aplicaciones instaladas',
'Insufficient privileges': 'Privilegios insuficientes',
'internal error': 'error interno',
'Internal State': 'Estado Interno',
'Introduction': 'Introducción',
'Invalid action': 'Acción inválida',
'Invalid email': 'Correo electrónico inválido',
'invalid image': 'imagen inválida',
'Invalid login': 'Inicio de sesión inválido',
'invalid password': 'contraseña inválida',
'Invalid Query': 'Consulta inválida',
'invalid request': 'solicitud inválida',
'Invalid reset password': 'Reinicio de contraseña inválido',
'invalid ticket': 'tiquete inválido',
'Is Active': 'Está Activo',
'Key': 'Llave',
'language file "%(filename)s" created/updated': 'archivo de lenguaje "%(filename)s" creado/actualizado',
'Language files (static strings) updated': 'Archivos de lenguaje (cadenas estáticas) actualizados',
'languages': 'lenguajes',
'Languages': 'Lenguajes',
'languages updated': 'lenguajes actualizados',
'Last name': 'Apellido',
'Last saved on:': 'Guardado en:',
'Layout': 'Diseño de página',
'Layout Plugins': 'Plugins de diseño',
'Layouts': 'Diseños de páginas',
'License for': 'Licencia para',
'Live Chat': 'Chat en vivo',
'loading...': 'cargando...',
'Logged in': 'Sesión iniciada',
'Logged out': 'Sesión finalizada',
'Login': 'Inicio de sesión',
'login': 'inicio de sesión',
'Login disabled by administrator': 'Inicio de sesión deshabilitado por el administrador',
'Login to the Administrative Interface': 'Inicio de sesión para la Interfaz Administrativa',
'logout': 'fin de sesión',
'Logout': 'Fin de sesión',
'Los campos de contraseña no coinciden': 'Los campos de contraseña no coinciden',
'Lost Password': 'Contraseña perdida',
'Lost password?': '¿Olvidó la contraseña?',
'lost password?': '¿olvidó la contraseña?',
'Main Menu': 'Menú principal',
'Manage %(action)s': 'Manage %(action)s',
'Manage Access Control': 'Manage Access Control',
'Manage Cache': 'Gestionar la Caché',
'Memberships': 'Memberships',
'Menu Model': 'Modelo "menu"',
'merge': 'combinar',
'Models': 'Modelos',
'models': 'modelos',
'Modified By': 'Modificado Por',
'Modified On': 'Modificado En',
'Modules': 'Módulos',
'modules': 'módulos',
'must be YYYY-MM-DD HH:MM:SS!': '¡debe ser DD/MM/YYYY HH:MM:SS!',
'must be YYYY-MM-DD!': '¡debe ser DD/MM/YYYY!',
'My Sites': 'Mis Sitios',
'Name': 'Nombre',
'Necesitas elegir una facultad': 'Necesitas elegir una facultad',
'new application "%s" created': 'nueva aplicación "%s" creada',
'New password': 'Contraseña nueva',
'New Record': 'Registro nuevo',
'new record inserted': 'nuevo registro insertado',
'next %s rows': 'next %s rows',
'next 100 rows': '100 filas siguientes',
'NO': 'NO',
'No databases in this application': 'No hay bases de datos en esta aplicación',
'No puede estar vacío': 'No puede estar vacío',
'Not authorized': 'No autorizado',
'now': 'ahora',
'Object or table name': 'Nombre del objeto o tabla',
'Old password': 'Contraseña vieja',
'Online examples': 'Ejemplos en línea',
'or import from csv file': 'o importar desde archivo CSV',
'or provide application url:': 'o provea URL de la aplicación:',
'Origin': 'Origen',
'Original/Translation': 'Original/Traducción',
'Other Plugins': 'Otros Plugins',
'Other Recipes': 'Otras Recetas',
'Overview': 'Resumen',
'pack all': 'empaquetar todo',
'pack compiled': 'empaquete compiladas',
'Password': 'Contraseña',
'Password changed': 'Contraseña cambiada',
"Password fields don't match": 'Los campos de contraseña no coinciden',
'Password reset': 'Reinicio de contraseña',
'Peeking at file': 'Visualizando archivo',
'Permission': 'Permission',
'Permissions': 'Permissions',
'Phone': 'Teléfono',
'please input your password again': 'por favor introduzca su contraseña otra vez',
'Plugins': 'Plugins',
'Powered by': 'Este sitio usa',
'Preface': 'Prefacio',
'previous %s rows': 'previous %s rows',
'previous 100 rows': '100 filas anteriores',
'Profile': 'Perfil',
'Profile updated': 'Perfil actualizado',
'Prueba con un nombre más largo': 'Prueba con un nombre más largo',
'pygraphviz library not found': 'pygraphviz library not found',
'Python': 'Python',
'Query:': 'Consulta:',
'Quick Examples': 'Ejemplos Rápidos',
'RAM': 'RAM',
'RAM Cache Keys': 'Llaves de la Caché en RAM',
'Ram Cleared': 'Ram Limpiada',
'Recipes': 'Recetas',
'Record': 'Registro',
'record does not exist': 'el registro no existe',
'Record ID': 'ID de Registro',
'Record id': 'Id de registro',
'register': 'regístrese',
'Register': 'Regístrese',
'Registration identifier': 'Identificador de Registro',
'Registration key': 'Llave de registro',
'Registration needs verification': 'Registration needs verification',
'Registration successful': 'Registro con éxito',
'Regístrese': 'Regístrese',
'reload': 'recargar',
'Remember me (for 30 days)': 'Recuérdame (durante 30 días)',
'remove compiled': 'eliminar compiladas',
'Request reset password': 'Solicitar reinicio de contraseña',
'Reset Password key': 'Restaurar Llave de la Contraseña',
'Resolve Conflict file': 'archivo Resolución de Conflicto',
'restore': 'restaurar',
'Retrieve username': 'Recuperar nombre de usuario',
'revert': 'revertir',
'Role': 'Rol',
'Roles': 'Roles',
'Rows in Table': 'Filas en la tabla',
'Rows selected': 'Filas seleccionadas',
'save': 'guardar',
'Save model as...': 'Save model as...',
'Saved file hash:': 'Hash del archivo guardado:',
'Semantic': 'Semántica',
'Services': 'Servicios',
'session expired': 'sesión expirada',
'shell': 'terminal',
'site': 'sitio',
'Size of cache:': 'Tamaño de la Caché:',
'Solicitar reinicio de contraseña': 'Solicitar reinicio de contraseña',
'some files could not be removed': 'algunos archivos no pudieron ser removidos',
'state': 'estado',
'static': 'estáticos',
'Static files': 'Archivos estáticos',
'Statistics': 'Estadísticas',
'Stylesheet': 'Hoja de estilo',
'Submit': 'Enviar',
'submit': 'enviar',
'Success!': '¡Hecho!',
'Support': 'Soporte',
'Sure you want to delete this object?': '¿Está seguro que desea eliminar este objeto?',
'Table': 'tabla',
'Table name': 'Nombre de la tabla',
'test': 'probar',
'Testing application': 'Probando aplicación',
'The "query" is a condition like "db.table1.field1==\'value\'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.': 'La "consulta" es una condición como "db.tabla1.campo1==\'valor\'". Algo como "db.tabla1.campo1==db.tabla2.campo2" resulta en un JOIN SQL.',
'the application logic, each URL path is mapped in one exposed function in the controller': 'la lógica de la aplicación, cada ruta URL se mapea en una función expuesta en el controlador',
'The Core': 'El Núcleo',
'the data representation, define database tables and sets': 'la representación de datos, define tablas y conjuntos de base de datos',
'The output of the file is a dictionary that was rendered by the view %s': 'La salida de dicha función es un diccionario que es desplegado por la vista %s',
'the presentations layer, views are also known as templates': 'la capa de presentación, las vistas también son llamadas plantillas',
'The Views': 'Las Vistas',
'There are no controllers': 'No hay controladores',
'There are no models': 'No hay modelos',
'There are no modules': 'No hay módulos',
'There are no static files': 'No hay archivos estáticos',
'There are no translators, only default language is supported': 'No hay traductores, sólo el lenguaje por defecto es soportado',
'There are no views': 'No hay vistas',
'these files are served without processing, your images go here': 'estos archivos son servidos sin procesar, sus imágenes van aquí',
'This App': 'Esta Aplicación',
'This email already has an account': 'Este correo electrónico ya tiene una cuenta',
'This is a copy of the scaffolding application': 'Esta es una copia de la aplicación de andamiaje',
'This is the %(filename)s template': 'Esta es la plantilla %(filename)s',
'Ticket': 'Tiquete',
'Time in Cache (h:m:s)': 'Tiempo en Caché (h:m:s)',
'Timestamp': 'Marca de tiempo',
'to previous version.': 'a la versión previa.',
'Traceback': 'Traceback',
'translation strings for the application': 'cadenas de carácteres de traducción para la aplicación',
'try': 'intente',
'try something like': 'intente algo como',
'Twitter': 'Twitter',
'Unable to check for upgrades': 'No es posible verificar la existencia de actualizaciones',
'unable to create application "%s"': 'no es posible crear la aplicación "%s"',
'unable to delete file "%(filename)s"': 'no es posible eliminar el archivo "%(filename)s"',
'Unable to download': 'No es posible la descarga',
'Unable to download app': 'No es posible descarga la aplicación',
'unable to parse csv file': 'no es posible analizar el archivo CSV',
'unable to uninstall "%s"': 'no es posible instalar "%s"',
'uncheck all': 'desmarcar todos',
'uninstall': 'desinstalar',
'update': 'actualizar',
'update all languages': 'actualizar todos los lenguajes',
'Update:': 'Actualice:',
'upload application:': 'subir aplicación:',
'Upload existing application': 'Suba esta aplicación',
'upload file:': 'suba archivo:',
'Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.': 'Use (...)&(...) para AND, (...)|(...) para OR, y ~(...) para NOT, para crear consultas más complejas.',
'User': 'Usuario',
'User %(id)s is impersonating %(other_id)s': 'El usuario %(id)s está suplantando %(other_id)s',
'User %(id)s Logged-in': 'El usuario %(id)s inició la sesión',
'User %(id)s Logged-out': 'El usuario %(id)s finalizó la sesión',
'User %(id)s Password changed': 'Contraseña del usuario %(id)s cambiada',
'User %(id)s Password reset': 'Contraseña del usuario %(id)s reiniciada',
'User %(id)s Profile updated': 'Actualizado el perfil del usuario %(id)s',
'User %(id)s Registered': 'Usuario %(id)s Registrado',
'User %(id)s Username retrieved': 'Se ha recuperado el nombre de usuario del usuario %(id)s',
'User Id': 'Id de Usuario',
'User ID': 'ID de Usuario',
'Username': 'Nombre de usuario',
'Username retrieve': 'Recuperar nombre de usuario',
'Users': 'Usuarios',
'value already in database or empty': 'el valor ya existe en la base de datos o está vacío',
'value not in database': 'el valor no está en la base de datos',
'Verify Password': 'Verificar Contraseña',
'versioning': 'versiones',
'Videos': 'Vídeos',
'View': 'Vista',
'view': 'vista',
'views': 'vistas',
'Views': 'Vistas',
'web2py is up to date': 'web2py está actualizado',
'web2py Recent Tweets': 'Tweets Recientes de web2py',
'Welcome': 'Bienvenido',
'Welcome %(username)s! Click on the link %(link)s to verify your email': 'Bienvenido a Evadoc %(username)s! Haz clic en este enlace: %(link)s para verificar tu correo electronico',
'Welcome %s': 'Bienvenido %s',
'Welcome to web2py': 'Bienvenido a web2py',
'Welcome to web2py!': '¡Bienvenido a web2py!',
'Which called the function %s located in the file %s': 'La cual llamó la función %s localizada en el archivo %s',
'Working...': 'Trabajando...',
'YES': 'SÍ',
'You are successfully running web2py': 'Usted está ejecutando web2py exitosamente',
'You can modify this application and adapt it to your needs': 'Usted puede modificar esta aplicación y adaptarla a sus necesidades',
'You visited the url %s': 'Usted visitó la url %s',
'Your username is: %(username)s': 'Su nombre de usuario es: %(username)s',
}
| Yelrado/evadoc | languages/es.py | Python | gpl-3.0 | 22,321 |
/*
* An override of the OD Polygon TreeItem class
* Copyright (C) 2019 Wayne Mogg
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "uiwmpolygontreeitem.h"
#include "uiodpicksettreeitem.h"
#include "uiodapplmgr.h"
#include "uiodscenemgr.h"
#include "uivispartserv.h"
#include "uipickpartserv.h"
#include "vissurvobj.h"
#include "vispicksetdisplay.h"
#include "vispolylinedisplay.h"
#include "uistrings.h"
#include "uimenu.h"
#include "uimsg.h"
#include "picksettr.h"
#include "ptrman.h"
#include "pickset.h"
#include "uiioobj.h"
#include "ioman.h"
uiWMPolygonParentTreeItem::uiWMPolygonParentTreeItem()
: uiODPolygonParentTreeItem()
, toolsmenu_(uiStrings::sTools())
, handleMenu(this)
{
}
uiWMPolygonParentTreeItem::~uiWMPolygonParentTreeItem()
{
detachAllNotifiers();
}
#define mLoadPolyIdx 11
#define mNewPolyIdx 12
#define mSavePolyIdx 13
#define mOnlyAtPolyIdx 14
#define mAlwaysPolyIdx 15
bool uiWMPolygonParentTreeItem::addNewPolygon(Pick::Set* ps, bool warnifexist)
{
PtrMan<CtxtIOObj> ctio = mMkCtxtIOObj(PickSet);
ctio->setName( ps->name() );
BufferString errmsg;
if ( uiIOObj::fillCtio(*ctio, warnifexist) )
{
PtrMan<IOObj> ioobj = ctio->ioobj_;
IOM().commitChanges( *ioobj );
if ( !PickSetTranslator::store( *ps, ioobj, errmsg ) ) {
uiMSG().error(tr("%1").arg(errmsg));
return false;
}
Pick::Mgr().set( ioobj->key(), ps );
Pick::Set& polyps = Pick::Mgr().get( Pick::Mgr().size()-1 );
addPolygon( &polyps );
return true;
}
delete ps;
ps = 0;
return false;
}
void uiWMPolygonParentTreeItem::addPolygon(Pick::Set* ps )
{
if ( !ps ) return;
uiWMPolygonTreeItem* item = new uiWMPolygonTreeItem( -1, *ps );
addChild( item, true );
lastAddedChild = item;
}
bool uiWMPolygonParentTreeItem::showSubMenu()
{
mDynamicCastGet(visSurvey::Scene*,scene,applMgr()->visServer()->getObject(sceneID()));
const bool hastransform = scene && scene->getZAxisTransform();
uiMenu mnu( getUiParent(), uiStrings::sAction() );
mnu.insertAction( new uiAction(m3Dots(uiStrings::sAdd())), mLoadPolyIdx );
mnu.insertAction( new uiAction(m3Dots(uiStrings::sNew())), mNewPolyIdx );
if (toolsmenu_.nrItems()) {
uiMenu* toolmenu = new uiMenu(toolsmenu_);
mnu.addMenu(toolmenu);
}
if ( children_.size() > 0 )
{
mnu.insertSeparator();
uiAction* filteritem =
new uiAction( tr("Display Only at Sections") );
mnu.insertAction( filteritem, mOnlyAtPolyIdx );
filteritem->setEnabled( !hastransform );
uiAction* shwallitem = new uiAction( tr("Display in Full") );
mnu.insertAction( shwallitem, mAlwaysPolyIdx );
shwallitem->setEnabled( !hastransform );
mnu.insertSeparator();
mnu.insertAction( new uiAction(tr("Save Changes")), mSavePolyIdx );
}
addStandardItems( mnu );
const int mnuid = mnu.exec();
handleMenu.trigger( mnuid );
if ( mnuid<0 )
return false;
if ( mnuid==mLoadPolyIdx )
{
TypeSet<MultiID> mids;
if ( !applMgr()->pickServer()->loadSets(mids,true) )
return false;
for ( int idx=0; idx<mids.size(); idx++ )
{
Pick::Set& ps = Pick::Mgr().get( mids[idx] );
addPolygon( &ps );
}
}
else if ( mnuid==mNewPolyIdx )
{
if ( !applMgr()->pickServer()->createEmptySet(true) )
return false;
Pick::Set& ps = Pick::Mgr().get( Pick::Mgr().size()-1 );
addPolygon( &ps );
}
else if ( mnuid==mSavePolyIdx )
{
for (int idx=0; idx<children_.size(); idx++) {
mDynamicCastGet(uiWMPolygonTreeItem*,itm,children_[idx])
if (itm)
itm->updateZ();
}
if ( !applMgr()->pickServer()->storePickSets() )
uiMSG().error( tr("Problem saving changes. "
"Check write protection.") );
}
else if ( mnuid==mAlwaysPolyIdx || mnuid==mOnlyAtPolyIdx )
{
const bool showall = mnuid==mAlwaysPolyIdx;
for ( int idx=0; idx<children_.size(); idx++ )
{
mDynamicCastGet(uiODPolygonTreeItem*,itm,children_[idx])
if ( !itm ) continue;
itm->setOnlyAtSectionsDisplay( !showall );
itm->updateColumnText( uiODSceneMgr::cColorColumn() );
}
}
else
handleStandardItems( mnuid );
return true;
}
uiTreeItem* uiWMPolygonTreeItemFactory::createForVis(int visid, uiTreeItem*) const
{
mDynamicCastGet(visSurvey::PickSetDisplay*,psd,
ODMainWin()->applMgr().visServer()->getObject(visid));
if ( !psd || !psd->isPolygon() )
return 0;
Pick::Set* pickset = psd->getSet();
return new uiWMPolygonTreeItem(visid,*pickset);
}
uiWMPolygonTreeItem::uiWMPolygonTreeItem(int dispid,Pick::Set& ps)
: uiODPolygonTreeItem(dispid, ps)
{}
uiWMPolygonTreeItem::~uiWMPolygonTreeItem()
{}
void uiWMPolygonTreeItem::handleMenuCB( CallBacker* cb )
{
mCBCapsuleUnpackWithCaller( int, mnuid, caller, cb );
mDynamicCastGet( MenuHandler*, menu, caller );
if ( menu->isHandled() || mnuid==-1 )
return;
if ( menu->menuID()!=displayID() )
return;
if ( mnuid==storemnuitem_.id || mnuid==storeasmnuitem_.id )
updateZ();
uiODPolygonTreeItem::handleMenuCB(cb);
}
void uiWMPolygonTreeItem::updateZ()
{
float zval;
if ( getProperty( "Z value", zval ) ) {
for (int idx=0; idx<set_.size(); idx++)
set_.get(idx).setZ(zval);
applMgr()->storePickSet( set_ );
}
}
| waynegm/OpendTect-Plugins | plugins/uiWMTools/uiwmpolygontreeitem.cc | C++ | gpl-3.0 | 5,866 |
#ifndef GVERBDSP_H
#define GVERBDSP_H
#include "../include/ladspa-util.h"
typedef struct {
int size;
int idx;
float *buf;
} ty_fixeddelay;
typedef struct {
int size;
float coeff;
int idx;
float *buf;
} ty_diffuser;
typedef struct {
float damping;
float delay;
} ty_damper;
ty_diffuser *diffuser_make(int, float);
void diffuser_free(ty_diffuser *);
void diffuser_flush(ty_diffuser *);
//float diffuser_do(ty_diffuser *, float);
ty_damper *damper_make(float);
void damper_free(ty_damper *);
void damper_flush(ty_damper *);
//void damper_set(ty_damper *, float);
//float damper_do(ty_damper *, float);
ty_fixeddelay *fixeddelay_make(int);
void fixeddelay_free(ty_fixeddelay *);
void fixeddelay_flush(ty_fixeddelay *);
//float fixeddelay_read(ty_fixeddelay *, int);
//void fixeddelay_write(ty_fixeddelay *, float);
int isprime(int);
int nearest_prime(int, float);
static inline float diffuser_do(ty_diffuser *p, float x)
{
float y,w;
w = x - p->buf[p->idx]*p->coeff;
w = flush_to_zero(w);
y = p->buf[p->idx] + w*p->coeff;
p->buf[p->idx] = w;
p->idx = (p->idx + 1) % p->size;
return(y);
}
static inline float fixeddelay_read(ty_fixeddelay *p, int n)
{
int i;
i = (p->idx - n + p->size) % p->size;
return(p->buf[i]);
}
static inline void fixeddelay_write(ty_fixeddelay *p, float x)
{
p->buf[p->idx] = x;
p->idx = (p->idx + 1) % p->size;
}
static inline void damper_set(ty_damper *p, float damping)
{
p->damping = damping;
}
static inline float damper_do(ty_damper *p, float x)
{
float y;
y = x*(1.0-p->damping) + p->delay*p->damping;
p->delay = y;
return(y);
}
#endif
| swh/lv2 | gverb/gverbdsp.h | C | gpl-3.0 | 1,641 |
/*
* Copyright (C) 2010 Regents of the University of Michigan
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "SamHeaderPG.h"
// Constructor
SamHeaderPG::SamHeaderPG()
{
// Add required tags for this type.
myType = SamHeaderRecord::PG;
myTypeString = "PG";
addRequiredTag("ID");
myKeyTag = "ID";
}
// Destructor
SamHeaderPG::~SamHeaderPG()
{
}
SamHeaderRecord* SamHeaderPG::createCopy() const
{
SamHeaderPG* newPG = new SamHeaderPG();
if(newPG == NULL)
{
std::cerr << "Failed to create a copy of an PG Header Record\n" ;
return(NULL);
}
internalCopy(*newPG);
return(newPG);
}
| yjingj/bfGWAS_SS | libStatGen/bam/SamHeaderPG.cpp | C++ | gpl-3.0 | 1,286 |
/*
*
* Copyright (C) 2011-2012 ArkCORE2 <http://www.arkania.net/>
* Copyright (C) 2010-2012 Project SkyFire <http://www.projectskyfire.org/>
*
* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "Common.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "DB2FileLoader.h"
DB2FileLoader::DB2FileLoader()
{
data = NULL;
fieldsOffset = NULL;
}
bool DB2FileLoader::Load(const char *filename, const char *fmt)
{
uint32 header = 48;
if (data)
{
delete [] data;
data=NULL;
}
FILE * f = fopen(filename, "rb");
if (!f)
return false;
if (fread(&header, 4, 1, f) != 1) // Signature
{
fclose(f);
return false;
}
EndianConvert(header);
if (header != 0x32424457)
{
fclose(f);
return false; //'WDB2'
}
if (fread(&recordCount, 4, 1, f) != 1) // Number of records
{
fclose(f);
return false;
}
EndianConvert(recordCount);
if (fread(&fieldCount, 4, 1, f) != 1) // Number of fields
{
fclose(f);
return false;
}
EndianConvert(fieldCount);
if (fread(&recordSize, 4, 1, f) != 1) // Size of a record
{
fclose(f);
return false;
}
EndianConvert(recordSize);
if (fread(&stringSize, 4, 1, f) != 1) // String size
{
fclose(f);
return false;
}
EndianConvert(stringSize);
/* NEW WDB2 FIELDS*/
if (fread(&tableHash, 4, 1, f) != 1) // Table hash
{
fclose(f);
return false;
}
EndianConvert(tableHash);
if (fread(&build, 4, 1, f) != 1) // Build
{
fclose(f);
return false;
}
EndianConvert(build);
if (fread(&unk1, 4, 1, f) != 1) // Unknown WDB2
{
fclose(f);
return false;
}
EndianConvert(unk1);
if (build > 12880)
{
if (fread(&unk2, 4, 1, f) != 1) // Unknown WDB2
{
fclose(f);
return false;
}
EndianConvert(unk2);
if (fread(&maxIndex, 4, 1, f) != 1) // MaxIndex WDB2
{
fclose(f);
return false;
}
EndianConvert(maxIndex);
if (fread(&locale, 4, 1, f) != 1) // Locales
{
fclose(f);
return false;
}
EndianConvert(locale);
if (fread(&unk5, 4, 1, f) != 1) // Unknown WDB2
{
fclose(f);
return false;
}
EndianConvert(unk5);
}
if (maxIndex != 0)
{
int32 diff = maxIndex - unk2 + 1; // blizzard is some weird people...
fseek(f, diff * 4 + diff * 2, SEEK_CUR); // diff * 4: an index for rows, diff * 2: a memory allocation bank
}
fieldsOffset = new uint32[fieldCount];
fieldsOffset[0] = 0;
for (uint32 i = 1; i < fieldCount; i++)
{
fieldsOffset[i] = fieldsOffset[i - 1];
if (fmt[i - 1] == 'b' || fmt[i - 1] == 'X') // byte fields
fieldsOffset[i] += 1;
else // 4 byte fields (int32/float/strings)
fieldsOffset[i] += 4;
}
data = new unsigned char[recordSize*recordCount+stringSize];
stringTable = data + recordSize*recordCount;
if (fread(data, recordSize * recordCount + stringSize, 1, f) != 1)
{
fclose(f);
return false;
}
fclose(f);
return true;
}
DB2FileLoader::~DB2FileLoader()
{
if (data)
delete [] data;
if (fieldsOffset)
delete [] fieldsOffset;
}
DB2FileLoader::Record DB2FileLoader::getRecord(size_t id)
{
assert(data);
return Record(*this, data + id*recordSize);
}
uint32 DB2FileLoader::GetFormatRecordSize(const char * format, int32* index_pos)
{
uint32 recordsize = 0;
int32 i = -1;
for (uint32 x=0; format[x]; ++x)
{
switch (format[x])
{
case FT_FLOAT:
case FT_INT:
recordsize += 4;
break;
case FT_STRING:
recordsize += sizeof(char*);
break;
case FT_SORT:
i = x;
break;
case FT_IND:
i = x;
recordsize += 4;
break;
case FT_BYTE:
recordsize += 1;
break;
}
}
if (index_pos)
*index_pos = i;
return recordsize;
}
uint32 DB2FileLoader::GetFormatStringsFields(const char * format)
{
uint32 stringfields = 0;
for (uint32 x=0; format[x]; ++x)
if (format[x] == FT_STRING)
++stringfields;
return stringfields;
}
char* DB2FileLoader::AutoProduceData(const char* format, uint32& records, char**& indexTable)
{
typedef char * ptr;
if (strlen(format) != fieldCount)
return NULL;
//get struct size and index pos
int32 i;
uint32 recordsize=GetFormatRecordSize(format, &i);
if (i >= 0)
{
uint32 maxi = 0;
//find max index
for (uint32 y = 0; y < recordCount; y++)
{
uint32 ind=getRecord(y).getUInt(i);
if (ind>maxi)
maxi = ind;
}
++maxi;
records = maxi;
indexTable = new ptr[maxi];
memset(indexTable, 0, maxi * sizeof(ptr));
}
else
{
records = recordCount;
indexTable = new ptr[recordCount];
}
char* dataTable = new char[recordCount * recordsize];
uint32 offset=0;
for (uint32 y =0; y < recordCount; y++)
{
if (i>=0)
{
indexTable[getRecord(y).getUInt(i)] = &dataTable[offset];
}
else
indexTable[y] = &dataTable[offset];
for (uint32 x = 0; x < fieldCount; x++)
{
switch (format[x])
{
case FT_FLOAT:
*((float*)(&dataTable[offset])) = getRecord(y).getFloat(x);
offset += 4;
break;
case FT_IND:
case FT_INT:
*((uint32*)(&dataTable[offset])) = getRecord(y).getUInt(x);
offset += 4;
break;
case FT_BYTE:
*((uint8*)(&dataTable[offset])) = getRecord(y).getUInt8(x);
offset += 1;
break;
case FT_STRING:
*((char**)(&dataTable[offset])) = NULL; // will be replaces non-empty or "" strings in AutoProduceStrings
offset += sizeof(char*);
break;
}
}
}
return dataTable;
}
static char const* const nullStr = "";
char* DB2FileLoader::AutoProduceStringsArrayHolders(const char* format, char* dataTable)
{
if (strlen(format) != fieldCount)
return NULL;
// we store flat holders pool as single memory block
size_t stringFields = GetFormatStringsFields(format);
// each string field at load have array of string for each locale
size_t stringHolderSize = sizeof(char*) * TOTAL_LOCALES;
size_t stringHoldersRecordPoolSize = stringFields * stringHolderSize;
size_t stringHoldersPoolSize = stringHoldersRecordPoolSize * recordCount;
char* stringHoldersPool = new char[stringHoldersPoolSize];
// DB2 strings expected to have at least empty string
for (size_t i = 0; i < stringHoldersPoolSize / sizeof(char*); ++i)
((char const**)stringHoldersPool)[i] = nullStr;
uint32 offset=0;
// assign string holders to string field slots
for (uint32 y = 0; y < recordCount; y++)
{
uint32 stringFieldNum = 0;
for (uint32 x = 0; x < fieldCount; x++)
switch (format[x])
{
case FT_FLOAT:
case FT_IND:
case FT_INT:
offset += 4;
break;
case FT_BYTE:
offset += 1;
break;
case FT_STRING:
{
// init db2 string field slots by pointers to string holders
char const*** slot = (char const***)(&dataTable[offset]);
*slot = (char const**)(&stringHoldersPool[stringHoldersRecordPoolSize * y + stringHolderSize*stringFieldNum]);
++stringFieldNum;
offset += sizeof(char*);
break;
}
case FT_NA:
case FT_NA_BYTE:
case FT_SORT:
break;
default:
assert(false && "unknown format character");
}
}
//send as char* for store in char* pool list for free at unload
return stringHoldersPool;
}
char* DB2FileLoader::AutoProduceStrings(const char* format, char* dataTable, uint8 locale)
{
if (strlen(format) != fieldCount)
return NULL;
char* stringPool= new char[stringSize];
memcpy(stringPool, stringTable, stringSize);
uint32 offset = 0;
for (uint32 y =0; y < recordCount; y++)
{
for (uint32 x = 0; x < fieldCount; x++)
switch (format[x])
{
case FT_FLOAT:
case FT_IND:
case FT_INT:
offset += 4;
break;
case FT_BYTE:
offset += 1;
break;
case FT_STRING:
{
// fill only not filled entries
char** slot = (char**)(&dataTable[offset]);
if (**((char***)slot) == nullStr)
{
const char * st = getRecord(y).getString(x);
*slot=stringPool + (st-(const char*)stringTable);
}
offset+=sizeof(char*);
break;
}
}
}
return stringPool;
}
| TheGhostGroup/ArkCORE2 | src/server/shared/DataStores/DB2FileLoader.cpp | C++ | gpl-3.0 | 10,914 |
subroutine get_gravity_using_cpus
include 'starsmasher.h'
integer i,j,jlower,jupper
real*8 dr1,dr2,dr3
real*8 r2,rinv,rinv2,mrinv1,mrinv3,gacc,gpot
real*8 invq1,qq1,q21,q31,invq21,invq31,acc1,
$ pot1,g1,mj11,mj21
real*8 invq2,qq2,q22,q32,invq22,invq32,acc2,
$ pot2,g2,mj12,mj22
real*8 dgx, dgy, dgz
real*8 ami, amj, massratio
real*8 twohpi, twohpj, fourhpi2, fourhpj2
c write(69,*) 'particle',ntot,'has u,x,y,z,m,h=',
c $ u(ntot),x(ntot),y(ntot),z(ntot),am(ntot),hp(ntot)
do i=1,ntot
gx(i)=0.d0
gy(i)=0.d0
gz(i)=0.d0
grpot(i)=0.d0
enddo
if(nselfgravity.eq.0)then
jlower=ntot
if(u(jlower).ne.0.d0)then
write(69,*)'last particle not a point particle?'
stop
endif
endif
jupper=ntot
do i=ngrav_lower,ngrav_upper
if(i.eq.ntot) jlower=1 ! so any last point particle interacts with everything
if(nselfgravity.eq.1) jlower=i
ami=am(i)
twohpi=2*hp(i)
fourhpi2=twohpi*twohpi
if(nkernel.eq.0) then
c nkernel=0 is the cubic spline kernel
do j=jlower,jupper
dr1=x(j)-x(i)
dr2=y(j)-y(i)
dr3=z(j)-z(i)
r2=dr1**2+dr2**2+dr3**2
rinv = 1/sqrt(r2)
rinv2 = rinv * rinv
amj=am(j)
twohpj=2*hp(j)
fourhpj2=twohpj*twohpj
massratio=ami/amj
mrinv1 = rinv * amj
mrinv3 = rinv2 * mrinv1
if(r2.ge.max(fourhpi2,fourhpj2))then
dgx=mrinv3 * dr1
dgy=mrinv3 * dr2
dgz=mrinv3 * dr3
gx(i) = gx(i) + dgx
gx(j) = gx(j) - dgx*massratio
gy(i) = gy(i) + dgy
gy(j) = gy(j) - dgy*massratio
gz(i) = gz(i) + dgz
gz(j) = gz(j) - dgz*massratio
grpot(i) = grpot(i) -mrinv1
grpot(j) = grpot(j) -mrinv1*massratio
else
if(r2.gt.0)then
invq1= rinv * twohpi
invq2= rinv * twohpj
qq1= 1/invq1
qq2= 1/invq2
else
invq1= 0.d0
invq2= 0.d0
qq1= 0.d0
qq2= 0.d0
endif
q21=qq1*qq1
q22=qq2*qq2
q31=qq1*q21
q32=qq2*q22
invq21=invq1*invq1
invq22=invq2*invq2
invq31=invq1*invq21
invq32=invq2*invq22
if(qq1.lt.0.5d0) then
acc1=
$ 10.666666666667d0+q21*(32.0d0*qq1-38.4d0)
pot1= -2.8d0+q21*(5.333333333333d0+q21*
$ (6.4d0*qq1-9.6d0))
else
acc1=
$ 21.333333333333d0-48.0d0*qq1+38.4d0*q21
$ -10.666666666667d0*q31-0.066666666667d0*invq31
pot1=
$ -3.2d0+0.066666666667d0*invq1+q21*
$ (10.666666666667d0+qq1*(-16.0d0+qq1*
$ (9.6d0-2.133333333333d0*qq1)))
endif
if(qq2.lt.0.5d0) then
acc2=
$ 10.666666666667d0+q22*(32.0d0*qq2-38.4d0)
pot2= -2.8d0+q22*(5.333333333333d0+q22*
$ (6.4d0*qq2-9.6d0))
else
acc2=
$ 21.333333333333d0-48.0d0*qq2+38.4d0*q22
$ -10.666666666667d0*q32-0.066666666667d0*invq32
pot2=
$ -3.2d0+0.066666666667d0*invq2+q22*
$ (10.666666666667d0+qq2*(-16.0d0+qq2*
$ (9.6d0-2.133333333333d0*qq2)))
endif
mj11=amj/twohpi
mj12=amj/twohpj
mj21=mj11/fourhpi2
mj22=mj12/fourhpj2
if(r2.le.fourhpi2)then
g1=1
else
g1=0
endif
if(r2.le.fourhpj2)then
g2=1
else
g2=0
endif
if(r2.gt.0)then
gacc=0.5d0*(g1*mj21*acc1+(1.0d0-g1)*mrinv3+
$ g2*mj22*acc2+(1.0d0-g2)*mrinv3)
gpot=0.5d0*(g1*mj11*pot1+(g1-1.0d0)*mrinv1+
$ g2*mj12*pot2+(g2-1.0d0)*mrinv1)
else
gacc=0.d0
if(u(i).ne.0)then
gpot=-0.7d0*(mj11 + mj12) ! 0.7 instead of 1.4 so that we don't double count below when i=j
else
gpot=0.d0
endif
endif
dgx=gacc * dr1
dgy=gacc * dr2
dgz=gacc * dr3
gx(i) = gx(i) + dgx
gx(j) = gx(j) - dgx*massratio
gy(i) = gy(i) + dgy
gy(j) = gy(j) - dgy*massratio
gz(i) = gz(i) + dgz
gz(j) = gz(j) - dgz*massratio
grpot(i) = grpot(i) + gpot
grpot(j) = grpot(j) + gpot*massratio
endif
enddo
else if (nkernel.eq.1) then
c nkernel=1 is the Wendland W_{3,3} kernel
do j=jlower,jupper
dr1=x(j)-x(i)
dr2=y(j)-y(i)
dr3=z(j)-z(i)
r2=dr1**2+dr2**2+dr3**2
rinv = 1/sqrt(r2)
rinv2 = rinv * rinv
amj=am(j)
twohpj=2*hp(j)
fourhpj2=twohpj*twohpj
massratio=ami/amj
mrinv1 = rinv * amj
mrinv3 = rinv2 * mrinv1
if(r2.ge.max(fourhpi2,fourhpj2))then
dgx=mrinv3 * dr1
dgy=mrinv3 * dr2
dgz=mrinv3 * dr3
gx(i) = gx(i) + dgx
gx(j) = gx(j) - dgx*massratio
gy(i) = gy(i) + dgy
gy(j) = gy(j) - dgy*massratio
gz(i) = gz(i) + dgz
gz(j) = gz(j) - dgz*massratio
grpot(i) = grpot(i) -mrinv1
grpot(j) = grpot(j) -mrinv1*massratio
else
if(r2.gt.0)then
invq1= rinv * twohpi
invq2= rinv * twohpj
qq1= 1/invq1
qq2= 1/invq2
else
invq1= 0.d0
invq2= 0.d0
qq1= 0.d0
qq2= 0.d0
endif
! Relate to the CUDA code grav_force_direct.cu...
! qq1 = q.x, qq2 = q.y
! q21 = q2.x, q22 = q2.y
q21=qq1*qq1
q22=qq2*qq2
q31=qq1*q21
q32=qq2*q22
invq21=invq1*invq1
invq22=invq2*invq2
invq31=invq1*invq21
invq32=invq2*invq22
acc1=28.4375d0 + q21 * ( (-187.6875d0) + q21 * (
$ 804.375d0 + q21 * ( (-4379.375d0) + qq1 * (
$ 9009.d0 + qq1 * ( (-8957.8125d0) + qq1 * (5005.d0
$ + qq1 * ( (-1515.9375d0) + 195.d0*qq1)))))))
acc2=28.4375d0 + q22 * ( (-187.6875d0) + q22 * (
$ 804.375d0 + q22 * ( (-4379.375d0) + qq2 * (
$ 9009.d0 + qq2 * ( (-8957.8125d0) + qq2 * (5005.d0
$ + qq2 * ( (-1515.9375d0) + 195.d0*qq2)))))))
mj11=amj/twohpi
mj12=amj/twohpj
mj21=mj11/fourhpi2
mj22=mj12/fourhpj2
if(r2.le.fourhpi2)then
g1=1
pot1=(-3.828125d0) + q21 * (14.21875d0 + q21 * (
$ (-46.921875d0) + q21 * (134.0625d0 + q21 * (
$ (-547.421875d0) + qq1 * (1001.d0 + qq1 * (
$ (-895.78125d0) + qq1 * (455.d0 + qq1 * (
$ (-126.328125d0) + 15.d0*qq1))))))))
else
g1=0
pot1=0
endif
if(r2.le.fourhpj2)then
g2=1
pot2=(-3.828125d0) + q22 * (14.21875d0 + q22 * (
$ (-46.921875d0) + q22 * (134.0625d0 + q22 * (
$ (-547.421875d0) + qq2 * (1001.d0 + qq2 * (
$ (-895.78125d0) + qq2 * (455.d0 + qq2 * (
$ (-126.328125d0) + 15.d0*qq2))))))))
else
g2=0
pot2=0
endif
if(r2.gt.0)then
gacc=0.5d0*(g1*mj21*acc1+(1.0d0-g1)*mrinv3+
$ g2*mj22*acc2+(1.0d0-g2)*mrinv3)
gpot=0.5d0*(mj11*pot1+(g1-1.0d0)*mrinv1+
$ mj12*pot2+(g2-1.0d0)*mrinv1)
else
gacc=0.d0
if(u(i).ne.0)then
gpot=-0.5d0*1.9140625d0*(mj11 + mj12) ! 0.5 factor is so that we don't double count below when i=j
else
gpot=0.d0
endif
endif
dgx=gacc * dr1
dgy=gacc * dr2
dgz=gacc * dr3
gx(i) = gx(i) + dgx
gx(j) = gx(j) - dgx*massratio
gy(i) = gy(i) + dgy
gy(j) = gy(j) - dgy*massratio
gz(i) = gz(i) + dgz
gz(j) = gz(j) - dgz*massratio
grpot(i) = grpot(i) + gpot
grpot(j) = grpot(j) + gpot*massratio
endif
enddo
else
c nkernel=2 is the Wendland C4 kernel
do j=jlower,jupper
dr1=x(j)-x(i)
dr2=y(j)-y(i)
dr3=z(j)-z(i)
r2=dr1**2+dr2**2+dr3**2
rinv = 1/sqrt(r2)
rinv2 = rinv * rinv
amj=am(j)
twohpj=2*hp(j)
fourhpj2=twohpj*twohpj
massratio=ami/amj
mrinv1 = rinv * amj
mrinv3 = rinv2 * mrinv1
if(r2.ge.max(fourhpi2,fourhpj2))then
dgx=mrinv3 * dr1
dgy=mrinv3 * dr2
dgz=mrinv3 * dr3
gx(i) = gx(i) + dgx
gx(j) = gx(j) - dgx*massratio
gy(i) = gy(i) + dgy
gy(j) = gy(j) - dgy*massratio
gz(i) = gz(i) + dgz
gz(j) = gz(j) - dgz*massratio
grpot(i) = grpot(i) -mrinv1
grpot(j) = grpot(j) -mrinv1*massratio
else
if(r2.gt.0)then
invq1= rinv * twohpi
invq2= rinv * twohpj
qq1= 1/invq1
qq2= 1/invq2
else
invq1= 0.d0
invq2= 0.d0
qq1= 0.d0
qq2= 0.d0
endif
! Relate to the CUDA code grav_force_direct.cu...
! qq1 = q.x, qq2 = q.y
! q21 = q2.x, q22 = q2.y
q21=qq1*qq1
q22=qq2*qq2
q31=qq1*q21
q32=qq2*q22
invq21=invq1*invq1
invq22=invq2*invq2
invq31=invq1*invq21
invq32=invq2*invq22
acc1=20.625d0 + q21 * ( (-115.5d0) + q21 * (618.75d0 +
$ qq1 * ( (-1155.d0) + qq1 * (962.5d0 + qq1 * (
$ (-396.d0) + 65.625d0 * qq1)))))
acc2=20.625d0 + q22 * ( (-115.5d0) + q22 * (618.75d0 +
$ qq2 * ( (-1155.d0) + qq2 * (962.5d0 + qq2 * (
$ (-396.d0) + 65.625d0 * qq2)))))
mj11=amj/twohpi
mj12=amj/twohpj
mj21=mj11/fourhpi2
mj22=mj12/fourhpj2
if(r2.le.fourhpi2)then
g1=1
pot1=(-3.4375d0) + q21 * (10.3125d0 + q21 * (
$ (-28.875d0) + q21 * (103.125d0 + qq1 *(
$ (-165.d0) + qq1 * (120.3125d0 + qq1 * ( (-44.d0)
$ + 6.5625d0*qq1))))))
else
g1=0
pot1=0
endif
if(r2.le.fourhpj2)then
g2=1
pot2=(-3.4375d0) + q22 * (10.3125d0 + q22 * (
$ (-28.875d0) + q22 * (103.125d0 + qq2 *(
$ (-165.d0) + qq2 * (120.3125d0 + qq2 * ( (-44.d0)
$ + 6.5625d0*qq2))))))
else
g2=0
pot2=0
endif
if(r2.gt.0)then
gacc=0.5d0*(g1*mj21*acc1+(1.0d0-g1)*mrinv3+
$ g2*mj22*acc2+(1.0d0-g2)*mrinv3)
gpot=0.5d0*(mj11*pot1+(g1-1.0d0)*mrinv1+
$ mj12*pot2+(g2-1.0d0)*mrinv1)
else
gacc=0.d0
if(u(i).ne.0)then
gpot=-0.5d0*1.71875d0*(mj11 + mj12) ! 0.5 factor is so that we don't double count below when i=j
else
gpot=0.d0
endif
endif
dgx=gacc * dr1
dgy=gacc * dr2
dgz=gacc * dr3
gx(i) = gx(i) + dgx
gx(j) = gx(j) - dgx*massratio
gy(i) = gy(i) + dgy
gy(j) = gy(j) - dgy*massratio
gz(i) = gz(i) + dgz
gz(j) = gz(j) - dgz*massratio
grpot(i) = grpot(i) + gpot
grpot(j) = grpot(j) + gpot*massratio
endif
enddo
endif
enddo
return
end
subroutine set_nusegpus
implicit none
integer nintvar,neos,nusegpus,nselfgravity,ncooling
common/integration/nintvar,neos,nusegpus,nselfgravity,ncooling
nusegpus=0
return
end
subroutine firsthalf_grav_forces(ntot, ngrav_lower, mygravlength,
$ x, y, z, am, range, q, nkernel)
integer ntot,ngrav_lower,mygravlength,q,nkernel
real*8 x(ntot),y(ntot),z(ntot),am(ntot),range(ntot)
return
end
subroutine lasthalf_grav_forces(ntot, gx, gy, gz, grpot)
integer ntot
real*8 gx(ntot),gy(ntot),gz(ntot),grpot(ntot)
return
end
subroutine gpu_init_dev(i,theta_angle)
integer i
real*8 theta_angle
return
end
| jalombar/starsmasher | parallel_bleeding_edge/src/cpu_grav.f | FORTRAN | gpl-3.0 | 15,299 |
# -*- coding: utf-8 -*-
#
# (c) Copyright 2001-2009 Hewlett-Packard Development Company, L.P.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Authors: Don Welch
#
# Qt
from PyQt4.QtCore import *
from PyQt4.QtGui import *
class ReadOnlyRadioButton(QRadioButton):
def __init__(self, parent):
QRadioButton.__init__(self, parent)
self.setFocusPolicy(Qt.NoFocus)
self.clearFocus()
def mousePressEvent(self, e):
if e.button() == Qt.LeftButton:
return
QRadioButton.mousePressEvent(e)
def mouseReleaseEvent(self, e):
if e.button() == Qt.LeftButton:
return
QRadioButton.mouseReleaseEvent(e)
def mouseMoveEvent(self, e):
return
def keyPressEvent(self, e):
if e.key() not in (Qt.Key_Up, Qt.Key_Left, Qt.Key_Right,
Qt.Key_Down, Qt.Key_Escape):
return
QRadioButton.keyPressEvent(e)
def keyReleaseEvent(self, e):
return
| Alberto-Beralix/Beralix | i386-squashfs-root/usr/share/hplip/ui4/readonlyradiobutton.py | Python | gpl-3.0 | 1,657 |
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Shoehorn theme with the underlying Bootstrap theme.
*
* @package theme
* @subpackage shoehorn
* @copyright © 2014-onwards G J Barnard in respect to modifications of the Bootstrap theme.
* @author G J Barnard - gjbarnard at gmail dot com and {@link http://moodle.org/user/profile.php?id=442195}
* @author Based on code originally written by Bas Brands, David Scotson and many other contributors.
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
function theme_shoehorn_process_css($css, $theme) {
global $PAGE;
$outputus = $PAGE->get_renderer('theme_shoehorn', 'core');
\theme_shoehorn\toolbox::set_core_renderer($outputus);
// Set the background image for the logo.
$logo = \theme_shoehorn\toolbox::setting_file_url('logo', 'logo');
$css = theme_shoehorn_set_setting($css, '[[setting:logo]]', $logo);
// Set the theme font.
$headingfont = \theme_shoehorn\toolbox::get_setting('fontnameheading');
$bodyfont = \theme_shoehorn\toolbox::get_setting('fontnamebody');
$css = theme_shoehorn_set_font($css, 'heading', $headingfont);
$css = theme_shoehorn_set_font($css, 'body', $bodyfont);
// Show login message if desired.
$css = theme_shoehorn_set_loginmessage($css);
// Process look and feel.
$css = theme_shoehorn_set_landf($css);
// Colour settings.
$footerbottomcolour = \theme_shoehorn\toolbox::get_setting('footerbottomcolour', '#267F00');
$css = theme_shoehorn_set_setting($css, '[[setting:htmlbackground]]', $footerbottomcolour); // Footer bottom background.
$textcolour = \theme_shoehorn\toolbox::get_setting('textcolour', '#1F4D87');
$css = theme_shoehorn_set_setting($css, '[[setting:textcolour]]', $textcolour);
$css = theme_shoehorn_set_setting($css, '[[setting:textcolour8light]]', shoehorn_hexadjust($textcolour, -8));
$css = theme_shoehorn_set_setting($css, '[[setting:textcolour10light]]', shoehorn_hexadjust($textcolour, -10));
$css = theme_shoehorn_set_setting($css, '[[setting:textcolour5dark]]', shoehorn_hexadjust($textcolour, 5));
$css = theme_shoehorn_set_setting($css, '[[setting:textcolour10dark]]', shoehorn_hexadjust($textcolour, 10));
$css = theme_shoehorn_set_setting($css, '[[setting:textcolour75rgba]]', shoehorn_hex2rgba($textcolour, 0.75));
$linkcolour = \theme_shoehorn\toolbox::get_setting('linkcolour', '#1F4D87');
$css = theme_shoehorn_set_setting($css, '[[setting:linkcolour]]', $linkcolour);
$css = theme_shoehorn_set_setting($css, '[[setting:linkcolour2rgba]]', shoehorn_hex2rgba($linkcolour, 0.2));
$css = theme_shoehorn_set_setting($css, '[[setting:linkcolour4rgba]]', shoehorn_hex2rgba($linkcolour, 0.4));
$css = theme_shoehorn_set_setting($css, '[[setting:linkcolour8rgba]]', shoehorn_hex2rgba($linkcolour, 0.8));
$css = theme_shoehorn_set_setting($css, '[[setting:linkcolourhover]]', $linkcolour);
$navbartextcolour = \theme_shoehorn\toolbox::get_setting('navbartextcolour', '#653CAE');
$css = theme_shoehorn_set_setting($css, '[[setting:navbardefaultcolour]]', $navbartextcolour);
$css = theme_shoehorn_set_setting($css, '[[setting:navbardefaultcolourlight]]', shoehorn_hexadjust($navbartextcolour, -10));
$navbarbackgroundcolour = \theme_shoehorn\toolbox::get_setting('navbarbackgroundcolour', '#FFD974');
$css = theme_shoehorn_set_setting($css, '[[setting:navbardefaultbackground]]', $navbarbackgroundcolour);
$css = theme_shoehorn_set_setting($css, '[[setting:navbardefaultbackgroundrgba]]',
shoehorn_hex2rgba($navbarbackgroundcolour, 0.75));
$css = theme_shoehorn_set_setting($css, '[[setting:navbardefaultbackground8rgba]]',
shoehorn_hex2rgba($navbarbackgroundcolour, 0.8));
$navbarbordercolour = \theme_shoehorn\toolbox::get_setting('navbarbordercolour', '#FFD053');
$css = theme_shoehorn_set_setting($css, '[[setting:navbardefaultborder]]', $navbarbordercolour);
$css = theme_shoehorn_set_setting($css, '[[setting:navbardefaultborderrgba]]', shoehorn_hex2rgba($navbarbordercolour, 0.75));
$css = theme_shoehorn_set_setting($css, '[[setting:navbardefaulthover]]', $navbarbordercolour);
$css = theme_shoehorn_set_setting($css, '[[setting:navbardefaulthoverrgba]]', shoehorn_hex2rgba($navbarbordercolour, 0.75));
$pagetopcolour = \theme_shoehorn\toolbox::get_setting('pagetopcolour', '#2E73C9');
$css = theme_shoehorn_set_setting($css, '[[setting:pagetopbackground]]', $pagetopcolour);
$css = theme_shoehorn_set_setting($css, '[[setting:pagetopbackgroundrgba]]', shoehorn_hex2rgba($pagetopcolour, 1));
$css = theme_shoehorn_set_setting($css, '[[setting:pagetopbackground90rgba]]', shoehorn_hex2rgba($pagetopcolour, .9));
$pagebottomcolour = \theme_shoehorn\toolbox::get_setting('pagebottomcolour', '#C9E6FF');
$css = theme_shoehorn_set_setting($css, '[[setting:pagebottombackground]]', $pagebottomcolour);
$css = theme_shoehorn_set_setting($css, '[[setting:pagebottombackgroundrgba]]', shoehorn_hex2rgba($pagebottomcolour, 1));
$css = theme_shoehorn_set_setting($css, '[[setting:pagebottombackground5rgba]]', shoehorn_hex2rgba($pagebottomcolour, 0.5));
$css = theme_shoehorn_set_setting($css, '[[setting:pagebottombackground6rgba]]', shoehorn_hex2rgba($pagebottomcolour, 0.6));
$css = theme_shoehorn_set_setting($css, '[[setting:pagebottombackground65rgba]]', shoehorn_hex2rgba($pagebottomcolour, 0.65));
$css = theme_shoehorn_set_setting($css, '[[setting:pagebottombackground7rgba]]', shoehorn_hex2rgba($pagebottomcolour, 0.7));
$css = theme_shoehorn_set_setting($css, '[[setting:pagebottombackground95rgba]]', shoehorn_hex2rgba($pagebottomcolour, 0.95));
$pagebottombackgroundlight = shoehorn_hexadjust($pagebottomcolour, -5);
$css = theme_shoehorn_set_setting($css, '[[setting:pagebottombackgroundlight]]', $pagebottombackgroundlight);
$css = theme_shoehorn_set_setting($css, '[[setting:pagebottombackgroundlight4rgba]]',
shoehorn_hex2rgba($pagebottombackgroundlight, 0.4));
$css = theme_shoehorn_set_setting($css, '[[setting:pagebottombackgroundlight75rgba]]',
shoehorn_hex2rgba($pagebottombackgroundlight, 0.75));
$css = theme_shoehorn_set_setting($css, '[[setting:pagebottombackgroundlight2light]]',
shoehorn_hexadjust($pagebottombackgroundlight, -2));
$css = theme_shoehorn_set_setting($css, '[[setting:pagebottombackgroundlight5dark]]',
shoehorn_hexadjust($pagebottombackgroundlight, 5));
$css = theme_shoehorn_set_setting($css, '[[setting:pagebottombackgroundlight10dark]]',
shoehorn_hexadjust($pagebottombackgroundlight, 10));
$css = theme_shoehorn_set_setting($css, '[[setting:pagebottombackgrounddark]]',
shoehorn_hexadjust($pagebottomcolour, 5));
$css = theme_shoehorn_set_setting($css, '[[setting:pagebottombackgroundlighthover]]',
shoehorn_hexadjust($pagebottombackgroundlight, -2));
$pageheadertextcolour = \theme_shoehorn\toolbox::get_setting('pageheadertextcolour', '#FFFFFF');
$css = theme_shoehorn_set_setting($css, '[[setting:pageheadertextcolour]]', $pageheadertextcolour);
$footertextcolour = \theme_shoehorn\toolbox::get_setting('footertextcolour', '#B8D2E9');
$css = theme_shoehorn_set_setting($css, '[[setting:footertextcolour]]', $footertextcolour);
$css = theme_shoehorn_set_setting($css, '[[setting:footertextcolourlight]]',
shoehorn_hexadjust($footertextcolour, -10));
$footertopcolour = \theme_shoehorn\toolbox::get_setting('footertopcolour', '#269F00');
$css = theme_shoehorn_set_setting($css, '[[setting:footertopbackground]]', $footertopcolour);
$css = theme_shoehorn_set_setting($css, '[[setting:footerbottombackground]]', $footerbottomcolour);
$footertopbackgroundlight = shoehorn_hexadjust($footertopcolour, 20);
$css = theme_shoehorn_set_setting($css, '[[setting:footertopbackgroundlight]]', $footertopbackgroundlight);
$css = theme_shoehorn_set_setting($css, '[[setting:footertopbackgroundlightrgba]]',
shoehorn_hex2rgba($footertopbackgroundlight, 0.25));
// Set custom CSS.
$customcsssetting = \theme_shoehorn\toolbox::get_setting('customcss');
if (!empty($customcsssetting)) {
$customcss = $customcsssetting;
} else {
$customcss = null;
}
$css = theme_shoehorn_set_setting($css, '[[setting:customcss]]', $customcss);
return $css;
}
function theme_shoehorn_set_setting($css, $tag, $replacement) {
if (is_null($replacement)) {
$replacement = '';
}
$css = str_replace($tag, $replacement, $css);
return $css;
}
function theme_shoehorn_set_font($css, $type, $fontname) {
$familytag = '[[setting:' . $type .'font]]';
$facetag = '[[setting:fontfiles' . $type . ']]';
if (empty($fontname)) {
$familyreplacement = '';
$facereplacement = '';
} else {
$fontfiles = array();
$fontfileeot = \theme_shoehorn\toolbox::setting_file_url('fontfileeot'.$type, 'fontfileeot'.$type);
if (!empty($fontfileeot)) {
$fontfiles[] = "url('".$fontfileeot."?#iefix') format('embedded-opentype')";
}
$fontfilewoff = \theme_shoehorn\toolbox::setting_file_url('fontfilewoff'.$type, 'fontfilewoff'.$type);
if (!empty($fontfilewoff)) {
$fontfiles[] = "url('".$fontfilewoff."') format('woff')";
}
$fontfilewofftwo = \theme_shoehorn\toolbox::setting_file_url('fontfilewofftwo'.$type, 'fontfilewofftwo'.$type);
if (!empty($fontfilewofftwo)) {
$fontfiles[] = "url('".$fontfilewofftwo."') format('woff2')";
}
$fontfileotf = \theme_shoehorn\toolbox::setting_file_url('fontfileotf'.$type, 'fontfileotf'.$type);
if (!empty($fontfileotf)) {
$fontfiles[] = "url('".$fontfileotf."') format('opentype')";
}
$fontfilettf = \theme_shoehorn\toolbox::setting_file_url('fontfilettf'.$type, 'fontfilettf'.$type);
if (!empty($fontfilettf)) {
$fontfiles[] = "url('".$fontfilettf."') format('truetype')";
}
$fontfilesvg = \theme_shoehorn\toolbox::setting_file_url('fontfilesvg'.$type, 'fontfilesvg'.$type);
if (!empty($fontfilesvg)) {
$fontfiles[] = "url('".$fontfilesvg."') format('svg')";
}
if (!empty($fontfiles)) {
$familyreplacement = '"'.$fontname.'",';
$facereplacement = '@font-face {'.PHP_EOL.'font-family: "'.$fontname.'";'.PHP_EOL;
$facereplacement .= !empty($fontfileeot) ? "src: url('".$fontfileeot."');".PHP_EOL : '';
$facereplacement .= "src: ";
$facereplacement .= implode(",".PHP_EOL." ", $fontfiles);
$facereplacement .= ";".PHP_EOL."}";
} else {
// No files no point.
$familyreplacement = '';
$facereplacement = '';
}
}
$css = str_replace($familytag, $familyreplacement, $css);
$css = str_replace($facetag, $facereplacement, $css);
return $css;
}
function theme_shoehorn_set_loginmessage($css) {
$tag = '[[setting:theloginmessge]]';
$showloginmessage = \theme_shoehorn\toolbox::get_setting('showloginmessage');
if ($showloginmessage == 2) {
$content = "content: '";
$loginmessage = \theme_shoehorn\toolbox::get_setting('loginmessage');
if (!empty($loginmessage)) {
$replacement = $content.$loginmessage."';";
} else {
$replacement = $content.get_string('theloginmessage', 'theme_shoehorn')."';";
}
} else {
$replacement = '';
}
$css = str_replace($tag, $replacement, $css);
return $css;
}
function theme_shoehorn_set_landf($css) {
// All pages image.
$tag = '[[setting:landfallpagesbackgroundimage]]';
$landfallpagesbackgroundimage = \theme_shoehorn\toolbox::setting_file_url('landfallpagesbackgroundimage',
'landfallpagesbackgroundimage');
if ($landfallpagesbackgroundimage) {
$replacement = 'background: url(\''.$landfallpagesbackgroundimage.'\') repeat; margin-bottom: -26px;';
} else {
$replacement = '';
}
$css = str_replace($tag, $replacement, $css);
// All pages transparency.
$tag = '[[setting:landfallpagescontenttransparency]]';
$tagmain = '[[setting:landfallpagescontenttransparencymain]]';
$replacement = 'background-color: rgba(255, 255, 255, ';
/* Ref: http://css-tricks.com/css-transparency-settings-for-all-broswers/. */
$replacementmain = 'zoom: 1; filter: alpha(opacity=';
$landfallpagescontenttransparency = \theme_shoehorn\toolbox::get_setting('landfallpagescontenttransparency');
if (!empty($landfallpagescontenttransparency)) {
$allpages = round($landfallpagescontenttransparency, 2);
$replacement .= $allpages / 100;
$replacementmain .= $allpages;
$replacementmain .= '); opacity: ';
$replacementmain .= $allpages / 100;
} else {
$replacementmain .= '100); opacity: 1.0';
$replacement = '1.0';
}
$replacement .= ');';
$replacementmain .= ';';
$css = str_replace($tag, $replacement, $css);
$css = str_replace($tagmain, $replacementmain, $css);
// Front page image.
$tag = '[[setting:landffrontpagebackgroundimage]]';
$landffrontpagebackgroundimage = \theme_shoehorn\toolbox::setting_file_url('landffrontpagebackgroundimage',
'landffrontpagebackgroundimage');
if ($landffrontpagebackgroundimage) {
$replacement = 'background: url(\''.$landffrontpagebackgroundimage.'\') repeat; margin-bottom: -26px;';
} else {
$replacement = '';
}
$css = str_replace($tag, $replacement, $css);
// Front page transparency.
$tag = '[[setting:landffrontpagecontenttransparency]]';
$tagmain = '[[setting:landffrontpagecontenttransparencymain]]';
$replacement = 'background-color: rgba(255, 255, 255, ';
/* http://css-tricks.com/css-transparency-settings-for-all-broswers/ */
$replacementmain = 'zoom: 1; filter: alpha(opacity=';
$landffrontpagecontenttransparency = \theme_shoehorn\toolbox::get_setting('landffrontpagecontenttransparency');
if (!empty($landffrontpagecontenttransparency)) {
$frontpage = round($landffrontpagecontenttransparency, 2);
$replacement .= $frontpage / 100;
$replacementmain .= $frontpage;
$replacementmain .= '); opacity: ';
$replacementmain .= $frontpage / 100;
} else {
$replacementmain .= '100); opacity: 1.0';
$replacement = '1.0';
}
$replacement .= ');';
$replacementmain .= ';';
$css = str_replace($tag, $replacement, $css);
$css = str_replace($tagmain, $replacementmain, $css);
return $css;
}
/**
* Serves any files associated with the theme settings.
*
* @param stdClass $course
* @param stdClass $cm
* @param context $context
* @param string $filearea
* @param array $args
* @param bool $forcedownload
* @param array $options
* @return bool
*/
function theme_shoehorn_pluginfile($course, $cm, $context, $filearea, $args, $forcedownload,
array $options = array()) {
static $theme;
if (empty($theme)) {
$theme = theme_config::load('shoehorn');
}
if ($context->contextlevel == CONTEXT_SYSTEM) {
if ($filearea === 'logo') {
return $theme->setting_file_serve('logo', $args, $forcedownload, $options);
} else if (preg_match("/^fontfile(eot|otf|svg|ttf|woff|woff2)(heading|body)$/", $filearea)) {
// Ref: http://www.regexr.com/.
return $theme->setting_file_serve($filearea, $args, $forcedownload, $options);
} else if (substr($filearea, 0, 19) === 'frontpageslideimage') {
return $theme->setting_file_serve($filearea, $args, $forcedownload, $options);
} else if (substr($filearea, 0, 14) === 'imagebankimage') {
return $theme->setting_file_serve($filearea, $args, $forcedownload, $options);
} else if (substr($filearea, 0, 27) === 'loginbackgroundchangerimage') {
return $theme->setting_file_serve($filearea, $args, $forcedownload, $options);
} else if ($filearea === 'syntaxhighlighter') {
theme_shoehorn_serve_syntaxhighlighter($args[1]);
} else if ($filearea === 'landffrontpagebackgroundimage') {
return $theme->setting_file_serve('landffrontpagebackgroundimage', $args, $forcedownload, $options);
} else if ($filearea === 'landfallpagesbackgroundimage') {
return $theme->setting_file_serve('landfallpagesbackgroundimage', $args, $forcedownload, $options);
} else {
send_file_not_found();
}
} else {
send_file_not_found();
}
}
function theme_shoehorn_serve_syntaxhighlighter($filename) {
global $CFG;
if (file_exists("{$CFG->dirroot}/theme/shoehorn/javascript/syntaxhighlighter_3_0_83/scripts/")) {
$thesyntaxhighlighterpath = $CFG->dirroot.'/theme/shoehorn/javascript/syntaxhighlighter_3_0_83/scripts/';
} else if (!empty($CFG->themedir) && file_exists("{$CFG->themedir}/shoehorn/javascript/syntaxhighlighter_3_0_83/scripts/")) {
$thesyntaxhighlighterpath = $CFG->themedir.'/shoehorn/javascript/syntaxhighlighter_3_0_83/scripts/';
} else {
header('HTTP/1.0 404 Not Found');
die('Shoehorn syntax highlighter scripts folder not found, check $CFG->themedir is correct.');
}
$thefile = $thesyntaxhighlighterpath . $filename;
/* Ref: http://css-tricks.com/snippets/php/intelligent-php-cache-control/ - rather than /lib/csslib.php as it is a static
file who's contents should only change if it is rebuilt. But! There should be no difference with TDM on so will see for
the moment if that decision is a factor. */
$etagfile = md5_file($thefile);
// File.
$lastmodified = filemtime($thefile);
// Header.
$ifmodifiedsince = (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? $_SERVER['HTTP_IF_MODIFIED_SINCE'] : false);
$etagheader = (isset($_SERVER['HTTP_IF_NONE_MATCH']) ? trim($_SERVER['HTTP_IF_NONE_MATCH']) : false);
if ((($ifmodifiedsince) && (strtotime($ifmodifiedsince) == $lastmodified)) || $etagheader == $etagfile) {
theme_shoehorn_send_unmodified($lastmodified, $etagfile, 'application/javascript');
}
theme_shoehorn_send_cached($thesyntaxhighlighterpath, $filename, $lastmodified, $etagfile, 'application/javascript');
}
function theme_shoehorn_send_unmodified($lastmodified, $etag, $contenttype) {
$lifetime = 60 * 60 * 24 * 60;
header('HTTP/1.1 304 Not Modified');
header('Expires: '.gmdate('D, d M Y H:i:s', time() + $lifetime).' GMT');
header('Cache-Control: public, max-age=' . $lifetime);
header('Content-Type: '.$contenttype.'; charset=utf-8');
header('Etag: "'.$etag.'"');
if ($lastmodified) {
header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $lastmodified).' GMT');
}
die;
}
function theme_shoehorn_send_cached($path, $filename, $lastmodified, $etag, $contenttype) {
global $CFG;
require_once($CFG->dirroot . '/lib/configonlylib.php'); // For min_enable_zlib_compression().
// Sixty days only - the revision may get incremented quite often.
$lifetime = 60 * 60 * 24 * 60;
header('Etag: "'.$etag.'"');
header('Content-Disposition: inline; filename="'.$filename.'"');
header('Last-Modified: '.gmdate('D, d M Y H:i:s', $lastmodified).' GMT');
header('Expires: '.gmdate('D, d M Y H:i:s', time() + $lifetime).' GMT');
header('Pragma: ');
header('Cache-Control: public, max-age='.$lifetime);
header('Accept-Ranges: none');
header('Content-Type: '.$contenttype.'; charset=utf-8');
if (!min_enable_zlib_compression()) {
header('Content-Length: '.filesize($path . $filename));
}
readfile($path . $filename);
die;
}
/**
* Returns the RGB for the given hex.
*
* @param string $hex
* @return array
*/
function shoehorn_hex2rgb($hex) {
// From: http://bavotasan.com/2011/convert-hex-color-to-rgb-using-php/.
$hex = str_replace("#", "", $hex);
if (strlen($hex) == 3) {
$r = hexdec(substr($hex, 0, 1).substr($hex, 0, 1));
$g = hexdec(substr($hex, 1, 1).substr($hex, 1, 1));
$b = hexdec(substr($hex, 2, 1).substr($hex, 2, 1));
} else {
$r = hexdec(substr($hex, 0, 2));
$g = hexdec(substr($hex, 2, 2));
$b = hexdec(substr($hex, 4, 2));
}
$rgb = array('r' => $r, 'g' => $g, 'b' => $b);
return $rgb; // Returns the rgb as an array.
}
function shoehorn_hexadjust($hex, $percentage) {
$percentage = round($percentage / 100, 2);
$rgb = shoehorn_hex2rgb($hex);
$r = round($rgb['r'] - ($rgb['r'] * $percentage));
$g = round($rgb['g'] - ($rgb['g'] * $percentage));
$b = round($rgb['b'] - ($rgb['b'] * $percentage));
return '#'.str_pad(dechex(max(0, min(255, $r))), 2, '0', STR_PAD_LEFT)
.str_pad(dechex(max(0, min(255, $g))), 2, '0', STR_PAD_LEFT)
.str_pad(dechex(max(0, min(255, $b))), 2, '0', STR_PAD_LEFT);
}
/**
* Returns the RGBA for the given hex and alpha.
*
* @param string $hex
* @param double $alpha
* @return string
*/
function shoehorn_hex2rgba($hex, $alpha) {
$rgba = shoehorn_hex2rgb($hex);
$rgba[] = $alpha;
return 'rgba('.implode(", ", $rgba).')'; // Returns the rgba values separated by commas.
}
| gpoulet/moodle | theme/shoehorn/lib.php | PHP | gpl-3.0 | 22,123 |
export const utils = {}
utils.getChoiceById = (choices, choiceId) => {
return choices.find(choice => choice.id === choiceId)
}
utils.isSolutionChecked = (solution, answers) => {
return answers ? answers.indexOf(solution.id) > -1 : false
}
utils.answerId = (id) => {
return `${id}-your-answer`
}
utils.expectedId = (id) => {
return `${id}-expected-answer`
}
utils.getAnswerClassForSolution = (solution, answers, hasExpectedAnswer = true) => {
const checked = utils.isSolutionChecked(solution, answers)
if (checked) {
if (hasExpectedAnswer) {
if (solution.score > 0) {
return 'correct-answer'
}
return 'incorrect-answer'
}
return 'selected-answer'
}
return ''
}
utils.setChoiceTicks = (choices, multiple = false) => {
if (multiple) {
choices.map(choice => choice.checked = choice.score > 0)
} else {
let max = 0
let maxId = null
choices.map(choice => {
if (choice.score > max) {
max = choice.score
maxId = choice.id
}
})
choices.map(choice =>
choice.checked = max > 0 && choice.id === maxId
)
}
return choices
} | claroline/Distribution | plugin/exo/Resources/modules/items/choice/utils.js | JavaScript | gpl-3.0 | 1,145 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Resample image to desired resolution</title>
</head>
<body><div class="manualnavbar" style="text-align: center;">
<div class="prev" style="text-align: left; float: left;"><a href="imagick.render.html">Imagick::render</a></div>
<div class="next" style="text-align: right; float: right;"><a href="imagick.resetimagepage.html">Imagick::resetImagePage</a></div>
<div class="up"><a href="class.imagick.html">Imagick</a></div>
<div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="imagick.resampleimage" class="refentry">
<div class="refnamediv">
<h1 class="refname">Imagick::resampleImage</h1>
<p class="verinfo">(PECL imagick 2.0.0)</p><p class="refpurpose"><span class="refname">Imagick::resampleImage</span> — <span class="dc-title">Resample image to desired resolution</span></p>
</div>
<div class="refsect1 description" id="refsect1-imagick.resampleimage-description">
<h3 class="title">Description</h3>
<div class="methodsynopsis dc-description">
<span class="type">bool</span> <span class="methodname"><strong>Imagick::resampleImage</strong></span>
( <span class="methodparam"><span class="type">float</span> <code class="parameter">$x_resolution</code></span>
, <span class="methodparam"><span class="type">float</span> <code class="parameter">$y_resolution</code></span>
, <span class="methodparam"><span class="type">int</span> <code class="parameter">$filter</code></span>
, <span class="methodparam"><span class="type">float</span> <code class="parameter">$blur</code></span>
)</div>
<p class="para rdfs-comment">
Resample image to desired resolution.
</p>
</div>
<div class="refsect1 parameters" id="refsect1-imagick.resampleimage-parameters">
<h3 class="title">Parameters</h3>
<p class="para">
<dl>
<dt>
<code class="parameter">x_resolution</code></dt>
<dd>
<p class="para">
</p>
</dd>
<dt>
<code class="parameter">y_resolution</code></dt>
<dd>
<p class="para">
</p>
</dd>
<dt>
<code class="parameter">filter</code></dt>
<dd>
<p class="para">
</p>
</dd>
<dt>
<code class="parameter">blur</code></dt>
<dd>
<p class="para">
</p>
</dd>
</dl>
</p>
</div>
<div class="refsect1 returnvalues" id="refsect1-imagick.resampleimage-returnvalues">
<h3 class="title">Return Values</h3>
<p class="para">
Returns <strong><code>TRUE</code></strong> on success.
</p>
</div>
</div><hr /><div class="manualnavbar" style="text-align: center;">
<div class="prev" style="text-align: left; float: left;"><a href="imagick.render.html">Imagick::render</a></div>
<div class="next" style="text-align: right; float: right;"><a href="imagick.resetimagepage.html">Imagick::resetImagePage</a></div>
<div class="up"><a href="class.imagick.html">Imagick</a></div>
<div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
| rafaelgou/the-phpjs-local-docs-collection | php/5.5/imagick.resampleimage.html | HTML | gpl-3.0 | 3,196 |
url: http://sanskrit.inria.fr/cgi-bin/SKT/sktreader?t=VH;lex=SH;cache=f;st=t;us=f;cp=t;text=naabhiratra;topic=;abs=f;allSol=2;mode=p;cpts=<!DOCTYPE html>
<html><head>
<meta charset="utf-8">
<title>Sanskrit Reader Companion</title>
<meta name="author" content="Gérard Huet">
<meta property="dc:datecopyrighted" content="2016">
<meta property="dc:rightsholder" content="Gérard Huet">
<meta name="keywords" content="dictionary,sanskrit,heritage,dictionnaire,sanscrit,india,inde,indology,linguistics,panini,digital humanities,cultural heritage,computational linguistics,hypertext lexicon">
<link rel="stylesheet" type="text/css" href="http://sanskrit.inria.fr/DICO/style.css" media="screen,tv">
<link rel="shortcut icon" href="http://sanskrit.inria.fr/IMAGES/favicon.ico">
<script type="text/javascript" src="http://sanskrit.inria.fr/DICO/utf82VH.js"></script>
</head>
<body class="chamois_back">
<br><h1 class="title">The Sanskrit Reader Companion</h1>
<table class="chamois_back" border="0" cellpadding="0%" cellspacing="15pt" width="100%">
<tr><td>
<p align="center">
<div class="latin16"><a class="green" href="/cgi-bin/SKT/sktgraph?t=VH;lex=SH;cache=f;st=t;us=f;cp=t;text=naabhiratra;topic=;abs=f;cpts=;mode=g">✓</a> Show Summary of Solutions
</p>
Input:
<span class="red16">nābhiratra</span><hr>
<br>
Sentence:
<span class="deva16" lang="sa">नाभिरत्र</span><br>
may be analysed as:</div><br>
<hr>
<span class="blue">Solution 1 : <a class="green" href="/cgi-bin/SKT/sktparser?t=VH;lex=SH;cache=f;st=t;us=f;cp=t;text=naabhiratra;topic=;abs=f;cpts=;mode=p;n=1">✓</a></span><br>
[ <span class="blue" title="0"><b>na</b></span><table class="mauve_back">
<tr><th><span class="latin12"><tr><th><span class="latin12">{ part. }[<a class="navy" href="http://sanskrit.inria.fr/DICO/34.html#na"><i>na</i></a>]</span></th></tr></span></th></tr></table>⟨<span class="magenta">a</span><span class="green">|</span><span class="magenta">ā</span><span class="blue"> → </span><span class="red">ā</span>⟩]
<br>
[ <span class="blue" title="1"><b>ābhiḥ</b></span><table class="light_blue_back">
<tr><th><span class="latin12"><tr><th><span class="latin12">{ i. pl. f. }[<a class="navy" href="http://sanskrit.inria.fr/DICO/5.html#ayam"><i>ayam</i></a>]</span></th></tr></span></th></tr></table>⟨<span class="magenta">ḥ</span><span class="green">|</span><span class="magenta">a</span><span class="blue"> → </span><span class="red">ra</span>⟩]
<br>
[ <span class="blue" title="5"><b>atra</b></span><table class="mauve_back">
<tr><th><span class="latin12"><tr><th><span class="latin12">{ adv. }[<a class="navy" href="http://sanskrit.inria.fr/DICO/1.html#atra#1"><i>atra_1</i></a>]</span></th></tr></span></th></tr></table>⟨⟩]
<br>
<br>
<hr>
<span class="blue">Solution 2 : <a class="green" href="/cgi-bin/SKT/sktparser?t=VH;lex=SH;cache=f;st=t;us=f;cp=t;text=naabhiratra;topic=;abs=f;cpts=;mode=p;n=2">✓</a></span><br>
[ <span class="blue" title="0"><b>nābhiḥ</b></span><table class="deep_sky_back">
<tr><th><span class="latin12"><tr><th><span class="latin12">{ nom. sg. m. | nom. sg. f. }[<a class="navy" href="http://sanskrit.inria.fr/DICO/35.html#naabhi"><i>nābhi</i></a>]</span></th></tr></span></th></tr></table>⟨<span class="magenta">ḥ</span><span class="green">|</span><span class="magenta">a</span><span class="blue"> → </span><span class="red">ra</span>⟩]
<br>
[ <span class="blue" title="5"><b>atra</b></span><table class="mauve_back">
<tr><th><span class="latin12"><tr><th><span class="latin12">{ adv. }[<a class="navy" href="http://sanskrit.inria.fr/DICO/1.html#atra#1"><i>atra_1</i></a>]</span></th></tr></span></th></tr></table>⟨⟩]
<br>
<br>
<hr>
<span class="magenta">2</span><span class="blue"> solution</span><span class="blue">s</span><span class="blue"> kept among </span><span class="magenta">2</span><br>
<br>
<hr>
<br>
<br>
</td></tr></table>
<table class="pad60">
<tr><td></td></tr></table>
<div class="enpied">
<table class="bandeau"><tr><td>
<a href="http://ocaml.org"><img src="http://sanskrit.inria.fr/IMAGES/ocaml.gif" alt="Le chameau Ocaml" height="50"></a>
</td><td>
<table class="center">
<tr><td>
<a href="http://sanskrit.inria.fr/index.fr.html"><b>Top</b></a> |
<a href="http://sanskrit.inria.fr/DICO/index.fr.html"><b>Index</b></a> |
<a href="http://sanskrit.inria.fr/DICO/index.fr.html#stemmer"><b>Stemmer</b></a> |
<a href="http://sanskrit.inria.fr/DICO/grammar.fr.html"><b>Grammar</b></a> |
<a href="http://sanskrit.inria.fr/DICO/sandhi.fr.html"><b>Sandhi</b></a> |
<a href="http://sanskrit.inria.fr/DICO/reader.fr.html"><b>Reader</b></a> |
<a href="http://sanskrit.inria.fr/faq.fr.html"><b>Help</b></a> |
<a href="http://sanskrit.inria.fr/portal.fr.html"><b>Portal</b></a>
</td></tr><tr><td>
© Gérard Huet 1994-2016</td></tr></table></td><td>
<a href="http://www.inria.fr/"><img src="http://sanskrit.inria.fr/IMAGES/logo_inria.png" alt="Logo Inria" height="50"></a>
<br></td></tr></table></div>
</body>
</html>
| sanskritiitd/sanskrit | uohCorpus.fil/uoh/uoh.filteredcorpus.txt_output/astanga-hridayam-sandhi-extract1-27.txt.out.dict_4056_inr.html | HTML | gpl-3.0 | 5,148 |
/*
* ping.c -- Buffered pinging using cyclic arrays.
*
* This file is donated to the Tox Project.
* Copyright 2013 plutooo
*
* Copyright (C) 2013 Tox project All Rights Reserved.
*
* This file is part of Tox.
*
* Tox is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Tox is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Tox. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdint.h>
#include "DHT.h"
#include "ping.h"
#include "network.h"
#include "util.h"
#include "ping_array.h"
#define PING_NUM_MAX 512
/* Maximum newly announced nodes to ping per TIME_TO_PING seconds. */
#define MAX_TO_PING 16
/* Ping newly announced nodes to ping per TIME_TO_PING seconds*/
#define TIME_TO_PING 4
struct PING {
DHT *dht;
Ping_Array ping_array;
Node_format to_ping[MAX_TO_PING];
uint64_t last_to_ping;
};
#define PING_PLAIN_SIZE (1 + sizeof(uint64_t))
#define DHT_PING_SIZE (1 + CLIENT_ID_SIZE + crypto_box_NONCEBYTES + PING_PLAIN_SIZE + crypto_box_MACBYTES)
#define PING_DATA_SIZE (CLIENT_ID_SIZE + sizeof(IP_Port))
int send_ping_request(PING *ping, IP_Port ipp, const uint8_t *client_id)
{
uint8_t pk[DHT_PING_SIZE];
int rc;
uint64_t ping_id;
if (id_equal(client_id, ping->dht->self_public_key))
return 1;
uint8_t shared_key[crypto_box_BEFORENMBYTES];
// generate key to encrypt ping_id with recipient privkey
DHT_get_shared_key_sent(ping->dht, shared_key, client_id);
// Generate random ping_id.
uint8_t data[PING_DATA_SIZE];
id_copy(data, client_id);
memcpy(data + CLIENT_ID_SIZE, &ipp, sizeof(IP_Port));
ping_id = ping_array_add(&ping->ping_array, data, sizeof(data));
if (ping_id == 0)
return 1;
uint8_t ping_plain[PING_PLAIN_SIZE];
ping_plain[0] = NET_PACKET_PING_REQUEST;
memcpy(ping_plain + 1, &ping_id, sizeof(ping_id));
pk[0] = NET_PACKET_PING_REQUEST;
id_copy(pk + 1, ping->dht->self_public_key); // Our pubkey
new_nonce(pk + 1 + CLIENT_ID_SIZE); // Generate new nonce
rc = encrypt_data_symmetric(shared_key,
pk + 1 + CLIENT_ID_SIZE,
ping_plain, sizeof(ping_plain),
pk + 1 + CLIENT_ID_SIZE + crypto_box_NONCEBYTES);
if (rc != PING_PLAIN_SIZE + crypto_box_MACBYTES)
return 1;
return sendpacket(ping->dht->net, ipp, pk, sizeof(pk));
}
static int send_ping_response(PING *ping, IP_Port ipp, const uint8_t *client_id, uint64_t ping_id,
uint8_t *shared_encryption_key)
{
uint8_t pk[DHT_PING_SIZE];
int rc;
if (id_equal(client_id, ping->dht->self_public_key))
return 1;
uint8_t ping_plain[PING_PLAIN_SIZE];
ping_plain[0] = NET_PACKET_PING_RESPONSE;
memcpy(ping_plain + 1, &ping_id, sizeof(ping_id));
pk[0] = NET_PACKET_PING_RESPONSE;
id_copy(pk + 1, ping->dht->self_public_key); // Our pubkey
new_nonce(pk + 1 + CLIENT_ID_SIZE); // Generate new nonce
// Encrypt ping_id using recipient privkey
rc = encrypt_data_symmetric(shared_encryption_key,
pk + 1 + CLIENT_ID_SIZE,
ping_plain, sizeof(ping_plain),
pk + 1 + CLIENT_ID_SIZE + crypto_box_NONCEBYTES );
if (rc != PING_PLAIN_SIZE + crypto_box_MACBYTES)
return 1;
return sendpacket(ping->dht->net, ipp, pk, sizeof(pk));
}
static int handle_ping_request(void *_dht, IP_Port source, const uint8_t *packet, uint16_t length)
{
DHT *dht = _dht;
int rc;
if (length != DHT_PING_SIZE)
return 1;
PING *ping = dht->ping;
if (id_equal(packet + 1, ping->dht->self_public_key))
return 1;
uint8_t shared_key[crypto_box_BEFORENMBYTES];
uint8_t ping_plain[PING_PLAIN_SIZE];
// Decrypt ping_id
DHT_get_shared_key_recv(dht, shared_key, packet + 1);
rc = decrypt_data_symmetric(shared_key,
packet + 1 + CLIENT_ID_SIZE,
packet + 1 + CLIENT_ID_SIZE + crypto_box_NONCEBYTES,
PING_PLAIN_SIZE + crypto_box_MACBYTES,
ping_plain );
if (rc != sizeof(ping_plain))
return 1;
if (ping_plain[0] != NET_PACKET_PING_REQUEST)
return 1;
uint64_t ping_id;
memcpy(&ping_id, ping_plain + 1, sizeof(ping_id));
// Send response
send_ping_response(ping, source, packet + 1, ping_id, shared_key);
add_to_ping(ping, packet + 1, source);
return 0;
}
static int handle_ping_response(void *_dht, IP_Port source, const uint8_t *packet, uint16_t length)
{
DHT *dht = _dht;
int rc;
if (length != DHT_PING_SIZE)
return 1;
PING *ping = dht->ping;
if (id_equal(packet + 1, ping->dht->self_public_key))
return 1;
uint8_t shared_key[crypto_box_BEFORENMBYTES];
// generate key to encrypt ping_id with recipient privkey
DHT_get_shared_key_sent(ping->dht, shared_key, packet + 1);
uint8_t ping_plain[PING_PLAIN_SIZE];
// Decrypt ping_id
rc = decrypt_data_symmetric(shared_key,
packet + 1 + CLIENT_ID_SIZE,
packet + 1 + CLIENT_ID_SIZE + crypto_box_NONCEBYTES,
PING_PLAIN_SIZE + crypto_box_MACBYTES,
ping_plain);
if (rc != sizeof(ping_plain))
return 1;
if (ping_plain[0] != NET_PACKET_PING_RESPONSE)
return 1;
uint64_t ping_id;
memcpy(&ping_id, ping_plain + 1, sizeof(ping_id));
uint8_t data[PING_DATA_SIZE];
if (ping_array_check(data, sizeof(data), &ping->ping_array, ping_id) != sizeof(data))
return 1;
if (!id_equal(packet + 1, data))
return 1;
IP_Port ipp;
memcpy(&ipp, data + CLIENT_ID_SIZE, sizeof(IP_Port));
if (!ipport_equal(&ipp, &source))
return 1;
addto_lists(dht, source, packet + 1);
return 0;
}
/* Check if client_id with ip_port is in the list.
*
* return 1 if it is.
* return 0 if it isn't.
*/
static int in_list(const Client_data *list, uint16_t length, const uint8_t *client_id, IP_Port ip_port)
{
uint32_t i;
for (i = 0; i < length; ++i) {
if (id_equal(list[i].client_id, client_id)) {
const IPPTsPng *ipptp;
if (ip_port.ip.family == AF_INET) {
ipptp = &list[i].assoc4;
} else {
ipptp = &list[i].assoc6;
}
if (!is_timeout(ipptp->timestamp, BAD_NODE_TIMEOUT) && ipport_equal(&ipptp->ip_port, &ip_port))
return 1;
}
}
return 0;
}
/* Add nodes to the to_ping list.
* All nodes in this list are pinged every TIME_TO_PING seconds
* and are then removed from the list.
* If the list is full the nodes farthest from our client_id are replaced.
* The purpose of this list is to enable quick integration of new nodes into the
* network while preventing amplification attacks.
*
* return 0 if node was added.
* return -1 if node was not added.
*/
int add_to_ping(PING *ping, const uint8_t *client_id, IP_Port ip_port)
{
if (!ip_isset(&ip_port.ip))
return -1;
if (in_list(ping->dht->close_clientlist, LCLIENT_LIST, client_id, ip_port))
return -1;
uint32_t i;
for (i = 0; i < MAX_TO_PING; ++i) {
if (!ip_isset(&ping->to_ping[i].ip_port.ip)) {
memcpy(ping->to_ping[i].public_key, client_id, CLIENT_ID_SIZE);
ipport_copy(&ping->to_ping[i].ip_port, &ip_port);
return 0;
}
if (memcmp(ping->to_ping[i].public_key, client_id, CLIENT_ID_SIZE) == 0) {
return -1;
}
}
uint32_t r = rand();
for (i = 0; i < MAX_TO_PING; ++i) {
if (id_closest(ping->dht->self_public_key, ping->to_ping[(i + r) % MAX_TO_PING].public_key, client_id) == 2) {
memcpy(ping->to_ping[(i + r) % MAX_TO_PING].public_key, client_id, CLIENT_ID_SIZE);
ipport_copy(&ping->to_ping[(i + r) % MAX_TO_PING].ip_port, &ip_port);
return 0;
}
}
return -1;
}
/* Ping all the valid nodes in the to_ping list every TIME_TO_PING seconds.
* This function must be run at least once every TIME_TO_PING seconds.
*/
void do_to_ping(PING *ping)
{
if (!is_timeout(ping->last_to_ping, TIME_TO_PING))
return;
if (!ip_isset(&ping->to_ping[0].ip_port.ip))
return;
ping->last_to_ping = unix_time();
uint32_t i;
for (i = 0; i < MAX_TO_PING; ++i) {
if (!ip_isset(&ping->to_ping[i].ip_port.ip))
return;
send_ping_request(ping, ping->to_ping[i].ip_port, ping->to_ping[i].public_key);
ip_reset(&ping->to_ping[i].ip_port.ip);
}
}
PING *new_ping(DHT *dht)
{
PING *ping = calloc(1, sizeof(PING));
if (ping == NULL)
return NULL;
if (ping_array_init(&ping->ping_array, PING_NUM_MAX, PING_TIMEOUT) != 0) {
free(ping);
return NULL;
}
ping->dht = dht;
networking_registerhandler(ping->dht->net, NET_PACKET_PING_REQUEST, &handle_ping_request, dht);
networking_registerhandler(ping->dht->net, NET_PACKET_PING_RESPONSE, &handle_ping_response, dht);
return ping;
}
void kill_ping(PING *ping)
{
networking_registerhandler(ping->dht->net, NET_PACKET_PING_REQUEST, NULL, NULL);
networking_registerhandler(ping->dht->net, NET_PACKET_PING_RESPONSE, NULL, NULL);
ping_array_free_all(&ping->ping_array);
free(ping);
}
| cmotc/tox_api-oldversion | toxcore/ping.c | C | gpl-3.0 | 10,117 |
from __future__ import absolute_import
import logging
import os
from flask import Flask
from flask_pymongo import PyMongo
from raven.contrib.flask import Sentry
from heman.api import HemanAPI
api = HemanAPI(prefix='/api')
"""API object
"""
sentry = Sentry(logging=True, level=logging.ERROR)
"""Sentry object
"""
mongo = PyMongo()
"""Access to database
In other parts of the application you can do::
from heman.config import mongo
mongo.db.collection.find({"foo": "bar"})
"""
def create_app(**config):
"""Application Factory
You can create a new He-Man application with::
from heman.config import create_app
app = create_app() # app can be uses as WSGI application
app.run() # Or you can run as a simple web server
"""
app = Flask(
__name__, static_folder=None
)
if 'MONGO_URI' in os.environ:
app.config['MONGO_URI'] = os.environ['MONGO_URI']
app.config['LOG_LEVEL'] = 'DEBUG'
app.config['SECRET_KEY'] = '2205552d13b5431bb537732bbb051f1214414f5ab34d47'
configure_logging(app)
configure_sentry(app)
configure_api(app)
configure_mongodb(app)
configure_login(app)
return app
def configure_api(app):
"""Configure API Endpoints.
"""
from heman.api.cch import resources as cch_resources
from heman.api.infoenergia import resources as infoenergia_resources
from heman.api import ApiCatchall
# Add CCHFact resources
for resource in cch_resources:
api.add_resource(*resource)
# Add InfoEnergia resources
for resource in infoenergia_resources:
api.add_resource(*resource)
api.add_resource(ApiCatchall, '/<path:path>')
api.init_app(app)
def configure_sentry(app):
"""Configure Sentry logger.
Uses `Raven
<http://raven.readthedocs.org/en/latest/integrations/flask.html>`_
"""
sentry.init_app(app)
def configure_mongodb(app):
"""Configure MongoDB access.
Uses `Flask-PyMongo <https://flask-pymongo.readthedocs.org/>`_
"""
mongo.init_app(app)
def configure_logging(app):
"""Configure logging
Call ``logging.basicConfig()`` with the level ``LOG_LEVEL`` of application.
"""
logging.basicConfig(level=getattr(logging, app.config['LOG_LEVEL']))
def configure_login(app):
"""Configure login authentification
Uses `Flask-Login <https://flask-login.readthedocs.org>`_
"""
from heman.auth import login_manager
from flask_login import logout_user
login_manager.init_app(app)
@app.teardown_request
def force_logout(*args, **kwargs):
logout_user()
| Som-Energia/heman | heman/config.py | Python | gpl-3.0 | 2,611 |
package org.digitalcampus.oppia.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import org.digitalcampus.mobile.learning.R;
import org.digitalcampus.mobile.learning.databinding.RowQuizAttemptBinding;
import org.digitalcampus.oppia.model.QuizAttempt;
import org.digitalcampus.oppia.utils.DateUtils;
import java.util.List;
import androidx.annotation.NonNull;
public class QuizAttemptAdapter extends RecyclerViewClickableAdapter<QuizAttemptAdapter.QuizAttemptViewHolder>{
private final Context ctx;
private final List<QuizAttempt> quizAttempts;
public QuizAttemptAdapter(Context context, List<QuizAttempt> quizAttempts) {
this.ctx = context;
this.quizAttempts = quizAttempts;
}
class QuizAttemptViewHolder extends RecyclerViewClickableAdapter.ViewHolder {
private final RowQuizAttemptBinding binding;
QuizAttemptViewHolder(View itemView) {
super(itemView);
binding = RowQuizAttemptBinding.bind(itemView);
}
}
@NonNull
@Override
public QuizAttemptViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v = LayoutInflater.from(ctx).inflate(R.layout.row_quiz_attempt, parent, false);
return new QuizAttemptViewHolder(v);
}
@Override
public void onBindViewHolder(@NonNull QuizAttemptViewHolder viewHolder, int position) {
final QuizAttempt quiz = getItemAtPosition(position);
viewHolder.binding.attemptTimetaken.setText(quiz.getHumanTimetaken());
viewHolder.binding.attemptDate.setText(DateUtils.DISPLAY_DATETIME_FORMAT.print(quiz.getDatetime()));
viewHolder.binding.score.percentLabel.setText(quiz.getScorePercentLabel());
viewHolder.binding.score.percentLabel.setBackgroundResource(
quiz.isPassed()
? R.drawable.scorecard_quiz_item_passed
: R.drawable.scorecard_quiz_item_attempted);
}
@Override
public int getItemCount() {
return quizAttempts.size();
}
public QuizAttempt getItemAtPosition(int position) {
return quizAttempts.get(position);
}
}
| jjoseba/oppia-mobile-android | app/src/main/java/org/digitalcampus/oppia/adapter/QuizAttemptAdapter.java | Java | gpl-3.0 | 2,271 |
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose: CHud handles the message, calculation, and drawing the HUD
//
// $NoKeywords: $
//=============================================================================//
#ifndef HUD_H
#define HUD_H
#ifdef _WIN32
#pragma once
#endif
#include "UtlVector.h"
#include "UtlDict.h"
#include "ConVar.h"
#include <vgui/vgui.h>
#include <Color.h>
#include <bitbuf.h>
namespace vgui
{
class IScheme;
}
// basic rectangle struct used for drawing
typedef struct wrect_s
{
int left;
int right;
int top;
int bottom;
} wrect_t;
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
class CHudTexture
{
public:
CHudTexture()
{
Q_memset( szShortName, 0, sizeof( szShortName ) );
Q_memset( szTextureFile, 0, sizeof( szTextureFile ) );
Q_memset( texCoords, 0, sizeof( texCoords ) );
Q_memset( &rc, 0, sizeof( rc ) );
textureId = -1;
bRenderUsingFont = false;
bPrecached = false;
cCharacterInFont = 0;
hFont = NULL;
}
CHudTexture& operator =( const CHudTexture& src )
{
if ( this == &src )
return *this;
Q_strncpy( szShortName, src.szShortName, sizeof( szShortName ) );
Q_strncpy( szTextureFile, src.szTextureFile, sizeof( szTextureFile ) );
Q_memcpy( texCoords, src.texCoords, sizeof( texCoords ) );
textureId = src.textureId;
rc = src.rc;
bRenderUsingFont = src.bRenderUsingFont;
cCharacterInFont = src.cCharacterInFont;
hFont = src.hFont;
return *this;
}
int Width() const
{
return rc.right - rc.left;
}
int Height() const
{
return rc.bottom - rc.top;
}
// causes the font manager to generate the glyph, prevents run time hitches on platforms that have slow font managers
void Precache( void );
// returns width & height of icon with scale applied (scale is ignored if font is used to render)
int EffectiveWidth( float flScale ) const;
int EffectiveHeight( float flScale ) const;
void DrawSelf( int x, int y, Color& clr ) const;
void DrawSelf( int x, int y, int w, int h, Color& clr ) const;
#ifdef GE_DLL
void DrawSelfRotated( int x, int y, float theta, Color& clr = Color(255,255,255,255) ) const;
void DrawSelfRotated( int x, int y, int w, int h, float theta, Color& clr = Color(255,255,255,255) ) const;
void DrawSelfScaled( int x, int y, float scale, Color& clr = Color(255,255,255,255) ) const;
void DrawSelfScaled( int x, int y, int w, int h, float scale, Color& clr = Color(255,255,255,255) ) const;
void DrawScew_Left( int tex2, int width, int height, float percent, int offset, int radius ) const;
void DrawScew_Right( int tex2, int width, int height, float percent, int offset, int radius ) const;
#endif
void DrawSelfCropped( int x, int y, int cropx, int cropy, int cropw, int croph, Color& clr ) const;
// new version to scale the texture over a finalWidth and finalHeight passed in
void DrawSelfCropped( int x, int y, int cropx, int cropy, int cropw, int croph, int finalWidth, int finalHeight, Color& clr ) const;
char szShortName[ 64 ];
char szTextureFile[ 256 ];
bool bRenderUsingFont;
bool bPrecached;
char cCharacterInFont;
vgui::HFont hFont;
// vgui texture Id assigned to this item
int textureId;
// s0, t0, s1, t1
float texCoords[ 4 ];
// Original bounds
wrect_t rc;
};
#include "hudtexturehandle.h"
class CHudElement;
class CHudRenderGroup;
//-----------------------------------------------------------------------------
// Purpose: Main hud manager
//-----------------------------------------------------------------------------
class CHud
{
public:
//For progress bar orientations
static const int HUDPB_HORIZONTAL;
static const int HUDPB_VERTICAL;
static const int HUDPB_HORIZONTAL_INV;
public:
CHud();
~CHud();
// Init's called when the HUD's created at DLL load
void Init( void );
// VidInit's called when the video mode's changed
void VidInit( void );
// Shutdown's called when the engine's shutting down
void Shutdown( void );
// LevelInit's called whenever a new level's starting
void LevelInit( void );
// LevelShutdown's called whenever a level's finishing
void LevelShutdown( void );
void ResetHUD( void );
// A saved game has just been loaded
void OnRestore();
void Think();
void ProcessInput( bool bActive );
void UpdateHud( bool bActive );
void InitColors( vgui::IScheme *pScheme );
// Hud element registration
void AddHudElement( CHudElement *pHudElement );
void RemoveHudElement( CHudElement *pHudElement );
// Search list for "name" and return the hud element if it exists
CHudElement *FindElement( const char *pName );
bool IsHidden( int iHudFlags );
float GetSensitivity();
float GetFOVSensitivityAdjust();
void DrawProgressBar( int x, int y, int width, int height, float percentage, Color& clr, unsigned char type );
void DrawIconProgressBar( int x, int y, CHudTexture *icon, CHudTexture *icon2, float percentage, Color& clr, int type );
CHudTexture *GetIcon( const char *szIcon );
// loads a new icon into the list, without duplicates
CHudTexture *AddUnsearchableHudIconToList( CHudTexture& texture );
CHudTexture *AddSearchableHudIconToList( CHudTexture& texture );
void RefreshHudTextures();
// User messages
void MsgFunc_ResetHUD(bf_read &msg);
void MsgFunc_SendAudio(bf_read &msg);
// Hud Render group
int LookupRenderGroupIndexByName( const char *pszGroupName );
bool LockRenderGroup( int iGroupIndex, CHudElement *pLocker = NULL );
bool UnlockRenderGroup( int iGroupIndex, CHudElement *pLocker = NULL );
bool IsRenderGroupLockedFor( CHudElement *pHudElement, int iGroupIndex );
int RegisterForRenderGroup( const char *pszGroupName );
int AddHudRenderGroup( const char *pszGroupName );
bool DoesRenderGroupExist( int iGroupIndex );
void SetScreenShotTime( float flTime ){ m_flScreenShotTime = flTime; }
public:
int m_iKeyBits;
#ifndef _XBOX
float m_flMouseSensitivity;
float m_flMouseSensitivityFactor;
#endif
float m_flFOVSensitivityAdjust;
Color m_clrNormal;
Color m_clrCaution;
Color m_clrYellowish;
CUtlVector< CHudElement * > m_HudList;
private:
void InitFonts();
void SetupNewHudTexture( CHudTexture *t );
bool m_bHudTexturesLoaded;
// Global list of known icons
CUtlDict< CHudTexture *, int > m_Icons;
CUtlVector< const char * > m_RenderGroupNames;
CUtlMap< int, CHudRenderGroup * > m_RenderGroups;
float m_flScreenShotTime; // used to take end-game screenshots
};
extern CHud gHUD;
//-----------------------------------------------------------------------------
// Global fonts used in the client DLL
//-----------------------------------------------------------------------------
extern vgui::HFont g_hFontTrebuchet24;
void LoadHudTextures( CUtlDict< CHudTexture *, int >& list, char *szFilenameWithoutExtension, const unsigned char *pICEKey );
void GetHudSize( int& w, int &h );
#endif // HUD_H
| Entropy-Soldier/ges-legacy-code | game/sdk/client/hud.h | C | gpl-3.0 | 7,220 |
// Copyright 2009 Warsaw University, Faculty of Physics
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package multiplexer.jmx.util;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.TimeUnit;
/**
* @author Piotr Findeisen
*/
public class Queues {
private Queues() {
}
public static <E> E pollUninterruptibly(BlockingQueue<E> queue, TimeoutCounter timer) {
while (true) {
long remainingMillis = timer.getRemainingMillis();
if (remainingMillis <= 0)
break;
try {
return queue.poll(remainingMillis, TimeUnit.MILLISECONDS);
} catch (InterruptedException e) {
// no-op
}
}
return null;
}
public static <E> E pollUninterruptibly(BlockingQueue<E> queue, long timeoutMillis) {
return pollUninterruptibly(queue, new TimeoutCounter(timeoutMillis));
}
}
| BrainTech/jmx | src/main/java/multiplexer/jmx/util/Queues.java | Java | gpl-3.0 | 1,416 |
url: http://sanskrit.inria.fr/cgi-bin/SKT/sktreader?t=VH;lex=SH;cache=f;st=t;us=f;cp=t;text=vasantasenaivai.saa;topic=;abs=f;allSol=2;mode=p;cpts=<!DOCTYPE html>
<html><head>
<meta charset="utf-8">
<title>Sanskrit Reader Companion</title>
<meta name="author" content="Gérard Huet">
<meta property="dc:datecopyrighted" content="2016">
<meta property="dc:rightsholder" content="Gérard Huet">
<meta name="keywords" content="dictionary,sanskrit,heritage,dictionnaire,sanscrit,india,inde,indology,linguistics,panini,digital humanities,cultural heritage,computational linguistics,hypertext lexicon">
<link rel="stylesheet" type="text/css" href="http://sanskrit.inria.fr/DICO/style.css" media="screen,tv">
<link rel="shortcut icon" href="http://sanskrit.inria.fr/IMAGES/favicon.ico">
<script type="text/javascript" src="http://sanskrit.inria.fr/DICO/utf82VH.js"></script>
</head>
<body class="chamois_back">
<br><h1 class="title">The Sanskrit Reader Companion</h1>
<table class="chamois_back" border="0" cellpadding="0%" cellspacing="15pt" width="100%">
<tr><td>
<p align="center">
<div class="latin16"><a class="green" href="/cgi-bin/SKT/sktgraph?t=VH;lex=SH;cache=f;st=t;us=f;cp=t;text=vasantasenaivai.saa;topic=;abs=f;cpts=;mode=g">✓</a> Show Summary of Solutions
</p>
Input:
<span class="red16">vasantasenaivaiṣā</span><hr>
<br>
Sentence:
<span class="deva16" lang="sa">वसन्तसेनैवैषा</span><br>
may be analysed as:</div><br>
<hr>
<span class="blue">Solution 3 : <a class="green" href="/cgi-bin/SKT/sktparser?t=VH;lex=SH;cache=f;st=t;us=f;cp=t;text=vasantasenaivai.saa;topic=;abs=f;cpts=;mode=p;n=3">✓</a></span><br>
[ <span class="blue" title="0"><b>vasanta</b></span><table class="yellow_back">
<tr><th><span class="latin12"><tr><th><span class="latin12">{ iic. }[<a class="navy" href="http://sanskrit.inria.fr/DICO/57.html#vasanta"><i>vasanta</i></a>]</span></th></tr></span></th></tr></table>⟨⟩]
<br>
[ <span class="blue" title="7"><b>senā</b></span><table class="deep_sky_back">
<tr><th><span class="latin12"><tr><th><span class="latin12">{ nom. sg. f. }[<a class="navy" href="http://sanskrit.inria.fr/DICO/71.html#senaa"><i>senā</i></a>]</span></th></tr></span></th></tr></table>⟨<span class="magenta">ā</span><span class="green">|</span><span class="magenta">e</span><span class="blue"> → </span><span class="red">ai</span>⟩]
<br>
[ <span class="blue" title="10"><b>eva</b></span><table class="mauve_back">
<tr><th><span class="latin12"><tr><th><span class="latin12">{ prep. }[<a class="navy" href="http://sanskrit.inria.fr/DICO/17.html#eva"><i>eva</i></a>]</span></th></tr></span></th></tr></table>⟨<span class="magenta">a</span><span class="green">|</span><span class="magenta">e</span><span class="blue"> → </span><span class="red">ai</span>⟩]
<br>
[ <span class="blue" title="12"><b>eṣā</b></span><table class="deep_sky_back">
<tr><th><span class="latin12"><tr><th><span class="latin12">{ nom. sg. f. }[<a class="navy" href="http://sanskrit.inria.fr/DICO/17.html#e.sa#1"><i>eṣa_1</i></a>]</span></th></tr></span></th></tr></table>⟨⟩]
<br>
<br>
<hr>
<span class="blue">Solution 4 : <a class="green" href="/cgi-bin/SKT/sktparser?t=VH;lex=SH;cache=f;st=t;us=f;cp=t;text=vasantasenaivai.saa;topic=;abs=f;cpts=;mode=p;n=4">✓</a></span><br>
[ <span class="blue" title="0"><b>vasanta</b></span><table class="yellow_back">
<tr><th><span class="latin12"><tr><th><span class="latin12">{ iic. }[<a class="navy" href="http://sanskrit.inria.fr/DICO/57.html#vasanta"><i>vasanta</i></a>]</span></th></tr></span></th></tr></table>⟨⟩]
<br>
[ <span class="blue" title="7"><b>senā</b></span><table class="deep_sky_back">
<tr><th><span class="latin12"><tr><th><span class="latin12">{ nom. sg. f. }[<a class="navy" href="http://sanskrit.inria.fr/DICO/71.html#senaa"><i>senā</i></a>]</span></th></tr></span></th></tr></table>⟨<span class="magenta">ā</span><span class="green">|</span><span class="magenta">e</span><span class="blue"> → </span><span class="red">ai</span>⟩]
<br>
[ <span class="blue" title="10"><b>eva</b></span><table class="mauve_back">
<tr><th><span class="latin12"><tr><th><span class="latin12">{ prep. }[<a class="navy" href="http://sanskrit.inria.fr/DICO/17.html#eva"><i>eva</i></a>]</span></th></tr></span></th></tr></table>⟨<span class="magenta">a</span><span class="green">|</span><span class="magenta">e</span><span class="blue"> → </span><span class="red">ai</span>⟩]
<br>
[ <span class="blue" title="12"><b>eṣā</b></span><table class="light_blue_back">
<tr><th><span class="latin12"><tr><th><span class="latin12">{ nom. sg. f. }[<a class="navy" href="http://sanskrit.inria.fr/DICO/17.html#etad"><i>etad</i></a>]</span></th></tr></span></th></tr></table>⟨⟩]
<br>
<br>
<hr>
<span class="magenta">2</span><span class="blue"> solution</span><span class="blue">s</span><span class="blue"> kept among </span><span class="magenta">4</span><br>
<span class="blue">Filtering efficiency: </span>
<span class="magenta">66%</span>
<br>
<hr>
<br>
<br>
</td></tr></table>
<table class="pad60">
<tr><td></td></tr></table>
<div class="enpied">
<table class="bandeau"><tr><td>
<a href="http://ocaml.org"><img src="http://sanskrit.inria.fr/IMAGES/ocaml.gif" alt="Le chameau Ocaml" height="50"></a>
</td><td>
<table class="center">
<tr><td>
<a href="http://sanskrit.inria.fr/index.fr.html"><b>Top</b></a> |
<a href="http://sanskrit.inria.fr/DICO/index.fr.html"><b>Index</b></a> |
<a href="http://sanskrit.inria.fr/DICO/index.fr.html#stemmer"><b>Stemmer</b></a> |
<a href="http://sanskrit.inria.fr/DICO/grammar.fr.html"><b>Grammar</b></a> |
<a href="http://sanskrit.inria.fr/DICO/sandhi.fr.html"><b>Sandhi</b></a> |
<a href="http://sanskrit.inria.fr/DICO/reader.fr.html"><b>Reader</b></a> |
<a href="http://sanskrit.inria.fr/faq.fr.html"><b>Help</b></a> |
<a href="http://sanskrit.inria.fr/portal.fr.html"><b>Portal</b></a>
</td></tr><tr><td>
© Gérard Huet 1994-2016</td></tr></table></td><td>
<a href="http://www.inria.fr/"><img src="http://sanskrit.inria.fr/IMAGES/logo_inria.png" alt="Logo Inria" height="50"></a>
<br></td></tr></table></div>
</body>
</html>
| sanskritiitd/sanskrit | uohCorpus.fil/uoh/uoh.filteredcorpus.txt_output/7.charudattam-ext.txt.out.dict_935_inr.html | HTML | gpl-3.0 | 6,363 |
<?php
/**
* @package Yaf
* @author 李枨煊<lcx165@gmail.com> (DOC Only)
*/
class Yaf_Response_Cli extends Yaf_Response_Abstract {
} | flyhope/GithuBlog | php_docs_code/yaf_phpdoc/yaf-response-cli.php | PHP | gpl-3.0 | 137 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by texi2html, http://www.gnu.org/software/texinfo/ -->
<!-- This file redirects to the location of a node or anchor -->
<head>
<title>XEmacs User’s Manual: Log Entries</title>
<meta name="description" content="XEmacs User’s Manual: Log Entries">
<meta name="keywords" content="XEmacs User’s Manual: Log Entries">
<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>
<meta http-equiv="Refresh" content="2; url=Files.html#Log-Entries">
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<p>The node you are looking for is at <a href="Files.html#Log-Entries">Log Entries</a>.</p>
</body>
| cgwalters/texinfo-git-mirror | texi2html/test/xemacs_manual/res/xemacs_frame/Log-Entries.html | HTML | gpl-3.0 | 1,819 |
/*
Copyright 2012-2015, University of Geneva.
This file is part of Great Balls of Fire (GBF).
Great Balls of Fire (GBF) is free software: you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
Great Balls of Fire (GBF) is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with Great Balls of Fire (GBF). If not, see
<http://www.gnu.org/licenses/>.
*/
package ch.unige.gbf
package math
import ec.util.{MersenneTwisterFast => MT}
import java.lang.ThreadLocal
import scala.math.{exp,log,sqrt,E,pow}
class RNG( val seed: Int ) {
private lazy val seeder = new MT(seed)
private def nextSeed: Int = seeder.synchronized {
seeder.nextInt
}
private val rng = new ThreadLocal[MT] {
override protected def initialValue() = new MT( nextSeed )
}
def nextDouble: Double = rng.get.nextDouble
def nextDouble( max: Double ): Double =
rng.get.nextDouble*max
def nextGaussian( avg: Double = 0.0, std: Double = 1.0): Double =
rng.get.nextGaussian*std + avg
def nextLogNormal( avg: Double, std: Double ): Double =
exp( avg + std * nextGaussian() )
//Adapted from: https://github.com/jliszka/probability-monad/blob/master/src/main/scala/probability-monad/Distribution.scala
def nextGamma( k: Double, theta: Double): Double = {
val n = k.toInt
val gammaInt = Array.fill( n )( -log( nextDouble ) ).sum //TODO: Optimize
val gammaFrac = {
val delta = k - n
def helper(): Double = {
val u1 = nextDouble
val u2 = nextDouble
val u3 = nextDouble
val (zeta, eta) = {
val v0 = E / (E + delta)
if (u1 <= v0) {
val zeta = pow(u2, 1/delta)
val eta = u3 * pow(zeta, delta - 1)
(zeta, eta)
} else {
val zeta = 1 - log(u2)
val eta = u3 * exp(-zeta)
(zeta, eta)
}
}
if (eta > pow(zeta, delta - 1) * exp(-zeta))
helper()
else
zeta
}
helper()
}
(gammaInt + gammaFrac) * theta
}
def nextBeta(a: Double, b: Double): Double = {
val x = nextGamma(a, 1)
val y = nextGamma(b, 1)
x / (x + y)
}
def nextBeta(a: Double, b: Double, min: Double, max: Double): Double = {
val x = nextBeta( a, b )
x*(max-min) + min
}
}
object RNG {
def apply() = {
val seed = (System.currentTimeMillis() >> 7 ).toInt
new RNG( seed )
}
def apply( seed: Int ) = new RNG( seed )
import org.streum.configrity._
lazy val reader = read[Int]( "seed", -1 ) map { s =>
if( s == -1 ) apply() else apply(s)
}
}
| unigeSPC/gbf | simulator/src/math/RNG.scala | Scala | gpl-3.0 | 2,995 |
#!/usr/bin/perl
# Copyright 2000-2002 Katipo Communications
# Copyright 2010 BibLibre
#
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Koha is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Koha; if not, see <http://www.gnu.org/licenses>.
=head1 moremember.pl
script to do a borrower enquiry/bring up borrower details etc
Displays all the details about a borrower
written 20/12/99 by chris@katipo.co.nz
last modified 21/1/2000 by chris@katipo.co.nz
modified 31/1/2001 by chris@katipo.co.nz
to not allow items on request to be renewed
needs html removed and to use the C4::Output more, but its tricky
=cut
use Modern::Perl;
use CGI qw ( -utf8 );
use C4::Context;
use C4::Auth qw/:DEFAULT get_session/;
use C4::Output;
use C4::Members;
use C4::Koha;
#use Smart::Comments;
#use Data::Dumper;
use vars qw($debug);
BEGIN {
$debug = $ENV{DEBUG} || 0;
}
my $input = new CGI;
my $sessionID = $input->cookie("CGISESSID");
my $session = get_session($sessionID);
$debug or $debug = $input->param('debug') || 0;
my $print = $input->param('print');
my $error = $input->param('error');
# circ staff who process checkouts but can't edit
# patrons still need to be able to print receipts
my $flagsrequired = { circulate => "circulate_remaining_permissions" };
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "circ/printslip.tt",
query => $input,
type => "intranet",
authnotrequired => 0,
flagsrequired => $flagsrequired,
debug => 1,
}
);
my $borrowernumber = $input->param('borrowernumber');
my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in";
my $patron = Koha::Patrons->find( $borrowernumber );
output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
my $branch=C4::Context->userenv->{'branch'};
my ($slip, $is_html);
if (my $letter = IssueSlip ($session->param('branch') || $branch, $borrowernumber, $print eq "qslip")) {
$slip = $letter->{content};
$is_html = $letter->{is_html};
}
$template->param(
slip => $slip,
plain => !$is_html,
borrowernumber => $borrowernumber,
caller => 'members',
stylesheet => C4::Context->preference("SlipCSS"),
error => $error,
);
$template->param( IntranetSlipPrinterJS => C4::Context->preference('IntranetSlipPrinterJS' ) );
output_html_with_http_headers $input, $cookie, $template->output;
| dpavlin/Koha | members/printslip.pl | Perl | gpl-3.0 | 3,023 |
#include <iostream>
#include <time.h>
#include "GenomeSequence.h"
#include "InputFile.h"
void readDbsnp(mmapArrayBool_t& dbSNP, const char* fileName, GenomeSequence& ref);
int main(int argc, char ** argv)
{
// time_t startTime;
// time_t endTime;
// startTime = time(NULL);
GenomeSequence* refPtr = new GenomeSequence("testFiles/chr1_partial.fa");
// endTime = time(NULL);
// std::cerr << "Time to read reference: " << endTime - startTime << std::endl;
if(refPtr == NULL)
{
std::cerr << "Failed to read the reference\n";
return(-1);
}
std::cerr << "\nStandard VCF DBSNP test\n";
mmapArrayBool_t dbsnpArray1;
const char* dbsnpFileName = "testFiles/dbsnp.vcf";
// startTime = time(NULL);
refPtr->loadDBSNP(dbsnpArray1, dbsnpFileName);
// endTime = time(NULL);
// std::cerr << "Time to read dbsnp through reference: " << endTime - startTime << std::endl;
genomeIndex_t mapPos =
refPtr->getGenomePosition("1", 10233);
std::cerr << "dbsnp " << mapPos << ": "
<< dbsnpArray1[mapPos] << std::endl;
std::cerr << "dbsnp " << mapPos+1 << ": "
<< dbsnpArray1[mapPos+1] << std::endl;
std::cerr << "dbsnp " << mapPos+2 << ": "
<< dbsnpArray1[mapPos+2] << std::endl;
std::cerr << "\nGZIP VCF DBSNP test\n";
mmapArrayBool_t dbsnpArray2;
dbsnpFileName = "testFiles/dbsnp.vcf.gz";
// startTime = time(NULL);
refPtr->loadDBSNP(dbsnpArray2, dbsnpFileName);
// endTime = time(NULL);
// std::cerr << "Time to read dbsnp through reference: " << endTime - startTime << std::endl;
mapPos = refPtr->getGenomePosition("1", 10233);
std::cerr << "dbsnp " << mapPos << ": "
<< dbsnpArray2[mapPos] << std::endl;
std::cerr << "dbsnp " << mapPos+1 << ": "
<< dbsnpArray2[mapPos+1] << std::endl;
std::cerr << "dbsnp " << mapPos+2 << ": "
<< dbsnpArray2[mapPos+2] << std::endl;
return(0);
}
| yjingj/bfGWAS_SS | libStatGen/general/test/dbsnp/Main.cpp | C++ | gpl-3.0 | 2,049 |
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
/* This is an emulation of EFI runtime services.
This allows a more uniform boot on i386 machines.
As it emulates only runtime service it isn't able
to chainload EFI bootloader on non-EFI system. */
#include <grub/file.h>
#include <grub/err.h>
#include <grub/env.h>
#include <grub/mm.h>
#include <grub/dl.h>
#include <grub/misc.h>
#include <grub/efiemu/efiemu.h>
#include <grub/machine/efiemu.h>
#include <grub/command.h>
#include <grub/i18n.h>
GRUB_EXPORT(grub_efiemu_prepare);
GRUB_EXPORT(grub_efiemu_sizeof_uintn_t);
GRUB_EXPORT(grub_efiemu_system_table32);
GRUB_EXPORT(grub_efiemu_system_table64);
GRUB_EXPORT(grub_efiemu_finish_boot_services);
GRUB_EXPORT(grub_efiemu_exit_boot_services);
/* System table. Two version depending on mode */
grub_efi_system_table32_t *grub_efiemu_system_table32 = 0;
grub_efi_system_table64_t *grub_efiemu_system_table64 = 0;
/* Modules may need to execute some actions after memory allocation happens */
static struct grub_efiemu_prepare_hook *efiemu_prepare_hooks = 0;
/* Linked list of configuration tables */
static struct grub_efiemu_configuration_table *efiemu_config_tables = 0;
static int prepared = 0;
/* Free all allocated space */
grub_err_t
grub_efiemu_unload (void)
{
struct grub_efiemu_configuration_table *cur, *d;
struct grub_efiemu_prepare_hook *curhook, *d2;
grub_efiemu_loadcore_unload ();
grub_efiemu_mm_unload ();
for (cur = efiemu_config_tables; cur;)
{
d = cur->next;
if (cur->unload)
cur->unload (cur->data);
grub_free (cur);
cur = d;
}
efiemu_config_tables = 0;
for (curhook = efiemu_prepare_hooks; curhook;)
{
d2 = curhook->next;
if (curhook->unload)
curhook->unload (curhook->data);
grub_free (curhook);
curhook = d2;
}
efiemu_prepare_hooks = 0;
prepared = 0;
return GRUB_ERR_NONE;
}
/* Remove previously registered table from the list */
grub_err_t
grub_efiemu_unregister_configuration_table (grub_efi_guid_t guid)
{
struct grub_efiemu_configuration_table *cur, *prev;
/* Special treating if head is to remove */
while (efiemu_config_tables
&& !grub_memcmp (&(efiemu_config_tables->guid), &guid, sizeof (guid)))
{
if (efiemu_config_tables->unload)
efiemu_config_tables->unload (efiemu_config_tables->data);
cur = efiemu_config_tables->next;
grub_free (efiemu_config_tables);
efiemu_config_tables = cur;
}
if (!efiemu_config_tables)
return GRUB_ERR_NONE;
/* Remove from chain */
for (prev = efiemu_config_tables, cur = prev->next; cur;)
if (grub_memcmp (&(cur->guid), &guid, sizeof (guid)) == 0)
{
if (cur->unload)
cur->unload (cur->data);
prev->next = cur->next;
grub_free (cur);
cur = prev->next;
}
else
{
prev = cur;
cur = cur->next;
}
return GRUB_ERR_NONE;
}
grub_err_t
grub_efiemu_register_prepare_hook (grub_err_t (*hook) (void *data),
void (*unload) (void *data),
void *data)
{
struct grub_efiemu_prepare_hook *nhook;
if (! hook)
return grub_error (GRUB_ERR_BAD_ARGUMENT, "you must supply the hook");
nhook = (struct grub_efiemu_prepare_hook *) grub_malloc (sizeof (*nhook));
if (! nhook)
return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't prepare hook");
nhook->hook = hook;
nhook->unload = unload;
nhook->data = data;
nhook->next = efiemu_prepare_hooks;
efiemu_prepare_hooks = nhook;
return GRUB_ERR_NONE;
}
/* Register a configuration table either supplying the address directly
or with a hook
*/
grub_err_t
grub_efiemu_register_configuration_table (grub_efi_guid_t guid,
void * (*get_table) (void *data),
void (*unload) (void *data),
void *data)
{
struct grub_efiemu_configuration_table *tbl;
grub_err_t err;
if (! get_table && ! data)
return grub_error (GRUB_ERR_BAD_ARGUMENT,
"you must set at least get_table or data");
if ((err = grub_efiemu_unregister_configuration_table (guid)))
return err;
tbl = (struct grub_efiemu_configuration_table *) grub_malloc (sizeof (*tbl));
if (! tbl)
return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't register table");
tbl->guid = guid;
tbl->get_table = get_table;
tbl->unload = unload;
tbl->data = data;
tbl->next = efiemu_config_tables;
efiemu_config_tables = tbl;
return GRUB_ERR_NONE;
}
static grub_err_t
grub_cmd_efiemu_unload (grub_command_t cmd __attribute__ ((unused)),
int argc __attribute__ ((unused)),
char *args[] __attribute__ ((unused)))
{
return grub_efiemu_unload ();
}
static grub_err_t
grub_cmd_efiemu_prepare (grub_command_t cmd __attribute__ ((unused)),
int argc __attribute__ ((unused)),
char *args[] __attribute__ ((unused)))
{
return grub_efiemu_prepare ();
}
int
grub_efiemu_exit_boot_services (grub_efi_uintn_t map_key
__attribute__ ((unused)))
{
/* Nothing to do here yet */
return 1;
}
int
grub_efiemu_finish_boot_services (void)
{
/* Nothing to do here yet */
return 1;
}
/* Load the runtime from the file FILENAME. */
static grub_err_t
grub_efiemu_load_file (const char *filename)
{
grub_file_t file;
grub_err_t err;
file = grub_file_open (filename);
if (! file)
return 0;
err = grub_efiemu_mm_init ();
if (err)
{
grub_file_close (file);
grub_efiemu_unload ();
return grub_error (grub_errno, "couldn't init memory management");
}
grub_dprintf ("efiemu", "mm initialized\n");
err = grub_efiemu_loadcore_init (file);
if (err)
{
grub_file_close (file);
grub_efiemu_unload ();
return err;
}
grub_file_close (file);
/* For configuration tables entry in system table. */
grub_efiemu_request_symbols (1);
return GRUB_ERR_NONE;
}
grub_err_t
grub_efiemu_autocore (void)
{
const char *prefix;
char *filename;
char *suffix;
grub_err_t err;
if (grub_efiemu_sizeof_uintn_t () != 0)
return GRUB_ERR_NONE;
prefix = grub_env_get ("prefix");
if (! prefix)
return grub_error (GRUB_ERR_FILE_NOT_FOUND,
"couldn't find efiemu core because prefix "
"isn't set");
suffix = grub_efiemu_get_default_core_name ();
filename = grub_xasprintf ("%s/%s", prefix, suffix);
if (! filename)
return grub_error (GRUB_ERR_OUT_OF_MEMORY,
"couldn't allocate temporary space");
err = grub_efiemu_load_file (filename);
grub_free (filename);
if (err)
return err;
#ifndef GRUB_MACHINE_EMU
err = grub_machine_efiemu_init_tables ();
if (err)
return err;
#endif
return GRUB_ERR_NONE;
}
grub_err_t
grub_efiemu_prepare (void)
{
// grub_err_t err;
if (prepared)
return GRUB_ERR_NONE;
grub_dprintf ("efiemu", "Preparing %d-bit efiemu\n",
8 * grub_efiemu_sizeof_uintn_t ());
// err = grub_efiemu_autocore ();
grub_efiemu_autocore ();
/* Create NVRAM. */
grub_efiemu_pnvram ();
prepared = 1;
if (grub_efiemu_sizeof_uintn_t () == 4)
return grub_efiemu_prepare32 (efiemu_prepare_hooks, efiemu_config_tables);
else
return grub_efiemu_prepare64 (efiemu_prepare_hooks, efiemu_config_tables);
}
static grub_err_t
grub_cmd_efiemu_load (grub_command_t cmd __attribute__ ((unused)),
int argc, char *args[])
{
grub_err_t err;
grub_efiemu_unload ();
if (argc != 1)
return grub_error (GRUB_ERR_BAD_ARGUMENT, "filename required");
err = grub_efiemu_load_file (args[0]);
if (err)
return err;
#ifndef GRUB_MACHINE_EMU
err = grub_machine_efiemu_init_tables ();
if (err)
return err;
#endif
return GRUB_ERR_NONE;
}
static grub_command_t cmd_loadcore, cmd_prepare, cmd_unload;
GRUB_MOD_INIT(efiemu)
{
cmd_loadcore = grub_register_command ("efiemu_loadcore",
grub_cmd_efiemu_load,
N_("FILE"),
N_("Load and initialize EFI emulator."));
cmd_prepare = grub_register_command ("efiemu_prepare",
grub_cmd_efiemu_prepare,
0,
N_("Finalize loading of EFI emulator."));
cmd_unload = grub_register_command ("efiemu_unload", grub_cmd_efiemu_unload,
0,
N_("Unload EFI emulator."));
}
GRUB_MOD_FINI(efiemu)
{
grub_unregister_command (cmd_loadcore);
grub_unregister_command (cmd_prepare);
grub_unregister_command (cmd_unload);
}
| Firef0x/burg | efiemu/main.c | C | gpl-3.0 | 8,909 |
package org.graylog.plugin.zeromq;
import org.graylog2.plugin.Plugin;
import org.graylog2.plugin.PluginMetaData;
import org.graylog2.plugin.PluginModule;
import java.util.Collection;
import java.util.Collections;
public class ZeroMQPlugin implements Plugin {
@Override
public PluginMetaData metadata() {
return new ZeroMQPluginMetaData();
}
@Override
public Collection<PluginModule> modules() {
return Collections.<PluginModule>singleton(new ZeroMQPluginModule());
}
}
| Graylog2/graylog-plugin-zeromq | src/main/java/org/graylog/plugin/zeromq/ZeroMQPlugin.java | Java | gpl-3.0 | 513 |
// RUN: %clang_cc1 -DCHECK -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-64
// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-64
// RUN: %clang_cc1 -DCHECK -verify -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-32
// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
// RUN: %clang_cc1 -DCHECK -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix CHECK --check-prefix CHECK-32
// RUN: %clang_cc1 -DCHECK -verify -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -DCHECK -verify -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
// RUN: %clang_cc1 -DCHECK -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY0 %s
// SIMD-ONLY0-NOT: {{__kmpc|__tgt}}
// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix LAMBDA --check-prefix LAMBDA-64
// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
// RUN: %clang_cc1 -DLAMBDA -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix LAMBDA --check-prefix LAMBDA-64
// RUN: %clang_cc1 -DLAMBDA -verify -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY1 %s
// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
// RUN: %clang_cc1 -DLAMBDA -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap --check-prefix SIMD-ONLY1 %s
// SIMD-ONLY1-NOT: {{__kmpc|__tgt}}
// expected-no-diagnostics
#ifndef HEADER
#define HEADER
struct St {
int a, b;
St() : a(0), b(0) {}
St(const St &st) : a(st.a + st.b), b(0) {}
~St() {}
};
volatile int g = 1212;
volatile int &g1 = g;
template <class T>
struct S {
T f;
S(T a) : f(a + g) {}
S() : f(g) {}
S(const S &s, St t = St()) : f(s.f + t.a) {}
operator T() { return T(); }
~S() {}
};
// CHECK-DAG: [[S_FLOAT_TY:%.+]] = type { float }
// CHECK-DAG: [[S_INT_TY:%.+]] = type { i{{[0-9]+}} }
template <typename T>
T tmain() {
S<T> test;
T t_var = T();
T vec[] = {1, 2};
S<T> s_arr[] = {1, 2};
S<T> &var = test;
#pragma omp target
#pragma omp teams distribute parallel for simd private(t_var, vec, s_arr, var)
for (int i = 0; i < 2; ++i) {
vec[i] = t_var;
s_arr[i] = var;
}
return T();
}
// CHECK-DAG: [[TEST:@.+]] ={{.*}} global [[S_FLOAT_TY]] zeroinitializer,
S<float> test;
// CHECK-DAG: [[T_VAR:@.+]] ={{.*}} global i{{[0-9]+}} 333,
int t_var = 333;
// CHECK-DAG: [[VEC:@.+]] ={{.*}} global [2 x i{{[0-9]+}}] [i{{[0-9]+}} 1, i{{[0-9]+}} 2],
int vec[] = {1, 2};
// CHECK-DAG: [[S_ARR:@.+]] ={{.*}} global [2 x [[S_FLOAT_TY]]] zeroinitializer,
S<float> s_arr[] = {1, 2};
// CHECK-DAG: [[VAR:@.+]] ={{.*}} global [[S_FLOAT_TY]] zeroinitializer,
S<float> var(3);
// CHECK-DAG: [[SIVAR:@.+]] = internal global i{{[0-9]+}} 0,
int main() {
static int sivar;
#ifdef LAMBDA
// LAMBDA: [[G:@.+]] ={{.*}} global i{{[0-9]+}} 1212,
// LAMBDA-LABEL: @main
// LAMBDA: call void [[OUTER_LAMBDA:@.+]](
[&]() {
// LAMBDA: define{{.*}} internal{{.*}} void [[OUTER_LAMBDA]](
// LAMBDA: call i32 @__tgt_target_teams_mapper(%struct.ident_t* @{{.+}}, i64 -1, i8* @{{[^,]+}}, i32 1, i8** %{{[^,]+}}, i8** %{{[^,]+}}, i{{64|32}}* {{.+}}@{{[^,]+}}, i32 0, i32 0), i64* {{.+}}@{{[^,]+}}, i32 0, i32 0), i8** null
// LAMBDA: call void @[[LOFFL1:.+]](
// LAMBDA: ret
#pragma omp target
#pragma omp teams distribute parallel for simd private(g, g1, sivar)
for (int i = 0; i < 2; ++i) {
// LAMBDA: define{{.*}} internal{{.*}} void @[[LOFFL1]](i{{64|32}} {{%.+}})
// LAMBDA: call void {{.+}} @__kmpc_fork_teams({{.+}}, i32 0, {{.+}} @[[LOUTL1:.+]] to {{.+}})
// LAMBDA: ret void
// LAMBDA: define internal void @[[LOUTL1]]({{.+}})
// Skip global, bound tid and loop vars
// LAMBDA: {{.+}} = alloca i32*,
// LAMBDA: {{.+}} = alloca i32*,
// LAMBDA: alloca i32,
// LAMBDA: alloca i32,
// LAMBDA: alloca i32,
// LAMBDA: alloca i32,
// LAMBDA: alloca i32,
// LAMBDA: alloca i32,
// LAMBDA: [[G_PRIV:%.+]] = alloca i{{[0-9]+}},
// LAMBDA: [[G1_PRIV:%.+]] = alloca i{{[0-9]+}}
// LAMBDA: [[TMP:%.+]] = alloca i{{[0-9]+}}*,
// LAMBDA: [[SIVAR_PRIV:%.+]] = alloca i{{[0-9]+}},
// LAMBDA: store{{.+}} [[G1_PRIV]], {{.+}} [[TMP]],
g = 1;
g1 = 1;
sivar = 2;
// LAMBDA: call void @__kmpc_for_static_init_4(
// LAMBDA: call void {{.+}} @__kmpc_fork_call({{.+}}, {{.+}}, {{.+}} @[[LPAR_OUTL:.+]] to
// LAMBDA: call void @__kmpc_for_static_fini(
// LAMBDA: ret void
// LAMBDA: define internal void @[[LPAR_OUTL]]({{.+}})
// Skip global, bound tid and loop vars
// LAMBDA: {{.+}} = alloca i32*,
// LAMBDA: {{.+}} = alloca i32*,
// LAMBDA: alloca i{{[0-9]+}},
// LAMBDA: alloca i{{[0-9]+}},
// LAMBDA: alloca i32,
// LAMBDA: alloca i32,
// LAMBDA: alloca i32,
// LAMBDA: alloca i32,
// LAMBDA: alloca i32,
// LAMBDA: alloca i32,
// LAMBDA: [[G_PRIV:%.+]] = alloca i{{[0-9]+}},
// LAMBDA: [[G1_PRIV:%.+]] = alloca i{{[0-9]+}}
// LAMBDA: [[TMP:%.+]] = alloca i{{[0-9]+}}*,
// LAMBDA: [[SIVAR_PRIV:%.+]] = alloca i{{[0-9]+}},
// LAMBDA: store{{.+}} [[G1_PRIV]], {{.+}} [[TMP]],
// LAMBDA-DAG: store{{.+}} 1, {{.+}} [[G_PRIV]],
// LAMBDA-DAG: store{{.+}} 2, {{.+}} [[SIVAR_PRIV]],
// LAMBDA-DAG: [[G1_REF:%.+]] = load{{.+}}, {{.+}} [[TMP]],
// LAMBDA-DAG: store{{.+}} 1, {{.+}} [[G1_REF]],
// LAMBDA: call void [[INNER_LAMBDA:@.+]](
// LAMBDA: call void @__kmpc_for_static_fini(
// LAMBDA: ret void
[&]() {
// LAMBDA: define {{.+}} void [[INNER_LAMBDA]]({{.+}} [[ARG_PTR:%.+]])
// LAMBDA: store %{{.+}}* [[ARG_PTR]], %{{.+}}** [[ARG_PTR_REF:%.+]],
g = 2;
g1 = 2;
sivar = 4;
// LAMBDA: [[ARG_PTR:%.+]] = load %{{.+}}*, %{{.+}}** [[ARG_PTR_REF]]
// LAMBDA: [[G_PTR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG_PTR]], i{{[0-9]+}} 0, i{{[0-9]+}} 0
// LAMBDA: [[G_REF:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[G_PTR_REF]]
// LAMBDA: store i{{[0-9]+}} 2, i{{[0-9]+}}* [[G_REF]]
// LAMBDA: [[G1_PTR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG_PTR]], i{{[0-9]+}} 0, i{{[0-9]+}} 1
// LAMBDA: [[G1_REF:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[G1_PTR_REF]]
// LAMBDA: store i{{[0-9]+}} 2, i{{[0-9]+}}* [[G1_REF]]
// LAMBDA: [[SIVAR_PTR_REF:%.+]] = getelementptr inbounds %{{.+}}, %{{.+}}* [[ARG_PTR]], i{{[0-9]+}} 0, i{{[0-9]+}} 2
// LAMBDA: [[SIVAR_REF:%.+]] = load i{{[0-9]+}}*, i{{[0-9]+}}** [[SIVAR_PTR_REF]]
// LAMBDA: store i{{[0-9]+}} 4, i{{[0-9]+}}* [[SIVAR_REF]]
}();
}
}();
return 0;
// LAMBDA: !{!"llvm.loop.vectorize.enable", i1 true}
#else
#pragma omp target
#pragma omp teams distribute parallel for simd private(t_var, vec, s_arr, var, sivar)
for (int i = 0; i < 2; ++i) {
vec[i] = t_var;
s_arr[i] = var;
sivar += i;
}
return tmain<int>();
#endif
}
// CHECK: define {{.*}}i{{[0-9]+}} @main()
// CHECK: call i32 @__tgt_target_teams_mapper(%struct.ident_t* @{{.+}}, i64 -1, i8* @{{[^,]+}}, i32 0, i8** null, i8** null, i{{64|32}}* null, i64* null, i8** null, i8** null, i32 0, i32 0)
// CHECK: call void @[[OFFL1:.+]]()
// CHECK: {{%.+}} = call{{.*}} i32 @[[TMAIN_INT:.+]]()
// CHECK: ret
// CHECK: define{{.*}} void @[[OFFL1]]()
// CHECK: call void {{.+}} @__kmpc_fork_teams({{.+}}, i32 0, {{.+}} @[[OUTL1:.+]] to {{.+}})
// CHECK: ret void
// CHECK: define internal void @[[OUTL1]]({{.+}})
// Skip global, bound tid and loop vars
// CHECK: {{.+}} = alloca i32*,
// CHECK: {{.+}} = alloca i32*,
// CHECK: {{.+}} = alloca i32,
// CHECK: {{.+}} = alloca i32,
// CHECK: {{.+}} = alloca i32,
// CHECK: {{.+}} = alloca i32,
// CHECK: {{.+}} = alloca i32,
// CHECK-DAG: [[T_VAR_PRIV:%.+]] = alloca i{{[0-9]+}},
// CHECK-DAG: [[VEC_PRIV:%.+]] = alloca [2 x i{{[0-9]+}}],
// CHECK-DAG: [[S_ARR_PRIV:%.+]] = alloca [2 x [[S_FLOAT_TY]]],
// CHECK-DAG: [[VAR_PRIV:%.+]] = alloca [[S_FLOAT_TY]],
// CHECK-DAG: [[SIVAR_PRIV:%.+]] = alloca i{{[0-9]+}},
// CHECK: alloca i32,
// private(s_arr)
// CHECK-DAG: [[S_ARR_PRIV_BGN:%.+]] = getelementptr{{.*}} [2 x [[S_FLOAT_TY]]], [2 x [[S_FLOAT_TY]]]* [[S_ARR_PRIV]],
// CHECK-DAG: [[S_ARR_PTR_ALLOC:%.+]] = phi{{.+}} [ [[S_ARR_PRIV_BGN]], {{.+}} ], [ [[S_ARR_NEXT:%.+]], {{.+}} ]
// CHECK-DAG: call void @{{.+}}({{.+}} [[S_ARR_PTR_ALLOC]])
// CHECK-DAG: [[S_ARR_NEXT]] = getelementptr {{.+}} [[S_ARR_PTR_ALLOC]],
// private(var)
// CHECK-DAG: call void @{{.+}}({{.+}} [[VAR_PRIV]])
// CHECK: call void @__kmpc_for_static_init_4(
// CHECK: call void {{.+}} @__kmpc_fork_call({{.+}}, {{.+}}, {{.+}} @[[PAR_OUTL1:.+]] to
// CHECK: call void @__kmpc_for_static_fini(
// CHECK: ret void
// CHECK: define internal void @[[PAR_OUTL1]]({{.+}})
// Skip global, bound tid and loop vars
// CHECK: {{.+}} = alloca i32*,
// CHECK: {{.+}} = alloca i32*,
// CHECK: {{.+}} = alloca i{{[0-9]+}},
// CHECK: {{.+}} = alloca i{{[0-9]+}},
// CHECK: {{.+}} = alloca i32,
// CHECK: {{.+}} = alloca i32,
// CHECK: {{.+}} = alloca i32,
// CHECK: {{.+}} = alloca i32,
// CHECK: {{.+}} = alloca i32,
// CHECK: {{.+}} = alloca i32,
// CHECK-DAG: [[T_VAR_PRIV:%.+]] = alloca i{{[0-9]+}},
// CHECK-DAG: [[VEC_PRIV:%.+]] = alloca [2 x i{{[0-9]+}}],
// CHECK-DAG: [[S_ARR_PRIV:%.+]] = alloca [2 x [[S_FLOAT_TY]]],
// CHECK-DAG: [[VAR_PRIV:%.+]] = alloca [[S_FLOAT_TY]],
// CHECK-DAG: [[SIVAR_PRIV:%.+]] = alloca i{{[0-9]+}},
// CHECK: alloca i32,
// private(s_arr)
// CHECK-DAG: [[S_ARR_PRIV_BGN:%.+]] = getelementptr{{.*}} [2 x [[S_FLOAT_TY]]], [2 x [[S_FLOAT_TY]]]* [[S_ARR_PRIV]],
// CHECK-DAG: [[S_ARR_PTR_ALLOC:%.+]] = phi{{.+}} [ [[S_ARR_PRIV_BGN]], {{.+}} ], [ [[S_ARR_NEXT:%.+]], {{.+}} ]
// CHECK-DAG: call void @{{.+}}({{.+}} [[S_ARR_PTR_ALLOC]])
// CHECK-DAG: [[S_ARR_NEXT]] = getelementptr {{.+}} [[S_ARR_PTR_ALLOC]],
// private(var)
// CHECK-DAG: call void @{{.+}}({{.+}} [[VAR_PRIV]])
// CHECK: call void @__kmpc_for_static_init_4(
// CHECK-DAG: {{.+}} = {{.+}} [[T_VAR_PRIV]]
// CHECK-DAG: {{.+}} = {{.+}} [[VEC_PRIV]]
// CHECK-DAG: {{.+}} = {{.+}} [[S_ARR_PRIV]]
// CHECK-DAG: {{.+}} = {{.+}} [[VAR_PRIV]]
// CHECK-DAG: {{.+}} = {{.+}} [[SIVAR_PRIV]]
// CHECK: call void @__kmpc_for_static_fini(
// CHECK: ret void
// CHECK: define{{.*}} i{{[0-9]+}} @[[TMAIN_INT]]()
// CHECK: call i32 @__tgt_target_teams_mapper(%struct.ident_t* @{{.+}}, i64 -1, i8* @{{[^,]+}}, i32 0,
// CHECK: call void @[[TOFFL1:.+]]()
// CHECK: ret
// CHECK: define {{.*}}void @[[TOFFL1]]()
// CHECK: call void {{.+}} @__kmpc_fork_teams({{.+}}, i32 0, {{.+}} @[[TOUTL1:.+]] to {{.+}})
// CHECK: ret void
// CHECK: define internal void @[[TOUTL1]]({{.+}})
// Skip global, bound tid and loop vars
// CHECK: {{.+}} = alloca i32*,
// CHECK: {{.+}} = alloca i32*,
// CHECK: alloca i{{[0-9]+}},
// CHECK: alloca i{{[0-9]+}},
// CHECK: alloca i{{[0-9]+}},
// CHECK: alloca i{{[0-9]+}},
// CHECK: alloca i{{[0-9]+}},
// CHECK: alloca i{{[0-9]+}},
// CHECK: [[T_VAR_PRIV:%.+]] = alloca i{{[0-9]+}},
// CHECK: [[VEC_PRIV:%.+]] = alloca [2 x i{{[0-9]+}}],
// CHECK: [[S_ARR_PRIV:%.+]] = alloca [2 x [[S_INT_TY]]],
// CHECK: [[VAR_PRIV:%.+]] = alloca [[S_INT_TY]],
// CHECK: [[TMP:%.+]] = alloca [[S_INT_TY]]*,
// private(s_arr)
// CHECK-DAG: [[S_ARR_PRIV_BGN:%.+]] = getelementptr{{.*}} [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* [[S_ARR_PRIV]],
// CHECK-DAG: [[S_ARR_PTR_ALLOC:%.+]] = phi{{.+}} [ [[S_ARR_PRIV_BGN]], {{.+}} ], [ [[S_ARR_NEXT:%.+]], {{.+}} ]
// CHECK-DAG: call void @{{.+}}({{.+}} [[S_ARR_PTR_ALLOC]])
// CHECK-DAG: [[S_ARR_NEXT]] = getelementptr {{.+}} [[S_ARR_PTR_ALLOC]],
// CHECK-DAG: [[S_ARR_PRIV_BGN:%.+]] = getelementptr{{.*}} [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* [[S_ARR_PRIV]],
// CHECK-DAG: [[S_ARR_PTR_ALLOC:%.+]] = phi{{.+}} [ [[S_ARR_PRIV_BGN]], {{.+}} ], [ [[S_ARR_NEXT:%.+]], {{.+}} ]
// CHECK-DAG: call void @{{.+}}({{.+}} [[S_ARR_PTR_ALLOC]])
// CHECK-DAG: [[S_ARR_NEXT]] = getelementptr {{.+}} [[S_ARR_PTR_ALLOC]],
// private(var)
// CHECK-DAG: call void @{{.+}}({{.+}} [[VAR_PRIV]])
// CHECK-DAG: store{{.+}} [[VAR_PRIV]], {{.+}} [[TMP]]
// CHECK: call void @__kmpc_for_static_init_4(
// CHECK: call void {{.+}} @__kmpc_fork_call({{.+}}, {{.+}}, {{.+}} @[[TPAR_OUTL1:.+]] to
// CHECK: call void @__kmpc_for_static_fini(
// CHECK: ret void
// CHECK: define internal void @[[TPAR_OUTL1]]({{.+}})
// Skip global, bound tid and loop vars
// CHECK: {{.+}} = alloca i32*,
// CHECK: {{.+}} = alloca i32*,
// prev lb and ub
// CHECK: alloca i{{[0-9]+}},
// CHECK: alloca i{{[0-9]+}},
// iter variables
// CHECK: alloca i{{[0-9]+}},
// CHECK: alloca i{{[0-9]+}},
// CHECK: alloca i{{[0-9]+}},
// CHECK: alloca i{{[0-9]+}},
// CHECK: alloca i{{[0-9]+}},
// CHECK: alloca i32,
// CHECK: [[T_VAR_PRIV:%.+]] = alloca i{{[0-9]+}},
// CHECK: [[VEC_PRIV:%.+]] = alloca [2 x i{{[0-9]+}}],
// CHECK: [[S_ARR_PRIV:%.+]] = alloca [2 x [[S_INT_TY]]],
// CHECK: [[VAR_PRIV:%.+]] = alloca [[S_INT_TY]],
// CHECK: [[TMP:%.+]] = alloca [[S_INT_TY]]*,
// private(s_arr)
// CHECK-DAG: [[S_ARR_PRIV_BGN:%.+]] = getelementptr{{.*}} [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* [[S_ARR_PRIV]],
// CHECK-DAG: [[S_ARR_PTR_ALLOC:%.+]] = phi{{.+}} [ [[S_ARR_PRIV_BGN]], {{.+}} ], [ [[S_ARR_NEXT:%.+]], {{.+}} ]
// CHECK-DAG: call void @{{.+}}({{.+}} [[S_ARR_PTR_ALLOC]])
// CHECK-DAG: [[S_ARR_NEXT]] = getelementptr {{.+}} [[S_ARR_PTR_ALLOC]],
// CHECK-DAG: [[S_ARR_PRIV_BGN:%.+]] = getelementptr{{.*}} [2 x [[S_INT_TY]]], [2 x [[S_INT_TY]]]* [[S_ARR_PRIV]],
// CHECK-DAG: [[S_ARR_PTR_ALLOC:%.+]] = phi{{.+}} [ [[S_ARR_PRIV_BGN]], {{.+}} ], [ [[S_ARR_NEXT:%.+]], {{.+}} ]
// CHECK-DAG: call void @{{.+}}({{.+}} [[S_ARR_PTR_ALLOC]])
// CHECK-DAG: [[S_ARR_NEXT]] = getelementptr {{.+}} [[S_ARR_PTR_ALLOC]],
// private(var)
// CHECK-DAG: call void @{{.+}}({{.+}} [[VAR_PRIV]])
// CHECK-DAG: store{{.+}} [[VAR_PRIV]], {{.+}} [[TMP]]
// CHECK: call void @__kmpc_for_static_init_4(
// CHECK-DAG: {{.+}} = {{.+}} [[T_VAR_PRIV]]
// CHECK-DAG: {{.+}} = {{.+}} [[VEC_PRIV]]
// CHECK-DAG: {{.+}} = {{.+}} [[S_ARR_PRIV]]
// CHECK-DAG: {{.+}} = {{.+}} [[TMP]]
// CHECK: call void @__kmpc_for_static_fini(
// CHECK: ret void
// CHECK: !{!"llvm.loop.vectorize.enable", i1 true}
#endif
| sabel83/metashell | 3rd/templight/clang/test/OpenMP/teams_distribute_parallel_for_simd_private_codegen.cpp | C++ | gpl-3.0 | 16,652 |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="tr" xml:lang="tr"><head><!--
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
This file is generated from xml source: DO NOT EDIT
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-->
<title>htdigest - Özet kimlik doğrulama dosyalarını yönetir - Apache HTTP Sunucusu</title>
<link href="../../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
<link href="../../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
<link href="../../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
<link href="../../images/favicon.ico" rel="shortcut icon" /></head>
<body id="manual-page"><div id="page-header">
<p class="menu"><a href="../mod/index.html">Modüller</a> | <a href="../mod/directives.html">Yönergeler</a> | <a href="../faq/index.html">SSS</a> | <a href="../glossary.html">Terimler</a> | <a href="../sitemap.html">Site Haritası</a></p>
<p class="apache">Apache HTTP Sunucusu Sürüm 2.2</p>
<img alt="" src="../../images/feather.gif" /></div>
<div class="up"><a href="./index.html"><img title="<-" alt="<-" src="../../images/left.gif" /></a></div>
<div id="path">
<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Sunucusu</a> > <a href="http://httpd.apache.org/docs/">Belgeleme</a> > <a href="../index.html">Sürüm 2.2</a> > <a href="./index.html">Programlar</a></div><div id="page-content"><div id="preamble"><h1>htdigest - Özet kimlik doğrulama dosyalarını yönetir</h1>
<div class="toplang">
<p><span>Mevcut Diller: </span><a href="../../en/programs/htdigest.html" hreflang="en" rel="alternate" title="English"> en </a> |
<a href="../../ko/programs/htdigest.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> |
<a href="../../tr/programs/htdigest.html" title="Türkçe"> tr </a></p>
</div>
<p><code><strong>htdigest</strong></code>, HTTP kullanıcılarının digest
türü kimlik doğrulaması için kullanıcı isimlerinin ve parolalarının
saklanmasında kullanılacak düz metin dosyalarını oluşturmak ve güncellemek
için kullanılır. Apache HTTP sunucusunun mevcut özkaynaklarının kullanımı
sadece <code><strong>htdigest</strong></code> tarafından oluşturulan
dosyalarda listelenmiş kullanıcılara tahsis edilebilir.</p>
<p>Bu kılavuz sayfası sadece komut satırı değiştirgelerini listeler.
Kullanıcı kimlik doğrulamasını
<strong><code class="program"><a href="../programs/httpd.html">httpd</a></code></strong>'de yapılandırmak için gerekli
yönergelerle ilgili ayrıntılar için Apache dağıtımının bir parçası olan
ve <a href="http://httpd.apache.org/"> http://httpd.apache.org/</a>
adresinde de bulunan Apache HTTP Sunucusu Belgelerine bakınız.</p>
</div>
<div id="quickview"><ul id="toc"><li><img alt="" src="../../images/down.gif" /> <a href="#synopsis">Kullanım</a></li>
<li><img alt="" src="../../images/down.gif" /> <a href="#options">Seçenekler</a></li>
<li><img alt="" src="../../images/down.gif" /> <a href="#security">Güvenlik Değerlendirmeleri</a></li>
</ul><h3>Ayrıca bakınız:</h3><ul class="seealso"><li><code class="program"><a href="../programs/httpd.html">httpd</a></code></li><li><code class="module"><a href="../mod/mod_auth_digest.html">mod_auth_digest</a></code></li></ul></div>
<div class="top"><a href="#page-header"><img alt="top" src="../../images/up.gif" /></a></div>
<div class="section">
<h2><a name="synopsis" id="synopsis">Kullanım</a></h2>
<p><code><strong>htdigest</strong> [ -<strong>c</strong> ]
<var>parola-dosyası</var> <var>bölge</var> <var>kullanıcı</var></code></p>
</div><div class="top"><a href="#page-header"><img alt="top" src="../../images/up.gif" /></a></div>
<div class="section">
<h2><a name="options" id="options">Seçenekler</a></h2>
<dl>
<dt><code><strong>-c</strong></code></dt>
<dd><code><var>parola-dosyası</var></code> oluşturur. Dosya mevcutsa,
dosya silinip yeniden yazılır.</dd>
<dt><code><var>parola-dosyası</var></code></dt>
<dd>Kullanıcı ismi, parola ve bölge bilgilerini içeren dosyanın ismi.
<code><strong>-c</strong></code> seçeneği verilmişse ve dosya mevcut
değilse oluşturulur, dosya mevcutsa silinip yeniden oluşturulur.</dd>
<dt><code><var>bölge</var></code></dt>
<dd>Kullanıcının mensup olduğu bölge ismi.</dd>
<dt><code><var>kullanıcı</var></code></dt>
<dd><code><var>parola-dosyası</var></code>'nda oluşturulacak veya
güncellenecek kullanıcı ismi. <code><var>kullanıcı</var></code> bu
dosyada mevcut değilse yeni bir girdi eklenir. Girdi mevcutsa parolası
değiştirilir.</dd>
</dl>
</div><div class="top"><a href="#page-header"><img alt="top" src="../../images/up.gif" /></a></div>
<div class="section">
<h2><a name="security" id="security">Güvenlik Değerlendirmeleri</a></h2>
<p>Bu program bir setuid çalıştırılabiliri olarak güvenilir olmadığından
<em>setuid yapılmamalıdır</em>.</p>
</div></div>
<div class="bottomlang">
<p><span>Mevcut Diller: </span><a href="../../en/programs/htdigest.html" hreflang="en" rel="alternate" title="English"> en </a> |
<a href="../../ko/programs/htdigest.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> |
<a href="../../tr/programs/htdigest.html" title="Türkçe"> tr </a></p>
</div><div id="footer">
<p class="apache">Copyright 2012 The Apache Software Foundation.<br /><a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a> altında lisanslıdır.</p>
<p class="menu"><a href="../mod/index.html">Modüller</a> | <a href="../mod/directives.html">Yönergeler</a> | <a href="../faq/index.html">SSS</a> | <a href="../glossary.html">Terimler</a> | <a href="../sitemap.html">Site Haritası</a></p></div>
</body></html> | P3PO/the-phpjs-local-docs-collection | apache2/tr/programs/htdigest.html | HTML | gpl-3.0 | 6,252 |
/*
* Pixel Dungeon
* Copyright (C) 2012-2014 Oleg Dolya
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package com.shatteredpixel.shatteredicepixeldungeon.levels.painters;
import com.shatteredpixel.shatteredicepixeldungeon.Dungeon;
import com.shatteredpixel.shatteredicepixeldungeon.items.Generator;
import com.shatteredpixel.shatteredicepixeldungeon.items.Item;
import com.shatteredpixel.shatteredicepixeldungeon.items.Heap.Type;
import com.shatteredpixel.shatteredicepixeldungeon.items.keys.GoldenKey;
import com.shatteredpixel.shatteredicepixeldungeon.items.keys.IronKey;
import com.shatteredpixel.shatteredicepixeldungeon.levels.Level;
import com.shatteredpixel.shatteredicepixeldungeon.levels.Room;
import com.shatteredpixel.shatteredicepixeldungeon.levels.Terrain;
import com.watabou.utils.Random;
public class VaultPainter extends Painter {
public static void paint( Level level, Room room ) {
fill( level, room, Terrain.WALL );
fill( level, room, 1, Terrain.EMPTY );
int cx = (room.left + room.right) / 2;
int cy = (room.top + room.bottom) / 2;
int c = cx + cy * Level.WIDTH;
switch (Random.Int( 3 )) {
case 0:
level.drop( prize( level ), c ).type = Type.LOCKED_CHEST;
level.addItemToSpawn( new GoldenKey( Dungeon.depth ) );
break;
case 1:
Item i1, i2;
do {
i1 = prize( level );
i2 = prize( level );
} while (i1.getClass() == i2.getClass());
level.drop( i1, c ).type = Type.CRYSTAL_CHEST;
level.drop( i2, c + Level.NEIGHBOURS8[Random.Int( 8 )]).type = Type.CRYSTAL_CHEST;
level.addItemToSpawn( new GoldenKey( Dungeon.depth ) );
break;
case 2:
level.drop( prize( level ), c );
set( level, c, Terrain.PEDESTAL );
break;
}
room.entrance().set( Room.Door.Type.LOCKED );
level.addItemToSpawn( new IronKey( Dungeon.depth ) );
}
private static Item prize( Level level ) {
return Generator.random( Random.oneOf(
Generator.Category.WAND,
Generator.Category.RING,
Generator.Category.ARTIFACT
) );
}
}
| Sarius997/PD-ice | src/com/shatteredpixel/shatteredicepixeldungeon/levels/painters/VaultPainter.java | Java | gpl-3.0 | 2,633 |
/*
* Copyright 2005 MH-Software-Entwicklung. All rights reserved.
* Use is subject to license terms.
*/
package com.jtattoo.plaf;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeEvent;
import java.awt.*;
import javax.swing.*;
import javax.swing.plaf.*;
import javax.swing.plaf.basic.*;
import javax.swing.border.*;
public class BaseComboBoxUI extends BasicComboBoxUI {
protected PropertyChangeListener propertyChangeListener;
public static ComponentUI createUI(JComponent c) {
return new BaseComboBoxUI();
}
public void installUI(JComponent c) {
super.installUI(c);
comboBox.setRequestFocusEnabled(true);
if (comboBox.getEditor() != null) {
if (comboBox.getEditor().getEditorComponent() instanceof JTextField) {
((JTextField) (comboBox.getEditor().getEditorComponent())).setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
}
}
}
protected void installListeners() {
super.installListeners();
propertyChangeListener = new PropertyChangeHandler();
comboBox.addPropertyChangeListener(propertyChangeListener);
}
protected void uninstallListeners() {
comboBox.removePropertyChangeListener(propertyChangeListener);
propertyChangeListener = null;
super.uninstallListeners();
}
public Dimension getPreferredSize(JComponent c) {
Dimension size = super.getPreferredSize(c);
return new Dimension(size.width + 2, size.height + 2);
}
public JButton createArrowButton() {
JButton button = new ArrowButton();
if (JTattooUtilities.isLeftToRight(comboBox)) {
Border border = BorderFactory.createMatteBorder(0, 1, 0, 0, AbstractLookAndFeel.getFrameColor());
button.setBorder(border);
} else {
Border border = BorderFactory.createMatteBorder(0, 0, 0, 1, AbstractLookAndFeel.getFrameColor());
button.setBorder(border);
}
return button;
}
protected void setButtonBorder() {
if (JTattooUtilities.isLeftToRight(comboBox)) {
Border border = BorderFactory.createMatteBorder(0, 1, 0, 0, AbstractLookAndFeel.getFrameColor());
arrowButton.setBorder(border);
} else {
Border border = BorderFactory.createMatteBorder(0, 0, 0, 1, AbstractLookAndFeel.getFrameColor());
arrowButton.setBorder(border);
}
}
public class PropertyChangeHandler implements PropertyChangeListener {
public void propertyChange(PropertyChangeEvent e) {
String name = e.getPropertyName();
if (name.equals("componentOrientation")) {
setButtonBorder();
}
}
}
//-----------------------------------------------------------------------------
public static class ArrowButton extends NoFocusButton {
public void paint(Graphics g) {
Dimension size = getSize();
if (isEnabled()) {
if (getModel().isArmed() && getModel().isPressed()) {
JTattooUtilities.fillHorGradient(g, AbstractLookAndFeel.getTheme().getPressedColors(), 0, 0, size.width, size.height);
} else if (getModel().isRollover()) {
JTattooUtilities.fillHorGradient(g, AbstractLookAndFeel.getTheme().getRolloverColors(), 0, 0, size.width, size.height);
} else if (JTattooUtilities.isActive(this)) {
JTattooUtilities.fillHorGradient(g, AbstractLookAndFeel.getTheme().getButtonColors(), 0, 0, size.width, size.height);
} else {
JTattooUtilities.fillHorGradient(g, AbstractLookAndFeel.getTheme().getInActiveColors(), 0, 0, size.width, size.height);
}
} else {
JTattooUtilities.fillHorGradient(g, AbstractLookAndFeel.getTheme().getDisabledColors(), 0, 0, size.width, size.height);
}
Icon icon = BaseIcons.getComboBoxIcon();
int x = (size.width - icon.getIconWidth()) / 2;
int y = (size.height - icon.getIconHeight()) / 2;
if (getModel().isPressed() && getModel().isArmed()) {
icon.paintIcon(this, g, x + 2, y + 1);
} else {
icon.paintIcon(this, g, x + 1, y);
}
paintBorder(g);
}
}
}
| JanOveSaltvedt/kbot | src/com/jtattoo/plaf/BaseComboBoxUI.java | Java | gpl-3.0 | 4,425 |
import requests
from PIL import Image, ImageEnhance, ImageChops, ImageFilter
from io import BytesIO, StringIO
import time
import sys, os
import codecs
url = 'http://d1222391-23d7-46de-abef-73cbb63c1862.levels.pathwar.net'
imgurl = url + '/captcha.php'
headers = { 'Host' : 'd1222391-23d7-46de-abef-73cbb63c1862.levels.pathwar.net',
'User-Agent' : 'Mozilla/5.0 (X11; Linux x86_64; rv:37.0) Gecko/20100101 Firefox/37.0',
'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Language' : 'en-US,en;q=0.5',
'Accept-Encoding' : 'gzip, deflate',
'DNT' : '1',
'Referer' : 'http://http://d1222391-23d7-46de-abef-73cbb63c1862.levels.pathwar.net/',
'Cookie' : 'PHPSESSID=',#erased
'Authorization' : 'Basic ',#erased
# 'Connection' : 'keep-alive',
'Content-Type' : 'application/x-www-form-urlencoded' }
def recognize(img, bounds):
# read dataset of images for each letter
imgs = {}
datfile = open("ads.dat", "rt")
line = datfile.readline()
while line!="":
key = line[0]
if key not in imgs:
imgs[key] = []
imgs[key].append(Image.open(StringIO.StringIO(line[2:-1].decode("hex"))))
line = datfile.readline()
datfile.close()
# calculate difference with dataset for each boundbox
word = ""
for bound in bounds:
guess = []
total = (img.crop(bound).size)[0]*(img.crop(bound).size)[1]*1.0
for key in imgs:
for pattern in imgs[key]:
diff = ImageChops.difference(img.crop(bound), pattern.resize(img.crop(bound).size, Image.NEAREST))
pixels = list(diff.getdata())
samePixCnt = sum(i==0 for i in pixels)
guess.append([samePixCnt, key])
guess.sort(reverse=True)
word = word+guess[0][1]
print(total, guess[0:3], guess[0][0]/total, guess[1][0]/total, guess[2][0]/total)
print(word)
return word.replace("_", "")
def separate(img):
# count number of pixels for each column
colPixCnts = []
for col in range(img.size[0]):
pixels = list(img.crop([col, 0, col+1, img.size[1]]).getdata())
colPixCnts.append(sum(i==0 for i in pixels))
print (colPixCnts)
print("\n")
# average out pixel counts for trough column
for i in range(3, len(colPixCnts)-3, 2):
if colPixCnts[i-3]>4 and colPixCnts[i+3]>4:
colPixCnts[i-2:i+3] = [j+10 for j in colPixCnts[i-2:i+3]]
print(colPixCnts)
print("\n")
# calculate all bounding boxes of all letters
bounds = []
left = 0
right = 0
for col in range(img.size[0]): # slice all letters per column
if left==0 and colPixCnts[col]>20: # if (begin not set) and (col has letter)
left = col # then letter begin
if left!=0 and colPixCnts[col]<=20: # if (begin is set) and (col no letter)
right = col # then letter end
if right-left>8: # if (the letter is wide enough)
##############################################
print((right-left))
top = -1
bottom = -1
prev = -1
curr = -1
for row in range(img.size[1]): # slice single letter per row
pixels = list(img.crop([left, row, right, row+1]).getdata())
rowPixCnt = sum(i==255 for i in pixels)
if rowPixCnt==(right-left): # if (row no letter)
curr = row
if (curr-prev)>(bottom-top): # if (the letter is tall enough)
top = prev
bottom = curr
prev = curr
if (img.size[1]-prev)>(bottom-top): # if (the letter align to bottom)
top = prev
bottom = img.size[1]
##############################################
bounds.append([left, top+1, right, bottom]) # top row should has letter
left = 0
right = 0
print(bounds)
return bounds
def prepare(im):
im2 = Image.new("P",im.size,255)
for x in range(im.size[1]):
for y in range(im.size[0]):
pix = im.getpixel((y,x))
if pix == 1: # these are the numbers to get
im2.putpixel((y,x),0)
# im2 = im2.convert("RGB")
im2 = im2.resize((im2.size[0]*8, im2.size[1]*8), Image.BILINEAR)
# im2 = im2.resize((int(im2.size[0] / 2), int(im2.size[1] / 2)), Image.ANTIALIAS)
# im2 = ImageEnhance.Contrast(im2).enhance(1.4)
# im2 = ImageEnhance.Sharpness(im2).enhance(5)
# im2 = ImageChops.invert(im2)
# im2 = im2.filter(ImageFilter.MedianFilter(3))
# im2 = im2.convert('P')
return im2
def _train(img, bounds):
datfile = open("ads.dat", "rt")
lines = datfile.readlines()
datfile.close()
datfile = open("ads.dat", "at")
for bound in bounds:
img.crop(bound).show()
letter = input("Type in the letters you see in the image above (ENTER to skip): ")
bmpfile = BytesIO()
img.crop(bound).save(bmpfile, format='BMP')
# g = codecs.encode(bmpfile.getvalue(), 'hex_codec')
s = codecs.encode(bmpfile.getvalue(), 'hex')
s = codecs.decode(s)
line = letter+"|"+s+"\n"
if (letter!="") and (line not in lines): # if (not skipped) and (not duplicated)
datfile.write(line)
print(line)
bmpfile.close()
datfile.close()
def vertical_cut(im):
im = im.convert("P")
im2 = Image.new("P",im.size,255)
im = im.convert("P")
temp = {}
for x in range(im.size[1]):
for y in range(im.size[0]):
pix = im.getpixel((y,x))
temp[pix] = pix
if pix == 1: # these are the numbers to get
im2.putpixel((y,x),0)
# new code starts here
inletter = False
foundletter=False
start = 0
end = 0
letters = []
for y in range(im2.size[0]): # slice across
for x in range(im2.size[1]): # slice down
pix = im2.getpixel((y,x))
if pix != 255:
inletter = True
if foundletter == False and inletter == True:
foundletter = True
start = y
if foundletter == True and inletter == False:
foundletter = False
end = y
letters.append((start,end))
inletter=False
bounds = []
for letter in letters:
bounds.append([ letter[0] , 0, letter[1], im2.size[1] ])
print(bounds)
return bounds
if __name__=="__main__":
# if len(sys.argv) < 2:
# print(("usage: %s image" % (sys.argv[0])))
# sys.exit(2)
# file_name = sys.argv[1]
# img = Image.open(file_name).convert('P')
i = 0
while i < 3 :
response = requests.get(imgurl, headers = headers)
the_page = response.content
file = BytesIO(the_page)
img = Image.open(file)
# img = prepare(img)
img = img.resize((img.size[0]*4, img.size[1]*4), Image.BILINEAR)
img.show()
# bounds = separate(img)
bounds = vertical_cut(img)
_train(img, bounds)
i = i + 1
| KKfo/captcha_solver | experiment.py | Python | gpl-3.0 | 7,350 |
<?php
namespace NethServer\Module;
/*
* Copyright (C) 2011 Nethesis S.r.l.
*
* This script is part of NethServer.
*
* NethServer is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* NethServer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with NethServer. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* FirewallRules with plugin behaviour
* All tabs can be plugins.
*/
class FirewallRules extends \Nethgui\Controller\CollectionController implements \Nethgui\Utility\SessionConsumerInterface
{
const RULESTEP = 64;
/**
*
* @var \Nethgui\Utility\SessionInterface
*/
private $session;
protected function initializeAttributes(\Nethgui\Module\ModuleAttributesInterface $base)
{
return \Nethgui\Module\SimpleModuleAttributesProvider::extendModuleAttributes($base, 'Gateway', 10);
}
public function initialize()
{
$this
->setAdapter($this->getPlatform()->getTableAdapter('fwrules', 'rule'))
->setIndexAction(new \NethServer\Module\FirewallRules\Index())
;
$this
->addChild(new \NethServer\Module\FirewallRules\Create())
->addChild(new \NethServer\Module\FirewallRules\Edit())
->addChild(new \NethServer\Module\FirewallRules\EditService())
->addChild(new \NethServer\Module\FirewallRules\Copy())
->addChild(new \NethServer\Module\FirewallRules\PickObject())
->addChild(new \NethServer\Module\FirewallRules\Delete())
->addChild(new \NethServer\Module\FirewallRules\General())
->addChild(new \NethServer\Module\FirewallRules\CreateHostGroup())
->addChild(new \NethServer\Module\FirewallRules\CreateZone())
->addChild(new \NethServer\Module\FirewallRules\CreateHost())
->addChild(new \NethServer\Module\FirewallRules\CreateService())
->addChild(new \NethServer\Module\FirewallRules\CreateTime())
->addChild(new \NethServer\Module\FirewallRules\CheckRules())
->addChild(new \NethServer\Module\FirewallRules\CreateCidr())
->addChild(new \NethServer\Module\FirewallRules\CreateIpRange())
;
parent::initialize();
}
public function process()
{
parent::process();
if ($this->getRequest()->isMutation()) {
$A = $this->getAdapter();
$A->flush();
}
}
public function fixOrderedSetPositions()
{
$A = $this->getAdapter();
$A->flush();
$H = \iterator_to_array($A);
uasort($H, function($a, $b) {
$ap = isset($a['Position']) ? $a['Position'] : 0;
$bp = isset($b['Position']) ? $b['Position'] : 0;
return $ap > $bp;
});
// FIXME: Stupid routine to fix Position on every record.
// Could be optimized.
// Here we assume every rule must fit exactly a slot of RULESTEP
// units width.
$adjustPositions = function () use ($H, $A) {
$i = 0;
foreach (array_keys($H) as $key) {
$A[$key] = array('Position' => ($i + 1) * \NethServer\Module\FirewallRules::RULESTEP);
$i ++;
}
$A->save();
$A->flush();
};
// Check distances are large enough:
$prev = array('Position' => 0);
foreach ($H as $key => $curr) {
if ($curr['Position'] - $prev['Position'] < 4) {
$adjustPositions();
break;
}
$prev = $curr;
}
}
public function setSession(\Nethgui\Utility\SessionInterface $session)
{
$this->session = $session;
return $this;
}
public function getSession()
{
return $this->session;
}
}
| DavidePrincipi/nethserver-firewall-base | root/usr/share/nethesis/NethServer/Module/FirewallRules.php | PHP | gpl-3.0 | 4,269 |
/*
* Geopaparazzi - Digital field mapping on Android based devices
* Copyright (C) 2010 HydroloGIS (www.hydrologis.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package eu.geopaparazzi.library.routing.osmbonuspack;
import java.util.ArrayList;
/**
* Methods to encode and decode a polyline with Google polyline encoding/decoding scheme.
* @see <a href="https://developers.google.com/maps/documentation/utilities/polylinealgorithm">Google polyline algorithm</a>
*/
public class PolylineEncoder {
private static StringBuffer encodeSignedNumber(int num) {
int sgn_num = num << 1;
if (num < 0) {
sgn_num = ~(sgn_num);
}
return(encodeNumber(sgn_num));
}
private static StringBuffer encodeNumber(int num) {
StringBuffer encodeString = new StringBuffer();
while (num >= 0x20) {
int nextValue = (0x20 | (num & 0x1f)) + 63;
encodeString.append((char)(nextValue));
num >>= 5;
}
num += 63;
encodeString.append((char)(num));
return encodeString;
}
/**
* Encode a polyline with Google polyline encoding method
* @param polyline the polyline
* @param precision 1 for a 6 digits encoding, 10 for a 5 digits encoding.
* @return the encoded polyline, as a String
*/
public static String encode(ArrayList<GeoPoint> polyline, int precision) {
StringBuffer encodedPoints = new StringBuffer();
int prev_lat = 0, prev_lng = 0;
for (GeoPoint trackpoint:polyline) {
int lat = trackpoint.getLatitudeE6() / precision;
int lng = trackpoint.getLongitudeE6() / precision;
encodedPoints.append(encodeSignedNumber(lat - prev_lat));
encodedPoints.append(encodeSignedNumber(lng - prev_lng));
prev_lat = lat;
prev_lng = lng;
}
return encodedPoints.toString();
}
/**
* Decode a "Google-encoded" polyline
* @param encodedString
* @param precision 1 for a 6 digits encoding of lat and lon, 10 for a 5 digits encoding.
* @param hasAltitude if the polyline also contains altitude (GraphHopper routes, with altitude in cm).
* @return the polyline.
*/
public static ArrayList<GeoPoint> decode(String encodedString, int precision, boolean hasAltitude) {
int index = 0;
int len = encodedString.length();
int lat = 0, lng = 0, alt = 0;
ArrayList<GeoPoint> polyline = new ArrayList<GeoPoint>(len/3);
//capacity estimate: polyline size is roughly 1/3 of string length for a 5digits encoding, 1/5 for 10digits.
while (index < len) {
int b, shift, result;
shift = result = 0;
do {
b = encodedString.charAt(index++) - 63;
result |= (b & 0x1f) << shift;
shift += 5;
} while (b >= 0x20);
int dlat = ((result & 1) != 0 ? ~(result >> 1) : (result >> 1));
lat += dlat;
shift = result = 0;
do {
b = encodedString.charAt(index++) - 63;
result |= (b & 0x1f) << shift;
shift += 5;
} while (b >= 0x20);
int dlng = ((result & 1) != 0 ? ~(result >> 1) : (result >> 1));
lng += dlng;
if (hasAltitude){
shift = result = 0;
do {
b = encodedString.charAt(index++) - 63;
result |= (b & 0x1f) << shift;
shift += 5;
} while (b >= 0x20);
int dalt = ((result & 1) != 0 ? ~(result >> 1) : (result >> 1));
alt += dalt;
}
GeoPoint p = new GeoPoint(lat*precision, lng*precision, alt/100);
polyline.add(p);
}
//Log.d("BONUSPACK", "decode:string="+len+" points="+polyline.size());
return polyline;
}
}
| Huertix/geopaparazzi | geopaparazzilibrary/src/eu/geopaparazzi/library/routing/osmbonuspack/PolylineEncoder.java | Java | gpl-3.0 | 4,539 |
import logging
from sqlalchemy import *
from kallithea.lib.dbmigrate.migrate import *
from kallithea.lib.dbmigrate.migrate.changeset import *
from kallithea.model import meta
from kallithea.lib.dbmigrate.versions import _reset_base, notify
log = logging.getLogger(__name__)
def upgrade(migrate_engine):
"""
Upgrade operations go here.
Don't create your own engine; bind migrate_engine to your metadata
"""
_reset_base(migrate_engine)
from kallithea.lib.dbmigrate.schema import db_2_2_3
# issue fixups
fixups(db_2_2_3, meta.Session)
def downgrade(migrate_engine):
meta = MetaData()
meta.bind = migrate_engine
def fixups(models, _SESSION):
notify('Creating repository states')
for repo in models.Repository.get_all():
_state = models.Repository.STATE_CREATED
print 'setting repo %s state to "%s"' % (repo, _state)
repo.repo_state = _state
_SESSION().add(repo)
_SESSION().commit()
| zhumengyuan/kallithea | kallithea/lib/dbmigrate/versions/031_version_2_2_3.py | Python | gpl-3.0 | 977 |
../../../../../../../../share/pyshared/ubuntuone-control-panel/ubuntuone/controlpanel/gui/gtk/package_manager.py | Alberto-Beralix/Beralix | i386-squashfs-root/usr/lib/python2.7/dist-packages/ubuntuone-control-panel/ubuntuone/controlpanel/gui/gtk/package_manager.py | Python | gpl-3.0 | 112 |
package games.strategy.triplea.ui.panels.map;
import games.strategy.engine.data.Resource;
import games.strategy.engine.data.ResourceCollection;
import games.strategy.engine.data.Route;
import games.strategy.engine.data.Territory;
import games.strategy.triplea.image.ResourceImageFactory;
import games.strategy.triplea.ui.logic.RouteCalculator;
import games.strategy.triplea.ui.mapdata.MapData;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics2D;
import java.awt.Polygon;
import java.awt.RenderingHints;
import java.awt.Shape;
import java.awt.geom.AffineTransform;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Line2D;
import java.awt.geom.Path2D;
import java.awt.geom.Point2D;
import java.awt.image.BufferedImage;
import java.util.Arrays;
import java.util.List;
import java.util.function.Function;
import org.apache.commons.math3.analysis.interpolation.SplineInterpolator;
import org.apache.commons.math3.analysis.polynomials.PolynomialSplineFunction;
/** Draws a route on a map. */
public class MapRouteDrawer {
private static final SplineInterpolator splineInterpolator = new SplineInterpolator();
/**
* This value influences the "resolution" of the Path. Too low values make the Path look edgy, too
* high values will cause lag and rendering errors because the distance between the drawing
* segments is shorter than 2 pixels
*/
private static final double DETAIL_LEVEL = 1.0;
private static final int ARROW_LENGTH = 4;
private static final int MESSAGE_HEIGHT = 26;
private static final int MESSAGE_PADDING = 8;
private static final int MESSAGE_TEXT_Y = 18;
private static final int MESSAGE_TEXT_SPACING = 6;
private static final Font MESSAGE_FONT = new Font("Dialog", Font.BOLD, 16);
private final RouteCalculator routeCalculator;
private final MapData mapData;
private final MapPanel mapPanel;
MapRouteDrawer(final MapPanel mapPanel, final MapData mapData) {
routeCalculator =
RouteCalculator.builder()
.isInfiniteX(mapData.scrollWrapX())
.isInfiniteY(mapData.scrollWrapY())
.mapWidth(mapPanel.getImageWidth())
.mapHeight(mapPanel.getImageHeight())
.build();
this.mapData = mapData;
this.mapPanel = mapPanel;
}
/** Draws the route to the screen. */
public void drawRoute(
final Graphics2D graphics,
final RouteDescription routeDescription,
final String maxMovement,
final ResourceCollection movementFuelCost,
final ResourceImageFactory resourceImageFactory) {
final Route route = routeDescription.getRoute();
if (route == null) {
return;
}
// set thickness and color of the future drawings
graphics.setStroke(new BasicStroke(3.5f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
graphics.setPaint(Color.red);
graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
final int numTerritories = route.getAllTerritories().size();
final Point2D[] points = routeCalculator.getTranslatedRoute(getRoutePoints(routeDescription));
final boolean tooFewTerritories = numTerritories <= 1;
final boolean tooFewPoints = points.length <= 2;
if (tooFewTerritories || tooFewPoints) {
if (routeDescription.getEnd() != null) { // AI has no End Point
drawDirectPath(graphics, routeDescription.getStart(), routeDescription.getEnd());
} else {
drawDirectPath(graphics, points[0], points[points.length - 1]);
}
if (tooFewPoints && !tooFewTerritories) {
drawMoveLength(
graphics, points, numTerritories, maxMovement, movementFuelCost, resourceImageFactory);
}
} else {
drawCurvedPath(graphics, points);
drawMoveLength(
graphics, points, numTerritories, maxMovement, movementFuelCost, resourceImageFactory);
}
drawJoints(graphics, points);
drawCustomCursor(graphics, routeDescription, points[points.length - 1]);
}
/**
* Draws Points on the Map.
*
* @param graphics The {@linkplain Graphics2D} Object being drawn on
* @param points The {@linkplain Point2D} array aka the "Joints" to be drawn
*/
private void drawJoints(final Graphics2D graphics, final Point2D[] points) {
final int jointsize = 10;
// If the points array is bigger than 1 the last joint should not be drawn (draw an arrow
// instead)
final Point2D[] newPoints =
points.length > 1 ? Arrays.copyOf(points, points.length - 1) : points;
for (final Point2D[] joints : routeCalculator.getAllPoints(newPoints)) {
for (final Point2D p : joints) {
final Ellipse2D circle =
new Ellipse2D.Double(jointsize / -2.0, jointsize / -2.0, jointsize, jointsize);
final AffineTransform ellipseTransform = getDrawingTransform();
ellipseTransform.translate(p.getX(), p.getY());
graphics.fill(ellipseTransform.createTransformedShape(circle));
}
}
}
/**
* Draws a specified CursorImage if available.
*
* @param graphics The {@linkplain Graphics2D} Object being drawn on
* @param routeDescription The RouteDescription object containing the CursorImage
* @param lastRoutePoint The last {@linkplain Point2D} on the drawn Route as a center for the
* cursor icon.
*/
private void drawCustomCursor(
final Graphics2D graphics,
final RouteDescription routeDescription,
final Point2D lastRoutePoint) {
final BufferedImage cursorImage = (BufferedImage) routeDescription.getCursorImage();
if (cursorImage != null) {
for (final Point2D[] endPoint : routeCalculator.getAllPoints(lastRoutePoint)) {
final AffineTransform imageTransform = getDrawingTransform();
imageTransform.translate(endPoint[0].getX(), endPoint[0].getY());
imageTransform.translate(cursorImage.getWidth() / 2.0, cursorImage.getHeight() / 2.0);
imageTransform.scale(1 / mapPanel.getScale(), 1 / mapPanel.getScale());
graphics.drawImage(cursorImage, imageTransform, null);
}
}
}
/**
* Draws a straight Line from the start to the stop of the specified {@linkplain RouteDescription}
* Also draws a small little point at the end of the Line.
*
* @param graphics The {@linkplain Graphics2D} Object being drawn on
* @param start The start {@linkplain Point2D} of the Path
* @param end The end {@linkplain Point2D} of the Path
*/
private void drawDirectPath(final Graphics2D graphics, final Point2D start, final Point2D end) {
final Point2D[] points = routeCalculator.getTranslatedRoute(start, end);
for (final Point2D[] newPoints : routeCalculator.getAllPoints(points)) {
drawTransformedShape(graphics, new Line2D.Float(newPoints[0], newPoints[1]));
if (newPoints[0].distance(newPoints[1]) > ARROW_LENGTH) {
drawArrow(graphics, newPoints[0], newPoints[1]);
}
}
}
/**
* Centripetal parameterization.
*
* <p>Check <a
* href="http://stackoverflow.com/a/37370620/5769952">http://stackoverflow.com/a/37370620/5769952</a>
* for more information
*
* @param points - The Points which should be parameterized
* @return A Parameter-Array called the "Index"
*/
protected double[] newParameterizedIndex(final Point2D[] points) {
final double[] index = new double[points.length];
for (int i = 1; i < points.length; i++) {
final double sqrtDistance = Math.sqrt(points[i - 1].distance(points[i]));
// Ensure that values are increasing even if the distance is 0
index[i] = Math.max(Math.nextUp(index[i - 1]), index[i - 1] + sqrtDistance);
}
return index;
}
/**
* Draws a line to the Screen regarding the Map-Offset.
*
* @param graphics The {@linkplain Graphics2D} Object to be drawn on
* @param shape The Shape to be drawn
*/
private void drawTransformedShape(final Graphics2D graphics, final Shape shape) {
graphics.draw(getDrawingTransform().createTransformedShape(shape));
}
/**
* Creates a {@linkplain Point2D} Array out of a {@linkplain RouteDescription} and a {@linkplain
* MapData} object.
*
* @param routeDescription {@linkplain RouteDescription} containing the Route information
* @return The {@linkplain Point2D} array specified by the {@linkplain RouteDescription} and
* {@linkplain MapData} objects
*/
protected Point2D[] getRoutePoints(final RouteDescription routeDescription) {
final List<Territory> territories = routeDescription.getRoute().getAllTerritories();
final int numTerritories = territories.size();
final Point2D[] points = new Point2D[numTerritories];
for (int i = 0; i < numTerritories; i++) {
points[i] = mapData.getCenter(territories.get(i));
}
if (routeDescription.getStart() != null) {
points[0] = routeDescription.getStart();
}
if (routeDescription.getEnd() != null && numTerritories > 1) {
points[numTerritories - 1] = routeDescription.getEnd();
}
return points;
}
/**
* Creates double arrays of y or x coordinates of the given {@linkplain Point2D} Array.
*
* @param points The {@linkplain Point2D} Array containing the Coordinates
* @param extractor A function specifying which value to return
* @return A double array with values specified by the given function
*/
protected double[] getValues(final Point2D[] points, final Function<Point2D, Double> extractor) {
final double[] result = new double[points.length];
for (int i = 0; i < points.length; i++) {
result[i] = extractor.apply(points[i]);
}
return result;
}
/**
* Creates a double array containing y coordinates of a {@linkplain PolynomialSplineFunction} with
* the above specified {@code DETAIL_LEVEL}.
*
* @param fuction The {@linkplain PolynomialSplineFunction} with the values
* @param index the parameterized array to indicate the maximum Values
* @return an array of double-precision y values of the specified function
*/
protected double[] getCoords(final PolynomialSplineFunction fuction, final double[] index) {
final double defaultCoordSize = index[index.length - 1];
final double[] coords = new double[(int) Math.round(DETAIL_LEVEL * defaultCoordSize) + 1];
final double stepSize = fuction.getKnots()[fuction.getKnots().length - 1] / coords.length;
double curValue = 0;
for (int i = 0; i < coords.length; i++) {
coords[i] = fuction.value(curValue);
curValue += stepSize;
}
return coords;
}
/**
* Draws how many moves are left.
*
* @param graphics The {@linkplain Graphics2D} Object to be drawn on
* @param points The {@linkplain Point2D} array of the unit's tour
* @param numTerritories how many Territories the unit traveled so far
* @param maxMovement The String indicating how man
*/
private void drawMoveLength(
final Graphics2D graphics,
final Point2D[] points,
final int numTerritories,
final String maxMovement,
final ResourceCollection movementFuelCost,
final ResourceImageFactory resourceImageFactory) {
final BufferedImage movementImage =
newMovementLeftImage(
String.valueOf(numTerritories - 1),
maxMovement,
movementFuelCost,
resourceImageFactory);
final int textXOffset = -movementImage.getWidth() / 2;
final Point2D cursorPos = points[points.length - 1];
final double deltaY = cursorPos.getY() - points[numTerritories - 2].getY();
final int textYOffset = deltaY > 0 ? movementImage.getHeight() : movementImage.getHeight() * -2;
for (final Point2D[] cursorPositions : routeCalculator.getAllPoints(cursorPos)) {
final AffineTransform imageTransform = getDrawingTransform();
imageTransform.translate(textXOffset, textYOffset);
imageTransform.translate(cursorPositions[0].getX(), cursorPositions[0].getY());
imageTransform.scale(1 / mapPanel.getScale(), 1 / mapPanel.getScale());
graphics.drawImage(movementImage, imageTransform, null);
}
}
/**
* Draws a smooth curve through the given array of points.
*
* <p>This algorithm is called Spline-Interpolation because the Apache-commons-math library we are
* using here does not accept values but {@code f(x)=y} with x having to increase all the time the
* idea behind this is to use a parameter array - the so called index as x array and splitting the
* points into a x and y coordinates array.
*
* <p>Finally those 2 interpolated arrays get unified into a single {@linkplain Point2D} array and
* drawn to the Map
*
* @param graphics The {@linkplain Graphics2D} Object to be drawn on
* @param points The Knot Points for the Spline-Interpolator aka the joints
*/
private void drawCurvedPath(final Graphics2D graphics, final Point2D[] points) {
final double[] index = newParameterizedIndex(points);
final PolynomialSplineFunction xcurve =
splineInterpolator.interpolate(index, getValues(points, Point2D::getX));
final double[] xcoords = getCoords(xcurve, index);
final PolynomialSplineFunction ycurve =
splineInterpolator.interpolate(index, getValues(points, Point2D::getY));
final double[] ycoords = getCoords(ycurve, index);
final List<Path2D> paths = routeCalculator.getAllNormalizedLines(xcoords, ycoords);
for (final Path2D path : paths) {
drawTransformedShape(graphics, path);
}
// draws the Line to the Cursor on every possible screen, so that the line ends at the cursor no
// matter what...
final List<Point2D[]> finishingPoints =
routeCalculator.getAllPoints(
new Point2D.Double(xcoords[xcoords.length - 1], ycoords[ycoords.length - 1]),
points[points.length - 1]);
final boolean hasArrowEnoughSpace =
points[points.length - 2].distance(points[points.length - 1]) > ARROW_LENGTH;
for (final Point2D[] finishingPointArray : finishingPoints) {
drawTransformedShape(
graphics, new Line2D.Double(finishingPointArray[0], finishingPointArray[1]));
if (hasArrowEnoughSpace) {
drawArrow(graphics, finishingPointArray[0], finishingPointArray[1]);
}
}
}
/** This draws current moves, max moves, and fuel cost. */
private static BufferedImage newMovementLeftImage(
final String curMovement,
final String maxMovement,
final ResourceCollection movementFuelCost,
final ResourceImageFactory resourceImageFactory) {
// Create and configure image
final String unitMovementLeft =
(maxMovement == null || maxMovement.isBlank()) ? "" : "/" + maxMovement;
final int imageWidth =
findMovementLeftImageWidth(curMovement, unitMovementLeft, movementFuelCost);
final BufferedImage image =
new BufferedImage(imageWidth, MESSAGE_HEIGHT, BufferedImage.TYPE_INT_ARGB);
final Graphics2D graphics = image.createGraphics();
graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
graphics.setFont(MESSAGE_FONT);
final FontMetrics fontMetrics = graphics.getFontMetrics();
// Draw background
graphics.setColor(new Color(220, 220, 220));
final int rectHeight = MESSAGE_HEIGHT - 2;
graphics.fillRoundRect(0, 0, imageWidth - 2, rectHeight, rectHeight, rectHeight);
graphics.setColor(Color.BLACK);
graphics.drawRoundRect(0, 0, imageWidth - 2, rectHeight, rectHeight, rectHeight);
// Draw current movement
graphics.setColor(new Color(0, 0, 200));
final boolean hasEnoughMovement = !unitMovementLeft.isEmpty();
final int textWidthOffset = fontMetrics.stringWidth(curMovement) / 2;
graphics.drawString(
curMovement,
!hasEnoughMovement ? (image.getWidth() / 2 - textWidthOffset) : MESSAGE_PADDING,
MESSAGE_TEXT_Y);
// If has enough movement, draw remaining movement and fuel costs
if (hasEnoughMovement) {
int x = MESSAGE_PADDING + fontMetrics.stringWidth(curMovement);
graphics.setColor(new Color(0, 0, 200));
graphics.drawString(unitMovementLeft, x, MESSAGE_TEXT_Y);
x += fontMetrics.stringWidth(unitMovementLeft) + MESSAGE_TEXT_SPACING;
graphics.setColor(new Color(200, 0, 0));
for (final Resource resource : movementFuelCost.getResourcesCopy().keySet()) {
try {
resourceImageFactory.getIcon(resource.getName()).paintIcon(null, graphics, x, 2);
} catch (final IllegalStateException e) {
graphics.drawString(resource.getName().substring(0, 1), x, MESSAGE_TEXT_Y);
}
x += ResourceImageFactory.IMAGE_SIZE;
final String quantity = "-" + movementFuelCost.getQuantity(resource);
graphics.drawString(quantity, x, MESSAGE_TEXT_Y);
x += fontMetrics.stringWidth(quantity) + MESSAGE_TEXT_SPACING;
}
}
graphics.dispose();
return image;
}
private static int findMovementLeftImageWidth(
final String curMovement,
final String unitMovementLeft,
final ResourceCollection movementFuelCost) {
// Create temp graphics to calculate necessary image width based on font sizes
final BufferedImage tempImage = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB);
final Graphics2D tempGraphics = tempImage.createGraphics();
tempGraphics.setFont(MESSAGE_FONT);
final FontMetrics fontMetrics = tempGraphics.getFontMetrics();
// Determine widths of each element to draw
int imageWidth = 2 * MESSAGE_PADDING;
imageWidth += fontMetrics.stringWidth(curMovement);
if (!unitMovementLeft.isEmpty()) {
imageWidth += fontMetrics.stringWidth(unitMovementLeft);
for (final Resource resource : movementFuelCost.getResourcesCopy().keySet()) {
imageWidth += MESSAGE_TEXT_SPACING;
imageWidth += fontMetrics.stringWidth("-" + movementFuelCost.getQuantity(resource));
imageWidth += ResourceImageFactory.IMAGE_SIZE;
}
}
tempGraphics.dispose();
return imageWidth;
}
/**
* Creates an Arrow-Shape.
*
* @param angle The radiant angle at which the arrow should be rotated
* @return A transformed Arrow-Shape
*/
private static Shape newArrowTipShape(final double angle) {
final int arrowOffset = 1;
final Polygon arrowPolygon = new Polygon();
arrowPolygon.addPoint(arrowOffset - ARROW_LENGTH, ARROW_LENGTH / 2);
arrowPolygon.addPoint(arrowOffset, 0);
arrowPolygon.addPoint(arrowOffset - ARROW_LENGTH, ARROW_LENGTH / -2);
final AffineTransform transform = new AffineTransform();
transform.scale(ARROW_LENGTH, ARROW_LENGTH);
transform.rotate(angle);
return transform.createTransformedShape(arrowPolygon);
}
/**
* Draws an Arrow on the {@linkplain Graphics2D} Object.
*
* @param graphics The {@linkplain Graphics2D} object to draw on
* @param from The destination {@linkplain Point2D} form the Arrow
* @param to The placement {@linkplain Point2D} for the Arrow
*/
private void drawArrow(final Graphics2D graphics, final Point2D from, final Point2D to) {
final Shape arrow =
newArrowTipShape(Math.atan2(to.getY() - from.getY(), to.getX() - from.getX()));
final AffineTransform transform = getDrawingTransform();
transform.translate(to.getX(), to.getY());
graphics.fill(transform.createTransformedShape(arrow));
}
private AffineTransform getDrawingTransform() {
return AffineTransform.getTranslateInstance(-mapPanel.getXOffset(), -mapPanel.getYOffset());
}
}
| RoiEXLab/triplea | game-app/game-core/src/main/java/games/strategy/triplea/ui/panels/map/MapRouteDrawer.java | Java | gpl-3.0 | 19,573 |
/*
* Copyright (C) 2005-2013 University of Sydney
*
* Licensed under the GNU License, Version 3.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.gnu.org/licenses/gpl-3.0.txt
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
/**
* brief description of file
*
* @author Tom Murtagh
* @author Kim Jackson
* @author Ian Johnson <ian.johnson@sydney.edu.au>
* @author Stephen White <stephen.white@sydney.edu.au>
* @author Artem Osmakov <artem.osmakov@sydney.edu.au>
* @copyright (C) 2005-2013 University of Sydney
* @link http://Sydney.edu.au/Heurist
* @version 3.1.0
* @license http://www.gnu.org/licenses/gpl-3.0.txt GNU License 3.0
* @package Heurist academic knowledge management system
* @subpackage !!!subpackagename for file such as Administration, Search, Edit, Application, Library
*/
-- createDefinitionTablesOnly.sql: SQL file to create the definition tables for use in crosswalking
-- @author Ian Johnson 4/8/2011
-- @copyright 2005-2010 University of Sydney Digital Innovation Unit.
-- @link: http://HeuristScholar.org
-- @license http://www.gnu.org/licenses/gpl-3.0.txt
-- @package Heurist academic knowledge management system
-- @todo
-- The rest of this file is a MySQL table creation script for the 10 (eventually more?)
-- database definition and user/groups tables, stripped of anything superfluous
-- NOTE: do not include referential integrity as this is only a subet of tables
-- and we only need the structures
-- defCalcFunctions, defCrosswalk, defDetailTypes,defFileExtToMimetype, defLanguages, defOntologies,
-- defRecStructure, defRecTypeGroups, defRecTypes, defRelationshipConstraints,
-- defTerms, defTranslations, sysIdentification, sysUGrps, sysUsrGrpLinks, usrTags
-- ***** THIS FILE MUST BE UPDATED IF THE DATABASE STRUCTURE IS CHANGED, see version # below
-- Extract the relevant tables from blankDBStructure.sql
-- ***** Database version: 1.1 @ 13/9/2011 ******
-- -------------------------------------------------------------------------------------------------------
-- SQL below copied from blankDBStructure.sql
-- Delete Records table plus everything below defURLPrefixes
-- -------------------------------------------------------------------------------------------------------
-- phpMyAdmin SQL Dump
-- phpMyAdmin SQL Dump
-- version 2.9.0.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Oct 19, 2012 at 12:14 PM
-- Server version: 5.0.51
-- PHP Version: 5.2.3
--
-- Database: 'hdb_H3CoreDefinitions'
--
-- --------------------------------------------------------
--
-- Table structure for table 'defCalcFunctions'
--
CREATE TABLE defCalcFunctions (
cfn_ID smallint(3) unsigned NOT NULL auto_increment COMMENT 'Primary key of defCalcFunctions table',
cfn_Domain enum('calcfieldstring','pluginphp') NOT NULL default 'calcfieldstring' COMMENT 'Domain of application of this function specification',
cfn_FunctionSpecification text NOT NULL COMMENT 'A function or chain of functions, or some PHP plugin code',
cfn_Modified timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP COMMENT 'Date of last modification of this record, used to get last updated date for table',
PRIMARY KEY (cfn_ID)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Specifications for generating calculated fields, plugins and';
-- --------------------------------------------------------
--
-- Table structure for table 'defCrosswalk'
--
CREATE TABLE defCrosswalk (
crw_ID mediumint(8) unsigned NOT NULL auto_increment COMMENT 'Primary key',
crw_SourcedbID mediumint(8) unsigned NOT NULL COMMENT 'The Heurist reference ID of the database containing the definition being mapped',
crw_SourceCode mediumint(8) unsigned NOT NULL COMMENT 'The code of the definition in the source database',
crw_DefType enum('rectype','constraint','detailtype','recstructure','ontology','vocabulary','term') NOT NULL COMMENT 'The type of code being mapped between the source and this database',
crw_LocalCode mediumint(8) unsigned NOT NULL COMMENT 'The corresponding code in the local database',
crw_Modified timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP COMMENT 'The date when this mapping added or modified',
PRIMARY KEY (crw_ID),
UNIQUE KEY crw_composite (crw_SourcedbID,crw_DefType,crw_LocalCode)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Map the codes used in this Heurist DB to codes used in other';
-- --------------------------------------------------------
--
-- Table structure for table 'defDetailTypeGroups'
--
CREATE TABLE defDetailTypeGroups (
dtg_ID tinyint(3) unsigned NOT NULL auto_increment COMMENT 'Primary ID - Code for detail type groups',
dtg_Name varchar(63) NOT NULL COMMENT 'Descriptive heading to be displayed for each group of details (fields)',
dtg_Order tinyint(3) unsigned zerofill NOT NULL default '002' COMMENT 'Ordering of detail type groups within pulldown lists',
dtg_Description varchar(255) NOT NULL COMMENT 'General description fo this group of detail (field) types',
dtg_Modified timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP COMMENT 'Date of last modification of this record, used to get last updated date for table',
PRIMARY KEY (dtg_ID)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Groups detail types for display in separate sections of edit';
-- --------------------------------------------------------
--
-- Table structure for table 'defDetailTypes'
--
CREATE TABLE defDetailTypes (
dty_ID smallint(5) unsigned NOT NULL auto_increment COMMENT 'Code for the detail type (field) - may vary between Heurist DBs',
dty_Name varchar(255) NOT NULL COMMENT 'The canonical (standard) name of the detail type, used as default in edit form',
dty_Documentation varchar(5000) default 'Please document the nature of this detail type (field)) ...' COMMENT 'Documentation of the detail type, what it means, how defined',
dty_Type enum('freetext','blocktext','integer','date','year','relmarker','boolean','enum','relationtype','resource','float','file','geo','separator','calculated','fieldsetmarker','urlinclude') NOT NULL COMMENT 'The value-type of this detail type, what sort of data is stored',
dty_HelpText varchar(255) NOT NULL default 'Please provide a short explanation for the user ...' COMMENT 'The default help text displayed to the user under the field',
dty_ExtendedDescription varchar(5000) default 'Please provide an extended description for display on rollover ...' COMMENT 'Extended text describing this detail type, for display in rollover',
dty_EntryMask text COMMENT 'Data entry mask, use to control decimals ion numeric values, content of text fields etc.',
dty_Status enum('reserved','approved','pending','open') NOT NULL default 'open' COMMENT 'Reserved Heurist codes, approved/pending by ''Board'', and user additions',
dty_OriginatingDBID mediumint(8) unsigned default NULL COMMENT 'Database where this detail type originated, 0 = locally',
dty_NameInOriginatingDB varchar(255) default NULL COMMENT 'Name used in database where this detail type originated',
dty_IDInOriginatingDB smallint(5) unsigned default NULL COMMENT 'ID used in database where this detail type originated',
dty_DetailTypeGroupID tinyint(3) unsigned NOT NULL default '1' COMMENT 'The general role of this detail allowing differentiated lists of detail types',
dty_OrderInGroup tinyint(3) unsigned default '0' COMMENT 'The display order of DetailType within group, alphabetic if equal values',
dty_JsonTermIDTree varchar(5000) default NULL COMMENT 'Tree of Term IDs to show for this field (display-only header terms set in HeaderTermIDs)',
dty_TermIDTreeNonSelectableIDs varchar(1000) default NULL COMMENT 'Term IDs to use as non-selectable headers for this field',
dty_PtrTargetRectypeIDs varchar(63) default NULL COMMENT 'CSVlist of target Rectype IDs, null = any',
dty_FieldSetRectypeID smallint(5) unsigned default NULL COMMENT 'For a FieldSetMarker, the record type to be inserted as a fieldset',
dty_ShowInLists tinyint(1) unsigned NOT NULL default '1' COMMENT 'Flags if detail type is to be shown in end-user interface, 1=yes',
dty_NonOwnerVisibility enum('hidden','viewable','public','pending') NOT NULL default 'viewable' COMMENT 'Allows restriction of visibility of a particular field in ALL record types (overrides rst_VisibleOutsideGroup)',
dty_Modified timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP COMMENT 'Date of last modification of this record, used to get last updated date for table',
dty_LocallyModified tinyint(1) unsigned NOT NULL default '0' COMMENT 'Flags a definition element which has been modified relative to the original source',
PRIMARY KEY (dty_ID),
UNIQUE KEY dty_Name (dty_Name),
KEY dty_Type (dty_Type),
KEY dty_DetailTypeGroupID (dty_DetailTypeGroupID)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='The detail types (fields) which can be attached to records';
-- --------------------------------------------------------
--
-- Table structure for table 'defFileExtToMimetype'
--
CREATE TABLE defFileExtToMimetype (
fxm_Extension varchar(10) NOT NULL COMMENT 'The file extension, indicates mimetype, icon and some beahviours',
fxm_MimeType varchar(100) NOT NULL COMMENT 'The standard mime type string',
fxm_OpenNewWindow tinyint(1) unsigned NOT NULL default '0' COMMENT 'Flag if a new window should be opened to display this mimetype',
fxm_IconFileName varchar(31) default NULL COMMENT 'Filename of the icon file for this mimetype (shared by several)',
fxm_FiletypeName varchar(31) default NULL COMMENT 'A textual name for the file type represented by the extension',
fxm_ImagePlaceholder varchar(63) default NULL COMMENT 'Thumbnail size representation for display, generate from fxm_FiletypeName',
fxm_Modified timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP COMMENT 'Date of last modification of this record, used to get last updated date for table',
PRIMARY KEY (fxm_Extension)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Converts extensions to mimetypes and provides icons and mime';
-- --------------------------------------------------------
--
-- Table structure for table 'defLanguages'
--
CREATE TABLE defLanguages (
lng_NISOZ3953 char(3) NOT NULL COMMENT 'Three character NISO Z39.53 language code',
lng_ISO639 char(2) NOT NULL COMMENT 'Two character ISO639 language code',
lng_Name varchar(63) NOT NULL COMMENT 'Language name, generally accepted name (normally English terminology)',
lng_Notes varchar(1000) default NULL COMMENT 'URL reference to, or notes on the definition of the language',
lng_Modified timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP COMMENT 'Date of last modification of this record, used to get last updated date for table',
PRIMARY KEY (lng_NISOZ3953)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Language list including optional standard language codes';
-- --------------------------------------------------------
--
-- Table structure for table 'defOntologies'
--
CREATE TABLE defOntologies (
ont_ID smallint(5) unsigned NOT NULL auto_increment COMMENT 'Ontology code, primary key',
ont_ShortName varchar(63) NOT NULL COMMENT 'The commonly used acronym or short name of the ontology',
ont_FullName varchar(255) NOT NULL COMMENT 'The commonly used full name of the ontology',
ont_Description varchar(1000) default NULL COMMENT 'An optional descriptuion of the domain, origina and aims of the ontology',
ont_RefURI varchar(250) default NULL COMMENT 'The URI to a definition of the ontology',
ont_Status enum('reserved','approved','pending','open') NOT NULL default 'open' COMMENT 'Reserved Heurist codes, approved/pending by ''Board'', and user additions',
ont_OriginatingDBID mediumint(8) unsigned default NULL COMMENT 'Database where this ontology originated, 0 = locally',
ont_NameInOriginatingDB varchar(63) default NULL COMMENT 'Name used in database where this ontology originated',
ont_IDInOriginatingDB smallint(5) unsigned default NULL COMMENT 'ID used in database where this ontology originated',
ont_Order tinyint(3) unsigned zerofill NOT NULL default '255' COMMENT 'Ordering value to define alternate display order in interface',
ont_Modified timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP COMMENT 'Date of last modification of this record, used to get last updated date for table',
ont_locallyModified tinyint(1) unsigned NOT NULL default '0' COMMENT 'Flags a definition element which has been modified relative to the original source',
PRIMARY KEY (ont_ID),
UNIQUE KEY ont_ShortName (ont_ShortName)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='A table of references to different ontologies used by Heuris';
-- --------------------------------------------------------
--
-- Table structure for table 'defRecStructure'
--
CREATE TABLE defRecStructure (
rst_ID smallint(5) unsigned NOT NULL auto_increment COMMENT 'Primary key for the record structures table',
rst_RecTypeID smallint(5) unsigned NOT NULL COMMENT 'The record type to which this detail is allocated, 0 = all rectypes',
rst_DetailTypeID smallint(5) unsigned NOT NULL COMMENT 'Detail type for this field or, if MSB set, FieldSet code + 32767',
rst_DisplayName varchar(255) NOT NULL default 'Please enter a prompt ...' COMMENT 'Display name for this dtl type in this rectype, autofill with dty_Name',
rst_DisplayHelpText varchar(255) default NULL COMMENT 'The user help text to be displayed for this detail type for this record type',
rst_DisplayExtendedDescription varchar(5000) default NULL COMMENT 'The rollover text to be displayed for this detail type for this record type',
rst_DisplayOrder smallint(3) unsigned zerofill NOT NULL default '999' COMMENT 'A sort order for display of this detail type in the record edit form',
rst_DisplayWidth tinyint(3) unsigned NOT NULL default '50' COMMENT 'The field width displayed for this detail type in this record type',
rst_DefaultValue varchar(63) default NULL COMMENT 'The default value for this detail type for this record type',
rst_RecordMatchOrder tinyint(1) unsigned NOT NULL default '0' COMMENT 'Indicates order of significance in detecting duplicate records, 1 = highest',
rst_CalcFunctionID tinyint(3) unsigned default NULL COMMENT 'FK to table of function specifications for calculating string values',
rst_RequirementType enum('required','recommended','optional','forbidden') NOT NULL default 'optional',
rst_NonOwnerVisibility enum('hidden','viewable','public','pending') NOT NULL default 'viewable' COMMENT 'Allows restriction of visibility of a particular field in a specified record type',
rst_Status enum('reserved','approved','pending','open') NOT NULL default 'open' COMMENT 'Reserved Heurist codes, approved/pending by ''Board'', and user additions',
rst_MayModify enum('locked','discouraged','open') NOT NULL default 'open' COMMENT 'Extent to which detail may be modified within this record structure',
rst_OriginatingDBID mediumint(8) unsigned default NULL COMMENT 'Database where this record structure element originated, 0 = locally',
rst_IDInOriginatingDB smallint(5) unsigned default NULL COMMENT 'ID used in database where this record structure element originated',
rst_MaxValues tinyint(3) unsigned default NULL COMMENT 'Maximum number of values per record for this detail, NULL = unlimited, 0 = not allowed',
rst_MinValues tinyint(3) unsigned NOT NULL default '0' COMMENT 'If required, minimum number of values per record for this detail',
rst_DisplayDetailTypeGroupID tinyint(3) unsigned default NULL COMMENT 'If set, places detail in specified group instead of according to dty_DetailTypeGroup',
rst_FilteredJsonTermIDTree varchar(500) default NULL COMMENT 'JSON encoded tree of allowed terms, subset of those defined in defDetailType',
rst_PtrFilteredIDs varchar(250) default NULL COMMENT 'Allowed Rectypes (CSV) within list defined by defDetailType (for pointer details)',
rst_OrderForThumbnailGeneration tinyint(3) unsigned default NULL COMMENT 'Priority order of fields to use in generating thumbnail, null = do not use',
rst_TermIDTreeNonSelectableIDs varchar(255) default NULL COMMENT 'Term IDs to use as non-selectable headers for this field',
rst_Modified timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP COMMENT 'Date of last modification of this record, used to get last updated date for table',
rst_LocallyModified tinyint(1) unsigned NOT NULL default '0' COMMENT 'Flags a definition element which has been modified relative to the original source',
PRIMARY KEY (rst_ID),
UNIQUE KEY rst_composite (rst_RecTypeID,rst_DetailTypeID),
KEY rst_DetailTypeID (rst_DetailTypeID)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='The record details (fields) required for each record type';
-- --------------------------------------------------------
--
-- Table structure for table 'defRecTypeGroups'
--
CREATE TABLE defRecTypeGroups (
rtg_ID tinyint(3) unsigned NOT NULL auto_increment COMMENT 'Record type group ID referenced in defRectypes',
rtg_Name varchar(40) NOT NULL COMMENT 'Name for this group of record types, shown as heading in lists',
rtg_Domain enum('functionalgroup','modelview') NOT NULL default 'functionalgroup' COMMENT 'Functional group (rectype has only one) or a Model/View group',
rtg_Order tinyint(3) unsigned zerofill NOT NULL default '002' COMMENT 'Ordering of record type groups within pulldown lists',
rtg_Description varchar(250) default NULL COMMENT 'A description of the record type group and its purpose',
rtg_Modified timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP COMMENT 'Date of last modification of this record, used to get last updated date for table',
PRIMARY KEY (rtg_ID),
UNIQUE KEY rtg_Name (rtg_Name)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Grouping mechanism for record types in pulldowns';
-- --------------------------------------------------------
--
-- Table structure for table 'defRecTypes'
--
CREATE TABLE defRecTypes (
rty_ID smallint(5) unsigned NOT NULL auto_increment COMMENT 'Record type code, widely used to reference record types, primary key',
rty_Name varchar(63) NOT NULL COMMENT 'The name which is used to describe this record (object) type',
rty_OrderInGroup tinyint(3) unsigned default '0' COMMENT 'Ordering within record type display groups for pulldowns',
rty_Description varchar(5000) NOT NULL COMMENT 'Description of this record type',
rty_TitleMask varchar(500) NOT NULL default '[title]' COMMENT 'Mask to build a composite title by combining field values',
rty_CanonicalTitleMask varchar(500) default '160' COMMENT 'Version of the mask converted to detail codes for processing',
rty_Plural varchar(63) default NULL COMMENT 'Plural form of the record type name, manually entered',
rty_Status enum('reserved','approved','pending','open') NOT NULL default 'open' COMMENT 'Reserved Heurist codes, approved/pending by ''Board'', and user additions',
rty_OriginatingDBID mediumint(8) unsigned default NULL COMMENT 'Database where this record type originated, 0 = locally',
rty_NameInOriginatingDB varchar(63) default NULL COMMENT 'Name used in database where this record type originated',
rty_IDInOriginatingDB smallint(5) unsigned default NULL COMMENT 'ID in database where this record type originated',
rty_NonOwnerVisibility enum('hidden','viewable','public','pending') NOT NULL default 'viewable' COMMENT 'Allows blanket restriction of visibility of a particular record type',
rty_ShowInLists tinyint(1) unsigned NOT NULL default '1' COMMENT 'Flags if record type is to be shown in end-user interface, 1=yes',
rty_RecTypeGroupID tinyint(3) unsigned NOT NULL default '1' COMMENT 'Record type group to which this record type belongs',
rty_RecTypeModelIDs varchar(63) default NULL COMMENT 'The model group(s) to which this rectype belongs, comma sep. list',
rty_FlagAsFieldset tinyint(1) unsigned NOT NULL default '0' COMMENT '0 = full record type, 1 = Fieldset = set of fields to include in other rectypes',
rty_ReferenceURL varchar(250) default NULL COMMENT 'A reference URL describing/defining the record type',
rty_AlternativeRecEditor varchar(63) default NULL COMMENT 'Name or URL of alternative record editor function to be used for this rectype',
rty_Type enum('normal','relationship','dummy') NOT NULL default 'normal' COMMENT 'Use to flag special record types to trigger special functions',
rty_ShowURLOnEditForm tinyint(1) NOT NULL default '1' COMMENT 'Determines whether special URL field is shown at the top of the edit form',
rty_ShowDescriptionOnEditForm tinyint(1) NOT NULL default '1' COMMENT 'Determines whether the record type description field is shown at the top of the edit form',
rty_Modified timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP COMMENT 'Date of last modification of this record, used to get last updated date for table',
rty_LocallyModified tinyint(1) unsigned NOT NULL default '0' COMMENT 'Flags a definition element which has been modified relative to the original source',
PRIMARY KEY (rty_ID),
UNIQUE KEY rty_Name (rty_Name),
KEY rty_RecTypeGroupID (rty_RecTypeGroupID)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Defines record types, which corresponds with a set of detail';
-- --------------------------------------------------------
--
-- Table structure for table 'defRelationshipConstraints'
--
CREATE TABLE defRelationshipConstraints (
rcs_ID smallint(5) unsigned NOT NULL auto_increment COMMENT 'Record-detailtype constraint table primary key',
rcs_SourceRectypeID smallint(5) unsigned default NULL COMMENT 'Source record type for this constraint, Null = all types',
rcs_TargetRectypeID smallint(5) unsigned default NULL COMMENT 'Target record type pointed to by relationship record, Null = all types',
rcs_Description varchar(1000) default 'Please describe ...',
rcs_RelationshipsLimit tinyint(3) unsigned default NULL COMMENT 'Deprecated: Null= no limit; 0=forbidden, 1, 2 ... =max # of relationship records per record per detailtype/rectypes triplet',
rcs_Status enum('reserved','approved','pending','open') NOT NULL default 'open' COMMENT 'Reserved Heurist codes, approved/pending by ''Board'', and user additions',
rcs_OriginatingDBID mediumint(8) unsigned NOT NULL default '0' COMMENT 'Database where this constraint originated, 0 or local db code = locally',
rcs_IDInOriginatingDB smallint(5) unsigned default '0' COMMENT 'Code used in database where this constraint originated',
rcs_TermID int(10) unsigned default NULL COMMENT 'The ID of a term to be constrained, applies to descendants unless they have more specific',
rcs_TermLimit tinyint(2) unsigned default NULL COMMENT 'Null=none 0=not allowed 1,2..=max # times a term from termSet ident. by termID can be used',
rcs_Modified timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP COMMENT 'Date of last modification of this record, used to get last updated date for table',
rcs_LocallyModified tinyint(1) unsigned NOT NULL default '0' COMMENT 'Flags a definition element which has been modified relative to the original source',
PRIMARY KEY (rcs_ID),
UNIQUE KEY rcs_CompositeKey (rcs_SourceRectypeID,rcs_TargetRectypeID,rcs_TermID),
KEY rcs_TermID (rcs_TermID),
KEY rcs_TargetRectypeID (rcs_TargetRectypeID),
KEY rcs_SourceRecTypeID (rcs_SourceRectypeID)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Constrain target-rectype/vocabularies/values for a pointer d';
-- --------------------------------------------------------
--
-- Table structure for table 'defTerms'
--
CREATE TABLE defTerms (
trm_ID int(10) unsigned NOT NULL auto_increment COMMENT 'Primary key, the term code used in the detail record',
trm_Label varchar(500) NOT NULL COMMENT 'Human readable term used in the interface, cannot be blank',
trm_InverseTermId int(10) unsigned default NULL COMMENT 'ID for the inverse value (relationships), null if no inverse',
trm_Description varchar(1000) default NULL COMMENT 'A description/gloss on the meaning of the term',
trm_Status enum('reserved','approved','pending','open') NOT NULL default 'open' COMMENT 'Reserved Heurist codes, approved/pending by ''Board'', and user additions',
trm_OriginatingDBID mediumint(8) unsigned default NULL COMMENT 'Database where this detail type originated, 0 = locally',
trm_NameInOriginatingDB varchar(63) default NULL COMMENT 'Name (label) for this term in originating database',
trm_IDInOriginatingDB mediumint(8) unsigned default NULL COMMENT 'ID used in database where this term originated',
trm_AddedByImport tinyint(1) unsigned NOT NULL default '0' COMMENT 'Set to 1 if term added by an import, otherwise 0',
trm_IsLocalExtension tinyint(1) unsigned NOT NULL default '0' COMMENT 'Flag that this value not in the externally referenced vocabulary',
trm_Domain enum('enum','relation') NOT NULL default 'enum' COMMENT 'Define the usage of the term',
trm_OntID smallint(5) unsigned NOT NULL default '0' COMMENT 'Ontology from which this vocabulary originated, 0 = locally defined ontology',
trm_ChildCount tinyint(3) NOT NULL default '0' COMMENT 'Stores the count of children, updated whenever children are added/removed',
trm_ParentTermID int(10) unsigned default NULL COMMENT 'The ID of the parent/owner term in the hierarchy',
trm_Depth tinyint(1) unsigned NOT NULL default '1' COMMENT 'Depth of term in the term tree, should always be 1+parent depth',
trm_Modified timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP COMMENT 'Date of last modification of this record, used to get last updated date for table',
trm_LocallyModified tinyint(1) unsigned NOT NULL default '0' COMMENT 'Flags a definition element which has been modified relative to the original source',
trm_Code varchar(100) default NULL COMMENT 'Optional code eg. alphanumeric code which may be required for import or export',
PRIMARY KEY (trm_ID),
KEY trm_ParentTermIDKey (trm_ParentTermID),
KEY trm_InverseTermIDKey (trm_InverseTermId)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Terms by detail type and the vocabulary they belong to';
-- --------------------------------------------------------
--
-- Table structure for table 'defTranslations'
--
CREATE TABLE defTranslations (
trn_ID int(10) unsigned NOT NULL auto_increment COMMENT 'Primary key of defTranslations table',
trn_Source enum('rty_Name','dty_Name','ont_ShortName','vcb_Name','trm_Label','rst_DisplayName','rtg_Name','dtl_Value') NOT NULL COMMENT 'The table/column to be translated (unique names identify source)',
trn_Code smallint(5) unsigned NOT NULL COMMENT 'The primary key / ID in the table containing the text to be translated',
trn_LanguageCode3 char(3) NOT NULL COMMENT 'The translation language code (NISO 3 character) for this record',
trn_Translation varchar(63) NOT NULL COMMENT 'The translation of the text in this location (table/field/id)',
trn_Modified timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP COMMENT 'Date of last modification of this record, used to get last updated date for table',
PRIMARY KEY (trn_ID),
UNIQUE KEY trn_composite (trn_Source,trn_Code,trn_LanguageCode3),
KEY trn_LanguageCode3 (trn_LanguageCode3)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Translation table into multiple languages for all translatab';
-- --------------------------------------------------------
--
-- Table structure for table 'defURLPrefixes'
--
CREATE TABLE defURLPrefixes (
urp_ID smallint(5) unsigned NOT NULL auto_increment COMMENT 'ID which will be stored as proxy for the URL prefix',
urp_Prefix varchar(250) NOT NULL COMMENT 'URL prefix which is prepended to record URLs',
urp_Modified timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP COMMENT 'Date of last modification of this record, used to get last updated date for table',
PRIMARY KEY (urp_ID),
UNIQUE KEY urp_Prefix (urp_Prefix)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Common URL prefixes allowing single-point change of URL for ';
| beoutsports/heurist-v3-1 | admin/setup/createDefinitionTablesOnly.sql | SQL | gpl-3.0 | 28,695 |
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Utils for behat-related stuff
*
* @package core
* @category test
* @copyright 2012 David Monllaó
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once(__DIR__ . '/../lib.php');
require_once(__DIR__ . '/../../testing/classes/util.php');
require_once(__DIR__ . '/behat_command.php');
require_once(__DIR__ . '/behat_config_manager.php');
require_once(__DIR__ . '/../../filelib.php');
/**
* Init/reset utilities for Behat database and dataroot
*
* @package core
* @category test
* @copyright 2013 David Monllaó
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class behat_util extends testing_util {
/**
* The behat test site fullname and shortname.
*/
const BEHATSITENAME = "Acceptance test site";
/**
* @var array Files to skip when resetting dataroot folder
*/
protected static $datarootskiponreset = array('.', '..', 'behat', 'behattestdir.txt');
/**
* @var array Files to skip when dropping dataroot folder
*/
protected static $datarootskipondrop = array('.', '..', 'lock');
/**
* Installs a site using $CFG->dataroot and $CFG->prefix
* @throws coding_exception
* @return void
*/
public static function install_site() {
global $DB, $CFG;
require_once($CFG->dirroot.'/user/lib.php');
if (!defined('BEHAT_UTIL')) {
throw new coding_exception('This method can be only used by Behat CLI tool');
}
$tables = $DB->get_tables(false);
if (!empty($tables)) {
behat_error(BEHAT_EXITCODE_INSTALLED);
}
// New dataroot.
self::reset_dataroot();
$options = array();
$options['adminuser'] = 'admin';
$options['adminpass'] = 'admin';
$options['fullname'] = self::BEHATSITENAME;
$options['shortname'] = self::BEHATSITENAME;
install_cli_database($options, false);
// We need to keep the installed dataroot filedir files.
// So each time we reset the dataroot before running a test, the default files are still installed.
self::save_original_data_files();
$frontpagesummary = new admin_setting_special_frontpagedesc();
$frontpagesummary->write_setting(self::BEHATSITENAME);
// Update admin user info.
$user = $DB->get_record('user', array('username' => 'admin'));
$user->email = 'moodle@example.com';
$user->firstname = 'Admin';
$user->lastname = 'User';
$user->city = 'Perth';
$user->country = 'AU';
user_update_user($user, false);
// Disable email message processor.
$DB->set_field('message_processors', 'enabled', '0', array('name' => 'email'));
// Sets maximum debug level.
set_config('debug', DEBUG_DEVELOPER);
set_config('debugdisplay', 1);
// Disable some settings that are not wanted on test sites.
set_config('noemailever', 1);
// Enable web cron.
set_config('cronclionly', 0);
// Keeps the current version of database and dataroot.
self::store_versions_hash();
// Stores the database contents for fast reset.
self::store_database_state();
}
/**
* Drops dataroot and remove test database tables
* @throws coding_exception
* @return void
*/
public static function drop_site() {
if (!defined('BEHAT_UTIL')) {
throw new coding_exception('This method can be only used by Behat CLI tool');
}
self::reset_dataroot();
self::drop_dataroot();
self::drop_database(true);
}
/**
* Checks if $CFG->behat_wwwroot is available and using same versions for cli and web.
*
* @return void
*/
public static function check_server_status() {
global $CFG;
$url = $CFG->behat_wwwroot . '/admin/tool/behat/tests/behat/fixtures/environment.php';
// Get web versions used by behat site.
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
if (empty($result)) {
behat_error (BEHAT_EXITCODE_REQUIREMENT, $CFG->behat_wwwroot . ' is not available, ensure you specified ' .
'correct url and that the server is set up and started.' . PHP_EOL . ' More info in ' .
behat_command::DOCS_URL . '#Running_tests' . PHP_EOL);
}
// Check if cli version is same as web version.
$result = json_decode($result, true);
$clienv = self::get_environment();
if ($result != $clienv) {
$output = 'Differences detected between cli and webserver...'.PHP_EOL;
foreach ($result as $key => $version) {
if ($clienv[$key] != $version) {
$output .= ' ' . $key . ': ' . PHP_EOL;
$output .= ' - web server: ' . $version . PHP_EOL;
$output .= ' - cli: ' . $clienv[$key] . PHP_EOL;
}
}
echo $output;
}
}
/**
* Checks whether the test database and dataroot is ready
* Stops execution if something went wrong
* @throws coding_exception
* @return void
*/
protected static function test_environment_problem() {
global $CFG, $DB;
if (!defined('BEHAT_UTIL')) {
throw new coding_exception('This method can be only used by Behat CLI tool');
}
if (!self::is_test_site()) {
behat_error(1, 'This is not a behat test site!');
}
$tables = $DB->get_tables(false);
if (empty($tables)) {
behat_error(BEHAT_EXITCODE_INSTALL, '');
}
if (!self::is_test_data_updated()) {
behat_error(BEHAT_EXITCODE_REINSTALL, 'The test environment was initialised for a different version');
}
}
/**
* Enables test mode
*
* It uses CFG->behat_dataroot
*
* Starts the test mode checking the composer installation and
* the test environment and updating the available
* features and steps definitions.
*
* Stores a file in dataroot/behat to allow Moodle to switch
* to the test environment when using cli-server.
* @throws coding_exception
* @return void
*/
public static function start_test_mode() {
global $CFG;
if (!defined('BEHAT_UTIL')) {
throw new coding_exception('This method can be only used by Behat CLI tool');
}
// Checks the behat set up and the PHP version.
if ($errorcode = behat_command::behat_setup_problem()) {
exit($errorcode);
}
// Check that test environment is correctly set up.
self::test_environment_problem();
// Updates all the Moodle features and steps definitions.
behat_config_manager::update_config_file();
if (self::is_test_mode_enabled()) {
return;
}
$contents = '$CFG->behat_wwwroot, $CFG->behat_prefix and $CFG->behat_dataroot' .
' are currently used as $CFG->wwwroot, $CFG->prefix and $CFG->dataroot';
$filepath = self::get_test_file_path();
if (!file_put_contents($filepath, $contents)) {
behat_error(BEHAT_EXITCODE_PERMISSIONS, 'File ' . $filepath . ' can not be created');
}
}
/**
* Returns the status of the behat test environment
*
* @return int Error code
*/
public static function get_behat_status() {
if (!defined('BEHAT_UTIL')) {
throw new coding_exception('This method can be only used by Behat CLI tool');
}
// Checks the behat set up and the PHP version, returning an error code if something went wrong.
if ($errorcode = behat_command::behat_setup_problem()) {
return $errorcode;
}
// Check that test environment is correctly set up, stops execution.
self::test_environment_problem();
}
/**
* Disables test mode
* @throws coding_exception
* @return void
*/
public static function stop_test_mode() {
if (!defined('BEHAT_UTIL')) {
throw new coding_exception('This method can be only used by Behat CLI tool');
}
$testenvfile = self::get_test_file_path();
if (!self::is_test_mode_enabled()) {
echo "Test environment was already disabled\n";
} else {
if (!unlink($testenvfile)) {
behat_error(BEHAT_EXITCODE_PERMISSIONS, 'Can not delete test environment file');
}
}
}
/**
* Checks whether test environment is enabled or disabled
*
* To check is the current script is running in the test
* environment
*
* @return bool
*/
public static function is_test_mode_enabled() {
$testenvfile = self::get_test_file_path();
if (file_exists($testenvfile)) {
return true;
}
return false;
}
/**
* Returns the path to the file which specifies if test environment is enabled
* @return string
*/
protected final static function get_test_file_path() {
return behat_command::get_behat_dir() . '/test_environment_enabled.txt';
}
/**
* Reset contents of all database tables to initial values, reset caches, etc.
*/
public static function reset_all_data() {
// Reset database.
self::reset_database();
// Purge dataroot directory.
self::reset_dataroot();
// Reset all static caches.
accesslib_clear_all_caches(true);
// Reset the nasty strings list used during the last test.
nasty_strings::reset_used_strings();
filter_manager::reset_caches();
// Reset course and module caches.
if (class_exists('format_base')) {
// If file containing class is not loaded, there is no cache there anyway.
format_base::reset_course_cache(0);
}
get_fast_modinfo(0, 0, true);
// Inform data generator.
self::get_data_generator()->reset();
}
}
| elearningatbath/moodlebath | lib/behat/classes/util.php | PHP | gpl-3.0 | 10,993 |
<!--
title: "Max"
custom_edit_url: https://github.com/netdata/netdata/edit/master/web/api/queries/max/README.md
-->
# Max
This module finds the max value in the time-frame given.
## how to use
Use it in alarms like this:
```
alarm: my_alarm
on: my_chart
lookup: max -1m unaligned of my_dimension
warn: $this > 1000
```
`max` does not change the units. For example, if the chart units is `requests/sec`, the result
will be again expressed in the same units.
It can also be used in APIs and badges as `&group=max` in the URL.
## Examples
Examining last 1 minute `successful` web server responses:
- 
- 
- 
## References
- <https://en.wikipedia.org/wiki/Sample_maximum_and_minimum>.
[](<>)
| 3cky/netdata | web/api/queries/max/README.md | Markdown | gpl-3.0 | 1,496 |
/*
Copyright 2013 David Malcolm <dmalcolm@redhat.com>
Copyright 2013 Red Hat, Inc.
This is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see
<http://www.gnu.org/licenses/>.
*/
#include <Python.h>
/*
Regression test for:
NotImplementedError: Don't know how to cope with exprcode: <type 'gcc.FloatExpr'> (<type 'gcc.FloatExpr'>) at pyalsa/alsaseq.c:1762
seen in many places
*/
float
test(int i)
{
return i / 42.0;
}
/*
PEP-7
Local variables:
c-basic-offset: 4
indent-tabs-mode: nil
End:
*/
| davidmalcolm/gcc-python-plugin | tests/cpychecker/absinterp/casts/int-to-float/input.c | C | gpl-3.0 | 1,060 |
:local(.loadingIndicator).alert.alert-info {
box-shadow: 0 2px 10px rgba(0,0,0,.2);
position: fixed;
top: 60px;
left: 50%;
height: 32px;
width: 200px;
margin-left: -100px; /* half of the element width */
padding: 5px 10px;
text-align: center;
z-index: 2000;
} | hellasmoon/graylog2-server | graylog2-web-interface/src/components/common/LoadingIndicator.css | CSS | gpl-3.0 | 299 |
require 'xdk/designkit/element'
module XDK
module DesignKit
# Tag is the simplest element subclass. It has a tag name
# and attributes.
class Tag < Element
class << self
# Tags can have attributes.
def attributes; @attributes ||= {}; end
# Define an attribute for a tag. If option :required is
# set to true, then a validator it created to make sure
# the attribute is set.
def attribute(key, *args)
options = (Hash===args.last) ? args.pop : nil
kind = args.pop || Attribute
attributes[key.to_sym] = [kind, options]
end
end
private
# Collect attribute names for complete class hierarchy.
def xml_schema_attributes
eigenclass = (class << self; self; end)
attributes = eigenclass.attributes
eigenclass.ancestors.each do |ancestor|
attributes = ancestor.attributes.merge(attributes)
break if self.class == ancestor
end
attributes
end
# -- Instance -----------------------------------------------------------
attr :element_attributes
def initialize(name=nil, attributes=nil)
super(name)
@element_attributes = {}
(attributes||{}).each{ |k,v| self[k] = v }
end
public
# Get attribute.
def [](key)
element_attributes[key.to_sym]
end
# Set attribute.
def []=(key, value)
attr = xml_schema_attributes[key.to_sym]
kind = attr ? attr[0] : Attribute
element_attributes[key.to_sym] = kind.new(key, value)
end
# Common to all XML tags/elements.
attribute "xml:base", nil #, :namespace => 'xml'
attribute "xml:lang", nil #, :namespace => 'xml'
# Convert to XML formatted string.
def to_xml(ns=nil)
atts = to_xml_attrs(ns)
atts = ' ' + atts unless atts.empty?
"<#{element_tagname}#{atts}/>"
end
private
def to_xml_attrs(ns)
# Build up attributes first.
atts = []
myns = xml_schema_namespace || ns
if myns != ns
atts << myns.to_xml
end
ns = myns
atts += element_attributes.collect do |k, v|
case v
when nil
nil
when Attribute
v.to_xml(ns)
else
%[#{k}="#{v}"]
end
end
atts.compact.join(' ')
end
end
end
end
| rubyunworks/xdk | lib/xdk/designkit/elements/tag.rb | Ruby | gpl-3.0 | 2,490 |
<?php /* ////////////////////////////////////////////////////////////////////////////////
** Copyright 2010 Matthew Burton, http://matthewburton.org
** Code by Burton and Joshua Knowles, http://auscillate.com
**
** This software is part of the Open Source ACH Project (ACH). You'll find
** all current information about project contributors, installation, updates,
** bugs and more at http://competinghypotheses.org.
**
**
** ACH is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** ACH is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Open Source ACH. If not, see <http://www.gnu.org/licenses/>.
//////////////////////////////////////////////////////////////////////////////// */
?>
<h3>Edit Project</h3>
<form name="nav" method="post" class="edit" action="edit_project_action.php">
<input type="hidden" name="project_id" value="<?=$active_project->id?>" />
<div class="form">
<h4>Reassign Project Owner</h4>
<p style="margin-bottom: 0px;"><select name="user_id"><option value="0">--- No Change ---</option><?php
$active_project->getUsers();
for( $j = 0; $j < count($active_project->users); $j++ ) {
if( $active_project->users[$j] != $active_user->id ) {
$this_user = new User();
$this_user->populateFromId($active_project->users[$j]);
echo('<option value="' . $this_user->id . '">' . $this_user->name . '</a> ');
}
}
?></select>
<?php if (count($active_project->users) == 1) {
echo "<p class=\"formNote\">You may not transfer ownership because you are the only member of this project. To appoint a new owner, first have them become a project member.</p>";
}
else {
echo "<p class=\"formNote\">If you change this, you'll no longer have access to this page.</p>";
}
?>
<h4>Title</h4>
<p><input type="text" name="title" value="<?=$active_project->title?>" size="20" /></p>
<p class="formNote">A short phrase or question that summarizes the project.</p>
<h4>Description</h4>
<p><textarea rows="4" name="description" cols="30"><?=$active_project->description?></textarea></p>
<h4>Keywords</h4>
<p><textarea rows="4" name="keywords" cols="30"><?=$active_project->keywords?></textarea></p>
<p class="formNote">Comma-seperated. Optional.</p>
<h4>Project's Overall Classification</h4>
<p><select name="classification">
<option value="U" <?php if( $active_project->classification == 'U' ) { echo('selected'); } ?> >Unclassified</option>
<option value="C" <?php if( $active_project->classification == 'C' ) { echo('selected'); } ?> >Confidential</option>
<option value="S" <?php if( $active_project->classification == 'S' ) { echo('selected'); } ?> >Secret</option>
<option value="TS" <?php if( $active_project->classification == 'TS' ) { echo('selected'); } ?> >Top Secret</option>
</select></p>
<br/>
<div class="privacySettings">
<h3>Project Privacy <?php helpLink('howto_project_management.php#project_privacy') ?></h3>
<br />
<p class="formNote">Note: The below options enable you to decide whether your project
is listed in your organization's directory of ACH projects, and, if so, the
circumstances under which others may view or join your project. The
directory provides a basic description of the project and lists its participants.</p><br />
<input type="radio" name="directory" value="n" onClick="Disab(1)" <?php if( $active_project->directory == 'n' ) { echo('checked'); } ?> /><strong>Private Project</strong>
<p class="formNote">This project will not be listed in the directory. You will select and communicate directly with any individuals whom you
want to view your work or to participate with you in a collaborative project. </p>
<br/>______________<br/><br/>
<p><input type="radio" name="directory" value="y" onClick="Disab(2)" <?php if( $active_project->directory == 'y' ) { echo('checked');} else {echo('unchecked');} ?> />
<strong>Open Project</strong></p>
<p class="formNote">This project will be listed in the directory. The following options apply to this listing:</p>
<br/>
<p> <input type="radio" name="public" value="n" <?php if( $active_project->public == 'n' && $active_project->directory == 'y') { echo('checked'); } ?> /><em>Restricted Viewership</em>.
Anyone who wants to view your project's data and discussion must first obtain your approval.
<br />
<input type="radio" name="public" value="y" <?php if( $active_project->public == 'y' && $active_project->directory == 'y' ) { echo('checked'); } ?> /><em>Publicly Viewable</em>.
Anyone user will have access to view this project's data and discussion at any time.</p>
<br/>
<p> <input type="radio" name="open" value="n" <?php if( $active_project->open == 'n' && $active_project->directory == 'y') { echo('checked'); } ?> /><em>Restricted Membership</em>.
Anyone who wants to become a member and active participant in this project must
contact you and ask for your permission.
<br/>
<input type="radio" name="open" value="y" <?php if( $active_project->open == 'y' && $active_project->directory == 'y') { echo('checked'); } ?> /><em>Open Membership</em>. <span class="formNote">
Anyone who wishes to contribute to this project is welcome to join it and become
active members. </span></p>
<br/>
</div>
<p class="submit"><input class="button" type="submit" value="Save" /></p>
<p class="formNote">NOTE: As the project owner, you may change these settings at any time.</p>
</div>
</form> | Burton/Analysis-of-Competing-Hypotheses | parts/project_edit.php | PHP | gpl-3.0 | 5,889 |
package com.baeldung.hibernate.bootstrap;
import com.baeldung.hibernate.bootstrap.model.TestEntity;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
public abstract class BarHibernateDAO {
@Autowired
private SessionFactory sessionFactory;
public TestEntity findEntity(int id) {
return getCurrentSession().find(TestEntity.class, 1);
}
public void createEntity(TestEntity entity) {
getCurrentSession().save(entity);
}
public void createEntity(int id, String newDescription) {
TestEntity entity = findEntity(id);
entity.setDescription(newDescription);
getCurrentSession().save(entity);
}
public void deleteEntity(int id) {
TestEntity entity = findEntity(id);
getCurrentSession().delete(entity);
}
protected Session getCurrentSession() {
return sessionFactory.getCurrentSession();
}
}
| Niky4000/UsefulUtils | projects/tutorials-master/tutorials-master/persistence-modules/spring-persistence-simple/src/main/java/com/baeldung/hibernate/bootstrap/BarHibernateDAO.java | Java | gpl-3.0 | 986 |
/*
* Copyright (C) 2010 Brockmann Consult GmbH (info@brockmann-consult.de)
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 3 of the License, or (at your option)
* any later version.
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, see http://www.gnu.org/licenses/
*/
package org.esa.beam.framework.datamodel;
import com.bc.ceres.core.Assert;
import com.bc.ceres.jai.GeneralFilterFunction;
import com.bc.ceres.jai.operator.GeneralFilterDescriptor;
import java.awt.*;
import java.awt.image.RenderedImage;
/**
* A band that obtains its input data from an underlying source raster and filters
* its data using a predefined {@link OpType operation type}.
*
* @author Norman Fomferra
*/
public class GeneralFilterBand extends FilterBand {
/**
* Predefined operation types.
*/
public enum OpType {
MIN,
MAX,
MEDIAN,
MEAN,
STDDEV,
/**
* Morphological erosion (= min)
*/
EROSION,
/**
* Morphological dilation (= max)
*/
DILATION,
OPENING,
CLOSING,
}
private final OpType opType;
private final Kernel structuringElement;
private final int iterationCount;
/**
* Creates a GeneralFilterBand.
*
* @param name the name of the band.
* @param source the source which shall be filtered.
* @param opType the predefined operation type.
* @param structuringElement the structuring element (as used by morphological filters)
*/
public GeneralFilterBand(String name, RasterDataNode source, OpType opType, Kernel structuringElement, int iterationCount) {
super(name,
source.getGeophysicalDataType() == ProductData.TYPE_FLOAT64 ? ProductData.TYPE_FLOAT64 : ProductData.TYPE_FLOAT32,
source.getSceneRasterWidth(),
source.getSceneRasterHeight(),
source);
Assert.notNull(opType, "opType");
Assert.notNull(structuringElement, "structuringElement");
this.opType = opType;
this.structuringElement = structuringElement;
this.iterationCount = iterationCount;
}
public OpType getOpType() {
return opType;
}
public Kernel getStructuringElement() {
return structuringElement;
}
/**
* Returns the source level-image according the the
*
* @param sourceImage The geophysical source image. No-data is masked as NaN.
* @param level The image level.
* @param rh Rendering hints. JAI.KEY_BORDER_EXTENDER is set to BorderExtenderCopy.BORDER_COPY.
* @return The resulting filtered level image.
*/
@Override
protected RenderedImage createSourceLevelImage(RenderedImage sourceImage, int level, RenderingHints rh) {
int x = structuringElement.getXOrigin();
int y = structuringElement.getYOrigin();
int w = structuringElement.getWidth();
int h = structuringElement.getHeight();
boolean[] data = toStructuringElementData(structuringElement);
RenderedImage targetImage = sourceImage;
for (int i = 0; i < iterationCount; i++) {
targetImage = createSourceLevelImage(targetImage, x, y, w, h, data, rh);
}
return targetImage;
}
private RenderedImage createSourceLevelImage(RenderedImage sourceImage, int x, int y, int w, int h, boolean[] data, RenderingHints rh) {
RenderedImage targetImage;
if (getOpType() == OpType.MIN) {
targetImage = GeneralFilterDescriptor.create(sourceImage, new GeneralFilterFunction.Min(w, h, x, y, data), rh);
} else if (getOpType() == OpType.MAX) {
targetImage = GeneralFilterDescriptor.create(sourceImage, new GeneralFilterFunction.Max(w, h, x, y, data), rh);
} else if (getOpType() == OpType.MEDIAN) {
targetImage = GeneralFilterDescriptor.create(sourceImage, new GeneralFilterFunction.Median(w, h, x, y, data), rh);
} else if (getOpType() == OpType.MEAN) {
targetImage = GeneralFilterDescriptor.create(sourceImage, new GeneralFilterFunction.Mean(w, h, x, y, data), rh);
} else if (getOpType() == OpType.STDDEV) {
targetImage = GeneralFilterDescriptor.create(sourceImage, new GeneralFilterFunction.StdDev(w, h, x, y, data), rh);
} else if (getOpType() == OpType.EROSION) {
targetImage = GeneralFilterDescriptor.create(sourceImage, new GeneralFilterFunction.Erosion(w, h, x, y, data), rh);
} else if (getOpType() == OpType.DILATION) {
targetImage = GeneralFilterDescriptor.create(sourceImage, new GeneralFilterFunction.Dilation(w, h, x, y, data), rh);
} else if (getOpType() == OpType.OPENING) {
targetImage = GeneralFilterDescriptor.create(sourceImage, new GeneralFilterFunction.Erosion(w, h, x, y, data), rh);
targetImage = GeneralFilterDescriptor.create(targetImage, new GeneralFilterFunction.Dilation(w, h, x, y, data), rh);
} else if (getOpType() == OpType.CLOSING) {
targetImage = GeneralFilterDescriptor.create(sourceImage, new GeneralFilterFunction.Dilation(w, h, x, y, data), rh);
targetImage = GeneralFilterDescriptor.create(targetImage, new GeneralFilterFunction.Erosion(w, h, x, y, data), rh);
} else {
throw new IllegalStateException(String.format("Unsupported operation type '%s'", getOpType()));
}
return targetImage;
}
private static boolean[] toStructuringElementData(Kernel kernel) {
double[] kernelElements = kernel.getKernelData(null);
boolean[] structuringElement = new boolean[kernelElements.length];
boolean hasFalse = false;
boolean hasTrue = false;
for (int i = 0; i < kernelElements.length; i++) {
boolean b = kernelElements[i] != 0.0;
if (b) {
hasTrue = true;
} else {
hasFalse = true;
}
structuringElement[i] = b;
}
return hasTrue && hasFalse ? structuringElement : null;
}
} | bcdev/beam | beam-core/src/main/java/org/esa/beam/framework/datamodel/GeneralFilterBand.java | Java | gpl-3.0 | 6,590 |
/**
* @FileName : WeWikiSummary.java
* @Project : NightHawk
* @Date : 2012. 7. 3.
* @작성자 : @author yion
* @변경이력 :
* @프로그램 설명 : 위키 헤드라인 섬머리
*/
package org.gliderwiki.web.domain;
import org.gliderwiki.framework.orm.sql.annotation.Column;
import org.gliderwiki.framework.orm.sql.annotation.Table;
import org.gliderwiki.web.vo.BaseObjectBean;
/**
* @author yion
*
*/
@Table("WE_WIKI_SUMMARY")
public class WeWikiSummary extends BaseObjectBean {
/**
* 섬머리 순번
*/
@Column(name = "we_summary_idx", primaryKey = true, autoIncrement = true)
private Integer we_summary_idx;
/**
* 위키순번
*/
@Column(name = "we_wiki_idx")
private Integer we_wiki_idx;
/**
* 위키리비전
*/
@Column(name = "we_wiki_revision")
private Integer we_wiki_revision;
/**
* 섬머리 타이틀
*/
@Column(name = "we_summary_title")
private String we_summary_title;
@Column(name = "we_summary_tag")
private String we_summary_tag;
@Column(name = "we_use_yn")
private String we_use_yn;
/**
* @return the we_summary_idx
*/
public Integer getWe_summary_idx() {
return we_summary_idx;
}
/**
* @param we_summary_idx the we_summary_idx to set
*/
public void setWe_summary_idx(Integer we_summary_idx) {
this.we_summary_idx = we_summary_idx;
}
/**
* @return the we_wiki_idx
*/
public Integer getWe_wiki_idx() {
return we_wiki_idx;
}
/**
* @param we_wiki_idx the we_wiki_idx to set
*/
public void setWe_wiki_idx(Integer we_wiki_idx) {
this.we_wiki_idx = we_wiki_idx;
}
/**
* @return the we_wiki_revision
*/
public Integer getWe_wiki_revision() {
return we_wiki_revision;
}
/**
* @param we_wiki_revision the we_wiki_revision to set
*/
public void setWe_wiki_revision(Integer we_wiki_revision) {
this.we_wiki_revision = we_wiki_revision;
}
/**
* @return the we_summary_title
*/
public String getWe_summary_title() {
return we_summary_title;
}
/**
* @param we_summary_title the we_summary_title to set
*/
public void setWe_summary_title(String we_summary_title) {
this.we_summary_title = we_summary_title;
}
/**
* @return the we_summary_tag
*/
public String getWe_summary_tag() {
return we_summary_tag;
}
/**
* @param we_summary_tag the we_summary_tag to set
*/
public void setWe_summary_tag(String we_summary_tag) {
this.we_summary_tag = we_summary_tag;
}
/**
* @return the we_use_yn
*/
public String getWe_use_yn() {
return we_use_yn;
}
/**
* @param we_use_yn the we_use_yn to set
*/
public void setWe_use_yn(String we_use_yn) {
this.we_use_yn = we_use_yn;
}
} | cafeciel/gliderwiki | src/org/gliderwiki/web/domain/WeWikiSummary.java | Java | gpl-3.0 | 2,666 |
set pythonexe=""
FOR /d %%f in ("C:\Python*" "C:\Program Files (x86)\Python*" "C:\Anaconda2") DO (
if exist "%%f\python.exe" (
set pythondir=%%f
set pythonexe="%%f\python.exe"
rem exit /b
)
)
| bopjesvla/BCI | utilities/findPython.bat | Batchfile | gpl-3.0 | 206 |
/***************************************************************************
file : MyTrack.h
created : 9 Apr 2006
copyright : (C) 2006 Tim Foden, 2013 D.Schellhammer
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef _MYTRACK_H_
#define _MYTRACK_H_
#include <track.h>
#include <car.h>
#include "Seg.h"
class MyTrack
{
public:
MyTrack();
~MyTrack();
void NewTrack( tTrack* pNewTrack, double seg_len );
double GetLength() const;
int GetSize() const;
double GetWidth() const;
double NormalisePos( double trackPos ) const;
int IndexFromPos( double trackPos ) const;
const Seg& operator[]( int index ) const;
const Seg& GetAt( int index ) const;
double GetDelta() const;
double CalcPos( tTrkLocPos& trkPos, double offset = 0 ) const;
double CalcPos( tCarElt* car, double offset = 0 ) const;
double CalcPos( double x, double y, const Seg* hint = 0, bool sides = false ) const;
double CalcForwardAngle( double trackPos ) const;
Vec2d CalcNormal( double trackPos ) const;
private:
void CalcPtAndNormal( const tTrackSeg* pSeg, double toStart, double& t, Vec3d& pt, Vec3d& norm ) const;
private:
int NSEG;
double m_delta;
Seg* m_pSegs;
tTrack* m_pCurTrack;
};
#endif // _MYTRACK_H_
| non-official-SD/base | src/drivers/dandroid/src/MyTrack.h | C | gpl-3.0 | 1,913 |
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
namespace CoreSys.Windows
{
public class WeekBar : MonoBehaviour
{
public ChooseWeek parent;
public Text weekBarText;
public int weekIndex; //This is the index in the list of the week this bar stands for
public WeekBar() { }
public void SetBar(ChooseWeek parent, int index, string barText)
{
weekIndex = index;
this.parent = parent;
weekBarText.text = barText;
}
}
} | Catalyse/VerizonScheduler | Assets/WindowScripts/WindowElements/WeekBar.cs | C# | gpl-3.0 | 543 |
<?php
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Paypal\Model\System\Config\Backend;
class Cron extends \Magento\Framework\App\Config\Value
{
const CRON_STRING_PATH = 'crontab/default/jobs/paypal_fetch_settlement_reports/schedule/cron_expr';
const CRON_MODEL_PATH_INTERVAL = 'paypal/fetch_reports/schedule';
/**
* @var \Magento\Framework\App\Config\ValueFactory
*/
protected $_configValueFactory;
/**
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Registry $registry
* @param \Magento\Framework\App\Config\ScopeConfigInterface $config
* @param \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList
* @param \Magento\Framework\App\Config\ValueFactory $configValueFactory
* @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource
* @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
* @param array $data
*/
public function __construct(
\Magento\Framework\Model\Context $context,
\Magento\Framework\Registry $registry,
\Magento\Framework\App\Config\ScopeConfigInterface $config,
\Magento\Framework\App\Cache\TypeListInterface $cacheTypeList,
\Magento\Framework\App\Config\ValueFactory $configValueFactory,
\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
array $data = []
) {
$this->_configValueFactory = $configValueFactory;
parent::__construct($context, $registry, $config, $cacheTypeList, $resource, $resourceCollection, $data);
}
/**
* Cron settings after save
*
* @return $this
*/
public function afterSave()
{
$cronExprString = '';
$time = explode(
',',
$this->_configValueFactory->create()->load('paypal/fetch_reports/time', 'path')->getValue()
);
if ($this->_configValueFactory->create()->load('paypal/fetch_reports/active', 'path')->getValue()) {
$interval = $this->_configValueFactory->create()->load(self::CRON_MODEL_PATH_INTERVAL, 'path')->getValue();
$cronExprString = "{$time[1]} {$time[0]} */{$interval} * *";
}
$this->_configValueFactory->create()->load(
self::CRON_STRING_PATH,
'path'
)->setValue(
$cronExprString
)->setPath(
self::CRON_STRING_PATH
)->save();
return parent::afterSave();
}
}
| rajmahesh/magento2-master | vendor/magento/module-paypal/Model/System/Config/Backend/Cron.php | PHP | gpl-3.0 | 2,645 |
// Copyright (C) 1999-2003 Paul O. Lewis
//
// This file is part of NCL (Nexus Class Library) version 2.0.
//
// NCL is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// NCL is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with NCL; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
#ifndef NCL_NXSTOKEN_H
#define NCL_NXSTOKEN_H
#include "nxsexception.h"
class NxsToken;
class NxsX_UnexpectedEOF: public NxsException
{
public:
NxsX_UnexpectedEOF(NxsToken &);
};
/*!
General notes on NexusTokenizing
File position information (pos, line and column) refer to the end of the token.
Note 1: the GetEmbeddedComments methods of ProcessedNxsToken and NxsToken can be tricky to use if detailed
position location of the comment is required. A vector of "embedded comments" in the NCL context is a collection of
all comments that were encountered during a GetNextToken operation. The behavior depends on whether the tokenizer
can tell if a section of text is has the potential to span comment. Potentially comment-spanning tokens have to be
read until a token-breaker is found. Thus they include trailing comments. Thus it is not always easy (or possible)
for client code to determine whether a specifie comment belongs "with" a particular NEXUS token rather than the
previous or next token.
For example:
Text Result as (token, {"embedded comment"}) pairs Explanation
============================ ============================================= =====================================
;a[1]b; (;, {}), (ab, {1}), (;, {}) ab is a comment-spanning token
;[1]a[2]b; (;, {}), (ab, {1, 2}), (;, {}) tokenizer realizes that ; is always a single token
so [1] is not encountered until the second GetNextToken() call.
a[1];[2]b; (a, {1}), (;, {}) (b, {2}), (;, {}) First GetNextToken() call reads "a" token until ; (thus reading "[1]")
; is a single character token, so no comments are read, thus making
[2] part of the third GetNextToken call().
In some cases the comment position information and token position information may reveal the exact location of the
comments. Fortunately the relative order of comments is retained and the exact position is rarely needed.\
Note 2: Using the NxsToken class with the saveCommandComments LabileFlag causes [&comment text here] comments to be
returned as tokens ONLY if they are not preceded by potentially comment-spanning tokens. This "feature" is new to
NCL v2.1 and is the result of a bug-fix (previous versions of NCL incorrectly broke tokens at the start of any comment).
Text Result as in saveCommandComments mode Explanation
========================= ============================================= =====================================
=[&R](1, ("=",{}) ("&R", {}), ("(",{}), ("1",{}), (",",{}) [&R] is not in the middle of potentially-comment-spanning token.
a[&R]b, ("ab",{"&R"}), (",",{}) [&R] is in the middle of comment-spanning token "ab"
a[&R], ("a",{"&R"}), (",",{}) [&R] is in on the trailing end of a potentially-comment-spanning token "a"
the tokenizer
This wart makes it more tedious to deal with command comments. However it is tolerable becuase the only supported use of command
comments in NCL is after single-character tokens (for example after = in a tree descpription).
The NHX command comments are not processed by NCL, but they occur in contexts in which it will be possible to determine
the correct location of the comment (though it is necessary to check the embedded comments when processing NHX trees):
Text Result as NOT IN saveCommandComments mode Explanation
========================= =================================================== =====================================
):3.5[&&NHXtext], (")",{}) (":", {}), ("3.5",{"&&NHXtext"}), (",",{}) "3.5" is potentially-comment-spanning, but the comment still
is stored with other metadata for the same edge.
)[&&NHXtext], (")",{}) (",", {"&&NHXtext"}) NHX comment is parsed with the second token, but
because , is NOT potentially-comment-spanning
know that [&&NHXtext] must have preceded the comma (the
token and comment column numbers would also make this clear.
*/
/*!
New in 2.1
- See Note 2 above (bug-fix, but wart introduced). This could lead to loss of backward compatibility if client
code relies of saveCommandComments in contexts in which command comments occur within potentially comment-spanning
tokens.
- NxsComment class.
- Comments are stored in tokenization (the GetNextToken() call will trash the previous comments, so client code
must store comments if they are needed permanently).
- NxsToken::SetEOFAllowed method added and SetEOFAllowed(false) is called when entering a block. This means that
when parsing block contents the NxsToken tokenizer will raise an NxsException if it runs out of file (thus
Block reader code no longer needs to check for atEOF() constantly to issue an appropriate error).
- ProcessedNxsToken class, NxsToken:ProcessAsSimpleKeyValuePairs, and NxsToken:ProcessAsCommand methods. This makes
it easier to parse commands (by allowing random access to the tokens in a command). These methods are not appropriate
for very long commands (such as MATRIX) or commands that require fiddling with the tokenizing rules (such as disabling
the hyphen as a token breaker)
- lazy NxsToken::GetFilePosition() and low level io operations dramatically speed up tokenization (~10-20 times faster).
- some other utility functions were added, and some refactoring (delegation to NxsString) was done to clean up
*/
/*!
Storage for a comment text and (end of the comment) file position information
*/
class NxsComment
{
public:
NxsComment(const std::string & s, long lineNumber, long colNumber)
:body(s),
line(lineNumber),
col(colNumber)
{}
long GetLineNumber() const
{
return line;
}
long GetColumnNumber() const
{
return col;
}
const std::string & GetText() const
{
return body;
}
void WriteAsNexus(std::ostream &out) const
{
out << '[' << body << ']';
}
private:
std::string body;
long line;
long col;
};
/*!
Storage for a file position, line number and column number.
*/
class NxsTokenPosInfo
{
public:
NxsTokenPosInfo()
:pos(0),
line(-1),
col(-1)
{}
NxsTokenPosInfo(file_pos position, long lineno, long columnno)
:pos(position),
line(lineno),
col(columnno)
{}
NxsTokenPosInfo(const NxsToken &);
file_pos GetFilePosition() const
{
return pos;
}
long GetLineNumber() const
{
return line;
}
long GetColumnNumber() const
{
return col;
}
file_pos pos; /* current file position */
long line; /* current line in file */
long col; /* column of current line */
};
/*!
A structure for storing the name of a command and to maps of option names
to value strings.
Produced by ProcessedNxsToken::ParseSimpleCmd (see that commands comments for rules on how it parses a NEXUS
command into a NxsSimpleCommandStrings struct).
*/
class NxsSimpleCommandStrings
{
public:
typedef std::vector<std::string> VecString;
typedef std::list<VecString> MatString;
typedef std::pair<NxsTokenPosInfo, std::string> SingleValFromFile;
typedef std::pair<NxsTokenPosInfo, VecString > MultiValFromFile;
typedef std::pair<NxsTokenPosInfo, MatString > MatFromFile;
typedef std::map<std::string, SingleValFromFile> stringToValFromFile;
typedef std::map<std::string, MultiValFromFile> stringToMultiValFromFile;
typedef std::map<std::string, MatFromFile> stringToMatFromFile;
// Looks for k in opts and multiOpts. Returns all of the values
// for the command option (will be an empty vector of strings if the option was not found).
// Case-sensitive!
// If an option is in multiOpts and opts, then only the value from opts will be returned!
MultiValFromFile GetOptValue(const std::string &k) const
{
MultiValFromFile mvff;
stringToValFromFile::const_iterator s = this->opts.find(k);
if (s != this->opts.end())
{
const SingleValFromFile & v(s->second);
mvff.first = v.first;
mvff.second.push_back(v.second);
}
else
{
stringToMultiValFromFile::const_iterator m = this->multiOpts.find(k);
if (m != this->multiOpts.end())
{
const MultiValFromFile & mv(m->second);
mvff.first = mv.first;
mvff.second = mv.second;
}
}
return mvff;
}
MatFromFile GetMatOptValue(const std::string & k) const
{
stringToMatFromFile::const_iterator mIt = this->matOpts.find(k);
if (mIt == this->matOpts.end())
return MatFromFile();
return mIt->second;
}
bool HasKey(const std::string k) const
{
if (this->opts.find(k) != this->opts.end())
return true;
return ((this->multiOpts.find(k) != this->multiOpts.end()) || (this->matOpts.find(k) != this->matOpts.end()));
}
std::string cmdName;
NxsTokenPosInfo cmdPos;
stringToValFromFile opts;
stringToMultiValFromFile multiOpts;
stringToMatFromFile matOpts;
};
/*!
Storage for a single NEXUS token, and embedded comments, along with end-of-the-token file position information.
*/
class ProcessedNxsToken
{
public:
static void IncrementNotLast(std::vector<ProcessedNxsToken>::const_iterator & it,
const std::vector<ProcessedNxsToken>::const_iterator &endIt,
const char * context);
static NxsSimpleCommandStrings ParseSimpleCmd(const std::vector<ProcessedNxsToken> &, bool convertToLower);
ProcessedNxsToken(const NxsToken &t);
ProcessedNxsToken(std::string &s)
:token(s)
{}
ProcessedNxsToken(std::string &s, file_pos position,long lineno, long columnno)
:token(s),
posInfo(position, lineno, columnno)
{}
std::string GetToken() const
{
return token;
}
const std::vector<NxsComment> & GetEmbeddedComments() const
{
return embeddedComments;
}
NxsTokenPosInfo GetFilePosInfo() const
{
return posInfo;
}
const NxsTokenPosInfo & GetFilePosInfoConstRef() const
{
return posInfo;
}
file_pos GetFilePosition() const
{
return posInfo.GetFilePosition();
}
long GetLineNumber() const
{
return posInfo.GetLineNumber();
}
long GetColumnNumber() const
{
return posInfo.GetColumnNumber();
}
bool Equals(const char *c) const
{
return NxsString::case_insensitive_equals(token.c_str(), c);
}
bool EqualsCaseSensitive(const char *c) const
{
return (strcmp(token.c_str(), c) == 0);
}
void SetEmbeddedComments(const std::vector<NxsComment> & c)
{
embeddedComments = c;
}
void WriteAsNexus(std::ostream &out) const
{
for (std::vector<NxsComment>::const_iterator cIt = embeddedComments.begin(); cIt != embeddedComments.end(); ++cIt)
cIt->WriteAsNexus(out);
out << NxsString::GetEscaped(token);
}
private:
std::string token;
NxsTokenPosInfo posInfo;
std::vector<NxsComment> embeddedComments; /* comments that were processed in the same GetToken operation that created this token. */
};
/*!
ProcessedNxsCommand is merely of a collection of ProcessedNxsToken objects. The NxsToken object can use a ; as a
separator to parse of its input stream until the next ";" and return a ProcessedNxsCommand.
See NxsToken::ProcessAsCommand method.
*/
typedef std::vector<ProcessedNxsToken> ProcessedNxsCommand;
bool WriteCommandAsNexus(std::ostream &, const ProcessedNxsCommand &);
/**---------------------------------------------------------------------------------------------------------------------
NxsToken objects are used by NxsReader to extract words (tokens) from a NEXUS data file. NxsToken objects know to
correctly skip NEXUS comments and understand NEXUS punctuation, making reading a NEXUS file as simple as repeatedly
calling the GetNextToken() function and then interpreting the token returned. If the token object is not attached
to an input stream, calls to GetNextToken() will have no effect. If the token object is not attached to an output
stream, output comments will be discarded (i.e., not output anywhere) and calls to Write or Writeln will be
ineffective. If input and output streams have been attached to the token object, however, tokens are read one at a
time from the input stream, and comments are correctly read and either written to the output stream (if an output
comment) or ignored (if not an output comment). Sequences of characters surrounded by single quotes are read in as
single tokens. A pair of adjacent single quotes are stored as a single quote, and underscore characters are stored
as blanks.
*/
class NxsToken
{
public:
static std::string EscapeString(const std::string &);
static bool NeedsQuotes(const std::string &);
static std::string GetQuoted(const std::string &);
static void DemandEndSemicolon(NxsToken &token, NxsString & errormsg, const char *contextString);
static unsigned DemandPositiveInt(NxsToken &token, NxsString & errormsg, const char *contextString);
static std::map<std::string, std::string> ParseAsSimpleKeyValuePairs(const ProcessedNxsCommand & tv, const char *cmdName);
static std::vector<ProcessedNxsToken> Tokenize(const std::string & );
enum NxsTokenFlags /* For use with the variable labileFlags */
{
saveCommandComments = 0x0001, /* if set, command comments of the form [&X] are not ignored but are instead saved as regular tokens (without the square brackets, however) */
parentheticalToken = 0x0002, /* if set, and if next character encountered is a left parenthesis, token will include everything up to the matching right parenthesis */
curlyBracketedToken = 0x0004, /* if set, and if next character encountered is a left curly bracket, token will include everything up to the matching right curly bracket */
doubleQuotedToken = 0x0008, /* if set, grabs entire phrase surrounded by double quotes */
singleCharacterToken = 0x0010, /* if set, next non-whitespace character returned as token */
newlineIsToken = 0x0020, /* if set, newline character treated as a token and atEOL set if newline encountered */
tildeIsPunctuation = 0x0040, /* if set, tilde character treated as punctuation and returned as a separate token */
useSpecialPunctuation = 0x0080, /* if set, character specified by the data member special is treated as punctuation and returned as a separate token */
hyphenNotPunctuation = 0x0100, /* if set, the hyphen character is not treated as punctutation (it is normally returned as a separate token) */
preserveUnderscores = 0x0200, /* if set, underscore characters inside tokens are not converted to blank spaces (normally, all underscores are automatically converted to blanks) */
ignorePunctuation = 0x0400 /* if set, the normal punctuation symbols are treated the same as any other darkspace characters */
};
NxsString errormsg;
NxsToken(std::istream &i);
virtual ~NxsToken();
bool AtEOF();
bool AtEOL();
bool Abbreviation(NxsString s);
bool Begins(NxsString s, bool respect_case = false);
void BlanksToUnderscores();
bool Equals(NxsString s, bool respect_case = false) const;
bool EqualsCaseSensitive(const char *c) const
{
return (strcmp(token.c_str(), c) == 0);
}
long GetFileColumn() const;
file_pos GetFilePosition() const;
long GetFileLine() const;
void GetNextToken();
NxsString GetToken(bool respect_case = true);
const char *GetTokenAsCStr(bool respect_case = true);
const NxsString &GetTokenReference() const;
int GetTokenLength() const;
bool IsPlusMinusToken();
bool IsPunctuationToken();
bool IsWhitespaceToken();
bool IsPlusMinusToken(const std::string & t);
bool IsPunctuationToken(const std::string & t);
bool IsWhitespaceToken(const std::string & t);
std::map<std::string, std::string> ProcessAsSimpleKeyValuePairs(const char *cmdName);
void ProcessAsCommand(ProcessedNxsCommand *tokenVec);
void ReplaceToken(const NxsString s);
void ResetToken();
void SetSpecialPunctuationCharacter(char c);
void SetLabileFlagBit(int bit);
bool StoppedOn(char ch);
void StripWhitespace();
void ToUpper();
void Write(std::ostream &out);
void Writeln(std::ostream &out);
virtual void OutputComment(const NxsString &msg);
void SetEOFAllowed(bool e)
{
eofAllowed = e;
}
bool GetEOFAllowed() const
{
return eofAllowed;
}
void SetBlockName(const char *);
std::string GetBlockName();
const std::vector<NxsComment> & GetEmbeddedComments() const
{
return embeddedComments;
}
char PeekAtNextChar() const;
/// Calling with `true` will force the NxsToken to only consider newick's
// punctuation characters to be punctuation (newick's punctuation
// chars are ()[]':;, this is a subset of NEXUS punctuation.
// Calling with `false` will restore NEXUS punctuation rules.
void UseNewickTokenization(bool v);
protected:
void AppendToComment(char ch);
void AppendToToken(char ch);
bool GetComment();
void GetCurlyBracketedToken();
void GetDoubleQuotedToken();
void GetQuoted();
void GetParentheticalToken();
bool IsPunctuation(char ch);
bool IsWhitespace(char ch);
private:
void AdvanceToNextCharInStream();
char GetNextChar();
//char ReadNextChar();
std::istream &inputStream; /* reference to input stream from which tokens will be read */
signed char nextCharInStream;
file_pos posOffBy; /* offset of the file pos (according to the stream) and the tokenizer (which is usually a character or two behind, due to saved chars */
file_pos usualPosOffBy; /* default of posOffBy. Usually this is -1, but it can be positive if a tokenizer is created from a substring of the file */
long fileLine; /* current file line */
long fileColumn; /* current column in current line (refers to column immediately following token just read) */
NxsString token; /* the character buffer used to store the current token */
NxsString comment; /* temporary buffer used to store output comments while they are being built */
bool eofAllowed;
signed char saved; /* either '\0' or is last character read from input stream */
bool atEOF; /* true if end of file has been encountered */
bool atEOL; /* true if newline encountered while newlineIsToken labile flag set */
char special; /* ad hoc punctuation character; default value is '\0' */
int labileFlags; /* storage for flags in the NxsTokenFlags enum */
char whitespace[4]; /* stores the 3 whitespace characters: blank space, tab and newline */
std::string currBlock;
std::vector<NxsComment> embeddedComments;
typedef bool (* CharPredFunc)(const char);
CharPredFunc isPunctuationFn;
};
typedef NxsToken NexusToken;
inline ProcessedNxsToken::ProcessedNxsToken(const NxsToken &t)
:token(t.GetTokenReference()),
posInfo(t)
{}
inline NxsTokenPosInfo::NxsTokenPosInfo(const NxsToken &t)
:pos(t.GetFilePosition()),
line(t.GetFileLine()),
col(t.GetFileColumn())
{}
/*!
Stores the current block name (for better error reporting only). Use NULL to clear the currBlock name.
*/
inline void NxsToken::SetBlockName(const char *c)
{
if (c == 0L)
currBlock.clear();
else
currBlock.assign(c);
}
/*!
Returns the token's block name (for better error reporting)
*/
inline std::string NxsToken::GetBlockName()
{
return currBlock;
}
/*!
Returns copy of s but with quoting according to the NEXUS Standard iff s needs to be quoted.
*/
inline std::string NxsToken::EscapeString(const std::string &s)
{
return NxsString::GetEscaped(s);
}
/*!
Returns the token for functions that only need read only access - faster than GetToken.
*/
inline const NxsString &NxsToken::GetTokenReference() const
{
return token;
}
/**
This function is called whenever an output comment (i.e., a comment beginning with an exclamation point) is found
in the data file.
This base-class version of OutputComment suppresses these messages. You can override this virtual function to display
the output comment in the most appropriate way for application platform you are supporting.
*/
inline void NxsToken::OutputComment(
const NxsString &) /* the contents of the printable comment discovered in the NEXUS data file */
{
}
/*!
Adds `ch' to end of comment NxsString.
*/
inline void NxsToken::AppendToComment(
char ch) /* character to be appended to comment */
{
comment += ch;
}
/*!
Adds `ch' to end of current token.
*/
inline void NxsToken::AppendToToken(
char ch) /* character to be appended to token */
{
token.push_back(ch);
}
/*!
Returns true if character supplied is considered a whitespace character. Note: treats '\n' as darkspace if labile
flag newlineIsToken is in effect.
*/
inline bool NxsToken::IsWhitespace(
char ch) /* the character in question */
{
bool ws = false;
// If ch is found in the whitespace array, it's whitespace
//
if (strchr(whitespace, ch) != NULL)
ws = true;
// Unless of course ch is the newline character and we're currently
// treating newlines as darkspace!
//
if (labileFlags & newlineIsToken && ch == '\n')
ws = false;
return ws;
}
/*!
Returns true if and only if last call to GetNextToken encountered the end-of-file character (or for some reason the
input stream is now out of commission).
*/
inline bool NxsToken::AtEOF()
{
return atEOF;
}
/*!
Returns true if and only if last call to GetNextToken encountered the newline character while the newlineIsToken
labile flag was in effect.
*/
inline bool NxsToken::AtEOL()
{
return atEOL;
}
/*!
Converts all blanks in token to underscore characters. Normally, underscores found in the tokens read from a NEXUS
file are converted to blanks automatically as they are read; this function reverts the blanks back to underscores.
*/
inline void NxsToken::BlanksToUnderscores()
{
token.BlanksToUnderscores();
}
/*!
Returns value stored in `filecol', which keeps track of the current column in the data file (i.e., number of
characters since the last new line was encountered).
*/
inline long NxsToken::GetFileColumn() const
{
return fileColumn;
}
/*!
Returns value stored in filepos, which keeps track of the current position in the data file (i.e., number of
characters since the beginning of the file). Note: for Metrowerks compiler, you must use the offset() method of
the streampos class to use the value returned.
*/
inline file_pos NxsToken::GetFilePosition() const
{
return inputStream.rdbuf()->pubseekoff(0,std::ios::cur, std::ios::in) + posOffBy;
}
/*!
Returns value stored in `fileline', which keeps track of the current line in the data file (i.e., number of new
lines encountered thus far).
*/
inline long NxsToken::GetFileLine() const
{
return fileLine;
}
/*!
Returns the data member `token'. Specifying false for`respect_case' parameter causes all characters in `token'
to be converted to upper case before `token' is returned. Specifying true results in GetToken returning exactly
what it read from the file.
*/
inline NxsString NxsToken::GetToken(
bool respect_case) /* determines whether token is converted to upper case before being returned */
{
if (!respect_case)
ToUpper();
return token;
}
/*!
Returns the data member `token' as a C-style string. Specifying false for`respect_case' parameter causes all
characters in `token' to be converted to upper case before the `token' C-string is returned. Specifying true
results in GetTokenAsCStr returning exactly what it read from the file.
*/
inline const char *NxsToken::GetTokenAsCStr(
bool respect_case) /* determines whether token is converted to upper case before being returned */
{
if (!respect_case)
ToUpper();
return token.c_str();
}
/*!
Returns token.size().
*/
inline int NxsToken::GetTokenLength() const
{
return (int)token.size();
}
/*!
Returns true if current token is a single character and this character is either '+' or '-'.
*/
inline bool NxsToken::IsPlusMinusToken()
{
return IsPlusMinusToken(token);
}
/*!
Returns true if t is a single character and this character is either '+' or '-'.
*/
inline bool NxsToken::IsPlusMinusToken(const std::string &t)
{
return (t.size() == 1 && ( t[0] == '+' || t[0] == '-') );
}
/*!
Returns true if character supplied is considered a punctuation character. The following twenty characters are
considered punctuation characters:
>
()[]{}/\,;:=*'"`+-<>
>
Exceptions:
~
o The tilde character ('~') is also considered punctuation if the tildeIsPunctuation labile flag is set
o The special punctuation character (specified using the SetSpecialPunctuationCharacter) is also considered
punctuation if the useSpecialPunctuation labile flag is set
o The hyphen (i.e., minus sign) character ('-') is not considered punctuation if the hyphenNotPunctuation
labile flag is set
~
Use the SetLabileFlagBit method to set one or more NxsLabileFlags flags in `labileFlags'
*/
inline bool NxsToken::IsPunctuation(
char ch) /* the character in question */
{
// PAUP 4.0b10
// o allows ]`<> inside taxon names
// o allows `<> inside taxset names
//
if (isPunctuationFn(ch))
{
if (labileFlags & hyphenNotPunctuation)
# if defined(NCL_VERSION_2_STYLE_HYPHEN) && NCL_VERSION_2_STYLE_HYPHEN
return (ch != '-');
# else
return (ch != '-' && ch != '+');
# endif
return true;
}
if (labileFlags & tildeIsPunctuation && ch == '~')
return true;
return (labileFlags & useSpecialPunctuation && ch == special);
}
/*!
Returns true if current token is a single character and this character is a punctuation character (as defined in
IsPunctuation function).
*/
inline bool NxsToken::IsPunctuationToken()
{
return IsPunctuationToken(token);
}
/*!
Returns true if t is a single character and this character is a punctuation character (as defined in
IsPunctuation function).
*/
inline bool NxsToken::IsPunctuationToken(const std::string &t)
{
return (t.size() == 1 && IsPunctuation(t[0]));
}
/*!
Returns true if current token is a single character and this character is a whitespace character (as defined in
IsWhitespace function).
*/
inline bool NxsToken::IsWhitespaceToken()
{
return IsWhitespaceToken(token);
}
/*!
Returns true if t is a single character and this character is a whitespace character (as defined in IsWhitespace function).
*/
inline bool NxsToken::IsWhitespaceToken(const std::string &t)
{
return (t.size() == 1 && IsWhitespace( t[0]));
}
/*!
Replaces current token NxsString with s.
*/
inline void NxsToken::ReplaceToken(
const NxsString s) /* NxsString to replace current token NxsString */
{
token = s;
}
/*!
Sets token to the empty NxsString ("").
*/
inline void NxsToken::ResetToken()
{
token.clear();
embeddedComments.clear();
}
/*!
Sets the special punctuation character to `c'. If the labile bit useSpecialPunctuation is set, this character will
be added to the standard list of punctuation symbols, and will be returned as a separate token like the other
punctuation characters.
*/
inline void NxsToken::SetSpecialPunctuationCharacter(
char c) /* the character to which `special' is set */
{
special = c;
}
/*!
Sets the bit specified in the variable `labileFlags'. The available bits are specified in the NxsTokenFlags enum.
All bits in `labileFlags' are cleared after each token is read.
*/
inline void NxsToken::SetLabileFlagBit(
int bit) /* the bit (see NxsTokenFlags enum) to set in `labileFlags' */
{
labileFlags |= bit;
}
/*!
Checks character stored in the variable saved to see if it matches supplied character `ch'. Good for checking such
things as whether token stopped reading characters because it encountered a newline (and labileFlags bit
newlineIsToken was set):
>
StoppedOn('\n');
>
or whether token stopped reading characters because of a punctuation character such as a comma:
>
StoppedOn(',');
>
*/
inline bool NxsToken::StoppedOn(
char ch) /* the character to compare with saved character */
{
if (saved == ch)
return true;
else
return false;
}
inline char NxsToken::PeekAtNextChar() const
{
return nextCharInStream;
}
/*!
Simply outputs the current NxsString stored in `token' to the output stream `out'. Does not send a newline to the
output stream afterwards.
*/
inline void NxsToken::Write(
std::ostream &out) /* the output stream to which to write token NxsString */
{
out << token;
}
/*!
Simply outputs the current NxsString stored in `token' to the output stream `out'. Sends a newline to the output
stream afterwards.
*/
inline void NxsToken::Writeln(
std::ostream &out) /* the output stream to which to write `token' */
{
out << token << std::endl;
}
inline std::map<std::string, std::string> NxsToken::ProcessAsSimpleKeyValuePairs(const char *cmdName)
{
ProcessedNxsCommand tokenVec;
ProcessAsCommand(&tokenVec);
return ParseAsSimpleKeyValuePairs(tokenVec, cmdName);
}
/*!
Returns true if token NxsString exactly equals `s'. If abbreviations are to be allowed, either Begins or
Abbreviation should be used instead of Equals.
*/
inline bool NxsToken::Equals(
NxsString s, /* the string for comparison to the string currently stored in this token */
bool respect_case) const /* if true, comparison will be case-sensitive */
{
if (respect_case)
return (strcmp(token.c_str(), s.c_str()) == 0);
return NxsString::case_insensitive_equals(token.c_str(), s.c_str());
}
#endif
| wrightaprilm/revbayes | src/libs/ncl/nxstoken.h | C | gpl-3.0 | 31,101 |
<?php
/*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
This plugin is part of Archaius theme.
@copyright 2015 onwards Daniel Munera Sanchez
*/
defined('MOODLE_INTERNAL') || die;
if ( is_siteadmin() ) {
$layout_color_options = new admin_settingpage('theme_archaius_layout_colors', get_string('layoutcolorssectiontitle', 'theme_archaius'));
$layout_color_options->add(new admin_setting_heading('theme_archaius_layout_colors', get_string('layoutcolorssectionsub', 'theme_archaius'),
format_text(get_string('layoutcolorssectiondesc', 'theme_archaius'), FORMAT_MARKDOWN)));
// Login background image
$name = 'theme_archaius/loginbackgroundimage';
$title = get_string('loginbackgroundimage','theme_archaius');
$description = get_string('loginbackgroundimagedesc', 'theme_archaius');
$setting = new admin_setting_configstoredfile($name, $title, $description, 'loginbackgroundimage');
$setting->set_updatedcallback('theme_reset_all_caches');
$layout_color_options->add($setting);
//Background color
$name = 'theme_archaius/bgcolor';
$title = get_string('bgcolor','theme_archaius');
$description = get_string('bgcolordesc', 'theme_archaius');
$default = '#fff';
$previewconfig = array(
'selector'=>'html,body',
'style'=>'backgroundColor'
);
$setting = new admin_setting_configcolourpicker(
$name,
$title,
$description,
$default,
$previewconfig
);
$setting->set_updatedcallback('theme_reset_all_caches');
$layout_color_options->add($setting);
// theme color setting
$name = 'theme_archaius/themecolor';
$title = get_string('themecolor','theme_archaius');
$description = get_string('themecolordesc', 'theme_archaius');
$default = '#2E3332';
$previewconfig = array(
'selector'=>'#page-header,#page-footer',
'style'=>'backgroundColor'
);
$setting = new admin_setting_configcolourpicker(
$name,
$title,
$description,
$default,
$previewconfig
);
$setting->set_updatedcallback('theme_reset_all_caches');
$layout_color_options->add($setting);
// blocks header colors
$name = 'theme_archaius/headercolor';
$title = get_string('headercolor','theme_archaius');
$description = get_string('headercolordesc', 'theme_archaius');
$default = '#697F6F';
$previewconfig = array(
'selector'=> '.header-tab',
'style'=>'backgroundColor'
);
$setting = new admin_setting_configcolourpicker(
$name,
$title,
$description,
$default,
$previewconfig
);
$setting->set_updatedcallback('theme_reset_all_caches');
$layout_color_options->add($setting);
// blocks header current colors
$name = 'theme_archaius/currentcolor';
$title = get_string('currentcolor','theme_archaius');
$description = get_string('currentcolordesc', 'theme_archaius');
$default = '#2E3332';
$previewconfig = array(
'selector'=> '.header-tab.current',
'style'=>'backgroundColor'
);
$setting = new admin_setting_configcolourpicker(
$name,
$title,
$description,
$default,
$previewconfig
);
$setting->set_updatedcallback('theme_reset_all_caches');
$layout_color_options->add($setting);
// custommenu color
$name = 'theme_archaius/custommenucolor';
$title = get_string('custommenucolor','theme_archaius');
$description = get_string('custommenucolor', 'theme_archaius');
$default = '#697F6F';
$previewconfig = array(
'selector'=> '#custommenu',
'style'=>'backgroundColor'
);
$setting = new admin_setting_configcolourpicker(
$name,
$title,
$description,
$default,
$previewconfig
);
$setting->set_updatedcallback('theme_reset_all_caches');
$layout_color_options->add($setting);
// custommenucurrent color
$name = 'theme_archaius/currentcustommenucolor';
$title = get_string('currentcustommenucolor','theme_archaius');
$description = get_string('currentcustommenucolor', 'theme_archaius');
$default = '#2E3332';
$previewconfig = array(
'selector'=> 'div.region-content div.header.current',
'style'=>'backgroundColor'
);
$setting = new admin_setting_configcolourpicker(
$name,
$title,
$description,
$default,
$previewconfig
);
$setting->set_updatedcallback('theme_reset_all_caches');
$layout_color_options->add($setting);
// header text color
$name = 'theme_archaius/headertextcolor';
$title = get_string('headertextcolor','theme_archaius');
$description = get_string('headertextcolordesc', 'theme_archaius');
$default = '#F5F5F5';
$previewconfig = array(
'selector'=> '#page-header, #page-header a:link, #page-header a:visited, #page-header .usermenu .moodle-actionmenu .toggle-display .userbutton .usertext, #page-header .usermenu .moodle-actionmenu:hover .toggle-display .userbutton .usertext',
'style'=>'color'
);
$setting = new admin_setting_configcolourpicker(
$name,
$title,
$description,
$default,
$previewconfig
);
$setting->set_updatedcallback('theme_reset_all_caches');
$layout_color_options->add($setting);
//Add options to admin tree
$ADMIN->add('theme_archaius', $layout_color_options);
}
| kathiravans/moodle29 | theme/archaius/settings/archaius_layout_color_settings.php | PHP | gpl-3.0 | 5,551 |
package com.oryx.remote.webservices.service.personservice;
import com.oryx.remote.webservice.element.model.system.ref.XmlPerson;
import com.oryx.remote.webservice.element.operation.XmlAuthentification;
import com.oryx.remote.webservice.element.operation.XmlOperationDescIn;
import javax.xml.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
/**
* <p>Classe Java pour anonymous complex type.
* <p>
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
* <p>
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="auth" type="{http://operation.element.webservice.remote.oryx.com}XmlAuthentification"/>
* <element name="request" type="{http://operation.element.webservice.remote.oryx.com}XmlOperationDescIn"/>
* <element name="Object" type="{http://ref.system.model.element.webservice.remote.oryx.com}XmlPerson" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"auth",
"request",
"object"
})
@XmlRootElement(name = "crudRequest")
public class CrudRequest {
@XmlElement(required = true)
protected XmlAuthentification auth;
@XmlElement(required = true)
protected XmlOperationDescIn request;
@XmlElement(name = "Object")
protected List<XmlPerson> object;
/**
* Obtient la valeur de la propriété auth.
*
* @return possible object is
* {@link XmlAuthentification }
*/
public XmlAuthentification getAuth() {
return auth;
}
/**
* Définit la valeur de la propriété auth.
*
* @param value allowed object is
* {@link XmlAuthentification }
*/
public void setAuth(XmlAuthentification value) {
this.auth = value;
}
/**
* Obtient la valeur de la propriété request.
*
* @return possible object is
* {@link XmlOperationDescIn }
*/
public XmlOperationDescIn getRequest() {
return request;
}
/**
* Définit la valeur de la propriété request.
*
* @param value allowed object is
* {@link XmlOperationDescIn }
*/
public void setRequest(XmlOperationDescIn value) {
this.request = value;
}
/**
* Gets the value of the object property.
* <p>
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the object property.
* <p>
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getObject().add(newItem);
* </pre>
* <p>
* <p>
* <p>
* Objects of the following type(s) are allowed in the list
* {@link XmlPerson }
*/
public List<XmlPerson> getObject() {
if (object == null) {
object = new ArrayList<XmlPerson>();
}
return this.object;
}
}
| 241180/Oryx | oryx-server-ws-gen/src/main/java/copied/com/oryx/remote/webservices/service/personservice/CrudRequest.java | Java | gpl-3.0 | 3,306 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Wei Gao <gaowei3@qq.com>
# Copyright: (c) 2018, Ansible Project
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = r'''
---
module: vmware_host_facts
short_description: Gathers facts about remote ESXi hostsystem
description:
- This module can be used to gathers facts like CPU, memory, datastore, network and system etc. about ESXi host system.
- Please specify hostname or IP address of ESXi host system as C(hostname).
- If hostname or IP address of vCenter is provided as C(hostname) and C(esxi_hostname) is not specified, then the
module will throw an error.
- VSAN facts added in 2.7 version.
version_added: 2.5
author:
- Wei Gao (@woshihaoren)
requirements:
- python >= 2.6
- PyVmomi
options:
esxi_hostname:
description:
- ESXi hostname.
- Host facts about the specified ESXi server will be returned.
- By specifying this option, you can select which ESXi hostsystem is returned if connecting to a vCenter.
version_added: 2.8
type: str
show_tag:
description:
- Tags related to Host are shown if set to C(True).
default: False
type: bool
required: False
version_added: 2.9
schema:
description:
- Specify the output schema desired.
- The 'summary' output schema is the legacy output from the module
- The 'vsphere' output schema is the vSphere API class definition
which requires pyvmomi>6.7.1
choices: ['summary', 'vsphere']
default: 'summary'
type: str
version_added: '2.10'
properties:
description:
- Specify the properties to retrieve.
- If not specified, all properties are retrieved (deeply).
- Results are returned in a structure identical to the vsphere API.
- 'Example:'
- ' properties: ['
- ' "hardware.memorySize",'
- ' "hardware.cpuInfo.numCpuCores",'
- ' "config.product.apiVersion",'
- ' "overallStatus"'
- ' ]'
- Only valid when C(schema) is C(vsphere).
type: list
required: False
version_added: '2.10'
extends_documentation_fragment: vmware.documentation
'''
EXAMPLES = r'''
- name: Gather vmware host facts
vmware_host_facts:
hostname: "{{ esxi_server }}"
username: "{{ esxi_username }}"
password: "{{ esxi_password }}"
register: host_facts
delegate_to: localhost
- name: Gather vmware host facts from vCenter
vmware_host_facts:
hostname: "{{ vcenter_server }}"
username: "{{ vcenter_user }}"
password: "{{ vcenter_pass }}"
esxi_hostname: "{{ esxi_hostname }}"
register: host_facts
delegate_to: localhost
- name: Gather vmware host facts from vCenter with tag information
vmware_host_facts:
hostname: "{{ vcenter_server }}"
username: "{{ vcenter_user }}"
password: "{{ vcenter_pass }}"
esxi_hostname: "{{ esxi_hostname }}"
show_tag: True
register: host_facts_tag
delegate_to: localhost
- name: Get VSAN Cluster UUID from host facts
vmware_host_facts:
hostname: "{{ esxi_server }}"
username: "{{ esxi_username }}"
password: "{{ esxi_password }}"
register: host_facts
- set_fact:
cluster_uuid: "{{ host_facts['ansible_facts']['vsan_cluster_uuid'] }}"
- name: Gather some info from a host using the vSphere API output schema
vmware_host_facts:
hostname: "{{ vcenter_server }}"
username: "{{ esxi_username }}"
password: "{{ esxi_password }}"
esxi_hostname: "{{ esxi_hostname }}"
schema: vsphere
properties:
- hardware.memorySize
- hardware.cpuInfo.numCpuCores
- config.product.apiVersion
- overallStatus
register: host_facts
'''
RETURN = r'''
ansible_facts:
description: system info about the host machine
returned: always
type: dict
sample:
{
"ansible_all_ipv4_addresses": [
"10.76.33.200"
],
"ansible_bios_date": "2011-01-01T00:00:00+00:00",
"ansible_bios_version": "0.5.1",
"ansible_datastore": [
{
"free": "11.63 GB",
"name": "datastore1",
"total": "12.50 GB"
}
],
"ansible_distribution": "VMware ESXi",
"ansible_distribution_build": "4887370",
"ansible_distribution_version": "6.5.0",
"ansible_hostname": "10.76.33.100",
"ansible_in_maintenance_mode": true,
"ansible_interfaces": [
"vmk0"
],
"ansible_memfree_mb": 2702,
"ansible_memtotal_mb": 4095,
"ansible_os_type": "vmnix-x86",
"ansible_processor": "Intel Xeon E312xx (Sandy Bridge)",
"ansible_processor_cores": 2,
"ansible_processor_count": 2,
"ansible_processor_vcpus": 2,
"ansible_product_name": "KVM",
"ansible_product_serial": "NA",
"ansible_system_vendor": "Red Hat",
"ansible_uptime": 1791680,
"ansible_vmk0": {
"device": "vmk0",
"ipv4": {
"address": "10.76.33.100",
"netmask": "255.255.255.0"
},
"macaddress": "52:54:00:56:7d:59",
"mtu": 1500
},
"vsan_cluster_uuid": null,
"vsan_node_uuid": null,
"vsan_health": "unknown",
"tags": [
{
"category_id": "urn:vmomi:InventoryServiceCategory:8eb81431-b20d-49f5-af7b-126853aa1189:GLOBAL",
"category_name": "host_category_0001",
"description": "",
"id": "urn:vmomi:InventoryServiceTag:e9398232-46fd-461a-bf84-06128e182a4a:GLOBAL",
"name": "host_tag_0001"
}
],
}
'''
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.common.text.formatters import bytes_to_human
from ansible.module_utils.vmware import PyVmomi, vmware_argument_spec, find_obj
try:
from pyVmomi import vim
except ImportError:
pass
from ansible.module_utils.vmware_rest_client import VmwareRestClient
class VMwareHostFactManager(PyVmomi):
def __init__(self, module):
super(VMwareHostFactManager, self).__init__(module)
esxi_host_name = self.params.get('esxi_hostname', None)
if self.is_vcenter():
if esxi_host_name is None:
self.module.fail_json(msg="Connected to a vCenter system without specifying esxi_hostname")
self.host = self.get_all_host_objs(esxi_host_name=esxi_host_name)
if len(self.host) > 1:
self.module.fail_json(msg="esxi_hostname matched multiple hosts")
self.host = self.host[0]
else:
self.host = find_obj(self.content, [vim.HostSystem], None)
if self.host is None:
self.module.fail_json(msg="Failed to find host system.")
def all_facts(self):
ansible_facts = {}
ansible_facts.update(self.get_cpu_facts())
ansible_facts.update(self.get_memory_facts())
ansible_facts.update(self.get_datastore_facts())
ansible_facts.update(self.get_network_facts())
ansible_facts.update(self.get_system_facts())
ansible_facts.update(self.get_vsan_facts())
ansible_facts.update(self.get_cluster_facts())
if self.params.get('show_tag'):
vmware_client = VmwareRestClient(self.module)
tag_info = {
'tags': vmware_client.get_tags_for_hostsystem(hostsystem_mid=self.host._moId)
}
ansible_facts.update(tag_info)
self.module.exit_json(changed=False, ansible_facts=ansible_facts)
def get_cluster_facts(self):
cluster_facts = {'cluster': None}
if self.host.parent and isinstance(self.host.parent, vim.ClusterComputeResource):
cluster_facts.update(cluster=self.host.parent.name)
return cluster_facts
def get_vsan_facts(self):
config_mgr = self.host.configManager.vsanSystem
if config_mgr is None:
return {
'vsan_cluster_uuid': None,
'vsan_node_uuid': None,
'vsan_health': "unknown",
}
status = config_mgr.QueryHostStatus()
return {
'vsan_cluster_uuid': status.uuid,
'vsan_node_uuid': status.nodeUuid,
'vsan_health': status.health,
}
def get_cpu_facts(self):
return {
'ansible_processor': self.host.summary.hardware.cpuModel,
'ansible_processor_cores': self.host.summary.hardware.numCpuCores,
'ansible_processor_count': self.host.summary.hardware.numCpuPkgs,
'ansible_processor_vcpus': self.host.summary.hardware.numCpuThreads,
}
def get_memory_facts(self):
return {
'ansible_memfree_mb': self.host.hardware.memorySize // 1024 // 1024 - self.host.summary.quickStats.overallMemoryUsage,
'ansible_memtotal_mb': self.host.hardware.memorySize // 1024 // 1024,
}
def get_datastore_facts(self):
facts = dict()
facts['ansible_datastore'] = []
for store in self.host.datastore:
_tmp = {
'name': store.summary.name,
'total': bytes_to_human(store.summary.capacity),
'free': bytes_to_human(store.summary.freeSpace),
}
facts['ansible_datastore'].append(_tmp)
return facts
def get_network_facts(self):
facts = dict()
facts['ansible_interfaces'] = []
facts['ansible_all_ipv4_addresses'] = []
for nic in self.host.config.network.vnic:
device = nic.device
facts['ansible_interfaces'].append(device)
facts['ansible_all_ipv4_addresses'].append(nic.spec.ip.ipAddress)
_tmp = {
'device': device,
'ipv4': {
'address': nic.spec.ip.ipAddress,
'netmask': nic.spec.ip.subnetMask,
},
'macaddress': nic.spec.mac,
'mtu': nic.spec.mtu,
}
facts['ansible_' + device] = _tmp
return facts
def get_system_facts(self):
sn = 'NA'
for info in self.host.hardware.systemInfo.otherIdentifyingInfo:
if info.identifierType.key == 'ServiceTag':
sn = info.identifierValue
facts = {
'ansible_distribution': self.host.config.product.name,
'ansible_distribution_version': self.host.config.product.version,
'ansible_distribution_build': self.host.config.product.build,
'ansible_os_type': self.host.config.product.osType,
'ansible_system_vendor': self.host.hardware.systemInfo.vendor,
'ansible_hostname': self.host.summary.config.name,
'ansible_product_name': self.host.hardware.systemInfo.model,
'ansible_product_serial': sn,
'ansible_bios_date': self.host.hardware.biosInfo.releaseDate,
'ansible_bios_version': self.host.hardware.biosInfo.biosVersion,
'ansible_uptime': self.host.summary.quickStats.uptime,
'ansible_in_maintenance_mode': self.host.runtime.inMaintenanceMode,
}
return facts
def properties_facts(self):
ansible_facts = self.to_json(self.host, self.params.get('properties'))
if self.params.get('show_tag'):
vmware_client = VmwareRestClient(self.module)
tag_info = {
'tags': vmware_client.get_tags_for_hostsystem(hostsystem_mid=self.host._moId)
}
ansible_facts.update(tag_info)
self.module.exit_json(changed=False, ansible_facts=ansible_facts)
def main():
argument_spec = vmware_argument_spec()
argument_spec.update(
esxi_hostname=dict(type='str', required=False),
show_tag=dict(type='bool', default=False),
schema=dict(type='str', choices=['summary', 'vsphere'], default='summary'),
properties=dict(type='list')
)
module = AnsibleModule(argument_spec=argument_spec,
supports_check_mode=True)
vm_host_manager = VMwareHostFactManager(module)
if module.params['schema'] == 'summary':
vm_host_manager.all_facts()
else:
vm_host_manager.properties_facts()
if __name__ == '__main__':
main()
| pdellaert/ansible | lib/ansible/modules/cloud/vmware/vmware_host_facts.py | Python | gpl-3.0 | 12,620 |
-----------------------------------
-- Area: Castle Zvahl Baileys (S) (138)
-- Mob: Yrvaulair_S_Cousseraux
-----------------------------------
-- require("scripts/zones/Castle_Zvahl_Baileys_[S]/MobIDs");
-----------------------------------
-- onMobInitialize
-----------------------------------
function onMobInitialize(mob)
end;
-----------------------------------
-- onMobSpawn
-----------------------------------
function onMobSpawn(mob)
end;
-----------------------------------
-- onMobEngaged
-----------------------------------
function onMobEngaged(mob,target)
end;
-----------------------------------
-- onMobFight
-----------------------------------
function onMobFight(mob,target)
end;
-----------------------------------
-- onMobDeath
-----------------------------------
function onMobDeath(mob,killer)
end;
| salamader/ffxi-a | scripts/zones/Castle_Zvahl_Baileys_[S]/mobs/Yrvaulair_S_Cousseraux.lua | Lua | gpl-3.0 | 839 |
/*
* AuthListAdapter.java shows the captured authentications within a list
* Copyright (C) 2011 Andreas Koch <koch.trier@gmail.com>
*
* This software was supported by the University of Trier
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation; either version 3 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package de.trier.infsec.koch.droidsheep.objects;
import android.content.Context;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import de.trier.infsec.koch.droidsheep.R;
import de.trier.infsec.koch.droidsheep.activities.ListenActivity;
import de.trier.infsec.koch.droidsheep.auth.Auth;
public class AuthListAdapter extends BaseAdapter {
private Context context;
public AuthListAdapter(Context context) {
this.context = context;
}
public int getCount() {
return ListenActivity.authList.size();
}
@Override
public Auth getItem(int position) {
return ListenActivity.authList.get(position);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
LinearLayout itemLayout = (LinearLayout) LayoutInflater.from(context).inflate(R.layout.listelement, parent, false);
if (position >= ListenActivity.authList.size())
return itemLayout;
if (ListenActivity.authList == null || ListenActivity.authList.get(position) == null) {
return itemLayout;
}
Auth auth = ListenActivity.authList.get(position);
TextView tv1 = (TextView) itemLayout.findViewById(R.id.listtext1);
TextView tv2 = (TextView) itemLayout.findViewById(R.id.listtext2);
ImageView imgView = (ImageView) itemLayout.findViewById(R.id.image);
tv1.setText(auth.getName());
if (auth.isGeneric()) {
tv1.setTextColor(Color.YELLOW);
} else {
tv1.setTextColor(Color.GREEN);
}
if (auth.isGeneric() || auth.getName() == null || auth.getName().equals("")) {
tv2.setText(auth.getIp() + " ID: " + auth.getId() + (auth.isSaved() ? " << SAVED >>" : ""));
} else {
tv2.setText(auth.getIp() + " " + auth.getName() + "@" + auth.getUrl());
}
if (auth.isSaved()) {
itemLayout.setBackgroundColor(Color.argb(150, 193, 205, 205));
tv2.setTextColor(Color.WHITE);
}
if (auth.getUrl().contains("amazon")) {
imgView.setImageDrawable(context.getResources().getDrawable(R.drawable.amazon));
} else if (auth.getUrl().contains("ebay")) {
imgView.setImageDrawable(context.getResources().getDrawable(R.drawable.ebay));
} else if (auth.getUrl().contains("facebook")) {
imgView.setImageDrawable(context.getResources().getDrawable(R.drawable.facebook));
} else if (auth.getUrl().contains("flickr")) {
imgView.setImageDrawable(context.getResources().getDrawable(R.drawable.flickr));
} else if (auth.getUrl().contains("google")) {
imgView.setImageDrawable(context.getResources().getDrawable(R.drawable.google));
} else if (auth.getUrl().contains("linkedin")) {
imgView.setImageDrawable(context.getResources().getDrawable(R.drawable.linkedin));
} else if (auth.getUrl().contains("twitter")) {
imgView.setImageDrawable(context.getResources().getDrawable(R.drawable.twitter));
} else if (auth.getUrl().contains("youtube")) {
imgView.setImageDrawable(context.getResources().getDrawable(R.drawable.youtube));
} else {
imgView.setImageDrawable(context.getResources().getDrawable(R.drawable.droidsheep_square));
}
return itemLayout;
}
@Override
public long getItemId(int position) {
return position;
}
}
| vilie/droid-sheep | src/de/trier/infsec/koch/droidsheep/objects/AuthListAdapter.java | Java | gpl-3.0 | 4,345 |
/* Copyright (C) 1991, 1997, 2009-2021 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#define UNSIGNED 1
#include "strtol.c"
| cooljeanius/emacs | lib/strtoul.c | C | gpl-3.0 | 809 |
# Was tun, wenn Infrastruktur nicht tut, was sie soll
## 1. Problem identifizieren
Hört sich einfach an, ist es oft aber nicht. Kommuniziere nur, was du
weißt. Falls sich Dein Gerät nicht mit dem WLAN verbindet,
solltest Du nicht sagen "Das Internet geht nicht", sondern "Mein Gerät
kommt nicht ins WLAN"
## 2.Den "Kümmerer" finden
Geht meist vor Ort durch "In-Die-Runde-Fragen" am Besten. Wenn Du einen
potenziellen Kümmerer gefunden hast, lass Dir Kontaktdaten geben, am
Besten eine E-Mail-Adresse.
Falls der entsprechende Kümmerer für dich ermittelbar ist, kannst Du
Dich an die Infrastruktur-Mailingliste wenden. Für diese musst Du Dich
nicht eintragen, du kannst einfach eine Mail an [1] schreiben. Für alles
was nicht direkt unter "Infrastruktur" fällt, kannst Du auch auf [2] ein
Issue aufmachen.
## 3. Fehlerbericht verfassen
Ebenfalls schwieriger als man manchmal denkt. Der Schlüssel zum Erfolg
hier, so präzise wie möglich zu schreiben. Fehlerbeschreibungen wie
"$ding geht nicht"
sind NICHT hilfreich, wenn sie sonst nichts beinhalten. Besser wäre:
"$ding funktioniert nicht, Power-LED bleibt trotz Netzstrom aus,
Steckdose und Kaltgerätekabel funktionieren aber mit anderen Geräten."
Grundsätzlich sollte ein Fehlerbericht folgende Punkte beinhalten:
* Fehlerbeschreibung
* Verwendete Hardware/Software (nur involvierte Komponenten)
* Wie kann der Fehler reproduziert werden
Auch hier gilt wieder: Verzichte auf Vermutungen, nenne nur Fakten, die
du gesichert weißt oder empirisch ermittelt hast.
## 4. Sei stolz auf Dich
Mit einem gut verfassten Fehlerbericht hast du bereits einen
signifikanten Anteil zur Lösung des Problems beigetragen.
| pRiVi/howto-openlab | infrastruktur/infrastruktur-kaputt-was-tun.md | Markdown | gpl-3.0 | 1,696 |
/*
Yelo: Open Sauce SDK
Halo 1 (CE) Edition
See license\OpenSauce\Halo1_CE for specific license information
*/
#pragma once
// See this header for more "Engine pointer markup system" documentation
#include <YeloLib/memory/memory_interface_base.hpp>
#include <YeloLib/memory/naked_func_writer.hpp>
//////////////////////////////////////////////////////////////////////////
// Value markup system
//
// [ce_value] : value for use in Client builds
// [cededi_value] : value for use in Dedi builds
//
//////////////////////////////////////////////////////////////////////////
#if PLATFORM_IS_DEDI
#define PLATFORM_VALUE(ce_value, cededi_value) cededi_value
#elif PLATFORM_IS_USER
#define PLATFORM_VALUE(ce_value, cededi_value) ce_value
#endif
#define PLATFORM_PTR(type, ce_value, cededi_value) CAST_PTR(type, PLATFORM_VALUE(ce_value, cededi_value))
| BipolarAurora/H-CE-Opensauce-V5 | OpenSauce/Halo1/Halo1_CE/Memory/MemoryInterface.hpp | C++ | gpl-3.0 | 857 |
/* XMRig
* Copyright 2010 Jeff Garzik <jgarzik@pobox.com>
* Copyright 2012-2014 pooler <pooler@litecoinpool.org>
* Copyright 2014 Lucas Jones <https://github.com/lucasjones>
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <direct.h>
#include <shlobj.h>
#include <windows.h>
#include "backend/opencl/OclCache.h"
void xmrig::OclCache::createDirectory()
{
std::string path = prefix() + "/xmrig";
_mkdir(path.c_str());
path += "/.cache";
_mkdir(path.c_str());
}
std::string xmrig::OclCache::prefix()
{
char path[MAX_PATH + 1];
if (SHGetSpecialFolderPathA(HWND_DESKTOP, path, CSIDL_LOCAL_APPDATA, FALSE)) {
return path;
}
return ".";
}
| Bendr0id/xmrigCC | src/backend/opencl/OclCache_win.cpp | C++ | gpl-3.0 | 1,705 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="content-language" content="en" />
<meta name="description" content="Liberty Eiffel project is a free Eiffel compiler started from SmartEiffel code base. Its goal is to retain from SmartEiffel its rigour; but not its rigidity. Think of Liberty as SmartEiffel down from its ivory tower." />
<meta name="keywords" content="LibertyEiffel, Documentation, Classes, Overview, Libraries, Tools" />
<meta name="robots" content="INDEX,FOLLOW" />
<title>Liberty Eiffel Documentation</title>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<div id="all">
<div class="header"><a href="http://www.gnu.org/software/liberty-eiffel/">GNU</a> | <a href="http://www.liberty-eiffel.org">Liberty Eiffel</a> | <a href="http://et.liberty-eiffel.org">Automated tests</a> | <a href="http://wiki.liberty-eiffel.org/index.php/Main_Page">Wiki</a> | <a href="https://savannah.gnu.org/projects/liberty-eiffel/">Savannah project</a> | <a href="http://apt.liberty-eiffel.org">Debian packages</a> | <b class="current">Documentation</b></div>
<div id="content">
<img src="images/liberty-light.png" alt="Liberty Logo" align="right">
<div id="text" style="width:920px;">
<h1><span class="dropcap">D</span>ocumentation overview</h1>
<p>
The Liberty classes documentation is generated each time <a href="http://et.liberty-eiffel.org">ET</a> runs.
</p>
<p>
The released documentation is not yet available.
</p>
<h1><span class="dropcap">L</span>ibrary classes</h1>
<ul>
<li><a href="api/libraries/index.html">The core library</a></li>
<li><a href="api/wrappers/index.html">The library wrappers</a></li>
<li><a href="api/staging/index.html">The "staging" libraries (i.e. not mature enough to be included in the upcoming release)</a></li>
<li><a href="api/tutorial/index.html">The tutorial</a></li>
</ul>
<h1><span class="dropcap">T</span>ool classes</h1>
<ul>
<li><a href="api/smarteiffel/index.html">The SmartEiffel tools</a></li>
<li><a href="api/liberty/index.html">The Liberty Eiffel tools</a></li>
</ul>
</div>
</div>
<div id="footer" class="header">
<!--#config timefmt="%F" -->
last updated on <!--#echo var="LAST_MODIFIED" --> - <a href="http://www.liberty-eiffel.org/#imprint">Imprint</a>
</div>
</div>
</body>
</html>
| cadrian/Liberty | website/doc/index.html | HTML | gpl-3.0 | 2,672 |
// This file was automatically generated. Do not modify.
'use strict';
goog.provide('Blockly.Msg.zh.hant');
goog.require('Blockly.Msg');
Blockly.Msg.ADD_COMMENT = "加入註解";
Blockly.Msg.AUTH = "Please authorize this app to enable your work to be saved and to allow it to be shared by you."; // untranslated
Blockly.Msg.CHANGE_VALUE_TITLE = "修改值:";
Blockly.Msg.CHAT = "與您的合作者洽談藉由在此框輸入!";
Blockly.Msg.COLLAPSE_ALL = "收合積木";
Blockly.Msg.COLLAPSE_BLOCK = "收合積木";
Blockly.Msg.COLOUR_BLEND_COLOUR1 = "顏色 1";
Blockly.Msg.COLOUR_BLEND_COLOUR2 = "顏色 2";
Blockly.Msg.COLOUR_BLEND_HELPURL = "http://meyerweb.com/eric/tools/color-blend/"; // untranslated
Blockly.Msg.COLOUR_BLEND_RATIO = "比例";
Blockly.Msg.COLOUR_BLEND_TITLE = "混合";
Blockly.Msg.COLOUR_BLEND_TOOLTIP = "透過一個比率 (0.0-1.0)來混合兩種顏色。";
Blockly.Msg.COLOUR_PICKER_HELPURL = "https://en.wikipedia.org/wiki/Color";
Blockly.Msg.COLOUR_PICKER_TOOLTIP = "從調色板中選擇一種顏色。";
Blockly.Msg.COLOUR_RANDOM_HELPURL = "http://randomcolour.com"; // untranslated
Blockly.Msg.COLOUR_RANDOM_TITLE = "隨機顏色";
Blockly.Msg.COLOUR_RANDOM_TOOLTIP = "隨機選擇一種顏色。";
Blockly.Msg.COLOUR_RGB_BLUE = "藍";
Blockly.Msg.COLOUR_RGB_GREEN = "綠";
Blockly.Msg.COLOUR_RGB_HELPURL = "http://www.december.com/html/spec/colorper.html"; // untranslated
Blockly.Msg.COLOUR_RGB_RED = "紅";
Blockly.Msg.COLOUR_RGB_TITLE = "顏色";
Blockly.Msg.COLOUR_RGB_TOOLTIP = "透過指定紅、綠、 藍色的值來建立一種顏色。所有的值必須介於 0 和 100 之間。";
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_HELPURL = "https://github.com/google/blockly/wiki/Loops#loop-termination-blocks"; // untranslated
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK = "停止 迴圈";
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE = "繼續下一個 迴圈";
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK = "離開當前的 迴圈";
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE = "跳過這個迴圈的其餘步驟,並繼續下一次的迴圈運算。";
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING = "警告: 此積木僅可用於迴圈內。";
Blockly.Msg.CONTROLS_FOREACH_HELPURL = "https://github.com/google/blockly/wiki/Loops#for-each for each block"; // untranslated
Blockly.Msg.CONTROLS_FOREACH_INPUT_INLIST = "自列表";
Blockly.Msg.CONTROLS_FOREACH_INPUT_INLIST_TAIL = "";
Blockly.Msg.CONTROLS_FOREACH_INPUT_ITEM = "取出每個";
Blockly.Msg.CONTROLS_FOREACH_TOOLTIP = "遍歷每個列表中的項目,將變量 '%1' 設定到該項目中,然後執行某些語句";
Blockly.Msg.CONTROLS_FOR_HELPURL = "https://github.com/google/blockly/wiki/Loops#count-with"; // untranslated
Blockly.Msg.CONTROLS_FOR_INPUT_FROM_TO_BY = "從範圍 %1 到 %2 每隔 %3";
Blockly.Msg.CONTROLS_FOR_INPUT_WITH = "使用";
Blockly.Msg.CONTROLS_FOR_INPUT_WITH_CHAINHULL = "Chain Hull: count with"; // untranslated
Blockly.Msg.CONTROLS_FOR_TOOLTIP = "從起始數到結尾數中取出變數 %1 的值,按指定的時間間隔,執行指定的積木。";
Blockly.Msg.CONTROLS_FOR_TOOLTIP_CHAINHULL = "Return the convex hull of each shape in the loop with the next shape"; // untranslated
Blockly.Msg.CONTROLS_IF_ELSEIF_TOOLTIP = "將條件添加到'如果'積木。";
Blockly.Msg.CONTROLS_IF_ELSE_TOOLTIP = "加入一個最終,所有條件下都都執行的區塊到'如果'積木中";
Blockly.Msg.CONTROLS_IF_HELPURL = "https://github.com/google/blockly/wiki/IfElse"; // untranslated
Blockly.Msg.CONTROLS_IF_IF_TOOLTIP = "添加、 刪除或重新排列各區塊來此重新配置這個'如果'積木。";
Blockly.Msg.CONTROLS_IF_MSG_ELSE = "否則";
Blockly.Msg.CONTROLS_IF_MSG_ELSEIF = "否則如果";
Blockly.Msg.CONTROLS_IF_MSG_IF = "如果";
Blockly.Msg.CONTROLS_IF_TOOLTIP_1 = "當值為真時,執行一些語句";
Blockly.Msg.CONTROLS_IF_TOOLTIP_2 = "當值為真時,執行第一個語句,否則則執行第二個語句";
Blockly.Msg.CONTROLS_IF_TOOLTIP_3 = "如果第一個值為真,則執行第一個語句。否則當第二個值為真時,則執行第二個語句";
Blockly.Msg.CONTROLS_IF_TOOLTIP_4 = "如果第一個值為真,則執行第一個語句。否則當第二個值為真時,則執行第二個語句。如果前幾個敘述都不為真,則執行最後一個語句";
Blockly.Msg.CONTROLS_REPEAT_HELPURL = "https://en.wikipedia.org/wiki/For_loop";
Blockly.Msg.CONTROLS_REPEAT_INPUT_DO = "執行";
Blockly.Msg.CONTROLS_REPEAT_TITLE = "重複 %1 次";
Blockly.Msg.CONTROLS_REPEAT_TITLE_REPEAT = "重複";
Blockly.Msg.CONTROLS_REPEAT_TITLE_TIMES = "次數";
Blockly.Msg.CONTROLS_REPEAT_TOOLTIP = "多次執行一些語句";
Blockly.Msg.CONTROLS_WHILEUNTIL_HELPURL = "https://github.com/google/blockly/wiki/Loops#repeat"; // untranslated
Blockly.Msg.CONTROLS_WHILEUNTIL_OPERATOR_UNTIL = "重複 直到";
Blockly.Msg.CONTROLS_WHILEUNTIL_OPERATOR_WHILE = "重複 當";
Blockly.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL = "當值為否時,執行一些語句";
Blockly.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE = "當值為真時,執行一些語句";
Blockly.Msg.DELETE_BLOCK = "刪除積木";
Blockly.Msg.DELETE_X_BLOCKS = "刪除 %1 塊積木";
Blockly.Msg.DISABLE_BLOCK = "停用積木";
Blockly.Msg.DUPLICATE_BLOCK = "複製";
Blockly.Msg.ENABLE_BLOCK = "啟用積木";
Blockly.Msg.EXPAND_ALL = "展開積木";
Blockly.Msg.EXPAND_BLOCK = "展開積木";
Blockly.Msg.EXTERNAL_INPUTS = "多行輸入";
Blockly.Msg.HELP = "說明";
Blockly.Msg.INLINE_INPUTS = "單行輸入";
Blockly.Msg.LISTS_CREATE_EMPTY_HELPURL = "https://github.com/google/blockly/wiki/Lists#create-empty-list"; // untranslated
Blockly.Msg.LISTS_CREATE_EMPTY_TITLE = "建立空列表";
Blockly.Msg.LISTS_CREATE_EMPTY_TOOLTIP = "返回一個長度為 0 的列表,不包含任何資料記錄";
Blockly.Msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD = "加入";
Blockly.Msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP = "添加、 刪除或重新排列各區塊來此重新配置這個 列表 積木。";
Blockly.Msg.LISTS_CREATE_WITH_HELPURL = "https://github.com/google/blockly/wiki/Lists#create-list-with"; // untranslated
Blockly.Msg.LISTS_CREATE_WITH_INPUT_WITH = "使用這些值建立列表";
Blockly.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP = "將一個項目加入到列表中。";
Blockly.Msg.LISTS_CREATE_WITH_TOOLTIP = "建立一個具備任意數量項目的列表。";
Blockly.Msg.LISTS_GET_INDEX_FIRST = "第一筆";
Blockly.Msg.LISTS_GET_INDEX_FROM_END = "倒數第#筆";
Blockly.Msg.LISTS_GET_INDEX_FROM_START = "#"; // untranslated
Blockly.Msg.LISTS_GET_INDEX_GET = "取值";
Blockly.Msg.LISTS_GET_INDEX_GET_REMOVE = "取出並移除";
Blockly.Msg.LISTS_GET_INDEX_LAST = "最後一筆";
Blockly.Msg.LISTS_GET_INDEX_RANDOM = "隨機";
Blockly.Msg.LISTS_GET_INDEX_REMOVE = "移除";
Blockly.Msg.LISTS_GET_INDEX_TAIL = ""; // untranslated
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FIRST = "返回列表中的第一個項目";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM_END = "返回在列表中的指定位置的項目。#1 是最後一個項目。";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM_START = "返回在列表中的指定位置的項目。#1 是第一個項目。";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_LAST = "返回列表中的最後一個項目";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM = "返回列表中隨機的一個項目";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST = "移除並返回列表中的第一個項目";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM_END = "移除並返回列表中的指定位置的項目。#1 是最後一個項目。";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM_START = "移除並返回列表中的指定位置的項目。#1 是第一個項目。";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST = "移除並返回列表中的最後一個項目";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM = "移除並返回列表中的隨機一個項目";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST = "移除列表中的第一個項目";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM_END = "移除在列表中的指定位置的項目。#1 是最後一個項目。";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM_START = "移除在列表中的指定位置的項目。#1 是第一個項目。";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST = "移除列表中的最後一個項目";
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM = "移除列表中隨機的一個項目";
Blockly.Msg.LISTS_GET_SUBLIST_END_FROM_END = "到 倒數 # 位";
Blockly.Msg.LISTS_GET_SUBLIST_END_FROM_START = "到 #";
Blockly.Msg.LISTS_GET_SUBLIST_END_LAST = "到 最後";
Blockly.Msg.LISTS_GET_SUBLIST_HELPURL = "https://github.com/google/blockly/wiki/Lists#getting-a-sublist"; // untranslated
Blockly.Msg.LISTS_GET_SUBLIST_START_FIRST = "從 頭 取得子列表";
Blockly.Msg.LISTS_GET_SUBLIST_START_FROM_END = "從倒數 # 取得子列表";
Blockly.Msg.LISTS_GET_SUBLIST_START_FROM_START = "從 # 取得子列表";
Blockly.Msg.LISTS_GET_SUBLIST_TAIL = ""; // untranslated
Blockly.Msg.LISTS_GET_SUBLIST_TOOLTIP = "複製列表中指定的部分。";
Blockly.Msg.LISTS_INDEX_OF_FIRST = "找出 第一個 項目出現";
Blockly.Msg.LISTS_INDEX_OF_HELPURL = "https://github.com/google/blockly/wiki/Lists#getting-items-from-a-list"; // untranslated
Blockly.Msg.LISTS_INDEX_OF_LAST = "找出 最後一個 項目出現";
Blockly.Msg.LISTS_INDEX_OF_TOOLTIP = "返回在列表中的第一個/最後一個匹配項目的索引值。如果未找到則返回 0。";
Blockly.Msg.LISTS_INLIST = "自列表";
Blockly.Msg.LISTS_IS_EMPTY_HELPURL = "https://github.com/google/blockly/wiki/Lists#is-empty"; // untranslated
Blockly.Msg.LISTS_IS_EMPTY_TITLE = "%1 值為空";
Blockly.Msg.LISTS_LENGTH_HELPURL = "https://github.com/google/blockly/wiki/Lists#length-of"; // untranslated
Blockly.Msg.LISTS_LENGTH_TITLE = "長度 %1";
Blockly.Msg.LISTS_LENGTH_TOOLTIP = "返回列表的長度。";
Blockly.Msg.LISTS_REPEAT_HELPURL = "https://github.com/google/blockly/wiki/Lists#create-list-with"; // untranslated
Blockly.Msg.LISTS_REPEAT_TITLE = "建立列表使用項目 %1 重複 %2 次數";
Blockly.Msg.LISTS_REPEAT_TOOLTIP = "建立包含指定重複次數的 值 的列表。";
Blockly.Msg.LISTS_SET_INDEX_HELPURL = "https://github.com/google/blockly/wiki/Lists#in-list--set"; // untranslated
Blockly.Msg.LISTS_SET_INDEX_INPUT_TO = "為";
Blockly.Msg.LISTS_SET_INDEX_INSERT = "插入到";
Blockly.Msg.LISTS_SET_INDEX_SET = "設定";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST = "在列表的起始處添加一個項目。";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM_END = "插入在列表中的指定位置的項目。#1 是最後一個項目。";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM_START = "插入在列表中的指定位置的項目。#1 是第一個項目。";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST = "在列表的尾端加入一個項目";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM = "在列表中隨機插入項目";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST = "設定列表中的第一個項目";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "設定在列表中的指定位置的項目。#1 是最後一個項目。";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "設定在列表中的指定位置的項目。#1 是第一個項目。";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "設定列表中的最後一個項目";
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "設定列表中隨機的一個項目";
Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated
Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "make list from text"; // untranslated
Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "make text from list"; // untranslated
Blockly.Msg.LISTS_SPLIT_TOOLTIP_JOIN = "Join a list of texts into one text, separated by a delimiter."; // untranslated
Blockly.Msg.LISTS_SPLIT_TOOLTIP_SPLIT = "Split text into a list of texts, breaking at each delimiter."; // untranslated
Blockly.Msg.LISTS_SPLIT_WITH_DELIMITER = "with delimiter"; // untranslated
Blockly.Msg.LISTS_TOOLTIP = "如果該列表為空,則返回 真。";
Blockly.Msg.LOGIC_BOOLEAN_FALSE = "否";
Blockly.Msg.LOGIC_BOOLEAN_HELPURL = "https://github.com/google/blockly/wiki/Logic#values"; // untranslated
Blockly.Msg.LOGIC_BOOLEAN_TOOLTIP = "返回 真 或 否。";
Blockly.Msg.LOGIC_BOOLEAN_TRUE = "真";
Blockly.Msg.LOGIC_COMPARE_HELPURL = "https://en.wikipedia.org/wiki/Inequality_(mathematics)";
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_EQ = "如果這兩個輸入區塊內容相等,返回 真。";
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_GT = "如果第一個輸入大於第二個輸入,返回 真。";
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_GTE = "如果第一個輸入大於或等於第二個輸入,返回 真。";
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_LT = "如果第一個輸入小於第二個輸入,返回 真。";
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_LTE = "如果第一個輸入是小於或等於第二個輸入,返回 真。";
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_NEQ = "如果這兩個輸入區塊內容不相等,返回 真。";
Blockly.Msg.LOGIC_NEGATE_HELPURL = "https://github.com/google/blockly/wiki/Logic#not"; // untranslated
Blockly.Msg.LOGIC_NEGATE_TITLE = "非 %1";
Blockly.Msg.LOGIC_NEGATE_TOOLTIP = "如果輸入的值是 否,則返回 真。如果輸入的值是 真 返回 否。";
Blockly.Msg.LOGIC_NULL = "空";
Blockly.Msg.LOGIC_NULL_HELPURL = "https://en.wikipedia.org/wiki/Nullable_type"; // untranslated
Blockly.Msg.LOGIC_NULL_TOOLTIP = "返回 空。";
Blockly.Msg.LOGIC_OPERATION_AND = "且";
Blockly.Msg.LOGIC_OPERATION_HELPURL = "https://github.com/google/blockly/wiki/Logic#logical-operations"; // untranslated
Blockly.Msg.LOGIC_OPERATION_OR = "或";
Blockly.Msg.LOGIC_OPERATION_TOOLTIP_AND = "如果這兩個輸入值都為 真,則返回 真。";
Blockly.Msg.LOGIC_OPERATION_TOOLTIP_OR = "如果至少一個輸入的值為 真,返回 真。";
Blockly.Msg.LOGIC_TERNARY_CONDITION = "測試";
Blockly.Msg.LOGIC_TERNARY_HELPURL = "https://en.wikipedia.org/wiki/%3F:"; // untranslated
Blockly.Msg.LOGIC_TERNARY_IF_FALSE = "如果為非";
Blockly.Msg.LOGIC_TERNARY_IF_TRUE = "如果為真";
Blockly.Msg.LOGIC_TERNARY_TOOLTIP = "檢查 'test' 中的條件。如果條件為 真,將返回 '如果為 真' 值 ;否則,返回 '如果為 否' 的值。";
Blockly.Msg.MATH_ADDITION_SYMBOL = "+"; // untranslated
Blockly.Msg.MATH_ARITHMETIC_HELPURL = "https://en.wikipedia.org/wiki/Arithmetic";
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_ADD = "返回兩個數字的總和。";
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE = "返回兩個數字的商。";
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS = "返回兩個數字的差。";
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY = "返回兩個數字的乘積。";
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_POWER = "返回第二個數字的指數的第一個數字。";
Blockly.Msg.MATH_CHANGE_HELPURL = "https://en.wikipedia.org/wiki/Programming_idiom#Incrementing_a_counter";
Blockly.Msg.MATH_CHANGE_INPUT_BY = "自";
Blockly.Msg.MATH_CHANGE_TITLE_CHANGE = "修改";
Blockly.Msg.MATH_CHANGE_TOOLTIP = "將數字添加到變量 '%1'。";
Blockly.Msg.MATH_CONSTANT_HELPURL = "https://en.wikipedia.org/wiki/Mathematical_constant";
Blockly.Msg.MATH_CONSTANT_TOOLTIP = "返回一個的常見常量: π (3.141......),e (2.718...)、 φ (1.618...)、 開方(2) (1.414......)、 開方(½) (0.707......) 或 ∞ (無窮大)。";
Blockly.Msg.MATH_CONSTRAIN_HELPURL = "https://en.wikipedia.org/wiki/Clamping_%28graphics%29"; // untranslated
Blockly.Msg.MATH_CONSTRAIN_TITLE = "限制數字 %1 介於 (低) %2 到 (高) %3";
Blockly.Msg.MATH_CONSTRAIN_TOOLTIP = "限制數字介於兩個指定的數字之間";
Blockly.Msg.MATH_DIVISION_SYMBOL = "÷"; // untranslated
Blockly.Msg.MATH_IS_DIVISIBLE_BY = "可被整除";
Blockly.Msg.MATH_IS_EVEN = "是偶數";
Blockly.Msg.MATH_IS_NEGATIVE = "是負值";
Blockly.Msg.MATH_IS_ODD = "是奇數";
Blockly.Msg.MATH_IS_POSITIVE = "是正值";
Blockly.Msg.MATH_IS_PRIME = "是質數";
Blockly.Msg.MATH_IS_TOOLTIP = "如果數字是偶數,奇數,非負整數,正數、 負數或如果它是可被某數字整除,則返回 真 或 否。";
Blockly.Msg.MATH_IS_WHOLE = "是非負整數";
Blockly.Msg.MATH_MODULO_HELPURL = "https://en.wikipedia.org/wiki/Modulo_operation";
Blockly.Msg.MATH_MODULO_TITLE = "取餘數自 %1 ÷ %2";
Blockly.Msg.MATH_MODULO_TOOLTIP = "回傳兩個數字相除的餘數";
Blockly.Msg.MATH_MULTIPLICATION_SYMBOL = "×"; // untranslated
Blockly.Msg.MATH_NUMBER_HELPURL = "https://en.wikipedia.org/wiki/Number";
Blockly.Msg.MATH_NUMBER_TOOLTIP = "一個數字。";
Blockly.Msg.MATH_ONLIST_HELPURL = ""; // untranslated
Blockly.Msg.MATH_ONLIST_OPERATOR_AVERAGE = "平均值 自列表";
Blockly.Msg.MATH_ONLIST_OPERATOR_MAX = "最大值 自列表";
Blockly.Msg.MATH_ONLIST_OPERATOR_MEDIAN = "中位數 自列表";
Blockly.Msg.MATH_ONLIST_OPERATOR_MIN = "最小值 自列表";
Blockly.Msg.MATH_ONLIST_OPERATOR_MODE = "比較眾數 自列表";
Blockly.Msg.MATH_ONLIST_OPERATOR_RANDOM = "隨機抽取 自列表";
Blockly.Msg.MATH_ONLIST_OPERATOR_STD_DEV = "標準差 自列表";
Blockly.Msg.MATH_ONLIST_OPERATOR_SUM = "總和 自列表";
Blockly.Msg.MATH_ONLIST_TOOLTIP_AVERAGE = "返回列表中數值的平均值 (算術平均值)。";
Blockly.Msg.MATH_ONLIST_TOOLTIP_MAX = "返回列表中的最大數字。";
Blockly.Msg.MATH_ONLIST_TOOLTIP_MEDIAN = "返回列表中數值的中位數。";
Blockly.Msg.MATH_ONLIST_TOOLTIP_MIN = "返回列表中的最小數字。";
Blockly.Msg.MATH_ONLIST_TOOLTIP_MODE = "返回一個列表中的最常見項目的列表。";
Blockly.Msg.MATH_ONLIST_TOOLTIP_RANDOM = "從列表中返回一個隨機的項目。";
Blockly.Msg.MATH_ONLIST_TOOLTIP_STD_DEV = "返回列表中數字的標準差。";
Blockly.Msg.MATH_ONLIST_TOOLTIP_SUM = "返回列表中的所有數字的總和。";
Blockly.Msg.MATH_POWER_SYMBOL = "^"; // untranslated
Blockly.Msg.MATH_RANDOM_FLOAT_HELPURL = "https://en.wikipedia.org/wiki/Random_number_generation";
Blockly.Msg.MATH_RANDOM_FLOAT_TITLE_RANDOM = "取隨機分數";
Blockly.Msg.MATH_RANDOM_FLOAT_TOOLTIP = "返回介於 (包含) 0.0 到 1.0 之間的隨機數。";
Blockly.Msg.MATH_RANDOM_INT_HELPURL = "https://en.wikipedia.org/wiki/Random_number_generation";
Blockly.Msg.MATH_RANDOM_INT_TITLE = "取隨機整數介於 (低) %1 到 %2";
Blockly.Msg.MATH_RANDOM_INT_TOOLTIP = "回傳限制的數字區間內的隨機數字";
Blockly.Msg.MATH_ROUND_HELPURL = "https://en.wikipedia.org/wiki/Rounding";
Blockly.Msg.MATH_ROUND_OPERATOR_ROUND = "四捨五入";
Blockly.Msg.MATH_ROUND_OPERATOR_ROUNDDOWN = "無條件捨去";
Blockly.Msg.MATH_ROUND_OPERATOR_ROUNDUP = "無條件進位";
Blockly.Msg.MATH_ROUND_TOOLTIP = "將數字向上或向下舍入。";
Blockly.Msg.MATH_SINGLE_HELPURL = "https://en.wikipedia.org/wiki/Square_root";
Blockly.Msg.MATH_SINGLE_OP_ABSOLUTE = "絕對值";
Blockly.Msg.MATH_SINGLE_OP_ROOT = "開根號";
Blockly.Msg.MATH_SINGLE_TOOLTIP_ABS = "返回指定數字的絕對值。";
Blockly.Msg.MATH_SINGLE_TOOLTIP_EXP = "返回指定數字指數的 e";
Blockly.Msg.MATH_SINGLE_TOOLTIP_LN = "返回指定數字的自然對數。";
Blockly.Msg.MATH_SINGLE_TOOLTIP_LOG10 = "返回指定數字的對數。";
Blockly.Msg.MATH_SINGLE_TOOLTIP_NEG = "返回指定數字的 negation。";
Blockly.Msg.MATH_SINGLE_TOOLTIP_POW10 = "返回指定數字指數的10的冪次。";
Blockly.Msg.MATH_SINGLE_TOOLTIP_ROOT = "返回指定數字的平方根。";
Blockly.Msg.MATH_SUBTRACTION_SYMBOL = "-"; // untranslated
Blockly.Msg.MATH_TRIG_ACOS = "acos"; // untranslated
Blockly.Msg.MATH_TRIG_ASIN = "asin"; // untranslated
Blockly.Msg.MATH_TRIG_ATAN = "atan"; // untranslated
Blockly.Msg.MATH_TRIG_COS = "cos"; // untranslated
Blockly.Msg.MATH_TRIG_HELPURL = "https://en.wikipedia.org/wiki/Trigonometric_functions";
Blockly.Msg.MATH_TRIG_SIN = "sin"; // untranslated
Blockly.Msg.MATH_TRIG_TAN = "tan"; // untranslated
Blockly.Msg.MATH_TRIG_TOOLTIP_ACOS = "返回指定角度的反餘弦值(非弧度)。";
Blockly.Msg.MATH_TRIG_TOOLTIP_ASIN = "返回指定角度的反正弦值(非弧度)。";
Blockly.Msg.MATH_TRIG_TOOLTIP_ATAN = "返回指定角度的反正切值。";
Blockly.Msg.MATH_TRIG_TOOLTIP_COS = "返回指定角度的餘弦值(非弧度)。";
Blockly.Msg.MATH_TRIG_TOOLTIP_SIN = "返回指定角度的正弦值(非弧度)。";
Blockly.Msg.MATH_TRIG_TOOLTIP_TAN = "返回指定角度的正切值(非弧度)。";
Blockly.Msg.ME = "Me"; // untranslated
Blockly.Msg.NEW_VARIABLE = "新變量...";
Blockly.Msg.NEW_VARIABLE_TITLE = "新變量名稱:";
Blockly.Msg.ORDINAL_NUMBER_SUFFIX = ""; // untranslated
Blockly.Msg.PROCEDURES_ALLOW_STATEMENTS = "allow statements"; // untranslated
Blockly.Msg.PROCEDURES_BEFORE_PARAMS = "與:";
Blockly.Msg.PROCEDURES_CALLNORETURN_CALL = "呼叫";
Blockly.Msg.PROCEDURES_CALLNORETURN_HELPURL = "https://en.wikipedia.org/wiki/Procedure_%28computer_science%29";
Blockly.Msg.PROCEDURES_CALLNORETURN_TOOLTIP = "執行使用者定義的函數 '%1'。";
Blockly.Msg.PROCEDURES_CALLRETURN_HELPURL = "https://en.wikipedia.org/wiki/Procedure_%28computer_science%29";
Blockly.Msg.PROCEDURES_CALLRETURN_TOOLTIP = "執行使用者定義的函數 '%1' 並使用它的回傳值";
Blockly.Msg.PROCEDURES_CALL_BEFORE_PARAMS = "與:";
Blockly.Msg.PROCEDURES_CREATE_DO = "建立 '%1'";
Blockly.Msg.PROCEDURES_DEFNORETURN_DO = ""; // untranslated
Blockly.Msg.PROCEDURES_DEFNORETURN_HELPURL = "https://en.wikipedia.org/wiki/Procedure_%28computer_science%29"; // untranslated
Blockly.Msg.PROCEDURES_DEFNORETURN_PROCEDURE = "流程";
Blockly.Msg.PROCEDURES_DEFNORETURN_TITLE = "到";
Blockly.Msg.PROCEDURES_DEFNORETURN_TOOLTIP = "創建一個無回傳值的函數。";
Blockly.Msg.PROCEDURES_DEFRETURN_HELPURL = "https://en.wikipedia.org/wiki/Procedure_%28computer_science%29"; // untranslated
Blockly.Msg.PROCEDURES_DEFRETURN_RETURN = "回傳";
Blockly.Msg.PROCEDURES_DEFRETURN_TOOLTIP = "創建一個有回傳值的函數。";
Blockly.Msg.PROCEDURES_DEF_DUPLICATE_WARNING = "警告: 此函數中有重複的參數。";
Blockly.Msg.PROCEDURES_HIGHLIGHT_CALLERS = "Highlight function instances"; // untranslated
Blockly.Msg.PROCEDURES_HIGHLIGHT_DEF = "高亮顯示函式定義";
Blockly.Msg.PROCEDURES_IFRETURN_TOOLTIP = "如果值為 真,則返回第二個值。";
Blockly.Msg.PROCEDURES_IFRETURN_WARNING = "警告: 此積木僅可在定義函式時使用。";
Blockly.Msg.PROCEDURES_MUTATORARG_TITLE = "變量:";
Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "Add an input to the function."; // untranslated
Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "參數";
Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "Add, remove, or reorder inputs to this function."; // untranslated
Blockly.Msg.REMOVE_COMMENT = "移除註解";
Blockly.Msg.RENAME_VARIABLE = "重新命名變量...";
Blockly.Msg.RENAME_VARIABLE_TITLE = "將所有 \"%1\" 變量重新命名為:";
Blockly.Msg.TEXT_APPEND_APPENDTEXT = "後加入文字";
Blockly.Msg.TEXT_APPEND_HELPURL = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
Blockly.Msg.TEXT_APPEND_TO = "在";
Blockly.Msg.TEXT_APPEND_TOOLTIP = "將一些文字追加到變量 '%1'。";
Blockly.Msg.TEXT_CHANGECASE_HELPURL = "https://github.com/google/blockly/wiki/Text#adjusting-text-case"; // untranslated
Blockly.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE = "轉成 小寫";
Blockly.Msg.TEXT_CHANGECASE_OPERATOR_TITLECASE = "轉成 首字母大寫";
Blockly.Msg.TEXT_CHANGECASE_OPERATOR_UPPERCASE = "轉成 大寫";
Blockly.Msg.TEXT_CHANGECASE_TOOLTIP = "使用不同的大小寫複製這段文字。";
Blockly.Msg.TEXT_CHARAT_FIRST = "取第一個字元";
Blockly.Msg.TEXT_CHARAT_FROM_END = "取得 倒數第 # 個字元";
Blockly.Msg.TEXT_CHARAT_FROM_START = "取得 字元 #";
Blockly.Msg.TEXT_CHARAT_HELPURL = "https://github.com/google/blockly/wiki/Text#extracting-text"; // untranslated
Blockly.Msg.TEXT_CHARAT_INPUT_INTEXT = "的字元在字串";
Blockly.Msg.TEXT_CHARAT_LAST = "取最後一個字元";
Blockly.Msg.TEXT_CHARAT_RANDOM = "取隨機一個字元";
Blockly.Msg.TEXT_CHARAT_TAIL = "";
Blockly.Msg.TEXT_CHARAT_TOOLTIP = "返回位於指定位置的字元。";
Blockly.Msg.TEXT_CREATE_JOIN_ITEM_TOOLTIP = "將一個項目加入到字串中。";
Blockly.Msg.TEXT_CREATE_JOIN_TITLE_JOIN = "加入";
Blockly.Msg.TEXT_CREATE_JOIN_TOOLTIP = "添加、 刪除或重新排列各區塊來此重新配置這個文字積木。";
Blockly.Msg.TEXT_GET_SUBSTRING_END_FROM_END = "到 倒數第 # 個字元";
Blockly.Msg.TEXT_GET_SUBSTRING_END_FROM_START = "到 字元 #";
Blockly.Msg.TEXT_GET_SUBSTRING_END_LAST = "到 最後一個字元";
Blockly.Msg.TEXT_GET_SUBSTRING_HELPURL = "https://github.com/google/blockly/wiki/Text#extracting-a-region-of-text"; // untranslated
Blockly.Msg.TEXT_GET_SUBSTRING_INPUT_IN_TEXT = "自字串";
Blockly.Msg.TEXT_GET_SUBSTRING_START_FIRST = "取得一段字串 自 第一個字元";
Blockly.Msg.TEXT_GET_SUBSTRING_START_FROM_END = "取得一段字串自 #";
Blockly.Msg.TEXT_GET_SUBSTRING_START_FROM_START = "取得一段字串自 #";
Blockly.Msg.TEXT_GET_SUBSTRING_TAIL = ""; // untranslated
Blockly.Msg.TEXT_GET_SUBSTRING_TOOLTIP = "返回指定的部分文字。";
Blockly.Msg.TEXT_INDEXOF_HELPURL = "https://github.com/google/blockly/wiki/Text#finding-text"; // untranslated
Blockly.Msg.TEXT_INDEXOF_INPUT_INTEXT = "在字串";
Blockly.Msg.TEXT_INDEXOF_OPERATOR_FIRST = "尋找 第一個 出現的字串";
Blockly.Msg.TEXT_INDEXOF_OPERATOR_LAST = "尋找 最後一個 出現的字串";
Blockly.Msg.TEXT_INDEXOF_TAIL = ""; // untranslated
Blockly.Msg.TEXT_INDEXOF_TOOLTIP = "返回在第二個字串中的第一個/最後一個匹配項目的索引值。如果未找到則返回 0。";
Blockly.Msg.TEXT_ISEMPTY_HELPURL = "https://github.com/google/blockly/wiki/Text#checking-for-empty-text"; // untranslated
Blockly.Msg.TEXT_ISEMPTY_TITLE = "%1 為空";
Blockly.Msg.TEXT_ISEMPTY_TOOLTIP = "如果提供的字串為空,則返回 真。";
Blockly.Msg.TEXT_JOIN_HELPURL = "https://github.com/google/blockly/wiki/Text#text-creation"; // untranslated
Blockly.Msg.TEXT_JOIN_TITLE_CREATEWITH = "建立字串使用";
Blockly.Msg.TEXT_JOIN_TOOLTIP = "通過串起任意數量的項目來建立一段文字。";
Blockly.Msg.TEXT_LENGTH_HELPURL = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
Blockly.Msg.TEXT_LENGTH_TITLE = "長度 %1";
Blockly.Msg.TEXT_LENGTH_TOOLTIP = "返回這串文字的字元數(含空格) 。";
Blockly.Msg.TEXT_PRINT_HELPURL = "https://github.com/google/blockly/wiki/Text#printing-text"; // untranslated
Blockly.Msg.TEXT_PRINT_TITLE = "印出 %1";
Blockly.Msg.TEXT_PRINT_TOOLTIP = "印出指定的文字、 數字或其他值。";
Blockly.Msg.TEXT_PROMPT_HELPURL = "https://github.com/google/blockly/wiki/Text#getting-input-from-the-user"; // untranslated
Blockly.Msg.TEXT_PROMPT_TOOLTIP_NUMBER = "輸入數字";
Blockly.Msg.TEXT_PROMPT_TOOLTIP_TEXT = "輸入文字";
Blockly.Msg.TEXT_PROMPT_TYPE_NUMBER = "輸入 數字 並顯示提示訊息";
Blockly.Msg.TEXT_PROMPT_TYPE_TEXT = "輸入 文字 並顯示提示訊息";
Blockly.Msg.TEXT_TEXT_HELPURL = "https://en.wikipedia.org/wiki/String_(computer_science)";
Blockly.Msg.TEXT_TEXT_TOOLTIP = "字元、 單詞或一行文字。";
Blockly.Msg.TEXT_TRIM_HELPURL = "https://github.com/google/blockly/wiki/Text#trimming-removing-spaces"; // untranslated
Blockly.Msg.TEXT_TRIM_OPERATOR_BOTH = "消除兩側空格";
Blockly.Msg.TEXT_TRIM_OPERATOR_LEFT = "消除左側空格";
Blockly.Msg.TEXT_TRIM_OPERATOR_RIGHT = "消除右側空格";
Blockly.Msg.TEXT_TRIM_TOOLTIP = "複製這段文字的同時刪除兩端多餘的空格。";
Blockly.Msg.TODAY = "Today"; // untranslated
Blockly.Msg.VARIABLES_DEFAULT_NAME = "變量";
Blockly.Msg.VARIABLES_GET_CREATE_SET = "創立 '設定 %1'";
Blockly.Msg.VARIABLES_GET_HELPURL = "https://github.com/google/blockly/wiki/Variables#get"; // untranslated
Blockly.Msg.VARIABLES_GET_TAIL = "";
Blockly.Msg.VARIABLES_GET_TITLE = "";
Blockly.Msg.VARIABLES_GET_TOOLTIP = "返回此變量的值。";
Blockly.Msg.VARIABLES_SET_CREATE_GET = "建立 '取得 %1'";
Blockly.Msg.VARIABLES_SET_HELPURL = "https://github.com/google/blockly/wiki/Variables#set"; // untranslated
Blockly.Msg.VARIABLES_SET_TAIL = "到";
Blockly.Msg.VARIABLES_SET_TITLE = "賦值";
Blockly.Msg.VARIABLES_SET_TOOLTIP = "設定此變量,好和輸入值相等。";
Blockly.Msg.PROCEDURES_DEFRETURN_TITLE = Blockly.Msg.PROCEDURES_DEFNORETURN_TITLE;
Blockly.Msg.LISTS_GET_SUBLIST_INPUT_IN_LIST = Blockly.Msg.LISTS_INLIST;
Blockly.Msg.LISTS_SET_INDEX_INPUT_IN_LIST = Blockly.Msg.LISTS_INLIST;
Blockly.Msg.PROCEDURES_DEFRETURN_PROCEDURE = Blockly.Msg.PROCEDURES_DEFNORETURN_PROCEDURE;
Blockly.Msg.VARIABLES_SET_ITEM = Blockly.Msg.VARIABLES_DEFAULT_NAME;
Blockly.Msg.LISTS_CREATE_WITH_ITEM_TITLE = Blockly.Msg.VARIABLES_DEFAULT_NAME;
Blockly.Msg.MATH_CHANGE_TITLE_ITEM = Blockly.Msg.VARIABLES_DEFAULT_NAME;
Blockly.Msg.VARIABLES_GET_ITEM = Blockly.Msg.VARIABLES_DEFAULT_NAME;
Blockly.Msg.PROCEDURES_DEFRETURN_DO = Blockly.Msg.PROCEDURES_DEFNORETURN_DO;
Blockly.Msg.LISTS_GET_INDEX_HELPURL = Blockly.Msg.LISTS_INDEX_OF_HELPURL;
Blockly.Msg.TEXT_CREATE_JOIN_ITEM_TITLE_ITEM = Blockly.Msg.VARIABLES_DEFAULT_NAME;
Blockly.Msg.CONTROLS_IF_MSG_THEN = Blockly.Msg.CONTROLS_REPEAT_INPUT_DO;
Blockly.Msg.LISTS_INDEX_OF_INPUT_IN_LIST = Blockly.Msg.LISTS_INLIST;
Blockly.Msg.PROCEDURES_CALLRETURN_CALL = Blockly.Msg.PROCEDURES_CALLNORETURN_CALL;
Blockly.Msg.LISTS_GET_INDEX_INPUT_IN_LIST = Blockly.Msg.LISTS_INLIST;
Blockly.Msg.CONTROLS_FOR_INPUT_DO = Blockly.Msg.CONTROLS_REPEAT_INPUT_DO;
Blockly.Msg.CONTROLS_FOREACH_INPUT_DO = Blockly.Msg.CONTROLS_REPEAT_INPUT_DO;
Blockly.Msg.CONTROLS_IF_IF_TITLE_IF = Blockly.Msg.CONTROLS_IF_MSG_IF;
Blockly.Msg.CONTROLS_WHILEUNTIL_INPUT_DO = Blockly.Msg.CONTROLS_REPEAT_INPUT_DO;
Blockly.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF = Blockly.Msg.CONTROLS_IF_MSG_ELSEIF;
Blockly.Msg.TEXT_APPEND_VARIABLE = Blockly.Msg.VARIABLES_DEFAULT_NAME;
Blockly.Msg.CONTROLS_IF_ELSE_TITLE_ELSE = Blockly.Msg.CONTROLS_IF_MSG_ELSE; | BogusCurry/BlocksCAD | blockly/msg/js/zh-hant.js | JavaScript | gpl-3.0 | 30,364 |
url: http://sanskrit.jnu.ac.in/sandhi/viccheda.jsp?itext=स शाब्द शाब्द इति<html>
<title>Sanskrit Sandhi Splitter at J.N.U. New Delhi</title>
<META CONTENT='text/hetml CHARSET=UTF-8' HTTP-EQUIV='Content-Type'/>
<META NAME="Author" CONTENT="Dr. Girish Nath Jha">
<META NAME="Keywords" CONTENT="Dr. Girish Nath Jha, Sachin, Diwakar Mishra, Sanskrit Computational Linguistics, Sanskrit informatics, Sanskrit computing, Sanskrit language processing, Sanskrit and computer, computer processing of sanskrit, subanta, tinanta, POS tagger, tagset, Indian languages, linguistics, amarakosha, amarakosa, Indian tradition, Indian heritage, Machine translation, AI, MT divergence, Sandhi, kridanta, taddhita, e-learning, corpus, etext, e-text, Sanskrit blog, Panini, Bhartrhari, Bhartrihari, Patanjali, karaka, mahabharata, ashtadhyayi, astadhyayi, indexer, indexing, lexical resources, Sanskrit, thesaurus, samasa, gender analysis in Sanskrit, Hindi, saHiT, language technology, NLP">
<META NAME="Description" CONTENT="Dr. Girish Nath Jha, Sachin, Diwakar Mishra, Sanskrit Computational Linguistics, Sanskrit informatics, Sanskrit computing, Sanskrit language processing, Sanskrit and computer, computer processing of sanskrit, subanta, tinanta, POS tagger, tagset, Indian languages, linguistics, amarakosha, amarakosa, Indian tradition, Indian heritage, Machine translation, AI, MT divergence, Sandhi, kridanta, taddhita, e-learning, corpus, etext, e-text, Sanskrit blog, Panini, Bhartrhari, Bhartrihari, Patanjali, karaka, mahabharata, ashtadhyayi, astadhyayi, indexer, indexing, lexical resources, Sanskrit, thesaurus, samasa, gender analysis in Sanskrit, Hindi, saHiT, language technology, NLP">
<head>
<head>
<style>
<!--
div.Section1
{page:Section1;}
-->
</style>
<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<script language="JavaScript" src=../js/menuitems.js></script>
<script language="JavaScript" src="../js/mm_menu.js"></script>
<meta name=Author content="Dr. Girish Nath Jha, JNU, New Delhi">
</head>
<body lang=EN-US link=blue vlink=blue style='tab-interval:.5in'>
<div class=Section1>
<div align=center>
<table border=1 cellspacing=0 cellpadding=0 width=802 style='width:601.5pt;
border-collapse:collapse;border:none;mso-border-alt:outset navy .75pt'>
<tr>
<td width=800 style='width:600.0pt;border:inset navy .75pt;padding:.75pt .75pt .75pt .75pt'>
<script language="JavaScript1.2">mmLoadMenus();</script>
<img width=800 height=130 id="_x0000_i1028" src="../images/header1.jpg"
border=0>
</td>
</tr>
<tr>
<td width=818 style='width:613.5pt;border:inset navy .75pt;border-top:none;
mso-border-top-alt:inset navy .75pt;padding:.75pt .75pt .75pt .75pt'>
<p align="center"><a href="../"><span style='text-decoration:none;text-underline:
none'><img border=1 width=49 height=26 id="_x0000_i1037"
src="../images/backtohome.jpg"></span></a><span style='text-underline:
none'> </span><a href="javascript:;"
onmouseover="MM_showMenu(window.mm_menu_0821171051_0,6,29,null,'image2')"
onmouseout="MM_startTimeout();"><span style='text-decoration:none;text-underline:
none'><img border=1 id=image2 src="../images/lang_tool.jpg"
name=image2 width="192" height="25"></span></a><span style='text-underline:
none'> </span><a href="javascript:;"
onmouseover="MM_showMenu(window.mm_menu_0821171909_0,6,29,null,'image3')"
onmouseout="MM_startTimeout();"><span style='text-decoration:none;text-underline:
none'><img border=1 id=image3 src="../images/lexical.jpg"
name=image3 width="137" height="25"></span></a><span style='text-underline:
none'> </span><a href="javascript:;"
onmouseover="MM_showMenu(window.mm_menu_0821171609_0,6,29,null,'image1')"
onmouseout="MM_startTimeout();"><span style='text-decoration:none;text-underline:
none'><img border=1 id=image1 src="../images/elearning.jpg"
name=image1 width="77" height="25"></span></a><span style='text-underline:
none'> </span><a href="javascript:;"
onmouseover="MM_showMenu(window.mm_menu_0821171809_0,6,29,null,'image4')"
onmouseout="MM_startTimeout();"><span style='text-decoration:none;text-underline:
none'><img border=1 id=image4 src="../images/corpora.jpg"
name=image4 width="105" height="26"></span></a><span style='text-underline:
none'> </span><a href="javascript:;"
onmouseover="MM_showMenu(window.mm_menu_0821171709_0,6,29,null,'image5')"
onmouseout="MM_startTimeout();"><span style='text-decoration:none;text-underline:
none'><img border=1 id=image5 src="../images/rstudents.jpg"
name=image5 width="125" height="26"></span></a><span style='text-underline:
none'> </span>
<a href="javascript:;"
onmouseover="MM_showMenu(window.mm_menu_0821171409_0,6,29,null,'image6')"
onmouseout="MM_startTimeout();"><span style='text-decoration:none;text-underline:
none'><img border=1 id=image6 src="../images/feedback.jpg"
name=image6 width="80" height="25"></span></a><span style='text-underline:
none'> </span>
<!---
<a href="../user/feedback.jsp"><img border="1" src="../images/feedback.jpg" width="80" height="25"></a>
--->
</td>
</tr>
<tr>
<td width="800">
<p align="center"><font color="#FF9933"><span style='font-size:18.0pt;
'><b>Sanskrit Sandhi Recognizer and Analyzer</b></span></font></p>
The Sanskrit sandhi splitter (VOWEL SANDHI) was developed as part of M.Phil. research by <a href="mailto:sachin.jnu@gmail.com">Sachin Kumar</a> (M.Phil. 2005-2007), and <a href=mailto:diwakarmishra@gmail.com>Diwakar Mishra</a> (M.Phil. 2007-2009) under the supervision of <a href=http://www.jnu.ac.in/faculty/gnjha>Dr. Girish Nath Jha</a>. The coding for this application has been done by Dr. Girish Nath Jha and Diwakar Mishra. <!---Please send feedback to to <a href="mailto:girishj@mail.jnu.ac.in">Dr. Girish Nath Jha</A>--->The Devanagari input mechanism has been developed in Javascript by Satyendra Kumar Chaube, Dr. Girish Nath Jha and Dharm Singh Rathore.
</center>
<table border=0 width=100%>
<tr>
<td valign=top width=48%>
<table>
<tr>
<td>
<FORM METHOD=get ACTION=viccheda.jsp#results name="iform" accept-Charset="UTF-8">
<font size=2><b>Enter Sanskrit text for sandhi processing (संधि-विच्छेद हेतु पाठ्य दें)
using adjacent keyboard OR Use our inbuilt <a href=../js/itrans.html target=_blank>iTRANS</a>-Devanagari unicode converter for fast typing<br>
<a href=sandhitest.txt>examples</a>
<TEXTAREA name=itext COLS=40 ROWS=9 onkeypress=checkKeycode(event) onkeyup=iu()> स शाब्द शाब्द इति</TEXTAREA>
</td>
</tr>
<tr>
<td>
<font color=red size=2>Run in debug mode</font>
<input type=checkbox name="debug" value="ON">
<br>
<input type=submit value="Click to sandhi-split (संधि-विच्छेद करें)"></span><br>
</td>
</tr>
</table>
</td>
<td valign=top width=52%>
<table>
<tr>
<td>
<head>
<SCRIPT language=JavaScript src="../js/devkb.js"></SCRIPT>
<head>
<TEXTAREA name=itrans rows=5 cols=10 style="display:none"></TEXTAREA>
<INPUT name=lastChar type=hidden>
<table border=2 style="background-color:#fff;">
<tbody>
<tr >
<td>
<input type=button name="btn" style="width: 24px" value="अ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="आ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="इ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ई" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="उ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ऊ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ए" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ऐ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ओ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="औ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="अं" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="अः" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ऍ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ऑ" onClick="keyboard(this.value)">
</td>
</tr>
<tr>
<td>
<input type=button name="btn" style="width: 24px" value="्" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ा" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ि" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ी" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ु" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ू" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="े" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ै" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ो" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ौ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ं" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ः" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ॅ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ॉ" onClick="keyboard(this.value)">
</td>
</tr>
<tr>
<td>
<input type=button name="btn" style="width: 24px" value="क" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ख" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ग" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="घ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ङ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="च" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="छ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ज" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="झ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ञ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 100px" value="Backspace" onClick="BackSpace()">
</td>
</tr>
<tr>
<td>
<input type=button name="btn" style="width: 24px" value="+" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ट" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ठ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ड" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ढ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ण" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="">
<input type=button name="btn" style="width: 24px" value="">
<input type=button name="btn" style="width: 24px" value="">
<input type=button name="btn" style="width: 24px" value="त" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="थ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="द" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ध" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="न" onClick="keyboard(this.value)">
</td>
</tr>
<tr>
<td>
<input type=button name="btn" style="width: 24px" value="/" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="प" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="फ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ब" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="भ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="म" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="">
<input type=button name="btn" style="width: 24px" value="">
<input type=button name="btn" style="width: 24px" value="">
<input type=button name="btn" style="width: 24px" value="य" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="र" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ल" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="व" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="।" onClick="keyboard(this.value)">
</td>
</tr>
<tr>
<td>
<input type=button name="btn" style="width: 24px" value="*" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="श" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ष" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="स" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="">
<input type=button name="btn" style="width: 24px" value="ऋ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ऌ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ृ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ॄ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="">
<input type=button name="btn" style="width: 24px" value="">
<input type=button name="btn" style="width: 24px" value="ह" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="">
<input type=button name="btn" style="width: 24px" value="॥" onClick="keyboard(this.value)">
</td>
</tr>
<tr>
<td>
<input type=button name="btn" style="width: 24px" value="त्र" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ज्ञ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="क्ष" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="श्र" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 200px" value="Space Bar" onClick="Space()">
<input type=button name="btn" style="width: 24px" value="ँ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="़" onClick="keyboard(this.value)">
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
</table>
</form>
<a name=results>
<font size=4><b><u>Results</u></b></font>
<br>
स शाब्द (दीर्घसन्धि अकः सवर्णे दीर्घः)<br> शाब्द (दीर्घसन्धि अकः सवर्णे दीर्घः)<br> शाब्द (दीर्घसन्धि अकः सवर्णे दीर्घः)<br> शाब्द (दीर्घसन्धि अकः सवर्णे दीर्घः)<br> शाब्द (दीर्घसन्धि अकः सवर्णे दीर्घः)<br> शाब्द (दीर्घसन्धि अकः सवर्णे दीर्घः)<br> शाब्द (दीर्घसन्धि अकः सवर्णे दीर्घः)<br> शाब्द (दीर्घसन्धि अकः सवर्णे दीर्घः)<br>
<br>
<font color=red>
<br>
<hr>
<br>
</body>
</html>
| sanskritiitd/sanskrit | uohCorpus.fil/uoh/uoh.filteredcorpus.txt_output/manjusa-ext.txt.out.dict_8717_jnu.html | HTML | gpl-3.0 | 17,385 |
{-# OPTIONS_GHC -fno-warn-warnings-deprecations #-}
-- | Inquiry to Nirum version.
module Nirum.Version (version, versionString, versionText) where
import Data.Maybe (mapMaybe)
import Data.Version (versionBranch, versionTags)
import qualified Data.SemVer as SV
import Data.Text (Text, pack)
import qualified Paths_nirum as P
-- Special module provided by Cabal
-- See also: http://stackoverflow.com/a/2892624/383405
-- | The semantic version of the running Nirum.
version :: SV.Version
version = case branch of
[major, minor, patch] ->
if length relTags == length tags
then SV.version major minor patch relTags []
else error ("invalid release identifiers: " ++ show relTags)
[_, _] -> error ("patch version is missing: " ++ show branch)
[_] -> error ("minor version is missing: " ++ show branch)
[] -> error "major version is missing"
_ -> error ("too precise version for semver: " ++ show branch)
where
branch :: [Int]
branch = versionBranch P.version
tags :: [String]
tags = versionTags P.version
relTags :: [SV.Identifier]
relTags = mapMaybe (SV.textual . pack) tags
-- | The string representation of 'version'.
versionString :: String
versionString = SV.toString version
-- | The text representation of 'version'.
versionText :: Text
versionText = SV.toText version
| spoqa/nirum | src/Nirum/Version.hs | Haskell | gpl-3.0 | 1,346 |
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'selectall', 'nb', {
toolbar: 'Merk alt'
} );
| vanpouckesven/cosnics | src/Chamilo/Libraries/Resources/Javascript/HtmlEditor/Ckeditor/src/plugins/selectall/lang/nb.js | JavaScript | gpl-3.0 | 226 |
---
- (en/topics/understand-4-digisec/2-passwords/1-1-intro.md): Learn how to create strong passphrases
- (en/topics/understand-2-security/1-your-security/1-1-intro.md): Understanding your security
- (en/topics/understand-4-digisec/0-getting-started/1-1-intro.md): Digital security basics
---
See also:
- Tactical Technology Collective: [Security in a Box](https://securityinabox.org/en/guide/veracrypt-new/windows)
| iilab/openmentoring | en/topics/tool-41-veracrypt/0-get-started/5-next.md | Markdown | gpl-3.0 | 416 |
#-*- coding: utf-8 -*-
#+---------------------------------------------------------------------------+
#| 01001110 01100101 01110100 01111010 01101111 01100010 |
#| |
#| Netzob : Inferring communication protocols |
#+---------------------------------------------------------------------------+
#| Copyright (C) 2011-2017 Georges Bossert and Frédéric Guihéry |
#| This program is free software: you can redistribute it and/or modify |
#| it under the terms of the GNU General Public License as published by |
#| the Free Software Foundation, either version 3 of the License, or |
#| (at your option) any later version. |
#| |
#| This program is distributed in the hope that it will be useful, |
#| but WITHOUT ANY WARRANTY; without even the implied warranty of |
#| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
#| GNU General Public License for more details. |
#| |
#| You should have received a copy of the GNU General Public License |
#| along with this program. If not, see <http://www.gnu.org/licenses/>. |
#+---------------------------------------------------------------------------+
#| @url : http://www.netzob.org |
#| @contact : contact@netzob.org |
#| @sponsors : Amossys, http://www.amossys.fr |
#| Supélec, http://www.rennes.supelec.fr/ren/rd/cidre/ |
#+---------------------------------------------------------------------------+
#+---------------------------------------------------------------------------+
#| File contributors : |
#| - Georges Bossert <georges.bossert (a) supelec.fr> |
#| - Frédéric Guihéry <frederic.guihery (a) amossys.fr> |
#+---------------------------------------------------------------------------+
#+---------------------------------------------------------------------------+
#| Standard library imports |
#+---------------------------------------------------------------------------+
import uuid
#+---------------------------------------------------------------------------+
#| Related third party imports |
#+---------------------------------------------------------------------------+
#+---------------------------------------------------------------------------+
#| Local application imports |
#+---------------------------------------------------------------------------+
from netzob.Common.Utils.Decorators import NetzobLogger
from netzob.Common.Utils.Decorators import typeCheck
from netzob.Model.Vocabulary.Domain.Variables.AbstractVariable import AbstractVariable
from netzob.Model.Vocabulary.Domain.Parser.VariableParserResult import VariableParserResult
@NetzobLogger
class VariableParserPath(object):
"""This class denotes one parsing result of a variable against a specified content
"""
def __init__(self,
variableParser,
consumedData,
remainingData,
originalVariableParserPath=None):
self.name = str(uuid.uuid4())
self.consumedData = consumedData
self.remainingData = remainingData
self.variableParser = variableParser
self.memory = self.variableParser.memory.duplicate()
self.originalVariableParserPath = originalVariableParserPath
self.variableParserResults = []
if originalVariableParserPath is not None:
self.variableParserResults.extend(
originalVariableParserPath.variableParserResults)
def getValueToParse(self, variable):
"""Returns the value that is assigned to the specified variable"""
def createVariableParserResult(self, variable, parserResult, consumedData,
remainedData):
variableParserResult = VariableParserResult(variable, parserResult,
consumedData, remainedData)
if parserResult:
self._logger.debug("New parser result attached to path {0}: {1}".
format(self, variableParserResult))
self.remainingData = variableParserResult.remainedData
if self.consumedData is None:
self._logger.debug("consumed is none...")
self.consumedData = variableParserResult.consumedData
else:
self.consumedData.extend(variableParserResult.consumedData)
else:
self._logger.debug("creation of an invalid parser result.")
self.variableParserResults.append(variableParserResult)
self._logger.debug(
"After registering new VariablePathResult, Path is {0}".format(
self))
def __str__(self):
return "Path {0} (consumedData={1}, remainingData={2}".format(
self.name, self.consumedData, self.remainingData)
@property
def consumedData(self):
return self.__consumedData
@consumedData.setter
def consumedData(self, consumedData):
self.__consumedData = consumedData
@property
def memory(self):
return self.__memory
@memory.setter
def memory(self, memory):
if memory is None:
raise Exception("Memory cannot be None")
self.__memory = memory
| lootr/netzob | netzob/src/netzob/Model/Vocabulary/Domain/Parser/VariableParserPath.py | Python | gpl-3.0 | 5,916 |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qlocale.qdoc -->
<title>List of All Members for QLocale | Qt Core 5.7</title>
<link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
<script type="text/javascript">
window.onload = function(){document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");};
</script>
</head>
<body>
<div class="header" id="qtdocheader">
<div class="main">
<div class="main-rounded">
<div class="navigationbar">
<table><tr>
<td ><a href="../qtdoc/supported-platforms-and-configurations.html#qt-5-7">Qt 5.7</a></td><td ><a href="qtcore-index.html">Qt Core</a></td><td ><a href="qtcore-module.html">C++ Classes</a></td><td >QLocale</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.7.0 Reference Documentation</td>
</tr></table>
</div>
</div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar"><div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">List of All Members for QLocale</h1>
<p>This is the complete list of members for <a href="qlocale.html">QLocale</a>, including inherited members.</p>
<div class="table"><table class="propsummary">
<tr><td class="topAlign"><ul>
<li class="fn">enum <span class="name"><b><a href="qlocale.html#Country-enum">Country</a></b></span></li>
<li class="fn">enum <span class="name"><b><a href="qlocale.html#CurrencySymbolFormat-enum">CurrencySymbolFormat</a></b></span></li>
<li class="fn">enum <span class="name"><b><a href="qlocale.html#FloatingPointPrecisionOption-enum">FloatingPointPrecisionOption</a></b></span></li>
<li class="fn">enum <span class="name"><b><a href="qlocale.html#FormatType-enum">FormatType</a></b></span></li>
<li class="fn">enum <span class="name"><b><a href="qlocale.html#Language-enum">Language</a></b></span></li>
<li class="fn">enum <span class="name"><b><a href="qlocale.html#MeasurementSystem-enum">MeasurementSystem</a></b></span></li>
<li class="fn">enum <span class="name"><b><a href="qlocale.html#NumberOption-enum">NumberOption</a></b></span></li>
<li class="fn">flags <span class="name"><b><a href="qlocale.html#NumberOption-enum">NumberOptions</a></b></span></li>
<li class="fn">enum <span class="name"><b><a href="qlocale.html#QuotationStyle-enum">QuotationStyle</a></b></span></li>
<li class="fn">enum <span class="name"><b><a href="qlocale.html#Script-enum">Script</a></b></span></li>
<li class="fn"><span class="name"><b><a href="qlocale.html#QLocale">QLocale</a></b></span>()</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#QLocale-1">QLocale</a></b></span>(const QString &)</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#QLocale-2">QLocale</a></b></span>(Language , Country )</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#QLocale-3">QLocale</a></b></span>(Language , Script , Country )</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#QLocale-4">QLocale</a></b></span>(const QLocale &)</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#dtor.QLocale">~QLocale</a></b></span>()</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#amText">amText</a></b></span>() const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#bcp47Name">bcp47Name</a></b></span>() const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#c">c</a></b></span>() : QLocale</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#country">country</a></b></span>() const : Country</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#countryToString">countryToString</a></b></span>(Country ) : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#createSeparatedList">createSeparatedList</a></b></span>(const QStringList &) const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#currencySymbol">currencySymbol</a></b></span>(CurrencySymbolFormat ) const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#dateFormat">dateFormat</a></b></span>(FormatType ) const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#dateTimeFormat">dateTimeFormat</a></b></span>(FormatType ) const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#dayName">dayName</a></b></span>(int , FormatType ) const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#decimalPoint">decimalPoint</a></b></span>() const : QChar</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#exponential">exponential</a></b></span>() const : QChar</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#firstDayOfWeek">firstDayOfWeek</a></b></span>() const : Qt::DayOfWeek</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#groupSeparator">groupSeparator</a></b></span>() const : QChar</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#language">language</a></b></span>() const : Language</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#languageToString">languageToString</a></b></span>(Language ) : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#matchingLocales">matchingLocales</a></b></span>(QLocale::Language , QLocale::Script , QLocale::Country ) : QList<QLocale></li>
<li class="fn"><span class="name"><b><a href="qlocale.html#measurementSystem">measurementSystem</a></b></span>() const : MeasurementSystem</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#monthName">monthName</a></b></span>(int , FormatType ) const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#name">name</a></b></span>() const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#nativeCountryName">nativeCountryName</a></b></span>() const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#nativeLanguageName">nativeLanguageName</a></b></span>() const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#negativeSign">negativeSign</a></b></span>() const : QChar</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#numberOptions">numberOptions</a></b></span>() const : NumberOptions</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#percent">percent</a></b></span>() const : QChar</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#pmText">pmText</a></b></span>() const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#positiveSign">positiveSign</a></b></span>() const : QChar</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#quoteString">quoteString</a></b></span>(const QString &, QuotationStyle ) const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#quoteString-1">quoteString</a></b></span>(const QStringRef &, QuotationStyle ) const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#script">script</a></b></span>() const : Script</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#scriptToString">scriptToString</a></b></span>(Script ) : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#setDefault">setDefault</a></b></span>(const QLocale &)</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#setNumberOptions">setNumberOptions</a></b></span>(NumberOptions )</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#standaloneDayName">standaloneDayName</a></b></span>(int , FormatType ) const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#standaloneMonthName">standaloneMonthName</a></b></span>(int , FormatType ) const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#swap">swap</a></b></span>(QLocale &)</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#system">system</a></b></span>() : QLocale</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#textDirection">textDirection</a></b></span>() const : Qt::LayoutDirection</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#timeFormat">timeFormat</a></b></span>(FormatType ) const : QString</li>
</ul></td><td class="topAlign"><ul>
<li class="fn"><span class="name"><b><a href="qlocale.html#toCurrencyString">toCurrencyString</a></b></span>(qlonglong , const QString &) const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toCurrencyString-1">toCurrencyString</a></b></span>(qulonglong , const QString &) const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toCurrencyString-2">toCurrencyString</a></b></span>(short , const QString &) const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toCurrencyString-3">toCurrencyString</a></b></span>(ushort , const QString &) const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toCurrencyString-4">toCurrencyString</a></b></span>(int , const QString &) const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toCurrencyString-5">toCurrencyString</a></b></span>(uint , const QString &) const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toCurrencyString-6">toCurrencyString</a></b></span>(double , const QString &) const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toCurrencyString-7">toCurrencyString</a></b></span>(double , const QString &, int ) const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toCurrencyString-8">toCurrencyString</a></b></span>(float , const QString &) const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toCurrencyString-9">toCurrencyString</a></b></span>(float , const QString &, int ) const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toDate">toDate</a></b></span>(const QString &, FormatType ) const : QDate</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toDate-1">toDate</a></b></span>(const QString &, const QString &) const : QDate</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toDateTime">toDateTime</a></b></span>(const QString &, FormatType ) const : QDateTime</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toDateTime-1">toDateTime</a></b></span>(const QString &, const QString &) const : QDateTime</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toDouble">toDouble</a></b></span>(const QString &, bool *) const : double</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toDouble-1">toDouble</a></b></span>(const QStringRef &, bool *) const : double</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toFloat">toFloat</a></b></span>(const QString &, bool *) const : float</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toFloat-1">toFloat</a></b></span>(const QStringRef &, bool *) const : float</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toInt">toInt</a></b></span>(const QString &, bool *) const : int</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toInt-1">toInt</a></b></span>(const QStringRef &, bool *) const : int</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toLongLong">toLongLong</a></b></span>(const QString &, bool *) const : qlonglong</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toLongLong-1">toLongLong</a></b></span>(const QStringRef &, bool *) const : qlonglong</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toLower">toLower</a></b></span>(const QString &) const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toShort">toShort</a></b></span>(const QString &, bool *) const : short</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toShort-1">toShort</a></b></span>(const QStringRef &, bool *) const : short</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toString">toString</a></b></span>(qlonglong ) const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toString-1">toString</a></b></span>(qulonglong ) const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toString-2">toString</a></b></span>(short ) const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toString-3">toString</a></b></span>(ushort ) const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toString-4">toString</a></b></span>(int ) const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toString-5">toString</a></b></span>(uint ) const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toString-6">toString</a></b></span>(double , char , int ) const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toString-7">toString</a></b></span>(float , char , int ) const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toString-8">toString</a></b></span>(const QDate &, const QString &) const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toString-9">toString</a></b></span>(const QDate &, FormatType ) const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toString-10">toString</a></b></span>(const QTime &, const QString &) const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toString-11">toString</a></b></span>(const QTime &, FormatType ) const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toString-12">toString</a></b></span>(const QDateTime &, FormatType ) const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toString-13">toString</a></b></span>(const QDateTime &, const QString &) const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toTime">toTime</a></b></span>(const QString &, FormatType ) const : QTime</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toTime-1">toTime</a></b></span>(const QString &, const QString &) const : QTime</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toUInt">toUInt</a></b></span>(const QString &, bool *) const : uint</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toUInt-1">toUInt</a></b></span>(const QStringRef &, bool *) const : uint</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toULongLong">toULongLong</a></b></span>(const QString &, bool *) const : qulonglong</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toULongLong-1">toULongLong</a></b></span>(const QStringRef &, bool *) const : qulonglong</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toUShort">toUShort</a></b></span>(const QString &, bool *) const : ushort</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toUShort-1">toUShort</a></b></span>(const QStringRef &, bool *) const : ushort</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#toUpper">toUpper</a></b></span>(const QString &) const : QString</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#uiLanguages">uiLanguages</a></b></span>() const : QStringList</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#weekdays">weekdays</a></b></span>() const : QList<Qt::DayOfWeek></li>
<li class="fn"><span class="name"><b><a href="qlocale.html#zeroDigit">zeroDigit</a></b></span>() const : QChar</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#operator-not-eq">operator!=</a></b></span>(const QLocale &) const : bool</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#operator-eq">operator=</a></b></span>(QLocale &&) : QLocale &</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#operator-eq-1">operator=</a></b></span>(const QLocale &) : QLocale &</li>
<li class="fn"><span class="name"><b><a href="qlocale.html#operator-eq-eq">operator==</a></b></span>(const QLocale &) const : bool</li>
</ul>
</td></tr>
</table></div>
</div>
</div>
</div>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2016 The Qt Company Ltd.
Documentation contributions included herein are the copyrights of
their respective owners.<br> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.<br> Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. </p>
</div>
</body>
</html>
| angeloprudentino/QtNets | Doc/qtcore/qlocale-members.html | HTML | gpl-3.0 | 17,139 |
<a id="search" class="scrollto" href="#" bs-popover data-container="body" data-placement="bottom" data-template="/static/main_actions/html/search_form.html" data-auto-close='true'><i class="fa fa-search"></i></a>
| giovaneliberato/dossiebr | src/static/main_actions/html/search.html | HTML | gpl-3.0 | 216 |
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.cts.tv.hostside;
import android.content.Context;
import android.media.tv.TvInputService;
import android.net.Uri;
import android.view.Surface;
/**
* Stub implementation of (@link android.media.tv.TvInputService}.
*/
public class StubTvInputService extends TvInputService {
@Override
public Session onCreateSession(String inputId) {
return new StubSessionImpl(this);
}
private static class StubSessionImpl extends Session {
StubSessionImpl(Context context) {
super(context);
}
@Override
public void onRelease() {
}
@Override
public boolean onSetSurface(Surface surface) {
return false;
}
@Override
public void onSetStreamVolume(float volume) {
}
@Override
public boolean onTune(Uri channelUri) {
return false;
}
@Override
public void onSetCaptionEnabled(boolean enabled) {
}
}
}
| wiki2014/Learning-Summary | alps/cts/hostsidetests/tv/app/src/com/android/cts/tv/hostside/StubTvInputService.java | Java | gpl-3.0 | 1,628 |
/* This file is part of HSPlasma.
*
* HSPlasma is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* HSPlasma is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with HSPlasma. If not, see <http://www.gnu.org/licenses/>.
*/
#include "pfPrcHelper.h"
static plString xmlEscape(const plString& text) {
return text.replace("&", "&").replace("\"", """)
.replace("<", "<").replace(">", ">")
.replace("'", "'");
}
void pfPrcHelper::directWrite(const plString& text)
{
file->writeStr(xmlEscape(text));
}
void pfPrcHelper::writeTabbed(const char* str) {
for (int i=0; i<iLvl; i++)
file->writeStr("\t");
file->writeStr(str);
}
void pfPrcHelper::startTag(const char* name) {
if (inTag)
endTag();
char buf[256];
snprintf(buf, 256, "<%s", name);
writeTabbed(buf);
openTags.push(name);
inTag = true;
}
void pfPrcHelper::writeParam(const char* name, const char* value) {
plString buf = plString::Format(" %s=\"%s\"", name, xmlEscape(value).cstr());
file->writeStr(buf.cstr());
}
void pfPrcHelper::writeParam(const char* name, int value) {
char buf[256];
snprintf(buf, 256, " %s=\"%d\"", name, value);
file->writeStr(buf);
}
void pfPrcHelper::writeParam(const char* name, long value) {
char buf[256];
snprintf(buf, 256, " %s=\"%ld\"", name, value);
file->writeStr(buf);
}
void pfPrcHelper::writeParam(const char* name, unsigned int value) {
char buf[256];
snprintf(buf, 256, " %s=\"%u\"", name, value);
file->writeStr(buf);
}
void pfPrcHelper::writeParam(const char* name, unsigned long value) {
char buf[256];
snprintf(buf, 256, " %s=\"%lu\"", name, value);
file->writeStr(buf);
}
void pfPrcHelper::writeParam(const char* name, float value) {
writeParam(name, (double)value);
}
void pfPrcHelper::writeParam(const char* name, double value) {
char buf[256];
snprintf(buf, 256, " %s=\"%.10g\"", name, value);
file->writeStr(buf);
}
void pfPrcHelper::writeParam(const char* name, bool value) {
char buf[256];
snprintf(buf, 256, " %s=\"%s\"", name, value ? "True" : "False");
file->writeStr(buf);
}
void pfPrcHelper::writeParamHex(const char* name, unsigned char value) {
char buf[256];
// %hhX is non-standard:
unsigned short pval = (unsigned short)value;
snprintf(buf, 256, " %s=\"0x%02hX\"", name, pval);
file->writeStr(buf);
}
void pfPrcHelper::writeParamHex(const char* name, unsigned short value) {
char buf[256];
snprintf(buf, 256, " %s=\"0x%04hX\"", name, value);
file->writeStr(buf);
}
void pfPrcHelper::writeParamHex(const char* name, unsigned int value) {
char buf[256];
snprintf(buf, 256, " %s=\"0x%08X\"", name, value);
file->writeStr(buf);
}
void pfPrcHelper::writeParamHex(const char* name, unsigned long value) {
char buf[256];
snprintf(buf, 256, " %s=\"0x%08lX\"", name, value);
file->writeStr(buf);
}
void pfPrcHelper::endTag(bool isShort) {
const char* buf = isShort ? " />\n" : ">\n";
file->writeStr(buf);
if (!isShort)
iLvl++;
else
openTags.pop();
inTag = false;
}
void pfPrcHelper::endTagNoBreak() {
file->writeStr(">");
iLvl++;
inTag = false;
}
void pfPrcHelper::writeSimpleTag(const char* name, bool isShort) {
startTag(name);
endTag(isShort);
}
void pfPrcHelper::writeTagNoBreak(const char* name) {
startTag(name);
endTagNoBreak();
}
void pfPrcHelper::closeTag() {
char buf[256];
iLvl--;
snprintf(buf, 256, "</%s>\n", openTags.top());
openTags.pop();
writeTabbed(buf);
}
void pfPrcHelper::closeTagNoBreak() {
char buf[256];
iLvl--;
snprintf(buf, 256, "</%s>\n", openTags.top());
openTags.pop();
file->writeStr(buf);
}
void pfPrcHelper::writeComment(const char* comment) {
writeTabbed("<!-- ");
file->writeStr(comment);
file->writeStr(" -->\n");
}
void pfPrcHelper::startPrc() {
file->writeStr("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n");
}
void pfPrcHelper::finalize() {
if (inTag) endTag();
while (!openTags.empty())
closeTag();
}
static bool goodChar(unsigned char ch) {
return (ch >= 0x20) && (ch < 0x7F)
&& (ch != (unsigned char)'<') && (ch != (unsigned char)'>');
}
void pfPrcHelper::writeHexStream(size_t length, const unsigned char* data) {
// Remember that the comments need to remain valid UTF-8, so only characters
// between 0x20 and 0x7F can be displayed...
size_t i;
for (i=0; i<(length / 16); i++) {
const unsigned char* ln = &data[i * 16];
file->writeStr(
plString::Format("%02X %02X %02X %02X %02X %02X %02X %02X "
"%02X %02X %02X %02X %02X %02X %02X %02X ",
ln[0x0], ln[0x1], ln[0x2], ln[0x3], ln[0x4], ln[0x5], ln[0x6], ln[0x7],
ln[0x8], ln[0x9], ln[0xA], ln[0xB], ln[0xC], ln[0xD], ln[0xE], ln[0xF]
));
file->writeStr(
plString::Format(" <!-- %c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c -->\n",
goodChar(ln[0x0]) ? ln[0x0] : '.',
goodChar(ln[0x1]) ? ln[0x1] : '.',
goodChar(ln[0x2]) ? ln[0x2] : '.',
goodChar(ln[0x3]) ? ln[0x3] : '.',
goodChar(ln[0x4]) ? ln[0x4] : '.',
goodChar(ln[0x5]) ? ln[0x5] : '.',
goodChar(ln[0x6]) ? ln[0x6] : '.',
goodChar(ln[0x7]) ? ln[0x7] : '.',
goodChar(ln[0x8]) ? ln[0x8] : '.',
goodChar(ln[0x9]) ? ln[0x9] : '.',
goodChar(ln[0xA]) ? ln[0xA] : '.',
goodChar(ln[0xB]) ? ln[0xB] : '.',
goodChar(ln[0xC]) ? ln[0xC] : '.',
goodChar(ln[0xD]) ? ln[0xD] : '.',
goodChar(ln[0xE]) ? ln[0xE] : '.',
goodChar(ln[0xF]) ? ln[0xF] : '.'
));
}
if ((length % 16) != 0) {
const unsigned char* ln = &data[(length / 16) * 16];
for (i=0; i<(length % 16); i++)
file->writeStr(plString::Format("%02X ", ln[i]));
for (; i<16; i++)
file->writeStr(" ");
file->writeStr(" <!-- ");
for (i=0; i<(length % 16); i++)
file->writeStr(
plString::Format("%c", goodChar(ln[i]) ? ln[i] : '.'));
for (; i<16; i++)
file->writeStr(" ");
file->writeStr(" -->\n");
}
}
| NadnerbD/libhsplasma | core/Stream/pfPrcHelper.cpp | C++ | gpl-3.0 | 7,166 |
# Copyright (C) 2010-2012, InSTEDD
#
# This file is part of Verboice.
#
# Verboice is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Verboice is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Verboice. If not, see <http://www.gnu.org/licenses/>.
module HttpBroker
class SessionStore
include Singleton
Timeout = 5 * 60
def initialize
@sessions = {}
@timers = {}
end
def session_for(key)
renew_em_timer(key)
@sessions[key] ||= HttpBroker::Session.new
end
private
def renew_em_timer(key)
current_timer = @timers[key]
EM.cancel_timer(current_timer) if current_timer
@timers[key] = EM.add_timer Timeout do
@timers.delete key
fiber = @sessions.delete(key).try(:get_fiber)
fiber.resume(Exception.new("Session timeout")) if fiber
end
end
end
class Session
def initialize
@session = {}
@fiber = nil
end
def store_fiber(fiber)
@fiber = fiber
end
def get_fiber
@fiber
end
def end!
@fiber = nil
end
def store(key, value)
@session[key] = value
end
def get(key)
@session[key]
end
end
end | channainfo/verboice | app/models/http_broker/session_store.rb | Ruby | gpl-3.0 | 1,645 |
url: http://sanskrit.jnu.ac.in/sandhi/viccheda.jsp?itext=यदेष<html>
<title>Sanskrit Sandhi Splitter at J.N.U. New Delhi</title>
<META CONTENT='text/hetml CHARSET=UTF-8' HTTP-EQUIV='Content-Type'/>
<META NAME="Author" CONTENT="Dr. Girish Nath Jha">
<META NAME="Keywords" CONTENT="Dr. Girish Nath Jha, Sachin, Diwakar Mishra, Sanskrit Computational Linguistics, Sanskrit informatics, Sanskrit computing, Sanskrit language processing, Sanskrit and computer, computer processing of sanskrit, subanta, tinanta, POS tagger, tagset, Indian languages, linguistics, amarakosha, amarakosa, Indian tradition, Indian heritage, Machine translation, AI, MT divergence, Sandhi, kridanta, taddhita, e-learning, corpus, etext, e-text, Sanskrit blog, Panini, Bhartrhari, Bhartrihari, Patanjali, karaka, mahabharata, ashtadhyayi, astadhyayi, indexer, indexing, lexical resources, Sanskrit, thesaurus, samasa, gender analysis in Sanskrit, Hindi, saHiT, language technology, NLP">
<META NAME="Description" CONTENT="Dr. Girish Nath Jha, Sachin, Diwakar Mishra, Sanskrit Computational Linguistics, Sanskrit informatics, Sanskrit computing, Sanskrit language processing, Sanskrit and computer, computer processing of sanskrit, subanta, tinanta, POS tagger, tagset, Indian languages, linguistics, amarakosha, amarakosa, Indian tradition, Indian heritage, Machine translation, AI, MT divergence, Sandhi, kridanta, taddhita, e-learning, corpus, etext, e-text, Sanskrit blog, Panini, Bhartrhari, Bhartrihari, Patanjali, karaka, mahabharata, ashtadhyayi, astadhyayi, indexer, indexing, lexical resources, Sanskrit, thesaurus, samasa, gender analysis in Sanskrit, Hindi, saHiT, language technology, NLP">
<head>
<head>
<style>
<!--
div.Section1
{page:Section1;}
-->
</style>
<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<script language="JavaScript" src=../js/menuitems.js></script>
<script language="JavaScript" src="../js/mm_menu.js"></script>
<meta name=Author content="Dr. Girish Nath Jha, JNU, New Delhi">
</head>
<body lang=EN-US link=blue vlink=blue style='tab-interval:.5in'>
<div class=Section1>
<div align=center>
<table border=1 cellspacing=0 cellpadding=0 width=802 style='width:601.5pt;
border-collapse:collapse;border:none;mso-border-alt:outset navy .75pt'>
<tr>
<td width=800 style='width:600.0pt;border:inset navy .75pt;padding:.75pt .75pt .75pt .75pt'>
<script language="JavaScript1.2">mmLoadMenus();</script>
<img width=800 height=130 id="_x0000_i1028" src="../images/header1.jpg"
border=0>
</td>
</tr>
<tr>
<td width=818 style='width:613.5pt;border:inset navy .75pt;border-top:none;
mso-border-top-alt:inset navy .75pt;padding:.75pt .75pt .75pt .75pt'>
<p align="center"><a href="../"><span style='text-decoration:none;text-underline:
none'><img border=1 width=49 height=26 id="_x0000_i1037"
src="../images/backtohome.jpg"></span></a><span style='text-underline:
none'> </span><a href="javascript:;"
onmouseover="MM_showMenu(window.mm_menu_0821171051_0,6,29,null,'image2')"
onmouseout="MM_startTimeout();"><span style='text-decoration:none;text-underline:
none'><img border=1 id=image2 src="../images/lang_tool.jpg"
name=image2 width="192" height="25"></span></a><span style='text-underline:
none'> </span><a href="javascript:;"
onmouseover="MM_showMenu(window.mm_menu_0821171909_0,6,29,null,'image3')"
onmouseout="MM_startTimeout();"><span style='text-decoration:none;text-underline:
none'><img border=1 id=image3 src="../images/lexical.jpg"
name=image3 width="137" height="25"></span></a><span style='text-underline:
none'> </span><a href="javascript:;"
onmouseover="MM_showMenu(window.mm_menu_0821171609_0,6,29,null,'image1')"
onmouseout="MM_startTimeout();"><span style='text-decoration:none;text-underline:
none'><img border=1 id=image1 src="../images/elearning.jpg"
name=image1 width="77" height="25"></span></a><span style='text-underline:
none'> </span><a href="javascript:;"
onmouseover="MM_showMenu(window.mm_menu_0821171809_0,6,29,null,'image4')"
onmouseout="MM_startTimeout();"><span style='text-decoration:none;text-underline:
none'><img border=1 id=image4 src="../images/corpora.jpg"
name=image4 width="105" height="26"></span></a><span style='text-underline:
none'> </span><a href="javascript:;"
onmouseover="MM_showMenu(window.mm_menu_0821171709_0,6,29,null,'image5')"
onmouseout="MM_startTimeout();"><span style='text-decoration:none;text-underline:
none'><img border=1 id=image5 src="../images/rstudents.jpg"
name=image5 width="125" height="26"></span></a><span style='text-underline:
none'> </span>
<a href="javascript:;"
onmouseover="MM_showMenu(window.mm_menu_0821171409_0,6,29,null,'image6')"
onmouseout="MM_startTimeout();"><span style='text-decoration:none;text-underline:
none'><img border=1 id=image6 src="../images/feedback.jpg"
name=image6 width="80" height="25"></span></a><span style='text-underline:
none'> </span>
<!---
<a href="../user/feedback.jsp"><img border="1" src="../images/feedback.jpg" width="80" height="25"></a>
--->
</td>
</tr>
<tr>
<td width="800">
<p align="center"><font color="#FF9933"><span style='font-size:18.0pt;
'><b>Sanskrit Sandhi Recognizer and Analyzer</b></span></font></p>
The Sanskrit sandhi splitter (VOWEL SANDHI) was developed as part of M.Phil. research by <a href="mailto:sachin.jnu@gmail.com">Sachin Kumar</a> (M.Phil. 2005-2007), and <a href=mailto:diwakarmishra@gmail.com>Diwakar Mishra</a> (M.Phil. 2007-2009) under the supervision of <a href=http://www.jnu.ac.in/faculty/gnjha>Dr. Girish Nath Jha</a>. The coding for this application has been done by Dr. Girish Nath Jha and Diwakar Mishra. <!---Please send feedback to to <a href="mailto:girishj@mail.jnu.ac.in">Dr. Girish Nath Jha</A>--->The Devanagari input mechanism has been developed in Javascript by Satyendra Kumar Chaube, Dr. Girish Nath Jha and Dharm Singh Rathore.
</center>
<table border=0 width=100%>
<tr>
<td valign=top width=48%>
<table>
<tr>
<td>
<FORM METHOD=get ACTION=viccheda.jsp#results name="iform" accept-Charset="UTF-8">
<font size=2><b>Enter Sanskrit text for sandhi processing (संधि-विच्छेद हेतु पाठ्य दें)
using adjacent keyboard OR Use our inbuilt <a href=../js/itrans.html target=_blank>iTRANS</a>-Devanagari unicode converter for fast typing<br>
<a href=sandhitest.txt>examples</a>
<TEXTAREA name=itext COLS=40 ROWS=9 onkeypress=checkKeycode(event) onkeyup=iu()> यदेष</TEXTAREA>
</td>
</tr>
<tr>
<td>
<font color=red size=2>Run in debug mode</font>
<input type=checkbox name="debug" value="ON">
<br>
<input type=submit value="Click to sandhi-split (संधि-विच्छेद करें)"></span><br>
</td>
</tr>
</table>
</td>
<td valign=top width=52%>
<table>
<tr>
<td>
<head>
<SCRIPT language=JavaScript src="../js/devkb.js"></SCRIPT>
<head>
<TEXTAREA name=itrans rows=5 cols=10 style="display:none"></TEXTAREA>
<INPUT name=lastChar type=hidden>
<table border=2 style="background-color:#fff;">
<tbody>
<tr >
<td>
<input type=button name="btn" style="width: 24px" value="अ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="आ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="इ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ई" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="उ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ऊ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ए" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ऐ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ओ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="औ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="अं" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="अः" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ऍ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ऑ" onClick="keyboard(this.value)">
</td>
</tr>
<tr>
<td>
<input type=button name="btn" style="width: 24px" value="्" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ा" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ि" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ी" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ु" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ू" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="े" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ै" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ो" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ौ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ं" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ः" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ॅ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ॉ" onClick="keyboard(this.value)">
</td>
</tr>
<tr>
<td>
<input type=button name="btn" style="width: 24px" value="क" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ख" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ग" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="घ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ङ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="च" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="छ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ज" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="झ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ञ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 100px" value="Backspace" onClick="BackSpace()">
</td>
</tr>
<tr>
<td>
<input type=button name="btn" style="width: 24px" value="+" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ट" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ठ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ड" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ढ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ण" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="">
<input type=button name="btn" style="width: 24px" value="">
<input type=button name="btn" style="width: 24px" value="">
<input type=button name="btn" style="width: 24px" value="त" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="थ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="द" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ध" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="न" onClick="keyboard(this.value)">
</td>
</tr>
<tr>
<td>
<input type=button name="btn" style="width: 24px" value="/" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="प" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="फ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ब" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="भ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="म" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="">
<input type=button name="btn" style="width: 24px" value="">
<input type=button name="btn" style="width: 24px" value="">
<input type=button name="btn" style="width: 24px" value="य" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="र" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ल" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="व" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="।" onClick="keyboard(this.value)">
</td>
</tr>
<tr>
<td>
<input type=button name="btn" style="width: 24px" value="*" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="श" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ष" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="स" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="">
<input type=button name="btn" style="width: 24px" value="ऋ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ऌ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ृ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ॄ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="">
<input type=button name="btn" style="width: 24px" value="">
<input type=button name="btn" style="width: 24px" value="ह" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="">
<input type=button name="btn" style="width: 24px" value="॥" onClick="keyboard(this.value)">
</td>
</tr>
<tr>
<td>
<input type=button name="btn" style="width: 24px" value="त्र" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="ज्ञ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="क्ष" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="श्र" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 200px" value="Space Bar" onClick="Space()">
<input type=button name="btn" style="width: 24px" value="ँ" onClick="keyboard(this.value)">
<input type=button name="btn" style="width: 24px" value="़" onClick="keyboard(this.value)">
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
</table>
</form>
<a name=results>
<font size=4><b><u>Results</u></b></font>
<br>
यद ईष (गुणसन्धि आद् गुणः)<br> यदा ईष (गुणसन्धि आद् गुणः)<br> यद इष (गुणसन्धि आद् गुणः)<br> यद एष (पररूपसन्धि एङि पररूपम्/ओमाङोश्च)<br> यदा एष (पररूपसन्धि एङि पररूपम्/ओमाङोश्च)<br>
<br>
<font color=red>
<br>
<hr>
<br>
</body>
</html>
| sanskritiitd/sanskrit | uohCorpus.fil/uoh/uoh.filteredcorpus.txt_output/Aakhyanvallari_ext.txt.out.dict_1295_jnu.html | HTML | gpl-3.0 | 16,931 |
#/*
Unix SMB/CIFS implementation.
routines for marshalling/unmarshalling special netlogon types
Copyright (C) Andrew Tridgell 2005
Copyright (C) Andrew Bartlett <abartlet@samba.org> 2008
Copyright (C) Guenther Deschner 2011
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* The following definitions come from ../librpc/ndr/ndr_nbt.c */
#ifndef _LIBRPC_NDR_NDR_NBT_H
#define _LIBRPC_NDR_NDR_NBT_H
#include "librpc/gen_ndr/nbt.h"
NDR_SCALAR_PROTO(nbt_string, const char *)
enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_REQUEST(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_SAM_LOGON_REQUEST *r);
enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_REQUEST(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_SAM_LOGON_REQUEST *r);
enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_RESPONSE_EX_with_flags(struct ndr_push *ndr, int ndr_flags, const struct NETLOGON_SAM_LOGON_RESPONSE_EX *r);
enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_RESPONSE_EX_with_flags(struct ndr_pull *ndr, int ndr_flags, struct NETLOGON_SAM_LOGON_RESPONSE_EX *r,
uint32_t nt_version_flags);
enum ndr_err_code ndr_push_netlogon_samlogon_response(struct ndr_push *ndr, int ndr_flags, const struct netlogon_samlogon_response *r);
enum ndr_err_code ndr_pull_netlogon_samlogon_response(struct ndr_pull *ndr, int ndr_flags, struct netlogon_samlogon_response *r);
void ndr_print_netlogon_samlogon_response(struct ndr_print *ndr, const char *name, struct netlogon_samlogon_response *r);
#endif /* _LIBRPC_NDR_NDR_NBT_H */
| kernevil/samba | librpc/ndr/ndr_nbt.h | C | gpl-3.0 | 2,128 |
/*
* tscomp-ja - Converts a TSC file into bytecode usable by CSMD
*
* Compile:
* gcc tscomp-ja.c -o tscomp-ja
*
* Usage:
* ./tscomp-ja [-t] <tsc file[s ...]> <kanji list file>
*/
#include <ctype.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX_EVENTS 106
#define COMMAND_COUNT 93
// Chars starting with 0xE0-0xFE are a 2 byte sequence
#define MULTIBYTE_BEGIN 0xE0
#define MULTIBYTE_END 0xFE
#define SYM_EVENT '#'
#define SYM_COMMENT '-'
#define SYM_COMMAND '<'
#define SYM_PARAM_SEP ':'
#define LEN_COMMAND 3
#define LEN_NUMBER 4
#define CFLAG_MSGOPEN 0x01
#define CFLAG_MSGCLOSE 0x02
#define CFLAG_JUMP 0x04
#define CFLAG_END 0x08
#define OP_EVENT 0xFFFF
enum {
CT_COMMAND,
CT_EVENT,
CT_ASCII,
CT_KANJI,
CT_SKIP,
CT_SKIP2BYTE,
CT_INVALID,
CT_INVALID2BYTE,
};
// TSC Command Definition
typedef struct {
char name[4]; // All commands are 3 uppercase characters
unsigned char opcode; // Byte value that represents the instruction
unsigned char params; // Number of parameters 0-4
unsigned short flags; // Other properties of the instruction
} CommandDef;
const CommandDef command_table[COMMAND_COUNT] = {
// Message Related
{ "MSG", 0x80, 0, CFLAG_MSGOPEN },
{ "MS2", 0x81, 0, CFLAG_MSGOPEN },
{ "MS3", 0x82, 0, CFLAG_MSGOPEN },
{ "CLO", 0x83, 0, CFLAG_MSGCLOSE },
{ "CLR", 0x84, 0, CFLAG_MSGOPEN },
{ "NUM", 0x85, 1, CFLAG_MSGOPEN },
{ "GIT", 0x86, 1, CFLAG_MSGOPEN },
{ "FAC", 0x87, 1, CFLAG_MSGOPEN },
{ "CAT", 0x88, 0, 0 },
{ "SAT", 0x89, 0, 0 },
{ "TUR", 0x8A, 0, 0 },
{ "YNJ", 0x8B, 1, CFLAG_JUMP },
// Commands that are at the end of an event block
{ "END", 0x8C, 0, CFLAG_MSGCLOSE | CFLAG_END },
{ "EVE", 0x8D, 1, CFLAG_MSGCLOSE | CFLAG_JUMP | CFLAG_END },
{ "TRA", 0x8E, 4, CFLAG_MSGCLOSE | CFLAG_END },
{ "INI", 0x8F, 0, CFLAG_MSGCLOSE | CFLAG_END },
{ "LDP", 0x90, 0, CFLAG_MSGCLOSE | CFLAG_END },
{ "ESC", 0x91, 0, CFLAG_MSGCLOSE | CFLAG_END },
// Music / Sound (18-25)
{ "CMU", 0x92, 1, 0 }, // Change music
{ "FMU", 0x93, 0, 0 }, // Fade music
{ "RMU", 0x94, 0, 0 }, // Resume music
{ "SOU", 0x95, 1, 0 }, // Play a sound
{ "SPS", 0x96, 0, 0 }, // Start the propeller sound
{ "CPS", 0x97, 0, 0 }, // Stop the propeller sound
{ "SSS", 0x98, 1, 0 }, // Start the stream sound
{ "CSS", 0x99, 0, 0 }, // Stop the stream sound
// Wait Commands
{ "NOD", 0x9A, 0, 0 }, // Wait for player input before resuming
{ "WAI", 0x9B, 1, 0 }, // Wait an amount of time
{ "WAS", 0x9C, 0, 0 }, // Wait for player to be on the ground
// Player Control
{ "MM0", 0x9D, 0, 0 }, // Stop player movement
{ "MOV", 0x9E, 2, 0 }, // Move the player
{ "MYB", 0x9F, 1, 0 }, // Makes the player hop (0x20)
{ "MYD", 0xA0, 1, 0 }, // Set player direction
{ "UNI", 0xA1, 1, 0 }, // Change movement type
{ "UNJ", 0xA2, 2, CFLAG_JUMP }, // Jump on movement type
{ "KEY", 0xA3, 0, 0 }, // Lock player controls and hide HUD
{ "PRI", 0xA4, 0, 0 }, // Lock player controls until KEY or END
{ "FRE", 0xA5, 0, 0 }, // Give control back to the player
{ "HMC", 0xA6, 0, 0 }, // Hide the player
{ "SMC", 0xA7, 0, 0 }, // Show the player
{ "LI+", 0xA8, 1, 0 }, // Restore health
{ "ML+", 0xA9, 1, 0 }, // Increase max health
// NPC / Entities / Boss
{ "ANP", 0xAA, 3, 0 }, // Animate NPC
{ "CNP", 0xAB, 3, 0 }, // Change NPC
{ "MNP", 0xAC, 4, 0 }, // Move NPC
{ "DNA", 0xAD, 1, 0 }, // Delete all of a certain NPC
{ "DNP", 0xAE, 1, 0 }, // Delete specific NPC
{ "INP", 0xAF, 3, 0 }, // Initialize / change entity (0x30)
{ "SNP", 0xB0, 4, 0 }, // Also creates an entity
{ "BOA", 0xB1, 1, 0 }, // Change boss animation / state
{ "BSL", 0xB2, 1, 0 }, // Start boss fight with entity
{ "NCJ", 0xB3, 2, CFLAG_JUMP }, // Jump to event if NPC exists
{ "ECJ", 0xB4, 2, CFLAG_JUMP }, // Jump to event if any entity exists
// Arms
{ "AE+", 0xB5, 0, 0 }, // Refill all ammo
{ "ZAM", 0xB6, 0, 0 }, // Takes away all ammo
{ "AM+", 0xB7, 2, 0 }, // Give player weapon and/or ammo
{ "AM-", 0xB8, 1, 0 }, // Remove player weapon
{ "TAM", 0xB9, 3, 0 }, // Trade weapons
{ "AMJ", 0xBA, 2, CFLAG_JUMP }, // Jump to event if have weapon
// Equps
{ "EQ+", 0xBB, 1, 0 }, // Equip item
{ "EQ-", 0xBC, 1, 0 }, // Unequip item
// Items
{ "IT+", 0xBD, 1, 0 }, // Give item
{ "IT-", 0xBE, 1, 0 }, // Remove item
{ "ITJ", 0xBF, 2, CFLAG_JUMP }, // Jump to event if have item (0x40)
// Flags
{ "FL+", 0xC0, 1, 0 }, // Set flag
{ "FL-", 0xC1, 1, 0 }, // Clear flag
{ "FLJ", 0xC2, 2, CFLAG_JUMP }, // Jump to event if flag is true
{ "SK+", 0xC3, 1, 0 }, // Enable skipflag
{ "SK-", 0xC4, 1, 0 }, // Disable skipflag
{ "SKJ", 0xC5, 2, CFLAG_JUMP }, // Jump on skipflag (boss rematch)
// Camera
{ "FOB", 0xC6, 2, 0 }, // Focus on boss
{ "FOM", 0xC7, 1, 0 }, // Focus on me
{ "FON", 0xC8, 2, 0 }, // Focus on NPC
{ "QUA", 0xC9, 1, 0 }, // Shake camera for quake effect
// Screen Effects
{ "FAI", 0xCA, 1, 0 }, // Fade in
{ "FAO", 0xCB, 1, 0 }, // Fade out
{ "FLA", 0xCC, 0, 0 }, // Flash screen white
// Room
{ "MLP", 0xCD, 0, 0 }, // Show the map
{ "MNA", 0xCE, 0, 0 }, // Display room name
{ "CMP", 0xCF, 3, 0 }, // Change room tile (0x50)
{ "MP+", 0xD0, 1, 0 }, // Enable map flag
{ "MPJ", 0xD1, 1, CFLAG_JUMP }, // Jump if map flag enabled
// Misc
{ "CRE", 0xD2, 0, 0 }, // Rolls the credits
{ "SIL", 0xD3, 1, 0 }, // Show illustration (credits)
{ "CIL", 0xD4, 0, 0 }, // Clear illustration (credits)
{ "SLP", 0xD5, 0, 0 }, // Show teleporter menu
{ "PS+", 0xD6, 2, 0 }, // Portal slot +
{ "SVP", 0xD7, 0, 0 }, // Saves the game
{ "STC", 0xD8, 0, 0 }, // Save time counter
{ "XX1", 0xD9, 1, 0 }, // Island control
{ "SMP", 0xDA, 2, 0 },
{ "NOP", 0xDB, 0, 0 },
};
const char *ValidChars =
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ,.?=!@$%^&*()[]{}|_-+:;'\"\n";
uint8_t *tsc = NULL;
uint16_t tscSize = 0;
uint16_t pc = 0;
uint16_t *kanji = NULL;
uint16_t kanjiCount = 0;
bool trace = false;
void tsc_open(const char *filename) {
if(trace) printf("TRACE: Opening '%s'\n", filename);
FILE *tscFile = fopen(filename, "rb");
fseek(tscFile, 0, SEEK_END);
tscSize = ftell(tscFile);
tsc = malloc(tscSize);
fseek(tscFile, 0, SEEK_SET);
fread(tsc, 1, tscSize, tscFile);
fclose(tscFile);
// Obtain the key from the center of the file
uint8_t key = tsc[tscSize / 2];
// Apply key to all bytes except where the key itself was
for(uint16_t i = 0; i < tscSize; i++) {
if(i != tscSize / 2) tsc[i] -= key;
if(trace) fputc(tsc[i], stdout);
}
pc = 0;
}
void tsc_close() {
if(trace) printf("TRACE: Closing TSC\n");
if(tsc) {
free(tsc);
tsc = NULL;
}
}
uint8_t get_char_type() {
// Command symbol '<'
if(tsc[pc] == SYM_COMMAND) return CT_COMMAND;
// Event symbol '#'
if(tsc[pc] == SYM_EVENT) return CT_EVENT;
// First check the valid ASCII chars list
for(uint16_t i = 0; i < strlen(ValidChars); i++) {
if(tsc[pc] == ValidChars[i]) return CT_ASCII;
}
// Skip '\r'
if(tsc[pc] == '\r') return CT_SKIP;
// Double byte char?
if((tsc[pc] >= 0x81 && tsc[pc] <= 0x9F) || (tsc[pc] >= 0xE0 && tsc[pc] <= 0xFC)) {
//uint16_t wc = (tsc[pc] << 8) | tsc[pc+1];
// Kanji
//for(int i = 0; i < kanjiCount; i++) {
// if(wc == kanji[i]) return CT_KANJI;
//}
//return CT_INVALID2BYTE;
return CT_KANJI;
}
return CT_INVALID;
}
uint16_t read_number() {
char str[LEN_NUMBER + 1];
for(int i = 0; i < 4; i++) {
char c = tsc[pc++];
if(!isdigit(c)) {
printf("WARN: Parameter should be 4 digits but is only %hu.\n", i);
str[i] = '\0';
pc--;
break;
}
str[i] = c;
}
str[LEN_NUMBER] = '\0';
return atoi(str);
}
uint16_t do_command(FILE *fout) {
uint8_t opcode = 0xDB; // NOP
uint8_t params = 0;
uint16_t flags = 0;
char str[LEN_COMMAND + 1];
// Find command from 3 character string
for(int i = 0; i < LEN_COMMAND; i++) str[i] = tsc[pc++];
str[LEN_COMMAND] = '\0';
for(int i = 0; i < COMMAND_COUNT; i++) {
if(strcmp(str, command_table[i].name) == 0) {
opcode = command_table[i].opcode;
params = command_table[i].params;
flags = command_table[i].flags;
break;
}
}
if(opcode == 0xDB) {
printf("ERROR: Bad command '%s'\n", str);
return flags;
}
if(trace) printf("TRACE: Command: '<%s", str);
//printf("TRACE: Command %s matches %hhu.\n", str, opcode);
fwrite(&opcode, 1, 1, fout);
// Parse parameters
for(int i = 0; i < params; i++) {
uint16_t val = read_number();
if(trace) printf("%04hu", val);
fwrite(&val, 1, 2, fout);
// Parameters should be separated by ':', CS doesn't actually check though
if(i != params - 1) {
if(tsc[pc++] != ':') {
if(trace) printf("\n");
printf("WARN: No ':' between parameters.\n");
} else {
if(trace) printf(":");
}
}
}
if(trace) printf("'\n");
return flags;
}
void do_event(FILE *fout) {
bool msgWindowOpen = false;
uint16_t id = read_number();
uint16_t commandCount = 0;
if(trace) printf("TRACE: Event: #%04hu\n", id);
fwrite(&id, 1, 2, fout);
while(pc < tscSize) {
uint8_t ct = get_char_type();
switch(ct) {
case CT_COMMAND: {
pc++;
commandCount++;
uint16_t flags = do_command(fout);
if(flags & CFLAG_MSGOPEN) msgWindowOpen = true;
else if(flags & CFLAG_MSGCLOSE) msgWindowOpen = false;
if(flags & CFLAG_END) return;
}
break;
case CT_EVENT: {
if(commandCount != 0) {
printf("WARN: Non-empty event #%04hu has no ending!\n", id);
}
//pc++;
return;
}
break;
case CT_ASCII: {
if(msgWindowOpen) {
fwrite(&tsc[pc], 1, 1, fout);
} else if(tsc[pc] != '\n') {
printf("WARN: Printable text char '%c' is never displayed.\n", tsc[pc]);
}
pc++;
}
break;
case CT_KANJI: {
uint16_t wc = (tsc[pc] << 8) | tsc[pc+1];
int k;
for(k = 0; k < kanjiCount; k++) {
if(wc == kanji[k]) break;
}
if(k == kanjiCount) {
printf("WARN: Unknown kanji: 0x%04hx\n", wc);
} else {
// Index by appearance in the list, and fit that number into banks
// of 0x60 for each 'page'
uint8_t page = k / 0x60;
uint8_t word = k % 0x60;
uint8_t b = MULTIBYTE_BEGIN + page; // First byte
fwrite(&b, 1, 1, fout);
b = word + 0x20; // Second byte
fwrite(&b, 1, 1, fout);
}
pc += 2;
}
break;
case CT_SKIP: pc++; break;
case CT_SKIP2BYTE: pc += 2; break;
case CT_INVALID: {
printf("WARN: Invalid character: '%c' (0x%02hx)\n", tsc[pc], tsc[pc]);
pc++;
}
break;
case CT_INVALID2BYTE: {
uint16_t wc = (tsc[pc] << 8) | tsc[pc+1];
printf("WARN: Invalid double byte character: 0x%04hx\n", wc);
pc += 2;
}
break;
}
}
}
void do_script(FILE *fout) {
uint8_t eventCount = 0;
// Place holder to store the real count when finished
fwrite(&eventCount, 1, 1, fout);
while(pc < tscSize && eventCount < MAX_EVENTS) {
uint8_t c = tsc[pc++];
if(c == SYM_EVENT) {
uint16_t sym = OP_EVENT;
fwrite(&sym, 1, 2, fout);
do_event(fout);
eventCount++;
} else if(c != '\n' && c != '\r') {
//printf("Debug: Char '%c' while looking for events.\n", c);
}
}
// Event count at beginning of file
fseek(fout, 0, SEEK_SET);
fwrite(&eventCount, 1, 1, fout);
}
int main(int argc,char *argv[]) {
if(argc < 3) {
printf("Usage: tscomp-ja [-t] <tsc file [more tsc files ...]> <kanji list file>\n");
return 0;
}
if(argv[1][0] == '-' && argv[1][1] == 't' && argv[1][2] == '\0') {
trace = true;
}
// Load the kanji list
FILE *kfile = fopen(argv[argc-1], "rb");
if(!kfile) {
printf("ERROR: Failed to open '%s'.\n", argv[argc-1]);
return EXIT_FAILURE;
}
fseek(kfile, 0, SEEK_END);
kanjiCount = ftell(kfile) / 2; // Each iteration is 2 bytes
fseek(kfile, 0, SEEK_SET);
kanji = malloc(kanjiCount * 2);
fread(kanji, 1, kanjiCount * 2, kfile);
fclose(kfile);
// Endianness is a bitch
for(uint16_t i = 0; i < kanjiCount; i++) {
uint8_t hi = kanji[i] >> 8;
uint8_t lo = kanji[i] & 0xFF;
kanji[i] = (lo << 8) | hi;
}
printf("INFO: Loaded kanji list.\n");
// Go through each of the TSC files given
char outstr[256];
for(int i = 1 + trace; i < argc-1; i++) {
tsc_open(argv[i]);
sprintf(outstr, "%s", argv[i]);
outstr[strlen(outstr)-1] = 'b';
FILE *outfile = fopen(outstr, "wb");
do_script(outfile);
fclose(outfile);
tsc_close();
}
free(kanji);
return EXIT_SUCCESS;
}
| aderosier/cave-story-md | tools/tscomp-ja/tscomp-ja.c | C | gpl-3.0 | 12,345 |
.diagram {
position: absolute;
background-color: white;
}
.diagram-node-wrapper {
position: absolute;
z-index: 1;
}
.diagram-node {
padding: 12px;
text-align: center;
border: 2px solid #2e6f9a;
box-shadow: 2px 2px 19px #e0e0e0;
-o-box-shadow: 2px 2px 19px #e0e0e0;
-webkit-box-shadow: 2px 2px 19px #e0e0e0;
-moz-box-shadow: 2px 2px 19px #e0e0e0;
-moz-border-radius: 8px;
border-radius: 8px;
opacity: 0.8;
filter: alpha(opacity = 80);
cursor: move;
background-color: white;
font-size: 11px;
-webkit-transition: background-color 0.25s ease-in;
-moz-transition: background-color 0.25s ease-in;
transition: background-color 0.25s ease-in;
}
.diagram-node-label {
word-wrap: break-word;
white-space: normal;
text-align:center;
width: 110px;
margin-left: -15px;
margin-top: 5px;
height: auto;
}
.diagram-node.selected {
border: 2px solid orange;
}
.diagram-node.disabled {
opacity: 0.25;
}
.diagram ._jsPlumb_endpoint {
z-index: 3;
}
.diagram ._jsPlumb_overlay {
z-index: 2;
}
.endpointSourceLabel {
color: white;
background-color: #0072C6;
padding: 1px 6px 2px;
font-size: 12.025px;
font-weight: bold;
white-space: nowrap;
-webkit-border-radius: 9px;
-moz-border-radius: 9px;
border-radius: 9px;
}
.dragHover {
border: 2px solid orange;
}
path {
cursor: pointer;
}
.rubberband {
border: 2px solid orange;
display: none;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
z-index: 10;
} | JumpMind/metl | metl-ui/src/main/resources/org/jumpmind/metl/ui/diagram/diagram.css | CSS | gpl-3.0 | 1,527 |
---------------------------------------------
-- Mantle Pierce
--
-- Description: Stabs a single target. Additional effect: Weight
-- Type: Physical
-- Utsusemi/Blink absorb: 1-3 shadow(s)
-- Range: Melee
-- Notes:
---------------------------------------------
require("scripts/globals/settings");
require("scripts/globals/status");
require("scripts/globals/monstertpmoves");
---------------------------------------------
function onMobSkillCheck(target,mob,skill)
return 0;
end;
function onMobWeaponSkill(target, mob, skill)
local numhits = math.random(1,3);
local accmod = 2;
local dmgmod = 2;
local info = MobPhysicalMove(mob,target,skill,numhits,accmod,dmgmod,TP_NO_EFFECT);
local dmg = MobFinalAdjustments(info.dmg,mob,skill,target,MOBSKILL_PHYSICAL,MOBPARAM_PIERCE,info.hitslanded);
local typeEffect = dsp.effect.WEIGHT;
MobPhysicalStatusEffectMove(mob, target, skill, typeEffect, 50, 0, 120);
target:delHP(dmg);
return dmg;
end;
| waterlgndx/darkstar | scripts/globals/mobskills/mantle_pierce.lua | Lua | gpl-3.0 | 990 |
<script src="../../../lib/processing.min.js"></script>
<script src="../../../src/rita.js"></script>
<script type="text/processing" data-processing-target="mycanvas">
// =========================== Start Processing ===============================
size(600, 400);
RiText.defaults.showBounds = true;
var pf = createFont("Arial", 36);
rt1 = new RiText("Bounding", 130, 100);
rt1.font(pf);
rt2 = new RiText("wounze", 50, 240);
rt3 = new RiText("Bound in", 290, 150, pf);
rt3.scale(64/pf.size);
rt4 = new RiText("Bounding", 130, 200, pf);
//rt4 = new RiText("Bounding", 20, 60, pf);
rt4.scale(32/pf.size); // default
rt5 = new RiText("Boundage", 180, 300);
rt5.font(createFont("Times New Roman",64));
background(255);
RiText.drawAll();
// ============================ End Processing =================================
</script>
<canvas id="mycanvas" style="border: 1px solid #000000;"></canvas>
| dhowe/RiTaJSHistory | test/renderer/processing/ex-motion-types.html | HTML | gpl-3.0 | 934 |
url: http://sanskrit.inria.fr/cgi-bin/SKT/sktreader?t=VH;lex=SH;cache=f;st=t;us=f;cp=t;text=kimartha.m vaa;topic=;abs=f;allSol=2;mode=p;cpts=<!DOCTYPE html>
<html><head>
<meta charset="utf-8">
<title>Sanskrit Reader Companion</title>
<meta name="author" content="Gérard Huet">
<meta property="dc:datecopyrighted" content="2016">
<meta property="dc:rightsholder" content="Gérard Huet">
<meta name="keywords" content="dictionary,sanskrit,heritage,dictionnaire,sanscrit,india,inde,indology,linguistics,panini,digital humanities,cultural heritage,computational linguistics,hypertext lexicon">
<link rel="stylesheet" type="text/css" href="http://sanskrit.inria.fr/DICO/style.css" media="screen,tv">
<link rel="shortcut icon" href="http://sanskrit.inria.fr/IMAGES/favicon.ico">
<script type="text/javascript" src="http://sanskrit.inria.fr/DICO/utf82VH.js"></script>
</head>
<body class="chamois_back">
<br><h1 class="title">The Sanskrit Reader Companion</h1>
<table class="chamois_back" border="0" cellpadding="0%" cellspacing="15pt" width="100%">
<tr><td>
<p align="center">
<div class="latin16"><a class="green" href="/cgi-bin/SKT/sktgraph?t=VH;lex=SH;cache=f;st=t;us=f;cp=t;text=kimartha.m%20vaa;topic=;abs=f;cpts=;mode=g">✓</a> Show Summary of Solutions
</p>
Input:
<span class="red16">kimarthaṃ vā</span><hr>
<br>
Sentence:
<span class="deva16" lang="sa">किमर्थम् वा</span><br>
may be analysed as:</div><br>
<hr>
<span class="blue">Solution 1 : <a class="green" href="/cgi-bin/SKT/sktparser?t=VH;lex=SH;cache=f;st=t;us=f;cp=t;text=kimartha.m%20vaa;topic=;abs=f;cpts=;mode=p;n=1">✓</a></span><br>
[ <span class="blue" title="0"><b>kim</b></span><table class="yellow_back">
<tr><th><span class="latin12"><tr><th><span class="latin12">{ iic. }[<a class="navy" href="http://sanskrit.inria.fr/DICO/21.html#kim"><i>kim</i></a>]</span></th></tr></span></th></tr></table>⟨⟩]
<br>
[ <span class="blue" title="3"><b>artham</b></span><table class="deep_sky_back">
<tr><th><span class="latin12"><tr><th><span class="latin12">{ acc. sg. m. }[<a class="navy" href="http://sanskrit.inria.fr/DICO/6.html#artha"><i>artha</i></a>]</span></th></tr></span></th></tr></table>⟨⟩]
<br>
[ <span class="blue" title="8"><b>vā</b></span><table class="mauve_back">
<tr><th><span class="latin12"><tr><th><span class="latin12">{ conj. }[<a class="navy" href="http://sanskrit.inria.fr/DICO/58.html#vaa#1"><i>vā_1</i></a>]</span></th></tr></span></th></tr></table>⟨⟩]
<br>
<br>
<hr>
<span class="blue">Solution 2 : <a class="green" href="/cgi-bin/SKT/sktparser?t=VH;lex=SH;cache=f;st=t;us=f;cp=t;text=kimartha.m%20vaa;topic=;abs=f;cpts=;mode=p;n=2">✓</a></span><br>
[ <span class="blue" title="0"><b>kim</b></span><table class="yellow_back">
<tr><th><span class="latin12"><tr><th><span class="latin12">{ iic. }[<a class="navy" href="http://sanskrit.inria.fr/DICO/21.html#kim"><i>kim</i></a>]</span></th></tr></span></th></tr></table>⟨⟩]
<br>
[ <span class="blue" title="3"><b>artham</b></span><table class="cyan_back">
<tr><th><span class="latin12"><tr><th><span class="latin12">{ acc. sg. n. | nom. sg. n. }[<a class="navy" href="http://sanskrit.inria.fr/DICO/6.html#artha"><i>artha</i></a>]</span></th></tr></span></th></tr></table>⟨⟩]
<br>
[ <span class="blue" title="8"><b>vā</b></span><table class="mauve_back">
<tr><th><span class="latin12"><tr><th><span class="latin12">{ conj. }[<a class="navy" href="http://sanskrit.inria.fr/DICO/58.html#vaa#1"><i>vā_1</i></a>]</span></th></tr></span></th></tr></table>⟨⟩]
<br>
<br>
<hr>
<span class="blue">Solution 3 : <a class="green" href="/cgi-bin/SKT/sktparser?t=VH;lex=SH;cache=f;st=t;us=f;cp=t;text=kimartha.m%20vaa;topic=;abs=f;cpts=;mode=p;n=3">✓</a></span><br>
[ <span class="blue" title="0"><b>kim</b></span><table class="light_blue_back">
<tr><th><span class="latin12"><tr><th><span class="latin12">{ acc. sg. n. | nom. sg. n. }[<a class="navy" href="http://sanskrit.inria.fr/DICO/21.html#kim"><i>kim</i></a>]</span></th></tr></span></th></tr></table>⟨⟩]
<br>
[ <span class="blue" title="3"><b>artham</b></span><table class="deep_sky_back">
<tr><th><span class="latin12"><tr><th><span class="latin12">{ acc. sg. m. }[<a class="navy" href="http://sanskrit.inria.fr/DICO/6.html#artha"><i>artha</i></a>]</span></th></tr></span></th></tr></table>⟨⟩]
<br>
[ <span class="blue" title="8"><b>vā</b></span><table class="mauve_back">
<tr><th><span class="latin12"><tr><th><span class="latin12">{ conj. }[<a class="navy" href="http://sanskrit.inria.fr/DICO/58.html#vaa#1"><i>vā_1</i></a>]</span></th></tr></span></th></tr></table>⟨⟩]
<br>
<br>
<hr>
<span class="magenta">3</span><span class="blue"> solution</span><span class="blue">s</span><span class="blue"> kept among </span><span class="magenta">3</span><br>
<br>
<hr>
<br>
<br>
</td></tr></table>
<table class="pad60">
<tr><td></td></tr></table>
<div class="enpied">
<table class="bandeau"><tr><td>
<a href="http://ocaml.org"><img src="http://sanskrit.inria.fr/IMAGES/ocaml.gif" alt="Le chameau Ocaml" height="50"></a>
</td><td>
<table class="center">
<tr><td>
<a href="http://sanskrit.inria.fr/index.fr.html"><b>Top</b></a> |
<a href="http://sanskrit.inria.fr/DICO/index.fr.html"><b>Index</b></a> |
<a href="http://sanskrit.inria.fr/DICO/index.fr.html#stemmer"><b>Stemmer</b></a> |
<a href="http://sanskrit.inria.fr/DICO/grammar.fr.html"><b>Grammar</b></a> |
<a href="http://sanskrit.inria.fr/DICO/sandhi.fr.html"><b>Sandhi</b></a> |
<a href="http://sanskrit.inria.fr/DICO/reader.fr.html"><b>Reader</b></a> |
<a href="http://sanskrit.inria.fr/faq.fr.html"><b>Help</b></a> |
<a href="http://sanskrit.inria.fr/portal.fr.html"><b>Portal</b></a>
</td></tr><tr><td>
© Gérard Huet 1994-2016</td></tr></table></td><td>
<a href="http://www.inria.fr/"><img src="http://sanskrit.inria.fr/IMAGES/logo_inria.png" alt="Logo Inria" height="50"></a>
<br></td></tr></table></div>
</body>
</html>
| sanskritiitd/sanskrit | uohCorpus.fil/uoh/uoh.filteredcorpus.txt_output/vetalkatha_ext.txt.out.dict_16926_inr.html | HTML | gpl-3.0 | 6,106 |
/**
* @license
* Copyright 2013 Palantir Technologies, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as ts from "typescript";
import { Location, Privacy } from "../completedDocsRule";
import { Exclusion } from "./exclusion";
export interface IClassExclusionDescriptor {
locations?: Location[];
privacies?: Privacy[];
}
export declare class ClassExclusion extends Exclusion<IClassExclusionDescriptor> {
readonly locations: Set<Location>;
readonly privacies: Set<Privacy>;
excludes(node: ts.Node): boolean;
private shouldLocationBeDocumented(node);
private shouldPrivacyBeDocumented(node);
}
| brunosr1985/PHPLogin | node_modules/tslint/lib/rules/completed-docs/classExclusion.d.ts | TypeScript | gpl-3.0 | 1,150 |
#region License
// Copyright (c) 2013, ClearCanvas Inc.
// All rights reserved.
// http://www.clearcanvas.ca
//
// This file is part of the ClearCanvas RIS/PACS open source project.
//
// The ClearCanvas RIS/PACS open source project is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// The ClearCanvas RIS/PACS open source project is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
// Public License for more details.
//
// You should have received a copy of the GNU General Public License along with
// the ClearCanvas RIS/PACS open source project. If not, see
// <http://www.gnu.org/licenses/>.
#endregion
using System;
using System.Collections.Generic;
using ClearCanvas.Common;
using ClearCanvas.Common.Utilities;
using ClearCanvas.Desktop;
using ClearCanvas.Desktop.Actions;
using ClearCanvas.Desktop.Tools;
using ClearCanvas.Enterprise.Common.Admin.UserAdmin;
using ClearCanvas.Enterprise.Desktop;
using ClearCanvas.Ris.Application.Common;
using ClearCanvas.Ris.Application.Common.Admin.StaffAdmin;
namespace ClearCanvas.Ris.Client
{
[MenuAction("launch", "global-menus/Admin/Staff", "Launch")]
[ActionPermission("launch", ClearCanvas.Ris.Application.Common.AuthorityTokens.Admin.Data.Staff)]
[ExtensionOf(typeof(DesktopToolExtensionPoint), FeatureToken = FeatureTokens.RIS.Core)]
public class StaffSummaryTool : Tool<IDesktopToolContext>
{
private IWorkspace _workspace;
public void Launch()
{
if (_workspace == null)
{
try
{
StaffSummaryComponent component = new StaffSummaryComponent();
_workspace = ApplicationComponent.LaunchAsWorkspace(
this.Context.DesktopWindow,
component,
SR.TitleStaff);
_workspace.Closed += delegate { _workspace = null; };
}
catch (Exception e)
{
// failed to launch component
ExceptionHandler.Report(e, this.Context.DesktopWindow);
}
}
else
{
_workspace.Activate();
}
}
}
/// <summary>
/// Extension point for views onto <see cref="StaffSummaryComponent"/>
/// </summary>
[ExtensionPoint]
public class StaffSummaryComponentViewExtensionPoint : ExtensionPoint<IApplicationComponentView>
{
}
/// <summary>
/// StaffSummaryComponent class
/// </summary>
[AssociateView(typeof(StaffSummaryComponentViewExtensionPoint))]
public class StaffSummaryComponent : SummaryComponentBase<StaffSummary, StaffTable, ListStaffRequest>
{
private string _firstName;
private string _lastName;
private readonly string[] _staffTypesFilter;
/// <summary>
/// Constructor
/// </summary>
public StaffSummaryComponent()
{
}
/// <summary>
/// Constructor
/// </summary>
/// <param name="dialogMode">Indicates whether the component will be shown in a dialog box or not</param>
public StaffSummaryComponent(bool dialogMode)
:this(dialogMode, new string[]{})
{
}
/// <summary>
/// Constructor
/// </summary>
/// <param name="dialogMode">Indicates whether the component will be shown in a dialog box or not</param>
/// <param name="staffTypesFilter">Filters the staff list according to the specified staff types.</param>
public StaffSummaryComponent(bool dialogMode, string[] staffTypesFilter)
:base(dialogMode)
{
_staffTypesFilter = staffTypesFilter;
}
#region Presentation Model
public string FirstName
{
get { return _firstName; }
set { _firstName = value; }
}
public string LastName
{
get { return _lastName; }
set { _lastName = value; }
}
#endregion
/// <summary>
/// Override this method to perform custom initialization of the action model,
/// such as adding permissions or adding custom actions.
/// </summary>
/// <param name="model"></param>
protected override void InitializeActionModel(AdminActionModel model)
{
base.InitializeActionModel(model);
model.Add.SetPermissibility(ClearCanvas.Ris.Application.Common.AuthorityTokens.Admin.Data.Staff);
model.Edit.SetPermissibility(ClearCanvas.Ris.Application.Common.AuthorityTokens.Admin.Data.Staff);
model.Delete.SetPermissibility(ClearCanvas.Ris.Application.Common.AuthorityTokens.Admin.Data.Staff);
model.ToggleActivation.SetPermissibility(ClearCanvas.Ris.Application.Common.AuthorityTokens.Admin.Data.Staff);
}
protected override bool SupportsDelete
{
get { return true; }
}
/// <summary>
/// Gets the list of items to show in the table, according to the specifed first and max items.
/// </summary>
/// <returns></returns>
protected override IList<StaffSummary> ListItems(ListStaffRequest request)
{
ListStaffResponse listResponse = null;
Platform.GetService<IStaffAdminService>(
delegate(IStaffAdminService service)
{
request.StaffTypesFilter = _staffTypesFilter;
request.FamilyName = _lastName;
request.GivenName = _firstName;
listResponse = service.ListStaff(request);
});
return listResponse.Staffs;
}
/// <summary>
/// Called to handle the "add" action.
/// </summary>
/// <param name="addedItems"></param>
/// <returns>True if items were added, false otherwise.</returns>
protected override bool AddItems(out IList<StaffSummary> addedItems)
{
addedItems = new List<StaffSummary>();
StaffEditorComponent editor = new StaffEditorComponent();
ApplicationComponentExitCode exitCode = ApplicationComponent.LaunchAsDialog(
this.Host.DesktopWindow, editor, SR.TitleAddStaff);
if (exitCode == ApplicationComponentExitCode.Accepted)
{
addedItems.Add(editor.StaffSummary);
return true;
}
return false;
}
/// <summary>
/// Called to handle the "edit" action.
/// </summary>
/// <param name="items">A list of items to edit.</param>
/// <param name="editedItems">The list of items that were edited.</param>
/// <returns>True if items were edited, false otherwise.</returns>
protected override bool EditItems(IList<StaffSummary> items, out IList<StaffSummary> editedItems)
{
editedItems = new List<StaffSummary>();
StaffSummary item = CollectionUtils.FirstElement(items);
StaffEditorComponent editor = new StaffEditorComponent(item.StaffRef);
ApplicationComponentExitCode exitCode = ApplicationComponent.LaunchAsDialog(
this.Host.DesktopWindow, editor, SR.TitleUpdateStaff + " - " + item.Name);
if (exitCode == ApplicationComponentExitCode.Accepted)
{
editedItems.Add(editor.StaffSummary);
return true;
}
return false;
}
/// <summary>
/// Called to handle the "delete" action, if supported.
/// </summary>
/// <param name="items"></param>
/// <param name="deletedItems">The list of items that were deleted.</param>
/// <param name="failureMessage">The message if there any errors that occurs during deletion.</param>
/// <returns>True if items were deleted, false otherwise.</returns>
protected override bool DeleteItems(IList<StaffSummary> items, out IList<StaffSummary> deletedItems, out string failureMessage)
{
failureMessage = null;
deletedItems = new List<StaffSummary>();
foreach (StaffSummary item in items)
{
try
{
Platform.GetService<IStaffAdminService>(
delegate(IStaffAdminService service)
{
// check if staff has associated user account
StaffDetail detail = service.LoadStaffForEdit(
new LoadStaffForEditRequest(item.StaffRef)).StaffDetail;
if (!string.IsNullOrEmpty(detail.UserName))
{
// ask if the account should be deleted too
if(this.Host.ShowMessageBox(
string.Format(SR.MessageConfirmDeleteAssociatedUserAccount, detail.UserName), MessageBoxActions.YesNo)
== DialogBoxAction.Yes)
{
Platform.GetService<IUserAdminService>(
delegate(IUserAdminService userAdminService)
{
userAdminService.DeleteUser(new DeleteUserRequest(detail.UserName));
});
}
else
{
// not deleting user, but we should update user's display name
Platform.GetService<IUserAdminService>(
delegate(IUserAdminService userAdminService)
{
LoadUserForEditResponse editResponse = userAdminService.LoadUserForEdit(new LoadUserForEditRequest(detail.UserName));
UserDetail userDetail = editResponse.UserDetail;
userDetail.DisplayName = null;
userAdminService.UpdateUser(new UpdateUserRequest(userDetail));
});
}
}
service.DeleteStaff(new DeleteStaffRequest(item.StaffRef));
});
deletedItems.Add(item);
}
catch (Exception e)
{
failureMessage = e.Message;
}
}
return deletedItems.Count > 0;
}
/// <summary>
/// Called to handle the "toggle activation" action, if supported
/// </summary>
/// <param name="items">A list of items to edit.</param>
/// <param name="editedItems">The list of items that were edited.</param>
/// <returns>True if items were edited, false otherwise.</returns>
protected override bool UpdateItemsActivation(IList<StaffSummary> items, out IList<StaffSummary> editedItems)
{
List<StaffSummary> results = new List<StaffSummary>();
foreach (StaffSummary item in items)
{
Platform.GetService<IStaffAdminService>(
delegate(IStaffAdminService service)
{
StaffDetail detail = service.LoadStaffForEdit(
new LoadStaffForEditRequest(item.StaffRef)).StaffDetail;
detail.Deactivated = !detail.Deactivated;
StaffSummary summary = service.UpdateStaff(
new UpdateStaffRequest(detail)).Staff;
results.Add(summary);
});
}
editedItems = results;
return true;
}
/// <summary>
/// Compares two items to see if they represent the same item.
/// </summary>
/// <param name="x"></param>
/// <param name="y"></param>
/// <returns></returns>
protected override bool IsSameItem(StaffSummary x, StaffSummary y)
{
return x.StaffRef.Equals(y.StaffRef, true);
}
}
}
| chinapacs/ImageViewer | Ris/Client/StaffSummaryComponent.cs | C# | gpl-3.0 | 11,175 |
using System;
using System.Xml.Serialization;
namespace Aliyun.Api
{
[Serializable]
public abstract class AliyunResponse
{
/// <summary>
/// 错误码
/// </summary>
[XmlElement("Code")]
public string Code { get; set; }
/// <summary>
/// 错误信息
/// </summary>
[XmlElement("Message")]
public string Message { get; set; }
/// <summary>
/// 响应原始内容
/// </summary>
public string Body { get; set; }
/// <summary>
/// 响应结果是否错误
/// </summary>
public bool IsError => !string.IsNullOrEmpty(this.Code);
}
}
| kk141242/siteserver | source/BaiRong.Core/ThirdParty/AliDaYu/Aliyun/AliyunResponse.cs | C# | gpl-3.0 | 701 |
// Torc - Copyright 2011-2013 University of Southern California. All Rights Reserved.
// $HeadURL: https://svn.east.isi.edu/torc/trunk/src/torc/bitstream/assembler/lut/parser.yy $
// $Id: parser.yy 1303 2013-02-25 23:18:16Z nsteiner $
// This program is free software: you can redistribute it and/or modify it under the terms of the
// GNU General Public License as published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
// the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with this program. If
// not, see <http://www.gnu.org/licenses/>.
#ifndef TORC_BITSTREAM_ASSEMBLER_SHAREDFUNCTIONS_HPP
#define TORC_BITSTREAM_ASSEMBLER_SHAREDFUNCTIONS_HPP
#include <iostream>
#include <vector>
#include <map>
#include <stdint.h>
// Typedefs
typedef std::map<const std::string, std::vector<std::string> > CompoundSettingMap;
typedef std::map<const std::string, std::vector<uint32_t> > ConfigBitMap;
typedef std::map<const std::string, ConfigBitMap> ElementConfigMap;
typedef std::map<const std::string, ElementConfigMap> TiletypeElementMap;
// Shared constants
extern const std::string kNameSeparator;
extern const std::string kFamily;
extern const std::string kConfigOff;
extern const std::string kArchitectureName;
extern const std::string kXDLExtension;
// Shared global variables
extern CompoundSettingMap gCompoundSettingsMap;
bool elementNeedsCompoundSetting(std::string elementName);
bool DSPMaskOrPatternConfig(const std::string &siteType, const std::string &elementName);
void InitializeCompoundSettingsMap();
#endif // TORC_BITSTREAM_ASSEMBLER_SHAREDFUNCTIONS_HPP
| torc-isi/torc | src/torc/bitstream/assembler/SharedFunctions.hpp | C++ | gpl-3.0 | 1,916 |
-----------------------------------
-- Area: North Gustaberg (S) (88)
-- Mob: Azo
-----------------------------------
-- require("scripts/zones/North_Gustaberg_[S]/MobIDs");
-----------------------------------
-- onMobInitialize
-----------------------------------
function onMobInitialize(mob)
end;
-----------------------------------
-- onMobSpawn
-----------------------------------
function onMobSpawn(mob)
end;
-----------------------------------
-- onMobEngaged
-----------------------------------
function onMobEngaged(mob,target)
end;
-----------------------------------
-- onMobFight
-----------------------------------
function onMobFight(mob,target)
end;
-----------------------------------
-- onMobDeath
-----------------------------------
function onMobDeath(mob,killer)
end;
| salamader/ffxi-a | scripts/zones/North_Gustaberg_[S]/mobs/Azo.lua | Lua | gpl-3.0 | 809 |
/*
Copyright (c) 2013 yvt
This file is part of OpenSpades.
OpenSpades is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenSpades is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenSpades. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "../Client/IRenderer.h"
#include "../Core/Math.h"
#include "../Client/SceneDefinition.h"
#include <map>
#include "../Client/IGameMapListener.h"
#include "GLCameraBlurFilter.h"
#include "GLDynamicLight.h"
namespace spades {
namespace draw {
class IGLDevice;
class GLShader;
class GLProgram;
class GLProgramManager;
class GLImageManager;
class GLMapRenderer;
class GLModelManager;
class GLImageRenderer;
class GLFlatMapRenderer;
class IGLSpriteRenderer;
class GLLongSpriteRenderer;
class GLFramebufferManager;
class GLMapShadowRenderer;
class GLModelRenderer;
class IGLShadowMapRenderer;
class GLWaterRenderer;
class GLAmbientShadowRenderer;
class GLRadiosityRenderer;
class GLLensDustFilter;
class GLSoftLitSpriteRenderer;
class GLRenderer: public client::IRenderer, public client::IGameMapListener {
friend class GLShadowShader;
friend class IGLShadowMapRenderer;
friend class GLRadiosityRenderer;
friend class GLSoftLitSpriteRenderer;
struct DebugLine{
Vector3 v1, v2;
Vector4 color;
};
Handle<IGLDevice> device;
GLFramebufferManager *fbManager;
client::GameMap *map;
bool inited;
bool sceneUsedInThisFrame;
client::SceneDefinition sceneDef;
Plane3 frustrum[6];
std::vector<DebugLine> debugLines;
std::vector<GLDynamicLight> lights;
GLProgramManager *programManager;
GLImageManager *imageManager;
GLModelManager *modelManager;
IGLShadowMapRenderer *shadowMapRenderer;
GLMapShadowRenderer *mapShadowRenderer;
GLMapRenderer *mapRenderer;
GLImageRenderer *imageRenderer;
GLFlatMapRenderer *flatMapRenderer;
GLModelRenderer *modelRenderer;
IGLSpriteRenderer *spriteRenderer;
GLLongSpriteRenderer *longSpriteRenderer;
GLWaterRenderer *waterRenderer;
GLAmbientShadowRenderer *ambientShadowRenderer;
GLRadiosityRenderer *radiosityRenderer;
GLCameraBlurFilter *cameraBlur;
GLLensDustFilter *lensDustFilter;
// used when r_srgb = 1
IGLDevice::UInteger lastColorBufferTexture;
float fogDistance;
Vector3 fogColor;
// used for color correction
Vector3 smoothedFogColor;
Matrix4 projectionMatrix;
Matrix4 viewMatrix;
Matrix4 projectionViewMatrix;
bool renderingMirror;
Vector4 drawColorAlphaPremultiplied;
bool legacyColorPremultiply;
unsigned int lastTime;
bool duringSceneRendering;
void BuildProjectionMatrix();
void BuildView();
void BuildFrustrum();
void RenderDebugLines();
void RenderObjects();
void EnsureInitialized();
void EnsureSceneStarted();
void EnsureSceneNotStarted();
protected:
virtual ~GLRenderer();
public:
GLRenderer(IGLDevice *glDevice);
virtual void Init();
virtual void Shutdown();
virtual client::IImage *RegisterImage(const char *filename);
virtual client::IModel *RegisterModel(const char *filename);
virtual client::IImage *CreateImage(Bitmap *);
virtual client::IModel *CreateModel(VoxelModel *);
virtual client::IModel *CreateModelOptimized(VoxelModel *);
GLProgram *RegisterProgram(const std::string& name);
GLShader *RegisterShader(const std::string& name);
virtual void SetGameMap(client::GameMap *);
virtual void SetFogColor(Vector3 v);
virtual void SetFogDistance(float f){fogDistance = f;}
Vector3 GetFogColor() { return fogColor; }
float GetFogDistance() { return fogDistance; }
Vector3 GetFogColorForSolidPass();
virtual void StartScene(const client::SceneDefinition&);
virtual void RenderModel(client::IModel *, const client::ModelRenderParam&);
virtual void AddLight(const client::DynamicLightParam& light);
virtual void AddDebugLine(Vector3 a, Vector3 b, Vector4 color);
virtual void AddSprite(client::IImage *, Vector3 center, float radius, float rotation);
virtual void AddLongSprite(client::IImage *, Vector3 p1, Vector3 p2, float radius);
virtual void EndScene();
virtual void MultiplyScreenColor(Vector3);
virtual void SetColor(Vector4);
virtual void SetColorAlphaPremultiplied(Vector4);
virtual void DrawImage(client::IImage *, const Vector2& outTopLeft);
virtual void DrawImage(client::IImage *, const AABB2& outRect);
virtual void DrawImage(client::IImage *, const Vector2& outTopLeft, const AABB2& inRect);
virtual void DrawImage(client::IImage *, const AABB2& outRect, const AABB2& inRect);
virtual void DrawImage(client::IImage *, const Vector2& outTopLeft, const Vector2& outTopRight, const Vector2& outBottomLeft, const AABB2& inRect);
virtual void DrawFlatGameMap(const AABB2& outRect, const AABB2& inRect);
virtual void FrameDone();
virtual void Flip();
virtual Bitmap *ReadBitmap();
virtual float ScreenWidth();
virtual float ScreenHeight();
IGLDevice *GetGLDevice() {return device; }
GLFramebufferManager *GetFramebufferManager() { return fbManager; }
IGLShadowMapRenderer *GetShadowMapRenderer() { return shadowMapRenderer; }
GLAmbientShadowRenderer *GetAmbientShadowRenderer() { return ambientShadowRenderer; }
GLMapShadowRenderer *GetMapShadowRenderer() { return mapShadowRenderer; }
GLRadiosityRenderer *GetRadiosityRenderer() { return radiosityRenderer; }
GLModelRenderer *GetModelRenderer() { return modelRenderer; }
const Matrix4& GetProjectionMatrix() const { return projectionMatrix; }
const Matrix4& GetProjectionViewMatrix() const { return projectionViewMatrix; }
const Matrix4& GetViewMatrix() const { return viewMatrix; }
bool IsRenderingMirror() const { return renderingMirror; }
virtual void GameMapChanged(int x, int y, int z, client::GameMap *);
const client::SceneDefinition& GetSceneDef() const {
return sceneDef;
}
bool BoxFrustrumCull(const AABB3&);
bool SphereFrustrumCull(const Vector3& center, float radius);
};
}
}
| prosa100/openspades | Sources/Draw/GLRenderer.h | C | gpl-3.0 | 6,683 |
url: http://sanskrit.inria.fr/cgi-bin/SKT/sktreader?t=VH;lex=SH;cache=f;st=t;us=f;cp=t;text=tvafgati.h;topic=;abs=f;allSol=2;mode=p;cpts=<!DOCTYPE html>
<html><head>
<meta charset="utf-8">
<title>Sanskrit Reader Companion</title>
<meta name="author" content="Gérard Huet">
<meta property="dc:datecopyrighted" content="2016">
<meta property="dc:rightsholder" content="Gérard Huet">
<meta name="keywords" content="dictionary,sanskrit,heritage,dictionnaire,sanscrit,india,inde,indology,linguistics,panini,digital humanities,cultural heritage,computational linguistics,hypertext lexicon">
<link rel="stylesheet" type="text/css" href="http://sanskrit.inria.fr/DICO/style.css" media="screen,tv">
<link rel="shortcut icon" href="http://sanskrit.inria.fr/IMAGES/favicon.ico">
<script type="text/javascript" src="http://sanskrit.inria.fr/DICO/utf82VH.js"></script>
</head>
<body class="chamois_back">
<br><h1 class="title">The Sanskrit Reader Companion</h1>
<table class="chamois_back" border="0" cellpadding="0%" cellspacing="15pt" width="100%">
<tr><td>
<p align="center">
<div class="latin16"><a class="green" href="/cgi-bin/SKT/sktgraph?t=VH;lex=SH;cache=f;st=t;us=f;cp=t;text=tvafgati.h;topic=;abs=f;cpts=;mode=g">✓</a> Show Summary of Solutions
</p>
Input:
<span class="red16">tvaṅgatiḥ</span><hr>
<br>
Sentence:
<span class="deva16" lang="sa">त्वङ्गतिः</span><br>
may be analysed as:</div><br>
<hr>
<span class="blue">Solution 1 : <a class="green" href="/cgi-bin/SKT/sktparser?t=VH;lex=SH;cache=f;st=t;us=f;cp=t;text=tvafgati.h;topic=;abs=f;cpts=;mode=p;n=1">✓</a></span><br>
[ <span class="blue" title="0"><b>tvam</b></span><table class="light_blue_back">
<tr><th><span class="latin12"><tr><th><span class="latin12">{ nom. sg. * }[<a class="navy" href="http://sanskrit.inria.fr/DICO/53.html#yu.smad"><i>yuṣmad</i></a>]</span></th></tr></span></th></tr></table>⟨<span class="magenta">m</span><span class="green">|</span><span class="magenta">g</span><span class="blue"> → </span><span class="red">ṅg</span>⟩]
<br>
[ <span class="blue" title="4"><b>gatiḥ</b></span><table class="deep_sky_back">
<tr><th><span class="latin12"><tr><th><span class="latin12">{ nom. sg. f. }[<a class="navy" href="http://sanskrit.inria.fr/DICO/24.html#gati"><i>gati</i></a>]</span></th></tr></span></th></tr></table>⟨<span class="magenta">ḥ</span><span class="green">|</span><span class="magenta"></span><span class="blue"> → </span><span class="red">ḥ</span>⟩]
<br>
<br>
<hr>
<span class="magenta">1</span><span class="blue"> solution</span><span class="blue"> kept among </span><span class="magenta">1</span><br>
<br>
<hr>
<br>
<br>
</td></tr></table>
<table class="pad60">
<tr><td></td></tr></table>
<div class="enpied">
<table class="bandeau"><tr><td>
<a href="http://ocaml.org"><img src="http://sanskrit.inria.fr/IMAGES/ocaml.gif" alt="Le chameau Ocaml" height="50"></a>
</td><td>
<table class="center">
<tr><td>
<a href="http://sanskrit.inria.fr/index.fr.html"><b>Top</b></a> |
<a href="http://sanskrit.inria.fr/DICO/index.fr.html"><b>Index</b></a> |
<a href="http://sanskrit.inria.fr/DICO/index.fr.html#stemmer"><b>Stemmer</b></a> |
<a href="http://sanskrit.inria.fr/DICO/grammar.fr.html"><b>Grammar</b></a> |
<a href="http://sanskrit.inria.fr/DICO/sandhi.fr.html"><b>Sandhi</b></a> |
<a href="http://sanskrit.inria.fr/DICO/reader.fr.html"><b>Reader</b></a> |
<a href="http://sanskrit.inria.fr/faq.fr.html"><b>Help</b></a> |
<a href="http://sanskrit.inria.fr/portal.fr.html"><b>Portal</b></a>
</td></tr><tr><td>
© Gérard Huet 1994-2016</td></tr></table></td><td>
<a href="http://www.inria.fr/"><img src="http://sanskrit.inria.fr/IMAGES/logo_inria.png" alt="Logo Inria" height="50"></a>
<br></td></tr></table></div>
</body>
</html>
| sanskritiitd/sanskrit | uohCorpus.fil/uoh/uoh.filteredcorpus.txt_output/agnipuran-1-111-sandhi_ext.txt.out.dict_3334_inr.html | HTML | gpl-3.0 | 3,891 |
package n;
import static data.Limits.MAXNETNODES;
import static doom.NetConsts.CMD_GET;
import static doom.NetConsts.CMD_SEND;
import static doom.NetConsts.DOOMCOM_ID;
import i.DoomStatusAware;
import i.IDoomSystem;
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.SocketException;
import java.net.SocketTimeoutException;
import w.DoomBuffer;
import doom.DoomContext;
import doom.DoomMain;
import doom.DoomStatus;
import doom.doomcom_t;
import doom.doomdata_t;
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// $Id: BasicNetworkInterface.java,v 1.5 2011/05/26 13:39:06 velktron Exp $
//
// Copyright (C) 1993-1996 by id Software, Inc.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// $Log: BasicNetworkInterface.java,v $
// Revision 1.5 2011/05/26 13:39:06 velktron
// Now using ICommandLineManager
//
// Revision 1.4 2011/05/18 16:54:31 velktron
// Changed to DoomStatus
//
// Revision 1.3 2011/05/17 16:53:42 velktron
// _D_'s version.
//
// Revision 1.2 2010/12/20 17:15:08 velktron
// Made the renderer more OO -> TextureManager and other changes as well.
//
// Revision 1.1 2010/11/17 23:55:06 velktron
// Kind of playable/controllable.
//
// Revision 1.2 2010/11/11 15:31:28 velktron
// Fixed "warped floor" error.
//
// Revision 1.1 2010/10/22 16:22:43 velktron
// Renderer works stably enough but a ton of bleeding. Started working on netcode.
//
//
// DESCRIPTION:
//
//-----------------------------------------------------------------------------
public class BasicNetworkInterface
implements DoomSystemNetworking, DoomStatusAware {
public static final String rcsid = "$Id: BasicNetworkInterface.java,v 1.5 2011/05/26 13:39:06 velktron Exp $";
////////////// STATUS ///////////
IDoomSystem I;
protected DoomMain DM;
public BasicNetworkInterface(DoomContext DC){
this.DM=DC.DM;
//this.myargv=DM.myargv;
//this.myargc=DM.myargc;
sendData=new doomdata_t();
recvData=new doomdata_t();
// We can do that since the buffer is reused.
// Note: this will effectively tie doomdata and the datapacket.
recvPacket=new DatagramPacket(recvData.cached(),recvData.cached().length);
sendPacket=new DatagramPacket(sendData.cached(),sendData.cached().length);
}
// Bind it to the ones inside DN and DM;
//doomdata_t netbuffer;
doomcom_t doomcom;
// For some odd reason...
/** Changes endianness of a number */
public static int ntohl(int x) {
return ((((x & 0x000000ff) << 24) |
((x & 0x0000ff00) << 8) |
((x & 0x00ff0000) >>> 8) |
((x & 0xff000000) >>> 24)));
}
public static short ntohs(short x) {
return (short) (((x & 0x00ff) << 8) | ((x & 0xff00) >>> 8));
}
public static int htonl(int x) {
return ntohl(x);
}
public static short htons(short x){
return ntohs(x);
}
//void NetSend ();
//boolean NetListen ();
//
// NETWORKING
//
// Maes: come on, we all know it's 666.
int DOOMPORT = 666;//(IPPORT_USERRESERVED +0x1d );
//_D_: for testing purposes. If testing on the same machine, we can't have two UDP servers on the same port
int RECVPORT = DOOMPORT;
int SENDPORT = DOOMPORT;
//DatagramSocket sendsocket;
DatagramSocket insocket;
// MAES: closest java equivalent
DatagramSocket /*InetAddress*/ sendaddress[]=new DatagramSocket/*InetAddress*/[MAXNETNODES];
interface NetFunction {
public void invoke();
}
// To use inside packetsend. Declare once and reuse to save on heap costs.
private doomdata_t sendData;
private doomdata_t recvData;
// We also reuse always the same DatagramPacket, "peged" to sw's byte buffer.
private DatagramPacket recvPacket;
private DatagramPacket sendPacket;
public void sendSocketPacket(DatagramSocket ds, DatagramPacket dp) throws IOException {
ds.send(dp);
}
public PacketSend packetSend = new PacketSend();
public class PacketSend implements NetFunction {
@Override
public void invoke() {
int c;
doomdata_t netbuffer = DM.netbuffer;
// byte swap: so this is transferred as little endian? Ugh
/*sendData.checksum = htonl(netbuffer.checksum);
sendData.player = netbuffer.player;
sendData.retransmitfrom = netbuffer.retransmitfrom;
sendData.starttic = netbuffer.starttic;
sendData.numtics = netbuffer.numtics;
for (c=0 ; c< netbuffer.numtics ; c++)
{
sendData.cmds[c].forwardmove = netbuffer.cmds[c].forwardmove;
sendData.cmds[c].sidemove = netbuffer.cmds[c].sidemove;
sendData.cmds[c].angleturn = htons(netbuffer.cmds[c].angleturn);
sendData.cmds[c].consistancy = htons(netbuffer.cmds[c].consistancy);
sendData.cmds[c].chatchar = netbuffer.cmds[c].chatchar;
sendData.cmds[c].buttons = netbuffer.cmds[c].buttons;
}
*/
//printf ("sending %i\n",gametic);
sendData.copyFrom(netbuffer);
// MAES: This will force the buffer to be refreshed.
byte[] bytes = sendData.pack();
/*System.out.print("SEND >> Thisplayer: "+DM.consoleplayer+" numtics: "+sendData.numtics+" consistency: ");
for (doom.ticcmd_t t: sendData.cmds)
System.out.print(t.consistancy+",");
System.out.println();*/
// The socket already contains the address it needs,
// and the packet's buffer is already modified. Send away.
sendPacket.setData(bytes, 0, doomcom.datalength);
DatagramSocket sendsocket;
try {
sendsocket = sendaddress[doomcom.remotenode];
sendPacket.setSocketAddress(sendsocket.getRemoteSocketAddress());
sendSocketPacket(sendsocket, sendPacket);
} catch (Exception e) {
e.printStackTrace();
I.Error ("SendPacket error: %s",e.getMessage());
}
// if (c == -1)
// I_Error ("SendPacket error: %s",strerror(errno));
}
}
public void socketGetPacket(DatagramSocket ds, DatagramPacket dp) throws IOException {
ds.receive(dp);
}
// Used inside PacketGet
private boolean first=true;
public PacketGet packetGet = new PacketGet();
public class PacketGet implements NetFunction {
@Override
public void invoke() {
int i;
int c;
// Receive back into swp.
try {
//recvPacket.setSocketAddress(insocket.getLocalSocketAddress());
socketGetPacket(insocket, recvPacket);
}
catch (SocketTimeoutException e) {
doomcom.remotenode = -1; // no packet
return;
}
catch (Exception e)
{ if (e.getClass()!=java.nio.channels.IllegalBlockingModeException.class){
I.Error ("GetPacket: %s",e.getStackTrace());
}
}
recvData.unpack(recvPacket.getData());
InetAddress fromaddress = recvPacket.getAddress();
/*System.out.print("RECV << Thisplayer: "+DM.consoleplayer+" numtics: "+recvData.numtics+" consistency: ");
for (doom.ticcmd_t t: recvData.cmds)
System.out.print(t.consistancy+",");
System.out.println();*/
{
//static int first=1;
if (first){
sb.setLength(0);
sb.append("("+DM.consoleplayer+") PacketRECV len=");
sb.append(recvPacket.getLength());
sb.append(":p=[0x");
sb.append(Integer.toHexString(recvData.checksum));
sb.append(" 0x");
sb.append(DoomBuffer.getBEInt(recvData.retransmitfrom,recvData.starttic,recvData.player,recvData.numtics));
sb.append("numtics: "+recvData.numtics);
System.out.println(sb.toString());
first = false;
}
}
// find remote node number
for (i=0 ; i<doomcom.numnodes ; i++) {
if (sendaddress[i] != null) {
if (fromaddress.equals(sendaddress[i].getInetAddress()))
break;
}
}
if (i == doomcom.numnodes)
{
// packet is not from one of the players (new game broadcast)
doomcom.remotenode = -1; // no packet
return;
}
doomcom.remotenode = (short) i; // good packet from a game player
doomcom.datalength = (short) recvPacket.getLength();
//_D_: temporary hack to test two player on single machine
//doomcom.remotenode = (short)(RECVPORT-DOOMPORT);
// byte swap
/*doomdata_t netbuffer = DM.netbuffer;
netbuffer.checksum = ntohl(recvData.checksum);
netbuffer.player = recvData.player;
netbuffer.retransmitfrom = recvData.retransmitfrom;
netbuffer.starttic = recvData.starttic;
netbuffer.numtics = recvData.numtics;
for (c=0 ; c< netbuffer.numtics ; c++)
{
netbuffer.cmds[c].forwardmove = recvData.cmds[c].forwardmove;
netbuffer.cmds[c].sidemove = recvData.cmds[c].sidemove;
netbuffer.cmds[c].angleturn = ntohs(recvData.cmds[c].angleturn);
netbuffer.cmds[c].consistancy = ntohs(recvData.cmds[c].consistancy);
netbuffer.cmds[c].chatchar = recvData.cmds[c].chatchar;
netbuffer.cmds[c].buttons = recvData.cmds[c].buttons;
} */
DM.netbuffer.copyFrom(recvData);
}
};
// Maes: oh great. More function pointer "fun".
NetFunction netget = packetGet;
NetFunction netsend = packetSend;
//
// I_InitNetwork
//
@Override
public void InitNetwork() {
boolean trueval = true;
int i;
int p;
//struct hostent* hostentry; // host information entry
doomcom = new doomcom_t();
//netbuffer = new doomdata_t();
DM.setDoomCom(doomcom);
//DM.netbuffer = netbuffer;
// set up for network
i = DM.CM.CheckParm ("-dup");
if ((i!=0) && i< DM.CM.getArgc()-1)
{
doomcom.ticdup = (short) (DM.CM.getArgv(i+1).charAt(0)-'0');
if (doomcom.ticdup < 1)
doomcom.ticdup = 1;
if (doomcom.ticdup > 9)
doomcom.ticdup = 9;
}
else
doomcom. ticdup = 1;
if (DM.CM.CheckParm ("-extratic")!=0)
doomcom. extratics = 1;
else
doomcom. extratics = 0;
p = DM.CM.CheckParm ("-port");
if ((p!=0) && (p<DM.CM.getArgc()-1))
{
DOOMPORT = Integer.parseInt(DM.CM.getArgv(p+1));
System.out.println ("using alternate port "+DOOMPORT);
}
// parse network game options,
// -net <consoleplayer> <host> <host> ...
i = DM.CM.CheckParm ("-net");
if (i==0)
{
// single player game
DM.netgame = false;
doomcom.id = DOOMCOM_ID;
doomcom.numplayers = doomcom.numnodes = 1;
doomcom.deathmatch = 0; // false
doomcom.consoleplayer = 0;
return;
}
DM.netgame = true;
// parse player number and host list
doomcom.consoleplayer = (short) (DM.CM.getArgv(i+1).charAt(0)-'1');
RECVPORT = SENDPORT = DOOMPORT;
if (doomcom.consoleplayer == 0)
SENDPORT++;
else
RECVPORT++;
doomcom.numnodes = 1; // this node for sure
i++;
while (++i < DM.CM.getArgc() && DM.CM.getArgv(i).charAt(0) != '-')
{
try {
InetAddress addr = InetAddress.getByName(DM.CM.getArgv(i));
DatagramSocket ds = new DatagramSocket(null);
ds.setReuseAddress(true);
ds.connect(addr, SENDPORT);
sendaddress[doomcom.numnodes] = ds;
}catch (Exception e) {
e.printStackTrace();
}
doomcom.numnodes++;
}
doomcom.id = DOOMCOM_ID;
doomcom.numplayers = doomcom.numnodes;
// build message to receive
try {
insocket = new DatagramSocket(null);
insocket.setReuseAddress(true);
insocket.setSoTimeout(1);
insocket.bind(new InetSocketAddress(RECVPORT));
} catch (SocketException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
@Override
public void NetCmd() {
if (insocket == null) //HACK in case "netgame" is due to "addbot"
return;
if (DM.doomcom.command == CMD_SEND)
{
netsend.invoke ();
}
else if (doomcom.command == CMD_GET)
{
netget.invoke ();
}
else
I.Error ("Bad net cmd: %i\n",doomcom.command);
}
// Instance StringBuilder
private StringBuilder sb=new StringBuilder();
@Override
public void updateStatus(DoomStatus DC) {
// TODO Auto-generated method stub
}
}
| SpleenOfDoom/MochaDoom | src/n/BasicNetworkInterface.java | Java | gpl-3.0 | 14,007 |
var searchData=
[
['k_5fcoeff',['K_coeff',['../classsage__circuit__analysis_1_1SmallSignalLinearCircuit.html#a31b504e6f11875560fc819cc591a5283',1,'sage_circuit_analysis.SmallSignalLinearCircuit.K_coeff()'],['../classsage__circuit__analysis_1_1SmallSignalLinearCircuit.html#a9d21174a0350225ee439c9b509035c34',1,'sage_circuit_analysis.SmallSignalLinearCircuit.K_coeff()']]],
['kind_5fexpr',['KIND_EXPR',['../namespacesage__circuit__analysis.html#a4d87352a85623b7cc6ab51c2f07165fb',1,'sage_circuit_analysis']]],
['kind_5fid',['kind_id',['../classsage__circuit__analysis_1_1SmallSignalLinearCircuit.html#aa8b02260c5b339c7d6d5411c0503737f',1,'sage_circuit_analysis::SmallSignalLinearCircuit']]],
['kind_5fline_5fdata',['kind_line_data',['../classsage__circuit__analysis_1_1SmallSignalLinearCircuit.html#a06d139ba1b6ae057950ca8b6620a7e6a',1,'sage_circuit_analysis::SmallSignalLinearCircuit']]],
['kind_5flineptr',['kind_lineptr',['../classsage__circuit__analysis_1_1SmallSignalLinearCircuit.html#a0c320f651aea96aa531713dd28e17752',1,'sage_circuit_analysis::SmallSignalLinearCircuit']]]
];
| alessandro-bernardini/SAPICE | html/search/variables_6b.js | JavaScript | gpl-3.0 | 1,093 |
# Files
Files for use with the copy module.
| zardah/pierwszy | roles/__layout_template__/files/README.md | Markdown | gpl-3.0 | 46 |
/*
* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef WEBRTC_TEST_RTP_RTCP_OBSERVER_H_
#define WEBRTC_TEST_RTP_RTCP_OBSERVER_H_
#include <map>
#include <memory>
#include <vector>
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/base/criticalsection.h"
#include "webrtc/base/event.h"
#include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h"
#include "webrtc/test/constants.h"
#include "webrtc/test/direct_transport.h"
#include "webrtc/typedefs.h"
#include "webrtc/video_send_stream.h"
namespace webrtc {
namespace test {
class PacketTransport;
class RtpRtcpObserver {
public:
enum Action {
SEND_PACKET,
DROP_PACKET,
};
virtual ~RtpRtcpObserver() {}
virtual bool Wait() { return observation_complete_.Wait(timeout_ms_); }
virtual Action OnSendRtp(const uint8_t* packet, size_t length) {
return SEND_PACKET;
}
virtual Action OnSendRtcp(const uint8_t* packet, size_t length) {
return SEND_PACKET;
}
virtual Action OnReceiveRtp(const uint8_t* packet, size_t length) {
return SEND_PACKET;
}
virtual Action OnReceiveRtcp(const uint8_t* packet, size_t length) {
return SEND_PACKET;
}
protected:
explicit RtpRtcpObserver(int event_timeout_ms)
: observation_complete_(false, false),
parser_(RtpHeaderParser::Create()),
timeout_ms_(event_timeout_ms) {
parser_->RegisterRtpHeaderExtension(kRtpExtensionTransmissionTimeOffset,
kTOffsetExtensionId);
parser_->RegisterRtpHeaderExtension(kRtpExtensionAbsoluteSendTime,
kAbsSendTimeExtensionId);
parser_->RegisterRtpHeaderExtension(kRtpExtensionTransportSequenceNumber,
kTransportSequenceNumberExtensionId);
}
rtc::Event observation_complete_;
const std::unique_ptr<RtpHeaderParser> parser_;
private:
const int timeout_ms_;
};
class PacketTransport : public test::DirectTransport {
public:
enum TransportType { kReceiver, kSender };
PacketTransport(Call* send_call,
RtpRtcpObserver* observer,
TransportType transport_type,
const FakeNetworkPipe::Config& configuration)
: test::DirectTransport(configuration, send_call),
observer_(observer),
transport_type_(transport_type) {}
private:
bool SendRtp(const uint8_t* packet,
size_t length,
const PacketOptions& options) override {
EXPECT_FALSE(RtpHeaderParser::IsRtcp(packet, length));
RtpRtcpObserver::Action action;
{
if (transport_type_ == kSender) {
action = observer_->OnSendRtp(packet, length);
} else {
action = observer_->OnReceiveRtp(packet, length);
}
}
switch (action) {
case RtpRtcpObserver::DROP_PACKET:
// Drop packet silently.
return true;
case RtpRtcpObserver::SEND_PACKET:
return test::DirectTransport::SendRtp(packet, length, options);
}
return true; // Will never happen, makes compiler happy.
}
bool SendRtcp(const uint8_t* packet, size_t length) override {
EXPECT_TRUE(RtpHeaderParser::IsRtcp(packet, length));
RtpRtcpObserver::Action action;
{
if (transport_type_ == kSender) {
action = observer_->OnSendRtcp(packet, length);
} else {
action = observer_->OnReceiveRtcp(packet, length);
}
}
switch (action) {
case RtpRtcpObserver::DROP_PACKET:
// Drop packet silently.
return true;
case RtpRtcpObserver::SEND_PACKET:
return test::DirectTransport::SendRtcp(packet, length);
}
return true; // Will never happen, makes compiler happy.
}
RtpRtcpObserver* const observer_;
TransportType transport_type_;
};
} // namespace test
} // namespace webrtc
#endif // WEBRTC_TEST_RTP_RTCP_OBSERVER_H_
| golden1232004/webrtc_new | webrtc/test/rtp_rtcp_observer.h | C | gpl-3.0 | 4,236 |
package me.mrCookieSlime.Slimefun.Objects.SlimefunItem.machines;
import java.util.ArrayList;
import java.util.List;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.InvUtils;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.Item.CustomItem;
import me.mrCookieSlime.Slimefun.Lists.RecipeType;
import me.mrCookieSlime.Slimefun.Lists.SlimefunItems;
import me.mrCookieSlime.Slimefun.Objects.Category;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.AContainer;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.MachineHelper;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.MachineRecipe;
import me.mrCookieSlime.Slimefun.Setup.SlimefunManager;
import me.mrCookieSlime.Slimefun.api.BlockStorage;
import me.mrCookieSlime.Slimefun.api.energy.ChargableBlock;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.material.MaterialData;
public abstract class Refinery extends AContainer {
public Refinery(Category category, ItemStack item, String name, RecipeType recipeType, ItemStack[] recipe) {
super(category, item, name, recipeType, recipe);
}
@Override
public String getInventoryTitle() {
return "&cRefinery";
}
@Override
public ItemStack getProgressBar() {
return new ItemStack(Material.FLINT_AND_STEEL);
}
@Override
public void registerDefaultRecipes() {}
@Override
public String getMachineIdentifier() {
return "REFINERY";
}
@SuppressWarnings("deprecation")
protected void tick(Block b) {
if (isProcessing(b)) {
int timeleft = progress.get(b);
if (timeleft > 0) {
ItemStack item = getProgressBar().clone();
item.setDurability(MachineHelper.getDurability(item, timeleft, processing.get(b).getTicks()));
ItemMeta im = item.getItemMeta();
im.setDisplayName(" ");
List<String> lore = new ArrayList<String>();
lore.add(MachineHelper.getProgress(timeleft, processing.get(b).getTicks()));
lore.add("");
lore.add(MachineHelper.getTimeLeft(timeleft / 2));
im.setLore(lore);
item.setItemMeta(im);
BlockStorage.getInventory(b).replaceExistingItem(22, item);
if (ChargableBlock.isChargable(b)) {
if (ChargableBlock.getCharge(b) < getEnergyConsumption()) return;
ChargableBlock.addCharge(b, -getEnergyConsumption());
progress.put(b, timeleft - 1);
}
else progress.put(b, timeleft - 1);
}
else {
BlockStorage.getInventory(b).replaceExistingItem(22, new CustomItem(new MaterialData(Material.STAINED_GLASS_PANE, (byte) 15), " "));
pushItems(b, processing.get(b).getOutput());
progress.remove(b);
processing.remove(b);
}
}
else {
for (int slot: getInputSlots()) {
if (SlimefunManager.isItemSimiliar(BlockStorage.getInventory(b).getItemInSlot(slot), SlimefunItems.BUCKET_OF_OIL, true)) {
MachineRecipe r = new MachineRecipe(40, new ItemStack[0], new ItemStack[] {SlimefunItems.BUCKET_OF_FUEL});
if (!fits(b, r.getOutput())) return;
BlockStorage.getInventory(b).replaceExistingItem(slot, InvUtils.decreaseItem(BlockStorage.getInventory(b).getItemInSlot(slot), 1));
processing.put(b, r);
progress.put(b, r.getTicks());
break;
}
}
}
}
}
| Joapple/Slimefun4 | src/me/mrCookieSlime/Slimefun/Objects/SlimefunItem/machines/Refinery.java | Java | gpl-3.0 | 3,310 |
/*
* Copyright 2013 The LibYuv Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef INCLUDE_LIBYUV_ROTATE_ROW_H_
#define INCLUDE_LIBYUV_ROTATE_ROW_H_
#include "libyuv/basic_types.h"
#ifdef __cplusplus
namespace libyuv {
extern "C" {
#endif
#if defined(__pnacl__) || defined(__CLR_VER) || \
(defined(__native_client__) && defined(__x86_64__)) || \
(defined(__i386__) && !defined(__SSE__) && !defined(__clang__))
#define LIBYUV_DISABLE_X86
#endif
#if defined(__native_client__)
#define LIBYUV_DISABLE_NEON
#endif
// MemorySanitizer does not support assembly code yet. http://crbug.com/344505
#if defined(__has_feature)
#if __has_feature(memory_sanitizer)
#define LIBYUV_DISABLE_X86
#endif
#endif
// The following are available for Visual C 32 bit:
#if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && defined(_MSC_VER) && \
!defined(__clang__)
#define HAS_TRANSPOSEWX8_SSSE3
#define HAS_TRANSPOSEUVWX8_SSE2
#endif
// The following are available for GCC 32 or 64 bit:
#if !defined(LIBYUV_DISABLE_X86) && (defined(__i386__) || defined(__x86_64__))
#define HAS_TRANSPOSEWX8_SSSE3
#endif
// The following are available for 64 bit GCC:
#if !defined(LIBYUV_DISABLE_X86) && defined(__x86_64__)
#define HAS_TRANSPOSEWX8_FAST_SSSE3
#define HAS_TRANSPOSEUVWX8_SSE2
#endif
#if !defined(LIBYUV_DISABLE_NEON) && \
(defined(__ARM_NEON__) || defined(LIBYUV_NEON) || defined(__aarch64__))
#define HAS_TRANSPOSEWX8_NEON
#define HAS_TRANSPOSEUVWX8_NEON
#endif
#if !defined(LIBYUV_DISABLE_MSA) && defined(__mips_msa)
#define HAS_TRANSPOSEWX16_MSA
#define HAS_TRANSPOSEUVWX16_MSA
#endif
#if !defined(LIBYUV_DISABLE_LSX) && defined(__loongarch_sx)
#define HAS_TRANSPOSEWX16_LSX
#define HAS_TRANSPOSEUVWX16_LSX
#endif
void TransposeWxH_C(const uint8_t* src,
int src_stride,
uint8_t* dst,
int dst_stride,
int width,
int height);
void TransposeWx8_C(const uint8_t* src,
int src_stride,
uint8_t* dst,
int dst_stride,
int width);
void TransposeWx16_C(const uint8_t* src,
int src_stride,
uint8_t* dst,
int dst_stride,
int width);
void TransposeWx8_NEON(const uint8_t* src,
int src_stride,
uint8_t* dst,
int dst_stride,
int width);
void TransposeWx8_SSSE3(const uint8_t* src,
int src_stride,
uint8_t* dst,
int dst_stride,
int width);
void TransposeWx8_Fast_SSSE3(const uint8_t* src,
int src_stride,
uint8_t* dst,
int dst_stride,
int width);
void TransposeWx16_MSA(const uint8_t* src,
int src_stride,
uint8_t* dst,
int dst_stride,
int width);
void TransposeWx16_LSX(const uint8_t* src,
int src_stride,
uint8_t* dst,
int dst_stride,
int width);
void TransposeWx8_Any_NEON(const uint8_t* src,
int src_stride,
uint8_t* dst,
int dst_stride,
int width);
void TransposeWx8_Any_SSSE3(const uint8_t* src,
int src_stride,
uint8_t* dst,
int dst_stride,
int width);
void TransposeWx8_Fast_Any_SSSE3(const uint8_t* src,
int src_stride,
uint8_t* dst,
int dst_stride,
int width);
void TransposeWx16_Any_MSA(const uint8_t* src,
int src_stride,
uint8_t* dst,
int dst_stride,
int width);
void TransposeWx16_Any_LSX(const uint8_t* src,
int src_stride,
uint8_t* dst,
int dst_stride,
int width);
void TransposeUVWxH_C(const uint8_t* src,
int src_stride,
uint8_t* dst_a,
int dst_stride_a,
uint8_t* dst_b,
int dst_stride_b,
int width,
int height);
void TransposeUVWx8_C(const uint8_t* src,
int src_stride,
uint8_t* dst_a,
int dst_stride_a,
uint8_t* dst_b,
int dst_stride_b,
int width);
void TransposeUVWx16_C(const uint8_t* src,
int src_stride,
uint8_t* dst_a,
int dst_stride_a,
uint8_t* dst_b,
int dst_stride_b,
int width);
void TransposeUVWx8_SSE2(const uint8_t* src,
int src_stride,
uint8_t* dst_a,
int dst_stride_a,
uint8_t* dst_b,
int dst_stride_b,
int width);
void TransposeUVWx8_NEON(const uint8_t* src,
int src_stride,
uint8_t* dst_a,
int dst_stride_a,
uint8_t* dst_b,
int dst_stride_b,
int width);
void TransposeUVWx16_MSA(const uint8_t* src,
int src_stride,
uint8_t* dst_a,
int dst_stride_a,
uint8_t* dst_b,
int dst_stride_b,
int width);
void TransposeUVWx16_LSX(const uint8_t* src,
int src_stride,
uint8_t* dst_a,
int dst_stride_a,
uint8_t* dst_b,
int dst_stride_b,
int width);
void TransposeUVWx8_Any_SSE2(const uint8_t* src,
int src_stride,
uint8_t* dst_a,
int dst_stride_a,
uint8_t* dst_b,
int dst_stride_b,
int width);
void TransposeUVWx8_Any_NEON(const uint8_t* src,
int src_stride,
uint8_t* dst_a,
int dst_stride_a,
uint8_t* dst_b,
int dst_stride_b,
int width);
void TransposeUVWx16_Any_MSA(const uint8_t* src,
int src_stride,
uint8_t* dst_a,
int dst_stride_a,
uint8_t* dst_b,
int dst_stride_b,
int width);
void TransposeUVWx16_Any_LSX(const uint8_t* src,
int src_stride,
uint8_t* dst_a,
int dst_stride_a,
uint8_t* dst_b,
int dst_stride_b,
int width);
#ifdef __cplusplus
} // extern "C"
} // namespace libyuv
#endif
#endif // INCLUDE_LIBYUV_ROTATE_ROW_H_
| igormironchik/security-cam | 3rdparty/libyuv/include/libyuv/rotate_row.h | C | gpl-3.0 | 8,141 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.