code
stringlengths
4
1.01M
language
stringclasses
2 values
package org.amse.marinaSokol.model.interfaces.object.net; public interface IActivationFunctor { /** * Ôóíêöèÿ àêòèâàöèè * @param x - ÷èñëî, ïîäàííîå íà ôóíêöèþ àêòèâàöèè * @return âûõîä íåéðîíà * */ double getFunction(double x); /** * ïðîèçâîäíàÿ ôóíêöèè àêòèâàöèè * @param x - ÷èñëî, ïîäàííîå íà ôóíêöèþ * @return âûõîä * */ double getDerivation(double x); /** * Èìÿ ôóíêöèè àêòèâàöèè * @return èìÿ ôóíêöèè àêòèâàöèè * */ String getNameFunction(); }
Java
/* SPDX-FileCopyrightText: 2007 Jean-Baptiste Mardelle <jb@kdenlive.org> SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL */ #include "definitions.h" #include <klocalizedstring.h> #include <QColor> #include <utility> #ifdef CRASH_AUTO_TEST #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wsign-conversion" #pragma GCC diagnostic ignored "-Wfloat-equal" #pragma GCC diagnostic ignored "-Wshadow" #pragma GCC diagnostic ignored "-Wpedantic" #include <rttr/registration> #pragma GCC diagnostic pop RTTR_REGISTRATION { using namespace rttr; // clang-format off registration::enumeration<GroupType>("GroupType")( value("Normal", GroupType::Normal), value("Selection", GroupType::Selection), value("AVSplit", GroupType::AVSplit), value("Leaf", GroupType::Leaf) ); registration::enumeration<PlaylistState::ClipState>("PlaylistState")( value("VideoOnly", PlaylistState::VideoOnly), value("AudioOnly", PlaylistState::AudioOnly), value("Disabled", PlaylistState::Disabled) ); // clang-format on } #endif QDebug operator<<(QDebug qd, const ItemInfo &info) { qd << "ItemInfo " << &info; qd << "\tTrack" << info.track; qd << "\tStart pos: " << info.startPos.toString(); qd << "\tEnd pos: " << info.endPos.toString(); qd << "\tCrop start: " << info.cropStart.toString(); qd << "\tCrop duration: " << info.cropDuration.toString(); return qd.maybeSpace(); } CommentedTime::CommentedTime() : m_time(GenTime(0)) { } CommentedTime::CommentedTime(const GenTime &time, QString comment, int markerType) : m_time(time) , m_comment(std::move(comment)) , m_type(markerType) { } CommentedTime::CommentedTime(const QString &hash, const GenTime &time) : m_time(time) , m_comment(hash.section(QLatin1Char(':'), 1)) , m_type(hash.section(QLatin1Char(':'), 0, 0).toInt()) { } QString CommentedTime::comment() const { return (m_comment.isEmpty() ? i18n("Marker") : m_comment); } GenTime CommentedTime::time() const { return m_time; } void CommentedTime::setComment(const QString &comm) { m_comment = comm; } void CommentedTime::setTime(const GenTime &t) { m_time = t; } void CommentedTime::setMarkerType(int newtype) { m_type = newtype; } QString CommentedTime::hash() const { return QString::number(m_type) + QLatin1Char(':') + (m_comment.isEmpty() ? i18n("Marker") : m_comment); } int CommentedTime::markerType() const { return m_type; } bool CommentedTime::operator>(const CommentedTime &op) const { return m_time > op.time(); } bool CommentedTime::operator<(const CommentedTime &op) const { return m_time < op.time(); } bool CommentedTime::operator>=(const CommentedTime &op) const { return m_time >= op.time(); } bool CommentedTime::operator<=(const CommentedTime &op) const { return m_time <= op.time(); } bool CommentedTime::operator==(const CommentedTime &op) const { return m_time == op.time(); } bool CommentedTime::operator!=(const CommentedTime &op) const { return m_time != op.time(); } const QString groupTypeToStr(GroupType t) { switch (t) { case GroupType::Normal: return QStringLiteral("Normal"); case GroupType::Selection: return QStringLiteral("Selection"); case GroupType::AVSplit: return QStringLiteral("AVSplit"); case GroupType::Leaf: return QStringLiteral("Leaf"); } Q_ASSERT(false); return QString(); } GroupType groupTypeFromStr(const QString &s) { std::vector<GroupType> types{GroupType::Selection, GroupType::Normal, GroupType::AVSplit, GroupType::Leaf}; for (const auto &t : types) { if (s == groupTypeToStr(t)) { return t; } } Q_ASSERT(false); return GroupType::Normal; } std::pair<bool, bool> stateToBool(PlaylistState::ClipState state) { return {state == PlaylistState::VideoOnly, state == PlaylistState::AudioOnly}; } PlaylistState::ClipState stateFromBool(std::pair<bool, bool> av) { Q_ASSERT(!av.first || !av.second); if (av.first) { return PlaylistState::VideoOnly; } else if (av.second) { return PlaylistState::AudioOnly; } else { return PlaylistState::Disabled; } } SubtitledTime::SubtitledTime() : m_starttime(0) , m_endtime(0) { } SubtitledTime::SubtitledTime(const GenTime &start, QString sub, const GenTime &end) : m_starttime(start) , m_subtitle(std::move(sub)) , m_endtime(end) { } QString SubtitledTime::subtitle() const { return m_subtitle; } GenTime SubtitledTime::start() const { return m_starttime; } GenTime SubtitledTime::end() const { return m_endtime; } void SubtitledTime::setSubtitle(const QString& sub) { m_subtitle = sub; } void SubtitledTime::setEndTime(const GenTime& end) { m_endtime = end; } bool SubtitledTime::operator>(const SubtitledTime& op) const { return(m_starttime > op.m_starttime && m_endtime > op.m_endtime && m_starttime > op.m_endtime); } bool SubtitledTime::operator<(const SubtitledTime& op) const { return(m_starttime < op.m_starttime && m_endtime < op.m_endtime && m_endtime < op.m_starttime); } bool SubtitledTime::operator==(const SubtitledTime& op) const { return(m_starttime == op.m_starttime && m_endtime == op.m_endtime); } bool SubtitledTime::operator!=(const SubtitledTime& op) const { return(m_starttime != op.m_starttime && m_endtime != op.m_endtime); }
Java
// ------------------------------------------------------------------------------------------ // Licensed by Interprise Solutions. // http://www.InterpriseSolutions.com // For details on this license please visit the product homepage at the URL above. // THE ABOVE NOTICE MUST REMAIN INTACT. // ------------------------------------------------------------------------------------------ using System; using InterpriseSuiteEcommerceCommon; using InterpriseSuiteEcommerceCommon.InterpriseIntegration; namespace InterpriseSuiteEcommerce { /// <summary> /// Summary description for tableorder_process. /// </summary> public partial class tableorder_process : System.Web.UI.Page { protected void Page_Load(object sender, System.EventArgs e) { Response.CacheControl = "private"; Response.Expires = 0; Response.AddHeader("pragma", "no-cache"); Customer ThisCustomer = ((InterpriseSuiteEcommercePrincipal)Context.User).ThisCustomer; ThisCustomer.RequireCustomerRecord(); InterpriseShoppingCart cart = new InterpriseShoppingCart(null, 1, ThisCustomer, CartTypeEnum.ShoppingCart, String.Empty, false,true); bool redirectToWishList = false; foreach (string key in Request.Form.AllKeys) { try { if (!key.StartsWith("ProductID")) { continue; } // retrieve the item counter // This may look obvious 4 but we want to make it expressive string itemCounterValue = Request.Form[key]; string quantityOrderedValue = Request.Form["Quantity"]; if (string.IsNullOrEmpty(quantityOrderedValue)) { quantityOrderedValue = Request.Form["Quantity_" + itemCounterValue]; if (!string.IsNullOrEmpty(quantityOrderedValue)) { quantityOrderedValue = quantityOrderedValue.Split(',')[0]; } } int counter = 0; int quantityOrdered = 0; if (!string.IsNullOrEmpty(itemCounterValue) && int.TryParse(itemCounterValue, out counter) && !string.IsNullOrEmpty(quantityOrderedValue) && int.TryParse(quantityOrderedValue, out quantityOrdered) && quantityOrdered > 0) { string unitMeasureFieldKey = "UnitMeasureCode_" + counter.ToString(); bool useDefaultUnitMeasure = string.IsNullOrEmpty(Request.Form[unitMeasureFieldKey]); string isWishListFieldKey = "IsWishList_" + counter.ToString(); bool isWishList = !string.IsNullOrEmpty(Request.Form[isWishListFieldKey]); redirectToWishList = isWishList; // we've got a valid counter string itemCode = string.Empty; using (var con = DB.NewSqlConnection()) { con.Open(); using (var reader = DB.GetRSFormat(con, "SELECT ItemCode FROM InventoryItem with (NOLOCK) WHERE Counter = {0}", counter)) { if (reader.Read()) { itemCode = DB.RSField(reader, "ItemCode"); } } } if(!string.IsNullOrEmpty(itemCode)) { UnitMeasureInfo? umInfo = null; if(!useDefaultUnitMeasure) { umInfo = InterpriseHelper.GetItemUnitMeasure(itemCode, Request.Form[unitMeasureFieldKey]); } if(null == umInfo && useDefaultUnitMeasure) { umInfo = InterpriseHelper.GetItemDefaultUnitMeasure(itemCode); } if (null != umInfo && umInfo.HasValue) { if (isWishList) { cart.CartType = CartTypeEnum.WishCart; } cart.AddItem(ThisCustomer, ThisCustomer.PrimaryShippingAddressID, itemCode, counter, quantityOrdered, umInfo.Value.Code, CartTypeEnum.ShoppingCart); //, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, CartTypeEnum.ShoppingCart, false, false, string.Empty, decimal.Zero); } } } } catch { // do nothing, add the items that we can } } if (redirectToWishList) { Response.Redirect("WishList.aspx"); } else { Response.Redirect("ShoppingCart.aspx?add=true"); } } } }
Java
<?php /** * WooCommerce Admin Webhooks Class * * @author WooThemes * @category Admin * @package WooCommerce/Admin * @version 2.4.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } /** * WC_Admin_Webhooks. */ class WC_Admin_Webhooks { /** * Initialize the webhooks admin actions. */ public function __construct() { add_action( 'admin_init', array( $this, 'actions' ) ); } /** * Check if is webhook settings page. * * @return bool */ private function is_webhook_settings_page() { return isset( $_GET['page'] ) && 'wc-settings' == $_GET['page'] && isset( $_GET['tab'] ) && 'api' == $_GET['tab'] && isset( $_GET['section'] ) && 'webhooks' == isset( $_GET['section'] ); } /** * Updated the Webhook name. * * @param int $webhook_id */ private function update_name( $webhook_id ) { global $wpdb; // @codingStandardsIgnoreStart $name = ! empty( $_POST['webhook_name'] ) ? $_POST['webhook_name'] : sprintf( __( 'Webhook created on %s', 'woocommerce' ), strftime( _x( '%b %d, %Y @ %I:%M %p', 'Webhook created on date parsed by strftime', 'woocommerce' ) ) ); // @codingStandardsIgnoreEnd $wpdb->update( $wpdb->posts, array( 'post_title' => $name ), array( 'ID' => $webhook_id ) ); } /** * Updated the Webhook status. * * @param WC_Webhook $webhook */ private function update_status( $webhook ) { $status = ! empty( $_POST['webhook_status'] ) ? wc_clean( $_POST['webhook_status'] ) : ''; $webhook->update_status( $status ); } /** * Updated the Webhook delivery URL. * * @param WC_Webhook $webhook */ private function update_delivery_url( $webhook ) { $delivery_url = ! empty( $_POST['webhook_delivery_url'] ) ? $_POST['webhook_delivery_url'] : ''; if ( wc_is_valid_url( $delivery_url ) ) { $webhook->set_delivery_url( $delivery_url ); } } /** * Updated the Webhook secret. * * @param WC_Webhook $webhook */ private function update_secret( $webhook ) { $secret = ! empty( $_POST['webhook_secret'] ) ? $_POST['webhook_secret'] : wp_generate_password( 50, true, true ); $webhook->set_secret( $secret ); } /** * Updated the Webhook topic. * * @param WC_Webhook $webhook */ private function update_topic( $webhook ) { if ( ! empty( $_POST['webhook_topic'] ) ) { $resource = ''; $event = ''; switch ( $_POST['webhook_topic'] ) { case 'custom' : if ( ! empty( $_POST['webhook_custom_topic'] ) ) { list( $resource, $event ) = explode( '.', wc_clean( $_POST['webhook_custom_topic'] ) ); } break; case 'action' : $resource = 'action'; $event = ! empty( $_POST['webhook_action_event'] ) ? wc_clean( $_POST['webhook_action_event'] ) : ''; break; default : list( $resource, $event ) = explode( '.', wc_clean( $_POST['webhook_topic'] ) ); break; } $topic = $resource . '.' . $event; if ( wc_is_webhook_valid_topic( $topic ) ) { $webhook->set_topic( $topic ); } } } /** * Save method. */ private function save() { if ( empty( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'woocommerce-settings' ) ) { wp_die( __( 'Action failed. Please refresh the page and retry.', 'woocommerce' ) ); } $webhook_id = absint( $_POST['webhook_id'] ); if ( ! current_user_can( 'edit_shop_webhook', $webhook_id ) ) { return; } $webhook = new WC_Webhook( $webhook_id ); // Name $this->update_name( $webhook->id ); // Status $this->update_status( $webhook ); // Delivery URL $this->update_delivery_url( $webhook ); // Secret $this->update_secret( $webhook ); // Topic $this->update_topic( $webhook ); // Update date. wp_update_post( array( 'ID' => $webhook->id, 'post_modified' => current_time( 'mysql' ) ) ); // Run actions do_action( 'woocommerce_webhook_options_save', $webhook->id ); delete_transient( 'woocommerce_webhook_ids' ); // Ping the webhook at the first time that is activated $pending_delivery = get_post_meta( $webhook->id, '_webhook_pending_delivery', true ); if ( isset( $_POST['webhook_status'] ) && 'active' === $_POST['webhook_status'] && $pending_delivery ) { $result = $webhook->deliver_ping(); if ( is_wp_error( $result ) ) { // Redirect to webhook edit page to avoid settings save actions wp_safe_redirect( admin_url( 'admin.php?page=wc-settings&tab=api&section=webhooks&edit-webhook=' . $webhook->id . '&error=' . urlencode( $result->get_error_message() ) ) ); exit(); } } // Redirect to webhook edit page to avoid settings save actions wp_safe_redirect( admin_url( 'admin.php?page=wc-settings&tab=api&section=webhooks&edit-webhook=' . $webhook->id . '&updated=1' ) ); exit(); } /** * Create Webhook. */ private function create() { if ( empty( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'create-webhook' ) ) { wp_die( __( 'Action failed. Please refresh the page and retry.', 'woocommerce' ) ); } if ( ! current_user_can( 'publish_shop_webhooks' ) ) { wp_die( __( 'You don\'t have permissions to create Webhooks!', 'woocommerce' ) ); } $webhook_id = wp_insert_post( array( 'post_type' => 'shop_webhook', 'post_status' => 'pending', 'ping_status' => 'closed', 'post_author' => get_current_user_id(), 'post_password' => strlen( ( $password = uniqid( 'webhook_' ) ) ) > 20 ? substr( $password, 0, 20 ) : $password, // @codingStandardsIgnoreStart 'post_title' => sprintf( __( 'Webhook created on %s', 'woocommerce' ), strftime( _x( '%b %d, %Y @ %I:%M %p', 'Webhook created on date parsed by strftime', 'woocommerce' ) ) ), // @codingStandardsIgnoreEnd 'comment_status' => 'open', ) ); if ( is_wp_error( $webhook_id ) ) { wp_die( $webhook_id->get_error_messages() ); } update_post_meta( $webhook_id, '_webhook_pending_delivery', true ); delete_transient( 'woocommerce_webhook_ids' ); // Redirect to edit page wp_redirect( admin_url( 'admin.php?page=wc-settings&tab=api&section=webhooks&edit-webhook=' . $webhook_id . '&created=1' ) ); exit(); } /** * Bulk trash/delete. * * @param array $webhooks * @param bool $delete */ private function bulk_trash( $webhooks, $delete = false ) { foreach ( $webhooks as $webhook_id ) { if ( $delete ) { wp_delete_post( $webhook_id, true ); } else { wp_trash_post( $webhook_id ); } } $type = ! EMPTY_TRASH_DAYS || $delete ? 'deleted' : 'trashed'; $qty = count( $webhooks ); $status = isset( $_GET['status'] ) ? '&status=' . sanitize_text_field( $_GET['status'] ) : ''; delete_transient( 'woocommerce_webhook_ids' ); // Redirect to webhooks page wp_redirect( admin_url( 'admin.php?page=wc-settings&tab=api&section=webhooks' . $status . '&' . $type . '=' . $qty ) ); exit(); } /** * Bulk untrash. * * @param array $webhooks */ private function bulk_untrash( $webhooks ) { foreach ( $webhooks as $webhook_id ) { wp_untrash_post( $webhook_id ); } $qty = count( $webhooks ); delete_transient( 'woocommerce_webhook_ids' ); // Redirect to webhooks page wp_redirect( admin_url( 'admin.php?page=wc-settings&tab=api&section=webhooks&status=trash&untrashed=' . $qty ) ); exit(); } /** * Bulk actions. */ private function bulk_actions() { if ( empty( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'woocommerce-settings' ) ) { wp_die( __( 'Action failed. Please refresh the page and retry.', 'woocommerce' ) ); } if ( ! current_user_can( 'edit_shop_webhooks' ) ) { wp_die( __( 'You don\'t have permissions to edit Webhooks!', 'woocommerce' ) ); } $webhooks = array_map( 'absint', (array) $_GET['webhook'] ); switch ( $_GET['action'] ) { case 'trash' : $this->bulk_trash( $webhooks ); break; case 'untrash' : $this->bulk_untrash( $webhooks ); break; case 'delete' : $this->bulk_trash( $webhooks, true ); break; default : break; } } /** * Empty Trash. */ private function empty_trash() { if ( empty( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'empty_trash' ) ) { wp_die( __( 'Action failed. Please refresh the page and retry.', 'woocommerce' ) ); } if ( ! current_user_can( 'delete_shop_webhooks' ) ) { wp_die( __( 'You don\'t have permissions to delete Webhooks!', 'woocommerce' ) ); } $webhooks = get_posts( array( 'post_type' => 'shop_webhook', 'ignore_sticky_posts' => true, 'nopaging' => true, 'post_status' => 'trash', 'fields' => 'ids', ) ); foreach ( $webhooks as $webhook_id ) { wp_delete_post( $webhook_id, true ); } $qty = count( $webhooks ); // Redirect to webhooks page wp_redirect( admin_url( 'admin.php?page=wc-settings&tab=api&section=webhooks&deleted=' . $qty ) ); exit(); } /** * Webhooks admin actions. */ public function actions() { if ( $this->is_webhook_settings_page() ) { // Save if ( isset( $_POST['save'] ) && isset( $_POST['webhook_id'] ) ) { $this->save(); } // Create if ( isset( $_GET['create-webhook'] ) ) { $this->create(); } // Bulk actions if ( isset( $_GET['action'] ) && isset( $_GET['webhook'] ) ) { $this->bulk_actions(); } // Empty trash if ( isset( $_GET['empty_trash'] ) ) { $this->empty_trash(); } } } /** * Page output. */ public static function page_output() { // Hide the save button $GLOBALS['hide_save_button'] = true; if ( isset( $_GET['edit-webhook'] ) ) { $webhook_id = absint( $_GET['edit-webhook'] ); $webhook = new WC_Webhook( $webhook_id ); if ( 'trash' != $webhook->post_data->post_status ) { include( 'settings/views/html-webhooks-edit.php' ); return; } } self::table_list_output(); } /** * Notices. */ public static function notices() { if ( isset( $_GET['trashed'] ) ) { $trashed = absint( $_GET['trashed'] ); WC_Admin_Settings::add_message( sprintf( _n( '1 webhook moved to the Trash.', '%d webhooks moved to the Trash.', $trashed, 'woocommerce' ), $trashed ) ); } if ( isset( $_GET['untrashed'] ) ) { $untrashed = absint( $_GET['untrashed'] ); WC_Admin_Settings::add_message( sprintf( _n( '1 webhook restored from the Trash.', '%d webhooks restored from the Trash.', $untrashed, 'woocommerce' ), $untrashed ) ); } if ( isset( $_GET['deleted'] ) ) { $deleted = absint( $_GET['deleted'] ); WC_Admin_Settings::add_message( sprintf( _n( '1 webhook permanently deleted.', '%d webhooks permanently deleted.', $deleted, 'woocommerce' ), $deleted ) ); } if ( isset( $_GET['updated'] ) ) { WC_Admin_Settings::add_message( __( 'Webhook updated successfully.', 'woocommerce' ) ); } if ( isset( $_GET['created'] ) ) { WC_Admin_Settings::add_message( __( 'Webhook created successfully.', 'woocommerce' ) ); } if ( isset( $_GET['error'] ) ) { WC_Admin_Settings::add_error( wc_clean( $_GET['error'] ) ); } } /** * Table list output. */ private static function table_list_output() { echo '<h2>' . __( 'Webhooks', 'woocommerce' ) . ' <a href="' . esc_url( wp_nonce_url( admin_url( 'admin.php?page=wc-settings&tab=api&section=webhooks&create-webhook=1' ), 'create-webhook' ) ) . '" class="add-new-h2">' . __( 'Add webhook', 'woocommerce' ) . '</a></h2>'; $webhooks_table_list = new WC_Admin_Webhooks_Table_List(); $webhooks_table_list->prepare_items(); echo '<input type="hidden" name="page" value="wc-settings" />'; echo '<input type="hidden" name="tab" value="api" />'; echo '<input type="hidden" name="section" value="webhooks" />'; $webhooks_table_list->views(); $webhooks_table_list->search_box( __( 'Search webhooks', 'woocommerce' ), 'webhook' ); $webhooks_table_list->display(); } /** * Logs output. * * @param WC_Webhook $webhook */ public static function logs_output( $webhook ) { $current = isset( $_GET['log_page'] ) ? absint( $_GET['log_page'] ) : 1; $args = array( 'post_id' => $webhook->id, 'status' => 'approve', 'type' => 'webhook_delivery', 'number' => 10, ); if ( 1 < $current ) { $args['offset'] = ( $current - 1 ) * 10; } remove_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_webhook_comments' ), 10, 1 ); $logs = get_comments( $args ); add_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_webhook_comments' ), 10, 1 ); if ( $logs ) { include_once( dirname( __FILE__ ) . '/settings/views/html-webhook-logs.php' ); } else { echo '<p>' . __( 'This Webhook has no log yet.', 'woocommerce' ) . '</p>'; } } /** * Get the webhook topic data. * * @return array */ public static function get_topic_data( $webhook ) { $topic = $webhook->get_topic(); $event = ''; $resource = ''; if ( $topic ) { list( $resource, $event ) = explode( '.', $topic ); if ( 'action' === $resource ) { $topic = 'action'; } elseif ( ! in_array( $resource, array( 'coupon', 'customer', 'order', 'product' ) ) ) { $topic = 'custom'; } } return array( 'topic' => $topic, 'event' => $event, 'resource' => $resource, ); } /** * Get the logs navigation. * * @param int $total * * @return string */ public static function get_logs_navigation( $total, $webhook ) { $pages = ceil( $total / 10 ); $current = isset( $_GET['log_page'] ) ? absint( $_GET['log_page'] ) : 1; $html = '<div class="webhook-logs-navigation">'; $html .= '<p class="info" style="float: left;"><strong>'; $html .= sprintf( '%s &ndash; Page %d of %d', _n( '1 item', sprintf( '%d items', $total ), $total, 'woocommerce' ), $current, $pages ); $html .= '</strong></p>'; if ( 1 < $pages ) { $html .= '<p class="tools" style="float: right;">'; if ( 1 == $current ) { $html .= '<button class="button-primary" disabled="disabled">' . __( '&lsaquo; Previous', 'woocommerce' ) . '</button> '; } else { $html .= '<a class="button-primary" href="' . admin_url( 'admin.php?page=wc-settings&tab=api&section=webhooks&edit-webhook=' . $webhook->id . '&log_page=' . ( $current - 1 ) ) . '#webhook-logs">' . __( '&lsaquo; Previous', 'woocommerce' ) . '</a> '; } if ( $pages == $current ) { $html .= '<button class="button-primary" disabled="disabled">' . __( 'Next &rsaquo;', 'woocommerce' ) . '</button>'; } else { $html .= '<a class="button-primary" href="' . admin_url( 'admin.php?page=wc-settings&tab=api&section=webhooks&edit-webhook=' . $webhook->id . '&log_page=' . ( $current + 1 ) ) . '#webhook-logs">' . __( 'Next &rsaquo;', 'woocommerce' ) . '</a>'; } $html .= '</p>'; } $html .= '<div class="clear"></div></div>'; return $html; } } new WC_Admin_Webhooks();
Java
/** * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * * This library 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 Lesser General Public License for more * details. */ package net.sareweb.emg.service; import com.liferay.portal.kernel.bean.PortletBeanLocatorUtil; import com.liferay.portal.kernel.util.ReferenceRegistry; import com.liferay.portal.service.InvokableService; /** * Provides the remote service utility for Draw. This utility wraps * {@link net.sareweb.emg.service.impl.DrawServiceImpl} and is the * primary access point for service operations in application layer code running * on a remote server. Methods of this service are expected to have security * checks based on the propagated JAAS credentials because this service can be * accessed remotely. * * @author A.Galdos * @see DrawService * @see net.sareweb.emg.service.base.DrawServiceBaseImpl * @see net.sareweb.emg.service.impl.DrawServiceImpl * @generated */ public class DrawServiceUtil { /* * NOTE FOR DEVELOPERS: * * Never modify this class directly. Add custom service methods to {@link net.sareweb.emg.service.impl.DrawServiceImpl} and rerun ServiceBuilder to regenerate this class. */ /** * Returns the Spring bean ID for this bean. * * @return the Spring bean ID for this bean */ public static java.lang.String getBeanIdentifier() { return getService().getBeanIdentifier(); } /** * Sets the Spring bean ID for this bean. * * @param beanIdentifier the Spring bean ID for this bean */ public static void setBeanIdentifier(java.lang.String beanIdentifier) { getService().setBeanIdentifier(beanIdentifier); } public static java.lang.Object invokeMethod(java.lang.String name, java.lang.String[] parameterTypes, java.lang.Object[] arguments) throws java.lang.Throwable { return getService().invokeMethod(name, parameterTypes, arguments); } public static java.util.List<net.sareweb.emg.model.Draw> getDrawsNewerThanDate( long date) throws com.liferay.portal.kernel.exception.SystemException { return getService().getDrawsNewerThanDate(date); } public static void clearService() { _service = null; } public static DrawService getService() { if (_service == null) { InvokableService invokableService = (InvokableService)PortletBeanLocatorUtil.locate(ClpSerializer.getServletContextName(), DrawService.class.getName()); if (invokableService instanceof DrawService) { _service = (DrawService)invokableService; } else { _service = new DrawServiceClp(invokableService); } ReferenceRegistry.registerReference(DrawServiceUtil.class, "_service"); } return _service; } /** * @deprecated As of 6.2.0 */ public void setService(DrawService service) { } private static DrawService _service; }
Java
#define ICON_SIZE QSize(48,48) #define EXPANDED_HEIGHT 413 #define UNEXPANDED_HEIGHT 137 #include "mainpage.h" #include "ui_options.h" #include <QWidget> #include <QComboBox> #include <QHBoxLayout> #include <QVBoxLayout> #include <QGroupBox> #include <QCheckBox> #include <QLineEdit> #include <QMimeData> #include <QLabel> #include <QToolBar> #include <QAction> #include <QToolButton> #include <QFileDialog> #include <QUrl> #include <SMasterIcons> #include <SDeviceList> #include <SComboBox> #include <SDialogTools> class MainPagePrivate { public: QVBoxLayout *layout; QHBoxLayout *image_layout; QToolButton *open_btn; QLineEdit *src_line; SComboBox *dst_combo; QLabel *label; QToolBar *toolbar; QAction *go_action; QAction *more_action; SDeviceList *device_list; Ui::OptionsUi *options_ui; QWidget *options_widget; QList<SDeviceItem> devices; }; MainPage::MainPage( SApplication *parent ) : SPage( tr("Image Burner") , parent , SPage::WindowedPage ) { p = new MainPagePrivate; p->device_list = new SDeviceList( this ); p->src_line = new QLineEdit(); p->src_line->setReadOnly( true ); p->src_line->setFixedHeight( 28 ); p->src_line->setPlaceholderText( tr("Please select a Disc Image") ); p->src_line->setFocusPolicy( Qt::NoFocus ); p->open_btn = new QToolButton(); p->open_btn->setIcon( SMasterIcons::icon( ICON_SIZE , "document-open.png" ) ); p->open_btn->setFixedSize( 28 , 28 ); p->image_layout = new QHBoxLayout(); p->image_layout->addWidget( p->src_line ); p->image_layout->addWidget( p->open_btn ); p->dst_combo = new SComboBox(); p->dst_combo->setIconSize( QSize(22,22) ); p->label = new QLabel(); p->label->setText( tr("To") ); p->toolbar = new QToolBar(); p->toolbar->setToolButtonStyle( Qt::ToolButtonTextBesideIcon ); p->toolbar->setStyleSheet( "QToolBar{ border-style:solid ; margin:0px }" ); p->options_widget = new QWidget(); p->options_ui = new Ui::OptionsUi; p->options_ui->setupUi( p->options_widget ); p->layout = new QVBoxLayout( this ); p->layout->addLayout( p->image_layout ); p->layout->addWidget( p->label ); p->layout->addWidget( p->dst_combo ); p->layout->addWidget( p->options_widget ); p->layout->addWidget( p->toolbar ); p->layout->setContentsMargins( 10 , 10 , 10 , 10 ); setFixedWidth( 413 ); setFixedHeight( EXPANDED_HEIGHT ); p->dst_combo->setCurrentIndex( 0 ); connect( p->device_list , SIGNAL(deviceDetected(SDeviceItem)) , SLOT(deviceDetected(SDeviceItem)) ); connect( p->open_btn , SIGNAL(clicked()) , SLOT(select_src_image()) ); connect( p->dst_combo , SIGNAL(currentIndexChanged(int)) , SLOT(device_index_changed(int)) ); connect( p->options_ui->scan_check , SIGNAL(toggled(bool)) , p->options_ui->scan_widget , SLOT(setVisible(bool)) ); p->options_ui->scan_check->setChecked( false ); p->device_list->refresh(); init_actions(); more_prev(); setAcceptDrops( true ); } void MainPage::init_actions() { QWidget *spr1 = new QWidget(); spr1->setSizePolicy( QSizePolicy::Expanding , QSizePolicy::Minimum ); p->go_action = new QAction( SMasterIcons::icon(ICON_SIZE,"tools-media-optical-burn.png") , tr("Go") , this ); p->more_action = new QAction( SMasterIcons::icon(ICON_SIZE,"edit-rename.png") , tr("More") , this ); p->toolbar->addAction( p->more_action ); p->toolbar->addWidget( spr1 ); p->toolbar->addAction( p->go_action ); connect( p->go_action , SIGNAL(triggered()) , SLOT(go_prev()) ); connect( p->more_action , SIGNAL(triggered()) , SLOT(more_prev()) ); } void MainPage::deviceDetected( const SDeviceItem & device ) { if( !p->devices.contains(device) ) { p->devices << device; p->dst_combo->insertItem( p->devices.count()-1 , SMasterIcons::icon(ICON_SIZE,"drive-optical.png") , device.name() ); } else { int index = p->devices.indexOf( device ); p->devices.removeAt( index ); p->devices.insert( index , device ); p->dst_combo->setItemText( index , device.name() ); device_index_changed( p->dst_combo->currentIndex() ); } } void MainPage::device_index_changed( int index ) { if( index < 0 ) return ; const SDeviceItem & device = p->devices.at( index ); const SDiscFeatures & disc = device.currentDiscFeatures(); QList<int> list; if( disc.volume_disc_type_str.contains("blu",Qt::CaseInsensitive) ) list = device.deviceFeatures().bluray_speed_list; else if( disc.volume_disc_type_str.contains("dvd",Qt::CaseInsensitive) ) list = device.deviceFeatures().dvd_speed_list; else list = device.deviceFeatures().cd_speed_list; if( list.isEmpty() ) list << 2 << 1; p->options_ui->speed_combo->clear(); for( int i=0 ; i<list.count() ; i++ ) p->options_ui->speed_combo->addItem( QString::number(list.at(i)) ); } QString MainPage::sourceImage() const { return p->src_line->text(); } const SDeviceItem & MainPage::destinationDevice() const { return p->devices.at( p->dst_combo->currentIndex() ); } void MainPage::go_prev() { SDialogTools::getTimer( this , tr("Your Request will be starting after count down.") , 7000 , this , SIGNAL(go()) ); } void MainPage::more_prev() { if( height() == UNEXPANDED_HEIGHT ) { setFixedHeight( EXPANDED_HEIGHT ); p->options_widget->show(); p->more_action->setText( tr("Less") ); } else { setFixedHeight( UNEXPANDED_HEIGHT ); p->options_widget->hide(); p->more_action->setText( tr("More") ); } setDefaultOptions(); } void MainPage::setDefaultOptions() { int index = p->dst_combo->currentIndex(); if( index < 0 ) return ; const SDeviceItem & device = p->devices.at(index); const SDiscFeatures & disc = device.currentDiscFeatures(); /*! -------------------- Scanner Options -------------------------*/ p->options_ui->scan_line->setText( disc.volume_label_str ); } bool MainPage::scan() const { return p->options_ui->scan_check->isChecked(); } int MainPage::copiesNumber() const { return p->options_ui->copies_spin->value(); } int MainPage::speed() const { return p->options_ui->speed_combo->currentText().toInt(); } bool MainPage::eject() const { return p->options_ui->eject_check->isChecked(); } bool MainPage::dummy() const { return p->options_ui->dummy_check->isChecked(); } bool MainPage::remove() const { return p->options_ui->remove_check->isChecked(); } QString MainPage::scanName() const { return p->options_ui->scan_line->text(); } void MainPage::setSourceImage( const QString & file ) { p->src_line->setText( file ); } void MainPage::select_src_image() { SDialogTools::getOpenFileName( this , this , SLOT(setSourceImage(QString)) ); } void MainPage::setDestinationDevice( const QString & bus_len_id ) { for( int i=0 ; i<p->devices.count() ; i++ ) if( p->devices.at(i).toQString() == bus_len_id ) { p->dst_combo->setCurrentIndex( i ); return ; } } void MainPage::setScan( const QString & str ) { p->options_ui->scan_check->setChecked( !str.isEmpty() ); p->options_ui->scan_line->setText( str ); } void MainPage::setCopiesNumber( int value ) { p->options_ui->copies_spin->setValue( value ); } void MainPage::setSpeed( int speed ) { p->options_ui->speed_combo->setEditText( QString::number(speed) ); } void MainPage::setEject( bool stt ) { p->options_ui->eject_check->setChecked( stt ); } void MainPage::setDummy( bool stt ) { p->options_ui->dummy_check->setChecked( stt ); } void MainPage::setRemove( bool stt ) { p->options_ui->remove_check->setChecked( stt ); } void MainPage::dropEvent( QDropEvent *event ) { QList<QUrl> list = event->mimeData()->urls(); QString url_path = list.first().path(); #ifdef Q_OS_WIN32 if( url_path[0] == '/' ) url_path.remove( 0 , 1 ); #endif setSourceImage( url_path ); event->acceptProposedAction(); QWidget::dropEvent( event ); } void MainPage::dragEnterEvent( QDragEnterEvent *event ) { if( !event->mimeData()->hasUrls() ) return; QList<QUrl> list = event->mimeData()->urls(); if( list.count() != 1 ) event->ignore(); else event->acceptProposedAction(); QWidget::dragEnterEvent( event ); } MainPage::~MainPage() { delete p->options_ui; delete p; }
Java
# Makefile.in generated by automake 1.13.2 from Makefile.am. # monte/Makefile. Generated from Makefile.in by configure. # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/gsl pkgincludedir = $(includedir)/gsl pkglibdir = $(libdir)/gsl pkglibexecdir = $(libexecdir)/gsl am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = x86_64-unknown-linux-gnu host_triplet = x86_64-unknown-linux-gnu check_PROGRAMS = test$(EXEEXT) subdir = monte DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp \ $(noinst_HEADERS) $(pkginclude_HEADERS) \ $(top_srcdir)/test-driver ChangeLog README TODO ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libgslmonte_la_LIBADD = am_libgslmonte_la_OBJECTS = miser.lo plain.lo vegas.lo libgslmonte_la_OBJECTS = $(am_libgslmonte_la_OBJECTS) AM_V_lt = $(am__v_lt_$(V)) am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) am__v_lt_0 = --silent am__v_lt_1 = am_test_OBJECTS = test.$(OBJEXT) test_OBJECTS = $(am_test_OBJECTS) test_DEPENDENCIES = libgslmonte.la ../rng/libgslrng.la \ ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la \ ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la AM_V_P = $(am__v_P_$(V)) am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY)) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_$(V)) am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_$(V)) am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I. -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_$(V)) am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_$(V)) am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libgslmonte_la_SOURCES) $(test_SOURCES) DIST_SOURCES = $(libgslmonte_la_SOURCES) $(test_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pkgincludedir)" HEADERS = $(noinst_HEADERS) $(pkginclude_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = .test LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = ${SHELL} /home/arne/src/github.com/barnex/gsl/gsl-1.16/missing aclocal-1.13 AMTAR = $${TAR-tar} AM_DEFAULT_VERBOSITY = 1 AR = ar AUTOCONF = ${SHELL} /home/arne/src/github.com/barnex/gsl/gsl-1.16/missing autoconf AUTOHEADER = ${SHELL} /home/arne/src/github.com/barnex/gsl/gsl-1.16/missing autoheader AUTOMAKE = ${SHELL} /home/arne/src/github.com/barnex/gsl/gsl-1.16/missing automake-1.13 AWK = mawk CC = gcc CCDEPMODE = depmode=gcc3 CFLAGS = -g -O2 CPP = gcc -E CPPFLAGS = CYGPATH_W = echo DEFS = -DHAVE_CONFIG_H DEPDIR = .deps DLLTOOL = false DSYMUTIL = DUMPBIN = ECHO_C = ECHO_N = -n ECHO_T = EGREP = /bin/grep -E EXEEXT = FGREP = /bin/grep -F GREP = /bin/grep GSL_CFLAGS = -I${prefix}/include GSL_LIBM = -lm GSL_LIBS = -L${exec_prefix}/lib -lgsl GSL_LT_CBLAS_VERSION = 0:0:0 GSL_LT_VERSION = 17:0:17 GSL_MAJOR_VERSION = 1 GSL_MINOR_VERSION = 16 HAVE_AIX_IEEE_INTERFACE = HAVE_DARWIN86_IEEE_INTERFACE = HAVE_DARWIN_IEEE_INTERFACE = HAVE_FREEBSD_IEEE_INTERFACE = HAVE_GNUM68K_IEEE_INTERFACE = HAVE_GNUPPC_IEEE_INTERFACE = HAVE_GNUSPARC_IEEE_INTERFACE = HAVE_GNUX86_IEEE_INTERFACE = HAVE_HPUX11_IEEE_INTERFACE = HAVE_HPUX_IEEE_INTERFACE = HAVE_IRIX_IEEE_INTERFACE = HAVE_NETBSD_IEEE_INTERFACE = HAVE_OPENBSD_IEEE_INTERFACE = HAVE_OS2EMX_IEEE_INTERFACE = HAVE_SOLARIS_IEEE_INTERFACE = HAVE_SUNOS4_IEEE_INTERFACE = HAVE_TRU64_IEEE_INTERFACE = INSTALL = /usr/bin/install -c INSTALL_DATA = ${INSTALL} -m 644 INSTALL_PROGRAM = ${INSTALL} INSTALL_SCRIPT = ${INSTALL} INSTALL_STRIP_PROGRAM = $(install_sh) -c -s LD = /usr/bin/ld -m elf_x86_64 LDFLAGS = LIBM = -lm LIBOBJS = LIBS = -lm LIBTOOL = $(SHELL) $(top_builddir)/libtool LIPO = LN_S = ln -s LTLIBOBJS = MAINT = # MAKEINFO = ${SHELL} /home/arne/src/github.com/barnex/gsl/gsl-1.16/missing makeinfo MANIFEST_TOOL = : MKDIR_P = /bin/mkdir -p NM = /usr/bin/nm -B NMEDIT = OBJDUMP = objdump OBJEXT = o OTOOL = OTOOL64 = PACKAGE = gsl PACKAGE_BUGREPORT = PACKAGE_NAME = gsl PACKAGE_STRING = gsl 1.16 PACKAGE_TARNAME = gsl PACKAGE_URL = PACKAGE_VERSION = 1.16 PATH_SEPARATOR = : RANLIB = ranlib SED = /bin/sed SET_MAKE = SHELL = /bin/bash STRIP = strip VERSION = 1.16 abs_builddir = /home/arne/src/github.com/barnex/gsl/gsl-1.16/monte abs_srcdir = /home/arne/src/github.com/barnex/gsl/gsl-1.16/monte abs_top_builddir = /home/arne/src/github.com/barnex/gsl/gsl-1.16 abs_top_srcdir = /home/arne/src/github.com/barnex/gsl/gsl-1.16 ac_ct_AR = ar ac_ct_CC = gcc ac_ct_DUMPBIN = am__include = include am__leading_dot = . am__quote = am__tar = $${TAR-tar} chof - "$$tardir" am__untar = $${TAR-tar} xf - bindir = ${exec_prefix}/bin build = x86_64-unknown-linux-gnu build_alias = build_cpu = x86_64 build_os = linux-gnu build_vendor = unknown builddir = . datadir = ${datarootdir} datarootdir = ${prefix}/share docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} dvidir = ${docdir} exec_prefix = ${prefix} host = x86_64-unknown-linux-gnu host_alias = host_cpu = x86_64 host_os = linux-gnu host_vendor = unknown htmldir = ${docdir} includedir = ${prefix}/include infodir = ${datarootdir}/info install_sh = ${SHELL} /home/arne/src/github.com/barnex/gsl/gsl-1.16/install-sh libdir = ${exec_prefix}/lib libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale localstatedir = ${prefix}/var mandir = ${datarootdir}/man mkdir_p = $(MKDIR_P) oldincludedir = /usr/include pdfdir = ${docdir} prefix = /usr/local program_transform_name = s,x,x, psdir = ${docdir} sbindir = ${exec_prefix}/sbin sharedstatedir = ${prefix}/com srcdir = . sysconfdir = ${prefix}/etc target_alias = top_build_prefix = ../ top_builddir = .. top_srcdir = .. noinst_LTLIBRARIES = libgslmonte.la libgslmonte_la_SOURCES = miser.c plain.c gsl_monte_vegas.h gsl_monte_miser.h gsl_monte_plain.h gsl_monte.h vegas.c pkginclude_HEADERS = gsl_monte.h gsl_monte_vegas.h gsl_monte_miser.h gsl_monte_plain.h INCLUDES = -I$(top_srcdir) TESTS = $(check_PROGRAMS) test_SOURCES = test.c test_LDADD = libgslmonte.la ../rng/libgslrng.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la noinst_HEADERS = test_main.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: # $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu monte/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu monte/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: # $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): # $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libgslmonte.la: $(libgslmonte_la_OBJECTS) $(libgslmonte_la_DEPENDENCIES) $(EXTRA_libgslmonte_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libgslmonte_la_OBJECTS) $(libgslmonte_la_LIBADD) $(LIBS) clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list test$(EXEEXT): $(test_OBJECTS) $(test_DEPENDENCIES) $(EXTRA_test_DEPENDENCIES) @rm -f test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_OBJECTS) $(test_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c include ./$(DEPDIR)/miser.Plo include ./$(DEPDIR)/plain.Plo include ./$(DEPDIR)/test.Po include ./$(DEPDIR)/vegas.Plo .c.o: $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po # $(AM_V_CC)source='$<' object='$@' libtool=no \ # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ # $(AM_V_CC_no)$(COMPILE) -c $< .c.obj: $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po # $(AM_V_CC)source='$<' object='$@' libtool=no \ # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ # $(AM_V_CC_no)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo # $(AM_V_CC)source='$<' object='$@' libtool=yes \ # DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ # $(AM_V_CC_no)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-pkgincludeHEADERS: $(pkginclude_HEADERS) @$(NORMAL_INSTALL) @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \ done uninstall-pkgincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ else \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all $(check_PROGRAMS) @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? test.log: test$(EXEEXT) @p='test$(EXEEXT)'; \ b='test'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) #.test$(EXEEXT).log: # @p='$<'; \ # $(am__set_b); \ # $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ # --log-file $$b.log --trs-file $$b.trs \ # $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ # "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(pkgincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-pkgincludeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkgincludeHEADERS .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ clean-checkPROGRAMS clean-generic clean-libtool \ clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-pkgincludeHEADERS \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ recheck tags tags-am uninstall uninstall-am \ uninstall-pkgincludeHEADERS #demo_SOURCES= demo.c #demo_LDADD = libgslmonte.la ../rng/libgslrng.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../utils/libutils.la # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT:
Java
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ package org.mozilla.javascript.optimizer; import org.mozilla.javascript.ArrowFunction; import org.mozilla.javascript.Callable; import org.mozilla.javascript.ConsString; import org.mozilla.javascript.Context; import org.mozilla.javascript.ContextFactory; import org.mozilla.javascript.ES6Generator; import org.mozilla.javascript.Function; import org.mozilla.javascript.JavaScriptException; import org.mozilla.javascript.NativeFunction; import org.mozilla.javascript.NativeGenerator; import org.mozilla.javascript.NativeIterator; import org.mozilla.javascript.Script; import org.mozilla.javascript.ScriptRuntime; import org.mozilla.javascript.Scriptable; import org.mozilla.javascript.ScriptableObject; import org.mozilla.javascript.Undefined; /** * <p>OptRuntime class.</p> * * * */ public final class OptRuntime extends ScriptRuntime { /** Constant <code>oneObj</code> */ public static final Double oneObj = Double.valueOf(1.0); /** Constant <code>minusOneObj</code> */ public static final Double minusOneObj = Double.valueOf(-1.0); /** * Implement ....() call shrinking optimizer code. * * @param fun a {@link org.mozilla.javascript.Callable} object. * @param thisObj a {@link org.mozilla.javascript.Scriptable} object. * @param cx a {@link org.mozilla.javascript.Context} object. * @param scope a {@link org.mozilla.javascript.Scriptable} object. * @return a {@link java.lang.Object} object. */ public static Object call0(Callable fun, Scriptable thisObj, Context cx, Scriptable scope) { return fun.call(cx, scope, thisObj, ScriptRuntime.emptyArgs); } /** * Implement ....(arg) call shrinking optimizer code. * * @param fun a {@link org.mozilla.javascript.Callable} object. * @param thisObj a {@link org.mozilla.javascript.Scriptable} object. * @param arg0 a {@link java.lang.Object} object. * @param cx a {@link org.mozilla.javascript.Context} object. * @param scope a {@link org.mozilla.javascript.Scriptable} object. * @return a {@link java.lang.Object} object. */ public static Object call1(Callable fun, Scriptable thisObj, Object arg0, Context cx, Scriptable scope) { return fun.call(cx, scope, thisObj, new Object[] { arg0 } ); } /** * Implement ....(arg0, arg1) call shrinking optimizer code. * * @param fun a {@link org.mozilla.javascript.Callable} object. * @param thisObj a {@link org.mozilla.javascript.Scriptable} object. * @param arg0 a {@link java.lang.Object} object. * @param arg1 a {@link java.lang.Object} object. * @param cx a {@link org.mozilla.javascript.Context} object. * @param scope a {@link org.mozilla.javascript.Scriptable} object. * @return a {@link java.lang.Object} object. */ public static Object call2(Callable fun, Scriptable thisObj, Object arg0, Object arg1, Context cx, Scriptable scope) { return fun.call(cx, scope, thisObj, new Object[] { arg0, arg1 }); } /** * Implement ....(arg0, arg1, ...) call shrinking optimizer code. * * @param fun a {@link org.mozilla.javascript.Callable} object. * @param thisObj a {@link org.mozilla.javascript.Scriptable} object. * @param args an array of {@link java.lang.Object} objects. * @param cx a {@link org.mozilla.javascript.Context} object. * @param scope a {@link org.mozilla.javascript.Scriptable} object. * @return a {@link java.lang.Object} object. */ public static Object callN(Callable fun, Scriptable thisObj, Object[] args, Context cx, Scriptable scope) { return fun.call(cx, scope, thisObj, args); } /** * Implement name(args) call shrinking optimizer code. * * @param args an array of {@link java.lang.Object} objects. * @param name a {@link java.lang.String} object. * @param cx a {@link org.mozilla.javascript.Context} object. * @param scope a {@link org.mozilla.javascript.Scriptable} object. * @return a {@link java.lang.Object} object. */ public static Object callName(Object[] args, String name, Context cx, Scriptable scope) { Callable f = getNameFunctionAndThis(name, cx, scope); Scriptable thisObj = lastStoredScriptable(cx); return f.call(cx, scope, thisObj, args); } /** * Implement name() call shrinking optimizer code. * * @param name a {@link java.lang.String} object. * @param cx a {@link org.mozilla.javascript.Context} object. * @param scope a {@link org.mozilla.javascript.Scriptable} object. * @return a {@link java.lang.Object} object. */ public static Object callName0(String name, Context cx, Scriptable scope) { Callable f = getNameFunctionAndThis(name, cx, scope); Scriptable thisObj = lastStoredScriptable(cx); return f.call(cx, scope, thisObj, ScriptRuntime.emptyArgs); } /** * Implement x.property() call shrinking optimizer code. * * @param value a {@link java.lang.Object} object. * @param property a {@link java.lang.String} object. * @param cx a {@link org.mozilla.javascript.Context} object. * @param scope a {@link org.mozilla.javascript.Scriptable} object. * @return a {@link java.lang.Object} object. */ public static Object callProp0(Object value, String property, Context cx, Scriptable scope) { Callable f = getPropFunctionAndThis(value, property, cx, scope); Scriptable thisObj = lastStoredScriptable(cx); return f.call(cx, scope, thisObj, ScriptRuntime.emptyArgs); } /** * <p>add.</p> * * @param val1 a {@link java.lang.Object} object. * @param val2 a double. * @return a {@link java.lang.Object} object. */ public static Object add(Object val1, double val2) { if (val1 instanceof Scriptable) val1 = ((Scriptable) val1).getDefaultValue(null); if (!(val1 instanceof CharSequence)) return wrapDouble(toNumber(val1) + val2); return new ConsString((CharSequence)val1, toString(val2)); } /** {@inheritDoc} */ public static Object add(double val1, Object val2) { if (val2 instanceof Scriptable) val2 = ((Scriptable) val2).getDefaultValue(null); if (!(val2 instanceof CharSequence)) return wrapDouble(toNumber(val2) + val1); return new ConsString(toString(val1), (CharSequence)val2); } /** {@inheritDoc} */ @Deprecated public static Object elemIncrDecr(Object obj, double index, Context cx, int incrDecrMask) { return elemIncrDecr(obj, index, cx, getTopCallScope(cx), incrDecrMask); } /** {@inheritDoc} */ public static Object elemIncrDecr(Object obj, double index, Context cx, Scriptable scope, int incrDecrMask) { return ScriptRuntime.elemIncrDecr(obj, Double.valueOf(index), cx, scope, incrDecrMask); } /** * <p>padStart.</p> * * @param currentArgs an array of {@link java.lang.Object} objects. * @param count a int. * @return an array of {@link java.lang.Object} objects. */ public static Object[] padStart(Object[] currentArgs, int count) { Object[] result = new Object[currentArgs.length + count]; System.arraycopy(currentArgs, 0, result, count, currentArgs.length); return result; } /** * <p>initFunction.</p> * * @param fn a {@link org.mozilla.javascript.NativeFunction} object. * @param functionType a int. * @param scope a {@link org.mozilla.javascript.Scriptable} object. * @param cx a {@link org.mozilla.javascript.Context} object. */ public static void initFunction(NativeFunction fn, int functionType, Scriptable scope, Context cx) { ScriptRuntime.initFunction(cx, scope, fn, functionType, false); } /** * <p>bindThis.</p> * * @param fn a {@link org.mozilla.javascript.NativeFunction} object. * @param cx a {@link org.mozilla.javascript.Context} object. * @param scope a {@link org.mozilla.javascript.Scriptable} object. * @param thisObj a {@link org.mozilla.javascript.Scriptable} object. * @return a {@link org.mozilla.javascript.Function} object. */ public static Function bindThis(NativeFunction fn, Context cx, Scriptable scope, Scriptable thisObj) { return new ArrowFunction(cx, scope, fn, thisObj); } /** {@inheritDoc} */ public static Object callSpecial(Context cx, Callable fun, Scriptable thisObj, Object[] args, Scriptable scope, Scriptable callerThis, int callType, String fileName, int lineNumber) { return ScriptRuntime.callSpecial(cx, fun, thisObj, args, scope, callerThis, callType, fileName, lineNumber); } /** * <p>newObjectSpecial.</p> * * @param cx a {@link org.mozilla.javascript.Context} object. * @param fun a {@link java.lang.Object} object. * @param args an array of {@link java.lang.Object} objects. * @param scope a {@link org.mozilla.javascript.Scriptable} object. * @param callerThis a {@link org.mozilla.javascript.Scriptable} object. * @param callType a int. * @return a {@link java.lang.Object} object. */ public static Object newObjectSpecial(Context cx, Object fun, Object[] args, Scriptable scope, Scriptable callerThis, int callType) { return ScriptRuntime.newSpecial(cx, fun, args, scope, callType); } /** * <p>wrapDouble.</p> * * @param num a double. * @return a {@link java.lang.Double} object. */ public static Double wrapDouble(double num) { if (num == 0.0) { if (1 / num > 0) { // +0.0 return zeroObj; } } else if (num == 1.0) { return oneObj; } else if (num == -1.0) { return minusOneObj; } else if (Double.isNaN(num)) { return NaNobj; } return Double.valueOf(num); } static String encodeIntArray(int[] array) { // XXX: this extremely inefficient for small integers if (array == null) { return null; } int n = array.length; char[] buffer = new char[1 + n * 2]; buffer[0] = 1; for (int i = 0; i != n; ++i) { int value = array[i]; int shift = 1 + i * 2; buffer[shift] = (char)(value >>> 16); buffer[shift + 1] = (char)value; } return new String(buffer); } private static int[] decodeIntArray(String str, int arraySize) { // XXX: this extremely inefficient for small integers if (arraySize == 0) { if (str != null) throw new IllegalArgumentException(); return null; } if (str.length() != 1 + arraySize * 2 && str.charAt(0) != 1) { throw new IllegalArgumentException(); } int[] array = new int[arraySize]; for (int i = 0; i != arraySize; ++i) { int shift = 1 + i * 2; array[i] = (str.charAt(shift) << 16) | str.charAt(shift + 1); } return array; } /** * <p>newArrayLiteral.</p> * * @param objects an array of {@link java.lang.Object} objects. * @param encodedInts a {@link java.lang.String} object. * @param skipCount a int. * @param cx a {@link org.mozilla.javascript.Context} object. * @param scope a {@link org.mozilla.javascript.Scriptable} object. * @return a {@link org.mozilla.javascript.Scriptable} object. */ public static Scriptable newArrayLiteral(Object[] objects, String encodedInts, int skipCount, Context cx, Scriptable scope) { int[] skipIndexces = decodeIntArray(encodedInts, skipCount); return newArrayLiteral(objects, skipIndexces, cx, scope); } /** * <p>main.</p> * * @param script a {@link org.mozilla.javascript.Script} object. * @param args an array of {@link java.lang.String} objects. */ public static void main(final Script script, final String[] args) { ContextFactory.getGlobal().call(cx -> { ScriptableObject global = getGlobal(cx); // get the command line arguments and define "arguments" // array in the top-level object Object[] argsCopy = new Object[args.length]; System.arraycopy(args, 0, argsCopy, 0, args.length); Scriptable argsObj = cx.newArray(global, argsCopy); global.defineProperty("arguments", argsObj, ScriptableObject.DONTENUM); script.exec(cx, global); return null; }); } /** * <p>throwStopIteration.</p> * * @param scope a {@link java.lang.Object} object. * @param genState a {@link java.lang.Object} object. */ public static void throwStopIteration(Object scope, Object genState) { Object value = getGeneratorReturnValue(genState); Object si = (value == Undefined.instance) ? NativeIterator.getStopIterationObject((Scriptable)scope) : new NativeIterator.StopIteration(value); throw new JavaScriptException(si, "", 0); } /** * <p>createNativeGenerator.</p> * * @param funObj a {@link org.mozilla.javascript.NativeFunction} object. * @param scope a {@link org.mozilla.javascript.Scriptable} object. * @param thisObj a {@link org.mozilla.javascript.Scriptable} object. * @param maxLocals a int. * @param maxStack a int. * @return a {@link org.mozilla.javascript.Scriptable} object. */ public static Scriptable createNativeGenerator(NativeFunction funObj, Scriptable scope, Scriptable thisObj, int maxLocals, int maxStack) { GeneratorState gs = new GeneratorState(thisObj, maxLocals, maxStack); if (Context.getCurrentContext().getLanguageVersion() >= Context.VERSION_ES6) { return new ES6Generator(scope, funObj, gs); } else { return new NativeGenerator(scope, funObj, gs); } } /** * <p>getGeneratorStackState.</p> * * @param obj a {@link java.lang.Object} object. * @return an array of {@link java.lang.Object} objects. */ public static Object[] getGeneratorStackState(Object obj) { GeneratorState rgs = (GeneratorState) obj; if (rgs.stackState == null) rgs.stackState = new Object[rgs.maxStack]; return rgs.stackState; } /** * <p>getGeneratorLocalsState.</p> * * @param obj a {@link java.lang.Object} object. * @return an array of {@link java.lang.Object} objects. */ public static Object[] getGeneratorLocalsState(Object obj) { GeneratorState rgs = (GeneratorState) obj; if (rgs.localsState == null) rgs.localsState = new Object[rgs.maxLocals]; return rgs.localsState; } /** * <p>setGeneratorReturnValue.</p> * * @param obj a {@link java.lang.Object} object. * @param val a {@link java.lang.Object} object. */ public static void setGeneratorReturnValue(Object obj, Object val) { GeneratorState rgs = (GeneratorState) obj; rgs.returnValue = val; } /** * <p>getGeneratorReturnValue.</p> * * @param obj a {@link java.lang.Object} object. * @return a {@link java.lang.Object} object. */ public static Object getGeneratorReturnValue(Object obj) { GeneratorState rgs = (GeneratorState) obj; return (rgs.returnValue == null ? Undefined.instance : rgs.returnValue); } public static class GeneratorState { static final String CLASS_NAME = "org/mozilla/javascript/optimizer/OptRuntime$GeneratorState"; @SuppressWarnings("unused") public int resumptionPoint; static final String resumptionPoint_NAME = "resumptionPoint"; static final String resumptionPoint_TYPE = "I"; @SuppressWarnings("unused") public Scriptable thisObj; static final String thisObj_NAME = "thisObj"; static final String thisObj_TYPE = "Lorg/mozilla/javascript/Scriptable;"; Object[] stackState; Object[] localsState; int maxLocals; int maxStack; Object returnValue; GeneratorState(Scriptable thisObj, int maxLocals, int maxStack) { this.thisObj = thisObj; this.maxLocals = maxLocals; this.maxStack = maxStack; } } }
Java
#include "relativelayout.h" #include <QDebug> RelativeLayout::RelativeLayout(View *parent) : View(parent) { // By default, QQuickItem does not draw anything. If you subclass // QQuickItem to create a visual item, you will need to uncomment the // following line and re-implement updatePaintNode() // setFlag(ItemHasContents, true); } RelativeLayout::~RelativeLayout() { } void RelativeLayout::inflate() { View::inflate(); qDebug() << "Start rellayout inflate"; if (m_context != NULL && m_context->isValid()) { m_object = new QAndroidJniObject("android/widget/RelativeLayout", "(Landroid/content/Context;)V", m_context->object()); qDebug() << m_object->isValid(); qDebug() << m_object->toString(); foreach (QObject *child, m_children) { qDebug() << "add children to layout"; if (child != NULL) { qDebug() << child->metaObject()->className(); child->dumpObjectInfo(); if (child->inherits("View")) m_object->callMethod<void>("addView", "(Landroid/view/View;)V", qobject_cast<View*>(child)->object()->object()); } } } else qDebug() << "No context, cannot inflate!"; }
Java
.nav-tabs { border-bottom: 1px solid #151313 !important; background-color: rgba(0, 0, 0, 0.33); padding: 5px; } li.btn { height: 44px; } * { margin:0; padding:0; border-radius: 0px; } .table-hover>tbody>tr:hover { background-color: #8387F1; border-radius: 0px ; } .table-hover>tbody>tr>td { border-radius: 0px ; } .btn{ box-shadow: 1px 2px 5px #000000; } #tituloBarra{ font-style: oblique; font-weight: bold; cursor: pointer; float: right; background-color: #5bc0de; border-radius: 4px; border: 1px; padding: 4px; } .fotoGrilla { width: 40px; height: 40px; } .fotoform { max-width: 200px; max-height: 200px; } .container { margin-top: 12px; } #header { position: fixed; top: 0; width: 100%; height: 50px; background-color: #333; color: #FFFFFF; padding: 10px; z-index: 1; } .centrar { text-align:center; } body { margin: 0 auto; color:#333; padding-top: 40px; background: linear-gradient(to right ,rgba(41, 137, 216, 0.39), #dff0d8, #999); /* Standard syntax */ /*background:rgba(85, 85, 85, 0.72);*/ font-family:'Open Sans',sans-serif; } caption { font-size: 1.6em; font-weight: 400; padding: 10px 0; } footer { height: 60px; /*background-color: #C2C2C2;*/ background: linear-gradient(to right ,rgba(41, 137, 216, 0.39), #dff0d8, #999); } h1 { margin: 0px; border: black; } .imgLogin { width:325px; height:377px; } .CajaUno { max-width: 30%; width:400px; margin:0 auto; margin-top:8px; margin-bottom:2%; transition:opacity 1s; -webkit-transition:opacity 1s; } .CajaInicio { width:750px; margin:0 auto; margin-top:8px; margin-bottom:2%; transition:opacity 1s; -webkit-transition:opacity 1s; } .CajaEnunciado { max-width: 30%; border: dashed; position: fixed; background: royalblue; top: 0px; width: 400px; margin: 0; padding: 10px; margin-bottom: 2%; transition: opacity 1s; -webkit-transition: opacity 1s; border-radius: 15px; -webkit-border-radius: 15px; } .CajaInicio h1{ background:#010101 /*rgb(14, 26, 112);*/; padding:20px 0; font-size:140%; font-weight:300; text-align:center; color:#fff; } .CajaAbajo { margin-top: 100px; width:400px; top:0px; left:0px; transition:opacity 1s; -webkit-transition:opacity 1s; } .CajaArriva { margin-top: 20px; width:400px; top:0px; left:0px; transition:opacity 1s; -webkit-transition:opacity 1s; } #FormIngreso { background:#f0f0f0; padding:7% 5%; } input[type="text"],input[type="file"],input[type="search"]{ width:100%; background:#fff; margin-bottom:2%; border:1px solid #ccc; padding:2%; font-family:'Open Sans',sans-serif; font-size:140%; font-weight: 800; color:#555; } select{ width:100%; background:#fff; margin-bottom:2%; border:1px solid #ccc; padding:2%; font-family:'Open Sans',sans-serif; font-size:95%; color:#555; } .MiBotonUTN { display:block; text-transform: capitalize; border:hidden; width:100%; background:#f50056; margin:0 auto; margin-top:1%; padding:10px; text-align:center; text-decoration:none; color:#fff; cursor:pointer; -moz-border-radius:7px; -webkit-border-radius:7px; border-radius:7px; transition:background .3s; -webkit-transition:background .3s; } .MiBotonUTN:hover{ background:#1BA045; } /* .MiBotonUTNJuego { text-transform: capitalize; border:hidden; width:32%; background:#f50056; margin:0 auto; margin-top:1%; padding:10px; text-align:center; text-decoration:none; color:#fff; cursor:pointer; -moz-border-radius:7px; -webkit-border-radius:7px; border-radius:7px; transition:background .3s; -webkit-transition:background .3s; } */ .MiBotonUTNMenu { display:block; text-transform: capitalize; border:hidden; width:100px; background:#f50056; margin-top:1%; padding:6px; text-align:center; text-decoration:none; color:#fff; cursor:pointer; -moz-border-radius:7px; -webkit-border-radius:7px; border-radius:7px; transition:background .3s; -webkit-transition:background .3s; } .MiBotonUTNMenu:hover{ background: #1e5799; /* Old browsers */ background: -moz-linear-gradient(45deg, #1e5799 0%, #2989d8 16%, #2989d8 16%, #ffffff 36%, #ffffff 43%, #ebf709 48%, #ffffff 52%, #ffffff 61%, #207cca 82%, #207cca 99%, #207cca 99%, #7db9e8 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left bottom, right top, color-stop(0%,#1e5799), color-stop(16%,#2989d8), color-stop(16%,#2989d8), color-stop(36%,#ffffff), color-stop(43%,#ffffff), color-stop(48%,#ebf709), color-stop(52%,#ffffff), color-stop(61%,#ffffff), color-stop(82%,#207cca), color-stop(99%,#207cca), color-stop(99%,#207cca), color-stop(100%,#7db9e8)); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(45deg, #1e5799 0%,#2989d8 16%,#2989d8 16%,#ffffff 36%,#ffffff 43%,#ebf709 48%,#ffffff 52%,#ffffff 61%,#207cca 82%,#207cca 99%,#207cca 99%,#7db9e8 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(45deg, #1e5799 0%,#2989d8 16%,#2989d8 16%,#ffffff 36%,#ffffff 43%,#ebf709 48%,#ffffff 52%,#ffffff 61%,#207cca 82%,#207cca 99%,#207cca 99%,#7db9e8 100%); /* Opera 11.10+ */ background: -ms-linear-gradient(45deg, #1e5799 0%,#2989d8 16%,#2989d8 16%,#ffffff 36%,#ffffff 43%,#ebf709 48%,#ffffff 52%,#ffffff 61%,#207cca 82%,#207cca 99%,#207cca 99%,#7db9e8 100%); /* IE10+ */ background: linear-gradient(45deg, #1e5799 0%,#2989d8 16%,#2989d8 16%,#ffffff 36%,#ffffff 43%,#ebf709 48%,#ffffff 52%,#ffffff 61%,#207cca 82%,#207cca 99%,#207cca 99%,#7db9e8 100%); /* W3C */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1e5799', endColorstr='#7db9e8',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */ color:black; } /* .MiBotonUTNLinea{ max-width: 150px; position: absolute; text-transform: capitalize; border:hidden; width:100%; background:#00A1F5; margin:0 auto; margin-top:30%; padding:10px; text-align:center; text-decoration:none; color:#fff; cursor:pointer; -moz-border-radius:7px; -webkit-border-radius:7px; border-radius:7px; transition:background .3s; -webkit-transition:background .3s; } .MiBotonUTNLinea:hover{ background:red; } */ .MiBotonUTNMenuInicio { display:block; border:hidden; //width:150px; background:Blue; margin-top:1%; padding:6px; text-align:center; text-decoration:none; color:#fff; cursor:pointer; -moz-border-radius:7px; -webkit-border-radius:7px; border-radius:7px; transition:background .3s; -webkit-transition:background .3s; } .MiBotonUTNMenuInicio:hover{ background:red; } /* .CajaUno h1{ background:#f50056; padding:20px 0; font-size:140%; font-weight:300; text-align:center; color:#fff; } .CajaUno a:hover { color:#f50056; } */ /* .CajaUno a { color:#DDDDDD; } */ /* .PiedraPapelTijera { width: 100px; height: 100px; padding: 10px; }*/
Java
/* Copyright 2012 SINTEF ICT, Applied Mathematics. This file is part of the Open Porous Media project (OPM). OPM 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. OPM 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 OPM. If not, see <http://www.gnu.org/licenses/>. */ #ifndef OPM_INCOMPTPFA_HEADER_INCLUDED #define OPM_INCOMPTPFA_HEADER_INCLUDED #include <opm/core/simulator/SimulatorState.hpp> #include <opm/core/pressure/tpfa/ifs_tpfa.h> #include <vector> struct UnstructuredGrid; struct Wells; struct FlowBoundaryConditions; namespace Opm { class IncompPropertiesInterface; class RockCompressibility; class LinearSolverInterface; class WellState; class SimulatoreState; /// Encapsulating a tpfa pressure solver for the incompressible-fluid case. /// Supports gravity, wells controlled by bhp or reservoir rates, /// boundary conditions and simple sources as driving forces. /// Rock compressibility can be included, and necessary nonlinear /// iterations are handled. /// Below we use the shortcuts D for the number of dimensions, N /// for the number of cells and F for the number of faces. class IncompTpfa { public: /// Construct solver for incompressible case. /// \param[in] grid A 2d or 3d grid. /// \param[in] props Rock and fluid properties. /// \param[in] linsolver Linear solver to use. /// \param[in] gravity Gravity vector. If non-null, the array should /// have D elements. /// \param[in] wells The wells argument. Will be used in solution, /// is ignored if NULL. /// Note: this class observes the well object, and /// makes the assumption that the well topology /// and completions does not change during the /// run. However, controls (only) are allowed /// to change. /// \param[in] src Source terms. May be empty(). /// \param[in] bcs Boundary conditions, treat as all noflow if null. IncompTpfa(const UnstructuredGrid& grid, const IncompPropertiesInterface& props, LinearSolverInterface& linsolver, const double* gravity, const Wells* wells, const std::vector<double>& src, const FlowBoundaryConditions* bcs); /// Construct solver, possibly with rock compressibility. /// \param[in] grid A 2d or 3d grid. /// \param[in] props Rock and fluid properties. /// \param[in] rock_comp_props Rock compressibility properties. May be null. /// \param[in] linsolver Linear solver to use. /// \param[in] residual_tol Solution accepted if inf-norm of residual is smaller. /// \param[in] change_tol Solution accepted if inf-norm of change in pressure is smaller. /// \param[in] maxiter Maximum acceptable number of iterations. /// \param[in] gravity Gravity vector. If non-null, the array should /// have D elements. /// \param[in] wells The wells argument. Will be used in solution, /// is ignored if NULL. /// Note: this class observes the well object, and /// makes the assumption that the well topology /// and completions does not change during the /// run. However, controls (only) are allowed /// to change. /// \param[in] src Source terms. May be empty(). /// \param[in] bcs Boundary conditions, treat as all noflow if null. IncompTpfa(const UnstructuredGrid& grid, const IncompPropertiesInterface& props, const RockCompressibility* rock_comp_props, LinearSolverInterface& linsolver, const double residual_tol, const double change_tol, const int maxiter, const double* gravity, const Wells* wells, const std::vector<double>& src, const FlowBoundaryConditions* bcs); /// Destructor. virtual ~IncompTpfa(); /// Solve the pressure equation. If there is no pressure /// dependency introduced by rock compressibility effects, /// the equation is linear, and it is solved directly. /// Otherwise, the nonlinear equations ares solved by a /// Newton-Raphson scheme. /// May throw an exception if the number of iterations /// exceed maxiter (set in constructor). void solve(const double dt, SimulatorState& state, WellState& well_state); /// Expose read-only reference to internal half-transmissibility. const std::vector<double>& getHalfTrans() const { return htrans_; } protected: // Solve with no rock compressibility (linear eqn). void solveIncomp(const double dt, SimulatorState& state, WellState& well_state); // Solve with rock compressibility (nonlinear eqn). void solveRockComp(const double dt, SimulatorState& state, WellState& well_state); private: // Helper functions. void computeStaticData(); virtual void computePerSolveDynamicData(const double dt, const SimulatorState& state, const WellState& well_state); void computePerIterationDynamicData(const double dt, const SimulatorState& state, const WellState& well_state); void assemble(const double dt, const SimulatorState& state, const WellState& well_state); void solveIncrement(); double residualNorm() const; double incrementNorm() const; void computeResults(SimulatorState& state, WellState& well_state) const; protected: // ------ Data that will remain unmodified after construction. ------ const UnstructuredGrid& grid_; const IncompPropertiesInterface& props_; const RockCompressibility* rock_comp_props_; const LinearSolverInterface& linsolver_; const double residual_tol_; const double change_tol_; const int maxiter_; const double* gravity_; // May be NULL const Wells* wells_; // May be NULL, outside may modify controls (only) between calls to solve(). const std::vector<double>& src_; const FlowBoundaryConditions* bcs_; std::vector<double> htrans_; std::vector<double> gpress_; std::vector<int> allcells_; // ------ Data that will be modified for every solve. ------ std::vector<double> trans_ ; std::vector<double> wdp_; std::vector<double> totmob_; std::vector<double> omega_; std::vector<double> gpress_omegaweighted_; std::vector<double> initial_porevol_; struct ifs_tpfa_forces forces_; // ------ Data that will be modified for every solver iteration. ------ std::vector<double> porevol_; std::vector<double> rock_comp_; std::vector<double> pressures_; // ------ Internal data for the ifs_tpfa solver. ------ struct ifs_tpfa_data* h_; }; } // namespace Opm #endif // OPM_INCOMPTPFA_HEADER_INCLUDED
Java
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_65) on Thu Feb 05 20:10:13 EST 2015 --> <title>ModDiscoverer (Forge API)</title> <meta name="date" content="2015-02-05"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="ModDiscoverer (Forge API)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../cpw/mods/fml/common/discovery/ModCandidate.html" title="class in cpw.mods.fml.common.discovery"><span class="strong">Prev Class</span></a></li> <li>Next Class</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?cpw/mods/fml/common/discovery/ModDiscoverer.html" target="_top">Frames</a></li> <li><a href="ModDiscoverer.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">cpw.mods.fml.common.discovery</div> <h2 title="Class ModDiscoverer" class="title">Class ModDiscoverer</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>cpw.mods.fml.common.discovery.ModDiscoverer</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <hr> <br> <pre>public class <span class="strong">ModDiscoverer</span> extends java.lang.Object</pre> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><strong><a href="../../../../../cpw/mods/fml/common/discovery/ModDiscoverer.html#ModDiscoverer()">ModDiscoverer</a></strong>()</code>&nbsp;</td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method_summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../../cpw/mods/fml/common/discovery/ModDiscoverer.html#findClasspathMods(cpw.mods.fml.common.ModClassLoader)">findClasspathMods</a></strong>(<a href="../../../../../cpw/mods/fml/common/ModClassLoader.html" title="class in cpw.mods.fml.common">ModClassLoader</a>&nbsp;modClassLoader)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../../cpw/mods/fml/common/discovery/ModDiscoverer.html#findModDirMods(java.io.File)">findModDirMods</a></strong>(java.io.File&nbsp;modsDir)</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../cpw/mods/fml/common/discovery/ASMDataTable.html" title="class in cpw.mods.fml.common.discovery">ASMDataTable</a></code></td> <td class="colLast"><code><strong><a href="../../../../../cpw/mods/fml/common/discovery/ModDiscoverer.html#getASMTable()">getASMTable</a></strong>()</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>java.util.List&lt;java.io.File&gt;</code></td> <td class="colLast"><code><strong><a href="../../../../../cpw/mods/fml/common/discovery/ModDiscoverer.html#getNonModLibs()">getNonModLibs</a></strong>()</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>java.util.List&lt;<a href="../../../../../cpw/mods/fml/common/ModContainer.html" title="interface in cpw.mods.fml.common">ModContainer</a>&gt;</code></td> <td class="colLast"><code><strong><a href="../../../../../cpw/mods/fml/common/discovery/ModDiscoverer.html#identifyMods()">identifyMods</a></strong>()</code>&nbsp;</td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Object</h3> <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="ModDiscoverer()"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>ModDiscoverer</h4> <pre>public&nbsp;ModDiscoverer()</pre> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method_detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="findClasspathMods(cpw.mods.fml.common.ModClassLoader)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>findClasspathMods</h4> <pre>public&nbsp;void&nbsp;findClasspathMods(<a href="../../../../../cpw/mods/fml/common/ModClassLoader.html" title="class in cpw.mods.fml.common">ModClassLoader</a>&nbsp;modClassLoader)</pre> </li> </ul> <a name="findModDirMods(java.io.File)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>findModDirMods</h4> <pre>public&nbsp;void&nbsp;findModDirMods(java.io.File&nbsp;modsDir)</pre> </li> </ul> <a name="identifyMods()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>identifyMods</h4> <pre>public&nbsp;java.util.List&lt;<a href="../../../../../cpw/mods/fml/common/ModContainer.html" title="interface in cpw.mods.fml.common">ModContainer</a>&gt;&nbsp;identifyMods()</pre> </li> </ul> <a name="getASMTable()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getASMTable</h4> <pre>public&nbsp;<a href="../../../../../cpw/mods/fml/common/discovery/ASMDataTable.html" title="class in cpw.mods.fml.common.discovery">ASMDataTable</a>&nbsp;getASMTable()</pre> </li> </ul> <a name="getNonModLibs()"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>getNonModLibs</h4> <pre>public&nbsp;java.util.List&lt;java.io.File&gt;&nbsp;getNonModLibs()</pre> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../cpw/mods/fml/common/discovery/ModCandidate.html" title="class in cpw.mods.fml.common.discovery"><span class="strong">Prev Class</span></a></li> <li>Next Class</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?cpw/mods/fml/common/discovery/ModDiscoverer.html" target="_top">Frames</a></li> <li><a href="ModDiscoverer.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
Java
// This file is part of zinc64. // Copyright (c) 2016-2019 Sebastian Jastrzebski. All rights reserved. // Licensed under the GPLv3. See LICENSE file in the project root for full license text. use zinc64_core::{Ram, Rom, Shared, SharedCell}; pub struct VicMemory { base_address: SharedCell<u16>, charset: Shared<Rom>, ram: Shared<Ram>, } impl VicMemory { pub fn new(base_address: SharedCell<u16>, charset: Shared<Rom>, ram: Shared<Ram>) -> VicMemory { VicMemory { base_address, charset, ram, } } pub fn read(&self, address: u16) -> u8 { let full_address = self.base_address.get() | address; let zone = full_address >> 12; match zone { 0x01 => self.charset.borrow().read(full_address - 0x1000), 0x09 => self.charset.borrow().read(full_address - 0x9000), _ => self.ram.borrow().read(full_address), } } }
Java
# -*- coding: utf-8 -*- # # Stetl documentation build configuration file, created by # sphinx-quickstart on Sun Jun 2 11:01:36 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys, os # indicate Sphinx is building (to replace @Config decorators) os.environ['SPHINX_BUILD'] = '1' # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # sys.path.insert(0, os.path.abspath('.')) sys.path.insert(0, os.path.abspath('../')) # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.viewcode'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = u'Stetl' copyright = u'2013+, Just van den Broecke' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = '1.2-dev' # The full version, including alpha/beta/rc tags. release = '1.2-dev' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = [] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # -- Options for HTML output --------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'default' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # "<project> v<release> documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a <link> tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'Stetldoc' # -- Options for LaTeX output -------------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). #'pointsize': '10pt', # Additional stuff for the LaTeX preamble. #'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ ('index', 'Stetl.tex', u'Stetl Documentation', u'Just van den Broecke', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output -------------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'stetl', u'Stetl Documentation', [u'Just van den Broecke'], 1) ] # If true, show URL addresses after external links. #man_show_urls = False # -- Options for Texinfo output ------------------------------------------------ # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ ('index', 'Stetl', u'Stetl Documentation', u'Just van den Broecke', 'Stetl', 'One line description of project.', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. #texinfo_appendices = [] # If false, no module index is generated. #texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote'
Java
<html> <head> <title>Document Browser</title> <link rel='stylesheet' href='./scdoc.css' type='text/css' /> <meta http-equiv='Content-Type' content='text/html; charset=UTF-8' /> <script src="docmap.js" type="text/javascript"></script> <script src="scdoc.js" type="text/javascript"></script> <style> .browser { margin: 0em; border-collapse: collapse; margin-top: 1em; } .result { padding: 2px; } .browser td { vertical-align: top; border: none; } .result_doc { border-bottom: 1px solid #ddd; margin-top: 0.5em; } .result_summary { color: #444; font-size: 9pt; max-width: 18em; margin-bottom: 0.6em; } .category, .cat_selected { margin-bottom: 0.25em; border-bottom: 1px solid transparent; } .cat_selected { border-bottom: 1px solid #777; } .cat_header { border-bottom: 2px solid #999; color: #777; /* background: #aaa; color: white;*/ margin-bottom: 0.25em; padding: 2px; /* font-weight: bold;*/ } .category a { color: #555; font-weight: bold; } .cat_selected a { color: #000; font-weight: bold; } .cat_arrow { float: right; padding-left: 1ex; color: #555; } #search_checks { font-size: 9pt; color: #555; border-bottom: 1px solid #ddd; margin-top: 1em; padding-bottom: 1em; } .cat_count { color: #777; font-size: 9pt; } #total_count { font-size: 9pt; color: #777; } .doc_kind { color: #666; float: right; font-size: 8pt; padding: 0 2px; margin-left: 0.5ex; font-weight: bold; } </style> <noscript> <!--<meta http-equiv="refresh" content="3; URL=Overviews/Categories.html"> <p>JavaScript is not available, redirecting to <a href="Overviews/Categories.html">static category overview</a>...--> <p>The document browser needs JavaScript. </noscript> <script type="text/javascript"> var categorytree = null; var path = []; function GotoPath(p) { path = p.split(">"); var x = escape(p); if(window.location.hash != x) window.location.hash = x; updateTree(); } function updateTree() { var el = document.getElementById("browser"); var res = "<tr><td>"; var lev = 0; var tree = {entries:[],subcats:categorytree}; var p; var done = 0; var sel; var colors = { "Classes": "#7ab", "Reference": "#7b9", "Overviews": "#ca6", "Guides": "#b87", "Tutorials": "#b77", }; link = ""; while(1) { res += "<div class='result'>"; p=path[lev++]; var l = []; for(var k in tree.subcats) l.push(k); l = l.sort(); sel = ""; for(var i=0;i<l.length;i++) { var k = l[i]; if(k==p) { res += "<div class='cat_selected'>"; sel = k; } else res += "<div class='category'>"; res += "<a href='javascript:GotoPath(\""+link+k+"\")'>"+k+"</a>"; res += " <span class='cat_count'>("+tree.subcats[k].count+")</span>"; if(k==p) res += "<span class='cat_arrow'> &#9658;</span>"; res += "</div>"; } for(var i=0;i<tree.entries.length;i++) { var v = tree.entries[i]; var x = v.path.split("/"); res += "<div class='result_doc'><span class='doc_kind' "; var clr = colors[x[0]]; if(clr) { res += "style='color:"+clr+";'"; }; res += ">"; if(v.installed=="extension") res += "+"; else if(v.installed=="missing") res += "(not installed) "; var link = v.hasOwnProperty("oldhelp")?v.oldhelp:(v.path+".html"); res += x[0].toUpperCase()+"</span><a href='"+link+"'>"+v.title+"</a></div><div class='result_summary'>"+v.summary+"</div>"; } res += "</div>"; if(!p) break; tree = tree.subcats[p]; link += p+">"; res += "<td>"; res += "<div class='cat_header'>"+sel+"</div>"; if(!tree) { res += "<div class='result_summary'>&#9658; Category not found: "+p+"</div>"; break; } } el.innerHTML = res; } function countTree(t) { var x = 0; for(var k in t.subcats) x += countTree(t.subcats[k]); x += t.entries.length; return t.count = x; } function buildCategoryTree() { var cats = {}; for(var k in docmap) { var v = docmap[k]; if(v.installed=="extension" && !check_extensions.checked) continue; if(filter.value != "all" && v.path.split("/")[0].toLowerCase() != filter.value) continue; var c2 = v.categories.match(/[^, ]+[^,]*[^, ]+/g) || ["Uncategorized"]; for(var i=0;i<c2.length;i++) { var c = c2[i]; if(!cats[c]) cats[c]=[]; cats[c].push(v); } } var tree = {}; var p,l,e,a; for(var cat in cats) { var files = cats[cat]; p=tree; l=cat.split(">"); for(var i=0;i<l.length;i++) { var c = l[i]; if(!p[c]) { p[c]={}; p[c].subcats = {}; p[c].entries = []; p[c].count = 0; } e=p[c]; p=p[c].subcats; } for(var i=0;i<files.length;i++) e.entries.push(files[i]); e.entries = e.entries.sort(function(a,b) { a=a.title; b=b.title; if(a<b) return -1; else if(a>b) return +1; else return 0; }); } categorytree = tree; document.getElementById("total_count").innerHTML = countTree({subcats:tree,entries:[],count:0}) + " documents"; } var check_extensions; var filter; window.onload = function() { // restoreMenu(); helpRoot="."; fixTOC(); var onChange = function() { buildCategoryTree(); updateTree(); }; check_extensions = document.getElementById("check_extensions"); check_extensions.onchange = onChange; filter = document.getElementById("menu_filter"); filter.onchange = onChange; buildCategoryTree(); GotoPath(unescape(window.location.hash.slice(1))); } window.onhashchange = function() { GotoPath(unescape(window.location.hash.slice(1))); } </script> </head> <ul id="menubar"></ul> <body> <div class='contents'> <div class='header'> <div id='label'>SuperCollider</div> <h1>Document Browser</h1> <div id='summary'>Browse categories</div> </div> <div id="search_checks"> Filter: <select id="menu_filter"> <option SELECTED value="all">All documents</option> <option value="classes">Classes only</option> <option value="reference">Reference only</option> <option value="guides">Guides only</option> <option value="tutorials">Tutorials only</option> <option value="overviews">Overviews only</option> <option value="other">Other only</option> </select> <input type="checkbox" id="check_extensions" checked="true">Include extensions</input> </div> <div id="total_count"></div> <table class="browser" id="browser"></table> </div> </body> </html>
Java
<?php /** * Functions for building the page content for each codex page * * @since 1.0.0 * @package Codex_Creator */ /** * Get and format content output for summary section of the codex page. * * @since 1.0.0 * @package Codex_Creator * @param int $post_id Post ID of the post content required. * @param string $title Title for the content section. * @return string The formatted content. */ function cdxc_summary_content($post_id, $title) { $content = ''; $meta_value = get_post_meta($post_id, 'cdxc_summary', true); if (!$meta_value) { return; } $content .= CDXC_TITLE_START . $title . CDXC_TITLE_END; $content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END; /** * Filter the content returned by the function. * * @since 1.0.0 * @param string $content The content to be output. * @param int $post_id The post ID. * @param string $title The title for the content. */ return apply_filters('cdxc_summary_content', $content, $post_id, $title); } /** * Get and format content output for description section of the codex page. * * @since 1.0.0 * @package Codex_Creator * @param int $post_id Post ID of the post content required. * @param string $title Title for the content section. * @return string The formatted content. */ function cdxc_description_content($post_id, $title) { $content = ''; //$meta_value = get_post_meta($post_id, 'cdxc_description', true); $meta_value = get_post_meta($post_id, 'cdxc_meta_docblock', true); if (!$meta_value) { return ''; } $phpdoc = new \phpDocumentor\Reflection\DocBlock($meta_value); $line_arr = explode(PHP_EOL, $phpdoc->getLongDescription()->getContents()); $line_arr = array_values(array_filter($line_arr)); if (empty($line_arr)) { return ''; } $sample_open = false; $sample_close = false; foreach ($line_arr as $key=>$line) { //check for code sample opening if($line=='' && substr($line_arr[$key+1], 0, 3) === ' '){// we have found a opening code sample $sample_open = $key+1; } //check for code sample closing if($sample_open && substr($line_arr[$key], 0, 3) === ' '){// we have found a closing code sample $sample_close = $key; } } if ($sample_open && $sample_close) { $line_arr[$sample_open] = CDXC_SAMPLE_OPEN.$line_arr[$sample_open]; $line_arr[$sample_open] = $line_arr[$sample_close].CDXC_SAMPLE_CLOSE; } $meta_value = implode(PHP_EOL, $line_arr); $content .= CDXC_TITLE_START . $title . CDXC_TITLE_END; $content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END; /** * Filter the content returned by the function. * * @since 1.0.0 * @param string $content The content to be output. * @param int $post_id The post ID. * @param string $title The title for the content. */ return apply_filters('cdxc_description_content', $content, $post_id, $title); } /** * Get and format content output for usage section of the codex page. * * @since 1.0.0 * @package Codex_Creator * @param int $post_id Post ID of the post content required. * @param string $title Title for the content section. * @return string The formatted content. */ function cdxc_usage_content($post_id, $title) { $content = ''; $meta_value = get_post_meta($post_id, 'cdxc_usage', true); if (!$meta_value) { return; } $content .= CDXC_TITLE_START . $title . CDXC_TITLE_END; $content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END; /** * Filter the content returned by the function. * * @since 1.0.0 * @param string $content The content to be output. * @param int $post_id The post ID. * @param string $title The title for the content. */ return apply_filters('cdxc_usage_content', $content, $post_id, $title); } /** * Get and format content output for access section of the codex page. * * @since 1.0.0 * @package Codex_Creator * @param int $post_id Post ID of the post content required. * @param string $title Title for the content section. * @return string The formatted content. */ function cdxc_access_content($post_id, $title) { $content = ''; $meta_value = get_post_meta($post_id, 'cdxc_access', true); if (!$meta_value) { return; } $content .= CDXC_TITLE_START . $title . CDXC_TITLE_END; $content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END; /** * Filter the content returned by the function. * * @since 1.0.0 * @param string $content The content to be output. * @param int $post_id The post ID. * @param string $title The title for the content. */ return apply_filters('cdxc_access_content', $content, $post_id, $title); } /** * Get and format content output for deprecated section of the codex page. * * @since 1.0.0 * @package Codex_Creator * @param int $post_id Post ID of the post content required. * @param string $title Title for the content section. * @return string The formatted content. */ function cdxc_deprecated_content($post_id, $title) { $content = ''; $meta_value = get_post_meta($post_id, 'cdxc_deprecated', true); if (!$meta_value) { return; } $content .= CDXC_TITLE_START . $title . CDXC_TITLE_END; $content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END; /** * Filter the content returned by the function. * * @since 1.0.0 * @param string $content The content to be output. * @param int $post_id The post ID. * @param string $title The title for the content. */ return apply_filters('cdxc_deprecated_content', $content, $post_id, $title); } /** * Get and format content output for global section of the codex page. * * @since 1.0.0 * @package Codex_Creator * @param int $post_id Post ID of the post content required. * @param string $title Title for the content section. * @return string The formatted content. */ function cdxc_global_content($post_id, $title) { $content = ''; $meta_value = get_post_meta($post_id, 'cdxc_global', true); if (!$meta_value) { return; } $content .= CDXC_TITLE_START . $title . CDXC_TITLE_END; if (is_array($meta_value)) { foreach ($meta_value as $value) { $value = cdxc_global_content_helper($value); $content .= CDXC_CONTENT_START . $value . CDXC_CONTENT_END; } } else { $meta_value = cdxc_global_content_helper($meta_value); $content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END; } /** * Filter the content returned by the function. * * @since 1.0.0 * @param string $content The content to be output. * @param int $post_id The post ID. * @param string $title The title for the content. */ return apply_filters('cdxc_global_content', $content, $post_id, $title); } /** * Arrange a param value into a usable HTML output. * * @since 1.0.0 * @package Codex_Creator * @param string $param The param value to be used. * @return string Formatted HTML on success. */ function cdxc_global_content_helper($param) { if($param==''){return '';} $output = ''; $param_arr = explode(' ',$param); $param_arr = array_values(array_filter($param_arr)); //print_r($param_arr); $output .= '<dl>'; //variable if(!empty($param_arr[1])){ $var = $param_arr[1]; $output .= '<dt><b>'.$var.'</b></dt>'; unset($param_arr[1]); } $output .= '<dd>'; //datatype if(!empty($param_arr[0])){ $datatype = $param_arr[0]; $link_open = ''; $link_close = ''; if($datatype=='string' || $datatype=='String'){ $link_open = '<a href="http://codex.wordpress.org/How_to_Pass_Tag_Parameters#String" target="_blank">'; $link_close = '</a>'; } if($datatype=='int'){ $link_open = '<a href="http://codex.wordpress.org/How_to_Pass_Tag_Parameters#Integer" target="_blank">'; $link_close = '</a>'; } if($datatype=='bool'){ $link_open = '<a href="http://codex.wordpress.org/How_to_Pass_Tag_Parameters#Boolean" target="_blank">'; $link_close = '</a>'; } $output .= '('.$link_open.'<i>'.$datatype.'</i>'.$link_close.') '; unset($param_arr[0]); } //optional $optional = '(<i>'.__('required', CDXC_TEXTDOMAIN).'</i>)'; if(!empty($param_arr[2])){ $opt = $param_arr[2]; if($opt=='Optional.' || $opt=='optional.'){ $optional = '(<i>'.__('optional', CDXC_TEXTDOMAIN).'</i>)'; unset($param_arr[2]); } } $output .= $optional.' '; //we now split into descriptions. $param_str = implode(' ',$param_arr); $param_arr = explode('.',$param_str); $param_arr = array_filter($param_arr); //print_r($param_arr); //description/default $default = '<dl><dd>'.__('Default', CDXC_TEXTDOMAIN).': <i>'.__('None', CDXC_TEXTDOMAIN).'</i></dd></dl>'; foreach ($param_arr as $bit) { $bit = trim($bit); //echo '#'.$bit.'#'; if(substr( $bit, 0, 7) === 'Default'){ $bits = explode('Default',$bit); $default = '<dl><dd>'.__('Default', CDXC_TEXTDOMAIN).': <i>'.$bits[1].'</i></dd></dl>'; }else{ $output .= $bit.'. '; } } $output .= $default; $output .= '</dd>'; $output .= '</dl>'; return $output; } /** * Get and format content output for internal section of the codex page. * * @since 1.0.0 * @package Codex_Creator * @param int $post_id Post ID of the post content required. * @param string $title Title for the content section. * @return string The formatted content. */ function cdxc_internal_content($post_id, $title) { $content = ''; $meta_value = get_post_meta($post_id, 'cdxc_internal', true); if (!$meta_value) { return; } $content .= CDXC_TITLE_START . $title . CDXC_TITLE_END; $content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END; /** * Filter the content returned by the function. * * @since 1.0.0 * @param string $content The content to be output. * @param int $post_id The post ID. * @param string $title The title for the content. */ return apply_filters('cdxc_internal_content', $content, $post_id, $title); } /** * Get and format content output for ignore section of the codex page. * * @since 1.0.0 * @package Codex_Creator * @param int $post_id Post ID of the post content required. * @param string $title Title for the content section. * @return string The formatted content. */ function cdxc_ignore_content($post_id, $title) { $content = ''; $meta_value = get_post_meta($post_id, 'cdxc_ignore', true); if (!$meta_value) { return; } $content .= CDXC_TITLE_START . $title . CDXC_TITLE_END; $content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END; /** * Filter the content returned by the function. * * @since 1.0.0 * @param string $content The content to be output. * @param int $post_id The post ID. * @param string $title The title for the content. */ return apply_filters('cdxc_ignore_content', $content, $post_id, $title); } /** * Get and format content output for link section of the codex page. * * @since 1.0.0 * @package Codex_Creator * @param int $post_id Post ID of the post content required. * @param string $title Title for the content section. * @return string The formatted content. */ function cdxc_link_content($post_id, $title) { $content = ''; $meta_value = get_post_meta($post_id, 'cdxc_link', true); if (!$meta_value) { return; } /* * @todo add checking for parsing links */ $content .= CDXC_TITLE_START . $title . CDXC_TITLE_END; $content .= CDXC_CONTENT_START ."<a href='$meta_value' >".$meta_value . "</a>".CDXC_CONTENT_END; /** * Filter the content returned by the function. * * @since 1.0.0 * @param string $content The content to be output. * @param int $post_id The post ID. * @param string $title The title for the content. */ return apply_filters('cdxc_link_content', $content, $post_id, $title); } /** * Get and format content output for method section of the codex page. * * @since 1.0.0 * @package Codex_Creator * @param int $post_id Post ID of the post content required. * @param string $title Title for the content section. * @return string The formatted content. */ function cdxc_method_content($post_id, $title) { $content = ''; $meta_value = get_post_meta($post_id, 'cdxc_method', true); if (!$meta_value) { return; } $content .= CDXC_TITLE_START . $title . CDXC_TITLE_END; $content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END; /** * Filter the content returned by the function. * * @since 1.0.0 * @param string $content The content to be output. * @param int $post_id The post ID. * @param string $title The title for the content. */ return apply_filters('cdxc_method_content', $content, $post_id, $title); } /** * Get and format content output for package section of the codex page. * * @since 1.0.0 * @package Codex_Creator * @param int $post_id Post ID of the post content required. * @param string $title Title for the content section. * @return string The formatted content. */ function cdxc_package_content($post_id, $title) { $content = ''; $meta_value = get_post_meta($post_id, 'cdxc_package', true); if (!$meta_value) { return; } $content .= CDXC_TITLE_START . $title . CDXC_TITLE_END; $content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END; /** * Filter the content returned by the function. * * @since 1.0.0 * @param string $content The content to be output. * @param int $post_id The post ID. * @param string $title The title for the content. */ return apply_filters('cdxc_package_content', $content, $post_id, $title); } /** * Get and format content output for param section of the codex page. * * @since 1.0.0 * @package Codex_Creator * @param int $post_id Post ID of the post content required. * @param string $title Title for the content section. * @return string The formatted content. */ function cdxc_param_content($post_id, $title) { $content = ''; $meta_value = get_post_meta($post_id, 'cdxc_param', true); if (!$meta_value) { return; } $content .= CDXC_TITLE_START . $title . CDXC_TITLE_END; if (is_array($meta_value)) { foreach ($meta_value as $value) { $value = cdxc_param_content_helper($value); $content .= CDXC_CONTENT_START . $value . CDXC_CONTENT_END; } } else { $meta_value = cdxc_param_content_helper($meta_value); $content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END; } /** * Filter the content returned by the function. * * @since 1.0.0 * @param string $content The content to be output. * @param int $post_id The post ID. * @param string $title The title for the content. */ return apply_filters('cdxc_param_content', $content, $post_id, $title); } /** * Arrange a param value into a usable HTML output. * * @since 1.0.0 * @package Codex_Creator * @param string $param The param value to be used. * @return string Formatted HTML on success. */ function cdxc_param_content_helper($param) { if($param==''){return '';} $output = ''; $param_arr = explode(' ',$param); $param_arr = array_values(array_filter($param_arr)); //print_r($param_arr); $output .= '<dl>'; //variable if(!empty($param_arr[1])){ $var = $param_arr[1]; $output .= '<dt><b>'.$var.'</b></dt>'; unset($param_arr[1]); } $output .= '<dd>'; //datatype if(!empty($param_arr[0])){ $datatype = $param_arr[0]; $link_open = ''; $link_close = ''; if($datatype=='string' || $datatype=='String'){ $link_open = '<a href="http://codex.wordpress.org/How_to_Pass_Tag_Parameters#String" target="_blank">'; $link_close = '</a>'; } if($datatype=='int'){ $link_open = '<a href="http://codex.wordpress.org/How_to_Pass_Tag_Parameters#Integer" target="_blank">'; $link_close = '</a>'; } if($datatype=='bool'){ $link_open = '<a href="http://codex.wordpress.org/How_to_Pass_Tag_Parameters#Boolean" target="_blank">'; $link_close = '</a>'; } $output .= '('.$link_open.'<i>'.$datatype.'</i>'.$link_close.') '; unset($param_arr[0]); } //optional $optional = '(<i>'.__('required', CDXC_TEXTDOMAIN).'</i>)'; if(!empty($param_arr[2])){ $opt = $param_arr[2]; if($opt=='Optional.' || $opt=='optional.'){ $optional = '(<i>'.__('optional', CDXC_TEXTDOMAIN).'</i>)'; unset($param_arr[2]); } } $output .= $optional.' '; //we now split into descriptions. $param_str = implode(' ',$param_arr); $param_arr = explode('.',$param_str); $param_arr = array_filter($param_arr); //print_r($param_arr); //description/default $default = '<dl><dd>'.__('Default', CDXC_TEXTDOMAIN).': <i>'.__('None', CDXC_TEXTDOMAIN).'</i></dd></dl>'; foreach ($param_arr as $bit) { $bit = trim($bit); //echo '#'.$bit.'#'; if(substr( $bit, 0, 7) === 'Default'){ $bits = explode('Default',$bit); $default = '<dl><dd>'.__('Default', CDXC_TEXTDOMAIN).': <i>'.$bits[1].'</i></dd></dl>'; }else{ $output .= $bit.'. '; } } $output .= $default; $output .= '</dd>'; $output .= '</dl>'; return $output; } /** * Get and format content output for example section of the codex page. * * @since 1.0.0 * @package Codex_Creator * @param int $post_id Post ID of the post content required. * @param string $title Title for the content section. * @return string The formatted content. */ function cdxc_example_content($post_id, $title) { $content = ''; $meta_value = get_post_meta($post_id, 'cdxc_example', true); if (!$meta_value) { return; } $content .= CDXC_TITLE_START . $title . CDXC_TITLE_END; $content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END; /** * Filter the content returned by the function. * * @since 1.0.0 * @param string $content The content to be output. * @param int $post_id The post ID. * @param string $title The title for the content. */ return apply_filters('cdxc_example_content', $content, $post_id, $title); } /** * Get and format content output for return section of the codex page. * * @since 1.0.0 * @package Codex_Creator * @param int $post_id Post ID of the post content required. * @param string $title Title for the content section. * @return string The formatted content. */ function cdxc_return_content($post_id, $title) { $content = ''; $meta_value = get_post_meta($post_id, 'cdxc_return', true); if (!$meta_value) { return; } $content .= CDXC_TITLE_START . $title . CDXC_TITLE_END; $meta_value = cdxc_return_content_helper($meta_value); $content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END; /** * Filter the content returned by the function. * * @since 1.0.0 * @param string $content The content to be output. * @param int $post_id The post ID. * @param string $title The title for the content. */ return apply_filters('cdxc_return_content', $content, $post_id, $title); } /** * Arrange a return value into a usable HTML output. * * @since 1.0.0 * @package Codex_Creator * @param string $value The string value to be used. * @return string Formatted HTML on success. */ function cdxc_return_content_helper($value) { if($value==''){return '';} $output = ''; $param_arr = explode(' ',$value); $param_arr = array_values(array_filter($param_arr)); //print_r($param_arr); $output .= '<dl>'; //datatype if(!empty($param_arr[0])){ $datatype = $param_arr[0]; $link_open = ''; $link_close = ''; if($datatype=='string' || $datatype=='String'){ $link_open = '<a href="http://codex.wordpress.org/How_to_Pass_Tag_Parameters#String" target="_blank">'; $link_close = '</a>'; } if($datatype=='int'){ $link_open = '<a href="http://codex.wordpress.org/How_to_Pass_Tag_Parameters#Integer" target="_blank">'; $link_close = '</a>'; } if($datatype=='bool'){ $link_open = '<a href="http://codex.wordpress.org/How_to_Pass_Tag_Parameters#Boolean" target="_blank">'; $link_close = '</a>'; } $output .= '<dt><b>('.$link_open.'<i>'.$datatype.'</i>'.$link_close.')</b></dt>'; unset($param_arr[0]); } $output .= '<ul>'; //we now split into descriptions. $param_str = implode(' ',$param_arr); $param_arr = explode('.',$param_str); $param_arr = array_filter($param_arr); //print_r($param_arr); //description/default foreach ($param_arr as $bit) { $bit = trim($bit); $output .= '<li>'.$bit.'. </li>'; } $output .= '</ul>'; $output .= '</dl>'; /** * Filter the content returned by the function. * * @since 1.0.0 * @param string $content The content to be output. * @param int $post_id The post ID. * @param string $title The title for the content. */ return $output; } /** * Get and format content output for see section of the codex page. * * @since 1.0.0 * @package Codex_Creator * @param int $post_id Post ID of the post content required. * @param string $title Title for the content section. * @return string The formatted content. */ function cdxc_see_content($post_id, $title) { $content = ''; $meta_value = get_post_meta($post_id, 'cdxc_see', true); if (!$meta_value) { return; } $content .= CDXC_TITLE_START . $title . CDXC_TITLE_END; if (is_array($meta_value)) { foreach ($meta_value as $value) { $value = cdxc_see_content_helper($value); $content .= CDXC_CONTENT_START . $value . CDXC_CONTENT_END; } } else { $meta_value = cdxc_see_content_helper($meta_value); $content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END; } /** * Filter the content returned by the function. * * @since 1.0.0 * @param string $content The content to be output. * @param int $post_id The post ID. * @param string $title The title for the content. */ return apply_filters('cdxc_see_content', $content, $post_id, $title); } /** * Arrange a see value into a usable HTML output. * * @since 1.0.0 * @package Codex_Creator * @param string $value The string value to be used. * @return string Formatted HTML on success. * @todo make this format URL's. */ function cdxc_see_content_helper($text) { if ($text == '') { return ''; } if (strpos($text,'"') !== false || strpos($text,"'") !== false) {// we have a hook $new_text = str_replace(array('"',"'"),'',$text); $page = get_page_by_title($new_text, OBJECT, 'codex_creator'); if($page) { $link = get_permalink($page->ID); $text = "<a href='$link' >$text</a>"; } }elseif(strpos($text,'()') !== false){ $new_text = str_replace('()','',$text); $page = get_page_by_title($new_text, OBJECT, 'codex_creator'); if($page) { $link = get_permalink($page->ID); $text = "<a href='$link' >$text</a>"; } } return $text; } /** * Get and format content output for since section of the codex page. * * @since 1.0.0 * @package Codex_Creator * @param int $post_id Post ID of the post content required. * @param string $title Title for the content section. * @return string The formatted content. */ function cdxc_since_content($post_id, $title) { $content = ''; $meta_value = get_post_meta($post_id, 'cdxc_since', true); if (!$meta_value) { return; } if (is_array($meta_value) && empty($meta_value)) { return false; } $content .= CDXC_TITLE_START . $title . CDXC_TITLE_END; $tags = array(); if (is_array($meta_value)) { $i=0; foreach ($meta_value as $value) { if($i==0){$since = __('Since', CDXC_TEXTDOMAIN).': ';}else{$since='';} if ($pieces = explode(" ", $value)) { $ver = $pieces[0]; unset($pieces[0]); $text = join(' ', $pieces); $content .= CDXC_CONTENT_START .$since. '<a href="%' . $ver . '%">' . $ver . '</a>' . ' ' . $text . CDXC_CONTENT_END; $tags[] = $ver; } else { $content .= CDXC_CONTENT_START . '<a href="%' . $value . '%">' . $value . '</a>' . CDXC_CONTENT_END; $tags[] = $value; } $i++; } } else { $content .= CDXC_CONTENT_START .__('Since', CDXC_TEXTDOMAIN). ': <a href="%' . $meta_value . '%">' . $meta_value . '</a>' . CDXC_CONTENT_END; $tags[] = $meta_value; } // get the project slug $project_slug = 'project-not-found'; $project_terms = wp_get_object_terms($post_id, 'codex_project'); if (!is_wp_error($project_terms) && !empty($project_terms) && is_object($project_terms[0])) { foreach ($project_terms as $p_term) { if ($p_term->parent == '0') { $project_slug = $p_term->slug; } } } //set all tags to have prefix of the project $alt_tags = array(); foreach ($tags as $temp_tag) { $alt_tags[] = $project_slug . '_' . $temp_tag; } $tags = $alt_tags; $tags_arr = wp_set_post_terms($post_id, $tags, 'codex_tags', false); //print_r($tags_arr);//exit; if (is_array($tags_arr)) { foreach ($tags_arr as $key => $tag_id) { //$term = get_term($tag_id, 'codex_tags'); $term = get_term_by('term_taxonomy_id', $tag_id, 'codex_tags'); $tag_link = get_term_link($term, 'codex_tags'); $orig_ver = str_replace($project_slug . '_', '', $tags[$key]); $content = str_replace('%' . $orig_ver . '%', $tag_link, $content); } } // print_r($tags_arr);exit; /** * Filter the content returned by the function. * * @since 1.0.0 * @param string $content The content to be output. * @param int $post_id The post ID. * @param string $title The title for the content. */ return apply_filters('cdxc_since_content', $content, $post_id, $title); } /** * Get and format content output for subpackage section of the codex page. * * @since 1.0.0 * @package Codex_Creator * @param int $post_id Post ID of the post content required. * @param string $title Title for the content section. * @return string The formatted content. */ function cdxc_subpackage_content($post_id, $title) { $content = ''; $meta_value = get_post_meta($post_id, 'cdxc_subpackage', true); if (!$meta_value) { return; } $content .= CDXC_TITLE_START . $title . CDXC_TITLE_END; $content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END; /** * Filter the content returned by the function. * * @since 1.0.0 * @param string $content The content to be output. * @param int $post_id The post ID. * @param string $title The title for the content. */ return apply_filters('cdxc_subpackage_content', $content, $post_id, $title); } /** * Get and format content output for todo section of the codex page. * * @since 1.0.0 * @package Codex_Creator * @param int $post_id Post ID of the post content required. * @param string $title Title for the content section. * @return string The formatted content. */ function cdxc_todo_content($post_id, $title) { $content = ''; $meta_value = get_post_meta($post_id, 'cdxc_todo', true); if (!$meta_value) { return; } $content .= CDXC_TITLE_START . $title . CDXC_TITLE_END; $content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END; /** * Filter the content returned by the function. * * @since 1.0.0 * @param string $content The content to be output. * @param int $post_id The post ID. * @param string $title The title for the content. */ return apply_filters('cdxc_todo_content', $content, $post_id, $title); } /** * Get and format content output for type section of the codex page. * * @since 1.0.0 * @package Codex_Creator * @param int $post_id Post ID of the post content required. * @param string $title Title for the content section. * @return string The formatted content. */ function cdxc_type_content($post_id, $title) { $content = ''; $meta_value = get_post_meta($post_id, 'cdxc_type', true); if (!$meta_value) { return; } $content .= CDXC_TITLE_START . $title . CDXC_TITLE_END; $content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END; /** * Filter the content returned by the function. * * @since 1.0.0 * @param string $content The content to be output. * @param int $post_id The post ID. * @param string $title The title for the content. */ return apply_filters('cdxc_type_content', $content, $post_id, $title); } /** * Get and format content output for uses section of the codex page. * * @since 1.0.0 * @package Codex_Creator * @param int $post_id Post ID of the post content required. * @param string $title Title for the content section. * @return string The formatted content. */ function cdxc_uses_content($post_id, $title) { return;// @todo make this work with arrays. $content = ''; $meta_value = get_post_meta($post_id, 'cdxc_uses', true); if (!$meta_value) { return; } $content .= CDXC_TITLE_START . $title . CDXC_TITLE_END; $content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END; /** * Filter the content returned by the function. * * @since 1.0.0 * @param string $content The content to be output. * @param int $post_id The post ID. * @param string $title The title for the content. */ return apply_filters('cdxc_uses_content', $content, $post_id, $title); } /** * Get and format content output for var section of the codex page. * * @since 1.0.0 * @package Codex_Creator * @param int $post_id Post ID of the post content required. * @param string $title Title for the content section. * @return string The formatted content. */ function cdxc_var_content($post_id, $title) { $content = ''; $meta_value = get_post_meta($post_id, 'cdxc_var', true); if (!$meta_value) { return; } $content .= CDXC_TITLE_START . $title . CDXC_TITLE_END; $content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END; /** * Filter the content returned by the function. * * @since 1.0.0 * @param string $content The content to be output. * @param int $post_id The post ID. * @param string $title The title for the content. */ return apply_filters('cdxc_var_content', $content, $post_id, $title); } /** * Get and format content output for functions section of the codex page. * * @since 1.0.0 * @package Codex_Creator * @param int $post_id Post ID of the post content required. * @param string $title Title for the content section. * @return string The formatted content. */ function cdxc_functions_content($post_id, $title) { $content = ''; $meta_value = get_post_meta($post_id, 'cdxc_meta_functions', true); if (!$meta_value) { return; } $content .= CDXC_TITLE_START . $title . CDXC_TITLE_END; //$content .= CDXC_CONTENT_START.$meta_value.CDXC_CONTENT_END; if (is_array($meta_value)) { foreach ($meta_value as $func) { $func_arr = get_page_by_title($func[1], OBJECT, 'codex_creator'); // print_r($func_arr);exit; if (is_object($func_arr)) { $link = get_permalink($func_arr->ID); $content .= CDXC_CONTENT_START . '<a href="' . $link . '">' . $func[1] . '()</a> [' . __('Line', CDXC_TEXTDOMAIN) . ': ' . $func[2] . ']' . CDXC_CONTENT_END; } else { $content .= CDXC_CONTENT_START . $func[1] . '() [' . __('Line', CDXC_TEXTDOMAIN) . ': ' . $func[2] . ']' . CDXC_CONTENT_END; } } } //$content .= CDXC_CONTENT_START.print_r($meta_value,true).CDXC_CONTENT_END; /** * Filter the content returned by the function. * * @since 1.0.0 * @param string $content The content to be output. * @param int $post_id The post ID. * @param string $title The title for the content. */ return apply_filters('cdxc_functions_content', $content, $post_id, $title); } /** * Get and format content output for actions section of the codex page. * * @since 1.0.0 * @package Codex_Creator * @param int $post_id Post ID of the post content required. * @param string $title Title for the content section. * @return string The formatted content. */ function cdxc_actions_content($post_id, $title) { $content = ''; $meta_value = get_post_meta($post_id, 'cdxc_meta_actions', true); if (!$meta_value) { return; } $content .= CDXC_TITLE_START . $title . CDXC_TITLE_END; if (is_array($meta_value)) { foreach ($meta_value as $func) { $func_arr = get_page_by_title($func[1], OBJECT, 'codex_creator'); //print_r($func_arr);exit; $name = "'".$func[1]."'"; if (is_object($func_arr)) { $link = get_permalink($func_arr->ID); $content .= CDXC_CONTENT_START . '<a href="' . $link . '">' . $name . ' </a> [' . __('Line', CDXC_TEXTDOMAIN) . ': ' . $func[2] . ']' . CDXC_CONTENT_END; } else { $content .= CDXC_CONTENT_START . $name . ' [' . __('Line', CDXC_TEXTDOMAIN) . ': ' . $func[2] . ']' . CDXC_CONTENT_END; } } } //$content .= CDXC_CONTENT_START.print_r($meta_value,true).CDXC_CONTENT_END; /** * Filter the content returned by the function. * * @since 1.0.0 * @param string $content The content to be output. * @param int $post_id The post ID. * @param string $title The title for the content. */ return apply_filters('cdxc_actions_content', $content, $post_id, $title); } /** * Get and format content output for filters section of the codex page. * * @since 1.0.0 * @package Codex_Creator * @param int $post_id Post ID of the post content required. * @param string $title Title for the content section. * @return string The formatted content. */ function cdxc_filters_content($post_id, $title) { $content = ''; $meta_value = get_post_meta($post_id, 'cdxc_meta_filters', true); if (!$meta_value) { return; } $content .= CDXC_TITLE_START . $title . CDXC_TITLE_END; if (is_array($meta_value)) { foreach ($meta_value as $func) { $func_arr = get_page_by_title($func[1], OBJECT, 'codex_creator'); // print_r($func_arr);exit; $name = "'".$func[1]."'"; if (is_object($func_arr)) { $link = get_permalink($func_arr->ID); $content .= CDXC_CONTENT_START . '<a href="' . $link . '">' . $name . ' </a> [' . __('Line', CDXC_TEXTDOMAIN) . ': ' . $func[2] . ']' . CDXC_CONTENT_END; } else { $content .= CDXC_CONTENT_START . $name . ' [' . __('Line', CDXC_TEXTDOMAIN) . ': ' . $func[2] . ']' . CDXC_CONTENT_END; } } } //$content .= CDXC_CONTENT_START.print_r($meta_value,true).CDXC_CONTENT_END; /** * Filter the content returned by the function. * * @since 1.0.0 * @param string $content The content to be output. * @param int $post_id The post ID. * @param string $title The title for the content. */ return apply_filters('cdxc_filters_content', $content, $post_id, $title); } /** * Get and format content output for location section of the codex page. * * @since 1.0.0 * @package Codex_Creator * @param int $post_id Post ID of the post content required. * @param string $title Title for the content section. * @return string The formatted content. */ function cdxc_location_content($post_id, $title) { $content = ''; $meta_type = get_post_meta($post_id, 'cdxc_meta_type', true); if ($meta_type == 'file' || $meta_type == 'action' || $meta_type == 'filter') { return false; } $meta_value = get_post_meta($post_id, 'cdxc_meta_path', true); if (!$meta_value) { return; } $line = get_post_meta($post_id, 'cdxc_meta_line', true); $content .= CDXC_TITLE_START . $title . CDXC_TITLE_END; $file_name = basename($meta_value); $func_arr = get_post($post_id); $func_name = $func_arr->post_title; if($meta_type=='function'){ $func_name_n = $func_name. '() '; }else{ $func_name_n = "'".$func_name. "' "; } $file_arr = get_page_by_title($file_name, OBJECT, 'codex_creator'); if (is_object($file_arr)) { $link = get_permalink($file_arr->ID); $content .= CDXC_CONTENT_START .$func_name_n . __('is located in', CDXC_TEXTDOMAIN) . ' <a href="' . $link . '">' . $meta_value . '</a> [' . __('Line', CDXC_TEXTDOMAIN) . ': ' . $line . ']' . CDXC_CONTENT_END; } else { $content .= CDXC_CONTENT_START . $func_name_n . __('is located in', CDXC_TEXTDOMAIN) . ' ' . $meta_value . ' [' . __('Line', CDXC_TEXTDOMAIN) . ': ' . $line . ']' . CDXC_CONTENT_END; } /** * Filter the content returned by the function. * * @since 1.0.0 * @param string $content The content to be output. * @param int $post_id The post ID. * @param string $title The title for the content. */ return apply_filters('cdxc_location_content', $content, $post_id, $title); } /** * Get and format content output for source code section of the codex page. * * @since 1.0.0 * @package Codex_Creator * @param int $post_id Post ID of the post content required. * @param string $title Title for the content section. * @return string The formatted content. */ function cdxc_code_content($post_id, $title) { $content = ''; $meta_value = get_post_meta($post_id, 'cdxc_meta_code', true); if (!$meta_value) { return; } $meta_value = "%%CDXC_SRC_CODE%%"; $content .= CDXC_TITLE_START . $title . CDXC_TITLE_END; //$content .= CDXC_PHP_CODE_START . $meta_value . CDXC_PHP_CODE_END; $content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END; /** * Filter the content returned by the function. * * @since 1.0.0 * @param string $content The content to be output. * @param int $post_id The post ID. * @param string $title The title for the content. */ return apply_filters('cdxc_code_content', $content, $post_id, $title); } /** * Get and format content output for filters section of the codex page. * * @since 1.0.0 * @package Codex_Creator * @param int $post_id Post ID of the post content required. * @param string $title Title for the content section. * @return string The formatted content. */ function cdxc_used_by_content($post_id, $title) { $content = ''; $meta_value = get_post_meta($post_id, 'cdxc_meta_used_by', true); if (!$meta_value) { return; } $content .= CDXC_TITLE_START . $title . CDXC_TITLE_END; if (is_array($meta_value)) { foreach ($meta_value as $func) { $func_arr = get_page_by_title($func['function_name'], OBJECT, 'codex_creator'); // print_r($func_arr);exit; $name = ''; if($func['function_name']){ $name = "".$func['function_name']."()"; } if (is_object($func_arr)) { $link = get_permalink($func_arr->ID); $content .= CDXC_CONTENT_START . $func['file_path'].': <a href="' . $link . '">' . $name . ' </a> [' . __('Line', CDXC_TEXTDOMAIN) . ': ' . $func['hook_line'] . ']' . CDXC_CONTENT_END; } else { $content .= CDXC_CONTENT_START .$func['file_path'].': '. $name . ' [' . __('Line', CDXC_TEXTDOMAIN) . ': ' . $func['hook_line'] . ']' . CDXC_CONTENT_END; } } } //$content .= CDXC_CONTENT_START.print_r($meta_value,true).CDXC_CONTENT_END; /** * Filter the content returned by the function. * * @since 1.0.0 * @param string $content The content to be output. * @param int $post_id The post ID. * @param string $title The title for the content. */ return apply_filters('cdxc_used_by_content', $content, $post_id, $title); }
Java
/******************************************************************************* * Copyright 2010 Olaf Sebelin * * This file is part of Verdandi. * * Verdandi 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. * * Verdandi 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 Verdandi. If not, see <http://www.gnu.org/licenses/>. ******************************************************************************/ package verdandi; /** * * @ */ public class InvalidIntervalException extends Exception { /** * */ private static final long serialVersionUID = 1L; /** * */ public InvalidIntervalException() { super(); } /** * @param message */ public InvalidIntervalException(String message) { super(message); } }
Java
/* * sound/oss/ad1848.c * * The low level driver for the AD1848/CS4248 codec chip which * is used for example in the MS Sound System. * * The CS4231 which is used in the GUS MAX and some other cards is * upwards compatible with AD1848 and this driver is able to drive it. * * CS4231A and AD1845 are upward compatible with CS4231. However * the new features of these chips are different. * * CS4232 is a PnP audio chip which contains a CS4231A (and SB, MPU). * CS4232A is an improved version of CS4232. * * * * Copyright (C) by Hannu Savolainen 1993-1997 * * OSS/Free for Linux is distributed under the GNU GENERAL PUBLIC LICENSE (GPL) * Version 2 (June 1991). See the "COPYING" file distributed with this software * for more info. * * * Thomas Sailer : ioctl code reworked (vmalloc/vfree removed) * general sleep/wakeup clean up. * Alan Cox : reformatted. Fixed SMP bugs. Moved to kernel alloc/free * of irqs. Use dev_id. * Christoph Hellwig : adapted to module_init/module_exit * Aki Laukkanen : added power management support * Arnaldo C. de Melo : added missing restore_flags in ad1848_resume * Miguel Freitas : added ISA PnP support * Alan Cox : Added CS4236->4239 identification * Daniel T. Cobra : Alernate config/mixer for later chips * Alan Cox : Merged chip idents and config code * * TODO * APM save restore assist code on IBM thinkpad * * Status: * Tested. Believed fully functional. */ #include <linux/init.h> #include <linux/interrupt.h> #include <linux/module.h> #include <linux/stddef.h> #include <linux/slab.h> #include <linux/isapnp.h> #include <linux/pnp.h> #include <linux/spinlock.h> #include "sound_config.h" #include "ad1848.h" #include "ad1848_mixer.h" typedef struct { spinlock_t lock; int base; int irq; int dma1, dma2; int dual_dma; /* 1, when two DMA channels allocated */ int subtype; unsigned char MCE_bit; unsigned char saved_regs[64]; /* Includes extended register space */ int debug_flag; int audio_flags; int record_dev, playback_dev; int xfer_count; int audio_mode; int open_mode; int intr_active; char *chip_name, *name; int model; #define MD_1848 1 #define MD_4231 2 #define MD_4231A 3 #define MD_1845 4 #define MD_4232 5 #define MD_C930 6 #define MD_IWAVE 7 #define MD_4235 8 /* Crystal Audio CS4235 */ #define MD_1845_SSCAPE 9 /* Ensoniq Soundscape PNP*/ #define MD_4236 10 /* 4236 and higher */ #define MD_42xB 11 /* CS 42xB */ #define MD_4239 12 /* CS4239 */ /* Mixer parameters */ int recmask; int supported_devices, orig_devices; int supported_rec_devices, orig_rec_devices; int *levels; short mixer_reroute[32]; int dev_no; volatile unsigned long timer_ticks; int timer_running; int irq_ok; mixer_ents *mix_devices; int mixer_output_port; } ad1848_info; typedef struct ad1848_port_info { int open_mode; int speed; unsigned char speed_bits; int channels; int audio_format; unsigned char format_bits; } ad1848_port_info; static struct address_info cfg; static int nr_ad1848_devs; static bool deskpro_xl; static bool deskpro_m; static bool soundpro; static volatile signed char irq2dev[17] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; #ifndef EXCLUDE_TIMERS static int timer_installed = -1; #endif static int loaded; static int ad_format_mask[13 /*devc->model */ ] = { 0, AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW, AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW | AFMT_S16_BE | AFMT_IMA_ADPCM, AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW | AFMT_S16_BE | AFMT_IMA_ADPCM, AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW, /* AD1845 */ AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW | AFMT_S16_BE | AFMT_IMA_ADPCM, AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW | AFMT_S16_BE | AFMT_IMA_ADPCM, AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW | AFMT_S16_BE | AFMT_IMA_ADPCM, AFMT_U8 | AFMT_S16_LE /* CS4235 */, AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW /* Ensoniq Soundscape*/, AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW | AFMT_S16_BE | AFMT_IMA_ADPCM, AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW | AFMT_S16_BE | AFMT_IMA_ADPCM, AFMT_U8 | AFMT_S16_LE | AFMT_MU_LAW | AFMT_A_LAW | AFMT_S16_BE | AFMT_IMA_ADPCM }; static ad1848_info adev_info[MAX_AUDIO_DEV]; #define io_Index_Addr(d) ((d)->base) #define io_Indexed_Data(d) ((d)->base+1) #define io_Status(d) ((d)->base+2) #define io_Polled_IO(d) ((d)->base+3) static struct { unsigned char flags; #define CAP_F_TIMER 0x01 } capabilities [10 /*devc->model */ ] = { {0} , {0} /* MD_1848 */ , {CAP_F_TIMER} /* MD_4231 */ , {CAP_F_TIMER} /* MD_4231A */ , {CAP_F_TIMER} /* MD_1845 */ , {CAP_F_TIMER} /* MD_4232 */ , {0} /* MD_C930 */ , {CAP_F_TIMER} /* MD_IWAVE */ , {0} /* MD_4235 */ , {CAP_F_TIMER} /* MD_1845_SSCAPE */ }; #ifdef CONFIG_PNP static int isapnp = 1; static int isapnpjump; static bool reverse; static int audio_activated; #else static int isapnp; #endif static int ad1848_open(int dev, int mode); static void ad1848_close(int dev); static void ad1848_output_block(int dev, unsigned long buf, int count, int intrflag); static void ad1848_start_input(int dev, unsigned long buf, int count, int intrflag); static int ad1848_prepare_for_output(int dev, int bsize, int bcount); static int ad1848_prepare_for_input(int dev, int bsize, int bcount); static void ad1848_halt(int dev); static void ad1848_halt_input(int dev); static void ad1848_halt_output(int dev); static void ad1848_trigger(int dev, int bits); static irqreturn_t adintr(int irq, void *dev_id); #ifndef EXCLUDE_TIMERS static int ad1848_tmr_install(int dev); static void ad1848_tmr_reprogram(int dev); #endif static int ad_read(ad1848_info *devc, int reg) { int x; int timeout = 900000; while (timeout > 0 && inb(devc->base) == 0x80) /*Are we initializing */ { timeout--; } if (reg < 32) { outb(((unsigned char) (reg & 0xff) | devc->MCE_bit), io_Index_Addr(devc)); x = inb(io_Indexed_Data(devc)); } else { int xreg, xra; xreg = (reg & 0xff) - 32; xra = (((xreg & 0x0f) << 4) & 0xf0) | 0x08 | ((xreg & 0x10) >> 2); outb(((unsigned char) (23 & 0xff) | devc->MCE_bit), io_Index_Addr(devc)); outb(((unsigned char) (xra & 0xff)), io_Indexed_Data(devc)); x = inb(io_Indexed_Data(devc)); } return x; } static void ad_write(ad1848_info *devc, int reg, int data) { int timeout = 900000; while (timeout > 0 && inb(devc->base) == 0x80) /* Are we initializing */ { timeout--; } if (reg < 32) { outb(((unsigned char) (reg & 0xff) | devc->MCE_bit), io_Index_Addr(devc)); outb(((unsigned char) (data & 0xff)), io_Indexed_Data(devc)); } else { int xreg, xra; xreg = (reg & 0xff) - 32; xra = (((xreg & 0x0f) << 4) & 0xf0) | 0x08 | ((xreg & 0x10) >> 2); outb(((unsigned char) (23 & 0xff) | devc->MCE_bit), io_Index_Addr(devc)); outb(((unsigned char) (xra & 0xff)), io_Indexed_Data(devc)); outb((unsigned char) (data & 0xff), io_Indexed_Data(devc)); } } static void wait_for_calibration(ad1848_info *devc) { int timeout; /* * Wait until the auto calibration process has finished. * * 1) Wait until the chip becomes ready (reads don't return 0x80). * 2) Wait until the ACI bit of I11 gets on and then off. */ timeout = 100000; while (timeout > 0 && inb(devc->base) == 0x80) { timeout--; } if (inb(devc->base) & 0x80) { printk(KERN_WARNING "ad1848: Auto calibration timed out(1).\n"); } timeout = 100; while (timeout > 0 && !(ad_read(devc, 11) & 0x20)) { timeout--; } if (!(ad_read(devc, 11) & 0x20)) { return; } timeout = 80000; while (timeout > 0 && (ad_read(devc, 11) & 0x20)) { timeout--; } if (ad_read(devc, 11) & 0x20) if ((devc->model != MD_1845) && (devc->model != MD_1845_SSCAPE)) { printk(KERN_WARNING "ad1848: Auto calibration timed out(3).\n"); } } static void ad_mute(ad1848_info *devc) { int i; unsigned char prev; /* * Save old register settings and mute output channels */ for (i = 6; i < 8; i++) { prev = devc->saved_regs[i] = ad_read(devc, i); } } static void ad_unmute(ad1848_info *devc) { } static void ad_enter_MCE(ad1848_info *devc) { int timeout = 1000; unsigned short prev; while (timeout > 0 && inb(devc->base) == 0x80) /*Are we initializing */ { timeout--; } devc->MCE_bit = 0x40; prev = inb(io_Index_Addr(devc)); if (prev & 0x40) { return; } outb((devc->MCE_bit), io_Index_Addr(devc)); } static void ad_leave_MCE(ad1848_info *devc) { unsigned char prev, acal; int timeout = 1000; while (timeout > 0 && inb(devc->base) == 0x80) /*Are we initializing */ { timeout--; } acal = ad_read(devc, 9); devc->MCE_bit = 0x00; prev = inb(io_Index_Addr(devc)); outb((0x00), io_Index_Addr(devc)); /* Clear the MCE bit */ if ((prev & 0x40) == 0) /* Not in MCE mode */ { return; } outb((0x00), io_Index_Addr(devc)); /* Clear the MCE bit */ if (acal & 0x08) /* Auto calibration is enabled */ { wait_for_calibration(devc); } } static int ad1848_set_recmask(ad1848_info *devc, int mask) { unsigned char recdev; int i, n; unsigned long flags; mask &= devc->supported_rec_devices; /* Rename the mixer bits if necessary */ for (i = 0; i < 32; i++) { if (devc->mixer_reroute[i] != i) { if (mask & (1 << i)) { mask &= ~(1 << i); mask |= (1 << devc->mixer_reroute[i]); } } } n = 0; for (i = 0; i < 32; i++) /* Count selected device bits */ if (mask & (1 << i)) { n++; } spin_lock_irqsave(&devc->lock, flags); if (!soundpro) { if (n == 0) { mask = SOUND_MASK_MIC; } else if (n != 1) /* Too many devices selected */ { mask &= ~devc->recmask; /* Filter out active settings */ n = 0; for (i = 0; i < 32; i++) /* Count selected device bits */ if (mask & (1 << i)) { n++; } if (n != 1) { mask = SOUND_MASK_MIC; } } switch (mask) { case SOUND_MASK_MIC: recdev = 2; break; case SOUND_MASK_LINE: case SOUND_MASK_LINE3: recdev = 0; break; case SOUND_MASK_CD: case SOUND_MASK_LINE1: recdev = 1; break; case SOUND_MASK_IMIX: recdev = 3; break; default: mask = SOUND_MASK_MIC; recdev = 2; } recdev <<= 6; ad_write(devc, 0, (ad_read(devc, 0) & 0x3f) | recdev); ad_write(devc, 1, (ad_read(devc, 1) & 0x3f) | recdev); } else /* soundpro */ { unsigned char val; int set_rec_bit; int j; for (i = 0; i < 32; i++) /* For each bit */ { if ((devc->supported_rec_devices & (1 << i)) == 0) { continue; /* Device not supported */ } for (j = LEFT_CHN; j <= RIGHT_CHN; j++) { if (devc->mix_devices[i][j].nbits == 0) /* Inexistent channel */ { continue; } /* * This is tricky: * set_rec_bit becomes 1 if the corresponding bit in mask is set * then it gets flipped if the polarity is inverse */ set_rec_bit = ((mask & (1 << i)) != 0) ^ devc->mix_devices[i][j].recpol; val = ad_read(devc, devc->mix_devices[i][j].recreg); val &= ~(1 << devc->mix_devices[i][j].recpos); val |= (set_rec_bit << devc->mix_devices[i][j].recpos); ad_write(devc, devc->mix_devices[i][j].recreg, val); } } } spin_unlock_irqrestore(&devc->lock, flags); /* Rename the mixer bits back if necessary */ for (i = 0; i < 32; i++) { if (devc->mixer_reroute[i] != i) { if (mask & (1 << devc->mixer_reroute[i])) { mask &= ~(1 << devc->mixer_reroute[i]); mask |= (1 << i); } } } devc->recmask = mask; return mask; } static void oss_change_bits(ad1848_info *devc, unsigned char *regval, unsigned char *muteval, int dev, int chn, int newval) { unsigned char mask; int shift; int mute; int mutemask; int set_mute_bit; set_mute_bit = (newval == 0) ^ devc->mix_devices[dev][chn].mutepol; if (devc->mix_devices[dev][chn].polarity == 1) /* Reverse */ { newval = 100 - newval; } mask = (1 << devc->mix_devices[dev][chn].nbits) - 1; shift = devc->mix_devices[dev][chn].bitpos; if (devc->mix_devices[dev][chn].mutepos == 8) { /* if there is no mute bit */ mute = 0; /* No mute bit; do nothing special */ mutemask = ~0; /* No mute bit; do nothing special */ } else { mute = (set_mute_bit << devc->mix_devices[dev][chn].mutepos); mutemask = ~(1 << devc->mix_devices[dev][chn].mutepos); } newval = (int) ((newval * mask) + 50) / 100; /* Scale it */ *regval &= ~(mask << shift); /* Clear bits */ *regval |= (newval & mask) << shift; /* Set new value */ *muteval &= mutemask; *muteval |= mute; } static int ad1848_mixer_get(ad1848_info *devc, int dev) { if (!((1 << dev) & devc->supported_devices)) { return -EINVAL; } dev = devc->mixer_reroute[dev]; return devc->levels[dev]; } static void ad1848_mixer_set_channel(ad1848_info *devc, int dev, int value, int channel) { int regoffs, muteregoffs; unsigned char val, muteval; unsigned long flags; regoffs = devc->mix_devices[dev][channel].regno; muteregoffs = devc->mix_devices[dev][channel].mutereg; val = ad_read(devc, regoffs); if (muteregoffs != regoffs) { muteval = ad_read(devc, muteregoffs); oss_change_bits(devc, &val, &muteval, dev, channel, value); } else { oss_change_bits(devc, &val, &val, dev, channel, value); } spin_lock_irqsave(&devc->lock, flags); ad_write(devc, regoffs, val); devc->saved_regs[regoffs] = val; if (muteregoffs != regoffs) { ad_write(devc, muteregoffs, muteval); devc->saved_regs[muteregoffs] = muteval; } spin_unlock_irqrestore(&devc->lock, flags); } static int ad1848_mixer_set(ad1848_info *devc, int dev, int value) { int left = value & 0x000000ff; int right = (value & 0x0000ff00) >> 8; int retvol; if (dev > 31) { return -EINVAL; } if (!(devc->supported_devices & (1 << dev))) { return -EINVAL; } dev = devc->mixer_reroute[dev]; if (devc->mix_devices[dev][LEFT_CHN].nbits == 0) { return -EINVAL; } if (left > 100) { left = 100; } if (right > 100) { right = 100; } if (devc->mix_devices[dev][RIGHT_CHN].nbits == 0) /* Mono control */ { right = left; } retvol = left | (right << 8); /* Scale volumes */ left = mix_cvt[left]; right = mix_cvt[right]; devc->levels[dev] = retvol; /* * Set the left channel */ ad1848_mixer_set_channel(devc, dev, left, LEFT_CHN); /* * Set the right channel */ if (devc->mix_devices[dev][RIGHT_CHN].nbits == 0) { goto out; } ad1848_mixer_set_channel(devc, dev, right, RIGHT_CHN); out: return retvol; } static void ad1848_mixer_reset(ad1848_info *devc) { int i; char name[32]; unsigned long flags; devc->mix_devices = &(ad1848_mix_devices[0]); sprintf(name, "%s_%d", devc->chip_name, nr_ad1848_devs); for (i = 0; i < 32; i++) { devc->mixer_reroute[i] = i; } devc->supported_rec_devices = MODE1_REC_DEVICES; switch (devc->model) { case MD_4231: case MD_4231A: case MD_1845: case MD_1845_SSCAPE: devc->supported_devices = MODE2_MIXER_DEVICES; break; case MD_C930: devc->supported_devices = C930_MIXER_DEVICES; devc->mix_devices = &(c930_mix_devices[0]); break; case MD_IWAVE: devc->supported_devices = MODE3_MIXER_DEVICES; devc->mix_devices = &(iwave_mix_devices[0]); break; case MD_42xB: case MD_4239: devc->mix_devices = &(cs42xb_mix_devices[0]); devc->supported_devices = MODE3_MIXER_DEVICES; break; case MD_4232: case MD_4235: case MD_4236: devc->supported_devices = MODE3_MIXER_DEVICES; break; case MD_1848: if (soundpro) { devc->supported_devices = SPRO_MIXER_DEVICES; devc->supported_rec_devices = SPRO_REC_DEVICES; devc->mix_devices = &(spro_mix_devices[0]); break; } default: devc->supported_devices = MODE1_MIXER_DEVICES; } devc->orig_devices = devc->supported_devices; devc->orig_rec_devices = devc->supported_rec_devices; devc->levels = load_mixer_volumes(name, default_mixer_levels, 1); for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) { if (devc->supported_devices & (1 << i)) { ad1848_mixer_set(devc, i, devc->levels[i]); } } ad1848_set_recmask(devc, SOUND_MASK_MIC); devc->mixer_output_port = devc->levels[31] | AUDIO_HEADPHONE | AUDIO_LINE_OUT; spin_lock_irqsave(&devc->lock, flags); if (!soundpro) { if (devc->mixer_output_port & AUDIO_SPEAKER) { ad_write(devc, 26, ad_read(devc, 26) & ~0x40); /* Unmute mono out */ } else { ad_write(devc, 26, ad_read(devc, 26) | 0x40); /* Mute mono out */ } } else { /* * From the "wouldn't it be nice if the mixer API had (better) * support for custom stuff" category */ /* Enable surround mode and SB16 mixer */ ad_write(devc, 16, 0x60); } spin_unlock_irqrestore(&devc->lock, flags); } static int ad1848_mixer_ioctl(int dev, unsigned int cmd, void __user *arg) { ad1848_info *devc = mixer_devs[dev]->devc; int val; if (cmd == SOUND_MIXER_PRIVATE1) { if (get_user(val, (int __user *)arg)) { return -EFAULT; } if (val != 0xffff) { unsigned long flags; val &= (AUDIO_SPEAKER | AUDIO_HEADPHONE | AUDIO_LINE_OUT); devc->mixer_output_port = val; val |= AUDIO_HEADPHONE | AUDIO_LINE_OUT; /* Always on */ devc->mixer_output_port = val; spin_lock_irqsave(&devc->lock, flags); if (val & AUDIO_SPEAKER) { ad_write(devc, 26, ad_read(devc, 26) & ~0x40); /* Unmute mono out */ } else { ad_write(devc, 26, ad_read(devc, 26) | 0x40); /* Mute mono out */ } spin_unlock_irqrestore(&devc->lock, flags); } val = devc->mixer_output_port; return put_user(val, (int __user *)arg); } if (cmd == SOUND_MIXER_PRIVATE2) { if (get_user(val, (int __user *)arg)) { return -EFAULT; } return (ad1848_control(AD1848_MIXER_REROUTE, val)); } if (((cmd >> 8) & 0xff) == 'M') { if (_SIOC_DIR(cmd) & _SIOC_WRITE) { switch (cmd & 0xff) { case SOUND_MIXER_RECSRC: if (get_user(val, (int __user *)arg)) { return -EFAULT; } val = ad1848_set_recmask(devc, val); break; default: if (get_user(val, (int __user *)arg)) { return -EFAULT; } val = ad1848_mixer_set(devc, cmd & 0xff, val); break; } return put_user(val, (int __user *)arg); } else { switch (cmd & 0xff) { /* * Return parameters */ case SOUND_MIXER_RECSRC: val = devc->recmask; break; case SOUND_MIXER_DEVMASK: val = devc->supported_devices; break; case SOUND_MIXER_STEREODEVS: val = devc->supported_devices; if (devc->model != MD_C930) { val &= ~(SOUND_MASK_SPEAKER | SOUND_MASK_IMIX); } break; case SOUND_MIXER_RECMASK: val = devc->supported_rec_devices; break; case SOUND_MIXER_CAPS: val = SOUND_CAP_EXCL_INPUT; break; default: val = ad1848_mixer_get(devc, cmd & 0xff); break; } return put_user(val, (int __user *)arg); } } else { return -EINVAL; } } static int ad1848_set_speed(int dev, int arg) { ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; ad1848_port_info *portc = (ad1848_port_info *) audio_devs[dev]->portc; /* * The sampling speed is encoded in the least significant nibble of I8. The * LSB selects the clock source (0=24.576 MHz, 1=16.9344 MHz) and other * three bits select the divisor (indirectly): * * The available speeds are in the following table. Keep the speeds in * the increasing order. */ typedef struct { int speed; unsigned char bits; } speed_struct; static speed_struct speed_table[] = { {5510, (0 << 1) | 1}, {5510, (0 << 1) | 1}, {6620, (7 << 1) | 1}, {8000, (0 << 1) | 0}, {9600, (7 << 1) | 0}, {11025, (1 << 1) | 1}, {16000, (1 << 1) | 0}, {18900, (2 << 1) | 1}, {22050, (3 << 1) | 1}, {27420, (2 << 1) | 0}, {32000, (3 << 1) | 0}, {33075, (6 << 1) | 1}, {37800, (4 << 1) | 1}, {44100, (5 << 1) | 1}, {48000, (6 << 1) | 0} }; int i, n, selected = -1; n = sizeof(speed_table) / sizeof(speed_struct); if (arg <= 0) { return portc->speed; } if (devc->model == MD_1845 || devc->model == MD_1845_SSCAPE) /* AD1845 has different timer than others */ { if (arg < 4000) { arg = 4000; } if (arg > 50000) { arg = 50000; } portc->speed = arg; portc->speed_bits = speed_table[3].bits; return portc->speed; } if (arg < speed_table[0].speed) { selected = 0; } if (arg > speed_table[n - 1].speed) { selected = n - 1; } for (i = 1 /*really */ ; selected == -1 && i < n; i++) { if (speed_table[i].speed == arg) { selected = i; } else if (speed_table[i].speed > arg) { int diff1, diff2; diff1 = arg - speed_table[i - 1].speed; diff2 = speed_table[i].speed - arg; if (diff1 < diff2) { selected = i - 1; } else { selected = i; } } } if (selected == -1) { printk(KERN_WARNING "ad1848: Can't find speed???\n"); selected = 3; } portc->speed = speed_table[selected].speed; portc->speed_bits = speed_table[selected].bits; return portc->speed; } static short ad1848_set_channels(int dev, short arg) { ad1848_port_info *portc = (ad1848_port_info *) audio_devs[dev]->portc; if (arg != 1 && arg != 2) { return portc->channels; } portc->channels = arg; return arg; } static unsigned int ad1848_set_bits(int dev, unsigned int arg) { ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; ad1848_port_info *portc = (ad1848_port_info *) audio_devs[dev]->portc; static struct format_tbl { int format; unsigned char bits; } format2bits[] = { { 0, 0 } , { AFMT_MU_LAW, 1 } , { AFMT_A_LAW, 3 } , { AFMT_IMA_ADPCM, 5 } , { AFMT_U8, 0 } , { AFMT_S16_LE, 2 } , { AFMT_S16_BE, 6 } , { AFMT_S8, 0 } , { AFMT_U16_LE, 0 } , { AFMT_U16_BE, 0 } }; int i, n = sizeof(format2bits) / sizeof(struct format_tbl); if (arg == 0) { return portc->audio_format; } if (!(arg & ad_format_mask[devc->model])) { arg = AFMT_U8; } portc->audio_format = arg; for (i = 0; i < n; i++) if (format2bits[i].format == arg) { if ((portc->format_bits = format2bits[i].bits) == 0) { return portc->audio_format = AFMT_U8; /* Was not supported */ } return arg; } /* Still hanging here. Something must be terribly wrong */ portc->format_bits = 0; return portc->audio_format = AFMT_U8; } static struct audio_driver ad1848_audio_driver = { .owner = THIS_MODULE, .open = ad1848_open, .close = ad1848_close, .output_block = ad1848_output_block, .start_input = ad1848_start_input, .prepare_for_input = ad1848_prepare_for_input, .prepare_for_output = ad1848_prepare_for_output, .halt_io = ad1848_halt, .halt_input = ad1848_halt_input, .halt_output = ad1848_halt_output, .trigger = ad1848_trigger, .set_speed = ad1848_set_speed, .set_bits = ad1848_set_bits, .set_channels = ad1848_set_channels }; static struct mixer_operations ad1848_mixer_operations = { .owner = THIS_MODULE, .id = "SOUNDPORT", .name = "AD1848/CS4248/CS4231", .ioctl = ad1848_mixer_ioctl }; static int ad1848_open(int dev, int mode) { ad1848_info *devc; ad1848_port_info *portc; unsigned long flags; if (dev < 0 || dev >= num_audiodevs) { return -ENXIO; } devc = (ad1848_info *) audio_devs[dev]->devc; portc = (ad1848_port_info *) audio_devs[dev]->portc; /* here we don't have to protect against intr */ spin_lock(&devc->lock); if (portc->open_mode || (devc->open_mode & mode)) { spin_unlock(&devc->lock); return -EBUSY; } devc->dual_dma = 0; if (audio_devs[dev]->flags & DMA_DUPLEX) { devc->dual_dma = 1; } devc->intr_active = 0; devc->audio_mode = 0; devc->open_mode |= mode; portc->open_mode = mode; spin_unlock(&devc->lock); ad1848_trigger(dev, 0); if (mode & OPEN_READ) { devc->record_dev = dev; } if (mode & OPEN_WRITE) { devc->playback_dev = dev; } /* * Mute output until the playback really starts. This decreases clicking (hope so). */ spin_lock_irqsave(&devc->lock, flags); ad_mute(devc); spin_unlock_irqrestore(&devc->lock, flags); return 0; } static void ad1848_close(int dev) { unsigned long flags; ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; ad1848_port_info *portc = (ad1848_port_info *) audio_devs[dev]->portc; devc->intr_active = 0; ad1848_halt(dev); spin_lock_irqsave(&devc->lock, flags); devc->audio_mode = 0; devc->open_mode &= ~portc->open_mode; portc->open_mode = 0; ad_unmute(devc); spin_unlock_irqrestore(&devc->lock, flags); } static void ad1848_output_block(int dev, unsigned long buf, int count, int intrflag) { unsigned long flags, cnt; ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; ad1848_port_info *portc = (ad1848_port_info *) audio_devs[dev]->portc; cnt = count; if (portc->audio_format == AFMT_IMA_ADPCM) { cnt /= 4; } else { if (portc->audio_format & (AFMT_S16_LE | AFMT_S16_BE)) /* 16 bit data */ { cnt >>= 1; } } if (portc->channels > 1) { cnt >>= 1; } cnt--; if ((devc->audio_mode & PCM_ENABLE_OUTPUT) && (audio_devs[dev]->flags & DMA_AUTOMODE) && intrflag && cnt == devc->xfer_count) { devc->audio_mode |= PCM_ENABLE_OUTPUT; devc->intr_active = 1; return; /* * Auto DMA mode on. No need to react */ } spin_lock_irqsave(&devc->lock, flags); ad_write(devc, 15, (unsigned char) (cnt & 0xff)); ad_write(devc, 14, (unsigned char) ((cnt >> 8) & 0xff)); devc->xfer_count = cnt; devc->audio_mode |= PCM_ENABLE_OUTPUT; devc->intr_active = 1; spin_unlock_irqrestore(&devc->lock, flags); } static void ad1848_start_input(int dev, unsigned long buf, int count, int intrflag) { unsigned long flags, cnt; ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; ad1848_port_info *portc = (ad1848_port_info *) audio_devs[dev]->portc; cnt = count; if (portc->audio_format == AFMT_IMA_ADPCM) { cnt /= 4; } else { if (portc->audio_format & (AFMT_S16_LE | AFMT_S16_BE)) /* 16 bit data */ { cnt >>= 1; } } if (portc->channels > 1) { cnt >>= 1; } cnt--; if ((devc->audio_mode & PCM_ENABLE_INPUT) && (audio_devs[dev]->flags & DMA_AUTOMODE) && intrflag && cnt == devc->xfer_count) { devc->audio_mode |= PCM_ENABLE_INPUT; devc->intr_active = 1; return; /* * Auto DMA mode on. No need to react */ } spin_lock_irqsave(&devc->lock, flags); if (devc->model == MD_1848) { ad_write(devc, 15, (unsigned char) (cnt & 0xff)); ad_write(devc, 14, (unsigned char) ((cnt >> 8) & 0xff)); } else { ad_write(devc, 31, (unsigned char) (cnt & 0xff)); ad_write(devc, 30, (unsigned char) ((cnt >> 8) & 0xff)); } ad_unmute(devc); devc->xfer_count = cnt; devc->audio_mode |= PCM_ENABLE_INPUT; devc->intr_active = 1; spin_unlock_irqrestore(&devc->lock, flags); } static int ad1848_prepare_for_output(int dev, int bsize, int bcount) { int timeout; unsigned char fs, old_fs, tmp = 0; unsigned long flags; ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; ad1848_port_info *portc = (ad1848_port_info *) audio_devs[dev]->portc; ad_mute(devc); spin_lock_irqsave(&devc->lock, flags); fs = portc->speed_bits | (portc->format_bits << 5); if (portc->channels > 1) { fs |= 0x10; } ad_enter_MCE(devc); /* Enables changes to the format select reg */ if (devc->model == MD_1845 || devc->model == MD_1845_SSCAPE) /* Use alternate speed select registers */ { fs &= 0xf0; /* Mask off the rate select bits */ ad_write(devc, 22, (portc->speed >> 8) & 0xff); /* Speed MSB */ ad_write(devc, 23, portc->speed & 0xff); /* Speed LSB */ } old_fs = ad_read(devc, 8); if (devc->model == MD_4232 || devc->model >= MD_4236) { tmp = ad_read(devc, 16); ad_write(devc, 16, tmp | 0x30); } if (devc->model == MD_IWAVE) { ad_write(devc, 17, 0xc2); /* Disable variable frequency select */ } ad_write(devc, 8, fs); /* * Write to I8 starts resynchronization. Wait until it completes. */ timeout = 0; while (timeout < 100 && inb(devc->base) != 0x80) { timeout++; } timeout = 0; while (timeout < 10000 && inb(devc->base) == 0x80) { timeout++; } if (devc->model >= MD_4232) { ad_write(devc, 16, tmp & ~0x30); } ad_leave_MCE(devc); /* * Starts the calibration process. */ spin_unlock_irqrestore(&devc->lock, flags); devc->xfer_count = 0; #ifndef EXCLUDE_TIMERS if (dev == timer_installed && devc->timer_running) if ((fs & 0x01) != (old_fs & 0x01)) { ad1848_tmr_reprogram(dev); } #endif ad1848_halt_output(dev); return 0; } static int ad1848_prepare_for_input(int dev, int bsize, int bcount) { int timeout; unsigned char fs, old_fs, tmp = 0; unsigned long flags; ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; ad1848_port_info *portc = (ad1848_port_info *) audio_devs[dev]->portc; if (devc->audio_mode) { return 0; } spin_lock_irqsave(&devc->lock, flags); fs = portc->speed_bits | (portc->format_bits << 5); if (portc->channels > 1) { fs |= 0x10; } ad_enter_MCE(devc); /* Enables changes to the format select reg */ if ((devc->model == MD_1845) || (devc->model == MD_1845_SSCAPE)) /* Use alternate speed select registers */ { fs &= 0xf0; /* Mask off the rate select bits */ ad_write(devc, 22, (portc->speed >> 8) & 0xff); /* Speed MSB */ ad_write(devc, 23, portc->speed & 0xff); /* Speed LSB */ } if (devc->model == MD_4232) { tmp = ad_read(devc, 16); ad_write(devc, 16, tmp | 0x30); } if (devc->model == MD_IWAVE) { ad_write(devc, 17, 0xc2); /* Disable variable frequency select */ } /* * If mode >= 2 (CS4231), set I28. It's the capture format register. */ if (devc->model != MD_1848) { old_fs = ad_read(devc, 28); ad_write(devc, 28, fs); /* * Write to I28 starts resynchronization. Wait until it completes. */ timeout = 0; while (timeout < 100 && inb(devc->base) != 0x80) { timeout++; } timeout = 0; while (timeout < 10000 && inb(devc->base) == 0x80) { timeout++; } if (devc->model != MD_1848 && devc->model != MD_1845 && devc->model != MD_1845_SSCAPE) { /* * CS4231 compatible devices don't have separate sampling rate selection * register for recording an playback. The I8 register is shared so we have to * set the speed encoding bits of it too. */ unsigned char tmp = portc->speed_bits | (ad_read(devc, 8) & 0xf0); ad_write(devc, 8, tmp); /* * Write to I8 starts resynchronization. Wait until it completes. */ timeout = 0; while (timeout < 100 && inb(devc->base) != 0x80) { timeout++; } timeout = 0; while (timeout < 10000 && inb(devc->base) == 0x80) { timeout++; } } } else { /* For AD1848 set I8. */ old_fs = ad_read(devc, 8); ad_write(devc, 8, fs); /* * Write to I8 starts resynchronization. Wait until it completes. */ timeout = 0; while (timeout < 100 && inb(devc->base) != 0x80) { timeout++; } timeout = 0; while (timeout < 10000 && inb(devc->base) == 0x80) { timeout++; } } if (devc->model == MD_4232) { ad_write(devc, 16, tmp & ~0x30); } ad_leave_MCE(devc); /* * Starts the calibration process. */ spin_unlock_irqrestore(&devc->lock, flags); devc->xfer_count = 0; #ifndef EXCLUDE_TIMERS if (dev == timer_installed && devc->timer_running) { if ((fs & 0x01) != (old_fs & 0x01)) { ad1848_tmr_reprogram(dev); } } #endif ad1848_halt_input(dev); return 0; } static void ad1848_halt(int dev) { ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; ad1848_port_info *portc = (ad1848_port_info *) audio_devs[dev]->portc; unsigned char bits = ad_read(devc, 9); if (bits & 0x01 && (portc->open_mode & OPEN_WRITE)) { ad1848_halt_output(dev); } if (bits & 0x02 && (portc->open_mode & OPEN_READ)) { ad1848_halt_input(dev); } devc->audio_mode = 0; } static void ad1848_halt_input(int dev) { ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; unsigned long flags; if (!(ad_read(devc, 9) & 0x02)) { return; /* Capture not enabled */ } spin_lock_irqsave(&devc->lock, flags); ad_mute(devc); { int tmout; if (!isa_dma_bridge_buggy) { disable_dma(audio_devs[dev]->dmap_in->dma); } for (tmout = 0; tmout < 100000; tmout++) if (ad_read(devc, 11) & 0x10) { break; } ad_write(devc, 9, ad_read(devc, 9) & ~0x02); /* Stop capture */ if (!isa_dma_bridge_buggy) { enable_dma(audio_devs[dev]->dmap_in->dma); } devc->audio_mode &= ~PCM_ENABLE_INPUT; } outb(0, io_Status(devc)); /* Clear interrupt status */ outb(0, io_Status(devc)); /* Clear interrupt status */ devc->audio_mode &= ~PCM_ENABLE_INPUT; spin_unlock_irqrestore(&devc->lock, flags); } static void ad1848_halt_output(int dev) { ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; unsigned long flags; if (!(ad_read(devc, 9) & 0x01)) { return; /* Playback not enabled */ } spin_lock_irqsave(&devc->lock, flags); ad_mute(devc); { int tmout; if (!isa_dma_bridge_buggy) { disable_dma(audio_devs[dev]->dmap_out->dma); } for (tmout = 0; tmout < 100000; tmout++) if (ad_read(devc, 11) & 0x10) { break; } ad_write(devc, 9, ad_read(devc, 9) & ~0x01); /* Stop playback */ if (!isa_dma_bridge_buggy) { enable_dma(audio_devs[dev]->dmap_out->dma); } devc->audio_mode &= ~PCM_ENABLE_OUTPUT; } outb((0), io_Status(devc)); /* Clear interrupt status */ outb((0), io_Status(devc)); /* Clear interrupt status */ devc->audio_mode &= ~PCM_ENABLE_OUTPUT; spin_unlock_irqrestore(&devc->lock, flags); } static void ad1848_trigger(int dev, int state) { ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; ad1848_port_info *portc = (ad1848_port_info *) audio_devs[dev]->portc; unsigned long flags; unsigned char tmp, old; spin_lock_irqsave(&devc->lock, flags); state &= devc->audio_mode; tmp = old = ad_read(devc, 9); if (portc->open_mode & OPEN_READ) { if (state & PCM_ENABLE_INPUT) { tmp |= 0x02; } else { tmp &= ~0x02; } } if (portc->open_mode & OPEN_WRITE) { if (state & PCM_ENABLE_OUTPUT) { tmp |= 0x01; } else { tmp &= ~0x01; } } /* ad_mute(devc); */ if (tmp != old) { ad_write(devc, 9, tmp); ad_unmute(devc); } spin_unlock_irqrestore(&devc->lock, flags); } static void ad1848_init_hw(ad1848_info *devc) { int i; int *init_values; /* * Initial values for the indirect registers of CS4248/AD1848. */ static int init_values_a[] = { 0xa8, 0xa8, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x0c, 0x02, 0x00, 0x8a, 0x01, 0x00, 0x00, /* Positions 16 to 31 just for CS4231/2 and ad1845 */ 0x80, 0x00, 0x10, 0x10, 0x00, 0x00, 0x1f, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; static int init_values_b[] = { /* Values for the newer chips Some of the register initialization values were changed. In order to get rid of the click that preceded PCM playback, calibration was disabled on the 10th byte. On that same byte, dual DMA was enabled; on the 11th byte, ADC dithering was enabled, since that is theoretically desirable; on the 13th byte, Mode 3 was selected, to enable access to extended registers. */ 0xa8, 0xa8, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x80, 0x00, 0x10, 0x10, 0x00, 0x00, 0x1f, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /* * Select initialisation data */ init_values = init_values_a; if (devc->model >= MD_4236) { init_values = init_values_b; } for (i = 0; i < 16; i++) { ad_write(devc, i, init_values[i]); } ad_mute(devc); /* Initialize some variables */ ad_unmute(devc); /* Leave it unmuted now */ if (devc->model > MD_1848) { if (devc->model == MD_1845_SSCAPE) { ad_write(devc, 12, ad_read(devc, 12) | 0x50); } else { ad_write(devc, 12, ad_read(devc, 12) | 0x40); /* Mode2 = enabled */ } if (devc->model == MD_IWAVE) { ad_write(devc, 12, 0x6c); /* Select codec mode 3 */ } if (devc->model != MD_1845_SSCAPE) for (i = 16; i < 32; i++) { ad_write(devc, i, init_values[i]); } if (devc->model == MD_IWAVE) { ad_write(devc, 16, 0x30); /* Playback and capture counters enabled */ } } if (devc->model > MD_1848) { if (devc->audio_flags & DMA_DUPLEX) { ad_write(devc, 9, ad_read(devc, 9) & ~0x04); /* Dual DMA mode */ } else { ad_write(devc, 9, ad_read(devc, 9) | 0x04); /* Single DMA mode */ } if (devc->model == MD_1845 || devc->model == MD_1845_SSCAPE) { ad_write(devc, 27, ad_read(devc, 27) | 0x08); /* Alternate freq select enabled */ } if (devc->model == MD_IWAVE) { /* Some magic Interwave specific initialization */ ad_write(devc, 12, 0x6c); /* Select codec mode 3 */ ad_write(devc, 16, 0x30); /* Playback and capture counters enabled */ ad_write(devc, 17, 0xc2); /* Alternate feature enable */ } } else { devc->audio_flags &= ~DMA_DUPLEX; ad_write(devc, 9, ad_read(devc, 9) | 0x04); /* Single DMA mode */ if (soundpro) { ad_write(devc, 12, ad_read(devc, 12) | 0x40); /* Mode2 = enabled */ } } outb((0), io_Status(devc)); /* Clear pending interrupts */ /* * Toggle the MCE bit. It completes the initialization phase. */ ad_enter_MCE(devc); /* In case the bit was off */ ad_leave_MCE(devc); ad1848_mixer_reset(devc); } int ad1848_detect(struct resource *ports, int *ad_flags, int *osp) { unsigned char tmp; ad1848_info *devc = &adev_info[nr_ad1848_devs]; unsigned char tmp1 = 0xff, tmp2 = 0xff; int optiC930 = 0; /* OPTi 82C930 flag */ int interwave = 0; int ad1847_flag = 0; int cs4248_flag = 0; int sscape_flag = 0; int io_base = ports->start; int i; DDB(printk("ad1848_detect(%x)\n", io_base)); if (ad_flags) { if (*ad_flags == 0x12345678) { interwave = 1; *ad_flags = 0; } if (*ad_flags == 0x87654321) { sscape_flag = 1; *ad_flags = 0; } if (*ad_flags == 0x12345677) { cs4248_flag = 1; *ad_flags = 0; } } if (nr_ad1848_devs >= MAX_AUDIO_DEV) { printk(KERN_ERR "ad1848 - Too many audio devices\n"); return 0; } spin_lock_init(&devc->lock); devc->base = io_base; devc->irq_ok = 0; devc->timer_running = 0; devc->MCE_bit = 0x40; devc->irq = 0; devc->open_mode = 0; devc->chip_name = devc->name = "AD1848"; devc->model = MD_1848; /* AD1848 or CS4248 */ devc->levels = NULL; devc->debug_flag = 0; /* * Check that the I/O address is in use. * * The bit 0x80 of the base I/O port is known to be 0 after the * chip has performed its power on initialization. Just assume * this has happened before the OS is starting. * * If the I/O address is unused, it typically returns 0xff. */ if (inb(devc->base) == 0xff) { DDB(printk("ad1848_detect: The base I/O address appears to be dead\n")); } /* * Wait for the device to stop initialization */ DDB(printk("ad1848_detect() - step 0\n")); for (i = 0; i < 10000000; i++) { unsigned char x = inb(devc->base); if (x == 0xff || !(x & 0x80)) { break; } } DDB(printk("ad1848_detect() - step A\n")); if (inb(devc->base) == 0x80) /* Not ready. Let's wait */ { ad_leave_MCE(devc); } if ((inb(devc->base) & 0x80) != 0x00) /* Not a AD1848 */ { DDB(printk("ad1848 detect error - step A (%02x)\n", (int) inb(devc->base))); return 0; } /* * Test if it's possible to change contents of the indirect registers. * Registers 0 and 1 are ADC volume registers. The bit 0x10 is read only * so try to avoid using it. */ DDB(printk("ad1848_detect() - step B\n")); ad_write(devc, 0, 0xaa); ad_write(devc, 1, 0x45); /* 0x55 with bit 0x10 clear */ if ((tmp1 = ad_read(devc, 0)) != 0xaa || (tmp2 = ad_read(devc, 1)) != 0x45) { if (tmp2 == 0x65) /* AD1847 has couple of bits hardcoded to 1 */ { ad1847_flag = 1; } else { DDB(printk("ad1848 detect error - step B (%x/%x)\n", tmp1, tmp2)); return 0; } } DDB(printk("ad1848_detect() - step C\n")); ad_write(devc, 0, 0x45); ad_write(devc, 1, 0xaa); if ((tmp1 = ad_read(devc, 0)) != 0x45 || (tmp2 = ad_read(devc, 1)) != 0xaa) { if (tmp2 == 0x8a) /* AD1847 has few bits hardcoded to 1 */ { ad1847_flag = 1; } else { DDB(printk("ad1848 detect error - step C (%x/%x)\n", tmp1, tmp2)); return 0; } } /* * The indirect register I12 has some read only bits. Let's * try to change them. */ DDB(printk("ad1848_detect() - step D\n")); tmp = ad_read(devc, 12); ad_write(devc, 12, (~tmp) & 0x0f); if ((tmp & 0x0f) != ((tmp1 = ad_read(devc, 12)) & 0x0f)) { DDB(printk("ad1848 detect error - step D (%x)\n", tmp1)); return 0; } /* * NOTE! Last 4 bits of the reg I12 tell the chip revision. * 0x01=RevB and 0x0A=RevC. */ /* * The original AD1848/CS4248 has just 15 indirect registers. This means * that I0 and I16 should return the same value (etc.). * However this doesn't work with CS4248. Actually it seems to be impossible * to detect if the chip is a CS4231 or CS4248. * Ensure that the Mode2 enable bit of I12 is 0. Otherwise this test fails * with CS4231. */ /* * OPTi 82C930 has mode2 control bit in another place. This test will fail * with it. Accept this situation as a possible indication of this chip. */ DDB(printk("ad1848_detect() - step F\n")); ad_write(devc, 12, 0); /* Mode2=disabled */ for (i = 0; i < 16; i++) { if ((tmp1 = ad_read(devc, i)) != (tmp2 = ad_read(devc, i + 16))) { DDB(printk("ad1848 detect step F(%d/%x/%x) - OPTi chip???\n", i, tmp1, tmp2)); if (!ad1847_flag) { optiC930 = 1; } break; } } /* * Try to switch the chip to mode2 (CS4231) by setting the MODE2 bit (0x40). * The bit 0x80 is always 1 in CS4248 and CS4231. */ DDB(printk("ad1848_detect() - step G\n")); if (ad_flags && *ad_flags == 400) { *ad_flags = 0; } else { ad_write(devc, 12, 0x40); /* Set mode2, clear 0x80 */ } if (ad_flags) { *ad_flags = 0; } tmp1 = ad_read(devc, 12); if (tmp1 & 0x80) { if (ad_flags) { *ad_flags |= AD_F_CS4248; } devc->chip_name = "CS4248"; /* Our best knowledge just now */ } if (optiC930 || (tmp1 & 0xc0) == (0x80 | 0x40)) { /* * CS4231 detected - is it? * * Verify that setting I0 doesn't change I16. */ DDB(printk("ad1848_detect() - step H\n")); ad_write(devc, 16, 0); /* Set I16 to known value */ ad_write(devc, 0, 0x45); if ((tmp1 = ad_read(devc, 16)) != 0x45) /* No change -> CS4231? */ { ad_write(devc, 0, 0xaa); if ((tmp1 = ad_read(devc, 16)) == 0xaa) /* Rotten bits? */ { DDB(printk("ad1848 detect error - step H(%x)\n", tmp1)); return 0; } /* * Verify that some bits of I25 are read only. */ DDB(printk("ad1848_detect() - step I\n")); tmp1 = ad_read(devc, 25); /* Original bits */ ad_write(devc, 25, ~tmp1); /* Invert all bits */ if ((ad_read(devc, 25) & 0xe7) == (tmp1 & 0xe7)) { int id; /* * It's at least CS4231 */ devc->chip_name = "CS4231"; devc->model = MD_4231; /* * It could be an AD1845 or CS4231A as well. * CS4231 and AD1845 report the same revision info in I25 * while the CS4231A reports different. */ id = ad_read(devc, 25); if ((id & 0xe7) == 0x80) /* Device busy??? */ { id = ad_read(devc, 25); } if ((id & 0xe7) == 0x80) /* Device still busy??? */ { id = ad_read(devc, 25); } DDB(printk("ad1848_detect() - step J (%02x/%02x)\n", id, ad_read(devc, 25))); if ((id & 0xe7) == 0x80) { /* * It must be a CS4231 or AD1845. The register I23 of * CS4231 is undefined and it appears to be read only. * AD1845 uses I23 for setting sample rate. Assume * the chip is AD1845 if I23 is changeable. */ unsigned char tmp = ad_read(devc, 23); ad_write(devc, 23, ~tmp); if (interwave) { devc->model = MD_IWAVE; devc->chip_name = "IWave"; } else if (ad_read(devc, 23) != tmp) /* AD1845 ? */ { devc->chip_name = "AD1845"; devc->model = MD_1845; } else if (cs4248_flag) { if (ad_flags) { *ad_flags |= AD_F_CS4248; } devc->chip_name = "CS4248"; devc->model = MD_1848; ad_write(devc, 12, ad_read(devc, 12) & ~0x40); /* Mode2 off */ } ad_write(devc, 23, tmp); /* Restore */ } else { switch (id & 0x1f) { case 3: /* CS4236/CS4235/CS42xB/CS4239 */ { int xid; ad_write(devc, 12, ad_read(devc, 12) | 0x60); /* switch to mode 3 */ ad_write(devc, 23, 0x9c); /* select extended register 25 */ xid = inb(io_Indexed_Data(devc)); ad_write(devc, 12, ad_read(devc, 12) & ~0x60); /* back to mode 0 */ switch (xid & 0x1f) { case 0x00: devc->chip_name = "CS4237B(B)"; devc->model = MD_42xB; break; case 0x08: /* Seems to be a 4238 ?? */ devc->chip_name = "CS4238"; devc->model = MD_42xB; break; case 0x09: devc->chip_name = "CS4238B"; devc->model = MD_42xB; break; case 0x0b: devc->chip_name = "CS4236B"; devc->model = MD_4236; break; case 0x10: devc->chip_name = "CS4237B"; devc->model = MD_42xB; break; case 0x1d: devc->chip_name = "CS4235"; devc->model = MD_4235; break; case 0x1e: devc->chip_name = "CS4239"; devc->model = MD_4239; break; default: printk("Chip ident is %X.\n", xid & 0x1F); devc->chip_name = "CS42xx"; devc->model = MD_4232; break; } } break; case 2: /* CS4232/CS4232A */ devc->chip_name = "CS4232"; devc->model = MD_4232; break; case 0: if ((id & 0xe0) == 0xa0) { devc->chip_name = "CS4231A"; devc->model = MD_4231A; } else { devc->chip_name = "CS4321"; devc->model = MD_4231; } break; default: /* maybe */ DDB(printk("ad1848: I25 = %02x/%02x\n", ad_read(devc, 25), ad_read(devc, 25) & 0xe7)); if (optiC930) { devc->chip_name = "82C930"; devc->model = MD_C930; } else { devc->chip_name = "CS4231"; devc->model = MD_4231; } } } } ad_write(devc, 25, tmp1); /* Restore bits */ DDB(printk("ad1848_detect() - step K\n")); } } else if (tmp1 == 0x0a) { /* * Is it perhaps a SoundPro CMI8330? * If so, then we should be able to change indirect registers * greater than I15 after activating MODE2, even though reading * back I12 does not show it. */ /* * Let's try comparing register values */ for (i = 0; i < 16; i++) { if ((tmp1 = ad_read(devc, i)) != (tmp2 = ad_read(devc, i + 16))) { DDB(printk("ad1848 detect step H(%d/%x/%x) - SoundPro chip?\n", i, tmp1, tmp2)); soundpro = 1; devc->chip_name = "SoundPro CMI 8330"; break; } } } DDB(printk("ad1848_detect() - step L\n")); if (ad_flags) { if (devc->model != MD_1848) { *ad_flags |= AD_F_CS4231; } } DDB(printk("ad1848_detect() - Detected OK\n")); if (devc->model == MD_1848 && ad1847_flag) { devc->chip_name = "AD1847"; } if (sscape_flag == 1) { devc->model = MD_1845_SSCAPE; } return 1; } int ad1848_init (char *name, struct resource *ports, int irq, int dma_playback, int dma_capture, int share_dma, int *osp, struct module *owner) { /* * NOTE! If irq < 0, there is another driver which has allocated the IRQ * so that this driver doesn't need to allocate/deallocate it. * The actually used IRQ is ABS(irq). */ int my_dev; char dev_name[100]; int e; ad1848_info *devc = &adev_info[nr_ad1848_devs]; ad1848_port_info *portc = NULL; devc->irq = (irq > 0) ? irq : 0; devc->open_mode = 0; devc->timer_ticks = 0; devc->dma1 = dma_playback; devc->dma2 = dma_capture; devc->subtype = cfg.card_subtype; devc->audio_flags = DMA_AUTOMODE; devc->playback_dev = devc->record_dev = 0; if (name != NULL) { devc->name = name; } if (name != NULL && name[0] != 0) sprintf(dev_name, "%s (%s)", name, devc->chip_name); else sprintf(dev_name, "Generic audio codec (%s)", devc->chip_name); rename_region(ports, devc->name); conf_printf2(dev_name, devc->base, devc->irq, dma_playback, dma_capture); if (devc->model == MD_1848 || devc->model == MD_C930) { devc->audio_flags |= DMA_HARDSTOP; } if (devc->model > MD_1848) { if (devc->dma1 == devc->dma2 || devc->dma2 == -1 || devc->dma1 == -1) { devc->audio_flags &= ~DMA_DUPLEX; } else { devc->audio_flags |= DMA_DUPLEX; } } portc = kmalloc(sizeof(ad1848_port_info), GFP_KERNEL); if (portc == NULL) { release_region(devc->base, 4); return -1; } if ((my_dev = sound_install_audiodrv(AUDIO_DRIVER_VERSION, dev_name, &ad1848_audio_driver, sizeof(struct audio_driver), devc->audio_flags, ad_format_mask[devc->model], devc, dma_playback, dma_capture)) < 0) { release_region(devc->base, 4); kfree(portc); return -1; } audio_devs[my_dev]->portc = portc; audio_devs[my_dev]->mixer_dev = -1; if (owner) { audio_devs[my_dev]->d->owner = owner; } memset((char *) portc, 0, sizeof(*portc)); nr_ad1848_devs++; ad1848_init_hw(devc); if (irq > 0) { devc->dev_no = my_dev; if (request_irq(devc->irq, adintr, 0, devc->name, (void *)(long)my_dev) < 0) { printk(KERN_WARNING "ad1848: Unable to allocate IRQ\n"); /* Don't free it either then.. */ devc->irq = 0; } if (capabilities[devc->model].flags & CAP_F_TIMER) { #ifndef CONFIG_SMP int x; unsigned char tmp = ad_read(devc, 16); #endif devc->timer_ticks = 0; ad_write(devc, 21, 0x00); /* Timer MSB */ ad_write(devc, 20, 0x10); /* Timer LSB */ #ifndef CONFIG_SMP ad_write(devc, 16, tmp | 0x40); /* Enable timer */ for (x = 0; x < 100000 && devc->timer_ticks == 0; x++); ad_write(devc, 16, tmp & ~0x40); /* Disable timer */ if (devc->timer_ticks == 0) { printk(KERN_WARNING "ad1848: Interrupt test failed (IRQ%d)\n", irq); } else { DDB(printk("Interrupt test OK\n")); devc->irq_ok = 1; } #else devc->irq_ok = 1; #endif } else { devc->irq_ok = 1; /* Couldn't test. assume it's OK */ } } else if (irq < 0) { irq2dev[-irq] = devc->dev_no = my_dev; } #ifndef EXCLUDE_TIMERS if ((capabilities[devc->model].flags & CAP_F_TIMER) && devc->irq_ok) { ad1848_tmr_install(my_dev); } #endif if (!share_dma) { if (sound_alloc_dma(dma_playback, devc->name)) { printk(KERN_WARNING "ad1848.c: Can't allocate DMA%d\n", dma_playback); } if (dma_capture != dma_playback) if (sound_alloc_dma(dma_capture, devc->name)) { printk(KERN_WARNING "ad1848.c: Can't allocate DMA%d\n", dma_capture); } } if ((e = sound_install_mixer(MIXER_DRIVER_VERSION, dev_name, &ad1848_mixer_operations, sizeof(struct mixer_operations), devc)) >= 0) { audio_devs[my_dev]->mixer_dev = e; if (owner) { mixer_devs[e]->owner = owner; } } return my_dev; } int ad1848_control(int cmd, int arg) { ad1848_info *devc; unsigned long flags; if (nr_ad1848_devs < 1) { return -ENODEV; } devc = &adev_info[nr_ad1848_devs - 1]; switch (cmd) { case AD1848_SET_XTAL: /* Change clock frequency of AD1845 (only ) */ if (devc->model != MD_1845 && devc->model != MD_1845_SSCAPE) { return -EINVAL; } spin_lock_irqsave(&devc->lock, flags); ad_enter_MCE(devc); ad_write(devc, 29, (ad_read(devc, 29) & 0x1f) | (arg << 5)); ad_leave_MCE(devc); spin_unlock_irqrestore(&devc->lock, flags); break; case AD1848_MIXER_REROUTE: { int o = (arg >> 8) & 0xff; int n = arg & 0xff; if (o < 0 || o >= SOUND_MIXER_NRDEVICES) { return -EINVAL; } if (!(devc->supported_devices & (1 << o)) && !(devc->supported_rec_devices & (1 << o))) { return -EINVAL; } if (n == SOUND_MIXER_NONE) { /* Just hide this control */ ad1848_mixer_set(devc, o, 0); /* Shut up it */ devc->supported_devices &= ~(1 << o); devc->supported_rec_devices &= ~(1 << o); break; } /* Make the mixer control identified by o to appear as n */ if (n < 0 || n >= SOUND_MIXER_NRDEVICES) { return -EINVAL; } devc->mixer_reroute[n] = o; /* Rename the control */ if (devc->supported_devices & (1 << o)) { devc->supported_devices |= (1 << n); } if (devc->supported_rec_devices & (1 << o)) { devc->supported_rec_devices |= (1 << n); } devc->supported_devices &= ~(1 << o); devc->supported_rec_devices &= ~(1 << o); } break; } return 0; } void ad1848_unload(int io_base, int irq, int dma_playback, int dma_capture, int share_dma) { int i, mixer, dev = 0; ad1848_info *devc = NULL; for (i = 0; devc == NULL && i < nr_ad1848_devs; i++) { if (adev_info[i].base == io_base) { devc = &adev_info[i]; dev = devc->dev_no; } } if (devc != NULL) { kfree(audio_devs[dev]->portc); release_region(devc->base, 4); if (!share_dma) { if (devc->irq > 0) /* There is no point in freeing irq, if it wasn't allocated */ { free_irq(devc->irq, (void *)(long)devc->dev_no); } sound_free_dma(dma_playback); if (dma_playback != dma_capture) { sound_free_dma(dma_capture); } } mixer = audio_devs[devc->dev_no]->mixer_dev; if (mixer >= 0) { sound_unload_mixerdev(mixer); } nr_ad1848_devs--; for ( ; i < nr_ad1848_devs ; i++) { adev_info[i] = adev_info[i + 1]; } } else { printk(KERN_ERR "ad1848: Can't find device to be unloaded. Base=%x\n", io_base); } } static irqreturn_t adintr(int irq, void *dev_id) { unsigned char status; ad1848_info *devc; int dev; int alt_stat = 0xff; unsigned char c930_stat = 0; int cnt = 0; dev = (long)dev_id; devc = (ad1848_info *) audio_devs[dev]->devc; interrupt_again: /* Jump back here if int status doesn't reset */ status = inb(io_Status(devc)); if (status == 0x80) { printk(KERN_DEBUG "adintr: Why?\n"); } if (devc->model == MD_1848) { outb((0), io_Status(devc)); /* Clear interrupt status */ } if (status & 0x01) { if (devc->model == MD_C930) { /* 82C930 has interrupt status register in MAD16 register MC11 */ spin_lock(&devc->lock); /* 0xe0e is C930 address port * 0xe0f is C930 data port */ outb(11, 0xe0e); c930_stat = inb(0xe0f); outb((~c930_stat), 0xe0f); spin_unlock(&devc->lock); alt_stat = (c930_stat << 2) & 0x30; } else if (devc->model != MD_1848) { spin_lock(&devc->lock); alt_stat = ad_read(devc, 24); ad_write(devc, 24, ad_read(devc, 24) & ~alt_stat); /* Selective ack */ spin_unlock(&devc->lock); } if ((devc->open_mode & OPEN_READ) && (devc->audio_mode & PCM_ENABLE_INPUT) && (alt_stat & 0x20)) { DMAbuf_inputintr(devc->record_dev); } if ((devc->open_mode & OPEN_WRITE) && (devc->audio_mode & PCM_ENABLE_OUTPUT) && (alt_stat & 0x10)) { DMAbuf_outputintr(devc->playback_dev, 1); } if (devc->model != MD_1848 && (alt_stat & 0x40)) /* Timer interrupt */ { devc->timer_ticks++; #ifndef EXCLUDE_TIMERS if (timer_installed == dev && devc->timer_running) { sound_timer_interrupt(); } #endif } } /* * Sometimes playback or capture interrupts occur while a timer interrupt * is being handled. The interrupt will not be retriggered if we don't * handle it now. Check if an interrupt is still pending and restart * the handler in this case. */ if (inb(io_Status(devc)) & 0x01 && cnt++ < 4) { goto interrupt_again; } return IRQ_HANDLED; } /* * Experimental initialization sequence for the integrated sound system * of the Compaq Deskpro M. */ static int init_deskpro_m(struct address_info *hw_config) { unsigned char tmp; if ((tmp = inb(0xc44)) == 0xff) { DDB(printk("init_deskpro_m: Dead port 0xc44\n")); return 0; } outb(0x10, 0xc44); outb(0x40, 0xc45); outb(0x00, 0xc46); outb(0xe8, 0xc47); outb(0x14, 0xc44); outb(0x40, 0xc45); outb(0x00, 0xc46); outb(0xe8, 0xc47); outb(0x10, 0xc44); return 1; } /* * Experimental initialization sequence for the integrated sound system * of Compaq Deskpro XL. */ static int init_deskpro(struct address_info *hw_config) { unsigned char tmp; if ((tmp = inb(0xc44)) == 0xff) { DDB(printk("init_deskpro: Dead port 0xc44\n")); return 0; } outb((tmp | 0x04), 0xc44); /* Select bank 1 */ if (inb(0xc44) != 0x04) { DDB(printk("init_deskpro: Invalid bank1 signature in port 0xc44\n")); return 0; } /* * OK. It looks like a Deskpro so let's proceed. */ /* * I/O port 0xc44 Audio configuration register. * * bits 0xc0: Audio revision bits * 0x00 = Compaq Business Audio * 0x40 = MS Sound System Compatible (reset default) * 0x80 = Reserved * 0xc0 = Reserved * bit 0x20: No Wait State Enable * 0x00 = Disabled (reset default, DMA mode) * 0x20 = Enabled (programmed I/O mode) * bit 0x10: MS Sound System Decode Enable * 0x00 = Decoding disabled (reset default) * 0x10 = Decoding enabled * bit 0x08: FM Synthesis Decode Enable * 0x00 = Decoding Disabled (reset default) * 0x08 = Decoding enabled * bit 0x04 Bank select * 0x00 = Bank 0 * 0x04 = Bank 1 * bits 0x03 MSS Base address * 0x00 = 0x530 (reset default) * 0x01 = 0x604 * 0x02 = 0xf40 * 0x03 = 0xe80 */ #ifdef DEBUGXL /* Debug printing */ printk("Port 0xc44 (before): "); outb((tmp & ~0x04), 0xc44); printk("%02x ", inb(0xc44)); outb((tmp | 0x04), 0xc44); printk("%02x\n", inb(0xc44)); #endif /* Set bank 1 of the register */ tmp = 0x58; /* MSS Mode, MSS&FM decode enabled */ switch (hw_config->io_base) { case 0x530: tmp |= 0x00; break; case 0x604: tmp |= 0x01; break; case 0xf40: tmp |= 0x02; break; case 0xe80: tmp |= 0x03; break; default: DDB(printk("init_deskpro: Invalid MSS port %x\n", hw_config->io_base)); return 0; } outb((tmp & ~0x04), 0xc44); /* Write to bank=0 */ #ifdef DEBUGXL /* Debug printing */ printk("Port 0xc44 (after): "); outb((tmp & ~0x04), 0xc44); /* Select bank=0 */ printk("%02x ", inb(0xc44)); outb((tmp | 0x04), 0xc44); /* Select bank=1 */ printk("%02x\n", inb(0xc44)); #endif /* * I/O port 0xc45 FM Address Decode/MSS ID Register. * * bank=0, bits 0xfe: FM synthesis Decode Compare bits 7:1 (default=0x88) * bank=0, bit 0x01: SBIC Power Control Bit * 0x00 = Powered up * 0x01 = Powered down * bank=1, bits 0xfc: MSS ID (default=0x40) */ #ifdef DEBUGXL /* Debug printing */ printk("Port 0xc45 (before): "); outb((tmp & ~0x04), 0xc44); /* Select bank=0 */ printk("%02x ", inb(0xc45)); outb((tmp | 0x04), 0xc44); /* Select bank=1 */ printk("%02x\n", inb(0xc45)); #endif outb((tmp & ~0x04), 0xc44); /* Select bank=0 */ outb((0x88), 0xc45); /* FM base 7:0 = 0x88 */ outb((tmp | 0x04), 0xc44); /* Select bank=1 */ outb((0x10), 0xc45); /* MSS ID = 0x10 (MSS port returns 0x04) */ #ifdef DEBUGXL /* Debug printing */ printk("Port 0xc45 (after): "); outb((tmp & ~0x04), 0xc44); /* Select bank=0 */ printk("%02x ", inb(0xc45)); outb((tmp | 0x04), 0xc44); /* Select bank=1 */ printk("%02x\n", inb(0xc45)); #endif /* * I/O port 0xc46 FM Address Decode/Address ASIC Revision Register. * * bank=0, bits 0xff: FM synthesis Decode Compare bits 15:8 (default=0x03) * bank=1, bits 0xff: Audio addressing ASIC id */ #ifdef DEBUGXL /* Debug printing */ printk("Port 0xc46 (before): "); outb((tmp & ~0x04), 0xc44); /* Select bank=0 */ printk("%02x ", inb(0xc46)); outb((tmp | 0x04), 0xc44); /* Select bank=1 */ printk("%02x\n", inb(0xc46)); #endif outb((tmp & ~0x04), 0xc44); /* Select bank=0 */ outb((0x03), 0xc46); /* FM base 15:8 = 0x03 */ outb((tmp | 0x04), 0xc44); /* Select bank=1 */ outb((0x11), 0xc46); /* ASIC ID = 0x11 */ #ifdef DEBUGXL /* Debug printing */ printk("Port 0xc46 (after): "); outb((tmp & ~0x04), 0xc44); /* Select bank=0 */ printk("%02x ", inb(0xc46)); outb((tmp | 0x04), 0xc44); /* Select bank=1 */ printk("%02x\n", inb(0xc46)); #endif /* * I/O port 0xc47 FM Address Decode Register. * * bank=0, bits 0xff: Decode enable selection for various FM address bits * bank=1, bits 0xff: Reserved */ #ifdef DEBUGXL /* Debug printing */ printk("Port 0xc47 (before): "); outb((tmp & ~0x04), 0xc44); /* Select bank=0 */ printk("%02x ", inb(0xc47)); outb((tmp | 0x04), 0xc44); /* Select bank=1 */ printk("%02x\n", inb(0xc47)); #endif outb((tmp & ~0x04), 0xc44); /* Select bank=0 */ outb((0x7c), 0xc47); /* FM decode enable bits = 0x7c */ outb((tmp | 0x04), 0xc44); /* Select bank=1 */ outb((0x00), 0xc47); /* Reserved bank1 = 0x00 */ #ifdef DEBUGXL /* Debug printing */ printk("Port 0xc47 (after): "); outb((tmp & ~0x04), 0xc44); /* Select bank=0 */ printk("%02x ", inb(0xc47)); outb((tmp | 0x04), 0xc44); /* Select bank=1 */ printk("%02x\n", inb(0xc47)); #endif /* * I/O port 0xc6f = Audio Disable Function Register */ #ifdef DEBUGXL printk("Port 0xc6f (before) = %02x\n", inb(0xc6f)); #endif outb((0x80), 0xc6f); #ifdef DEBUGXL printk("Port 0xc6f (after) = %02x\n", inb(0xc6f)); #endif return 1; } int probe_ms_sound(struct address_info *hw_config, struct resource *ports) { unsigned char tmp; DDB(printk("Entered probe_ms_sound(%x, %d)\n", hw_config->io_base, hw_config->card_subtype)); if (hw_config->card_subtype == 1) /* Has no IRQ/DMA registers */ { /* check_opl3(0x388, hw_config); */ return ad1848_detect(ports, NULL, hw_config->osp); } if (deskpro_xl && hw_config->card_subtype == 2) /* Compaq Deskpro XL */ { if (!init_deskpro(hw_config)) { return 0; } } if (deskpro_m) /* Compaq Deskpro M */ { if (!init_deskpro_m(hw_config)) { return 0; } } /* * Check if the IO port returns valid signature. The original MS Sound * system returns 0x04 while some cards (AudioTrix Pro for example) * return 0x00 or 0x0f. */ if ((tmp = inb(hw_config->io_base + 3)) == 0xff) /* Bus float */ { int ret; DDB(printk("I/O address is inactive (%x)\n", tmp)); if (!(ret = ad1848_detect(ports, NULL, hw_config->osp))) { return 0; } return 1; } DDB(printk("MSS signature = %x\n", tmp & 0x3f)); if ((tmp & 0x3f) != 0x04 && (tmp & 0x3f) != 0x0f && (tmp & 0x3f) != 0x00) { int ret; MDB(printk(KERN_ERR "No MSS signature detected on port 0x%x (0x%x)\n", hw_config->io_base, (int) inb(hw_config->io_base + 3))); DDB(printk("Trying to detect codec anyway but IRQ/DMA may not work\n")); if (!(ret = ad1848_detect(ports, NULL, hw_config->osp))) { return 0; } hw_config->card_subtype = 1; return 1; } if ((hw_config->irq != 5) && (hw_config->irq != 7) && (hw_config->irq != 9) && (hw_config->irq != 10) && (hw_config->irq != 11) && (hw_config->irq != 12)) { printk(KERN_ERR "MSS: Bad IRQ %d\n", hw_config->irq); return 0; } if (hw_config->dma != 0 && hw_config->dma != 1 && hw_config->dma != 3) { printk(KERN_ERR "MSS: Bad DMA %d\n", hw_config->dma); return 0; } /* * Check that DMA0 is not in use with a 8 bit board. */ if (hw_config->dma == 0 && inb(hw_config->io_base + 3) & 0x80) { printk(KERN_ERR "MSS: Can't use DMA0 with a 8 bit card/slot\n"); return 0; } if (hw_config->irq > 7 && hw_config->irq != 9 && inb(hw_config->io_base + 3) & 0x80) { printk(KERN_ERR "MSS: Can't use IRQ%d with a 8 bit card/slot\n", hw_config->irq); return 0; } return ad1848_detect(ports, NULL, hw_config->osp); } void attach_ms_sound(struct address_info *hw_config, struct resource *ports, struct module *owner) { static signed char interrupt_bits[12] = { -1, -1, -1, -1, -1, 0x00, -1, 0x08, -1, 0x10, 0x18, 0x20 }; signed char bits; char dma2_bit = 0; static char dma_bits[4] = { 1, 2, 0, 3 }; int config_port = hw_config->io_base + 0; int version_port = hw_config->io_base + 3; int dma = hw_config->dma; int dma2 = hw_config->dma2; if (hw_config->card_subtype == 1) /* Has no IRQ/DMA registers */ { hw_config->slots[0] = ad1848_init("MS Sound System", ports, hw_config->irq, hw_config->dma, hw_config->dma2, 0, hw_config->osp, owner); return; } /* * Set the IRQ and DMA addresses. */ bits = interrupt_bits[hw_config->irq]; if (bits == -1) { printk(KERN_ERR "MSS: Bad IRQ %d\n", hw_config->irq); release_region(ports->start, 4); release_region(ports->start - 4, 4); return; } outb((bits | 0x40), config_port); if ((inb(version_port) & 0x40) == 0) { printk(KERN_ERR "[MSS: IRQ Conflict?]\n"); } /* * Handle the capture DMA channel */ if (dma2 != -1 && dma2 != dma) { if (!((dma == 0 && dma2 == 1) || (dma == 1 && dma2 == 0) || (dma == 3 && dma2 == 0))) { /* Unsupported combination. Try to swap channels */ int tmp = dma; dma = dma2; dma2 = tmp; } if ((dma == 0 && dma2 == 1) || (dma == 1 && dma2 == 0) || (dma == 3 && dma2 == 0)) { dma2_bit = 0x04; /* Enable capture DMA */ } else { printk(KERN_WARNING "MSS: Invalid capture DMA\n"); dma2 = dma; } } else { dma2 = dma; } hw_config->dma = dma; hw_config->dma2 = dma2; outb((bits | dma_bits[dma] | dma2_bit), config_port); /* Write IRQ+DMA setup */ hw_config->slots[0] = ad1848_init("MS Sound System", ports, hw_config->irq, dma, dma2, 0, hw_config->osp, THIS_MODULE); } void unload_ms_sound(struct address_info *hw_config) { ad1848_unload(hw_config->io_base + 4, hw_config->irq, hw_config->dma, hw_config->dma2, 0); sound_unload_audiodev(hw_config->slots[0]); release_region(hw_config->io_base, 4); } #ifndef EXCLUDE_TIMERS /* * Timer stuff (for /dev/music). */ static unsigned int current_interval; static unsigned int ad1848_tmr_start(int dev, unsigned int usecs) { unsigned long flags; ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; unsigned long xtal_nsecs; /* nanoseconds per xtal oscillator tick */ unsigned long divider; spin_lock_irqsave(&devc->lock, flags); /* * Length of the timer interval (in nanoseconds) depends on the * selected crystal oscillator. Check this from bit 0x01 of I8. * * AD1845 has just one oscillator which has cycle time of 10.050 us * (when a 24.576 MHz xtal oscillator is used). * * Convert requested interval to nanoseconds before computing * the timer divider. */ if (devc->model == MD_1845 || devc->model == MD_1845_SSCAPE) { xtal_nsecs = 10050; } else if (ad_read(devc, 8) & 0x01) { xtal_nsecs = 9920; } else { xtal_nsecs = 9969; } divider = (usecs * 1000 + xtal_nsecs / 2) / xtal_nsecs; if (divider < 100) /* Don't allow shorter intervals than about 1ms */ { divider = 100; } if (divider > 65535) /* Overflow check */ { divider = 65535; } ad_write(devc, 21, (divider >> 8) & 0xff); /* Set upper bits */ ad_write(devc, 20, divider & 0xff); /* Set lower bits */ ad_write(devc, 16, ad_read(devc, 16) | 0x40); /* Start the timer */ devc->timer_running = 1; spin_unlock_irqrestore(&devc->lock, flags); return current_interval = (divider * xtal_nsecs + 500) / 1000; } static void ad1848_tmr_reprogram(int dev) { /* * Audio driver has changed sampling rate so that a different xtal * oscillator was selected. We have to reprogram the timer rate. */ ad1848_tmr_start(dev, current_interval); sound_timer_syncinterval(current_interval); } static void ad1848_tmr_disable(int dev) { unsigned long flags; ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; spin_lock_irqsave(&devc->lock, flags); ad_write(devc, 16, ad_read(devc, 16) & ~0x40); devc->timer_running = 0; spin_unlock_irqrestore(&devc->lock, flags); } static void ad1848_tmr_restart(int dev) { unsigned long flags; ad1848_info *devc = (ad1848_info *) audio_devs[dev]->devc; if (current_interval == 0) { return; } spin_lock_irqsave(&devc->lock, flags); ad_write(devc, 16, ad_read(devc, 16) | 0x40); devc->timer_running = 1; spin_unlock_irqrestore(&devc->lock, flags); } static struct sound_lowlev_timer ad1848_tmr = { 0, 2, ad1848_tmr_start, ad1848_tmr_disable, ad1848_tmr_restart }; static int ad1848_tmr_install(int dev) { if (timer_installed != -1) { return 0; /* Don't install another timer */ } timer_installed = ad1848_tmr.dev = dev; sound_timer_init(&ad1848_tmr, audio_devs[dev]->name); return 1; } #endif /* EXCLUDE_TIMERS */ EXPORT_SYMBOL(ad1848_detect); EXPORT_SYMBOL(ad1848_init); EXPORT_SYMBOL(ad1848_unload); EXPORT_SYMBOL(ad1848_control); EXPORT_SYMBOL(probe_ms_sound); EXPORT_SYMBOL(attach_ms_sound); EXPORT_SYMBOL(unload_ms_sound); static int __initdata io = -1; static int __initdata irq = -1; static int __initdata dma = -1; static int __initdata dma2 = -1; static int __initdata type = 0; module_param(io, int, 0); /* I/O for a raw AD1848 card */ module_param(irq, int, 0); /* IRQ to use */ module_param(dma, int, 0); /* First DMA channel */ module_param(dma2, int, 0); /* Second DMA channel */ module_param(type, int, 0); /* Card type */ module_param(deskpro_xl, bool, 0); /* Special magic for Deskpro XL boxen */ module_param(deskpro_m, bool, 0); /* Special magic for Deskpro M box */ module_param(soundpro, bool, 0); /* More special magic for SoundPro chips */ #ifdef CONFIG_PNP module_param(isapnp, int, 0); module_param(isapnpjump, int, 0); module_param(reverse, bool, 0); MODULE_PARM_DESC(isapnp, "When set to 0, Plug & Play support will be disabled"); MODULE_PARM_DESC(isapnpjump, "Jumps to a specific slot in the driver's PnP table. Use the source, Luke."); MODULE_PARM_DESC(reverse, "When set to 1, will reverse ISAPnP search order"); static struct pnp_dev *ad1848_dev = NULL; /* Please add new entries at the end of the table */ static struct { char *name; unsigned short card_vendor, card_device, vendor, function; short mss_io, irq, dma, dma2; /* index into isapnp table */ int type; } ad1848_isapnp_list[] __initdata = { { "CMI 8330 SoundPRO", ISAPNP_VENDOR('C', 'M', 'I'), ISAPNP_DEVICE(0x0001), ISAPNP_VENDOR('@', '@', '@'), ISAPNP_FUNCTION(0x0001), 0, 0, 0, -1, 0 }, { "CS4232 based card", ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('C', 'S', 'C'), ISAPNP_FUNCTION(0x0000), 0, 0, 0, 1, 0 }, { "CS4232 based card", ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('C', 'S', 'C'), ISAPNP_FUNCTION(0x0100), 0, 0, 0, 1, 0 }, { "OPL3-SA2 WSS mode", ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('Y', 'M', 'H'), ISAPNP_FUNCTION(0x0021), 1, 0, 0, 1, 1 }, { "Advanced Gravis InterWave Audio", ISAPNP_VENDOR('G', 'R', 'V'), ISAPNP_DEVICE(0x0001), ISAPNP_VENDOR('G', 'R', 'V'), ISAPNP_FUNCTION(0x0000), 0, 0, 0, 1, 0 }, {NULL} }; #ifdef MODULE static struct isapnp_device_id id_table[] = { { ISAPNP_VENDOR('C', 'M', 'I'), ISAPNP_DEVICE(0x0001), ISAPNP_VENDOR('@', '@', '@'), ISAPNP_FUNCTION(0x0001), 0 }, { ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('C', 'S', 'C'), ISAPNP_FUNCTION(0x0000), 0 }, { ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('C', 'S', 'C'), ISAPNP_FUNCTION(0x0100), 0 }, /* The main driver for this card is opl3sa2 { ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('Y','M','H'), ISAPNP_FUNCTION(0x0021), 0 }, */ { ISAPNP_VENDOR('G', 'R', 'V'), ISAPNP_DEVICE(0x0001), ISAPNP_VENDOR('G', 'R', 'V'), ISAPNP_FUNCTION(0x0000), 0 }, {0} }; MODULE_DEVICE_TABLE(isapnp, id_table); #endif static struct pnp_dev *activate_dev(char *devname, char *resname, struct pnp_dev *dev) { int err; err = pnp_device_attach(dev); if (err < 0) { return (NULL); } if ((err = pnp_activate_dev(dev)) < 0) { printk(KERN_ERR "ad1848: %s %s config failed (out of resources?)[%d]\n", devname, resname, err); pnp_device_detach(dev); return (NULL); } audio_activated = 1; return (dev); } static struct pnp_dev __init *ad1848_init_generic(struct pnp_card *bus, struct address_info *hw_config, int slot) { /* Configure Audio device */ if ((ad1848_dev = pnp_find_dev(bus, ad1848_isapnp_list[slot].vendor, ad1848_isapnp_list[slot].function, NULL))) { if ((ad1848_dev = activate_dev(ad1848_isapnp_list[slot].name, "ad1848", ad1848_dev))) { hw_config->io_base = pnp_port_start(ad1848_dev, ad1848_isapnp_list[slot].mss_io); hw_config->irq = pnp_irq(ad1848_dev, ad1848_isapnp_list[slot].irq); hw_config->dma = pnp_dma(ad1848_dev, ad1848_isapnp_list[slot].dma); if (ad1848_isapnp_list[slot].dma2 != -1) { hw_config->dma2 = pnp_dma(ad1848_dev, ad1848_isapnp_list[slot].dma2); } else { hw_config->dma2 = -1; } hw_config->card_subtype = ad1848_isapnp_list[slot].type; } else { return (NULL); } } else { return (NULL); } return (ad1848_dev); } static int __init ad1848_isapnp_init(struct address_info *hw_config, struct pnp_card *bus, int slot) { char *busname = bus->name[0] ? bus->name : ad1848_isapnp_list[slot].name; /* Initialize this baby. */ if (ad1848_init_generic(bus, hw_config, slot)) { /* We got it. */ printk(KERN_NOTICE "ad1848: PnP reports '%s' at i/o %#x, irq %d, dma %d, %d\n", busname, hw_config->io_base, hw_config->irq, hw_config->dma, hw_config->dma2); return 1; } return 0; } static int __init ad1848_isapnp_probe(struct address_info *hw_config) { static int first = 1; int i; /* Count entries in sb_isapnp_list */ for (i = 0; ad1848_isapnp_list[i].card_vendor != 0; i++); i--; /* Check and adjust isapnpjump */ if ( isapnpjump < 0 || isapnpjump > i) { isapnpjump = reverse ? i : 0; printk(KERN_ERR "ad1848: Valid range for isapnpjump is 0-%d. Adjusted to %d.\n", i, isapnpjump); } if (!first || !reverse) { i = isapnpjump; } first = 0; while (ad1848_isapnp_list[i].card_vendor != 0) { static struct pnp_card *bus = NULL; while ((bus = pnp_find_card( ad1848_isapnp_list[i].card_vendor, ad1848_isapnp_list[i].card_device, bus))) { if (ad1848_isapnp_init(hw_config, bus, i)) { isapnpjump = i; /* start next search from here */ return 0; } } i += reverse ? -1 : 1; } return -ENODEV; } #endif static int __init init_ad1848(void) { printk(KERN_INFO "ad1848/cs4248 codec driver Copyright (C) by Hannu Savolainen 1993-1996\n"); #ifdef CONFIG_PNP if (isapnp && (ad1848_isapnp_probe(&cfg) < 0) ) { printk(KERN_NOTICE "ad1848: No ISAPnP cards found, trying standard ones...\n"); isapnp = 0; } #endif if (io != -1) { struct resource *ports; if ( isapnp == 0 ) { if (irq == -1 || dma == -1) { printk(KERN_WARNING "ad1848: must give I/O , IRQ and DMA.\n"); return -EINVAL; } cfg.irq = irq; cfg.io_base = io; cfg.dma = dma; cfg.dma2 = dma2; cfg.card_subtype = type; } ports = request_region(io + 4, 4, "ad1848"); if (!ports) { return -EBUSY; } if (!request_region(io, 4, "WSS config")) { release_region(io + 4, 4); return -EBUSY; } if (!probe_ms_sound(&cfg, ports)) { release_region(io + 4, 4); release_region(io, 4); return -ENODEV; } attach_ms_sound(&cfg, ports, THIS_MODULE); loaded = 1; } return 0; } static void __exit cleanup_ad1848(void) { if (loaded) { unload_ms_sound(&cfg); } #ifdef CONFIG_PNP if (ad1848_dev) { if (audio_activated) { pnp_device_detach(ad1848_dev); } } #endif } module_init(init_ad1848); module_exit(cleanup_ad1848); #ifndef MODULE static int __init setup_ad1848(char *str) { /* io, irq, dma, dma2, type */ int ints[6]; str = get_options(str, ARRAY_SIZE(ints), ints); io = ints[1]; irq = ints[2]; dma = ints[3]; dma2 = ints[4]; type = ints[5]; return 1; } __setup("ad1848=", setup_ad1848); #endif MODULE_LICENSE("GPL");
Java
/* * SPDX-License-Identifier: GPL-3.0 * * * (J)ava (M)iscellaneous (U)tilities (L)ibrary * * JMUL is a central repository for utilities which are used in my * other public and private repositories. * * Copyright (C) 2016 Kristian Kutin * * 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/>. * * e-mail: kristian.kutin@arcor.de */ /* * This section contains meta informations. * * $Id$ */ package jmul.web.page; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.List; import jmul.io.NestedStreams; import jmul.io.NestedStreamsImpl; import jmul.misc.exceptions.MultipleCausesException; import static jmul.string.Constants.FILE_SEPARATOR; import static jmul.string.Constants.SLASH; /** * This class represents an entity which loads web content from the file * system. * * @author Kristian Kutin */ public class PageLoader { /** * The base directory of the web content. */ private final File baseDirectory; /** * The file with the page content. */ private final File file; /** * Creates a new instance of a content loader. * * @param aBaseDirectory * a base directory * @param aFile * a file (i.e. file path) */ public PageLoader(File aBaseDirectory, File aFile) { baseDirectory = aBaseDirectory; file = aFile; } /** * Loads the web content. * * @return web content */ public PublishedPage loadContent() { String path = getPath(); NestedStreams nestedStreams = null; try { nestedStreams = openStreams(file); } catch (FileNotFoundException e) { String message = "Unable to load the web content (\"" + file + "\")!"; throw new PageLoaderException(message, e); } byte[] content = null; try { content = loadContent(nestedStreams); } catch (IOException e) { Throwable followupError = null; try { nestedStreams.close(); } catch (IOException f) { followupError = f; } String message = "Error while reading from file (\"" + file + "\")!"; if (followupError != null) { throw new PageLoaderException(message, new MultipleCausesException(e, followupError)); } else { throw new PageLoaderException(message, followupError); } } return new PublishedPage(path, content); } /** * Determines the web path for this file relative to the base directory. * * @param aBaseDirectory * @param aFile * * @return a path * * @throws IOException * is thrown if the specified directory or file cannot be resolved to * absolute paths */ private static String determinePath(File aBaseDirectory, File aFile) throws IOException { String directory = aBaseDirectory.getCanonicalPath(); String fileName = aFile.getCanonicalPath(); String path = fileName.replace(directory, ""); path = path.replace(FILE_SEPARATOR, SLASH); return path; } /** * Opens a stream to read from the specified file. * * @param aFile * * @return an input stream * * @throws FileNotFoundException * is thrown if the specified file doesn't exist */ private static NestedStreams openStreams(File aFile) throws FileNotFoundException { InputStream reader = new FileInputStream(aFile); return new NestedStreamsImpl(reader); } /** * Tries to load the web content from the specified file. * * @param someNestedStreams * * @return some web content * * @throws IOException * is thrown if an error occurred while reading from the file */ private static byte[] loadContent(NestedStreams someNestedStreams) throws IOException { InputStream reader = (InputStream) someNestedStreams.getOuterStream(); List<Byte> buffer = new ArrayList<>(); while (true) { int next = reader.read(); if (next == -1) { break; } buffer.add((byte) next); } int size = buffer.size(); byte[] bytes = new byte[size]; for (int a = 0; a < size; a++) { Byte b = buffer.get(a); bytes[a] = b; } return bytes; } /** * Returns the path of the web page. * * @return a path */ public String getPath() { String path = null; try { path = determinePath(baseDirectory, file); } catch (IOException e) { String message = "Unable to resolve paths (\"" + baseDirectory + "\" & \"" + file + "\")!"; throw new PageLoaderException(message, e); } return path; } }
Java
/** * @file gensvm_debug.c * @author G.J.J. van den Burg * @date 2016-05-01 * @brief Functions facilitating debugging * * @details * Defines functions useful for debugging matrices. * * @copyright Copyright 2016, G.J.J. van den Burg. This file is part of GenSVM. GenSVM 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. GenSVM 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 GenSVM. If not, see <http://www.gnu.org/licenses/>. */ #include "gensvm_debug.h" /** * @brief Print a dense matrix * * @details * Debug function to print a matrix * * @param[in] M matrix * @param[in] rows number of rows of M * @param[in] cols number of columns of M */ void gensvm_print_matrix(double *M, long rows, long cols) { long i, j; for (i=0; i<rows; i++) { for (j=0; j<cols; j++) { if (j > 0) note(" "); note("%+6.6f", matrix_get(M, cols, i, j)); } note("\n"); } note("\n"); } /** * @brief Print a sparse matrix * * @details * Debug function to print a GenSparse sparse matrix * * @param[in] A a GenSparse matrix to print * */ void gensvm_print_sparse(struct GenSparse *A) { long i; // print matrix dimensions note("Sparse Matrix:\n"); note("\tnnz = %li, rows = %li, cols = %li\n", A->nnz, A->n_row, A->n_col); // print nonzero values note("\tvalues = [ "); for (i=0; i<A->nnz; i++) { if (i != 0) note(", "); note("%f", A->values[i]); } note(" ]\n"); // print row indices note("\tIA = [ "); for (i=0; i<A->n_row+1; i++) { if (i != 0) note(", "); note("%i", A->ia[i]); } note(" ]\n"); // print column indices note("\tJA = [ "); for (i=0; i<A->nnz; i++) { if (i != 0) note(", "); note("%i", A->ja[i]); } note(" ]\n"); }
Java
/******************************************************************************* * Australian National University Data Commons * Copyright (C) 2013 The Australian National University * * This file is part of Australian National University Data Commons. * * Australian National University Data Commons 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 au.edu.anu.datacommons.doi; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.io.StringWriter; import java.net.URI; import javax.ws.rs.core.UriBuilder; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Marshaller; import javax.xml.bind.Unmarshaller; import org.datacite.schema.kernel_4.Resource; import org.datacite.schema.kernel_4.Resource.Creators; import org.datacite.schema.kernel_4.Resource.Creators.Creator; import org.datacite.schema.kernel_4.Resource.Creators.Creator.CreatorName; import org.datacite.schema.kernel_4.Resource.Identifier; import org.datacite.schema.kernel_4.Resource.Titles; import org.datacite.schema.kernel_4.Resource.Titles.Title; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.sun.jersey.test.framework.JerseyTest; public class DoiClientTest extends JerseyTest { private static final Logger LOGGER = LoggerFactory.getLogger(DoiClientTest.class); private DoiClient doiClient; private String sampleDoi = "10.5072/13/50639BFE25F18"; private static JAXBContext context; private Marshaller marshaller; private Unmarshaller unmarshaller; public DoiClientTest() { super("au.edu.anu.datacommons.doi"); // LOGGER.trace("In Constructor"); // WebResource webResource = resource(); // DoiConfig doiConfig = new DoiConfigImpl(webResource.getURI().toString(), appId); // doiClient = new DoiClient(doiConfig); doiClient = new DoiClient(); } @BeforeClass public static void setUpBeforeClass() throws Exception { context = JAXBContext.newInstance(Resource.class); } @AfterClass public static void tearDownAfterClass() throws Exception { } @Before public void setUp() throws Exception { super.setUp(); marshaller = context.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); marshaller.setProperty(Marshaller.JAXB_SCHEMA_LOCATION, "http://datacite.org/schema/kernel-2.2 http://schema.datacite.org/meta/kernel-2.2/metadata.xsd"); } @After public void tearDown() throws Exception { super.tearDown(); } @Ignore public void testMint() { try { doiClient.mint("https://datacommons.anu.edu.au:8443/DataCommons/item/anudc:3320", generateSampleResource()); String respStr = doiClient.getDoiResponseAsString(); LOGGER.trace(respStr); } catch (Exception e) { failOnException(e); } } @Ignore public void testUpdate() { try { Resource res = new Resource(); Creators creators = new Creators(); Creator creator = new Creator(); CreatorName creatorName = new CreatorName(); creatorName.setValue("Creator 1"); creator.setCreatorName(creatorName); creators.getCreator().add(creator); res.setCreators(creators); Titles titles = new Titles(); Title title = new Title(); title.setValue("Title 1"); titles.getTitle().add(title); res.setTitles(titles); res.setPublisher("Publisher 1"); res.setPublicationYear("1987"); Identifier id = new Identifier(); id.setValue(sampleDoi); id.setIdentifierType("DOI"); res.setIdentifier(id); doiClient.update(sampleDoi, null, res); Resource newRes = doiClient.getMetadata(sampleDoi); String resAsStr = getResourceAsString(newRes); LOGGER.trace(resAsStr); } catch (Exception e) { failOnException(e); } } @Ignore public void testDeactivate() { try { doiClient.deactivate(sampleDoi); assertTrue(doiClient.getDoiResponseAsString().indexOf("AbsolutePath:" + resource().getURI().toString() + "deactivate.xml/") != -1); // assertTrue(doiClient.getDoiResponseAsString().indexOf("QueryParam:app_id=TEST" + appId) != -1); assertTrue(doiClient.getDoiResponseAsString().indexOf("QueryParam:doi=" + sampleDoi) != -1); } catch (Exception e) { failOnException(e); } } @Ignore public void testActivate() { try { doiClient.activate(sampleDoi); assertTrue(doiClient.getDoiResponseAsString().indexOf("AbsolutePath:" + resource().getURI().toString() + "activate.xml/") != -1); // assertTrue(doiClient.getDoiResponseAsString().indexOf("QueryParam:app_id=TEST" + appId) != -1); assertTrue(doiClient.getDoiResponseAsString().indexOf("QueryParam:doi=" + sampleDoi) != -1); } catch (Exception e) { failOnException(e); } } @Test public void testGetDoiMetaData() { try { Resource res = doiClient.getMetadata(sampleDoi); StringWriter strW = new StringWriter(); marshaller.marshal(res, strW); // assertTrue(doiClient.getDoiResponseAsString().indexOf("AbsolutePath:" + resource().getURI().toString() + "xml.xml/") != -1); // assertTrue(doiClient.getDoiResponseAsString().indexOf("QueryParam:doi=" + sampleDoi) != -1); } catch (Exception e) { failOnException(e); } } private Resource generateSampleResource() { Resource metadata = new Resource(); Titles titles = new Titles(); Title title1 = new Title(); title1.setValue("Some title without a type"); titles.getTitle().add(title1); metadata.setTitles(titles); Creators creators = new Creators(); metadata.setCreators(creators); Creator creator = new Creator(); CreatorName creatorName = new CreatorName(); creatorName.setValue("Smith, John"); creator.setCreatorName(creatorName); metadata.getCreators().getCreator().add(creator); metadata.setPublisher("Some random publisher"); metadata.setPublicationYear("2010"); return metadata; } private String getResourceAsString(Resource res) throws JAXBException { StringWriter strW = new StringWriter(); marshaller.marshal(res, strW); return strW.toString(); } private void failOnException(Throwable e) { LOGGER.error(e.getMessage(), e); fail(e.getMessage()); } }
Java
/* Report an error and exit. Copyright (C) 2017-2019 Free Software Foundation, 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 3, 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. */ /* Borrowed from coreutils. */ #ifndef DIE_H # define DIE_H # include <error.h> # include <stdbool.h> # include <verify.h> /* Like 'error (STATUS, ...)', except STATUS must be a nonzero constant. This may pacify the compiler or help it generate better code. */ # define die(status, ...) \ verify_expr (status, (error (status, __VA_ARGS__), assume (false))) #endif /* DIE_H */
Java
/* =========================================================================== Shadow of Dust GPL Source Code Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company. This file is part of the Shadow of Dust GPL Source Code ("Shadow of Dust Source Code"). Shadow of Dust Source Code 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. Shadow of Dust Source Code 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 Shadow of Dust Source Code. If not, see <http://www.gnu.org/licenses/>. In addition, the Shadow of Dust Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Shadow of Dust Source Code. If not, please request a copy in writing from id Software at the address below. If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. =========================================================================== */ #pragma once // DialogAFView dialog class DialogAFView : public CDialog { DECLARE_DYNAMIC(DialogAFView) public: DialogAFView(CWnd* pParent = NULL); // standard constructor virtual ~DialogAFView(); enum { IDD = IDD_DIALOG_AF_VIEW }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support virtual int OnToolHitTest( CPoint point, TOOLINFO* pTI ) const; afx_msg BOOL OnToolTipNotify( UINT id, NMHDR *pNMHDR, LRESULT *pResult ); afx_msg void OnBnClickedCheckViewBodies(); afx_msg void OnBnClickedCheckViewBodynames(); afx_msg void OnBnClickedCheckViewBodyMass(); afx_msg void OnBnClickedCheckViewTotalMass(); afx_msg void OnBnClickedCheckViewInertiatensor(); afx_msg void OnBnClickedCheckViewVelocity(); afx_msg void OnBnClickedCheckViewConstraints(); afx_msg void OnBnClickedCheckViewConstraintnames(); afx_msg void OnBnClickedCheckViewPrimaryonly(); afx_msg void OnBnClickedCheckViewLimits(); afx_msg void OnBnClickedCheckViewConstrainedBodies(); afx_msg void OnBnClickedCheckViewTrees(); afx_msg void OnBnClickedCheckMd5Skeleton(); afx_msg void OnBnClickedCheckMd5Skeletononly(); afx_msg void OnBnClickedCheckLinesDepthtest(); afx_msg void OnBnClickedCheckLinesUsearrows(); afx_msg void OnBnClickedCheckPhysicsNofriction(); afx_msg void OnBnClickedCheckPhysicsNolimits(); afx_msg void OnBnClickedCheckPhysicsNogravity(); afx_msg void OnBnClickedCheckPhysicsNoselfcollision(); afx_msg void OnBnClickedCheckPhysicsTiming(); afx_msg void OnBnClickedCheckPhysicsDragEntities(); afx_msg void OnBnClickedCheckPhysicsShowDragSelection(); DECLARE_MESSAGE_MAP() private: //{{AFX_DATA(DialogAFView) BOOL m_showBodies; BOOL m_showBodyNames; BOOL m_showMass; BOOL m_showTotalMass; BOOL m_showInertia; BOOL m_showVelocity; BOOL m_showConstraints; BOOL m_showConstraintNames; BOOL m_showPrimaryOnly; BOOL m_showLimits; BOOL m_showConstrainedBodies; BOOL m_showTrees; BOOL m_showSkeleton; BOOL m_showSkeletonOnly; BOOL m_debugLineDepthTest; BOOL m_debugLineUseArrows; BOOL m_noFriction; BOOL m_noLimits; BOOL m_noGravity; BOOL m_noSelfCollision; BOOL m_showTimings; BOOL m_dragEntity; BOOL m_dragShowSelection; //}}AFX_DATA float m_gravity; static toolTip_t toolTips[]; };
Java
// Copyright 2016, Durachenko Aleksey V. <durachenko.aleksey@gmail.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 "version.h" #define STR_HELPER(x) #x #define STR(x) STR_HELPER(x) #ifndef APP_NAME #define APP_NAME "target" #endif #ifndef APP_MAJOR #define APP_MAJOR 0 #endif #ifndef APP_MINOR #define APP_MINOR 0 #endif #ifndef APP_PATCH #define APP_PATCH 0 #endif #ifndef APP_VERSION #define APP_VERSION STR(APP_MAJOR) "." STR(APP_MINOR) "." STR(APP_PATCH) #endif const char *appName() { return STR(APP_NAME); } const char *appShortName() { return STR(APP_NAME); } const char *appFullName() { return STR(APP_NAME); } const char *appVersion() { return STR(APP_VERSION); } const char *appBuildNumber() { #ifdef APP_BUILD_NUMBER return STR(APP_BUILD_NUMBER); #else return "0"; #endif } const char *appBuildDate() { #ifdef APP_BUILD_DATE return STR(APP_BUILD_DATE); #else return "0000-00-00T00:00:00+0000"; #endif } const char *appRevision() { #ifdef APP_REVISION return STR(APP_REVISION); #else return "0"; #endif } const char *appSources() { #ifdef APP_SOURCES return STR(APP_SOURCES); #else return ""; #endif }
Java
import { Model } from "chomex"; import catalog from "./catalog"; export interface DeckCaptureLike { _id: any; title: string; row: number; col: number; page: number; cell: { x: number; y: number; w: number, h: number; }; protected?: boolean; } /** * 編成キャプチャの設定を保存する用のモデル。 * ふつうの1艦隊編成もあれば、連合艦隊、航空基地編成などもある。 */ export default class DeckCapture extends Model { static __ns = "DeckCapture"; static default = { normal: { title: "編成キャプチャ", row: 3, col: 2, cell: catalog.fleet, protected: true, }, combined: { title: "連合編成キャプチャ", row: 3, col: 2, cell: catalog.fleet, protected: true, page: 2, pagelabel: ["第一艦隊", "第二艦隊"], }, aviation: { title: "基地航空隊", row: 1, col: 3, cell: catalog.aviation, protected: true, }, }; title: string; // この編成キャプチャ設定の名前 row: number; // 列数 col: number; // 行数 cell: { // 1セルの定義 x: number; // スタート座標X (ゲーム幅を1に対して) y: number; // スタート座標Y (ゲーム高を1に対して) w: number; // セル幅 (ゲーム幅を1に対して) h: number; // セル高 (ゲーム高を1に対して) }; protected = false; // 削除禁止 page = 1; // 繰り返しページ数 pagelabel: string[] = []; // ページごとのラベル obj(): DeckCaptureLike { return { _id: this._id, title: this.title, row: this.row, col: this.col, page: this.page, cell: {...this.cell}, protected: this.protected, }; } static listObj(): DeckCaptureLike[] { return this.list<DeckCapture>().map(d => d.obj()); } }
Java
/******************************************************************************* MPhoto - Photo viewer for multi-touch devices Copyright (C) 2010 Mihai Paslariu 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 "ImageLoadQueue.h" // synchronized against all other methods ImageLoadItem ImageLoadQueue::pop ( void ) { ImageLoadItem x; _sem.acquire(); _mutex.lock(); x = QQueue<ImageLoadItem>::front(); QQueue<ImageLoadItem>::pop_front(); _mutex.unlock(); return x; } // synchronized against all other methods ImageLoadItem ImageLoadQueue::popWithPriority ( void ) { ImageLoadItem x; _sem.acquire(); _mutex.lock(); QQueue<ImageLoadItem>::Iterator it; QQueue<ImageLoadItem>::Iterator it_max; int max_prio = -1; for ( it = this->begin(); it != this->end(); it++ ) { if ( it->priority > max_prio ) { max_prio = it->priority; it_max = it; } } x = *it_max; this->erase( it_max ); _mutex.unlock(); return x; } // synchronized only against pop void ImageLoadQueue::push ( const ImageLoadItem &x ) { _mutex.lock(); QQueue<ImageLoadItem>::push_back(x); _sem.release(); _mutex.unlock(); } // synchronized only against pop QList<ImageLoadItem> ImageLoadQueue::clear( void ) { QList<ImageLoadItem> cleared_items = QList<ImageLoadItem>(); while ( _sem.tryAcquire() ) { ImageLoadItem x; _mutex.lock(); x = QQueue<ImageLoadItem>::front(); QQueue<ImageLoadItem>::pop_front(); _mutex.unlock(); cleared_items.append( x ); } return cleared_items; } void ImageLoadQueue::clearPriorities( void ) { _mutex.lock(); QQueue<ImageLoadItem>::Iterator it; for ( it = this->begin(); it != this->end(); it++ ) { it->priority = 0; } _mutex.unlock(); } void ImageLoadQueue::updatePriority( QImage ** dest, int priority ) { _mutex.lock(); QQueue<ImageLoadItem>::Iterator it; for ( it = this->begin(); it != this->end(); it++ ) { if ( it->destination == dest ) it->priority = priority; } _mutex.unlock(); }
Java
/* * Copyright (C) 2007-2009 Daniel Prevost <dprevost@photonsoftware.org> * * This file is part of Photon (photonsoftware.org). * * This file may be distributed and/or modified under the terms of the * GNU General Public License version 2 or version 3 as published by the * Free Software Foundation and appearing in the file COPYING.GPL2 and * COPYING.GPL3 included in the packaging of this software. * * Licensees holding a valid Photon Commercial license can use this file * in accordance with the terms of their license. * * This software 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. */ /* --+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-- */ #include "Nucleus/Hash.h" #include "Nucleus/Tests/Hash/HashTest.h" const bool expectedToPass = true; /* --+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-- */ int main() { psonSessionContext context; psonHash* pHash; enum psoErrors errcode; char* key1 = "My Key 1"; char* key2 = "My Key 2"; char* data1 = "My Data 1"; char* data2 = "My Data 2"; psonHashItem * pHashItem; pHash = initHashTest( expectedToPass, &context ); errcode = psonHashInit( pHash, g_memObjOffset, 100, &context ); if ( errcode != PSO_OK ) { ERROR_EXIT( expectedToPass, &context.errorHandler, ; ); } errcode = psonHashInsert( pHash, (unsigned char*)key1, strlen(key1), data1, strlen(data1), &pHashItem, &context ); if ( errcode != PSO_OK ) { ERROR_EXIT( expectedToPass, &context.errorHandler, ; ); } /* A duplicate - not allowed */ errcode = psonHashInsert( pHash, (unsigned char*)key1, strlen(key1), data2, strlen(data2), &pHashItem, &context ); if ( errcode != PSO_ITEM_ALREADY_PRESENT ) { ERROR_EXIT( expectedToPass, NULL, ; ); } errcode = psonHashInsert( pHash, (unsigned char*)key2, strlen(key2), data1, strlen(data1), &pHashItem, &context ); if ( errcode != PSO_OK ) { ERROR_EXIT( expectedToPass, &context.errorHandler, ; ); } return 0; } /* --+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-- */
Java
#ifndef LIGHTNET_SUBSAMPLE_MODULE_H #define LIGHTNET_SUBSAMPLE_MODULE_H #include "module.h" using namespace std; using FeatureMap = vector<vector<Neuron*>>; FeatureMap* matrifyNeurons(vector<Neuron*>& v, int sizex, int sizey) { FeatureMap *fmap = new FeatureMap(); fmap->resize(sizex); int z = 0; for(unsigned int x = 0; x < fmap->size(); x++) { fmap->at(x).resize(sizey); for(unsigned int y = 0; y < fmap->at(x).size(); y++) { fmap->at(x).at(y) = v.at(z); z++; } } return fmap; } class SubsampleModule : public Module { private: int inputSize; double lowerWeightLimit,upperWeightLimit; int sizex, sizey, numFeatures, featureSize; vector<FeatureMap*> featureMaps; public: SubsampleModule(int numFeatures, int sizex, int sizey) { this->sizex = sizex; this->sizey = sizey; this->featureSize = sizex*sizey; this->numFeatures = numFeatures; for(int n = 0; n < featureSize*numFeatures/pow(2,2); n++) { neurons.push_back(new Neuron(0.25, 0.25)); } for(int f = 0; f < numFeatures; f++) { vector<Neuron*> v(neurons.begin()+(f*floor(sizex/2.0)*floor(sizey/2.0)),neurons.begin()+((f+1)*floor(sizex/2.0)*floor(sizey/2.0))); featureMaps.push_back(matrifyNeurons(v,floor(sizex/2.0),floor(sizey/2.0))); } } void connect(Module* prev) { int z = 0; for(int f = 0; f < numFeatures; f++) { vector<Neuron*> v(prev->getNeurons().begin()+(f*sizex*sizey),prev->getNeurons().begin()+((f+1)*sizex*sizey)); FeatureMap* fmap = matrifyNeurons(v,sizex,sizey); for(int fx = 0; fx < featureMaps[f]->size(); fx++) { for(int fy = 0; fy < featureMaps[f]->at(0).size(); fy++) { for(int ix = fx*2; ix < fx*2 + 2; ix++) { for(int iy = fy*2; iy < fy*2 + 2; iy++) { //cout << f << " connecting " << fx << "," << fy << " to " << ix << "," << iy << endl; featureMaps[f]->at(fx).at(fy)->connect(fmap->at(ix).at(iy),new Weight()); } } } } } //cout << "size " << neurons.size() << endl; } void gradientDescent(double learningRate) {} }; #endif
Java
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated from a template. // // Manual changes to this file may cause unexpected behavior in your application. // Manual changes to this file will be overwritten if the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace WithoutPath.DAL { using System; using System.Collections.Generic; public partial class ShipType { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] public ShipType() { this.Characters = new HashSet<Character>(); } public int Id { get; set; } public long EveID { get; set; } public string Name { get; set; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public virtual ICollection<Character> Characters { get; set; } } }
Java
<?php /************************* Coppermine Photo Gallery ************************ Copyright (c) 2003-2016 Coppermine Dev Team v1.0 originally written by Gregory Demar This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation. ******************************************** Coppermine version: 1.6.03 $HeadURL$ **********************************************/ $base = array( 0x00 => 'ruk', 'rut', 'rup', 'ruh', 'rweo', 'rweog', 'rweogg', 'rweogs', 'rweon', 'rweonj', 'rweonh', 'rweod', 'rweol', 'rweolg', 'rweolm', 'rweolb', 0x10 => 'rweols', 'rweolt', 'rweolp', 'rweolh', 'rweom', 'rweob', 'rweobs', 'rweos', 'rweoss', 'rweong', 'rweoj', 'rweoc', 'rweok', 'rweot', 'rweop', 'rweoh', 0x20 => 'rwe', 'rweg', 'rwegg', 'rwegs', 'rwen', 'rwenj', 'rwenh', 'rwed', 'rwel', 'rwelg', 'rwelm', 'rwelb', 'rwels', 'rwelt', 'rwelp', 'rwelh', 0x30 => 'rwem', 'rweb', 'rwebs', 'rwes', 'rwess', 'rweng', 'rwej', 'rwec', 'rwek', 'rwet', 'rwep', 'rweh', 'rwi', 'rwig', 'rwigg', 'rwigs', 0x40 => 'rwin', 'rwinj', 'rwinh', 'rwid', 'rwil', 'rwilg', 'rwilm', 'rwilb', 'rwils', 'rwilt', 'rwilp', 'rwilh', 'rwim', 'rwib', 'rwibs', 'rwis', 0x50 => 'rwiss', 'rwing', 'rwij', 'rwic', 'rwik', 'rwit', 'rwip', 'rwih', 'ryu', 'ryug', 'ryugg', 'ryugs', 'ryun', 'ryunj', 'ryunh', 'ryud', 0x60 => 'ryul', 'ryulg', 'ryulm', 'ryulb', 'ryuls', 'ryult', 'ryulp', 'ryulh', 'ryum', 'ryub', 'ryubs', 'ryus', 'ryuss', 'ryung', 'ryuj', 'ryuc', 0x70 => 'ryuk', 'ryut', 'ryup', 'ryuh', 'reu', 'reug', 'reugg', 'reugs', 'reun', 'reunj', 'reunh', 'reud', 'reul', 'reulg', 'reulm', 'reulb', 0x80 => 'reuls', 'reult', 'reulp', 'reulh', 'reum', 'reub', 'reubs', 'reus', 'reuss', 'reung', 'reuj', 'reuc', 'reuk', 'reut', 'reup', 'reuh', 0x90 => 'ryi', 'ryig', 'ryigg', 'ryigs', 'ryin', 'ryinj', 'ryinh', 'ryid', 'ryil', 'ryilg', 'ryilm', 'ryilb', 'ryils', 'ryilt', 'ryilp', 'ryilh', 0xA0 => 'ryim', 'ryib', 'ryibs', 'ryis', 'ryiss', 'rying', 'ryij', 'ryic', 'ryik', 'ryit', 'ryip', 'ryih', 'ri', 'rig', 'rigg', 'rigs', 0xB0 => 'rin', 'rinj', 'rinh', 'rid', 'ril', 'rilg', 'rilm', 'rilb', 'rils', 'rilt', 'rilp', 'rilh', 'rim', 'rib', 'ribs', 'ris', 0xC0 => 'riss', 'ring', 'rij', 'ric', 'rik', 'rit', 'rip', 'rih', 'ma', 'mag', 'magg', 'mags', 'man', 'manj', 'manh', 'mad', 0xD0 => 'mal', 'malg', 'malm', 'malb', 'mals', 'malt', 'malp', 'malh', 'mam', 'mab', 'mabs', 'mas', 'mass', 'mang', 'maj', 'mac', 0xE0 => 'mak', 'mat', 'map', 'mah', 'mae', 'maeg', 'maegg', 'maegs', 'maen', 'maenj', 'maenh', 'maed', 'mael', 'maelg', 'maelm', 'maelb', 0xF0 => 'maels', 'maelt', 'maelp', 'maelh', 'maem', 'maeb', 'maebs', 'maes', 'maess', 'maeng', 'maej', 'maec', 'maek', 'maet', 'maep', 'maeh', );
Java
package co.edu.udea.ingenieriaweb.admitravel.bl; import java.util.List; import co.edu.udea.ingenieriaweb.admitravel.dto.PaqueteDeViaje; import co.edu.udea.ingenieriaweb.admitravel.util.exception.IWBLException; import co.edu.udea.ingenieriaweb.admitravel.util.exception.IWDaoException; /** * Clase DestinoBL define la funcionalidad a implementar en el DestinoBLImp * * @author Yeferson Marín * */ public interface PaqueteDeViajeBL { /** * Método que permite almacenar un paquete de viaje en el sistema * @param idPaquete tipo de identificación del paquete de viaje * @param destinos nombre del destinos (Este parametro no debería ir) * @param transporte transporte en el que se hace el viaje * @param alimentacion alimentación que lleva el viaje * @param duracionViaje duración del viaje tomado * @throws IWDaoException ocurre cuando hay un error en la base de datos * @throws IWBLException ocurre cuando hay un error de lógica del negocio en los datos a guardar */ public void guardar(String idPaquete, String destinos, String transporte, String alimentacion, String duracionViaje) throws IWDaoException, IWBLException; public void actualizar(PaqueteDeViaje paqueteDeViaje, String idPaquete, String destinos, String transporte, String alimentacion, String duracionViaje)throws IWDaoException, IWBLException; PaqueteDeViaje obtener(String idPaquete) throws IWDaoException, IWBLException; }
Java
// mailer.js var nodemailer = require('nodemailer'); var smtpTransport = nodemailer.createTransport("SMTP", { service: "Mandrill", debug: true, auth: { user: "evanroman1@gmail.com", pass: "k-AdDVcsNJ9oj8QYATVNGQ" } }); exports.sendEmailConfirmation = function(emailaddress, username, firstname, expiremoment, token){ var mailOptions = { from: "confirm@ativinos.com", // sender address to: emailaddress, // list of receivers subject: "Confirm email and start Ativinos", // Subject line text: 'Hi ' +firstname+ ', your account, ' +username+ ', will be enabled after you confirm your email. Your account will be deleted by ' + expiremoment + ' if you do not verify email before then. To verify your email, visit http://www.ativinos.com/emailverify?token=' + token + '&username=' + username, html: 'Hi ' +firstname+ ', your account, ' +username+ ', will be enabled after you confirm your email. Your account will be deleted by ' + expiremoment + ' if you do not verify email before then. To verify your email, visit <a href="http://www.ativinos.com/emailverify?token=' + token + '&username=' + username + '">http://www.ativinos.com/emailverify?token=' + token + '&username=' + username + '</a>', } smtpTransport.sendMail(mailOptions, function(error, response){ if(error){ console.log(error); } }) }
Java
$(function(){ $('#telefone').mask('(99)9999-9999'); $('.editar').on({ click : function(){ var url = URI+"sistema/editar/"+$(this).attr('data-item'); window.location.href = url; } }); $('.deletar').on({ click : function(){ var $selecionados = get_selecionados(); if($selecionados.length > 0) { var $url = URI+"sistema/remover/"; if (window.confirm("deseja apagar os ("+$selecionados.length+") itens selecionados? ")) { $.post($url, { 'selecionados': $selecionados}, function(data){ pop_up(data, setTimeout(function(){location.reload()}, 100)); }); } } else { pop_up('nenhum item selecionado'); } } }); $('#description').on('keyup',function(){ var alvo = $("#char-digitado"); var max = 140; var digitados = $(this).val().length; var restante = max - digitados; if(digitados > max) { var val = $(this).val(); $(this).val(val.substr(0, max)); restante = 0; } alvo.html(restante); }); });
Java
def plotHistory(plot_context, axes): """ @type axes: matplotlib.axes.Axes @type plot_config: PlotConfig """ plot_config = plot_context.plotConfig() if ( not plot_config.isHistoryEnabled() or plot_context.history_data is None or plot_context.history_data.empty ): return data = plot_context.history_data style = plot_config.historyStyle() lines = axes.plot_date( x=data.index.values, y=data, color=style.color, alpha=style.alpha, marker=style.marker, linestyle=style.line_style, linewidth=style.width, markersize=style.size, ) if len(lines) > 0 and style.isVisible(): plot_config.addLegendItem("History", lines[0])
Java
# -*- coding: UTF-8 -*- """ Desc: django util. Note: --------------------------------------- # 2016/04/30 kangtian created """ from hashlib import md5 def gen_md5(content_str): m = md5() m.update(content_str) return m.hexdigest()
Java
/* Copyright (C) 2013 Edwin Velds This file is part of Polka 2. Polka 2 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. Polka 2 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 Polka 2. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _POLKA_BITMAPCANVAS_H_ #define _POLKA_BITMAPCANVAS_H_ #include "Object.h" #include "ObjectManager.h" #include "icons/sketch.c" #include <glibmm/i18n.h> #include <cairomm/surface.h> namespace Polka { /* class Palette; class BitmapCanvas : public Polka::Object { public: BitmapCanvas( int depth ); ~BitmapCanvas(); enum Type { BP2, BP4, BP6, BRGB332, BRGB555 }; int width() const; int height() const; const Palette *getPalette( unsigned int slot = 0 ) const; Cairo::RefPtr<Cairo::ImageSurface> getImage() const; void setPalette( const Palette& palette, unsigned int slot = 0 ); protected: virtual void doUpdate(); private: Cairo::RefPtr<Cairo::ImageSurface> m_Image; std::vector<char*> m_Data; std::vector<const Palette *> m_Palettes; }; class Bitmap16CanvasFactory : public ObjectManager::ObjectFactory { public: BitmapCanvasFactory() : ObjectManager::ObjectFactory( _("16 Color Canvas"), _("Sketch canvasses"), 20, "BMP16CANVAS", "BITMAPCANVASEDIT", "PAL1,PAL2,PALG9K", sketch ) {} Object *create() const { return new BitmapCanvas( BitmapCanvas::BP4 ); } }; */ } // namespace Polka #endif // _POLKA_BITMAPCANVAS_H_
Java
/* avr_libs Copyright (C) 2014 Edward Sargsyan avr_libs 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. avr_libs 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 avr_libs. If not, see <http://www.gnu.org/licenses/>. */ #ifndef SD_CMD_H #define SD_SD_CMD_H /* CMD0: response R1 */ #define SD_CMD_GO_IDLE_STATE 0x00 /* CMD1: response R1 */ #define SD_CMD_SEND_OP_COND 0x01 /* CMD8: response R7 */ #define SD_CMD_SEND_IF_COND 0x08 /* CMD9: response R1 */ #define SD_CMD_SEND_CSD 0x09 /* CMD10: response R1 */ #define SD_CMD_SEND_CID 0x0a /* CMD12: response R1 */ #define SD_CMD_STOP_TRANSMISSION 0x0c /* CMD13: response R2 */ #define SD_CMD_SEND_STATUS 0x0d /* CMD16: arg0[31:0]: block length, response R1 */ #define SD_CMD_SET_BLOCKLEN 0x10 /* CMD17: arg0[31:0]: data address, response R1 */ #define SD_CMD_READ_SINGLE_BLOCK 0x11 /* CMD18: arg0[31:0]: data address, response R1 */ #define SD_CMD_READ_MULTIPLE_BLOCK 0x12 /* CMD24: arg0[31:0]: data address, response R1 */ #define SD_CMD_WRITE_SINGLE_BLOCK 0x18 /* CMD25: arg0[31:0]: data address, response R1 */ #define SD_CMD_WRITE_MULTIPLE_BLOCK 0x19 /* CMD27: response R1 */ #define SD_CMD_PROGRAM_CSD 0x1b /* CMD28: arg0[31:0]: data address, response R1b */ #define SD_CMD_SET_WRITE_PROT 0x1c /* CMD29: arg0[31:0]: data address, response R1b */ #define SD_CMD_CLR_WRITE_PROT 0x1d /* CMD30: arg0[31:0]: write protect data address, response R1 */ #define SD_CMD_SEND_WRITE_PROT 0x1e /* CMD32: arg0[31:0]: data address, response R1 */ #define SD_CMD_TAG_SECTOR_START 0x20 /* CMD33: arg0[31:0]: data address, response R1 */ #define SD_CMD_TAG_SECTOR_END 0x21 /* CMD34: arg0[31:0]: data address, response R1 */ #define SD_CMD_UNTAG_SECTOR 0x22 /* CMD35: arg0[31:0]: data address, response R1 */ #define SD_CMD_TAG_ERASE_GROUP_START 0x23 /* CMD36: arg0[31:0]: data address, response R1 */ #define SD_CMD_TAG_ERASE_GROUP_END 0x24 /* CMD37: arg0[31:0]: data address, response R1 */ #define SD_CMD_UNTAG_ERASE_GROUP 0x25 /* CMD38: arg0[31:0]: stuff bits, response R1b */ #define SD_CMD_ERASE 0x26 /* ACMD41: arg0[31:0]: OCR contents, response R1 */ #define SD_CMD_GET_OCR 0x29 /* CMD42: arg0[31:0]: stuff bits, response R1b */ #define SD_CMD_LOCK_UNLOCK 0x2a /* CMD55: arg0[31:0]: stuff bits, response R1 */ #define SD_CMD_APP 0x37 /* CMD58: arg0[31:0]: stuff bits, response R3 */ #define SD_CMD_READ_OCR 0x3a /* CMD59: arg0[31:1]: stuff bits, arg0[0:0]: crc option, response R1 */ #define SD_CMD_CRC_ON_OFF 0x3b /* command responses */ /* R1: size 1 byte */ #define SD_R1_IDLE_STATE 0 #define SD_R1_ERASE_RESET 1 #define SD_R1_ILLEGAL_COMMAND 2 #define SD_R1_COM_CRC_ERR 3 #define SD_R1_ERASE_SEQ_ERR 4 #define SD_R1_ADDR_ERR 5 #define SD_R1_PARAM_ERR 6 /* R1b: equals R1, additional busy bytes */ /* R2: size 2 bytes */ #define SD_R2_CARD_LOCKED 0 #define SD_R2_WP_ERASE_SKIP 1 #define SD_R2_ERR 2 #define SD_R2_CARD_ERR 3 #define SD_R2_CARD_ECC_FAIL 4 #define SD_R2_WP_VIOLATION 5 #define SD_R2_INVAL_ERASE 6 #define SD_R2_OUT_OF_RANGE 7 #define SD_R2_CSD_OVERWRITE 7 #define SD_R2_IDLE_STATE ( SD_R1_IDLE_STATE + 8) #define SD_R2_ERASE_RESET ( SD_R1_ERASE_RESET + 8) #define SD_R2_ILLEGAL_COMMAND ( SD_R1_ILLEGAL_COMMAND + 8) #define SD_R2_COM_CRC_ERR ( SD_R1_COM_CRC_ERR + 8) #define SD_R2_ERASE_SEQ_ERR ( SD_R1_ERASE_SEQ_ERR + 8) #define SD_R2_ADDR_ERR ( SD_R1_ADDR_ERR + 8) #define SD_R2_PARAM_ERR ( SD_R1_PARAM_ERR + 8) /* R3: size 5 bytes */ #define SD_R3_OCR_MASK (0xffffffffUL) #define SD_R3_IDLE_STATE ( SD_R1_IDLE_STATE + 32) #define SD_R3_ERASE_RESET ( SD_R1_ERASE_RESET + 32) #define SD_R3_ILLEGAL_COMMAND ( SD_R1_ILLEGAL_COMMAND + 32) #define SD_R3_COM_CRC_ERR ( SD_R1_COM_CRC_ERR + 32) #define SD_R3_ERASE_SEQ_ERR ( SD_R1_ERASE_SEQ_ERR + 32) #define SD_R3_ADDR_ERR ( SD_R1_ADDR_ERR + 32) #define SD_R3_PARAM_ERR ( SD_R1_PARAM_ERR + 32) /* Data Response: size 1 byte */ #define SD_DR_STATUS_MASK 0x0e #define SD_DR_STATUS_ACCEPTED 0x05 #define SD_DR_STATUS_CRC_ERR 0x0a #define SD_DR_STATUS_WRITE_ERR 0x0c #endif // SD_CMD_H
Java
using System; namespace Server.Network { public delegate void OnPacketReceive( NetState state, PacketReader pvSrc ); public delegate bool ThrottlePacketCallback( NetState state ); public class PacketHandler { public PacketHandler( int packetID, int length, bool ingame, OnPacketReceive onReceive ) { PacketID = packetID; Length = length; Ingame = ingame; OnReceive = onReceive; } public int PacketID { get; } public int Length { get; } public OnPacketReceive OnReceive { get; } public ThrottlePacketCallback ThrottleCallback { get; set; } public bool Ingame { get; } } }
Java
package com.github.wglanzer.redmine; import java.util.function.Consumer; /** * Interface that is able to create background-tasks * * @author w.glanzer, 11.12.2016. */ public interface IRTaskCreator { /** * Executes a given task in background * * @param pTask Task that should be done in background * @return the given task */ <T extends ITask> T executeInBackground(T pTask); /** * Progress, that can be executed */ interface ITask extends Consumer<IProgressIndicator> { /** * @return the name of the current progress */ String getName(); } /** * Indicator-Interface to call back to UI */ interface IProgressIndicator { /** * Adds the given number to percentage * * @param pPercentage 0-100 */ void addPercentage(double pPercentage); } }
Java
<?php $namespacetree = array( 'vector' => array( ), 'std' => array( 'vector' => array( 'inner' => array( ) ) ) ); $string = "while(!acceptable(a)) perform_random_actions(&a);";
Java
#ifndef VIDDEF_H #define VIDDEF_H #include <QObject> // FFmpeg is a pure C project, so to use the libraries within your C++ application you need // to explicitly state that you are using a C library by using extern "C"." extern "C" { #include <libavcodec/avcodec.h> #include <libavformat/avformat.h> #include <libavformat/avio.h> #include <libswscale/swscale.h> #include <libavutil/avstring.h> #include <libavutil/time.h> #include <libavutil/mem.h> #include <libavutil/pixfmt.h> } #include <cmath> #define MAX_VIDEOQ_SIZE (5 * 256 * 1024) #define AV_SYNC_THRESHOLD 0.01 #define AV_NOSYNC_THRESHOLD 10.0 #define VIDEO_PICTURE_QUEUE_SIZE 1 // YUV_Overlay is similar to SDL_Overlay // A SDL_Overlay is similar to a SDL_Surface except it stores a YUV overlay. // Possible format: #define SDL_YV12_OVERLAY 0x32315659 /* Planar mode: Y + V + U */ #define SDL_IYUV_OVERLAY 0x56555949 /* Planar mode: Y + U + V */ #define SDL_YUY2_OVERLAY 0x32595559 /* Packed mode: Y0+U0+Y1+V0 */ #define SDL_UYVY_OVERLAY 0x59565955 /* Packed mode: U0+Y0+V0+Y1 */ #define SDL_YVYU_OVERLAY 0x55595659 /* Packed mode: Y0+V0+Y1+U0 */ typedef struct Overlay { quint32 format; int w, h; int planes; quint16 *pitches; quint8 **pixels; quint32 hw_overlay:1; } YUV_Overlay; typedef struct PacketQueue { AVPacketList *first_pkt, *last_pkt; int nb_packets; int size; } PacketQueue; typedef struct VideoPicture { YUV_Overlay *bmp; int width, height; /* source height & width */ int allocated; double pts; } VideoPicture; typedef struct VideoState { AVFormatContext *pFormatCtx; int videoStream; double frame_timer; double frame_last_pts; double frame_last_delay; double video_clock; ///<pts of last decoded frame / predicted pts of next decoded frame AVStream *video_st; PacketQueue videoq; VideoPicture pictq[VIDEO_PICTURE_QUEUE_SIZE]; int pictq_size, pictq_rindex, pictq_windex; int quit; AVIOContext *io_context; struct SwsContext *sws_ctx; } VideoState; #endif // VIDDEF_H
Java
// ADOBE SYSTEMS INCORPORATED // Copyright 1993 - 2002 Adobe Systems Incorporated // All Rights Reserved // // NOTICE: Adobe permits you to use, modify, and distribute this // file in accordance with the terms of the Adobe license agreement // accompanying it. If you have received this file from a source // other than Adobe, then your use, modification, or distribution // of it requires the prior written permission of Adobe. //------------------------------------------------------------------- /* File: NearestBaseUIWin.c C source file for Windows specific code for Color Picker example. */ #include "NearestBase.h" #include "DialogUtilities.h" /*****************************************************************************/ DLLExport BOOL WINAPI PickerProc(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam); // Win32 Change /*****************************************************************************/ void DoAbout (AboutRecordPtr about) { ShowAbout(about); } /*****************************************************************************/ DLLExport BOOL WINAPI PickerProc(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam) // Win32 Change { int idd; // WIN32 Change static GPtr globals=NULL; /* need to be static */ long x = 0; switch (wMsg) { case WM_INITDIALOG: /* set up globals */ globals = (GPtr) lParam; CenterDialog(hDlg); /* fall into WM_PAINT */ case WM_PAINT: return FALSE; break; case WM_COMMAND: idd = COMMANDID (wParam); // WIN32 Change if (idd == x) // any radio groups ; // handle radios; else { switch (idd) { case OK: // assign to globals EndDialog(hDlg, idd); break; case CANCEL: gResult = userCanceledErr; EndDialog(hDlg, idd); // WIN32 change break; default: return FALSE; break; } } break; default: return FALSE; break; } return TRUE; } /*****************************************************************************/ Boolean DoParameters (GPtr globals) { INT_PTR nResult = noErr; PlatformData *platform; platform = (PlatformData *)((PickerRecordPtr) gStuff)->platformData; /* Query the user for parameters. */ nResult = DialogBoxParam(GetDLLInstance(), (LPSTR)"PICKERPARAM", (HWND)platform->hwnd, (DLGPROC)PickerProc, (LPARAM)globals); return (nResult == OK); // could be -1 } // NearestBaseUIWin.cpp
Java
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/lazylibrarian/ # # This file is part of Sick Beard. # # Sick Beard 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. # # Sick Beard 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 Sick Beard. If not, see <http://www.gnu.org/licenses/>. import lazylibrarian from lazylibrarian import logger, common, formatter # parse_qsl moved to urlparse module in v2.6 try: from urlparse import parse_qsl #@UnusedImport except: from cgi import parse_qsl #@Reimport import lib.oauth2 as oauth import lib.pythontwitter as twitter class TwitterNotifier: consumer_key = "208JPTMMnZjtKWA4obcH8g" consumer_secret = "BKaHzaQRd5PK6EH8EqPZ1w8mz6NSk9KErArarinHutk" REQUEST_TOKEN_URL = 'https://api.twitter.com/oauth/request_token' ACCESS_TOKEN_URL = 'https://api.twitter.com/oauth/access_token' AUTHORIZATION_URL = 'https://api.twitter.com/oauth/authorize' SIGNIN_URL = 'https://api.twitter.com/oauth/authenticate' def notify_snatch(self, title): if lazylibrarian.TWITTER_NOTIFY_ONSNATCH: self._notifyTwitter(common.notifyStrings[common.NOTIFY_SNATCH]+': '+title) def notify_download(self, title): if lazylibrarian.TWITTER_NOTIFY_ONDOWNLOAD: self._notifyTwitter(common.notifyStrings[common.NOTIFY_DOWNLOAD]+': '+title) def test_notify(self): return self._notifyTwitter("This is a test notification from LazyLibrarian / " + formatter.now(), force=True) def _get_authorization(self): signature_method_hmac_sha1 = oauth.SignatureMethod_HMAC_SHA1() #@UnusedVariable oauth_consumer = oauth.Consumer(key=self.consumer_key, secret=self.consumer_secret) oauth_client = oauth.Client(oauth_consumer) logger.info('Requesting temp token from Twitter') resp, content = oauth_client.request(self.REQUEST_TOKEN_URL, 'GET') if resp['status'] != '200': logger.info('Invalid respond from Twitter requesting temp token: %s' % resp['status']) else: request_token = dict(parse_qsl(content)) lazylibrarian.TWITTER_USERNAME = request_token['oauth_token'] lazylibrarian.TWITTER_PASSWORD = request_token['oauth_token_secret'] return self.AUTHORIZATION_URL+"?oauth_token="+ request_token['oauth_token'] def _get_credentials(self, key): request_token = {} request_token['oauth_token'] = lazylibrarian.TWITTER_USERNAME request_token['oauth_token_secret'] = lazylibrarian.TWITTER_PASSWORD request_token['oauth_callback_confirmed'] = 'true' token = oauth.Token(request_token['oauth_token'], request_token['oauth_token_secret']) token.set_verifier(key) logger.info('Generating and signing request for an access token using key '+key) signature_method_hmac_sha1 = oauth.SignatureMethod_HMAC_SHA1() #@UnusedVariable oauth_consumer = oauth.Consumer(key=self.consumer_key, secret=self.consumer_secret) logger.info('oauth_consumer: '+str(oauth_consumer)) oauth_client = oauth.Client(oauth_consumer, token) logger.info('oauth_client: '+str(oauth_client)) resp, content = oauth_client.request(self.ACCESS_TOKEN_URL, method='POST', body='oauth_verifier=%s' % key) logger.info('resp, content: '+str(resp)+','+str(content)) access_token = dict(parse_qsl(content)) logger.info('access_token: '+str(access_token)) logger.info('resp[status] = '+str(resp['status'])) if resp['status'] != '200': logger.error('The request for a token with did not succeed: '+str(resp['status'])) return False else: logger.info('Your Twitter Access Token key: %s' % access_token['oauth_token']) logger.info('Access Token secret: %s' % access_token['oauth_token_secret']) lazylibrarian.TWITTER_USERNAME = access_token['oauth_token'] lazylibrarian.TWITTER_PASSWORD = access_token['oauth_token_secret'] return True def _send_tweet(self, message=None): username=self.consumer_key password=self.consumer_secret access_token_key=lazylibrarian.TWITTER_USERNAME access_token_secret=lazylibrarian.TWITTER_PASSWORD logger.info(u"Sending tweet: "+message) api = twitter.Api(username, password, access_token_key, access_token_secret) try: api.PostUpdate(message) except Exception, e: logger.error(u"Error Sending Tweet: %s" %e) return False return True def _notifyTwitter(self, message='', force=False): prefix = lazylibrarian.TWITTER_PREFIX if not lazylibrarian.USE_TWITTER and not force: return False return self._send_tweet(prefix+": "+message) notifier = TwitterNotifier
Java
--- date: "2015-10-07T00:00:00Z" link: http://musicemojis.tumblr.com/ remoteImage: true title: Music Emojis category: Inspiration --- _A showcase of musicians in the minimal style of emojis!_ By [Bruno Leo Ribeiro](http://www.brunoleoribeiro.com/#kauko-home)
Java
/* * 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/>. */ /* * telemetry_hott.c * * Authors: * Konstantin Sharlaimov - HoTT code cleanup, proper state machine implementation, bi-directional serial port operation cleanup * Dominic Clifton - Hydra - Software Serial, Electronics, Hardware Integration and debugging, HoTT Code cleanup and fixes, general telemetry improvements. * Carsten Giesen - cGiesen - Baseflight port * Oliver Bayer - oBayer - MultiWii-HoTT, HoTT reverse engineering * Adam Majerczyk - HoTT-for-ardupilot from which some information and ideas are borrowed. * * https://github.com/obayer/MultiWii-HoTT * https://github.com/oBayer/MultiHoTT-Module * https://code.google.com/p/hott-for-ardupilot * * HoTT is implemented in Graupner equipment using a bi-directional protocol over a single wire. * * Generally the receiver sends a single request byte out using normal uart signals, then waits a short period for a * multiple byte response and checksum byte before it sends out the next request byte. * Each response byte must be send with a protocol specific delay between them. * * Serial ports use two wires but HoTT uses a single wire so some electronics are required so that * the signals don't get mixed up. When cleanflight transmits it should not receive it's own transmission. * * Connect as follows: * HoTT TX/RX -> Serial RX (connect directly) * Serial TX -> 1N4148 Diode -(| )-> HoTT TX/RX (connect via diode) * * The diode should be arranged to allow the data signals to flow the right way * -(| )- == Diode, | indicates cathode marker. * * As noticed by Skrebber the GR-12 (and probably GR-16/24, too) are based on a PIC 24FJ64GA-002, which has 5V tolerant digital pins. * * Note: The softserial ports are not listed as 5V tolerant in the STM32F103xx data sheet pinouts and pin description * section. Verify if you require a 5v/3.3v level shifters. The softserial port should not be inverted. * * There is a technical discussion (in German) about HoTT here * http://www.rc-network.de/forum/showthread.php/281496-Graupner-HoTT-Telemetrie-Sensoren-Eigenbau-DIY-Telemetrie-Protokoll-entschl%C3%BCsselt/page21 */ #include <stdbool.h> #include <stdint.h> #include <string.h> #include "platform.h" #if defined(TELEMETRY) && defined(TELEMETRY_HOTT) #include "build/build_config.h" #include "build/debug.h" #include "common/axis.h" #include "common/time.h" #include "drivers/time.h" #include "drivers/serial.h" #include "fc/runtime_config.h" #include "flight/pid.h" #include "io/serial.h" #include "io/gps.h" #include "navigation/navigation.h" #include "sensors/sensors.h" #include "sensors/battery.h" #include "telemetry/telemetry.h" #include "telemetry/hott.h" //#define HOTT_DEBUG typedef enum { HOTT_WAITING_FOR_REQUEST, HOTT_RECEIVING_REQUEST, HOTT_WAITING_FOR_TX_WINDOW, HOTT_TRANSMITTING, HOTT_ENDING_TRANSMISSION } hottState_e; #define HOTT_MESSAGE_PREPARATION_FREQUENCY_5_HZ ((1000 * 1000) / 5) #define HOTT_RX_SCHEDULE 4000 #define HOTT_TX_SCHEDULE 5000 #define HOTT_TX_DELAY_US 2000 #define MILLISECONDS_IN_A_SECOND 1000 static hottState_e hottState = HOTT_WAITING_FOR_REQUEST; static timeUs_t hottStateChangeUs = 0; static uint8_t *hottTxMsg = NULL; static uint8_t hottTxMsgSize; static uint8_t hottTxMsgCrc; #define HOTT_BAUDRATE 19200 #define HOTT_INITIAL_PORT_MODE MODE_RXTX static serialPort_t *hottPort = NULL; static serialPortConfig_t *portConfig; static bool hottTelemetryEnabled = false; static portSharing_e hottPortSharing; static HOTT_GPS_MSG_t hottGPSMessage; static HOTT_EAM_MSG_t hottEAMMessage; static void hottSwitchState(hottState_e newState, timeUs_t currentTimeUs) { if (hottState != newState) { hottState = newState; hottStateChangeUs = currentTimeUs; } } static void initialiseEAMMessage(HOTT_EAM_MSG_t *msg, size_t size) { memset(msg, 0, size); msg->start_byte = 0x7C; msg->eam_sensor_id = HOTT_TELEMETRY_EAM_SENSOR_ID; msg->sensor_id = HOTT_EAM_SENSOR_TEXT_ID; msg->stop_byte = 0x7D; } #ifdef GPS typedef enum { GPS_FIX_CHAR_NONE = '-', GPS_FIX_CHAR_2D = '2', GPS_FIX_CHAR_3D = '3', GPS_FIX_CHAR_DGPS = 'D', } gpsFixChar_e; static void initialiseGPSMessage(HOTT_GPS_MSG_t *msg, size_t size) { memset(msg, 0, size); msg->start_byte = 0x7C; msg->gps_sensor_id = HOTT_TELEMETRY_GPS_SENSOR_ID; msg->sensor_id = HOTT_GPS_SENSOR_TEXT_ID; msg->stop_byte = 0x7D; } #endif static void initialiseMessages(void) { initialiseEAMMessage(&hottEAMMessage, sizeof(hottEAMMessage)); #ifdef GPS initialiseGPSMessage(&hottGPSMessage, sizeof(hottGPSMessage)); #endif } #ifdef GPS void addGPSCoordinates(HOTT_GPS_MSG_t *hottGPSMessage, int32_t latitude, int32_t longitude) { int16_t deg = latitude / GPS_DEGREES_DIVIDER; int32_t sec = (latitude - (deg * GPS_DEGREES_DIVIDER)) * 6; int8_t min = sec / 1000000L; sec = (sec % 1000000L) / 100L; uint16_t degMin = (deg * 100L) + min; hottGPSMessage->pos_NS = (latitude < 0); hottGPSMessage->pos_NS_dm_L = degMin; hottGPSMessage->pos_NS_dm_H = degMin >> 8; hottGPSMessage->pos_NS_sec_L = sec; hottGPSMessage->pos_NS_sec_H = sec >> 8; deg = longitude / GPS_DEGREES_DIVIDER; sec = (longitude - (deg * GPS_DEGREES_DIVIDER)) * 6; min = sec / 1000000L; sec = (sec % 1000000L) / 100L; degMin = (deg * 100L) + min; hottGPSMessage->pos_EW = (longitude < 0); hottGPSMessage->pos_EW_dm_L = degMin; hottGPSMessage->pos_EW_dm_H = degMin >> 8; hottGPSMessage->pos_EW_sec_L = sec; hottGPSMessage->pos_EW_sec_H = sec >> 8; } void hottPrepareGPSResponse(HOTT_GPS_MSG_t *hottGPSMessage) { hottGPSMessage->gps_satelites = gpsSol.numSat; // Report climb rate regardless of GPS fix const int32_t climbrate = MAX(0, getEstimatedActualVelocity(Z) + 30000); hottGPSMessage->climbrate_L = climbrate & 0xFF; hottGPSMessage->climbrate_H = climbrate >> 8; const int32_t climbrate3s = MAX(0, 3.0f * getEstimatedActualVelocity(Z) / 100 + 120); hottGPSMessage->climbrate3s = climbrate3s & 0xFF; if (!STATE(GPS_FIX)) { hottGPSMessage->gps_fix_char = GPS_FIX_CHAR_NONE; return; } if (gpsSol.fixType == GPS_FIX_3D) { hottGPSMessage->gps_fix_char = GPS_FIX_CHAR_3D; } else { hottGPSMessage->gps_fix_char = GPS_FIX_CHAR_2D; } addGPSCoordinates(hottGPSMessage, gpsSol.llh.lat, gpsSol.llh.lon); // GPS Speed is returned in cm/s (from io/gps.c) and must be sent in km/h (Hott requirement) const uint16_t speed = (gpsSol.groundSpeed * 36) / 1000; hottGPSMessage->gps_speed_L = speed & 0x00FF; hottGPSMessage->gps_speed_H = speed >> 8; hottGPSMessage->home_distance_L = GPS_distanceToHome & 0x00FF; hottGPSMessage->home_distance_H = GPS_distanceToHome >> 8; const uint16_t hottGpsAltitude = (gpsSol.llh.alt / 100) + HOTT_GPS_ALTITUDE_OFFSET; // meters hottGPSMessage->altitude_L = hottGpsAltitude & 0x00FF; hottGPSMessage->altitude_H = hottGpsAltitude >> 8; hottGPSMessage->home_direction = GPS_directionToHome; } #endif static inline void updateAlarmBatteryStatus(HOTT_EAM_MSG_t *hottEAMMessage) { static uint32_t lastHottAlarmSoundTime = 0; if (((millis() - lastHottAlarmSoundTime) >= (telemetryConfig()->hottAlarmSoundInterval * MILLISECONDS_IN_A_SECOND))){ lastHottAlarmSoundTime = millis(); batteryState_e batteryState = getBatteryState(); if (batteryState == BATTERY_WARNING || batteryState == BATTERY_CRITICAL){ hottEAMMessage->warning_beeps = 0x10; hottEAMMessage->alarm_invers1 = HOTT_EAM_ALARM1_FLAG_BATTERY_1; } else { hottEAMMessage->warning_beeps = HOTT_EAM_ALARM1_FLAG_NONE; hottEAMMessage->alarm_invers1 = HOTT_EAM_ALARM1_FLAG_NONE; } } } static inline void hottEAMUpdateBattery(HOTT_EAM_MSG_t *hottEAMMessage) { hottEAMMessage->main_voltage_L = vbat & 0xFF; hottEAMMessage->main_voltage_H = vbat >> 8; hottEAMMessage->batt1_voltage_L = vbat & 0xFF; hottEAMMessage->batt1_voltage_H = vbat >> 8; updateAlarmBatteryStatus(hottEAMMessage); } static inline void hottEAMUpdateCurrentMeter(HOTT_EAM_MSG_t *hottEAMMessage) { const int32_t amp = amperage / 10; hottEAMMessage->current_L = amp & 0xFF; hottEAMMessage->current_H = amp >> 8; } static inline void hottEAMUpdateBatteryDrawnCapacity(HOTT_EAM_MSG_t *hottEAMMessage) { const int32_t mAh = mAhDrawn / 10; hottEAMMessage->batt_cap_L = mAh & 0xFF; hottEAMMessage->batt_cap_H = mAh >> 8; } static inline void hottEAMUpdateAltitudeAndClimbrate(HOTT_EAM_MSG_t *hottEAMMessage) { const int32_t alt = MAX(0, getEstimatedActualPosition(Z) / 100.0f + HOTT_GPS_ALTITUDE_OFFSET); // Value of 500 = 0m hottEAMMessage->altitude_L = alt & 0xFF; hottEAMMessage->altitude_H = alt >> 8; const int32_t climbrate = MAX(0, getEstimatedActualVelocity(Z) + 30000); hottEAMMessage->climbrate_L = climbrate & 0xFF; hottEAMMessage->climbrate_H = climbrate >> 8; const int32_t climbrate3s = MAX(0, 3.0f * getEstimatedActualVelocity(Z) / 100 + 120); hottEAMMessage->climbrate3s = climbrate3s & 0xFF; } void hottPrepareEAMResponse(HOTT_EAM_MSG_t *hottEAMMessage) { // Reset alarms hottEAMMessage->warning_beeps = 0x0; hottEAMMessage->alarm_invers1 = 0x0; hottEAMUpdateBattery(hottEAMMessage); hottEAMUpdateCurrentMeter(hottEAMMessage); hottEAMUpdateBatteryDrawnCapacity(hottEAMMessage); hottEAMUpdateAltitudeAndClimbrate(hottEAMMessage); } static void hottSerialWrite(uint8_t c) { static uint8_t serialWrites = 0; serialWrites++; serialWrite(hottPort, c); } void freeHoTTTelemetryPort(void) { closeSerialPort(hottPort); hottPort = NULL; hottTelemetryEnabled = false; } void initHoTTTelemetry(void) { portConfig = findSerialPortConfig(FUNCTION_TELEMETRY_HOTT); hottPortSharing = determinePortSharing(portConfig, FUNCTION_TELEMETRY_HOTT); initialiseMessages(); } void configureHoTTTelemetryPort(void) { if (!portConfig) { return; } hottPort = openSerialPort(portConfig->identifier, FUNCTION_TELEMETRY_HOTT, NULL, HOTT_BAUDRATE, HOTT_INITIAL_PORT_MODE, SERIAL_NOT_INVERTED); if (!hottPort) { return; } hottTelemetryEnabled = true; } static void hottQueueSendResponse(uint8_t *buffer, int length) { hottTxMsg = buffer; hottTxMsgSize = length; } static bool processBinaryModeRequest(uint8_t address) { switch (address) { #ifdef GPS case 0x8A: if (sensors(SENSOR_GPS)) { hottPrepareGPSResponse(&hottGPSMessage); hottQueueSendResponse((uint8_t *)&hottGPSMessage, sizeof(hottGPSMessage)); return true; } break; #endif case 0x8E: hottPrepareEAMResponse(&hottEAMMessage); hottQueueSendResponse((uint8_t *)&hottEAMMessage, sizeof(hottEAMMessage)); return true; } return false; } static void flushHottRxBuffer(void) { while (serialRxBytesWaiting(hottPort) > 0) { serialRead(hottPort); } } static bool hottSendTelemetryDataByte(timeUs_t currentTimeUs) { static timeUs_t byteSentTimeUs = 0; // Guard intra-byte interval if (currentTimeUs - byteSentTimeUs < HOTT_TX_DELAY_US) { return false; } if (hottTxMsgSize == 0) { // Send CRC byte hottSerialWrite(hottTxMsgCrc); return true; } else { // Send data byte hottTxMsgCrc += *hottTxMsg; hottSerialWrite(*hottTxMsg); hottTxMsg++; hottTxMsgSize--; return false; } } void checkHoTTTelemetryState(void) { bool newTelemetryEnabledValue = telemetryDetermineEnabledState(hottPortSharing); if (newTelemetryEnabledValue == hottTelemetryEnabled) { return; } if (newTelemetryEnabledValue) configureHoTTTelemetryPort(); else freeHoTTTelemetryPort(); } void handleHoTTTelemetry(timeUs_t currentTimeUs) { static uint8_t hottRequestBuffer[2]; static int hottRequestBufferPtr = 0; if (!hottTelemetryEnabled) return; bool reprocessState; do { reprocessState = false; switch (hottState) { case HOTT_WAITING_FOR_REQUEST: if (serialRxBytesWaiting(hottPort)) { hottRequestBufferPtr = 0; hottSwitchState(HOTT_RECEIVING_REQUEST, currentTimeUs); reprocessState = true; } break; case HOTT_RECEIVING_REQUEST: if ((currentTimeUs - hottStateChangeUs) >= HOTT_RX_SCHEDULE) { // Waiting for too long - resync flushHottRxBuffer(); hottSwitchState(HOTT_WAITING_FOR_REQUEST, currentTimeUs); } else { while (serialRxBytesWaiting(hottPort) && hottRequestBufferPtr < 2) { hottRequestBuffer[hottRequestBufferPtr++] = serialRead(hottPort); } if (hottRequestBufferPtr >= 2) { if ((hottRequestBuffer[0] == 0) || (hottRequestBuffer[0] == HOTT_BINARY_MODE_REQUEST_ID)) { /* * FIXME the first byte of the HoTT request frame is ONLY either 0x80 (binary mode) or 0x7F (text mode). * The binary mode is read as 0x00 (error reading the upper bit) while the text mode is correctly decoded. * The (requestId == 0) test is a workaround for detecting the binary mode with no ambiguity as there is only * one other valid value (0x7F) for text mode. * The error reading for the upper bit should nevertheless be fixed */ if (processBinaryModeRequest(hottRequestBuffer[1])) { hottSwitchState(HOTT_WAITING_FOR_TX_WINDOW, currentTimeUs); } else { hottSwitchState(HOTT_WAITING_FOR_REQUEST, currentTimeUs); } } else if (hottRequestBuffer[0] == HOTT_TEXT_MODE_REQUEST_ID) { // FIXME Text mode hottSwitchState(HOTT_WAITING_FOR_REQUEST, currentTimeUs); } else { // Received garbage - resync flushHottRxBuffer(); hottSwitchState(HOTT_WAITING_FOR_REQUEST, currentTimeUs); } reprocessState = true; } } break; case HOTT_WAITING_FOR_TX_WINDOW: if ((currentTimeUs - hottStateChangeUs) >= HOTT_TX_SCHEDULE) { hottTxMsgCrc = 0; hottSwitchState(HOTT_TRANSMITTING, currentTimeUs); } break; case HOTT_TRANSMITTING: if (hottSendTelemetryDataByte(currentTimeUs)) { hottSwitchState(HOTT_ENDING_TRANSMISSION, currentTimeUs); } break; case HOTT_ENDING_TRANSMISSION: if ((currentTimeUs - hottStateChangeUs) >= HOTT_TX_DELAY_US) { flushHottRxBuffer(); hottSwitchState(HOTT_WAITING_FOR_REQUEST, currentTimeUs); reprocessState = true; } break; }; } while (reprocessState); } #endif
Java
/* This file is part of Clementine. Copyright 2010, David Sansome <me@davidsansome.com> Clementine 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. Clementine 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 Clementine. If not, see <http://www.gnu.org/licenses/>. */ #include <Python.h> #include "core/utilities.h" #include "playlist/songplaylistitem.h" #include "scripting/script.h" #include "scripting/scriptmanager.h" #include "scripting/python/pythonengine.h" #include "gmock/gmock.h" #include "gtest/gtest.h" #include "testobjectdecorators.h" #include "test_utils.h" #include <QSettings> #include <QtDebug> #include <boost/noncopyable.hpp> class TemporaryScript : boost::noncopyable { public: TemporaryScript(const QString& code, const QString& directory_template = QString()) { directory_ = Utilities::MakeTempDir(directory_template); QSettings ini(directory_ + "/script.ini", QSettings::IniFormat); ini.beginGroup("Script"); ini.setValue("language", "python"); ini.setValue("script_file", "script.py"); QFile script(directory_ + "/script.py"); script.open(QIODevice::WriteOnly); script.write(code.toUtf8()); } ~TemporaryScript() { if (!directory_.isEmpty()) { Utilities::RemoveRecursive(directory_); } } QString directory_; }; class PythonTest : public ::testing::Test { protected: static void SetUpTestCase() { sManager = new ScriptManager; sEngine = qobject_cast<PythonEngine*>( sManager->EngineForLanguage(ScriptInfo::Language_Python)); sEngine->EnsureInitialised(); PythonQt::self()->addDecorators(new TestObjectDecorators()); } static void TearDownTestCase() { delete sManager; } static ScriptManager* sManager; static PythonEngine* sEngine; }; ScriptManager* PythonTest::sManager = NULL; PythonEngine* PythonTest::sEngine = NULL; TEST_F(PythonTest, HasPythonEngine) { ASSERT_TRUE(sEngine); } TEST_F(PythonTest, InitFromDirectory) { TemporaryScript script("pass"); ScriptInfo info; info.InitFromDirectory(sManager, script.directory_); EXPECT_TRUE(info.is_valid()); EXPECT_EQ(script.directory_, info.path()); EXPECT_EQ(ScriptInfo::Language_Python, info.language()); EXPECT_EQ(NULL, info.loaded()); } TEST_F(PythonTest, StdioIsRedirected) { TemporaryScript script( "import sys\n" "print 'text on stdout'\n" "print >>sys.stderr, 'text on stderr'\n"); ScriptInfo info; info.InitFromDirectory(sManager, script.directory_); sEngine->CreateScript(info); QString log = sManager->log_lines_plain().join("\n"); ASSERT_TRUE(log.contains("text on stdout")); ASSERT_TRUE(log.contains("text on stderr")); } TEST_F(PythonTest, CleanupModuleDict) { TemporaryScript script( "class Foo:\n" " def __init__(self):\n" " print 'constructor'\n" " def __del__(self):\n" " print 'destructor'\n" "f = Foo()\n"); ScriptInfo info; info.InitFromDirectory(sManager, script.directory_); Script* s = sEngine->CreateScript(info); ASSERT_TRUE(sManager->log_lines_plain().last().endsWith("constructor")); sEngine->DestroyScript(s); ASSERT_TRUE(sManager->log_lines_plain().last().endsWith("destructor")); } TEST_F(PythonTest, CleanupSignalConnections) { TemporaryScript script( "from PythonQt.QtCore import QCoreApplication\n" "class Foo:\n" " def __init__(self):\n" " QCoreApplication.instance().connect('aboutToQuit()', self.aslot)\n" " def __del__(self):\n" " print 'destructor'\n" " def aslot(self):\n" " pass\n" "f = Foo()\n"); ScriptInfo info; info.InitFromDirectory(sManager, script.directory_); sEngine->DestroyScript(sEngine->CreateScript(info)); ASSERT_TRUE(sManager->log_lines_plain().last().endsWith("destructor")); } TEST_F(PythonTest, ModuleConstants) { TemporaryScript script( "print type(__builtins__)\n" "print __file__\n" "print __name__\n" "print __package__\n" "print __path__\n" "print __script__\n"); ScriptInfo info; info.InitFromDirectory(sManager, script.directory_); sEngine->CreateScript(info); const QStringList log = sManager->log_lines_plain(); const int n = log.count(); ASSERT_GE(n, 6); EXPECT_TRUE(log.at(n-6).endsWith("<type 'dict'>")); // __builtins__ EXPECT_TRUE(log.at(n-5).endsWith(script.directory_ + "/script.py")); // __file__ EXPECT_TRUE(log.at(n-4).endsWith("clementinescripts." + info.id())); // __name__ EXPECT_TRUE(log.at(n-3).endsWith("None")); // __package__ EXPECT_TRUE(log.at(n-2).endsWith("['" + script.directory_ + "']")); // __path__ EXPECT_TRUE(log.at(n-1).contains("ScriptInterface (QObject ")); // __script__ } TEST_F(PythonTest, PythonQtAttrSetWrappedCPP) { // Tests 3rdparty/pythonqt/patches/call-slot-returnvalue.patch TemporaryScript script( "import PythonQt.QtGui\n" "PythonQt.QtGui.QStyleOption().version = 123\n" "PythonQt.QtGui.QStyleOption().version = 123\n" "PythonQt.QtGui.QStyleOption().version = 123\n"); ScriptInfo info; info.InitFromDirectory(sManager, script.directory_); EXPECT_TRUE(sEngine->CreateScript(info)); } TEST_F(PythonTest, PythonQtArgumentReferenceCount) { // Tests 3rdparty/pythonqt/patches/argument-reference-count.patch TemporaryScript script( "from PythonQt.QtCore import QFile, QObject\n" "class Foo(QFile):\n" " def Init(self, parent):\n" " QFile.__init__(self, parent)\n" "parent = QObject()\n" "Foo().Init(parent)\n" "assert parent\n"); ScriptInfo info; info.InitFromDirectory(sManager, script.directory_); EXPECT_TRUE(sEngine->CreateScript(info)); } TEST_F(PythonTest, PythonQtConversionStack) { // Tests 3rdparty/pythonqt/patches/conversion-stack.patch // This crash is triggered when a C++ thing calls a virtual method on a // python wrapper and that wrapper returns a QString, QByteArray or // QStringList. In this instance, initStyleOption() calls text() in Foo. TemporaryScript script( "from PythonQt.QtGui import QProgressBar, QStyleOptionProgressBar\n" "class Foo(QProgressBar):\n" " def text(self):\n" " return 'something'\n" "for _ in xrange(1000):\n" " Foo().initStyleOption(QStyleOptionProgressBar())\n"); ScriptInfo info; info.InitFromDirectory(sManager, script.directory_); EXPECT_TRUE(sEngine->CreateScript(info)); }
Java
<?php class ControllerCommonLanguage extends Controller { public function index() { $this->load->language('common/language'); $data['action'] = $this->url->link('common/language/language', '', $this->request->server['HTTPS']); $data['code'] = $this->session->data['language']; $this->load->model('localisation/language'); $data['languages'] = array(); $results = $this->model_localisation_language->getLanguages(); foreach ($results as $result) { if ($result['status']) { $data['languages'][] = array( 'layout' => 1, 'name' => $result['name'], 'code' => $result['code'] ); } } if (!isset($this->request->get['route'])) { $data['redirect'] = $this->url->link('common/home'); } else { $url_data = $this->request->get; unset($url_data['_route_']); $route = $url_data['route']; unset($url_data['route']); $url = ''; if ($url_data) { $url = '&' . urldecode(http_build_query($url_data, '', '&')); } $data['redirect'] = $this->url->link($route, $url, $this->request->server['HTTPS']); } return $this->load->view('common/language', $data); } public function language() { if (isset($this->request->post['code'])) { $this->session->data['language'] = $this->request->post['code']; } if (isset($this->request->post['redirect'])) { $this->response->redirect($this->request->post['redirect']); } else { $this->response->redirect($this->url->link('common/home')); } } }
Java
/** * Copyright (C) 2008 Happy Fish / YuQing * * FastDFS may be copied only under the terms of the GNU General * Public License V3, which may be found in the FastDFS source kit. * Please visit the FastDFS Home Page http://www.csource.org/ for more detail. **/ //tracker_nio.h #ifndef _TRACKER_NIO_H #define _TRACKER_NIO_H #include <stdio.h> #include <stdlib.h> #include <string.h> #include "fast_task_queue.h" #ifdef __cplusplus extern "C" { #endif /* * ÿ¸öÏ̵߳ĹܵÀpipe_fds[0]µÄREADʼþµÄ»Øµ÷º¯Êý * ÿ´Î¶Áȡһ¸öint±äÁ¿£¬ÊÇн¨Á¢Á¬½ÓµÄsocketÃèÊö·û£¬Ö®ºó¼ÓÈëµ½IOʼþ¼¯ºÏ * °´Í¨µÀ·Ö·¢µ½ÏàÓ¦¹¤×÷Ïß³ÌÖеȴý¿É¶Áʼþ´¥·¢ºóµ÷ÓÃclient_sock_readº¯Êý½øÐд¦Àí */ void recv_notify_read(int sock, short event, void *arg); /* ½«·¢Ëͱ¨ÎĵÄʼþ¼ÓÈëµ½IOʼþ¼¯ºÏÖÐ */ int send_add_event(struct fast_task_info *pTask); /* ÈÎÎñ½áÊøºóµÄÇåÀíº¯Êý */ void task_finish_clean_up(struct fast_task_info *pTask); #ifdef __cplusplus } #endif #endif
Java
using System; using System.Collections; using System.IO; namespace Server.Engines.Reports { public class StaffHistory : PersistableObject { #region Type Identification public static readonly PersistableType ThisTypeID = new PersistableType("stfhst", new ConstructCallback(Construct)); private static PersistableObject Construct() { return new StaffHistory(); } public override PersistableType TypeID { get { return ThisTypeID; } } #endregion private PageInfoCollection m_Pages; private QueueStatusCollection m_QueueStats; private Hashtable m_UserInfo; private Hashtable m_StaffInfo; public PageInfoCollection Pages { get { return this.m_Pages; } set { this.m_Pages = value; } } public QueueStatusCollection QueueStats { get { return this.m_QueueStats; } set { this.m_QueueStats = value; } } public Hashtable UserInfo { get { return this.m_UserInfo; } set { this.m_UserInfo = value; } } public Hashtable StaffInfo { get { return this.m_StaffInfo; } set { this.m_StaffInfo = value; } } public void AddPage(PageInfo info) { lock (SaveLock) this.m_Pages.Add(info); info.History = this; } public StaffHistory() { this.m_Pages = new PageInfoCollection(); this.m_QueueStats = new QueueStatusCollection(); this.m_UserInfo = new Hashtable(StringComparer.OrdinalIgnoreCase); this.m_StaffInfo = new Hashtable(StringComparer.OrdinalIgnoreCase); } public StaffInfo GetStaffInfo(string account) { lock (RenderLock) { if (account == null || account.Length == 0) return null; StaffInfo info = this.m_StaffInfo[account] as StaffInfo; if (info == null) this.m_StaffInfo[account] = info = new StaffInfo(account); return info; } } public UserInfo GetUserInfo(string account) { if (account == null || account.Length == 0) return null; UserInfo info = this.m_UserInfo[account] as UserInfo; if (info == null) this.m_UserInfo[account] = info = new UserInfo(account); return info; } public static readonly object RenderLock = new object(); public static readonly object SaveLock = new object(); public void Save() { lock (SaveLock) { if (!Directory.Exists("Output")) { Directory.CreateDirectory("Output"); } string path = Path.Combine(Core.BaseDirectory, "Output/staffHistory.xml"); PersistanceWriter pw = new XmlPersistanceWriter(path, "Staff"); pw.WriteDocument(this); pw.Close(); } } public void Load() { string path = Path.Combine(Core.BaseDirectory, "Output/staffHistory.xml"); if (!File.Exists(path)) return; PersistanceReader pr = new XmlPersistanceReader(path, "Staff"); pr.ReadDocument(this); pr.Close(); } public override void SerializeChildren(PersistanceWriter op) { for (int i = 0; i < this.m_Pages.Count; ++i) this.m_Pages[i].Serialize(op); for (int i = 0; i < this.m_QueueStats.Count; ++i) this.m_QueueStats[i].Serialize(op); } public override void DeserializeChildren(PersistanceReader ip) { DateTime min = DateTime.UtcNow - TimeSpan.FromDays(8.0); while (ip.HasChild) { PersistableObject obj = ip.GetChild(); if (obj is PageInfo) { PageInfo pageInfo = obj as PageInfo; pageInfo.UpdateResolver(); if (pageInfo.TimeSent >= min || pageInfo.TimeResolved >= min) { this.m_Pages.Add(pageInfo); pageInfo.History = this; } else { pageInfo.Sender = null; pageInfo.Resolver = null; } } else if (obj is QueueStatus) { QueueStatus queueStatus = obj as QueueStatus; if (queueStatus.TimeStamp >= min) this.m_QueueStats.Add(queueStatus); } } } public StaffInfo[] GetStaff() { StaffInfo[] staff = new StaffInfo[this.m_StaffInfo.Count]; int index = 0; foreach (StaffInfo staffInfo in this.m_StaffInfo.Values) staff[index++] = staffInfo; return staff; } public void Render(ObjectCollection objects) { lock (RenderLock) { objects.Add(this.GraphQueueStatus()); StaffInfo[] staff = this.GetStaff(); BaseInfo.SortRange = TimeSpan.FromDays(7.0); Array.Sort(staff); objects.Add(this.GraphHourlyPages(this.m_Pages, PageResolution.None, "New pages by hour", "graph_new_pages_hr")); objects.Add(this.GraphHourlyPages(this.m_Pages, PageResolution.Handled, "Handled pages by hour", "graph_handled_pages_hr")); objects.Add(this.GraphHourlyPages(this.m_Pages, PageResolution.Deleted, "Deleted pages by hour", "graph_deleted_pages_hr")); objects.Add(this.GraphHourlyPages(this.m_Pages, PageResolution.Canceled, "Canceled pages by hour", "graph_canceled_pages_hr")); objects.Add(this.GraphHourlyPages(this.m_Pages, PageResolution.Logged, "Logged-out pages by hour", "graph_logged_pages_hr")); BaseInfo.SortRange = TimeSpan.FromDays(1.0); Array.Sort(staff); objects.Add(this.ReportTotalPages(staff, TimeSpan.FromDays(1.0), "1 Day")); objects.AddRange((PersistableObject[])this.ChartTotalPages(staff, TimeSpan.FromDays(1.0), "1 Day", "graph_daily_pages")); BaseInfo.SortRange = TimeSpan.FromDays(7.0); Array.Sort(staff); objects.Add(this.ReportTotalPages(staff, TimeSpan.FromDays(7.0), "1 Week")); objects.AddRange((PersistableObject[])this.ChartTotalPages(staff, TimeSpan.FromDays(7.0), "1 Week", "graph_weekly_pages")); BaseInfo.SortRange = TimeSpan.FromDays(30.0); Array.Sort(staff); objects.Add(this.ReportTotalPages(staff, TimeSpan.FromDays(30.0), "1 Month")); objects.AddRange((PersistableObject[])this.ChartTotalPages(staff, TimeSpan.FromDays(30.0), "1 Month", "graph_monthly_pages")); for (int i = 0; i < staff.Length; ++i) objects.Add(this.GraphHourlyPages(staff[i])); } } public static int GetPageCount(StaffInfo staff, DateTime min, DateTime max) { return GetPageCount(staff.Pages, PageResolution.Handled, min, max); } public static int GetPageCount(PageInfoCollection pages, PageResolution res, DateTime min, DateTime max) { int count = 0; for (int i = 0; i < pages.Count; ++i) { if (res != PageResolution.None && pages[i].Resolution != res) continue; DateTime ts = pages[i].TimeResolved; if (ts >= min && ts < max) ++count; } return count; } private BarGraph GraphQueueStatus() { int[] totals = new int[24]; int[] counts = new int[24]; DateTime max = DateTime.UtcNow; DateTime min = max - TimeSpan.FromDays(7.0); for (int i = 0; i < this.m_QueueStats.Count; ++i) { DateTime ts = this.m_QueueStats[i].TimeStamp; if (ts >= min && ts < max) { DateTime date = ts.Date; TimeSpan time = ts.TimeOfDay; int hour = time.Hours; totals[hour] += this.m_QueueStats[i].Count; counts[hour]++; } } BarGraph barGraph = new BarGraph("Average pages in queue", "graph_pagequeue_avg", 10, "Time", "Pages", BarGraphRenderMode.Lines); barGraph.FontSize = 6; for (int i = 7; i <= totals.Length + 7; ++i) { int val; if (counts[i % totals.Length] == 0) val = 0; else val = (totals[i % totals.Length] + (counts[i % totals.Length] / 2)) / counts[i % totals.Length]; int realHours = i % totals.Length; int hours; if (realHours == 0) hours = 12; else if (realHours > 12) hours = realHours - 12; else hours = realHours; barGraph.Items.Add(hours + (realHours >= 12 ? " PM" : " AM"), val); } return barGraph; } private BarGraph GraphHourlyPages(StaffInfo staff) { return this.GraphHourlyPages(staff.Pages, PageResolution.Handled, "Average pages handled by " + staff.Display, "graphs_" + staff.Account.ToLower() + "_avg"); } private BarGraph GraphHourlyPages(PageInfoCollection pages, PageResolution res, string title, string fname) { int[] totals = new int[24]; int[] counts = new int[24]; DateTime[] dates = new DateTime[24]; DateTime max = DateTime.UtcNow; DateTime min = max - TimeSpan.FromDays(7.0); bool sentStamp = (res == PageResolution.None); for (int i = 0; i < pages.Count; ++i) { if (res != PageResolution.None && pages[i].Resolution != res) continue; DateTime ts = (sentStamp ? pages[i].TimeSent : pages[i].TimeResolved); if (ts >= min && ts < max) { DateTime date = ts.Date; TimeSpan time = ts.TimeOfDay; int hour = time.Hours; totals[hour]++; if (dates[hour] != date) { counts[hour]++; dates[hour] = date; } } } BarGraph barGraph = new BarGraph(title, fname, 10, "Time", "Pages", BarGraphRenderMode.Lines); barGraph.FontSize = 6; for (int i = 7; i <= totals.Length + 7; ++i) { int val; if (counts[i % totals.Length] == 0) val = 0; else val = (totals[i % totals.Length] + (counts[i % totals.Length] / 2)) / counts[i % totals.Length]; int realHours = i % totals.Length; int hours; if (realHours == 0) hours = 12; else if (realHours > 12) hours = realHours - 12; else hours = realHours; barGraph.Items.Add(hours + (realHours >= 12 ? " PM" : " AM"), val); } return barGraph; } private Report ReportTotalPages(StaffInfo[] staff, TimeSpan ts, string title) { DateTime max = DateTime.UtcNow; DateTime min = max - ts; Report report = new Report(title + " Staff Report", "400"); report.Columns.Add("65%", "left", "Staff Name"); report.Columns.Add("35%", "center", "Page Count"); for (int i = 0; i < staff.Length; ++i) report.Items.Add(staff[i].Display, GetPageCount(staff[i], min, max)); return report; } private PieChart[] ChartTotalPages(StaffInfo[] staff, TimeSpan ts, string title, string fname) { DateTime max = DateTime.UtcNow; DateTime min = max - ts; PieChart staffChart = new PieChart(title + " Staff Chart", fname + "_staff", true); int other = 0; for (int i = 0; i < staff.Length; ++i) { int count = GetPageCount(staff[i], min, max); if (i < 12 && count > 0) staffChart.Items.Add(staff[i].Display, count); else other += count; } if (other > 0) staffChart.Items.Add("Other", other); PieChart resChart = new PieChart(title + " Resolutions", fname + "_resol", true); int countTotal = GetPageCount(this.m_Pages, PageResolution.None, min, max); int countHandled = GetPageCount(this.m_Pages, PageResolution.Handled, min, max); int countDeleted = GetPageCount(this.m_Pages, PageResolution.Deleted, min, max); int countCanceled = GetPageCount(this.m_Pages, PageResolution.Canceled, min, max); int countLogged = GetPageCount(this.m_Pages, PageResolution.Logged, min, max); int countUnres = countTotal - (countHandled + countDeleted + countCanceled + countLogged); resChart.Items.Add("Handled", countHandled); resChart.Items.Add("Deleted", countDeleted); resChart.Items.Add("Canceled", countCanceled); resChart.Items.Add("Logged Out", countLogged); resChart.Items.Add("Unresolved", countUnres); return new PieChart[] { staffChart, resChart }; } } }
Java
/* * Copyright (C) 2018 Olzhas Rakhimov * * 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/>. */ /// @file /// Text alignment common conventions. #pragma once #include <Qt> namespace scram::gui { /// Default alignment of numerical values in tables. const int ALIGN_NUMBER_IN_TABLE = Qt::AlignRight | Qt::AlignVCenter; } // namespace scram::gui
Java
{% extends "layout.html" %} {% block body %} <div class="text_body"> <h2>Manage input variable groups</h2> <form> <h3>Create an input group</h3> <p> Input groups are used to select input variables for templates They are managed at the partner level, so that members of your group will only see the input groups that you manage. </p> <p> You can make your own copy of an input group that was created by another partner or leave the filters blank to create a new empty input group and add input variables below. </p> <dl> <div id="group_to_copy_select"> <dd>Copy default variable groups or from a selected partner</dd> <dt>{{ add_input_group_form.partner_to_copy }}</dt> <dd>Select the group to copy</dd> <dt>{{ add_input_group_form.group_to_copy }}</dt> </div> <div id="group_to_copy_div"> <div id = group_to_copy_members_div> <dd>Group members:</dd> <dt> <ul id="group_to_copy_members"> </ul> </dt> </div> <div id = group_to_copy_levels_div> <dd>Group available at levels:</dd> <dt> <ul id="group_to_copy_levels"> </ul> </dt> </div> </div> </dl> <dl> <dd>Enter a name to create a new group</dd> <dt>{{ add_input_group_form.input_group_name }} {{ add_input_group_form.submit_input_group_name }}</dt> {{ add_input_group_form.csrf_token }} </dl> <div id="manage_group_members_div"> <div> <h3>Manage group</h3> <p> Drag and drop between lists to add/remove items or within the list to arrange their order of appearance. Click commit to store these changes. </p> </div> <div id="group_inputs_div"> <h4>Manage selected group</h4> <dd>{{ manage_input_group_form.input_group_select }}</dd> <div id="group_inputs_list_div"> {{ manage_input_group_form.group_inputs }} </div> <h4>Select levels for this group</h4> <p> Note: This does not affect the availability of the groups input variables at each level. It only affects the visibility of the input group. </p> <dd>{{ manage_input_group_form.group_levels_select }}</dd> <dd>{{ manage_input_group_form.commit_group_changes }}</dd> {{ manage_input_group_form.csrf_token }} </div> <div id="all_inputs_div"> <h4>Find input variables</h4> <dd>Record type:{{ manage_input_group_form.record_type }} Item level:{{ manage_input_group_form.item_level }}</dd> <div id="all_inputs_list_div"> {{ manage_input_group_form.all_inputs }} </div> </div> </div> <div id="manage group visibility"> <h3> </h3> </div> </form> </div> <script src="{{ url_for('static', filename='jquery_1.8.3_min.js') }}"></script> <script src="{{ url_for('static', filename='jquery-ui-1.12.1.custom/jquery-ui.js') }}"></script> <script src="{{ url_for('static', filename='jquery_input_group_mgmt.js') }}"></script> {% endblock %}
Java
# <img src="https://v20.imgup.net/oakdex_logfbad.png" alt="fixer" width=282> [![Build Status](https://travis-ci.org/jalyna/oakdex-pokedex.svg?branch=master)](https://travis-ci.org/jalyna/oakdex-pokedex) [![Code Climate](https://codeclimate.com/github/jalyna/oakdex-pokedex/badges/gpa.svg)](https://codeclimate.com/github/jalyna/oakdex-pokedex) [![Test Coverage](https://codeclimate.com/github/jalyna/oakdex-pokedex/badges/coverage.svg)](https://codeclimate.com/github/jalyna/oakdex-pokedex/coverage) [![Issue Count](https://codeclimate.com/github/jalyna/oakdex-pokedex/badges/issue_count.svg)](https://codeclimate.com/github/jalyna/oakdex-pokedex) ## Getting Started ### Ruby Add oakdex to your Gemfile and do `bundle install`: ```ruby gem 'oakdex-pokedex' ``` Then you can use the library: ```ruby require 'oakdex/pokedex' eevee = Oakdex::Pokedex::Pokemon.find('Eevee') # => #<Oakdex::Pokedex::Pokemon:0x007fe3dd6a88f8 @attributes={"names"=>{"fr"=>"Évoli", "de"=>"Evoli", "it"=>"Eevee", "en"=>"Eevee"}, "national_id"=>133 ...> bulbasaur = Oakdex::Pokedex::Pokemon.find(1) # => #<Oakdex::Pokedex::Pokemon:0x007fe3dc55da80 @attributes={"names"=>{"fr"=>"Bulbizarre", "de"=>"Bisasam", ...> bulbasaur.name # => "Bulbasaur" bulbasaur.name('de') # => "Bisasam" bulbasaur.types # => ["Grass", "Poison"] bulbasaur.attributes # => {"names"=>{"fr"=>"Bulbizarre", "de"=>"Bisasam", "it"=>"Bulbasaur", "en"=>"Bulbasaur"}, "national_id"=>1, "types"=>["Grass", "Poison"], "abilities"=>[{"name"=>"Overgrow"}, {"name"=>"Chlorophyll", "hidden"=>true}], "gender_ratios"=>{"male"=>87.5, "female"=>12.5}, "catch_rate"=>45, "egg_groups"=...} tackle = Oakdex::Pokedex::Move.find('Tackle') # => #<Oakdex::Pokedex::Move:0x007fbc9a10cda0 @attributes={"index_number"=>33, "pp"=>35, "max_pp"=>56, "power"=>50, "accuracy"=>100, "category"=>"physical", "priority"=>0, "target"=>"target", ...> contrary = Oakdex::Pokedex::Ability.find('Contrary') # => #<Oakdex::Pokedex::Ability:0x007fbc9b033540 @attributes={"index_number"=>126, "names"=>{"fr"=>"Contestation", "de"=>"Umkehrung", "it"=>"Inversione", "en"=>"Contrary"}, "descriptions"=>{"en"=>"Inverts stat modifiers.", "de"=>"Attacken, die einen Statuswert des Pokémon erhöhen würden, senken ihn und umgekehrt."}}> fairy = Oakdex::Pokedex::Type.find('Fairy') # => #<Oakdex::Pokedex::Type:0x007fbc9a943c30 @attributes={"names"=>{"de"=>"Fee", "gr"=>"νεράιδα Neraida", "it"=>"Folletto", "pl"=>"Baśniowy (XY13) Bajkowy (XY46)", "en"=>"Fairy"}, "effectivness"=>{"Normal"=>1.0, "Fighting"=>2.0, "Flying"=>1.0, "Poison"=>0.5, "Ground"=>1.0, "Rock"=>1.0, "Bug"=>1.0, "Ghost"=>1.0, "Steel"=>0.5, "Fire"=>0.5, "Water"=>1.0, "Grass"=>1.0, "Electric"=>1.0, "Psychic"=>1.0, "Ice"=>1.0, "Dragon"=>2.0, "Dark"=>2.0, "Fairy"=>1.0}, "color"=>"#D685AD"}> fairy.effectivness_for('Dark') # => 2.0 water1 = Oakdex::Pokedex::EggGroup.find('Water 1') # => #<Oakdex::Pokedex::EggGroup:0x007fbc9a853398 @attributes={"names"=>{"en"=>"Water 1", "jp"=>"すいちゅう1 (水中1) Suichū1", "fr"=>"Eau 1", "de"=>"Wasser 1", "it"=>"Acqua 1", "es"=>"Agua 1"}}> generation6 = Oakdex::Pokedex::Generation.find('Generation VI') # => #<Oakdex::Pokedex::Generation:0x007fbc9b0382c0 @attributes={"number"=>6, "dex_name"=>"kalos_id", "names"=>{"en"=>"Generation VI", "de"=>"Generation VI"}, "games"=>[{"en"=>"X", "de"=>"X"}, {"en"=>"Y", "de"=>"Y"}, {"en"=>"Omega Ruby", "de"=>"Omega Rubin"}, {"en"=>"Alpha Sapphire", "de"=>"Alpha Saphir"}]}> bold = Oakdex::Pokedex::Nature.find('Bold') # => #<Oakdex::Pokedex::Nature:0x007fbc9a92b2c0 @attributes={"names"=>{"en"=>"Bold", "de"=>"Kühn"}, "increased_stat"=>"def", "decreased_stat"=>"atk", "favorite_flavor"=>"Sour", "disliked_flavor"=>"Spicy"}> Oakdex::Pokedex::Pokemon.all.size # => 802 Oakdex::Pokedex::Pokemon.where(type: 'Dark').size # => 46 Oakdex::Pokedex::Pokemon.where(egg_group: 'Human-Like').size # => 52 Oakdex::Pokedex::Pokemon.where(dex: 'alola').size # => 302 Oakdex::Pokedex::Pokemon.where(alola_id: 1) # => [#<Oakdex::Pokedex::Pokemon:0x007fbc9e542510 @attributes={"names"=>{"en"=>"Rowlet", "jp"=>"モクロー Mokuroh", "fr"=>"Brindibou", "es"=>"Rowlet", "de"=>"Bauz", "it"=>"Rowlet"}, "national_id"=>722, "alola_id"=>1, ...>] Oakdex::Pokedex::Move.where(type: 'Ground').size # => 26 ``` ### Javascript Install the package: ``` $ npm install oakdex-pokedex --save ``` Then you can use the library: ```js oakdexPokedex = require('oakdex-pokedex'); oakdexPokedex.findPokemon('Eevee', function(p) { // returns data/pokemon/eevee.json console.log(p.names.en); // Eeevee }); oakdexPokedex.findPokemon(4, function(p) { // returns data/pokemon/charmander.json console.log(p.names.en); // Charmander }); oakdexPokedex.findMove('Tackle', function(m) { // returns data/move/tackle.json console.log(m.names.en); // Tackle }); oakdexPokedex.findAbility('Contrary', function(a) { // returns data/ability/contrary.json console.log(a.names.en); // Contrary }); oakdexPokedex.findType('Fairy', function(t) { // returns data/type/fairy.json console.log(t.names.en); // Fairy }); oakdexPokedex.findEggGroup('Water 1', function(e) { // returns data/egg_group/water_1.json console.log(e.names.en); // Water 1 }); oakdexPokedex.findGeneration('Generation VI', function(g) { // returns data/generation/6.json console.log(g.names.en); // Generation VI }); oakdexPokedex.findNature('Bold', function(n) { // returns data/nature/bold.json console.log(n.names.en); // Bold }); oakdexPokedex.allPokemon(function(pokemon) { console.log(pokemon.length); // 802 }); oakdexPokedex.allPokemon({ type: 'Dark' }, function(pokemon) { console.log(pokemon.length); // 46 }); oakdexPokedex.allPokemon({ egg_group: 'Human-Like' }, function(pokemon) { console.log(pokemon.length); // 52 }); oakdexPokedex.allPokemon({ dex: 'alola' }, function(pokemon) { console.log(pokemon.length); // 302 }); oakdexPokedex.allMoves({ type: 'Ground' }, function(moves) { console.log(moves.length); // 26 }); ``` ### Schemas If you want to know what the structure of the given data is, checkout the following documentations: - [Pokemon](doc/pokemon.md) - [Move](doc/move.md) - [Ability](doc/ability.md) - [Type](doc/type.md) - [Egg Group](doc/egg_group.md) - [Nature](doc/nature.md) - [Generation](doc/generation.md) ### Sprites If you want also to include sprites in your pokedex, check out [oakdex-pokedex-sprites](https://github.com/jalyna/oakdex-pokedex-sprites). ## Contributing I would be happy if you want to add your contribution to the project. In order to contribute, you just have to fork this repository. ## License MIT License. See the included MIT-LICENSE file. ## Credits Logo Icon by [Roundicons Freebies](http://www.flaticon.com/authors/roundicons-freebies).
Java
import numpy as np import laspy as las # Determine if a point is inside a given polygon or not # Polygon is a list of (x,y) pairs. This function # returns True or False. The algorithm is called # the "Ray Casting Method". # the point_in_poly algorithm was found here: # http://geospatialpython.com/2011/01/point-in-polygon.html def point_in_poly(x,y,poly): n = len(poly) inside = False p1x,p1y = poly[0] for i in range(n+1): p2x,p2y = poly[i % n] if y > min(p1y,p2y): if y <= max(p1y,p2y): if x <= max(p1x,p2x): if p1y != p2y: xints = (y-p1y)*(p2x-p1x)/(p2y-p1y)+p1x if p1x == p2x or x <= xints: inside = not inside p1x,p1y = p2x,p2y return inside # This one is my own version of the ray-trace algorithm which utilises the numpy arrays so that a list of x and y coordinates can be processed in one call and only points inside polygon are returned alongside the indices in case required for future referencing. This saves a fair bit of looping. def points_in_poly(x,y,poly): n = len(poly) inside=np.zeros(x.size,dtype=bool) xints=np.zeros(x.size) p1x,p1y = poly[0] for i in range(n+1): p2x,p2y=poly[i % n] if p1y!=p2y: xints[np.all([y>min(p1y,p2y), y<=max(p1y,p2y), x<=max(p1x,p2x)],axis=0)] = (y[np.all([y>min(p1y,p2y), y<=max(p1y,p2y), x<=max(p1x,p2x)],axis=0)]-p1y)*(p2x-p1x)/(p2y-p1y)+p1x if p1x==p2x: inside[np.all([y>min(p1y,p2y), y<=max(p1y,p2y), x<=max(p1x,p2x)],axis=0)] = np.invert(inside[np.all([y>min(p1y,p2y), y<=max(p1y,p2y), x<=max(p1x,p2x)],axis=0)]) else: inside[np.all([y>min(p1y,p2y), y<=max(p1y,p2y), x<=max(p1x,p2x),x<=xints],axis=0)] = np.invert(inside[np.all([y>min(p1y,p2y), y<=max(p1y,p2y), x<=max(p1x,p2x),x<=xints],axis=0)]) p1x,p1y = p2x,p2y return x[inside],y[inside], inside # This retrieves all points within circular neighbourhood, Terget point is the location around which the neighbourhood search is conducted, for a specified search radius. x and y are vectors with the x and y coordinates of the test points def points_in_radius(x,y,target_x, target_y,radius): inside=np.zeros(x.size,dtype=bool) d2=(x-target_x)**2+(y-target_y)**2 inside = d2<=radius**2 return x[inside],y[inside], inside # filter lidar wth polygon # This function has been updated to include an option to filter by first return location. # The reason for this is so full collections of returns associated with each LiDAR pulse # can be retrieved, which can be an issue at edges in multi-return analyses def filter_lidar_data_by_polygon(in_pts,polygon,filter_by_first_return_location = False): pts = np.zeros((0,in_pts.shape[1])) if in_pts.shape[0]>0: if filter_by_first_return_location: # find first returns mask = in_pts[:,3]==1 x_temp, y_temp, inside_temp = points_in_poly(in_pts[mask,0],in_pts[mask,1],polygon) shots = np.unique(in_pts[mask,6][inside_temp]) # index 6 refers to GPS time inside = np.in1d(in_pts[:,6],shots) # this function retrieves all points corresponding to this GPS time x = in_pts[inside,0] y = in_pts[inside,1] x_temp=None y_temp=None inside_temp=None else: x,y,inside = points_in_poly(in_pts[:,0],in_pts[:,1],polygon) pts = in_pts[inside,:] else: print("\t\t\t no points in polygon") return pts # filter lidar by circular neighbourhood def filter_lidar_data_by_neighbourhood(in_pts,target_xy,radius): pts = np.zeros((0,in_pts.shape[1])) if in_pts.shape[0]>0: x,y,inside = points_in_radius(in_pts[:,0],in_pts[:,1],target_xy[0],target_xy[1],radius) pts = in_pts[inside,:] else: print( "\t\t\t no points in neighbourhood") return pts
Java
/* File: deref.h ** Author(s): Jiyang Xu, Terrance Swift, Kostis Sagonas ** Contact: xsb-contact@cs.sunysb.edu ** ** Copyright (C) The Research Foundation of SUNY, 1986, 1993-1998 ** Copyright (C) ECRC, Germany, 1990 ** ** XSB is free software; you can redistribute it and/or modify it under the ** terms of the GNU Library General Public License as published by the Free ** Software Foundation; either version 2 of the License, or (at your option) ** any later version. ** ** XSB 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 Library General Public License for ** more details. ** ** You should have received a copy of the GNU Library General Public License ** along with XSB; if not, write to the Free Software Foundation, ** Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** $Id: deref.h,v 1.13 2010-08-19 15:03:36 spyrosh Exp $ ** */ #ifndef __DEREF_H__ #define __DEREF_H__ /* TLS: Bao changed these derefs to handle attributed variables, since * a reference chain can, in principle, have a chain of var pointers * followed by a chain of attv pointers, ending in a free variable. * Actually, the code here is somewhat more general, and allows more * intermixture of attv and var pointers. So I may be wrong or the * code may be a little more general than it needs to be. * * XSB_Deref(op) is the same as XSB_CptrDeref(op) except that * XSB_CptrDeref(op) performs an explicit cast of op to a CPtr. */ #define XSB_Deref(op) XSB_Deref2(op,break) /* XSB_Deref2 is changed to consider attributed variables */ #define XSB_Deref2(op, stat) { \ while (isref(op)) { \ if (op == follow(op)) \ stat; \ op = follow(op); \ } \ while (isattv(op)) { \ if (cell((CPtr) dec_addr(op)) == dec_addr(op)) \ break; /* end of an attv */ \ else { \ op = cell((CPtr) dec_addr(op)); \ while (isref(op)) { \ if (op == follow(op)) \ stat; \ op = follow(op); \ } \ } \ } \ } #define XSB_CptrDeref(op) { \ while (isref(op)) { \ if (op == (CPtr) cell(op)) break; \ op = (CPtr) cell(op); \ } \ while (isattv(op)) { \ if (cell((CPtr) dec_addr(op)) == dec_addr(op)) \ break; \ else { \ op = (CPtr) cell((CPtr) dec_addr(op)); \ while (isref(op)) { \ if (op == (CPtr) cell(op)) break; \ op = (CPtr) cell(op); \ } \ } \ } \ } #define printderef(op) while (isref(op) && op > 0) { \ if (op==follow(op)) \ break; \ op=follow(op); } #endif /* __DEREF_H__ */
Java
// 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/>. /** * @package enrol_attributes * @author Julien Furrer <Julien.Furrer@unil.ch> * @copyright 2012-2015 Université de Lausanne (@link http://www.unil.ch} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ ; (function ($) { $.booleanEditor = { defaults: { rules: [], change: null }, paramList: M.enrol_attributes.paramList, operatorList: [ {label: " = ", value: "=="}, // {label: "=/=", value: "!="}, // {label: "contains", value: "contains"}, ] }; $.fn.extend({ booleanEditor: function (options) { var isMethodCall = (typeof options == 'string'), // is it a method call or booleanEditor instantiation ? args = Array.prototype.slice.call(arguments, 1); if (isMethodCall) switch (options) { case 'serialize': var mode = ( args[0] ) ? args[0].mode : '', ser_obj = serialize(this); switch (mode) { case 'json': return $.toJSON(ser_obj); break; case 'object': default: return ser_obj; } break; case 'getExpression': return getBooleanExpression(this); break; default: return; } settings = $.extend({}, $.booleanEditor.defaults, options); return this.each(function () { if (settings.change) { $(this).data('change', settings.change) } $(this) .addClass("enrol-attributes-boolean-editor") .append(createRuleList($('<ul></ul>'), settings.rules)); changed(this); }); } }); function serialize(root_elem) { var ser_obj = {rules: []}; var group_c_op = $("select:first[name='cond-operator']", root_elem).val(); if (group_c_op) ser_obj.cond_op = group_c_op; $("ul:first > li", root_elem).each(function () { r = $(this); if (r.hasClass('group')) { ser_obj['rules'].push(serialize(this)); } else { var cond_obj = { param: $("select[name='comparison-param'] option:selected", r).val(), comp_op: $("select[name='comparison-operator']", r).val(), value: $("input[name='value']", r).val() }; var cond_op = $("select[name='cond-operator']", r).val(); if (cond_op) cond_obj.cond_op = cond_op; ser_obj['rules'].push(cond_obj); } }); return ser_obj; } function getBooleanExpression(editor) { var expression = ""; $("ul:first > li", editor).each(function () { r = $(this); var c_op = $("select[name='cond-operator']", r).val(); if (c_op != undefined) c_op = '<span class="cond-op"> ' + c_op + ' </span>'; if (r.hasClass('group')) { expression += c_op + '<span class="group-op group-group">(</span>' + getBooleanExpression(this) + '<span class="group-op group-group">)</span>'; } else { expression += [ c_op, '<span class="group-op group-cond">(</span>', '<span class="comp-param">' + $("select[name='comparison-param'] option:selected", r).text() + '</span>', '<span class="comp-op"> ' + $("select[name='comparison-operator']", r).val() + ' </span>', '<span class="comp-val">' + '\'' + $("input[name='value']", r).val() + '\'' + '</span>', '<span class="group-op group-cond">)</span>' ].join(""); } }); return expression; } function changed(o) { $o = $(o); if (!$o.hasClass('enrol-attributes-boolean-editor')) { $o = $o.parents('.enrol-attributes-boolean-editor').eq(0); } if ($o.data('change')) { $o.data('change').apply($o.get(0)); } } function createRuleList(list_elem, rules) { //var list_elem = $(list_elem); if (list_elem.parent("li").eq(0).hasClass("group")) { console.log("inside a group"); return; } if (rules.length == 0) { // No rules, create a new one list_elem.append(getRuleConditionElement({first: true})); } else { // Read all rules for (var r_idx = 0; r_idx < rules.length; r_idx++) { var r = rules[r_idx]; r['first'] = (r_idx == 0); // If the rule is an array, create a group of rules if (r.rules && (typeof r.rules[0] == 'object')) { r.group = true; var rg = getRuleConditionElement(r); list_elem.append(rg); createRuleList($("ul:first", rg), r.rules); } else { list_elem.append(getRuleConditionElement(r)); } } } return list_elem; }; /** * Build the HTML code for editing a rule condition. * A rule is composed of one or more rule conditions linked by boolean operators */ function getRuleConditionElement(config) { config = $.extend({}, { first: false, group: false, cond_op: null, param: null, comp_op: null, value: '' }, config ); // If group flag is set, wrap content with <ul></ul>, content is obtained by a recursive call // to the function, passing a copy of config with flag group set to false var cond_block_content = $('<div class="sre-condition-box"></div>'); if (config.group) { cond_block_content.append('<ul></ul>'); } else { cond_block_content .append(makeSelectList({ // The list of parameters to be compared name: 'comparison-param', params: $.booleanEditor.paramList, selected_value: config.param }).addClass("comp-param")) .append($('<span>').addClass("comp-op").text('=')) // .append( makeSelectList({ // The comparison operator // name: 'comparison-operator', // params: $.booleanEditor.operatorList, // selected_value: config.comp_op // }).addClass("comp-op")) .append($('<input type="text" name="value" value="' + config.value + '"/>') .change(function () { changed(this) }) ); // The value of the comparions } var ruleConditionElement = $('<li></li>') .addClass((config.group) ? 'group' : 'rule') .append(createRuleOperatorSelect(config)) .append(cond_block_content) .append(createButtonPannel()) return ruleConditionElement; }; function createRuleOperatorSelect(config) { return (config.first) ? '' : makeSelectList({ 'name': 'cond-operator', params: [ {label: 'AND', value: 'and'}, {label: 'OR', value: 'or'} ], selected_value: config.cond_op }).addClass('sre-condition-rule-operator'); } function createButtonPannel() { var buttonPannel = $('<div class="button-pannel"></div>') .append($('<button type="button" class="button-add-cond">'+ M.util.get_string('addcondition', 'enrol_attributes') +'</button>') .click(function () { addNewConditionAfter($(this).parents('li').get(0)); }) ) .append($('<button type="button" class="button-add-group">'+ M.util.get_string('addgroup', 'enrol_attributes') +'</button>') .click(function () { addNewGroupAfter($(this).parents('li').get(0)); }) ) .append($('<button type="button" class="button-del-cond">'+ M.util.get_string('deletecondition', 'enrol_attributes') +'</button>') .click(function () { deleteCondition($(this).parents('li').eq(0)); }) ); $('button', buttonPannel).each(function () { $(this) .focus(function () { this.blur() }) .attr("title", $(this).text()) .wrapInner('<span/>'); }); return buttonPannel; } function makeSelectList(config) { config = $.extend({}, { name: 'list_name', params: [{label: 'label', value: 'value'}], selected_value: null }, config); var selectList = $('<select name="' + config.name + '"></select>') .change(function () { changed(this); }); $.each(config.params, function (i, p) { var p_obj = $('<option></option>') .attr({label: p.label, value: p.value}) .text(p.label); if (p.value == config.selected_value) { p_obj.attr("selected", "selected"); } p_obj.appendTo(selectList); }); return selectList; } // // -->> Conditions manipulation <<-- // function addNewConditionAfter(elem, config) { getRuleConditionElement(config) .hide() .insertAfter(elem) .fadeIn("normal", function () { changed(elem) }); } function addNewGroupAfter(elem, config) { getRuleConditionElement({group: true}) .hide() .insertAfter(elem) .find("ul:first") .append(getRuleConditionElement($.extend({}, config, {first: true}))) .end() .fadeIn("normal", function () { changed(elem) }); } /* * * Supprimer une condition : supprimer éventuellement le parent si dernier enfant, * mettre à jour le parent dans tous les cas. * */ function deleteCondition(elem) { if (elem.parent().parent().hasClass('enrol-attributes-boolean-editor')) { // Level 1 if (elem.siblings().length == 0) { return; } } else { // Higher level if (elem.siblings().length == 0) { // The last cond of the group, target the group itself, to be removed elem = elem.parents('li').eq(0); } } p = elem.parent(); elem.fadeOut("normal", function () { $(this).remove(); $("li:first .sre-condition-rule-operator", ".enrol-attributes-boolean-editor ul").remove(); changed(p); }); } })(jQuery);
Java
Gumbe is music content webapp that provide Sierra Leone to quickly access Salone music online. This app is build on # SoundRedux In an effort to learn es6 and [redux](https://github.com/rackt/redux), this is SoundRedux, a simple [Soundcloud](http://soundcloud.com) client See it in action at http://soundredux.io Uses [normalizr](https://github.com/gaearon/normalizr) 1. `npm install` 2. `npm run start` 3. visit `http://localhost:8080` Feedback, issues, etc. are more than welcome!
Java
from flask import json from unittest.mock import patch, Mock from urbansearch.gathering.indices_selector import IndicesSelector from urbansearch.server.main import Server from urbansearch.server import classify_documents from urbansearch.server.classify_documents import _join_workers from urbansearch.workers import Workers s = Server(run=False) @patch('urbansearch.server.classify_documents._join_workers') @patch.object(Workers, 'run_classifying_workers') @patch.object(IndicesSelector, 'run_workers') def test_download_indices_for_url(mock_rcw, mock_rw, mock_jw): with s.app.test_client() as c: resp = c.get('/api/v1/classify_documents/log_only?directory=test') assert mock_rcw.called assert mock_rw.called assert mock_jw.called @patch('urbansearch.server.classify_documents._join_workers') @patch.object(Workers, 'run_classifying_workers') @patch.object(IndicesSelector, 'run_workers') def test_classify_indices_to_db(mock_rcw, mock_rw, mock_jw): with s.app.test_client() as c: resp = c.get('/api/v1/classify_documents/to_database?directory=test') assert mock_rcw.called assert mock_rw.called assert mock_jw.called @patch('urbansearch.server.classify_documents._join_workers') @patch('urbansearch.server.classify_documents.db_utils') def test_classify_indices_to_db_no_connection(mock_db, mock_jw): mock_db.connected_to_db.return_value = False with s.app.test_client() as c: resp = c.get('/api/v1/classify_documents/to_database?directory=test') assert not mock_jw.called @patch('urbansearch.server.classify_documents._join_file_workers') @patch.object(Workers, 'run_classifying_workers') @patch.object(Workers, 'run_read_files_worker') def test_classify_textfiles_to_db(mock_rfw, mock_rw, mock_jw): classify_documents.classify_textfiles_to_db(0, 'test') assert mock_rfw.called assert mock_rw.called assert mock_jw.called @patch('urbansearch.server.classify_documents._join_workers') @patch('urbansearch.server.classify_documents.db_utils') def test_classify_textfiles_to_db_no_connection(mock_db, mock_jw): mock_db.connected_to_db.return_value = False classify_documents.classify_textfiles_to_db(0, None) assert not mock_jw.called def test_join_workers(): producers = [Mock()] cworker = Mock() consumers = [Mock()] classify_documents._join_workers(cworker, producers, consumers) for p in producers: assert p.join.called assert cworker.set_producers_done.called for c in consumers: assert c.join.called assert cworker.clear_producers_done.called def test_join_file_workers(): producers = [Mock()] cworker = Mock() consumers = [Mock()] classify_documents._join_file_workers(cworker, producers, consumers) for p in producers: assert p.join.called assert cworker.set_file_producers_done.called for c in consumers: assert c.join.called assert cworker.clear_file_producers_done.called
Java
/* Camera Functionality Library OpenMoco MoCoBus Core Libraries See www.dynamicperception.com for more information (c) 2008-2012 C.A. Church / Dynamic Perception LLC 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 OM_CAMERA_H #define OM_CAMERA_H #include <inttypes.h> // default pin assignments (nanomoco) #define OM_DEFSHUTTER1 9 // Trigger 1 pin #define OM_DEFSHUTTER2 8 // Trigger 2 pin #define OM_DEFFOCUS1 11 // Focus 1 pin #define OM_DEFFOCUS2 10 // Focus 2 pin // callback status codes #define OM_CAMEXP 1 // Camera exposure has begun #define OM_CAM_EFIN 2 // Camera exposure has completed #define OM_CAMFOC 3 // Camera focus has begun #define OM_CAM_FFIN 4 // Camera focus has completed #define OM_CAMWAIT 5 // (Exposure) delay has begun #define OM_CAM_WFIN 6 // (Exposure) delay has completed #define OM_CAM_INCLR 0 // Camera action is cleared #define OM_CAM_INEXP 1 // Camera is currently exposing #define OM_CAM_INFOC 2 // Camera is currently focusing #define OM_CAM_INDLY 3 // Camera is currently idle /** @brief Camera Action Manager The Caamera Action Manager class controls a camera's focus and shutter lines, given that these lines are attached to an arduino device via an optocoupler or similar device. The focus and shutter lines are driven HIGH to trigger the given action. All actions performed by the Camera Action Manager are non-blocking, and this library uses the MsTimer2 library to achieve this. For this reason, you may only have one such object instantiated in your program, and under no circumstances should you attempt to use MsTimer2 in another part of your program while a camera action is being performed. Status reporting from the Camera Manager is handled via a callback function, which you may specify. This function will be called at the beginning and completion of any action with a special code to indicate the status. For more information on this, see setHandler(). The default pins for the shutter and focus are 13 and 12, respectively. You may, however specify the shutter and focus pins via the constructor. Example: @code // note: You -always- have to include the MSTimer2 library in an arduino // sketch before including the OMCamera header #include "MsTimer2.h" #include "OMCamera.h" OMCamera Camera = OMCamera(); void setup() { Camera.setHandler(camCallBack); Serial.begin(19200); } void loop() { if( ! Camera.busy() ) { // camera is not busy doing anything, so we're ready to // start another cycle Serial.println("Round Begin, Triggering Focus"); Camera.focus(1000); } } void camCallBack(byte code) { switch(code) { case OM_CAM_FFIN: // focus finish code received Serial.println("Focus Done, Triggering Exposure"); // trigger an exposure Camera.expose(1000); break; case OM_CAM_EFIN: // exposure finish code received Serial.println("Exposure Done, Waiting."); // wait (non-blocking wait implemented via timer2) for 10 seconds Camera.wait(10000); break; case OM_CAM_WFIN: // wait finish code received // we do nothing, because this is the end of a sshot cycle - // the main loop will pick up again witth focus, because the // camera will no longer register as busy. Serial.println("Wait Done, Round Complete"); Serial.println(""); break; } } @endcode @author C. A. Church (c) 2011 C. A. Church / Dynamic Perception 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/>. */ class OMCamera { private: unsigned long m_shotsFired; static uint8_t m_shutter1; static uint8_t m_shutter2; static uint8_t m_focus1; static uint8_t m_focus2; unsigned long m_interval; // Camera interval in milliseconds unsigned long m_timeExp; unsigned int m_timeFoc; unsigned int m_timeWait; unsigned int m_maxShots; bool m_focusShut; static bool m_debug; static uint8_t m_curAct; static bool m_isBzy; static void(*f_camSignal)(uint8_t); void _init(); public: OMCamera(); OMCamera(uint8_t c_shut, uint8_t c_foc); static bool busy(); void setHandler(void(*)(uint8_t)); void setMaxShots(unsigned int shots); unsigned int getMaxShots(); bool repeat; bool enable; void intervalTime(unsigned long p_interval); unsigned long intervalTime(); void expose(); void expose(unsigned long p_time); void triggerTime(unsigned long p_tm); unsigned long triggerTime(); void exposureFocus(bool); uint8_t exposureFocus(); void focus(); void focus(unsigned int p_time); void focusTime(unsigned int p_tm); unsigned int focusTime(); void wait(); void wait(unsigned int p_time); void delayTime(unsigned int p_tm); unsigned int delayTime(); static void stop(); static void debugOutput(bool p_state); static bool debugOutput(); }; #endif
Java
##Computer Science project: SoccerStars To play, clone this repository or download the zip and unzip it on your computer. Then compile the files and launch the EcranAccueil class (*java EcranAccueil*). If you have a custom puck done for you (if you're a SCAN student mainly) enter your first name. For example, try *yassine* and *horia*. **Team members :** Horia Burca, Guilhem Dupuy, Vincent Garcia, Yassine Zouggari **Supervized by :** Yassine Zouggari (yzoug on GitHub) ![Image of the original game](http://i.imgur.com/Tchcfxw.jpg) ###Aim of the project: This project consist in creating a game similar to SoccerStars: a famous Android and iOS application. To get a grip of it, you can either download the application on a compatible mobile device or head to the website of the editor: [try the original SoccerStars](http://www.miniclip.com/games/soccer-stars-mobile/fr/). As suggested by the title, the *goal* of the players is the score against the opponent, like in a soccer game. To do so, you have 5 pucks at your disposal, on your side of the field: they consitute your team. In addition, there also is an 11th object, the soccer ball. The first team to push the ball inside the opponent's goal scores, and the first team that scores 2 times wins. The pucks and the goal bounce at the limits of the field and can't hence leave the boundaries. Alternately, each player will launch one of his pucks using his mouse, which will determine the direction in which it will be thrown. Depending on the distance between the first click and to position of the cursor when released, the puck will be assigned a proportional velocity. If the puck hits another puck or the ball, both displacements will be modified (their magnitude and direction). When the puck hits the field limit, it will change trajectory as would a light beam in Optics when reflected. The players hence use the bounces to their advantage, either to try and score, or the move the pucks of the opponent to disturb his attempts, or to defend their own goal. ### Main issues which had to be dealt with : While coding our program, we mainly faced the following problems: 1. First of all, our field had to be delimited, on the graphical point of vue (which means that these limits should appear clearly to the users), but also limited with respect to the pucks and the ball: they never leave the field and always stay inside it. 2. Then, as the aim of our project is to program an arcade game, we had to make clear for each player what is going on in the game (who scored, who’s playing on which side, etc …) 3. The displacement of all our elements (which means of our 10 pucks and the ball) had to be taken care of 4. Probably the hardest part of our project, we had to figure out a way to implement rebounds in order to be as realistic as possible. This means the collisions had to impact the displacements in a realistic way, but without trying to simulate them exactly as their happen in real life. We also had to differentiate how they happen when the ball is hit, versus when two pucks enter in contact with one another. 5. We tried to code the program following the general POO guidelines (private attributes, factorization of the code etc) and a big effort was made to make the code as legible as possible and as compact as possible. ### How did we face these issues ? * The first two problems were solved simply using IHM; indeed, we used a background image in order to indicate to the players were the field was, and we mesured it (pixel-wise) to find the actual limits of the field. Then, using the usual Graphics tools (*drawString(String a)*), we displayed the score. What took us the longest time is the precise positioning of each element, and the creation of all the graphics of the game: pucks at the right size, field modified to suit our needs for example. We had to use graphical softwares (GIMP mostly, or when possible, Paint) to achieve this. * In order to make sure that all our objects (ball + pucks) stay inside our field at all times, we implemented rebounds on the extremities of our field (knowing their exact position). This was done inside the move() method, inside our abstract class *PaletAndBall* (see the part dealing with the hierarchy of our different objects). * In order to implement the displacement of our objects (3), we tried to stay as simple as possible and only used 2 values, that were sufficient in order to simulate a standard mathematical vector, and hence allowing us to do basic trigonometry and mechanics for our displacements. Those two attributes of *PaletAndBall* are the direction and the speed, defined as doubles. The change of those variables is done with the mouse by the user, when he clicks and drags his mouse: we used *mousePressed* and *mouseReleased*, with a *MouseListener*. * The most challenging part of our project was the rebounds (4). In order to solve this issue, we tried to adapt physical models to our program. We tried not to spend too much time on this, as it relied more on (complicated) Mechanics than on Computer Science but it was still a major part of our project. We used a *collision(PaletAndBall p)* method implemented inside our abstract *PaletAndBall* class. This method is called by our *actionPerformed* method (that itself is call by a Swing Timer) on each object (puck or ball) that is moving. It checks, after each displacement, if the new position of the puck enters in contact with another object, and if that's true, it first moves the puck back up until it no longer is **above** the other object, then changes the directions and speeds of both objects accordingly. * We also had to face a major and unexpected issue; indeed, our pucks were moving too quick for our timer calling the *collision* method every 50ms. Due to this, our objects were often overlapping each other despite the precautions we took (explained just above), which was sometimes resulting in non-existing rebounds (pucks were sometimes going through other objects without bouncing against them). Some small tweaks on our *collision* method, and a lower limit for the maximum speed of our objects (from 200 to 100) were sufficient for compeletly solving this, but took us quite some time debugging. ### Bibliography: Two resources were needed during our work on this project: the [javadoc](https://docs.oracle.com/javase/7/docs/api/) mainly, and the Asteroids TP we did in class: the code we wrote for that TP helped us with some similar code that had to be written for our game (buffers, images etc). We also relied on our Mechanics textbook to come up with a simple collisions model, mainly concerning the changes in direction. ### Organization of our program: Her is the complete list of the different objects we used : * An abstract class named *PaletAndBall*. As its name suggests, it is divided in 2 child classes : * public *Ball* * public *Palet* We found the creation of such a class usefull in order to optimize the space occupied by our program; indeed, “Ball” and “Palet” objects share lots of common methods and attributes. In order to be able to know if our *PaletAndBall* object is a ball or a puck, we implemented the abstract isBall method, which returns a boolean. This is because throughout the game, we manipulate an *objects* variable that is an array containing ten pucks and a ball, hence we actually never know if we have a puck or a ball without using this method. * A public class named *Jeu*, child class of a JFrame, whcih implements an *ActionListener* (used for our Timer) and a *MouseListener* (used by the players when they set the speed and direction of one of their pucks). * A public *EcranAccueil* class, child class of a JFrame which implements an *ActionListener*. This listener is used in order to detect when the players click on the ball, which launches a new game. You can also choose the name of your team in the two JTextField. If the name correspond to one of the puck we have in the folder *images/*, you will have a special kind of puck. * A public class named *EcranFinal* child class of a JFrame is launched when someone wins, i.e. when someone score two times. This class implements an *ActionListener*, you can go back tothe menu or replay the game with the same team names. * A public class named *SoundClip*, which deals with the audio part of our program (music played during the game and while our *EcranAccueil* is displayed) ### Enhancement ideas : In our opinion, the main problem of our program is the sometimes non-realistic rebounds. Some extra work could be done in order to find better physical models, which would enhance the gameplay. Furthermore, we could also add posts to each side of our goals, which would make the rebounds on the side of the goals more interesting. This could be quite easily done by creating a non-moving *PaletAndBall* object. We didn’t realize this on our program as the use of a drawing software like Paint, Photoshop or GIMP is very time-consuming and not very interesting in terms of Computer Science. Some animation could be added when one of the players scores, once again in order to enhance the gameplay quality. Finally, the big enhancement idea (that Yassine will still work on even after the end of the project) is playing online. However, at INSA, the Internet access we have is behind a firewall that blocks all ports (except a few reserved ones). That's why for example it's impossible to use Steam or IRC clients from our homes. This made the writing of the server-side client-side of the code a lot harder, since I simply couldn't test if it was working or not. If I manage to find a solution it'll be possible to play our game over the web (I even have a server that can do the connection). ### Planning The actual way our project happened, the whole day-to-day changes are all available on GitHub: simply look at the [commits](https://github.com/yzoug/soccer-stars-clone/commits/master). However, we also had an initial planning that we hence didn't follow at the letter, but it's amusing to see how priorities shift when we actually start working on the project versus simply planning it. If you want to compare what happened and what we planned, here it is: 11/12/2015 : * Study the mechanics aspects of the game. * Create the objects Puck and Ball. * Beginning the IHM part of the project. 18/12/2015 : * Finish the IHM of the game (field + puck + ball). * Try to throw a puck on the field. * Try to integrate the mechanics aspects to the programme. 06/101/2015 : * Finish the throwing of the puck on the field. * Continue to integrate the mechanics aspects. * From now on, we were able to play a game (with lots of bugs thow). 13/01/2015 : * The finishing of each aspect of the programme were made. * We added customizable pucks (with pictures of some students of the class and even some of our teachers available)
Java
/* Copyright (C) 2014-2019 de4dot@gmail.com This file is part of dnSpy dnSpy 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. dnSpy 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 dnSpy. If not, see <http://www.gnu.org/licenses/>. */ using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.Composition; using System.Diagnostics; using System.Linq; using dnSpy.Contracts.Debugger; using dnSpy.Contracts.Debugger.Breakpoints.Code; using dnSpy.Contracts.Debugger.Code; using dnSpy.Debugger.Impl; namespace dnSpy.Debugger.Breakpoints.Code { abstract class DbgCodeBreakpointsService2 : DbgCodeBreakpointsService { public abstract void UpdateIsDebugging_DbgThread(bool newIsDebugging); public abstract DbgBoundCodeBreakpoint[] AddBoundBreakpoints_DbgThread(IList<DbgBoundCodeBreakpoint> boundBreakpoints); public abstract void RemoveBoundBreakpoints_DbgThread(IList<DbgBoundCodeBreakpoint> boundBreakpoints); public abstract DbgBoundCodeBreakpoint[] RemoveBoundBreakpoints_DbgThread(DbgRuntime runtime); } [Export(typeof(DbgCodeBreakpointsService))] [Export(typeof(DbgCodeBreakpointsService2))] sealed class DbgCodeBreakpointsServiceImpl : DbgCodeBreakpointsService2 { readonly object lockObj; readonly HashSet<DbgCodeBreakpointImpl> breakpoints; readonly Dictionary<DbgCodeLocation, DbgCodeBreakpointImpl> locationToBreakpoint; readonly DbgDispatcherProvider dbgDispatcherProvider; int breakpointId; bool isDebugging; public override event EventHandler<DbgBoundBreakpointsMessageChangedEventArgs> BoundBreakpointsMessageChanged; internal DbgDispatcherProvider DbgDispatcher => dbgDispatcherProvider; [ImportingConstructor] DbgCodeBreakpointsServiceImpl(DbgDispatcherProvider dbgDispatcherProvider, [ImportMany] IEnumerable<Lazy<IDbgCodeBreakpointsServiceListener>> dbgCodeBreakpointsServiceListener) { lockObj = new object(); breakpoints = new HashSet<DbgCodeBreakpointImpl>(); locationToBreakpoint = new Dictionary<DbgCodeLocation, DbgCodeBreakpointImpl>(); this.dbgDispatcherProvider = dbgDispatcherProvider; breakpointId = 0; isDebugging = false; foreach (var lz in dbgCodeBreakpointsServiceListener) lz.Value.Initialize(this); } void Dbg(Action callback) => dbgDispatcherProvider.Dbg(callback); public override void Modify(DbgCodeBreakpointAndSettings[] settings) { if (settings is null) throw new ArgumentNullException(nameof(settings)); Dbg(() => ModifyCore(settings)); } void ModifyCore(DbgCodeBreakpointAndSettings[] settings) { dbgDispatcherProvider.VerifyAccess(); List<DbgCodeBreakpointImpl>? updatedBreakpoints = null; var bps = new List<DbgCodeBreakpointAndOldSettings>(settings.Length); lock (lockObj) { foreach (var info in settings) { var bpImpl = info.Breakpoint as DbgCodeBreakpointImpl; Debug.Assert(!(bpImpl is null)); if (bpImpl is null) continue; Debug.Assert(breakpoints.Contains(bpImpl)); if (!breakpoints.Contains(bpImpl)) continue; var currentSettings = bpImpl.Settings; if (currentSettings == info.Settings) continue; bps.Add(new DbgCodeBreakpointAndOldSettings(bpImpl, currentSettings)); if (bpImpl.WriteSettings_DbgThread(info.Settings)) { if (updatedBreakpoints is null) updatedBreakpoints = new List<DbgCodeBreakpointImpl>(settings.Length); updatedBreakpoints.Add(bpImpl); } } } if (bps.Count > 0) BreakpointsModified?.Invoke(this, new DbgBreakpointsModifiedEventArgs(new ReadOnlyCollection<DbgCodeBreakpointAndOldSettings>(bps))); if (!(updatedBreakpoints is null)) { foreach (var bp in updatedBreakpoints) bp.RaiseBoundBreakpointsMessageChanged_DbgThread(); BoundBreakpointsMessageChanged?.Invoke(this, new DbgBoundBreakpointsMessageChangedEventArgs(new ReadOnlyCollection<DbgCodeBreakpoint>(updatedBreakpoints.ToArray()))); } } public override event EventHandler<DbgBreakpointsModifiedEventArgs> BreakpointsModified; public override event EventHandler<DbgCollectionChangedEventArgs<DbgCodeBreakpoint>> BreakpointsChanged; public override DbgCodeBreakpoint[] Breakpoints { get { lock (lockObj) return breakpoints.ToArray(); } } public override DbgCodeBreakpoint[] Add(DbgCodeBreakpointInfo[] breakpoints) { if (breakpoints is null) throw new ArgumentNullException(nameof(breakpoints)); var bpImpls = new List<DbgCodeBreakpointImpl>(breakpoints.Length); List<DbgObject>? objsToClose = null; lock (lockObj) { for (int i = 0; i < breakpoints.Length; i++) { var info = breakpoints[i]; var location = info.Location; if (locationToBreakpoint.ContainsKey(location)) { if (objsToClose is null) objsToClose = new List<DbgObject>(); objsToClose.Add(location); } else { var bp = new DbgCodeBreakpointImpl(this, breakpointId++, info.Options, location, info.Settings, isDebugging); bpImpls.Add(bp); } } Dbg(() => AddCore(bpImpls, objsToClose)); } return bpImpls.ToArray(); } void AddCore(List<DbgCodeBreakpointImpl> breakpoints, List<DbgObject>? objsToClose) { dbgDispatcherProvider.VerifyAccess(); var added = new List<DbgCodeBreakpoint>(breakpoints.Count); List<DbgCodeBreakpointImpl>? updatedBreakpoints = null; lock (lockObj) { foreach (var bp in breakpoints) { Debug.Assert(!this.breakpoints.Contains(bp)); if (this.breakpoints.Contains(bp)) continue; if (locationToBreakpoint.ContainsKey(bp.Location)) { if (objsToClose is null) objsToClose = new List<DbgObject>(); objsToClose.Add(bp); } else { added.Add(bp); this.breakpoints.Add(bp); locationToBreakpoint.Add(bp.Location, bp); if (bp.WriteIsDebugging_DbgThread(isDebugging)) { if (updatedBreakpoints is null) updatedBreakpoints = new List<DbgCodeBreakpointImpl>(breakpoints.Count); updatedBreakpoints.Add(bp); } } } } if (!(objsToClose is null)) { foreach (var obj in objsToClose) obj.Close(dbgDispatcherProvider.Dispatcher); } if (added.Count > 0) BreakpointsChanged?.Invoke(this, new DbgCollectionChangedEventArgs<DbgCodeBreakpoint>(added, added: true)); if (!(updatedBreakpoints is null)) { foreach (var bp in updatedBreakpoints) bp.RaiseBoundBreakpointsMessageChanged_DbgThread(); BoundBreakpointsMessageChanged?.Invoke(this, new DbgBoundBreakpointsMessageChangedEventArgs(new ReadOnlyCollection<DbgCodeBreakpoint>(updatedBreakpoints.ToArray()))); } } public override void Remove(DbgCodeBreakpoint[] breakpoints) { if (breakpoints is null) throw new ArgumentNullException(nameof(breakpoints)); Dbg(() => RemoveCore(breakpoints)); } void RemoveCore(DbgCodeBreakpoint[] breakpoints) { dbgDispatcherProvider.VerifyAccess(); var removed = new List<DbgCodeBreakpoint>(breakpoints.Length); lock (lockObj) { foreach (var bp in breakpoints) { var bpImpl = bp as DbgCodeBreakpointImpl; Debug.Assert(!(bpImpl is null)); if (bpImpl is null) continue; if (!this.breakpoints.Contains(bpImpl)) continue; removed.Add(bpImpl); this.breakpoints.Remove(bpImpl); bool b = locationToBreakpoint.Remove(bpImpl.Location); Debug.Assert(b); } } if (removed.Count > 0) { BreakpointsChanged?.Invoke(this, new DbgCollectionChangedEventArgs<DbgCodeBreakpoint>(removed, added: false)); foreach (var bp in removed) bp.Close(dbgDispatcherProvider.Dispatcher); } } public override DbgCodeBreakpoint? TryGetBreakpoint(DbgCodeLocation location) { if (location is null) throw new ArgumentNullException(nameof(location)); lock (lockObj) { if (locationToBreakpoint.TryGetValue(location, out var bp)) return bp; } return null; } public override void Clear() => Dbg(() => RemoveCore(VisibleBreakpoints.ToArray())); public override void UpdateIsDebugging_DbgThread(bool newIsDebugging) { dbgDispatcherProvider.VerifyAccess(); List<DbgCodeBreakpointImpl> updatedBreakpoints; lock (lockObj) { if (isDebugging == newIsDebugging) return; isDebugging = newIsDebugging; updatedBreakpoints = new List<DbgCodeBreakpointImpl>(breakpoints.Count); foreach (var bp in breakpoints) { bool updated = bp.WriteIsDebugging_DbgThread(isDebugging); if (updated) updatedBreakpoints.Add(bp); } } foreach (var bp in updatedBreakpoints) bp.RaiseBoundBreakpointsMessageChanged_DbgThread(); if (updatedBreakpoints.Count > 0) BoundBreakpointsMessageChanged?.Invoke(this, new DbgBoundBreakpointsMessageChangedEventArgs(new ReadOnlyCollection<DbgCodeBreakpoint>(updatedBreakpoints.ToArray()))); } public override DbgBoundCodeBreakpoint[] AddBoundBreakpoints_DbgThread(IList<DbgBoundCodeBreakpoint> boundBreakpoints) { dbgDispatcherProvider.VerifyAccess(); var dict = CreateBreakpointDictionary(boundBreakpoints); var updatedBreakpoints = new List<(bool raiseMessageChanged, DbgCodeBreakpointImpl breakpoint, List<DbgBoundCodeBreakpoint> boundBreakpoints)>(dict.Count); List<DbgBoundCodeBreakpoint>? unusedBoundBreakpoints = null; lock (lockObj) { foreach (var kv in dict) { var bp = kv.Key; if (breakpoints.Contains(bp)) { bool raiseMessageChanged = bp.AddBoundBreakpoints_DbgThread(kv.Value); updatedBreakpoints.Add((raiseMessageChanged, bp, kv.Value)); } else { if (unusedBoundBreakpoints is null) unusedBoundBreakpoints = new List<DbgBoundCodeBreakpoint>(); unusedBoundBreakpoints.AddRange(kv.Value); } } } foreach (var info in updatedBreakpoints) info.breakpoint.RaiseEvents_DbgThread(info.raiseMessageChanged, info.boundBreakpoints, added: true); if (updatedBreakpoints.Count > 0) BoundBreakpointsMessageChanged?.Invoke(this, new DbgBoundBreakpointsMessageChangedEventArgs(new ReadOnlyCollection<DbgCodeBreakpoint>(updatedBreakpoints.Where(a => a.raiseMessageChanged).Select(a => a.breakpoint).ToArray()))); return unusedBoundBreakpoints?.ToArray() ?? Array.Empty<DbgBoundCodeBreakpoint>(); } public override void RemoveBoundBreakpoints_DbgThread(IList<DbgBoundCodeBreakpoint> boundBreakpoints) { dbgDispatcherProvider.VerifyAccess(); var dict = CreateBreakpointDictionary(boundBreakpoints); var updatedBreakpoints = new List<(bool raiseMessageChanged, DbgCodeBreakpointImpl breakpoint, List<DbgBoundCodeBreakpoint> boundBreakpoints)>(dict.Count); lock (lockObj) { foreach (var kv in dict) { var bp = kv.Key; if (breakpoints.Contains(bp)) { bool raiseMessageChanged = bp.RemoveBoundBreakpoints_DbgThread(kv.Value); updatedBreakpoints.Add((raiseMessageChanged, bp, kv.Value)); } } } foreach (var info in updatedBreakpoints) info.breakpoint.RaiseEvents_DbgThread(info.raiseMessageChanged, info.boundBreakpoints, added: false); if (updatedBreakpoints.Count > 0) BoundBreakpointsMessageChanged?.Invoke(this, new DbgBoundBreakpointsMessageChangedEventArgs(new ReadOnlyCollection<DbgCodeBreakpoint>(updatedBreakpoints.Where(a => a.raiseMessageChanged).Select(a => a.breakpoint).ToArray()))); } static Dictionary<DbgCodeBreakpointImpl, List<DbgBoundCodeBreakpoint>> CreateBreakpointDictionary(IList<DbgBoundCodeBreakpoint> boundBreakpoints) { int count = boundBreakpoints.Count; var dict = new Dictionary<DbgCodeBreakpointImpl, List<DbgBoundCodeBreakpoint>>(count); for (int i = 0; i < boundBreakpoints.Count; i++) { var bound = boundBreakpoints[i]; var bpImpl = bound.Breakpoint as DbgCodeBreakpointImpl; Debug.Assert(!(bpImpl is null)); if (bpImpl is null) continue; if (!dict.TryGetValue(bpImpl, out var list)) dict.Add(bpImpl, list = new List<DbgBoundCodeBreakpoint>()); list.Add(bound); } return dict; } public override DbgBoundCodeBreakpoint[] RemoveBoundBreakpoints_DbgThread(DbgRuntime runtime) { dbgDispatcherProvider.VerifyAccess(); var list = new List<DbgBoundCodeBreakpoint>(); lock (lockObj) { foreach (var bp in breakpoints) { foreach (var boundBreakpoint in bp.BoundBreakpoints) { if (boundBreakpoint.Runtime == runtime) list.Add(boundBreakpoint); } } } var res = list.ToArray(); RemoveBoundBreakpoints_DbgThread(res); return res; } internal void OnBoundBreakpointsMessageChanged_DbgThread(DbgCodeBreakpointImpl bp) { dbgDispatcherProvider.VerifyAccess(); bp.RaiseBoundBreakpointsMessageChanged_DbgThread(); BoundBreakpointsMessageChanged?.Invoke(this, new DbgBoundBreakpointsMessageChangedEventArgs(new ReadOnlyCollection<DbgCodeBreakpoint>(new[] { bp }))); } } }
Java
#-*- coding:utf-8 -*- from findbilibili import * #funtion name [checkinfo] #判断要输出的回答 #param array 抓取的文字 #return string 回答 def checkinfo2(content): content[1] = content[1].decode('gbk') key = content[1].encode('utf-8') if key == '节操': return '这种东西早就没有了' result = animation(key) #搜动漫 return result #funtion name [animation] #搜索动漫 #param array 动漫名字 #return string 最后更新网址 def animation(name): url = bilibili(name) try: result = 'bilibili最后更新:第'+url[-1][0]+'集'+url[-1][1] return result except IndexError: return '什么都找不到!'
Java
# umte #### "uber minimal text editor" A lightweight python gtk3 text editor. ![screenshot](http://i.imgur.com/Yi44g.png) ## Features * Basic text editor functionality * Syntax highlighting * Line numbers * (in progress)Terminal bottom-window ## Requirements * *Python 3.1 or higher* * Gtk3 shtuff
Java
<? // If the form told us to generate a route or if this was a pending entry, re-generate a route. if ($data[$key] == "generate" || (isset($edit_id) && !is_numeric($edit_id))) { if ($options["not_unique"]) { $value = $cms->urlify(strip_tags($data[$options["source"]])); } else { $oroute = $cms->urlify(strip_tags($data[$options["source"]])); $value = $oroute; $x = 2; while (sqlrows(sqlquery("SELECT * FROM `".$form["table"]."` WHERE `$key` = '".sqlescape($value)."' AND id != '".sqlescape($_POST["id"])."'"))) { $value = $oroute."-".$x; $x++; } } } else { $no_process = true; } ?>
Java
@echo off del /q res_mods\xvm\res\clanicons\RU\nick\programist434.png del /q res_mods\xvm\res\clanicons\RU\nick\Morozochka.png del /q res_mods\xvm\res\clanicons\RU\nick\gipof1s.png
Java
# Network-Stream-Daemon
Java
/** * */ package qa.AnswerFormation; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Queue; import qa.IQuestion; import qa.Utility; /** * @author Deepak * */ public class AnswerGenerator implements IAnswerGenerator { /** * * @param processedQuestionsQueue */ public AnswerGenerator(Queue<IQuestion> processedQuestionsQueue, List<IQuestion> processedQuestions) { this.processedQuestionsQueue = processedQuestionsQueue; this.processedQuestions = processedQuestions; } /** * */ @Override public void run() { while(!processedQuestionsQueue.isEmpty() || !Utility.IsPassageRetrivalDone) { IQuestion question = processedQuestionsQueue.poll(); if(question == null) continue; HashSet<String> answers = new HashSet<String>(); for(String passage : question.getRelevantPassages()) { List<String> output = new ArrayList<String>(); String passageWithoutKeywords = null; String nerTaggedPassage = Utility.getNERTagging(passage); String posTaggedPassage = Utility.getPOSTagging(passage); output.addAll(getDataFromOutput(nerTaggedPassage, question.getAnswerTypes())); output.addAll(getDataFromOutput(posTaggedPassage, question.getAnswerTypes())); for(String answer : output) { if(!question.getQuestion().toLowerCase().contains(answer.toLowerCase()) && !answers.contains(answer)) { answers.add(answer); passageWithoutKeywords = Utility.removeKeywords(answer, question.getKeywords()); question.addAnswer(passageWithoutKeywords); } } } for(String passage : question.getRelevantPassages()) { List<String> output = new ArrayList<String>(); String passageWithoutKeywords = null; if(answers.size() >= 10) break; try{ output.addAll(Utility.getNounPhrases(passage, false)); } catch (Exception ex) { System.out.println(ex.getMessage()); } for(String answer : output) { if(!question.getQuestion().toLowerCase().contains(answer.toLowerCase()) && !answers.contains(answer)) { answers.add(answer); passageWithoutKeywords = Utility.removeKeywords(answer, question.getKeywords()); question.addAnswer(passageWithoutKeywords); } } } // for(String answer : answers) { // boolean flag = true; // for(String answer1 : answers) { // if(!answer.equals(answer1)) { // if(answer1.toLowerCase().contains(answer.toLowerCase())) { // flag = false; // break; // } // } // } // if(flag) { // question.addAnswer(answer); // } // } this.processedQuestions.add(question); } AnswerWriter writer = new AnswerWriter("answer.txt"); writer.writeAnswers(processedQuestions); } /** * * @param output * @param tagName * @return */ private List<String> getDataFromOutput(String output, String tagName) { List<String> answers = new ArrayList<String>(); StringBuilder temp = new StringBuilder(); String[] outputArray = output.split("[/_\\s]"); String[] tags = tagName.split("\\|"); for(String tag : tags) { if(tag == null || tag.equals("")) continue; String[] tagsArray = tag.split(":"); for(int arrayIndex = 1; arrayIndex < outputArray.length; arrayIndex+=2) { if(outputArray[arrayIndex].trim().equals(tagsArray[1].trim())) { temp.append(outputArray[arrayIndex - 1] + " "); } else { if(!temp.toString().equals("")) { answers.add(temp.toString().trim()); } temp = new StringBuilder(); } } if(!temp.toString().equals("") ) { answers.add(temp.toString().trim()); } } return answers; } /** * */ private Queue<IQuestion> processedQuestionsQueue; private List<IQuestion> processedQuestions; }
Java
/* gbp-flatpak-runner.h * * Copyright 2016-2019 Christian Hergert <chergert@redhat.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/>. * * SPDX-License-Identifier: GPL-3.0-or-later */ #pragma once #include <libide-foundry.h> G_BEGIN_DECLS #define GBP_TYPE_FLATPAK_RUNNER (gbp_flatpak_runner_get_type()) G_DECLARE_FINAL_TYPE (GbpFlatpakRunner, gbp_flatpak_runner, GBP, FLATPAK_RUNNER, IdeRunner) GbpFlatpakRunner *gbp_flatpak_runner_new (IdeContext *context, const gchar *build_path, IdeBuildTarget *build_target, const gchar *manifest_command); G_END_DECLS
Java
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_25) on Wed Feb 01 21:06:23 MST 2012 --> <TITLE> API Help </TITLE> <META NAME="date" CONTENT="2012-02-01"> <LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="API Help"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Help</B></FONT>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="index.html?help-doc.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="help-doc.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H1> How This API Document Is Organized</H1> </CENTER> This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.<H3> Overview</H3> <BLOCKQUOTE> <P> The <A HREF="overview-summary.html">Overview</A> page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.</BLOCKQUOTE> <H3> Package</H3> <BLOCKQUOTE> <P> Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:<UL> <LI>Interfaces (italic)<LI>Classes<LI>Enums<LI>Exceptions<LI>Errors<LI>Annotation Types</UL> </BLOCKQUOTE> <H3> Class/Interface</H3> <BLOCKQUOTE> <P> Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:<UL> <LI>Class inheritance diagram<LI>Direct Subclasses<LI>All Known Subinterfaces<LI>All Known Implementing Classes<LI>Class/interface declaration<LI>Class/interface description <P> <LI>Nested Class Summary<LI>Field Summary<LI>Constructor Summary<LI>Method Summary <P> <LI>Field Detail<LI>Constructor Detail<LI>Method Detail</UL> Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.</BLOCKQUOTE> </BLOCKQUOTE> <H3> Annotation Type</H3> <BLOCKQUOTE> <P> Each annotation type has its own separate page with the following sections:<UL> <LI>Annotation Type declaration<LI>Annotation Type description<LI>Required Element Summary<LI>Optional Element Summary<LI>Element Detail</UL> </BLOCKQUOTE> </BLOCKQUOTE> <H3> Enum</H3> <BLOCKQUOTE> <P> Each enum has its own separate page with the following sections:<UL> <LI>Enum declaration<LI>Enum description<LI>Enum Constant Summary<LI>Enum Constant Detail</UL> </BLOCKQUOTE> <H3> Use</H3> <BLOCKQUOTE> Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.</BLOCKQUOTE> <H3> Tree (Class Hierarchy)</H3> <BLOCKQUOTE> There is a <A HREF="overview-tree.html">Class Hierarchy</A> page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with <code>java.lang.Object</code>. The interfaces do not inherit from <code>java.lang.Object</code>.<UL> <LI>When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.<LI>When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.</UL> </BLOCKQUOTE> <H3> Deprecated API</H3> <BLOCKQUOTE> The <A HREF="deprecated-list.html">Deprecated API</A> page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.</BLOCKQUOTE> <H3> Index</H3> <BLOCKQUOTE> The <A HREF="index-files/index-1.html">Index</A> contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.</BLOCKQUOTE> <H3> Prev/Next</H3> These links take you to the next or previous class, interface, package, or related page.<H3> Frames/No Frames</H3> These links show and hide the HTML frames. All pages are available with or without frames. <P> <H3> Serialized Form</H3> Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description. <P> <H3> Constant Field Values</H3> The <a href="constant-values.html">Constant Field Values</a> page lists the static final fields and their values. <P> <FONT SIZE="-1"> <EM> This help file applies to API documentation generated using the standard doclet.</EM> </FONT> <BR> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Help</B></FONT>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="index.html?help-doc.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="help-doc.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>
Java
/* bricks.h -- bricks module; Copyright (C) 2015, 2016 Bruno Félix Rezende Ribeiro <oitofelix@gnu.org> 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, 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 MININIM_BRICKS_H #define MININIM_BRICKS_H /* dungeon vga */ #define DV_BRICKS_00 "data/bricks/dv-00.png" #define DV_BRICKS_01 "data/bricks/dv-01.png" #define DV_BRICKS_02 "data/bricks/dv-02.png" #define DV_BRICKS_03 "data/bricks/dv-03.png" /* palace vga */ #define PV_BRICKS_00 "data/bricks/pv-00.png" #define PV_BRICKS_01 "data/bricks/pv-01.png" void load_bricks (void); void unload_bricks (void); void draw_bricks_00 (ALLEGRO_BITMAP *bitmap, struct pos *p, enum em em, enum vm vm); void draw_bricks_01 (ALLEGRO_BITMAP *bitmap, struct pos *p, enum em em, enum vm vm); void draw_bricks_02 (ALLEGRO_BITMAP *bitmap, struct pos *p, enum em em, enum vm vm); void draw_bricks_03 (ALLEGRO_BITMAP *bitmap, struct pos *p, enum em em, enum vm vm); #endif /* MININIM_BRICKS_H */
Java
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- __author__ = """Co-Pierre Georg (co-pierre.georg@uct.ac.za)""" import sys from src.paralleltools import Parallel #------------------------------------------------------------------------- # # conftools.py is a simple module to manage .xml configuration files # #------------------------------------------------------------------------- if __name__ == '__main__': """ VARIABLES """ args = sys.argv config_file_name = args[1] """ CODE """ parallel = Parallel() parallel.create_config_files(config_file_name)
Java
--- layout: default --- {{> h2 text='Clickdummy'}} {{> h3 text='Lucom Formularmanager'}} <ul> <li> <a href="site/referenzformular.html" title="Referenzformular">Referenzformular</a> </li> <li> <a href="test.html" title="Testseite">Test</a> </li> </ul>
Java
// File__Duplicate - Duplication of some formats // Copyright (C) 2007-2012 MediaArea.net SARL, Info@MediaArea.net // // This library is free software: you can redistribute it and/or modify it // under the terms of the GNU Library General Public License as published by // the Free Software Foundation, either version 2 of the License, or // any later version. // // This library 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 Library General Public License for more details. // // You should have received a copy of the GNU Library General Public License // along with this library. If not, see <http://www.gnu.org/licenses/>. // //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // // Duplication helper for some specific formats // //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //--------------------------------------------------------------------------- // Pre-compilation #include "MediaInfo/PreComp.h" #ifdef __BORLANDC__ #pragma hdrstop #endif //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- #include "MediaInfo/Setup.h" //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- #if defined(MEDIAINFO_AVC_YES) //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- #include "MediaInfo/Video/File_Avc.h" #include "MediaInfo/MediaInfo_Config.h" #include "MediaInfo/MediaInfo_Config_MediaInfo.h" #include "ZenLib/ZtringList.h" #include "ZenLib/File.h" #include <cstring> using namespace ZenLib; using namespace std; //--------------------------------------------------------------------------- namespace MediaInfoLib { //*************************************************************************** // Options //*************************************************************************** //--------------------------------------------------------------------------- void File_Avc::Option_Manage() { #if MEDIAINFO_DUPLICATE //File__Duplicate configuration if (File__Duplicate_HasChanged()) { //Autorisation of other streams Streams[0x07].ShouldDuplicate=true; } #endif //MEDIAINFO_DUPLICATE } //*************************************************************************** // Set //*************************************************************************** //--------------------------------------------------------------------------- #if MEDIAINFO_DUPLICATE bool File_Avc::File__Duplicate_Set (const Ztring &Value) { ZtringList List(Value); //Searching Target bool IsForUs=false; std::vector<ZtringList::iterator> Targets_ToAdd; std::vector<ZtringList::iterator> Targets_ToRemove; std::vector<ZtringList::iterator> Orders_ToAdd; std::vector<ZtringList::iterator> Orders_ToRemove; for (ZtringList::iterator Current=List.begin(); Current<List.end(); ++Current) { //Detecting if we want to remove bool ToRemove=false; if (Current->find(__T('-'))==0) { ToRemove=true; Current->erase(Current->begin()); } //Managing targets if (Current->find(__T("file:"))==0 || Current->find(__T("memory:"))==0) (ToRemove?Targets_ToRemove:Targets_ToAdd).push_back(Current); //Parser name else if (Current->find(__T("parser=Avc"))==0) IsForUs=true; //Managing orders else (ToRemove?Orders_ToRemove:Orders_ToAdd).push_back(Current); } //For us? if (!IsForUs) return false; //Configuration of initial values frame_num_Old=(int32u)-1; Duplicate_Buffer_Size=0; SPS_PPS_AlreadyDone=false; FLV=false; //For each target to add for (std::vector<ZtringList::iterator>::iterator Target=Targets_ToAdd.begin(); Target<Targets_ToAdd.end(); ++Target) Writer.Configure(**Target); //For each order to add for (std::vector<ZtringList::iterator>::iterator Order=Orders_ToAdd.begin(); Order<Orders_ToAdd.end(); ++Order) if ((**Order)==__T("format=Flv")) FLV=true; return true; } #endif //MEDIAINFO_DUPLICATE //*************************************************************************** // Write //*************************************************************************** #if MEDIAINFO_DUPLICATE void File_Avc::File__Duplicate_Write (int64u Element_Code, int32u frame_num) { const int8u* ToAdd=Buffer+Buffer_Offset-(size_t)Header_Size+3; size_t ToAdd_Size=(size_t)(Element_Size+Header_Size-3); if (!SPS_PPS_AlreadyDone) { if (Element_Code==7) { std::memcpy(Duplicate_Buffer, ToAdd, ToAdd_Size); Duplicate_Buffer_Size=ToAdd_Size; } else if (Element_Code==8) { // Form: // 8 bytes : PTS // 8 bytes : DTS // 8 bytes : Size (without header) // 1 byte : Type (0=Frame, 1=Header); // 7 bytes : Reserved size_t Extra; if (FLV) Extra=1; //FLV else Extra=0; //MPEG-4 int8u Header[32]; int64u2BigEndian(Header+ 0, FrameInfo.PTS); int64u2BigEndian(Header+ 8, FrameInfo.DTS); int64u2BigEndian(Header+16, 5+Extra+2+Duplicate_Buffer_Size+1+2+ToAdd_Size); //5+Extra for SPS_SQS header, 2 for SPS size, 1 for PPS count, 2 for PPS size Header[24]=1; int56u2BigEndian(Header+25, 0); Writer.Write(Header, 32); //SPS_PPS int8u* SPS_SQS=new int8u[5+Extra]; if (Extra==1) { SPS_SQS[0]=0x01; //Profile FLV SPS_SQS[1]=(!seq_parameter_sets.empty() && seq_parameter_sets[0])?seq_parameter_sets[0]->profile_idc:0x00; //Compatible Profile. TODO: Handling more than 1 seq_parameter_set SPS_SQS[2]=0x00; //Reserved } else { SPS_SQS[0]=(!seq_parameter_sets.empty() && seq_parameter_sets[0])?seq_parameter_sets[0]->profile_idc:0x00; //Profile MPEG-4. TODO: Handling more than 1 seq_parameter_set SPS_SQS[1]=0x00; //Compatible Profile } SPS_SQS[2+Extra]=(!seq_parameter_sets.empty() && seq_parameter_sets[0])?seq_parameter_sets[0]->level_idc:0x00; //Level. TODO: Handling more than 1 seq_parameter_set SPS_SQS[3+Extra]=0xFF; //Reserved + Size of NALU length minus 1 SPS_SQS[4+Extra]=0xE1; //Reserved + seq_parameter_set count Writer.Write(SPS_SQS, 5+Extra); //NALU int8u NALU[2]; NALU[0]=((Duplicate_Buffer_Size)>> 8)&0xFF; NALU[1]=((Duplicate_Buffer_Size)>> 0)&0xFF; Writer.Write(NALU, 2); //SPS Writer.Write(Duplicate_Buffer, Duplicate_Buffer_Size); Duplicate_Buffer_Size=0; //PPS count SPS_SQS[0]=0x01; //pic_parameter_set count Writer.Write(SPS_SQS, 1); delete[] SPS_SQS; //NALU NALU[0]=((ToAdd_Size)>> 8)&0xFF; NALU[1]=((ToAdd_Size)>> 0)&0xFF; Writer.Write(NALU, 2); //PPS Writer.Write(ToAdd, ToAdd_Size); SPS_PPS_AlreadyDone=true; } } else if (frame_num!=(int32u)-1) { if (frame_num!=frame_num_Old && frame_num_Old!=(int32u)-1 && frame_num!=(int32u)-1) { // Form: // 8 bytes : PTS // 8 bytes : DTS // 8 bytes : Size (without header) // 1 byte : Type (0=Frame, 1=Header); // 7 bytes : Reserved int8u Header[32]; int64u2BigEndian(Header+ 0, FrameInfo.PTS); int64u2BigEndian(Header+ 8, FrameInfo.DTS); int64u2BigEndian(Header+16, Duplicate_Buffer_Size); Header[24]=0; int56u2BigEndian(Header+25, 0); Writer.Write(Header, 32); Writer.Write(Duplicate_Buffer, Duplicate_Buffer_Size); Duplicate_Buffer_Size=0; } //NALU int32u2BigEndian(Duplicate_Buffer+Duplicate_Buffer_Size, (int32u)ToAdd_Size); //4 bytes for NALU header Duplicate_Buffer_Size+=4; //Frame (partial) std::memcpy(Duplicate_Buffer+Duplicate_Buffer_Size, ToAdd, ToAdd_Size); Duplicate_Buffer_Size+=ToAdd_Size; frame_num_Old=frame_num; } } #endif //MEDIAINFO_DUPLICATE //*************************************************************************** // Output_Buffer //*************************************************************************** //--------------------------------------------------------------------------- #if MEDIAINFO_DUPLICATE size_t File_Avc::Output_Buffer_Get (const String &) { return Writer.Output_Buffer_Get(); } #endif //MEDIAINFO_DUPLICATE //--------------------------------------------------------------------------- #if MEDIAINFO_DUPLICATE size_t File_Avc::Output_Buffer_Get (size_t) { return Writer.Output_Buffer_Get(); } #endif //MEDIAINFO_DUPLICATE } //NameSpace #endif //MEDIAINFO_AVC_YES
Java
/* Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ (function(){function w(a){for(var f=0,p=0,n=0,q,d=a.$.rows.length;n<d;n++){q=a.$.rows[n];for(var e=f=0,b,c=q.cells.length;e<c;e++)b=q.cells[e],f+=b.colSpan;f>p&&(p=f)}return p}function t(a){return function(){var f=this.getValue(),f=!!(CKEDITOR.dialog.validate.integer().call(this,f)&&0<f);f||(alert(a),this.select());return f}}function r(a,f){var p=function(d){return new CKEDITOR.dom.element(d,a.document)},r=a.editable(),q=a.plugins.dialogadvtab;return{title:a.lang.table.title,minWidth:310,minHeight:CKEDITOR.env.ie? 310:280,getModel:function(d){return"tableProperties"!==this.dialog.getName()?null:(d=(d=d.getSelection())&&d.getRanges()[0])?d._getTableElement({table:1}):null},onLoad:function(){var d=this,a=d.getContentElement("advanced","advStyles");if(a)a.on("change",function(){var a=this.getStyle("width",""),c=d.getContentElement("info","txtWidth");c&&c.setValue(a,!0);a=this.getStyle("height","");(c=d.getContentElement("info","txtHeight"))&&c.setValue(a,!0)})},onShow:function(){var d=a.getSelection(),e=d.getRanges(), b,c=this.getContentElement("info","txtRows"),h=this.getContentElement("info","txtCols"),u=this.getContentElement("info","txtWidth"),l=this.getContentElement("info","txtHeight");"tableProperties"==f&&((d=d.getSelectedElement())&&d.is("table")?b=d:0<e.length&&(CKEDITOR.env.webkit&&e[0].shrink(CKEDITOR.NODE_ELEMENT),b=a.elementPath(e[0].getCommonAncestor(!0)).contains("table",1)),this._.selectedElement=b);b?(this.setupContent(b),c&&c.disable(),h&&h.disable()):(c&&c.enable(),h&&h.enable());u&&u.onChange(); l&&l.onChange()},onOk:function(){var d=a.getSelection(),e=this._.selectedElement&&d.createBookmarks(),b=this._.selectedElement||p("table"),c={};this.commitContent(c,b);if(c.info){c=c.info;if(!this._.selectedElement)for(var h=b.append(p("tbody")),f=parseInt(c.txtRows,10)||0,l=parseInt(c.txtCols,10)||0,k=0;k<f;k++)for(var g=h.append(p("tr")),m=0;m<l;m++)g.append(p("td")).appendBogus();f=c.selHeaders;if(!b.$.tHead&&("row"==f||"both"==f)){g=b.getElementsByTag("thead").getItem(0);h=b.getElementsByTag("tbody").getItem(0); l=h.getElementsByTag("tr").getItem(0);g||(g=new CKEDITOR.dom.element("thead"),g.insertBefore(h));for(k=0;k<l.getChildCount();k++)h=l.getChild(k),h.type!=CKEDITOR.NODE_ELEMENT||h.data("cke-bookmark")||(h.renameNode("th"),h.setAttribute("scope","col"));g.append(l.remove())}if(null!==b.$.tHead&&"row"!=f&&"both"!=f){g=new CKEDITOR.dom.element(b.$.tHead);for(h=b.getElementsByTag("tbody").getItem(0);0<g.getChildCount();){l=g.getFirst();for(k=0;k<l.getChildCount();k++)m=l.getChild(k),m.type==CKEDITOR.NODE_ELEMENT&& (m.renameNode("td"),m.removeAttribute("scope"));h.append(l,!0)}g.remove()}if(!this.hasColumnHeaders&&("col"==f||"both"==f))for(g=0;g<b.$.rows.length;g++)m=new CKEDITOR.dom.element(b.$.rows[g].cells[0]),m.renameNode("th"),m.setAttribute("scope","row");if(this.hasColumnHeaders&&"col"!=f&&"both"!=f)for(k=0;k<b.$.rows.length;k++)g=new CKEDITOR.dom.element(b.$.rows[k]),"tbody"==g.getParent().getName()&&(m=new CKEDITOR.dom.element(g.$.cells[0]),m.renameNode("td"),m.removeAttribute("scope"));c.txtHeight? b.setStyle("height",c.txtHeight):b.removeStyle("height");c.txtWidth?b.setStyle("width",c.txtWidth):b.removeStyle("width");b.getAttribute("style")||b.removeAttribute("style")}if(this._.selectedElement)try{d.selectBookmarks(e)}catch(n){}else a.insertElement(b),setTimeout(function(){var d=new CKEDITOR.dom.element(b.$.rows[0].cells[0]),c=a.createRange();c.moveToPosition(d,CKEDITOR.POSITION_AFTER_START);c.select()},0)},contents:[{id:"info",label:a.lang.table.title,elements:[{type:"hbox",widths:[null,null], styles:["vertical-align:top"],children:[{type:"vbox",padding:0,children:[{type:"text",id:"txtRows","default":3,label:a.lang.table.rows,required:!0,controlStyle:"width:5em",validate:t(a.lang.table.invalidRows),setup:function(d){this.setValue(d.$.rows.length)},commit:n},{type:"text",id:"txtCols","default":2,label:a.lang.table.columns,required:!0,controlStyle:"width:5em",validate:t(a.lang.table.invalidCols),setup:function(d){this.setValue(w(d))},commit:n},{type:"html",html:"\x26nbsp;"},{type:"select", id:"selHeaders",requiredContent:"th","default":"",label:a.lang.table.headers,items:[[a.lang.table.headersNone,""],[a.lang.table.headersRow,"row"],[a.lang.table.headersColumn,"col"],[a.lang.table.headersBoth,"both"]],setup:function(d){var a=this.getDialog();a.hasColumnHeaders=!0;for(var b=0;b<d.$.rows.length;b++){var c=d.$.rows[b].cells[0];if(c&&"th"!=c.nodeName.toLowerCase()){a.hasColumnHeaders=!1;break}}null!==d.$.tHead?this.setValue(a.hasColumnHeaders?"both":"row"):this.setValue(a.hasColumnHeaders? "col":"")},commit:n},{type:"text",id:"txtBorder",requiredContent:"table[border]","default":a.filter.check("table[border]")?1:0,label:a.lang.table.border,controlStyle:"width:3em",validate:CKEDITOR.dialog.validate.number(a.lang.table.invalidBorder),setup:function(d){this.setValue(d.getAttribute("border")||"")},commit:function(d,a){this.getValue()?a.setAttribute("border",this.getValue()):a.removeAttribute("border")}},{id:"cmbAlign",type:"select",requiredContent:"table[align]","default":"",label:a.lang.common.align, items:[[a.lang.common.notSet,""],[a.lang.common.left,"left"],[a.lang.common.center,"center"],[a.lang.common.right,"right"]],setup:function(a){this.setValue(a.getAttribute("align")||"")},commit:function(a,e){this.getValue()?e.setAttribute("align",this.getValue()):e.removeAttribute("align")}}]},{type:"vbox",padding:0,children:[{type:"hbox",widths:["5em"],children:[{type:"text",id:"txtWidth",requiredContent:"table{width}",controlStyle:"width:5em",label:a.lang.common.width,title:a.lang.common.cssLengthTooltip, "default":a.filter.check("table{width}")?500>r.getSize("width")?"100%":500:0,getValue:v,validate:CKEDITOR.dialog.validate.cssLength(a.lang.common.invalidCssLength.replace("%1",a.lang.common.width)),onChange:function(){var a=this.getDialog().getContentElement("advanced","advStyles");a&&a.updateStyle("width",this.getValue())},setup:function(a){a=a.getStyle("width");this.setValue(a)},commit:n}]},{type:"hbox",widths:["5em"],children:[{type:"text",id:"txtHeight",requiredContent:"table{height}",controlStyle:"width:5em", label:a.lang.common.height,title:a.lang.common.cssLengthTooltip,"default":"",getValue:v,validate:CKEDITOR.dialog.validate.cssLength(a.lang.common.invalidCssLength.replace("%1",a.lang.common.height)),onChange:function(){var a=this.getDialog().getContentElement("advanced","advStyles");a&&a.updateStyle("height",this.getValue())},setup:function(a){(a=a.getStyle("height"))&&this.setValue(a)},commit:n}]},{type:"html",html:"\x26nbsp;"},{type:"text",id:"txtCellSpace",requiredContent:"table[cellspacing]", controlStyle:"width:3em",label:a.lang.table.cellSpace,"default":a.filter.check("table[cellspacing]")?1:0,validate:CKEDITOR.dialog.validate.number(a.lang.table.invalidCellSpacing),setup:function(a){this.setValue(a.getAttribute("cellSpacing")||"")},commit:function(a,e){this.getValue()?e.setAttribute("cellSpacing",this.getValue()):e.removeAttribute("cellSpacing")}},{type:"text",id:"txtCellPad",requiredContent:"table[cellpadding]",controlStyle:"width:3em",label:a.lang.table.cellPad,"default":a.filter.check("table[cellpadding]")? 1:0,validate:CKEDITOR.dialog.validate.number(a.lang.table.invalidCellPadding),setup:function(a){this.setValue(a.getAttribute("cellPadding")||"")},commit:function(a,e){this.getValue()?e.setAttribute("cellPadding",this.getValue()):e.removeAttribute("cellPadding")}}]}]},{type:"html",align:"right",html:""},{type:"vbox",padding:0,children:[{type:"text",id:"txtCaption",requiredContent:"caption",label:a.lang.table.caption,setup:function(a){this.enable();a=a.getElementsByTag("caption");if(0<a.count()){a= a.getItem(0);var e=a.getFirst(CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT));e&&!e.equals(a.getBogus())?(this.disable(),this.setValue(a.getText())):(a=CKEDITOR.tools.trim(a.getText()),this.setValue(a))}},commit:function(d,e){if(this.isEnabled()){var b=this.getValue(),c=e.getElementsByTag("caption");if(b)0<c.count()?(c=c.getItem(0),c.setHtml("")):(c=new CKEDITOR.dom.element("caption",a.document),e.append(c,!0)),c.append(new CKEDITOR.dom.text(b,a.document));else if(0<c.count())for(b=c.count()- 1;0<=b;b--)c.getItem(b).remove()}}},{type:"text",id:"txtSummary",bidi:!0,requiredContent:"table[summary]",label:a.lang.table.summary,setup:function(a){this.setValue(a.getAttribute("summary")||"")},commit:function(a,e){this.getValue()?e.setAttribute("summary",this.getValue()):e.removeAttribute("summary")}}]}]},q&&q.createAdvancedTab(a,null,"table")]}}var v=CKEDITOR.tools.cssLength,n=function(a){var f=this.id;a.info||(a.info={});a.info[f]=this.getValue()};CKEDITOR.dialog.add("table",function(a){return r(a, "table")});CKEDITOR.dialog.add("tableProperties",function(a){return r(a,"tableProperties")})})();
Java
package com.wisecityllc.cookedapp.fragments; import android.app.Activity; import android.support.v4.app.Fragment; import android.net.Uri; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ListView; import android.widget.ProgressBar; import android.widget.TextView; import com.parse.ParseQueryAdapter; import com.segment.analytics.Analytics; import com.wisecityllc.cookedapp.R; import com.wisecityllc.cookedapp.adapters.AlertWallAdapter; import com.wisecityllc.cookedapp.parseClasses.Message; import java.util.List; /** * A simple {@link Fragment} subclass. * Activities that contain this fragment must implement the * {@link AlertsFragment.OnFragmentInteractionListener} interface * to handle interaction events. * Use the {@link AlertsFragment#newInstance} factory method to * create an instance of this fragment. */ public class AlertsFragment extends Fragment { public static final String ALERTS_SCREEN = "AlertsScreen"; private boolean mHasMadeInitialLoad = false; private AlertWallAdapter mAlertsAdapter; private ListView mAlertsListView; private TextView mNoAlertsTextView; private ProgressBar mLoadingIndicator; public static AlertsFragment newInstance() { AlertsFragment fragment = new AlertsFragment(); return fragment; } public AlertsFragment() { } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment return inflater.inflate(R.layout.fragment_alerts, container, false); } @Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); mLoadingIndicator = (ProgressBar) view.findViewById(R.id.alerts_fragment_loading_indicator); mAlertsAdapter = new AlertWallAdapter(this.getActivity()); mAlertsAdapter.addOnQueryLoadListener(new ParseQueryAdapter.OnQueryLoadListener<Message>() { @Override public void onLoading() { mAlertsListView.setVisibility(View.GONE); mLoadingIndicator.setVisibility(View.VISIBLE); mNoAlertsTextView.setVisibility(View.GONE); } @Override public void onLoaded(List<Message> list, Exception e) { mLoadingIndicator.setVisibility(View.GONE); mNoAlertsTextView.setVisibility(e != null || list == null || list.isEmpty() ? View.VISIBLE : View.GONE); mAlertsListView.setVisibility(View.VISIBLE); } }); if(mAlertsListView == null){ mAlertsListView = (ListView)view.findViewById(R.id.alerts_list_view); } mNoAlertsTextView = (TextView) view.findViewById(R.id.alerts_fragment_no_messages_text_view); // mAlertsListView.setOnItemClickListener(this); } @Override public void onAttach(Activity activity) { super.onAttach(activity); try { } catch (ClassCastException e) { throw new ClassCastException(activity.toString() + " must implement OnFragmentInteractionListener"); } } @Override public void onDetach() { super.onDetach(); } /** * This interface must be implemented by activities that contain this * fragment to allow an interaction in this fragment to be communicated * to the activity and potentially other fragments contained in that * activity. * <p/> * See the Android Training lesson <a href= * "http://developer.android.com/training/basics/fragments/communicating.html" * >Communicating with Other Fragments</a> for more information. */ public interface OnFragmentInteractionListener { // TODO: Update argument type and name public void onFragmentInteraction(Uri uri); } @Override public void setUserVisibleHint(boolean isVisibleToUser) { super.setUserVisibleHint(isVisibleToUser); if(isVisibleToUser) { // Has become visible Analytics.with(getActivity()).screen(null, ALERTS_SCREEN); // Delay our loading until we become visible if(mHasMadeInitialLoad == false && mAlertsAdapter != null) { mAlertsListView.setAdapter(mAlertsAdapter); mHasMadeInitialLoad = true; } } } }
Java
<!doctype html> <html lang="fr"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Tutoriel QGIS Passages</title> <meta name="description" content="Tutoriel QGIS"> <meta name="author" content="Pierson Julie" > <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,400italic,600,600italic,700,700italic&amp;subset=latin,latin-ext' rel='stylesheet' type='text/css'> <link rel="stylesheet" type="text/css" href="tutoqgis_print.css" media="screen"> </head> <body> <div id="wrap"> <div style="margin-left: 1.5cm; margin-right: 1.5cm"> <center> <a href="http://www.letg.cnrs.fr/" > <img style="margin-bottom: 12.5cm;" class="logo" src="illustrations/tous/logo_letg.png" alt="logo letg" width="10%"> </a> <a href="http://www.passages.cnrs.fr/" > <img style="margin-bottom: 12.5cm;" class="logo" src="illustrations/tous/logo_passages.png" alt="logo passages" width="22%"> </a> <p style="font-size:1.9em;color:#28A6B7;text-align:center;margin:0;padding:0;font-variant: small-caps;">Tutoriel QGIS : IV. Géoréférencement</p> <hr class="cover"> <p style="font-size:1.4em;margin:0;padding:0;font-variant: small-caps;">Export PDF de mai 2021</p> <a target="_blank" href="http://www.qgis.org/" > <img style="margin-bottom: 9cm;" class="logo" src="illustrations/tous/qgis-icon128.png" alt="logo QGIS" width="13%"> </a> <p style="font-size:1.1em;">Ceci est un export PDF du tutoriel QGIS 3.16 'Hannover' disponible ici : <a href="https://ouvrir.passages.cnrs.fr/tutoqgis/" >https://ouvrir.passages.cnrs.fr/tutoqgis/</a></p> <p>Plus d'informations sur cette page : <a href="https://ouvrir.passages.cnrs.fr/tutoqgis/en_savoir_plus.php" >https://ouvrir.passages.cnrs.fr/tutoqgis/en_savoir_plus.php</a>.</p> <p><em>Ce tutoriel est sous licence Creative Commons : vous êtes autorisé à le partager et l'adapter, pour toute utilisation y compris commerciale, à condition de citer l'auteur : Julie Pierson, UMR 6554 LETG, <a href="http://www.letg.cnrs.fr">www.letg.cnrs.fr</a>, et de partager votre travail sous les mêmes conditions. Le texte complet de la licence est disponible ici : <a href="https://creativecommons.org/licenses/by-sa/4.0/deed.fr">https://creativecommons.org/licenses/by-sa/4.0/deed.fr</a></em></p> </center> </div> </div> </body> </html>
Java
/* * Copyright (C) 2014 - Center of Excellence in Information Assurance * * 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 "keysgeneratorwidget.h" #include "ui_keysgeneratorwidget.h" #include "../Global/keygenerator.h" #include "../Global/keyvalidator.h" #include <QMessageBox> KeysGeneratorWidget::KeysGeneratorWidget(QWidget *parent) : QWidget(parent), ui(new Ui::KeysGeneratorWidget) { ui->setupUi(this); model = new QSqlTableModel; model->setTable("GeneratedTable"); model->select(); ui->tableView->setModel(model); ui->tableView->setAlternatingRowColors(true); ui->tableView->setSelectionMode(QAbstractItemView::SingleSelection); ui->tableView->setSelectionBehavior(QAbstractItemView::SelectRows); ui->tableView->resizeColumnToContents(1); ui->tableView->resizeColumnToContents(0); ui->tableView->setEditTriggers(QAbstractItemView::NoEditTriggers); } KeysGeneratorWidget::~KeysGeneratorWidget() { delete ui; } void KeysGeneratorWidget:: on_generateButton_clicked() { QString time = getTime(); QString id = getNextId(); QString constantNumber = "853023"; QString key = KeyGenerator::generateKey(time, id, constantNumber); if ( !key.endsWith("+") && KeyValidator::validate(key) ) { ui->serialLineEdit->setText(key); } } void KeysGeneratorWidget::on_generate1000KeysButton_clicked() { int count = 0; for (int i=0; i<100 ; i++ ){ QString time = getTime(); QString id = getNextId(); QString constantNumber = "853023"; QString key = KeyGenerator::generateKey(time, id, constantNumber); if ( KeyValidator::validate(key) ) { ui->serialLineEdit->setText(key); if ( ! existKey (key) && ! key.endsWith("+") ) { QSqlQuery query; QString time = QDate::currentDate().toString(); if ( query.exec("insert into GeneratedTable(serial, generateTime) values('" + key + "' , '" + time +"')") ) { qDebug() << "key: " << key; count++; } } } } qDebug() << "Number of Key Saved: " << count; } void KeysGeneratorWidget::on_saveKeyButton_clicked() { QString key = ui->serialLineEdit->text(); if ( KeyValidator::validate(key) ) { if ( ! existKey (key) && ! key.endsWith("+") ) { QSqlQuery query; QString time = QDate::currentDate().toString(); if ( query.exec("insert into GeneratedTable(serial, generateTime) values('" + key + "' , '" + time +"')") ) QMessageBox::information(this,"inserting Ok","inserting Ok"); else QMessageBox::warning(this,"cannot inserting key","cannot inserting key"); } else { QMessageBox::warning(this,"Key existing in DB","Key existing in DB"); } } else { QMessageBox::warning(this,"is not valid key", key + " is not valid key"); } model->select(); } void KeysGeneratorWidget::on_removeKeyButton_clicked() { int no = model->index(ui->tableView->currentIndex().row(),0).data().toInt(); QSqlQuery query; query.prepare("DELETE FROM GeneratedTable WHERE id = ?"); query.addBindValue(no); query.exec(); model->select(); } bool KeysGeneratorWidget:: existKey (QString key) { QSqlQuery query; query.prepare("SELECT * FROM GeneratedTable WHERE serial = ?"); query.addBindValue(key); query.exec(); while (query.next()) { return true; } return false; } QString KeysGeneratorWidget:: getTime () { QTime time = QTime::currentTime(); QString result = QString::number(time.msec()); return result; } QString KeysGeneratorWidget:: getNextId () { QString id = getRandomChars(5); return id; } QString KeysGeneratorWidget:: getRandomChars (int length) { int difference = 'Z'-'A'; QString result = ""; for (int i=0; i<length; i++) { char c = 'A' + ( rand() % difference ); result += c ; } return result; }
Java
/*************************************************************************** * matrix_statistics.h: * * TODO: add doc * * Written by Anthony Lomax * ALomax Scientific www.alomax.net * * modified: 2010.12.16 ***************************************************************************/ #define CONFIDENCE_LEVEL 68.0 // 68% confidence level used throughout // 2D ellipse typedef struct { double az1, len1; // semi-minor axis km double len2; // semi-major axis km } Ellipse2D; #define DELTA_CHI_SQR_68_2 2.30 // value for 68% conf (see Num Rec, 2nd ed, sec 15.6, table) // 3D ellipsoid typedef struct { double az1, dip1, len1; // semi-minor axis km double az2, dip2, len2; // semi-intermediate axis km double len3; // semi-major axis km double az3, dip3; // 20150601 AJL - semi-major axis az and dip added to support conversion to QuakeML Tait-Bryan representation } Ellipsoid3D; #define DELTA_CHI_SQR_68_3 3.53 // value for 68% conf (see Num Rec, 2nd ed, sec 15.6, table) char *get_matrix_statistics_error_mesage(); Vect3D CalcExpectationSamples(float*, int); Vect3D CalcExpectationSamplesWeighted(float* fdata, int nSamples); Vect3D CalcExpectationSamplesGlobal(float* fdata, int nSamples, double xReference); Vect3D CalcExpectationSamplesGlobalWeighted(float* fdata, int nSamples, double xReference); Mtrx3D CalcCovarianceSamplesRect(float* fdata, int nSamples, Vect3D* pexpect); Mtrx3D CalcCovarianceSamplesGlobal(float* fdata, int nSamples, Vect3D* pexpect); Mtrx3D CalcCovarianceSamplesGlobalWeighted(float* fdata, int nSamples, Vect3D* pexpect); Ellipsoid3D CalcErrorEllipsoid(Mtrx3D *, double); Ellipse2D CalcHorizontalErrorEllipse(Mtrx3D *pcov, double del_chi_2); void ellipsiod2Axes(Ellipsoid3D *, Vect3D *, Vect3D *, Vect3D *); void nllEllipsiod2XMLConfidenceEllipsoid(Ellipsoid3D *pellipsoid, double* psemiMajorAxisLength, double* pmajorAxisPlunge, double* pmajorAxisAzimuth, double* psemiIntermediateAxisLength, double* pintermediateAxisPlunge, double* pintermediateAxisAzimuth, double* psemiMinorAxisLength); int nllEllipsiod2QMLConfidenceEllipsoid(Ellipsoid3D *pellipsoid, double* psemiMajorAxisLength, double* psemiMinorAxisLength, double* psemiIntermediateAxisLength, double* pmajorAxisAzimuth, double* pmajorAxisPlunge, double* pmajorAxisRotation);
Java
/* ----------------------------------------------------------------------------------------------- This source file is part of the Particle Universe product. Copyright (c) 2010 Henry van Merode Usage of this program is licensed under the terms of the Particle Universe Commercial License. You can find a copy of the Commercial License in the Particle Universe package. ----------------------------------------------------------------------------------------------- */ #ifndef __PU_LOGMANAGER_H__ #define __PU_LOGMANAGER_H__ #include "OgreLogManager.h" namespace ParticleUniverse { // If the Ogre renderer is replaced by another renderer, the type below must be re-implemented. typedef Ogre::LogManager LogManager; } #endif
Java
<?php require "funciones.php"; CopiarArchivo($_REQUEST["txtRuta"]); ?>
Java
package org.aslab.om.metacontrol.action; import java.util.HashSet; import java.util.Set; import org.aslab.om.ecl.action.Action; import org.aslab.om.ecl.action.ActionFeedback; import org.aslab.om.ecl.action.ActionResult; import org.aslab.om.metacontrol.value.CompGoalAtomTracker; /** * <!-- begin-UML-doc --> * <!-- end-UML-doc --> * @author chcorbato * @generated "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ public class FunctionalAction extends Action { /** * <!-- begin-UML-doc --> * number of ever issued action_list (this way a new number is assigned to everyone upon creation) * <!-- end-UML-doc --> * @generated "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ private static short num_of_actions = 0; @Override protected short addAction(){ return num_of_actions++; } /** * <!-- begin-UML-doc --> * <!-- end-UML-doc --> * @generated "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ public Set<CompGoalAtomTracker> atoms = new HashSet<CompGoalAtomTracker>(); /** * <!-- begin-UML-doc --> * <!-- end-UML-doc --> * @param a * @generated "UML to Java (com.ibm.xtools.transform.uml2.java5.internal.UML2JavaTransform)" */ public FunctionalAction(Set<CompGoalAtomTracker> a) { // begin-user-code atoms = a; // end-user-code } @Override public ActionResult processResult(ActionFeedback feedback) { // TODO Auto-generated method stub return null; } @Override public boolean timeOut() { // TODO Auto-generated method stub return false; } }
Java
$(function() { $("#childGrid").jqGrid( { url : "TBCcnsizePrm.html?getGridData",datatype : "json",mtype : "GET",colNames : [ 'Conn Id',getLocalMessage('water.connsize.frmDt'), getLocalMessage('water.connsize.toDt'), getLocalMessage('water.connsize.frm'),getLocalMessage('water.connsize.to'), getLocalMessage('edit.msg'), getLocalMessage('master.view')], colModel : [ {name : "cnsId",width : 10,sortable : false,searchoptions: { "sopt": [ "eq"] }}, {name : "cnsFrmdt",width : 20,sortable : true,searchoptions: { "sopt": ["bw", "eq"] },formatter : dateTemplate}, {name : "cnsTodt",width : 20,sortable : true, searchoptions: { "sopt": ["bw", "eq"] },formatter : dateTemplate}, {name : "cnsFrom",width : 20,sortable : false,searchoptions: { "sopt": [ "eq"] }}, {name : "cnsTo",width : 20,sortable : false,searchoptions: { "sopt": [ "eq"] }}, {name : 'cnsId',index : 'cnsId',width : 20,align : 'center',formatter : returnEditUrl,editoptions : {value : "Yes:No"},formatoptions : {disabled : false},search:false }, {name : 'cnsId',index : 'cnsId',width : 20,align : 'center',formatter : returnViewUrl,editoptions : {value : "Yes:No"},formatoptions : {disabled : false},search:false} ], pager : "#pagered", rowNum : 30, rowList : [ 5, 10, 20, 30 ], sortname : "dsgid", sortorder : "desc", height : 'auto', viewrecords : true, gridview : true, loadonce : true, jsonReader : { root : "rows", page : "page", total : "total", records : "records", repeatitems : false, }, autoencode : true, caption : getLocalMessage('water.connsize.gridTtl') }); jQuery("#grid").jqGrid('navGrid','#pagered',{edit:false,add:false,del:false,search:true,refresh:false}); $("#pagered_left").css("width", ""); }); function returnEditUrl(cellValue, options, rowdata, action) { return "<a href='#' return false; class='editClass' value='"+rowdata.cnsId+"' ><img src='css/images/edit.png' width='20px' alt='Edit Charge Master' title='Edit Scrutiny Data' /></a>"; } function returnViewUrl(cellValue, options, rowdata, action) { return "<a href='#' return false; class='viewConnectionClass' value='"+rowdata.cnsId+"'><img src='css/images/grid/view-icon.png' width='20px' alt='View Master' title='View Master' /></a>"; } function returnisdeletedUrl(cellValue, options, rowdata, action) { if (rowdata.isdeleted == '0') { return "<a href='#' class='fa fa-check-circle fa-2x green ' value='"+rowdata.isdeleted+"' alt='Designation is Active' title='Designation is Active'></a>"; } else { return "<a href='#' class='fa fa-times-circle fa-2x red ' value='"+rowdata.isdeleted+"' alt='Designation is INActive' title='Designation is InActive'></a>"; } } $(function() { $(document) .on('click','.addConnectionClass',function() { var $link = $(this); var cnsId = $link.closest('tr').find('td:eq(0)').text(); var url = "TBCcnsizePrm.html?formForUpdate"; var requestData = "cnsId=" + cnsId + "&MODE1=" + "EDIT"; var returnData =__doAjaxRequest(url,'post',requestData,false); $('.content').html(returnData); prepareDateTag(); }); }); $(function() { $(document).on('click', '.editClass', function() { var $link = $(this); var cnsId = $link.closest('tr').find('td:eq(0)').text(); var url = "TBCcnsizePrm.html?formForUpdate"; var requestData = "cnsId=" + cnsId + "&MODE1=" + "EDIT"; var returnData =__doAjaxRequest(url,'post',requestData,false); $('.content').html(returnData); prepareDateTag(); }); }); $(function() { $(document).on('click', '.viewConnectionClass', function() { var $link = $(this); var cnsId = $link.closest('tr').find('td:eq(0)').text(); var url = "TBCcnsizePrm.html?formForUpdate"; var requestData = "cnsId=" + cnsId + "&MODE1=" + "VIEW"; var returnData =__doAjaxRequest(url,'post',requestData,false); $('.content').html(returnData); prepareDateTag(); }); }); /*ADD Form*/ function saveConnectionSizeDetails(obj){ return saveOrUpdateForm(obj, 'Saved Successfully', 'TBCcnsizePrm.html', 'create'); } function updateConnectionSizeDetails(obj){ return saveOrUpdateForm(obj, 'Saved Successfully', 'TBCcnsizePrm.html', 'update'); } function showConfirmBox(){ var errMsgDiv = '.msg-dialog-box'; var message=''; var cls = 'Yes'; message +='<p>Record Saved Successfully..</p>'; message +='<p style=\'text-align:center;margin: 5px;\'>'+ '<br/><input type=\'button\' value=\''+cls+'\' id=\'btnNo\' class=\'css_btn \' '+ ' onclick="ShowView()"/>'+ '</p>'; $(errMsgDiv).addClass('ok-msg').removeClass('warn-msg'); $(errMsgDiv).html(message); $(errMsgDiv).show(); $('#btnNo').focus(); showModalBox(errMsgDiv); } function ShowView(){ window.location.href='TBCcnsizePrm.html'; } $(".datepicker").datepicker({ dateFormat: 'dd/mm/yy', changeMonth: true, changeYear: true }); $(".warning-div ul").each(function () { var lines = $(this).html().split("<br>"); $(this).html('<li>' + lines.join("</li><li><i class='fa fa-exclamation-circle'></i>&nbsp;") + '</li>'); }); $('html,body').animate({ scrollTop: 0 }, 'slow');
Java
// Copyleft 2005 Chris Korda // 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 any later version. /* chris korda revision history: rev date comments 00 22apr05 initial version 01 07jul05 keep dialog within screen 02 23nov07 support Unicode 03 16dec08 in OnShowWindow, move LoadWnd within bShow block 04 24mar09 add special handling for main accelerators 05 21dec12 in OnShowWindow, don't clamp to work area if maximized 06 24jul15 override DoModal to save and restore focus 07 06jul17 remove update menu method dialog that saves and restores its position */ // PersistDlg.cpp : implementation file // #include "stdafx.h" #include "Resource.h" #include "PersistDlg.h" #include "Persist.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CPersistDlg dialog IMPLEMENT_DYNAMIC(CPersistDlg, CDialog); CPersistDlg::CPersistDlg(UINT nIDTemplate, UINT nIDAccel, LPCTSTR RegKey, CWnd *pParent) : CDialog(nIDTemplate, pParent), m_RegKey(RegKey) { //{{AFX_DATA_INIT(CPersistDlg) //}}AFX_DATA_INIT m_WasShown = FALSE; m_IDAccel = nIDAccel; m_Accel = nIDAccel != NULL && nIDAccel != IDR_MAINFRAME ? LoadAccelerators(AfxGetApp()->m_hInstance, MAKEINTRESOURCE(nIDAccel)) : NULL; } void CPersistDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CPersistDlg) //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CPersistDlg, CDialog) //{{AFX_MSG_MAP(CPersistDlg) ON_WM_DESTROY() ON_WM_SHOWWINDOW() //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CPersistDlg message handlers void CPersistDlg::OnDestroy() { CDialog::OnDestroy(); if (m_WasShown) CPersist::SaveWnd(REG_SETTINGS, this, m_RegKey); } void CPersistDlg::OnShowWindow(BOOL bShow, UINT nStatus) { CDialog::OnShowWindow(bShow, nStatus); if (bShow) { if (!m_WasShown && !IsWindowVisible()) { m_WasShown = TRUE; int Flags = (GetStyle() & WS_THICKFRAME) ? 0 : CPersist::NO_RESIZE; CPersist::LoadWnd(REG_SETTINGS, this, m_RegKey, Flags); } if (!IsZoomed()) { // unless we're maximized, clamp to work area // in case LoadWnd's SetWindowPlacement places us off-screen CRect r, wr; GetWindowRect(r); if (SystemParametersInfo(SPI_GETWORKAREA, 0, wr, 0)) { CRect br = wr; br.right -= GetSystemMetrics(SM_CXSMICON); br.bottom -= GetSystemMetrics(SM_CYCAPTION); CPoint pt = r.TopLeft(); if (!br.PtInRect(pt)) { // if dialog is off-screen pt.x = CLAMP(pt.x, wr.left, wr.right - r.Width()); pt.y = CLAMP(pt.y, wr.top, wr.bottom - r.Height()); r = CRect(pt, CSize(r.Width(), r.Height())); MoveWindow(r); } } } } } BOOL CPersistDlg::PreTranslateMessage(MSG* pMsg) { if (pMsg->message >= WM_KEYFIRST && pMsg->message <= WM_KEYLAST) { if (m_Accel != NULL) { if (TranslateAccelerator(m_hWnd, m_Accel, pMsg)) return(TRUE); } else { // no local accelerator table // if non-system key down and main accelerators, give main a try if (pMsg->message == WM_KEYDOWN && m_IDAccel == IDR_MAINFRAME && AfxGetMainWnd()->SendMessage(UWM_HANDLEDLGKEY, (WPARAM)pMsg)) return(TRUE); } } return CDialog::PreTranslateMessage(pMsg); } W64INT CPersistDlg::DoModal() { HWND hWndFocus = ::GetFocus(); W64INT retc = CDialog::DoModal(); if (IsWindow(hWndFocus) && ::IsWindowVisible(hWndFocus)) // extra cautious ::SetFocus(hWndFocus); return retc; }
Java
using System.Collections; using System.Collections.Generic; using UnityEngine; public class WaterItem : BaseItem { // Use this for initialization public override void Start() { base.Start(); BulletSpeed = .1f; ItemSprite = gameObject.GetComponent<SpriteRenderer>().sprite; NameText = "Water"; PickupText = "Shot Speed up"; } // Update is called once per frame void Update () { } }
Java
package net.ballmerlabs.scatterbrain.network.wifidirect; import android.os.Handler; import android.os.Looper; import android.os.Message; import net.ballmerlabs.scatterbrain.network.GlobalNet; /** * Created by user on 5/29/16. */ @SuppressWarnings({"FieldCanBeLocal", "DefaultFileTemplate"}) class WifiDirectLooper extends Thread { private Handler handler; @SuppressWarnings("unused") private final GlobalNet globnet; public WifiDirectLooper(GlobalNet globnet) { super(); this.globnet = globnet; handler = new Handler(); } public Handler getHandler() { return this.handler; } @Override public void run() { Looper.prepare(); handler = new Handler(new Handler.Callback() { @Override public boolean handleMessage(Message msg) { return true; } }); Looper.loop(); } }
Java
// <auto-generated> // ReSharper disable ConvertPropertyToExpressionBody // ReSharper disable DoNotCallOverridableMethodsInConstructor // ReSharper disable InconsistentNaming // ReSharper disable PartialMethodWithSinglePart // ReSharper disable PartialTypeWithSinglePart // ReSharper disable RedundantNameQualifier // ReSharper disable RedundantOverridenMember // ReSharper disable UseNameofExpression // TargetFrameworkVersion = 4.6 #pragma warning disable 1591 // Ignore "Missing XML Comment" warning using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Newtonsoft.Json; using Pikad.Framework.Repository; namespace IranMarketer.Domain.Entity { // AcademicFields [Table("AcademicFields", Schema = "dbo")] public class AcademicField : Entity<int> { [Column(@"TitleEn", Order = 2, TypeName = "nvarchar")] [MaxLength(1000)] [StringLength(1000)] [Display(Name = "Title en")] public string TitleEn { get; set; } [Column(@"TitleFa", Order = 3, TypeName = "nvarchar")] [MaxLength(1000)] [StringLength(1000)] [Display(Name = "Title fa")] public string TitleFa { get; set; } [JsonIgnore] public virtual System.Collections.Generic.ICollection<PartyUniversity> PartyUniversities { get; set; } public AcademicField() { PartyUniversities = new System.Collections.Generic.List<PartyUniversity>(); } } } // </auto-generated>
Java
/** * @file Map places of interest * @author Tom Jenkins tom@itsravenous.com */ module.exports = { castle: { title: 'Rowton Castle', lat: 52.708739, lng: -2.9228567, icon: 'pin_castle.png', main: true, description: 'Where it all happens! Rowton Castle is a small castle manor house roughly halfway between Shrewsbury and Welshpool.', link: 'https://rowtoncastle.com' }, barns: { title: 'Rowton Barns', lat: 52.709265, lng: -2.9255, icon: 'pin_hotel.png', description: 'Just a <del>drunken stumble</del> <ins>short stroll</ins> from the castle, Rowton Barns offers rooms in their beautifully converted farm buildings.', link: 'http://www.rowtonbarns.co.uk/' }, wollaston: { title: 'Wollaston Lodge', lat: 52.7036, lng: -2.9943, icon: 'pin_hotel.png', description: 'A boutique bed and breakfast with individually themed rooms.', link: 'http://www.wollastonlodge.co.uk/' }, travelodge: { title: 'Shrewsbury Travelodge', lat: 52.6817939, lng: -2.7645268, icon: 'pin_hotel.png', description: 'On Bayston Hill services, with free parking.', link: 'https://www.travelodge.co.uk/hotels/175/Shrewsbury-Bayston-Hill-hotel' } };
Java
var struct_create_packets_1_1__2 = [ [ "angle", "struct_create_packets_1_1__2.html#a425d33bd27790066ff7edb4a608a8149", null ], [ "buttons", "struct_create_packets_1_1__2.html#a6b7d2d6c0a3a063f873420c010063b33", null ], [ "distance", "struct_create_packets_1_1__2.html#afb30de28ec41190d0cb278640d4782ab", null ], [ "ir", "struct_create_packets_1_1__2.html#ac834057741105e898b3d4613b96c6eb1", null ] ];
Java
/* The standard CSS for doxygen 1.8.11 */ body, table, div, p, dl { font: 400 14px/22px Roboto,sans-serif; } /* @group Heading Levels */ h1.groupheader { font-size: 150%; } .title { font: 400 14px/28px Roboto,sans-serif; font-size: 150%; font-weight: bold; margin: 10px 2px; } h2.groupheader { border-bottom: 1px solid #EBB4B4; color: #D35858; font-size: 150%; font-weight: normal; margin-top: 1.75em; padding-top: 8px; padding-bottom: 4px; width: 100%; } h3.groupheader { font-size: 100%; } h1, h2, h3, h4, h5, h6 { -webkit-transition: text-shadow 0.5s linear; -moz-transition: text-shadow 0.5s linear; -ms-transition: text-shadow 0.5s linear; -o-transition: text-shadow 0.5s linear; transition: text-shadow 0.5s linear; margin-right: 15px; } h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { text-shadow: 0 0 15px cyan; } dt { font-weight: bold; } div.multicol { -moz-column-gap: 1em; -webkit-column-gap: 1em; -moz-column-count: 3; -webkit-column-count: 3; } p.startli, p.startdd { margin-top: 2px; } p.starttd { margin-top: 0px; } p.endli { margin-bottom: 0px; } p.enddd { margin-bottom: 4px; } p.endtd { margin-bottom: 2px; } /* @end */ caption { font-weight: bold; } span.legend { font-size: 70%; text-align: center; } h3.version { font-size: 90%; text-align: center; } div.qindex, div.navtab{ background-color: #FCF3F3; border: 1px solid #F0C7C7; text-align: center; } div.qindex, div.navpath { width: 100%; line-height: 140%; } div.navtab { margin-right: 15px; } /* @group Link Styling */ a { color: #D86868; font-weight: normal; text-decoration: none; } .contents a:visited { color: #DD7B7B; } a:hover { text-decoration: underline; } a.qindex { font-weight: bold; } a.qindexHL { font-weight: bold; background-color: #EFC2C2; color: #ffffff; border: 1px double #EBB3B3; } .contents a.qindexHL:visited { color: #ffffff; } a.el { font-weight: bold; } a.elRef { } a.code, a.code:visited, a.line, a.line:visited { color: #4665A2; } a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited { color: #4665A2; } /* @end */ dl.el { margin-left: -1cm; } pre.fragment { border: 1px solid #C4CFE5; background-color: #FBFCFD; padding: 4px 6px; margin: 4px 8px 4px 2px; overflow: auto; word-wrap: break-word; font-size: 9pt; line-height: 125%; font-family: monospace, fixed; font-size: 105%; } div.fragment { padding: 4px 6px; margin: 4px 8px 4px 2px; background-color: #FEFDFD; border: 1px solid #F6DCDC; } div.line { font-family: monospace, fixed; font-size: 13px; min-height: 13px; line-height: 1.0; text-wrap: unrestricted; white-space: -moz-pre-wrap; /* Moz */ white-space: -pre-wrap; /* Opera 4-6 */ white-space: -o-pre-wrap; /* Opera 7 */ white-space: pre-wrap; /* CSS3 */ word-wrap: break-word; /* IE 5.5+ */ text-indent: -53px; padding-left: 53px; padding-bottom: 0px; margin: 0px; -webkit-transition-property: background-color, box-shadow; -webkit-transition-duration: 0.5s; -moz-transition-property: background-color, box-shadow; -moz-transition-duration: 0.5s; -ms-transition-property: background-color, box-shadow; -ms-transition-duration: 0.5s; -o-transition-property: background-color, box-shadow; -o-transition-duration: 0.5s; transition-property: background-color, box-shadow; transition-duration: 0.5s; } div.line:after { content:"\000A"; white-space: pre; } div.line.glow { background-color: cyan; box-shadow: 0 0 10px cyan; } span.lineno { padding-right: 4px; text-align: right; border-right: 2px solid #0F0; background-color: #E8E8E8; white-space: pre; } span.lineno a { background-color: #D8D8D8; } span.lineno a:hover { background-color: #C8C8C8; } div.ah, span.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px; padding: 0.2em; border: solid thin #333; border-radius: 0.5em; -webkit-border-radius: .5em; -moz-border-radius: .5em; box-shadow: 2px 2px 3px #999; -webkit-box-shadow: 2px 2px 3px #999; -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000 110%); } div.classindex ul { list-style: none; padding-left: 0; } div.classindex span.ai { display: inline-block; } div.groupHeader { margin-left: 16px; margin-top: 12px; font-weight: bold; } div.groupText { margin-left: 16px; font-style: italic; } body { background-color: white; color: black; margin: 0; } div.contents { margin-top: 10px; margin-left: 12px; margin-right: 8px; } td.indexkey { background-color: #FCF3F3; font-weight: bold; border: 1px solid #F6DCDC; margin: 2px 0px 2px 0; padding: 2px 10px; white-space: nowrap; vertical-align: top; } td.indexvalue { background-color: #FCF3F3; border: 1px solid #F6DCDC; padding: 2px 10px; margin: 2px 0px; } tr.memlist { background-color: #FCF5F5; } p.formulaDsp { text-align: center; } img.formulaDsp { } img.formulaInl { vertical-align: middle; } div.center { text-align: center; margin-top: 0px; margin-bottom: 0px; padding: 0px; } div.center img { border: 0px; } address.footer { text-align: right; padding-right: 12px; } img.footer { border: 0px; vertical-align: middle; } /* @group Code Colorization */ span.keyword { color: #008000 } span.keywordtype { color: #604020 } span.keywordflow { color: #e08000 } span.comment { color: #800000 } span.preprocessor { color: #806020 } span.stringliteral { color: #002080 } span.charliteral { color: #008080 } span.vhdldigit { color: #ff00ff } span.vhdlchar { color: #000000 } span.vhdlkeyword { color: #700070 } span.vhdllogic { color: #ff0000 } blockquote { background-color: #FDFAFA; border-left: 2px solid #EFC2C2; margin: 0 24px 0 4px; padding: 0 12px 0 16px; } /* @end */ /* .search { color: #003399; font-weight: bold; } form.search { margin-bottom: 0px; margin-top: 0px; } input.search { font-size: 75%; color: #000080; font-weight: normal; background-color: #e8eef2; } */ td.tiny { font-size: 75%; } .dirtab { padding: 4px; border-collapse: collapse; border: 1px solid #F0C7C7; } th.dirtab { background: #FCF3F3; font-weight: bold; } hr { height: 0px; border: none; border-top: 1px solid #DE8282; } hr.footer { height: 1px; } /* @group Member Descriptions */ table.memberdecls { border-spacing: 0px; padding: 0px; } .memberdecls td, .fieldtable tr { -webkit-transition-property: background-color, box-shadow; -webkit-transition-duration: 0.5s; -moz-transition-property: background-color, box-shadow; -moz-transition-duration: 0.5s; -ms-transition-property: background-color, box-shadow; -ms-transition-duration: 0.5s; -o-transition-property: background-color, box-shadow; -o-transition-duration: 0.5s; transition-property: background-color, box-shadow; transition-duration: 0.5s; } .memberdecls td.glow, .fieldtable tr.glow { background-color: cyan; box-shadow: 0 0 15px cyan; } .mdescLeft, .mdescRight, .memItemLeft, .memItemRight, .memTemplItemLeft, .memTemplItemRight, .memTemplParams { background-color: #FEFBFB; border: none; margin: 4px; padding: 1px 0 0 8px; } .mdescLeft, .mdescRight { padding: 0px 8px 4px 8px; color: #555; } .memSeparator { border-bottom: 1px solid #DEE4F0; line-height: 1px; margin: 0px; padding: 0px; } .memItemLeft, .memTemplItemLeft { white-space: nowrap; } .memItemRight { width: 100%; } .memTemplParams { color: #DD7B7B; white-space: nowrap; font-size: 80%; } /* @end */ /* @group Member Details */ /* Styles for detailed member documentation */ .memtemplate { font-size: 80%; color: #DD7B7B; font-weight: normal; margin-left: 9px; } .memnav { background-color: #FCF3F3; border: 1px solid #F0C7C7; text-align: center; margin: 2px; margin-right: 15px; padding: 2px; } .mempage { width: 100%; } .memitem { padding: 0; margin-bottom: 10px; margin-right: 5px; -webkit-transition: box-shadow 0.5s linear; -moz-transition: box-shadow 0.5s linear; -ms-transition: box-shadow 0.5s linear; -o-transition: box-shadow 0.5s linear; transition: box-shadow 0.5s linear; display: table !important; width: 100%; } .memitem.glow { box-shadow: 0 0 15px cyan; } .memname { font-weight: bold; margin-left: 6px; } .memname td { vertical-align: bottom; } .memproto, dl.reflist dt { border-top: 1px solid #F1CACA; border-left: 1px solid #F1CACA; border-right: 1px solid #F1CACA; padding: 6px 0px 6px 0px; color: #C63333; font-weight: bold; text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); background-image:url('nav_f.png'); background-repeat:repeat-x; background-color: #FAEEEE; /* opera specific markup */ box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); border-top-right-radius: 4px; border-top-left-radius: 4px; /* firefox specific markup */ -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; -moz-border-radius-topright: 4px; -moz-border-radius-topleft: 4px; /* webkit specific markup */ -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); -webkit-border-top-right-radius: 4px; -webkit-border-top-left-radius: 4px; } .memdoc, dl.reflist dd { border-bottom: 1px solid #F1CACA; border-left: 1px solid #F1CACA; border-right: 1px solid #F1CACA; padding: 6px 10px 2px 10px; background-color: #FEFDFD; border-top-width: 0; background-image:url('nav_g.png'); background-repeat:repeat-x; background-color: #FFFFFF; /* opera specific markup */ border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); /* firefox specific markup */ -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; /* webkit specific markup */ -webkit-border-bottom-left-radius: 4px; -webkit-border-bottom-right-radius: 4px; -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); } dl.reflist dt { padding: 5px; } dl.reflist dd { margin: 0px 0px 10px 0px; padding: 5px; } .paramkey { text-align: right; } .paramtype { white-space: nowrap; } .paramname { color: #602020; white-space: nowrap; } .paramname em { font-style: normal; } .paramname code { line-height: 14px; } .params, .retval, .exception, .tparams { margin-left: 0px; padding-left: 0px; } .params .paramname, .retval .paramname { font-weight: bold; vertical-align: top; } .params .paramtype { font-style: italic; vertical-align: top; } .params .paramdir { font-family: "courier new",courier,monospace; vertical-align: top; } table.mlabels { border-spacing: 0px; } td.mlabels-left { width: 100%; padding: 0px; } td.mlabels-right { vertical-align: bottom; padding: 0px; white-space: nowrap; } span.mlabels { margin-left: 8px; } span.mlabel { background-color: #E7A4A4; border-top:1px solid #E18D8D; border-left:1px solid #E18D8D; border-right:1px solid #F6DCDC; border-bottom:1px solid #F6DCDC; text-shadow: none; color: white; margin-right: 4px; padding: 2px 3px; border-radius: 3px; font-size: 7pt; white-space: nowrap; vertical-align: middle; } /* @end */ /* these are for tree view inside a (index) page */ div.directory { margin: 10px 0px; border-top: 1px solid #EFC2C2; border-bottom: 1px solid #EFC2C2; width: 100%; } .directory table { border-collapse:collapse; } .directory td { margin: 0px; padding: 0px; vertical-align: top; } .directory td.entry { white-space: nowrap; padding-right: 6px; padding-top: 3px; } .directory td.entry a { outline:none; } .directory td.entry a img { border: none; } .directory td.desc { width: 100%; padding-left: 6px; padding-right: 6px; padding-top: 3px; border-left: 1px solid rgba(0,0,0,0.05); } .directory tr.even { padding-left: 6px; background-color: #FDFAFA; } .directory img { vertical-align: -30%; } .directory .levels { white-space: nowrap; width: 100%; text-align: right; font-size: 9pt; } .directory .levels span { cursor: pointer; padding-left: 2px; padding-right: 2px; color: #D86868; } .arrow { color: #EFC2C2; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; cursor: pointer; font-size: 80%; display: inline-block; width: 16px; height: 22px; } .icon { font-family: Arial, Helvetica; font-weight: bold; font-size: 12px; height: 14px; width: 16px; display: inline-block; background-color: #E7A4A4; color: white; text-align: center; border-radius: 4px; margin-left: 2px; margin-right: 2px; } .icona { width: 24px; height: 22px; display: inline-block; } .iconfopen { width: 24px; height: 18px; margin-bottom: 4px; background-image:url('folderopen.png'); background-position: 0px -4px; background-repeat: repeat-y; vertical-align:top; display: inline-block; } .iconfclosed { width: 24px; height: 18px; margin-bottom: 4px; background-image:url('folderclosed.png'); background-position: 0px -4px; background-repeat: repeat-y; vertical-align:top; display: inline-block; } .icondoc { width: 24px; height: 18px; margin-bottom: 4px; background-image:url('doc.png'); background-position: 0px -4px; background-repeat: repeat-y; vertical-align:top; display: inline-block; } table.directory { font: 400 14px Roboto,sans-serif; } /* @end */ div.dynheader { margin-top: 8px; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } address { font-style: normal; color: #CD3E3E; } table.doxtable caption { caption-side: top; } table.doxtable { border-collapse:collapse; margin-top: 4px; margin-bottom: 4px; } table.doxtable td, table.doxtable th { border: 1px solid #CE4545; padding: 3px 7px 2px; } table.doxtable th { background-color: #D45C5C; color: #FFFFFF; font-size: 110%; padding-bottom: 4px; padding-top: 5px; } table.fieldtable { /*width: 100%;*/ margin-bottom: 10px; border: 1px solid #F1CACA; border-spacing: 0px; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); } .fieldtable td, .fieldtable th { padding: 3px 7px 2px; } .fieldtable td.fieldtype, .fieldtable td.fieldname { white-space: nowrap; border-right: 1px solid #F1CACA; border-bottom: 1px solid #F1CACA; vertical-align: top; } .fieldtable td.fieldname { padding-top: 3px; } .fieldtable td.fielddoc { border-bottom: 1px solid #F1CACA; /*width: 100%;*/ } .fieldtable td.fielddoc p:first-child { margin-top: 0px; } .fieldtable td.fielddoc p:last-child { margin-bottom: 2px; } .fieldtable tr:last-child td { border-bottom: none; } .fieldtable th { background-image:url('nav_f.png'); background-repeat:repeat-x; background-color: #FAEEEE; font-size: 90%; color: #C63333; padding-bottom: 4px; padding-top: 5px; text-align:left; -moz-border-radius-topleft: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-left-radius: 4px; -webkit-border-top-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom: 1px solid #F1CACA; } .tabsearch { top: 0px; left: 10px; height: 36px; background-image: url('tab_b.png'); z-index: 101; overflow: hidden; font-size: 13px; } .navpath ul { font-size: 11px; background-image:url('tab_b.png'); background-repeat:repeat-x; background-position: 0 -5px; height:30px; line-height:30px; color:#ECB5B5; border:solid 1px #F5DADA; overflow:hidden; margin:0px; padding:0px; } .navpath li { list-style-type:none; float:left; padding-left:10px; padding-right:15px; background-image:url('bc_s.png'); background-repeat:no-repeat; background-position:right; color:#D45A5A; } .navpath li.navelem a { height:32px; display:block; text-decoration: none; outline: none; color: #CB3939; font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); text-decoration: none; } .navpath li.navelem a:hover { color:#E59D9D; } .navpath li.footer { list-style-type:none; float:right; padding-left:10px; padding-right:15px; background-image:none; background-repeat:no-repeat; background-position:right; color:#D45A5A; font-size: 8pt; } div.summary { float: right; font-size: 8pt; padding-right: 5px; width: 50%; text-align: right; } div.summary a { white-space: nowrap; } table.classindex { margin: 10px; white-space: nowrap; margin-left: 3%; margin-right: 3%; width: 94%; border: 0; border-spacing: 0; padding: 0; } div.ingroups { font-size: 8pt; width: 50%; text-align: left; } div.ingroups a { white-space: nowrap; } div.header { background-image:url('nav_h.png'); background-repeat:repeat-x; background-color: #FEFBFB; margin: 0px; border-bottom: 1px solid #F6DCDC; } div.headertitle { padding: 5px 5px 5px 10px; } dl { padding: 0 0 0 10px; } /* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug */ dl.section { margin-left: 0px; padding-left: 0px; } dl.note { margin-left:-7px; padding-left: 3px; border-left:4px solid; border-color: #D0C000; } dl.warning, dl.attention { margin-left:-7px; padding-left: 3px; border-left:4px solid; border-color: #FF0000; } dl.pre, dl.post, dl.invariant { margin-left:-7px; padding-left: 3px; border-left:4px solid; border-color: #00D000; } dl.deprecated { margin-left:-7px; padding-left: 3px; border-left:4px solid; border-color: #505050; } dl.todo { margin-left:-7px; padding-left: 3px; border-left:4px solid; border-color: #00C0E0; } dl.test { margin-left:-7px; padding-left: 3px; border-left:4px solid; border-color: #3030E0; } dl.bug { margin-left:-7px; padding-left: 3px; border-left:4px solid; border-color: #C08050; } dl.section dd { margin-bottom: 6px; } #projectlogo { text-align: center; vertical-align: bottom; border-collapse: separate; } #projectlogo img { border: 0px none; } #projectalign { vertical-align: middle; } #projectname { font: 300% Tahoma, Arial,sans-serif; margin: 0px; padding: 2px 0px; } #projectbrief { font: 120% Tahoma, Arial,sans-serif; margin: 0px; padding: 0px; } #projectnumber { font: 50% Tahoma, Arial,sans-serif; margin: 0px; padding: 0px; } #titlearea { padding: 0px; margin: 0px; width: 100%; border-bottom: 1px solid #E18D8D; } .image { text-align: center; } .dotgraph { text-align: center; } .mscgraph { text-align: center; } .diagraph { text-align: center; } .caption { font-weight: bold; } div.zoom { border: 1px solid #EDBABA; } dl.citelist { margin-bottom:50px; } dl.citelist dt { color:#D25252; float:left; font-weight:bold; margin-right:10px; padding:5px; } dl.citelist dd { margin:2px 0; padding:5px 0; } div.toc { padding: 14px 25px; background-color: #FDF9F9; border: 1px solid #F9E8E8; border-radius: 7px 7px 7px 7px; float: right; height: auto; margin: 0 8px 10px 10px; width: 200px; } div.toc li { background: url("bdwn.png") no-repeat scroll 0 5px transparent; font: 10px/1.2 Verdana,DejaVu Sans,Geneva,sans-serif; margin-top: 5px; padding-left: 10px; padding-top: 2px; } div.toc h3 { font: bold 12px/1.2 Arial,FreeSans,sans-serif; color: #DD7B7B; border-bottom: 0 none; margin: 0; } div.toc ul { list-style: none outside none; border: medium none; padding: 0px; } div.toc li.level1 { margin-left: 0px; } div.toc li.level2 { margin-left: 15px; } div.toc li.level3 { margin-left: 30px; } div.toc li.level4 { margin-left: 45px; } .inherit_header { font-weight: bold; color: gray; cursor: pointer; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .inherit_header td { padding: 6px 0px 2px 5px; } .inherit { display: none; } tr.heading h2 { margin-top: 12px; margin-bottom: 4px; } /* tooltip related style info */ .ttc { position: absolute; display: none; } #powerTip { cursor: default; white-space: nowrap; background-color: white; border: 1px solid gray; border-radius: 4px 4px 4px 4px; box-shadow: 1px 1px 7px gray; display: none; font-size: smaller; max-width: 80%; opacity: 0.9; padding: 1ex 1em 1em; position: absolute; z-index: 2147483647; } #powerTip div.ttdoc { color: grey; font-style: italic; } #powerTip div.ttname a { font-weight: bold; } #powerTip div.ttname { font-weight: bold; } #powerTip div.ttdeci { color: #006318; } #powerTip div { margin: 0px; padding: 0px; font: 12px/16px Roboto,sans-serif; } #powerTip:before, #powerTip:after { content: ""; position: absolute; margin: 0px; } #powerTip.n:after, #powerTip.n:before, #powerTip.s:after, #powerTip.s:before, #powerTip.w:after, #powerTip.w:before, #powerTip.e:after, #powerTip.e:before, #powerTip.ne:after, #powerTip.ne:before, #powerTip.se:after, #powerTip.se:before, #powerTip.nw:after, #powerTip.nw:before, #powerTip.sw:after, #powerTip.sw:before { border: solid transparent; content: " "; height: 0; width: 0; position: absolute; } #powerTip.n:after, #powerTip.s:after, #powerTip.w:after, #powerTip.e:after, #powerTip.nw:after, #powerTip.ne:after, #powerTip.sw:after, #powerTip.se:after { border-color: rgba(255, 255, 255, 0); } #powerTip.n:before, #powerTip.s:before, #powerTip.w:before, #powerTip.e:before, #powerTip.nw:before, #powerTip.ne:before, #powerTip.sw:before, #powerTip.se:before { border-color: rgba(128, 128, 128, 0); } #powerTip.n:after, #powerTip.n:before, #powerTip.ne:after, #powerTip.ne:before, #powerTip.nw:after, #powerTip.nw:before { top: 100%; } #powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after { border-top-color: #ffffff; border-width: 10px; margin: 0px -10px; } #powerTip.n:before { border-top-color: #808080; border-width: 11px; margin: 0px -11px; } #powerTip.n:after, #powerTip.n:before { left: 50%; } #powerTip.nw:after, #powerTip.nw:before { right: 14px; } #powerTip.ne:after, #powerTip.ne:before { left: 14px; } #powerTip.s:after, #powerTip.s:before, #powerTip.se:after, #powerTip.se:before, #powerTip.sw:after, #powerTip.sw:before { bottom: 100%; } #powerTip.s:after, #powerTip.se:after, #powerTip.sw:after { border-bottom-color: #ffffff; border-width: 10px; margin: 0px -10px; } #powerTip.s:before, #powerTip.se:before, #powerTip.sw:before { border-bottom-color: #808080; border-width: 11px; margin: 0px -11px; } #powerTip.s:after, #powerTip.s:before { left: 50%; } #powerTip.sw:after, #powerTip.sw:before { right: 14px; } #powerTip.se:after, #powerTip.se:before { left: 14px; } #powerTip.e:after, #powerTip.e:before { left: 100%; } #powerTip.e:after { border-left-color: #ffffff; border-width: 10px; top: 50%; margin-top: -10px; } #powerTip.e:before { border-left-color: #808080; border-width: 11px; top: 50%; margin-top: -11px; } #powerTip.w:after, #powerTip.w:before { right: 100%; } #powerTip.w:after { border-right-color: #ffffff; border-width: 10px; top: 50%; margin-top: -10px; } #powerTip.w:before { border-right-color: #808080; border-width: 11px; top: 50%; margin-top: -11px; } @media print { #top { display: none; } #side-nav { display: none; } #nav-path { display: none; } body { overflow:visible; } h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } .summary { display: none; } .memitem { page-break-inside: avoid; } #doc-content { margin-left:0 !important; height:auto !important; width:auto !important; overflow:inherit; display:inline; } }
Java
/* * LazyListView * Copyright (C) 2015 Romeo Calota <kicsyromy@gmail.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/>. */ #ifndef LAZYLISTVIEW_H #define LAZYLISTVIEW_H #include <QQuickItem> #include <QQmlComponent> #include <QScopedPointer> #include <QSharedPointer> class QQuickFlickable; class ItemPool; class LazyListView : public QQuickItem { Q_OBJECT Q_PROPERTY(int orientation READ getOrientation WRITE setOrientation NOTIFY orientationChanged) Q_PROPERTY(QQmlComponent * delegate READ getDelegate WRITE setDelegate NOTIFY delegateChanged) Q_PROPERTY(QObject * model READ getModel WRITE setModel NOTIFY modelChanged) public: LazyListView(); ~LazyListView(); public: int getOrientation() const; void setOrientation(int orientation); QQmlComponent * getDelegate() const; void setDelegate(QQmlComponent *delegate); QObject *getModel() const; void setModel(QObject *model); signals: void orientationChanged(); void delegateChanged(); void modelChanged(); private: void createListItems(QQmlComponent *component); void rearangeListItems(); private: QScopedPointer<QQuickFlickable> m_flickable; int m_cacheSize; QScopedPointer<ItemPool> m_itemPool; QObject *m_model; // This limits model types... can't be an int for instance QList<QQuickItem *> m_visibleItems; // Maybe as a LinkedList this would be more efficient? QQmlComponent *m_delegate; }; #endif // LAZYLISTVIEW_H
Java
/** * ***************************************************************************** * Copyright 2013 Kevin Hester * * See LICENSE.txt for license details. * * 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.geeksville.aws import com.amazonaws.auth.AWSCredentials import com.typesafe.config.ConfigFactory import grizzled.slf4j.Logging /** * Provides AWS credentials from a Typesafe style config db * * @param baseKey - we look for AWS keys underneed this root entry */ class ConfigCredentials(baseKey: String) extends AWSCredentials with Logging { private lazy val conf = ConfigFactory.load() private def prefix = if (baseKey.isEmpty) baseKey else baseKey + "." def getAWSAccessKeyId() = { val r = conf.getString(prefix + "aws.accessKey") //debug(s"Using AWS access key $r") r } def getAWSSecretKey() = { val r = conf.getString(prefix + "aws.secretKey") //debug(s"Using AWS secret key $r") r } }
Java
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Phaser Source: src/gameobjects/Image.js</title> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/default.css"> <link type="text/css" rel="stylesheet" href="styles/sunlight.default.css"> <link type="text/css" rel="stylesheet" href="styles/site.cerulean.css"> </head> <body> <div class="container-fluid"> <div class="navbar navbar-fixed-top navbar-inverse"> <div style="position: absolute; width: 143px; height: 31px; right: 10px; top: 10px; z-index: 1050"><a href="http://phaser.io"><img src="img/phaser.png" border="0" /></a></div> <div class="navbar-inner"> <a class="brand" href="index.html">Phaser API</a> <ul class="nav"> <li class="dropdown"> <a href="namespaces.list.html" class="dropdown-toggle" data-toggle="dropdown">Namespaces<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-0"> <a href="Phaser.html">Phaser</a> </li> <li class="class-depth-0"> <a href="Phaser.KeyCode.html">KeyCode</a> </li> <li class="class-depth-0"> <a href="PIXI.html">PIXI</a> </li> </ul> </li> <li class="dropdown"> <a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-1"> <a href="Phaser.Animation.html">Animation</a> </li> <li class="class-depth-1"> <a href="Phaser.AnimationManager.html">AnimationManager</a> </li> <li class="class-depth-1"> <a href="Phaser.AnimationParser.html">AnimationParser</a> </li> <li class="class-depth-1"> <a href="Phaser.ArraySet.html">ArraySet</a> </li> <li class="class-depth-1"> <a href="Phaser.ArrayUtils.html">ArrayUtils</a> </li> <li class="class-depth-1"> <a href="Phaser.AudioSprite.html">AudioSprite</a> </li> <li class="class-depth-1"> <a href="Phaser.BitmapData.html">BitmapData</a> </li> <li class="class-depth-1"> <a href="Phaser.BitmapText.html">BitmapText</a> </li> <li class="class-depth-1"> <a href="Phaser.Bullet.html">Bullet</a> </li> <li class="class-depth-1"> <a href="Phaser.Button.html">Button</a> </li> <li class="class-depth-1"> <a href="Phaser.Cache.html">Cache</a> </li> <li class="class-depth-1"> <a href="Phaser.Camera.html">Camera</a> </li> <li class="class-depth-1"> <a href="Phaser.Canvas.html">Canvas</a> </li> <li class="class-depth-1"> <a href="Phaser.Circle.html">Circle</a> </li> <li class="class-depth-1"> <a href="Phaser.Color.html">Color</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Angle.html">Angle</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Animation.html">Animation</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.AutoCull.html">AutoCull</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Bounds.html">Bounds</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.BringToTop.html">BringToTop</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Core.html">Core</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Crop.html">Crop</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Delta.html">Delta</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Destroy.html">Destroy</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.FixedToCamera.html">FixedToCamera</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Health.html">Health</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.InCamera.html">InCamera</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.InputEnabled.html">InputEnabled</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.InWorld.html">InWorld</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.LifeSpan.html">LifeSpan</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.LoadTexture.html">LoadTexture</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Overlap.html">Overlap</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.PhysicsBody.html">PhysicsBody</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Reset.html">Reset</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.ScaleMinMax.html">ScaleMinMax</a> </li> <li class="class-depth-2"> <a href="Phaser.Component.Smoothed.html">Smoothed</a> </li> <li class="class-depth-1"> <a href="Phaser.Create.html">Create</a> </li> <li class="class-depth-1"> <a href="Phaser.Creature.html">Creature</a> </li> <li class="class-depth-1"> <a href="Phaser.Device.html">Device</a> </li> <li class="class-depth-1"> <a href="Phaser.DeviceButton.html">DeviceButton</a> </li> <li class="class-depth-1"> <a href="Phaser.DOM.html">DOM</a> </li> <li class="class-depth-1"> <a href="Phaser.Easing.html">Easing</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Back.html">Back</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Bounce.html">Bounce</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Circular.html">Circular</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Cubic.html">Cubic</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Elastic.html">Elastic</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Exponential.html">Exponential</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Linear.html">Linear</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Quadratic.html">Quadratic</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Quartic.html">Quartic</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Quintic.html">Quintic</a> </li> <li class="class-depth-2"> <a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a> </li> <li class="class-depth-1"> <a href="Phaser.Ellipse.html">Ellipse</a> </li> <li class="class-depth-1"> <a href="Phaser.Events.html">Events</a> </li> <li class="class-depth-1"> <a href="Phaser.Filter.html">Filter</a> </li> <li class="class-depth-1"> <a href="Phaser.FlexGrid.html">FlexGrid</a> </li> <li class="class-depth-1"> <a href="Phaser.FlexLayer.html">FlexLayer</a> </li> <li class="class-depth-1"> <a href="Phaser.Frame.html">Frame</a> </li> <li class="class-depth-1"> <a href="Phaser.FrameData.html">FrameData</a> </li> <li class="class-depth-1"> <a href="Phaser.Game.html">Game</a> </li> <li class="class-depth-1"> <a href="Phaser.GameObjectCreator.html">GameObjectCreator</a> </li> <li class="class-depth-1"> <a href="Phaser.GameObjectFactory.html">GameObjectFactory</a> </li> <li class="class-depth-1"> <a href="Phaser.Gamepad.html">Gamepad</a> </li> <li class="class-depth-1"> <a href="Phaser.Graphics.html">Graphics</a> </li> <li class="class-depth-1"> <a href="Phaser.Group.html">Group</a> </li> <li class="class-depth-1"> <a href="Phaser.Image.html">Image</a> </li> <li class="class-depth-1"> <a href="Phaser.ImageCollection.html">ImageCollection</a> </li> <li class="class-depth-1"> <a href="Phaser.Input.html">Input</a> </li> <li class="class-depth-1"> <a href="Phaser.InputHandler.html">InputHandler</a> </li> <li class="class-depth-1"> <a href="Phaser.Key.html">Key</a> </li> <li class="class-depth-1"> <a href="Phaser.Keyboard.html">Keyboard</a> </li> <li class="class-depth-1"> <a href="Phaser.Line.html">Line</a> </li> <li class="class-depth-1"> <a href="Phaser.LinkedList.html">LinkedList</a> </li> <li class="class-depth-1"> <a href="Phaser.Loader.html">Loader</a> </li> <li class="class-depth-1"> <a href="Phaser.LoaderParser.html">LoaderParser</a> </li> <li class="class-depth-1"> <a href="Phaser.Math.html">Math</a> </li> <li class="class-depth-1"> <a href="Phaser.Matrix.html">Matrix</a> </li> <li class="class-depth-1"> <a href="Phaser.Mouse.html">Mouse</a> </li> <li class="class-depth-1"> <a href="Phaser.MSPointer.html">MSPointer</a> </li> <li class="class-depth-1"> <a href="Phaser.Net.html">Net</a> </li> <li class="class-depth-1"> <a href="Phaser.Particle.html">Particle</a> </li> <li class="class-depth-1"> <a href="Phaser.Particles.html">Particles</a> </li> <li class="class-depth-2"> <a href="Phaser.Particles.Arcade.html">Arcade</a> </li> <li class="class-depth-3"> <a href="Phaser.Particles.Arcade.Emitter.html">Emitter</a> </li> <li class="class-depth-1"> <a href="Phaser.Physics.html">Physics</a> </li> <li class="class-depth-2"> <a href="Phaser.Physics.Arcade.html">Arcade</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.Arcade.Body.html">Body</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.Arcade.TilemapCollision.html">TilemapCollision</a> </li> <li class="class-depth-2"> <a href="Phaser.Physics.Ninja.html">Ninja</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.Ninja.AABB.html">AABB</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.Ninja.Body.html">Body</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.Ninja.Circle.html">Circle</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.Ninja.Tile.html">Tile</a> </li> <li class="class-depth-2"> <a href="Phaser.Physics.P2.html">P2</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.Body.html">Body</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.BodyDebug.html">BodyDebug</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.DistanceConstraint.html">DistanceConstraint</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.FixtureList.html">FixtureList</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.GearConstraint.html">GearConstraint</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.InversePointProxy.html">InversePointProxy</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.LockConstraint.html">LockConstraint</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.Material.html">Material</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.PointProxy.html">PointProxy</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.PrismaticConstraint.html">PrismaticConstraint</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.RotationalSpring.html">RotationalSpring</a> </li> <li class="class-depth-3"> <a href="Phaser.Physics.P2.Spring.html">Spring</a> </li> <li class="class-depth-1"> <a href="Phaser.Plugin.html">Plugin</a> </li> <li class="class-depth-1"> <a href="Phaser.PluginManager.html">PluginManager</a> </li> <li class="class-depth-1"> <a href="Phaser.Point.html">Point</a> </li> <li class="class-depth-1"> <a href="Phaser.Pointer.html">Pointer</a> </li> <li class="class-depth-1"> <a href="Phaser.PointerMode.html">PointerMode</a> </li> <li class="class-depth-1"> <a href="Phaser.Polygon.html">Polygon</a> </li> <li class="class-depth-1"> <a href="Phaser.QuadTree.html">QuadTree</a> </li> <li class="class-depth-1"> <a href="Phaser.RandomDataGenerator.html">RandomDataGenerator</a> </li> <li class="class-depth-1"> <a href="Phaser.Rectangle.html">Rectangle</a> </li> <li class="class-depth-1"> <a href="Phaser.RenderTexture.html">RenderTexture</a> </li> <li class="class-depth-1"> <a href="Phaser.RequestAnimationFrame.html">RequestAnimationFrame</a> </li> <li class="class-depth-1"> <a href="Phaser.RetroFont.html">RetroFont</a> </li> <li class="class-depth-1"> <a href="Phaser.Rope.html">Rope</a> </li> <li class="class-depth-1"> <a href="Phaser.RoundedRectangle.html">RoundedRectangle</a> </li> <li class="class-depth-1"> <a href="Phaser.ScaleManager.html">ScaleManager</a> </li> <li class="class-depth-1"> <a href="Phaser.Signal.html">Signal</a> </li> <li class="class-depth-1"> <a href="Phaser.SignalBinding.html">SignalBinding</a> </li> <li class="class-depth-1"> <a href="Phaser.SinglePad.html">SinglePad</a> </li> <li class="class-depth-1"> <a href="Phaser.Sound.html">Sound</a> </li> <li class="class-depth-1"> <a href="Phaser.SoundManager.html">SoundManager</a> </li> <li class="class-depth-1"> <a href="Phaser.Sprite.html">Sprite</a> </li> <li class="class-depth-1"> <a href="Phaser.SpriteBatch.html">SpriteBatch</a> </li> <li class="class-depth-1"> <a href="Phaser.Stage.html">Stage</a> </li> <li class="class-depth-1"> <a href="Phaser.State.html">State</a> </li> <li class="class-depth-1"> <a href="Phaser.StateManager.html">StateManager</a> </li> <li class="class-depth-1"> <a href="Phaser.Text.html">Text</a> </li> <li class="class-depth-1"> <a href="Phaser.Tile.html">Tile</a> </li> <li class="class-depth-1"> <a href="Phaser.Tilemap.html">Tilemap</a> </li> <li class="class-depth-1"> <a href="Phaser.TilemapLayer.html">TilemapLayer</a> </li> <li class="class-depth-1"> <a href="Phaser.TilemapParser.html">TilemapParser</a> </li> <li class="class-depth-1"> <a href="Phaser.Tileset.html">Tileset</a> </li> <li class="class-depth-1"> <a href="Phaser.TileSprite.html">TileSprite</a> </li> <li class="class-depth-1"> <a href="Phaser.Time.html">Time</a> </li> <li class="class-depth-1"> <a href="Phaser.Timer.html">Timer</a> </li> <li class="class-depth-1"> <a href="Phaser.TimerEvent.html">TimerEvent</a> </li> <li class="class-depth-1"> <a href="Phaser.Touch.html">Touch</a> </li> <li class="class-depth-1"> <a href="Phaser.Tween.html">Tween</a> </li> <li class="class-depth-1"> <a href="Phaser.TweenData.html">TweenData</a> </li> <li class="class-depth-1"> <a href="Phaser.TweenManager.html">TweenManager</a> </li> <li class="class-depth-1"> <a href="Phaser.Utils.html">Utils</a> </li> <li class="class-depth-2"> <a href="Phaser.Utils.Debug.html">Debug</a> </li> <li class="class-depth-1"> <a href="Phaser.Video.html">Video</a> </li> <li class="class-depth-1"> <a href="Phaser.Weapon.html">Weapon</a> </li> <li class="class-depth-1"> <a href="Phaser.World.html">World</a> </li> <li class="class-depth-1"> <a href="PIXI.AbstractFilter.html">AbstractFilter</a> </li> <li class="class-depth-1"> <a href="PIXI.BaseTexture.html">BaseTexture</a> </li> <li class="class-depth-1"> <a href="PIXI.CanvasBuffer.html">CanvasBuffer</a> </li> <li class="class-depth-1"> <a href="PIXI.CanvasGraphics.html">CanvasGraphics</a> </li> <li class="class-depth-1"> <a href="PIXI.CanvasMaskManager.html">CanvasMaskManager</a> </li> <li class="class-depth-1"> <a href="PIXI.CanvasPool.html">CanvasPool</a> </li> <li class="class-depth-1"> <a href="PIXI.CanvasRenderer.html">CanvasRenderer</a> </li> <li class="class-depth-1"> <a href="PIXI.CanvasTinter.html">CanvasTinter</a> </li> <li class="class-depth-1"> <a href="PIXI.ComplexPrimitiveShader.html">ComplexPrimitiveShader</a> </li> <li class="class-depth-1"> <a href="PIXI.DisplayObjectContainer.html">DisplayObjectContainer</a> </li> <li class="class-depth-1"> <a href="PIXI.EarCut.html">EarCut</a> </li> <li class="class-depth-1"> <a href="PIXI.Event.html">Event</a> </li> <li class="class-depth-1"> <a href="PIXI.EventTarget.html">EventTarget</a> </li> <li class="class-depth-1"> <a href="PIXI.FilterTexture.html">FilterTexture</a> </li> <li class="class-depth-1"> <a href="PIXI.Graphics.html">Graphics</a> </li> <li class="class-depth-1"> <a href="PIXI.GraphicsData.html">GraphicsData</a> </li> <li class="class-depth-1"> <a href="PIXI.PIXI.html">PIXI</a> </li> <li class="class-depth-2"> <a href="PIXI.PIXI.DisplayObject.html">DisplayObject</a> </li> <li class="class-depth-1"> <a href="PIXI.PixiFastShader.html">PixiFastShader</a> </li> <li class="class-depth-1"> <a href="PIXI.PixiShader.html">PixiShader</a> </li> <li class="class-depth-1"> <a href="PIXI.PolyK.html">PolyK</a> </li> <li class="class-depth-1"> <a href="PIXI.PrimitiveShader.html">PrimitiveShader</a> </li> <li class="class-depth-1"> <a href="PIXI.RenderTexture.html">RenderTexture</a> </li> <li class="class-depth-1"> <a href="PIXI.Rope.html">Rope</a> </li> <li class="class-depth-1"> <a href="PIXI.Sprite.html">Sprite</a> </li> <li class="class-depth-1"> <a href="PIXI.SpriteBatch.html">SpriteBatch</a> </li> <li class="class-depth-1"> <a href="PIXI.Strip.html">Strip</a> </li> <li class="class-depth-1"> <a href="PIXI.StripShader.html">StripShader</a> </li> <li class="class-depth-1"> <a href="PIXI.Texture.html">Texture</a> </li> <li class="class-depth-1"> <a href="PIXI.TilingSprite.html">TilingSprite</a> </li> <li class="class-depth-1"> <a href="PIXI.WebGLBlendModeManager.html">WebGLBlendModeManager</a> </li> <li class="class-depth-1"> <a href="PIXI.WebGLFastSpriteBatch.html">WebGLFastSpriteBatch</a> </li> <li class="class-depth-1"> <a href="PIXI.WebGLFilterManager.html">WebGLFilterManager</a> </li> <li class="class-depth-1"> <a href="PIXI.WebGLRenderer.html">WebGLRenderer</a> </li> </ul> </li> <li class="dropdown"> <a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-0"> <a href="global.html#ANGLE_DOWN">ANGLE_DOWN</a> </li> <li class="class-depth-0"> <a href="global.html#ANGLE_LEFT">ANGLE_LEFT</a> </li> <li class="class-depth-0"> <a href="global.html#ANGLE_NORTH_EAST">ANGLE_NORTH_EAST</a> </li> <li class="class-depth-0"> <a href="global.html#ANGLE_NORTH_WEST">ANGLE_NORTH_WEST</a> </li> <li class="class-depth-0"> <a href="global.html#ANGLE_RIGHT">ANGLE_RIGHT</a> </li> <li class="class-depth-0"> <a href="global.html#ANGLE_SOUTH_EAST">ANGLE_SOUTH_EAST</a> </li> <li class="class-depth-0"> <a href="global.html#ANGLE_SOUTH_WEST">ANGLE_SOUTH_WEST</a> </li> <li class="class-depth-0"> <a href="global.html#ANGLE_UP">ANGLE_UP</a> </li> <li class="class-depth-0"> <a href="global.html#AUTO">AUTO</a> </li> <li class="class-depth-0"> <a href="global.html#BITMAPDATA">BITMAPDATA</a> </li> <li class="class-depth-0"> <a href="global.html#BITMAPTEXT">BITMAPTEXT</a> </li> <li class="class-depth-0"> <a href="global.html#blendModes">blendModes</a> </li> <li class="class-depth-0"> <a href="global.html#BOTTOM_CENTER">BOTTOM_CENTER</a> </li> <li class="class-depth-0"> <a href="global.html#BOTTOM_LEFT">BOTTOM_LEFT</a> </li> <li class="class-depth-0"> <a href="global.html#BOTTOM_RIGHT">BOTTOM_RIGHT</a> </li> <li class="class-depth-0"> <a href="global.html#BUTTON">BUTTON</a> </li> <li class="class-depth-0"> <a href="global.html#CANVAS">CANVAS</a> </li> <li class="class-depth-0"> <a href="global.html#CANVAS_FILTER">CANVAS_FILTER</a> </li> <li class="class-depth-0"> <a href="global.html#CENTER">CENTER</a> </li> <li class="class-depth-0"> <a href="global.html#CIRCLE">CIRCLE</a> </li> <li class="class-depth-0"> <a href="global.html#CREATURE">CREATURE</a> </li> <li class="class-depth-0"> <a href="global.html#displayList">displayList</a> </li> <li class="class-depth-0"> <a href="global.html#DOWN">DOWN</a> </li> <li class="class-depth-0"> <a href="global.html#ELLIPSE">ELLIPSE</a> </li> <li class="class-depth-0"> <a href="global.html#EMITTER">EMITTER</a> </li> <li class="class-depth-0"> <a href="global.html#GAMES">GAMES</a> </li> <li class="class-depth-0"> <a href="global.html#GRAPHICS">GRAPHICS</a> </li> <li class="class-depth-0"> <a href="global.html#GROUP">GROUP</a> </li> <li class="class-depth-0"> <a href="global.html#HEADLESS">HEADLESS</a> </li> <li class="class-depth-0"> <a href="global.html#HORIZONTAL">HORIZONTAL</a> </li> <li class="class-depth-0"> <a href="global.html#IMAGE">IMAGE</a> </li> <li class="class-depth-0"> <a href="global.html#intersectsRectangle">intersectsRectangle</a> </li> <li class="class-depth-0"> <a href="global.html#LANDSCAPE">LANDSCAPE</a> </li> <li class="class-depth-0"> <a href="global.html#LEFT">LEFT</a> </li> <li class="class-depth-0"> <a href="global.html#LEFT_BOTTOM">LEFT_BOTTOM</a> </li> <li class="class-depth-0"> <a href="global.html#LEFT_CENTER">LEFT_CENTER</a> </li> <li class="class-depth-0"> <a href="global.html#LEFT_TOP">LEFT_TOP</a> </li> <li class="class-depth-0"> <a href="global.html#LINE">LINE</a> </li> <li class="class-depth-0"> <a href="global.html#MATRIX">MATRIX</a> </li> <li class="class-depth-0"> <a href="global.html#NONE">NONE</a> </li> <li class="class-depth-0"> <a href="global.html#PENDING_ATLAS">PENDING_ATLAS</a> </li> <li class="class-depth-0"> <a href="global.html#POINT">POINT</a> </li> <li class="class-depth-0"> <a href="global.html#POINTER">POINTER</a> </li> <li class="class-depth-0"> <a href="global.html#POLYGON">POLYGON</a> </li> <li class="class-depth-0"> <a href="global.html#PORTRAIT">PORTRAIT</a> </li> <li class="class-depth-0"> <a href="global.html#RECTANGLE">RECTANGLE</a> </li> <li class="class-depth-0"> <a href="global.html#RENDERTEXTURE">RENDERTEXTURE</a> </li> <li class="class-depth-0"> <a href="global.html#RETROFONT">RETROFONT</a> </li> <li class="class-depth-0"> <a href="global.html#RIGHT">RIGHT</a> </li> <li class="class-depth-0"> <a href="global.html#RIGHT_BOTTOM">RIGHT_BOTTOM</a> </li> <li class="class-depth-0"> <a href="global.html#RIGHT_CENTER">RIGHT_CENTER</a> </li> <li class="class-depth-0"> <a href="global.html#RIGHT_TOP">RIGHT_TOP</a> </li> <li class="class-depth-0"> <a href="global.html#ROPE">ROPE</a> </li> <li class="class-depth-0"> <a href="global.html#ROUNDEDRECTANGLE">ROUNDEDRECTANGLE</a> </li> <li class="class-depth-0"> <a href="global.html#scaleModes">scaleModes</a> </li> <li class="class-depth-0"> <a href="global.html#SPRITE">SPRITE</a> </li> <li class="class-depth-0"> <a href="global.html#SPRITEBATCH">SPRITEBATCH</a> </li> <li class="class-depth-0"> <a href="global.html#TEXT">TEXT</a> </li> <li class="class-depth-0"> <a href="global.html#TILEMAP">TILEMAP</a> </li> <li class="class-depth-0"> <a href="global.html#TILEMAPLAYER">TILEMAPLAYER</a> </li> <li class="class-depth-0"> <a href="global.html#TILESPRITE">TILESPRITE</a> </li> <li class="class-depth-0"> <a href="global.html#TOP_CENTER">TOP_CENTER</a> </li> <li class="class-depth-0"> <a href="global.html#TOP_LEFT">TOP_LEFT</a> </li> <li class="class-depth-0"> <a href="global.html#TOP_RIGHT">TOP_RIGHT</a> </li> <li class="class-depth-0"> <a href="global.html#UP">UP</a> </li> <li class="class-depth-0"> <a href="global.html#VERSION">VERSION</a> </li> <li class="class-depth-0"> <a href="global.html#VERTICAL">VERTICAL</a> </li> <li class="class-depth-0"> <a href="global.html#VIDEO">VIDEO</a> </li> <li class="class-depth-0"> <a href="global.html#WEBGL">WEBGL</a> </li> <li class="class-depth-0"> <a href="global.html#WEBGL_FILTER">WEBGL_FILTER</a> </li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Core<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-1"><a href="Phaser.Game.html">Game</a></li> <li class="class-depth-1"><a href="Phaser.Group.html">Group</a></li> <li class="class-depth-1"><a href="Phaser.World.html">World</a></li> <li class="class-depth-1"><a href="Phaser.Loader.html">Loader</a></li> <li class="class-depth-1"><a href="Phaser.Cache.html">Cache</a></li> <li class="class-depth-1"><a href="Phaser.Time.html">Time</a></li> <li class="class-depth-1"><a href="Phaser.Camera.html">Camera</a></li> <li class="class-depth-1"><a href="Phaser.StateManager.html">State Manager</a></li> <li class="class-depth-1"><a href="Phaser.TweenManager.html">Tween Manager</a></li> <li class="class-depth-1"><a href="Phaser.SoundManager.html">Sound Manager</a></li> <li class="class-depth-1"><a href="Phaser.Input.html">Input Manager</a></li> <li class="class-depth-1"><a href="Phaser.ScaleManager.html">Scale Manager</a></li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Game Objects<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-1"><a href="Phaser.GameObjectFactory.html">Factory (game.add)</a></li> <li class="class-depth-1"><a href="Phaser.GameObjectCreator.html">Creator (game.make)</a></li> <li class="class-depth-1"><a href="Phaser.Sprite.html">Sprite</a></li> <li class="class-depth-1"><a href="Phaser.Image.html">Image</a></li> <li class="class-depth-1"><a href="Phaser.Sound.html">Sound</a></li> <li class="class-depth-1"><a href="Phaser.Video.html">Video</a></li> <li class="class-depth-1"><a href="Phaser.Particles.Arcade.Emitter.html">Particle Emitter</a></li> <li class="class-depth-1"><a href="Phaser.Particle.html">Particle</a></li> <li class="class-depth-1"><a href="Phaser.Text.html">Text</a></li> <li class="class-depth-1"><a href="Phaser.Tween.html">Tween</a></li> <li class="class-depth-1"><a href="Phaser.BitmapText.html">BitmapText</a></li> <li class="class-depth-1"><a href="Phaser.Tilemap.html">Tilemap</a></li> <li class="class-depth-1"><a href="Phaser.BitmapData.html">BitmapData</a></li> <li class="class-depth-1"><a href="Phaser.RetroFont.html">RetroFont</a></li> <li class="class-depth-1"><a href="Phaser.Button.html">Button</a></li> <li class="class-depth-1"><a href="Phaser.Animation.html">Animation</a></li> <li class="class-depth-1"><a href="Phaser.Graphics.html">Graphics</a></li> <li class="class-depth-1"><a href="Phaser.RenderTexture.html">RenderTexture</a></li> <li class="class-depth-1"><a href="Phaser.TileSprite.html">TileSprite</a></li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Geometry<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-1"><a href="Phaser.Circle.html">Circle</a></li> <li class="class-depth-1"><a href="Phaser.Ellipse.html">Ellipse</a></li> <li class="class-depth-1"><a href="Phaser.Line.html">Line</a></li> <li class="class-depth-1"><a href="Phaser.Matrix.html">Matrix</a></li> <li class="class-depth-1"><a href="Phaser.Point.html">Point</a></li> <li class="class-depth-1"><a href="Phaser.Polygon.html">Polygon</a></li> <li class="class-depth-1"><a href="Phaser.Rectangle.html">Rectangle</a></li> <li class="class-depth-1"><a href="Phaser.RoundedRectangle.html">Rounded Rectangle</a></li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Physics<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-1"><a href="Phaser.Physics.Arcade.html">Arcade Physics</a></li> <li class="class-depth-2"><a href="Phaser.Physics.Arcade.Body.html">Body</a></li> <li class="class-depth-2"><a href="Phaser.Weapon.html">Weapon</a></li> <li class="class-depth-1"><a href="Phaser.Physics.P2.html">P2 Physics</a></li> <li class="class-depth-2"><a href="Phaser.Physics.P2.Body.html">Body</a></li> <li class="class-depth-2"><a href="Phaser.Physics.P2.Spring.html">Spring</a></li> <li class="class-depth-2"><a href="Phaser.Physics.P2.CollisionGroup.html">CollisionGroup</a></li> <li class="class-depth-2"><a href="Phaser.Physics.P2.ContactMaterial.html">ContactMaterial</a></li> <li class="class-depth-1"><a href="Phaser.Physics.Ninja.html">Ninja Physics</a></li> <li class="class-depth-2"><a href="Phaser.Physics.Body.html">Body</a></li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Input<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-1"><a href="Phaser.InputHandler.html">Input Handler</a></li> <li class="class-depth-1"><a href="Phaser.Pointer.html">Pointer</a></li> <li class="class-depth-1"><a href="Phaser.DeviceButton.html">Device Button</a></li> <li class="class-depth-1"><a href="Phaser.Mouse.html">Mouse</a></li> <li class="class-depth-1"><a href="Phaser.Keyboard.html">Keyboard</a></li> <li class="class-depth-1"><a href="Phaser.Key.html">Key</a></li> <li class="class-depth-1"><a href="Phaser.Gamepad.html">Gamepad</a></li> </ul> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Community<b class="caret"></b></a> <ul class="dropdown-menu "> <li class="class-depth-1"><a href="http://phaser.io">Phaser Web Site</a></li> <li class="class-depth-1"><a href="https://github.com/photonstorm/phaser">Phaser Github</a></li> <li class="class-depth-1"><a href="http://phaser.io/examples">Phaser Examples</a></li> <li class="class-depth-1"><a href="https://github.com/photonstorm/phaser-plugins">Phaser Plugins</a></li> <li class="class-depth-1"><a href="http://www.html5gamedevs.com/forum/14-phaser/">Forum</a></li> <li class="class-depth-1"><a href="http://stackoverflow.com/questions/tagged/phaser-framework">Stack Overflow</a></li> <li class="class-depth-1"><a href="http://phaser.io/learn">Tutorials</a></li> <li class="class-depth-1"><a href="http://phaser.io/community/newsletter">Newsletter</a></li> <li class="class-depth-1"><a href="http://phaser.io/community/twitter">Twitter</a></li> <li class="class-depth-1"><a href="http://phaser.io/community/slack">Slack</a></li> <li class="class-depth-1"><a href="http://phaser.io/community/donate">Donate</a></li> <li class="class-depth-1"><a href="https://www.codeandweb.com/texturepacker/phaser">Texture Packer</a></li> </ul> </li> </ul> </div> </div> <div class="row-fluid"> <div class="span12"> <div id="main"> <h1 class="page-title">Source: src/gameobjects/Image.js</h1> <section> <article> <pre class="sunlight-highlight-javascript linenums">/** * @author Richard Davey &lt;rich@photonstorm.com> * @copyright 2016 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ /** * An Image is a light-weight object you can use to display anything that doesn't need physics or animation. * It can still rotate, scale, crop and receive input events. This makes it perfect for logos, backgrounds, simple buttons and other non-Sprite graphics. * * @class Phaser.Image * @extends PIXI.Sprite * @extends Phaser.Component.Core * @extends Phaser.Component.Angle * @extends Phaser.Component.Animation * @extends Phaser.Component.AutoCull * @extends Phaser.Component.Bounds * @extends Phaser.Component.BringToTop * @extends Phaser.Component.Crop * @extends Phaser.Component.Destroy * @extends Phaser.Component.FixedToCamera * @extends Phaser.Component.InputEnabled * @extends Phaser.Component.LifeSpan * @extends Phaser.Component.LoadTexture * @extends Phaser.Component.Overlap * @extends Phaser.Component.Reset * @extends Phaser.Component.Smoothed * @constructor * @param {Phaser.Game} game - A reference to the currently running game. * @param {number} [x=0] - The x coordinate of the Image. The coordinate is relative to any parent container this Image may be in. * @param {number} [y=0] - The y coordinate of the Image. The coordinate is relative to any parent container this Image may be in. * @param {string|Phaser.RenderTexture|Phaser.BitmapData|PIXI.Texture} [key] - The texture used by the Image during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture, BitmapData or PIXI.Texture. * @param {string|number} [frame] - If this Image is using part of a sprite sheet or texture atlas you can specify the exact frame to use by giving a string or numeric index. */ Phaser.Image = function (game, x, y, key, frame) { x = x || 0; y = y || 0; key = key || null; frame = frame || null; /** * @property {number} type - The const type of this object. * @readonly */ this.type = Phaser.IMAGE; PIXI.Sprite.call(this, Phaser.Cache.DEFAULT); Phaser.Component.Core.init.call(this, game, x, y, key, frame); }; Phaser.Image.prototype = Object.create(PIXI.Sprite.prototype); Phaser.Image.prototype.constructor = Phaser.Image; Phaser.Component.Core.install.call(Phaser.Image.prototype, [ 'Angle', 'Animation', 'AutoCull', 'Bounds', 'BringToTop', 'Crop', 'Destroy', 'FixedToCamera', 'InputEnabled', 'LifeSpan', 'LoadTexture', 'Overlap', 'Reset', 'Smoothed' ]); Phaser.Image.prototype.preUpdateInWorld = Phaser.Component.InWorld.preUpdate; Phaser.Image.prototype.preUpdateCore = Phaser.Component.Core.preUpdate; /** * Automatically called by World.preUpdate. * * @method Phaser.Image#preUpdate * @memberof Phaser.Image */ Phaser.Image.prototype.preUpdate = function() { if (!this.preUpdateInWorld()) { return false; } return this.preUpdateCore(); }; </pre> </article> </section> </div> <div class="clearfix"></div> <footer> <span class="copyright"> Phaser Copyright © 2012-2016 Photon Storm Ltd. </span> <br /> <span class="jsdoc-message"> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Mon Jul 11 2016 10:10:43 GMT+0100 (GMT Daylight Time) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>. </span> </footer> </div> <br clear="both"> </div> </div> <script src="scripts/sunlight.js"></script> <script src="scripts/sunlight.javascript.js"></script> <script src="scripts/sunlight-plugin.doclinks.js"></script> <script src="scripts/sunlight-plugin.linenumbers.js"></script> <script src="scripts/sunlight-plugin.menu.js"></script> <script src="scripts/jquery.min.js"></script> <script src="scripts/jquery.scrollTo.js"></script> <script src="scripts/jquery.localScroll.js"></script> <script src="scripts/bootstrap-dropdown.js"></script> <script src="scripts/toc.js"></script> <script> Sunlight.highlightAll({lineNumbers:true, showMenu: true, enableDoclinks :true}); </script> <script> $( function () { $( "#toc" ).toc( { anchorName : function(i, heading, prefix) { return $(heading).attr("id") || ( prefix + i ); }, selectors : "h1,h2,h3,h4", showAndHide : false, scrollTo : 60 } ); $( "#toc>ul" ).addClass( "nav nav-pills nav-stacked" ); $( "#main span[id^='toc']" ).addClass( "toc-shim" ); } ); </script> </body> </html>
Java
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_11) on Mon Jun 16 17:35:51 PDT 2014 --> <title>DTDConstants (Java Platform SE 8 )</title> <meta name="date" content="2014-06-16"> <meta name="keywords" content="javax.swing.text.html.parser.DTDConstants interface"> <meta name="keywords" content="CDATA"> <meta name="keywords" content="ENTITY"> <meta name="keywords" content="ENTITIES"> <meta name="keywords" content="ID"> <meta name="keywords" content="IDREF"> <meta name="keywords" content="IDREFS"> <meta name="keywords" content="NAME"> <meta name="keywords" content="NAMES"> <meta name="keywords" content="NMTOKEN"> <meta name="keywords" content="NMTOKENS"> <meta name="keywords" content="NOTATION"> <meta name="keywords" content="NUMBER"> <meta name="keywords" content="NUMBERS"> <meta name="keywords" content="NUTOKEN"> <meta name="keywords" content="NUTOKENS"> <meta name="keywords" content="RCDATA"> <meta name="keywords" content="EMPTY"> <meta name="keywords" content="MODEL"> <meta name="keywords" content="ANY"> <meta name="keywords" content="FIXED"> <meta name="keywords" content="REQUIRED"> <meta name="keywords" content="CURRENT"> <meta name="keywords" content="CONREF"> <meta name="keywords" content="IMPLIED"> <meta name="keywords" content="PUBLIC"> <meta name="keywords" content="SDATA"> <meta name="keywords" content="PI"> <meta name="keywords" content="STARTTAG"> <meta name="keywords" content="ENDTAG"> <meta name="keywords" content="MS"> <meta name="keywords" content="MD"> <meta name="keywords" content="SYSTEM"> <meta name="keywords" content="GENERAL"> <meta name="keywords" content="DEFAULT"> <meta name="keywords" content="PARAMETER"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="DTDConstants (Java Platform SE 8 )"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/DTDConstants.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage"><strong>Java&trade;&nbsp;Platform<br>Standard&nbsp;Ed.&nbsp;8</strong></div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../javax/swing/text/html/parser/DTD.html" title="class in javax.swing.text.html.parser"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../../javax/swing/text/html/parser/Element.html" title="class in javax.swing.text.html.parser"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?javax/swing/text/html/parser/DTDConstants.html" target="_top">Frames</a></li> <li><a href="DTDConstants.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li>Method</li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li>Method</li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">javax.swing.text.html.parser</div> <h2 title="Interface DTDConstants" class="title">Interface DTDConstants</h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Known Implementing Classes:</dt> <dd><a href="../../../../../javax/swing/text/html/parser/AttributeList.html" title="class in javax.swing.text.html.parser">AttributeList</a>, <a href="../../../../../javax/swing/text/html/parser/DocumentParser.html" title="class in javax.swing.text.html.parser">DocumentParser</a>, <a href="../../../../../javax/swing/text/html/parser/DTD.html" title="class in javax.swing.text.html.parser">DTD</a>, <a href="../../../../../javax/swing/text/html/parser/Element.html" title="class in javax.swing.text.html.parser">Element</a>, <a href="../../../../../javax/swing/text/html/parser/Entity.html" title="class in javax.swing.text.html.parser">Entity</a>, <a href="../../../../../javax/swing/text/html/parser/Parser.html" title="class in javax.swing.text.html.parser">Parser</a></dd> </dl> <hr> <br> <pre>public interface <span class="typeNameLabel">DTDConstants</span></pre> <div class="block">SGML constants used in a DTD. The names of the constants correspond the the equivalent SGML constructs as described in "The SGML Handbook" by Charles F. Goldfarb.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../javax/swing/text/html/parser/DTD.html" title="class in javax.swing.text.html.parser"><code>DTD</code></a>, <a href="../../../../../javax/swing/text/html/parser/Element.html" title="class in javax.swing.text.html.parser"><code>Element</code></a></dd> </dl> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- =========== FIELD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="field.summary"> <!-- --> </a> <h3>Field Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> <caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Field and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../javax/swing/text/html/parser/DTDConstants.html#ANY">ANY</a></span></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../javax/swing/text/html/parser/DTDConstants.html#CDATA">CDATA</a></span></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../javax/swing/text/html/parser/DTDConstants.html#CONREF">CONREF</a></span></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../javax/swing/text/html/parser/DTDConstants.html#CURRENT">CURRENT</a></span></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../javax/swing/text/html/parser/DTDConstants.html#DEFAULT">DEFAULT</a></span></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../javax/swing/text/html/parser/DTDConstants.html#EMPTY">EMPTY</a></span></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../javax/swing/text/html/parser/DTDConstants.html#ENDTAG">ENDTAG</a></span></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../javax/swing/text/html/parser/DTDConstants.html#ENTITIES">ENTITIES</a></span></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../javax/swing/text/html/parser/DTDConstants.html#ENTITY">ENTITY</a></span></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../javax/swing/text/html/parser/DTDConstants.html#FIXED">FIXED</a></span></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../javax/swing/text/html/parser/DTDConstants.html#GENERAL">GENERAL</a></span></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../javax/swing/text/html/parser/DTDConstants.html#ID">ID</a></span></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../javax/swing/text/html/parser/DTDConstants.html#IDREF">IDREF</a></span></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../javax/swing/text/html/parser/DTDConstants.html#IDREFS">IDREFS</a></span></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../javax/swing/text/html/parser/DTDConstants.html#IMPLIED">IMPLIED</a></span></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../javax/swing/text/html/parser/DTDConstants.html#MD">MD</a></span></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../javax/swing/text/html/parser/DTDConstants.html#MODEL">MODEL</a></span></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../javax/swing/text/html/parser/DTDConstants.html#MS">MS</a></span></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../javax/swing/text/html/parser/DTDConstants.html#NAME">NAME</a></span></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../javax/swing/text/html/parser/DTDConstants.html#NAMES">NAMES</a></span></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../javax/swing/text/html/parser/DTDConstants.html#NMTOKEN">NMTOKEN</a></span></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../javax/swing/text/html/parser/DTDConstants.html#NMTOKENS">NMTOKENS</a></span></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../javax/swing/text/html/parser/DTDConstants.html#NOTATION">NOTATION</a></span></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../javax/swing/text/html/parser/DTDConstants.html#NUMBER">NUMBER</a></span></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../javax/swing/text/html/parser/DTDConstants.html#NUMBERS">NUMBERS</a></span></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../javax/swing/text/html/parser/DTDConstants.html#NUTOKEN">NUTOKEN</a></span></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../javax/swing/text/html/parser/DTDConstants.html#NUTOKENS">NUTOKENS</a></span></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../javax/swing/text/html/parser/DTDConstants.html#PARAMETER">PARAMETER</a></span></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../javax/swing/text/html/parser/DTDConstants.html#PI">PI</a></span></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../javax/swing/text/html/parser/DTDConstants.html#PUBLIC">PUBLIC</a></span></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../javax/swing/text/html/parser/DTDConstants.html#RCDATA">RCDATA</a></span></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../javax/swing/text/html/parser/DTDConstants.html#REQUIRED">REQUIRED</a></span></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../javax/swing/text/html/parser/DTDConstants.html#SDATA">SDATA</a></span></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../javax/swing/text/html/parser/DTDConstants.html#STARTTAG">STARTTAG</a></span></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>static int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../javax/swing/text/html/parser/DTDConstants.html#SYSTEM">SYSTEM</a></span></code>&nbsp;</td> </tr> </table> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ FIELD DETAIL =========== --> <ul class="blockList"> <li class="blockList"><a name="field.detail"> <!-- --> </a> <h3>Field Detail</h3> <a name="CDATA"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>CDATA</h4> <pre>static final&nbsp;int CDATA</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#javax.swing.text.html.parser.DTDConstants.CDATA">Constant Field Values</a></dd> </dl> </li> </ul> <a name="ENTITY"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>ENTITY</h4> <pre>static final&nbsp;int ENTITY</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#javax.swing.text.html.parser.DTDConstants.ENTITY">Constant Field Values</a></dd> </dl> </li> </ul> <a name="ENTITIES"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>ENTITIES</h4> <pre>static final&nbsp;int ENTITIES</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#javax.swing.text.html.parser.DTDConstants.ENTITIES">Constant Field Values</a></dd> </dl> </li> </ul> <a name="ID"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>ID</h4> <pre>static final&nbsp;int ID</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#javax.swing.text.html.parser.DTDConstants.ID">Constant Field Values</a></dd> </dl> </li> </ul> <a name="IDREF"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>IDREF</h4> <pre>static final&nbsp;int IDREF</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#javax.swing.text.html.parser.DTDConstants.IDREF">Constant Field Values</a></dd> </dl> </li> </ul> <a name="IDREFS"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>IDREFS</h4> <pre>static final&nbsp;int IDREFS</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#javax.swing.text.html.parser.DTDConstants.IDREFS">Constant Field Values</a></dd> </dl> </li> </ul> <a name="NAME"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>NAME</h4> <pre>static final&nbsp;int NAME</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#javax.swing.text.html.parser.DTDConstants.NAME">Constant Field Values</a></dd> </dl> </li> </ul> <a name="NAMES"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>NAMES</h4> <pre>static final&nbsp;int NAMES</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#javax.swing.text.html.parser.DTDConstants.NAMES">Constant Field Values</a></dd> </dl> </li> </ul> <a name="NMTOKEN"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>NMTOKEN</h4> <pre>static final&nbsp;int NMTOKEN</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#javax.swing.text.html.parser.DTDConstants.NMTOKEN">Constant Field Values</a></dd> </dl> </li> </ul> <a name="NMTOKENS"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>NMTOKENS</h4> <pre>static final&nbsp;int NMTOKENS</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#javax.swing.text.html.parser.DTDConstants.NMTOKENS">Constant Field Values</a></dd> </dl> </li> </ul> <a name="NOTATION"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>NOTATION</h4> <pre>static final&nbsp;int NOTATION</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#javax.swing.text.html.parser.DTDConstants.NOTATION">Constant Field Values</a></dd> </dl> </li> </ul> <a name="NUMBER"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>NUMBER</h4> <pre>static final&nbsp;int NUMBER</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#javax.swing.text.html.parser.DTDConstants.NUMBER">Constant Field Values</a></dd> </dl> </li> </ul> <a name="NUMBERS"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>NUMBERS</h4> <pre>static final&nbsp;int NUMBERS</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#javax.swing.text.html.parser.DTDConstants.NUMBERS">Constant Field Values</a></dd> </dl> </li> </ul> <a name="NUTOKEN"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>NUTOKEN</h4> <pre>static final&nbsp;int NUTOKEN</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#javax.swing.text.html.parser.DTDConstants.NUTOKEN">Constant Field Values</a></dd> </dl> </li> </ul> <a name="NUTOKENS"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>NUTOKENS</h4> <pre>static final&nbsp;int NUTOKENS</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#javax.swing.text.html.parser.DTDConstants.NUTOKENS">Constant Field Values</a></dd> </dl> </li> </ul> <a name="RCDATA"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>RCDATA</h4> <pre>static final&nbsp;int RCDATA</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#javax.swing.text.html.parser.DTDConstants.RCDATA">Constant Field Values</a></dd> </dl> </li> </ul> <a name="EMPTY"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>EMPTY</h4> <pre>static final&nbsp;int EMPTY</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#javax.swing.text.html.parser.DTDConstants.EMPTY">Constant Field Values</a></dd> </dl> </li> </ul> <a name="MODEL"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>MODEL</h4> <pre>static final&nbsp;int MODEL</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#javax.swing.text.html.parser.DTDConstants.MODEL">Constant Field Values</a></dd> </dl> </li> </ul> <a name="ANY"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>ANY</h4> <pre>static final&nbsp;int ANY</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#javax.swing.text.html.parser.DTDConstants.ANY">Constant Field Values</a></dd> </dl> </li> </ul> <a name="FIXED"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>FIXED</h4> <pre>static final&nbsp;int FIXED</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#javax.swing.text.html.parser.DTDConstants.FIXED">Constant Field Values</a></dd> </dl> </li> </ul> <a name="REQUIRED"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>REQUIRED</h4> <pre>static final&nbsp;int REQUIRED</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#javax.swing.text.html.parser.DTDConstants.REQUIRED">Constant Field Values</a></dd> </dl> </li> </ul> <a name="CURRENT"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>CURRENT</h4> <pre>static final&nbsp;int CURRENT</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#javax.swing.text.html.parser.DTDConstants.CURRENT">Constant Field Values</a></dd> </dl> </li> </ul> <a name="CONREF"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>CONREF</h4> <pre>static final&nbsp;int CONREF</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#javax.swing.text.html.parser.DTDConstants.CONREF">Constant Field Values</a></dd> </dl> </li> </ul> <a name="IMPLIED"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>IMPLIED</h4> <pre>static final&nbsp;int IMPLIED</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#javax.swing.text.html.parser.DTDConstants.IMPLIED">Constant Field Values</a></dd> </dl> </li> </ul> <a name="PUBLIC"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>PUBLIC</h4> <pre>static final&nbsp;int PUBLIC</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#javax.swing.text.html.parser.DTDConstants.PUBLIC">Constant Field Values</a></dd> </dl> </li> </ul> <a name="SDATA"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>SDATA</h4> <pre>static final&nbsp;int SDATA</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#javax.swing.text.html.parser.DTDConstants.SDATA">Constant Field Values</a></dd> </dl> </li> </ul> <a name="PI"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>PI</h4> <pre>static final&nbsp;int PI</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#javax.swing.text.html.parser.DTDConstants.PI">Constant Field Values</a></dd> </dl> </li> </ul> <a name="STARTTAG"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>STARTTAG</h4> <pre>static final&nbsp;int STARTTAG</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#javax.swing.text.html.parser.DTDConstants.STARTTAG">Constant Field Values</a></dd> </dl> </li> </ul> <a name="ENDTAG"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>ENDTAG</h4> <pre>static final&nbsp;int ENDTAG</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#javax.swing.text.html.parser.DTDConstants.ENDTAG">Constant Field Values</a></dd> </dl> </li> </ul> <a name="MS"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>MS</h4> <pre>static final&nbsp;int MS</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#javax.swing.text.html.parser.DTDConstants.MS">Constant Field Values</a></dd> </dl> </li> </ul> <a name="MD"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>MD</h4> <pre>static final&nbsp;int MD</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#javax.swing.text.html.parser.DTDConstants.MD">Constant Field Values</a></dd> </dl> </li> </ul> <a name="SYSTEM"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>SYSTEM</h4> <pre>static final&nbsp;int SYSTEM</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#javax.swing.text.html.parser.DTDConstants.SYSTEM">Constant Field Values</a></dd> </dl> </li> </ul> <a name="GENERAL"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>GENERAL</h4> <pre>static final&nbsp;int GENERAL</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#javax.swing.text.html.parser.DTDConstants.GENERAL">Constant Field Values</a></dd> </dl> </li> </ul> <a name="DEFAULT"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>DEFAULT</h4> <pre>static final&nbsp;int DEFAULT</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#javax.swing.text.html.parser.DTDConstants.DEFAULT">Constant Field Values</a></dd> </dl> </li> </ul> <a name="PARAMETER"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>PARAMETER</h4> <pre>static final&nbsp;int PARAMETER</pre> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../constant-values.html#javax.swing.text.html.parser.DTDConstants.PARAMETER">Constant Field Values</a></dd> </dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/DTDConstants.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage"><strong>Java&trade;&nbsp;Platform<br>Standard&nbsp;Ed.&nbsp;8</strong></div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../javax/swing/text/html/parser/DTD.html" title="class in javax.swing.text.html.parser"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../../javax/swing/text/html/parser/Element.html" title="class in javax.swing.text.html.parser"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?javax/swing/text/html/parser/DTDConstants.html" target="_top">Frames</a></li> <li><a href="DTDConstants.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li>Method</li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li>Method</li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small><font size="-1"> <a href="http://bugreport.sun.com/bugreport/">Submit a bug or feature</a> <br>For further API reference and developer documentation, see <a href="http://download.oracle.com/javase/8/docs/index.html" target="_blank">Java SE Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.<br> Copyright &#x00a9; 1993, 2014, Oracle and/or its affiliates. All rights reserved. </font></small></p> </body> </html>
Java
/* xoreos-tools - Tools to help with xoreos development * * xoreos-tools is the legal property of its developers, whose names * can be found in the AUTHORS file distributed with this source * distribution. * * xoreos-tools 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. * * xoreos-tools 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 xoreos-tools. If not, see <http://www.gnu.org/licenses/>. */ /** @file * Base64 encoding and decoding. */ #include <cassert> #include <memory> #include "src/common/base64.h" #include "src/common/ustring.h" #include "src/common/error.h" #include "src/common/readstream.h" #include "src/common/memreadstream.h" #include "src/common/memwritestream.h" namespace Common { static const char kBase64Char[65] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; static const uint8_t kBase64Values[128] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3E, 0xFF, 0xFF, 0xFF, 0x3F, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; /** Write a character into our base64 string, and update the remaining * string length. * * Returns false if we ran out of remaining characters in this string. */ static bool writeCharacter(UString &base64, uint32_t c, size_t &maxLength) { assert(maxLength > 0); base64 += c; return --maxLength > 0; } /** Write multiple characters into our base64 string, and update the remaining * string length. * * Returns false if we ran out of remaining characters in this string. */ static bool writeCharacters(UString &base64, UString &str, size_t &lineLength) { while (!str.empty()) { writeCharacter(base64, *str.begin(), lineLength); str.erase(str.begin()); if (lineLength == 0) return false; } return lineLength > 0; } /** Find the raw value of a base64-encoded character. */ static uint8_t findCharacterValue(uint32_t c) { if ((c >= 128) || (kBase64Values[c] > 0x3F)) throw Exception("Invalid base64 character"); return kBase64Values[c]; } /** Encode data into base64 and write the result into the string, but only up * to maxLength characters. * * The string overhang is and input/output string of both the overhang from * the previous run of this function (which will get written into the base64 * string first) and the newly produced overhang. * * Returns false if we have written all data there is to write, both from the * overhang and the input data stream. */ static bool encodeBase64(ReadStream &data, UString &base64, size_t maxLength, UString &overhang) { if (maxLength == 0) throw Exception("Invalid base64 max line length"); // First write the overhang, and return if we already maxed out the length there if (!writeCharacters(base64, overhang, maxLength)) return true; overhang.clear(); uint8_t n; byte input[3]; // Read up to 3 characters at a time while ((n = data.read(input, 3)) != 0) { uint32_t code = 0; // Concat the input characters for (uint8_t i = 0; i < n; i++) code |= input[i] << (24 - i * 8); // Create up to 4 6-bit base64-characters out of them for (uint8_t i = 0; i < (n + 1); i++) { overhang += kBase64Char[(code >> 26) & 0x0000003F]; code <<= 6; } // Add padding for (int i = 0; i < (3 - n); i++) overhang += '='; // Write the base64 characters into the string, and return if we maxed out the length if (!writeCharacters(base64, overhang, maxLength)) return true; overhang.clear(); } // We reached the end of input the data return false; } static void decodeBase64(WriteStream &data, const UString &base64, UString &overhang) { assert(overhang.size() < 4); for (UString::iterator c = base64.begin(); c != base64.end(); ++c) { if ((*c != '=') && ((*c >= 128) || (kBase64Values[*c] > 0x3F))) continue; overhang += *c; if (overhang.size() == 4) { uint32_t code = 0; uint8_t n = 0; for (UString::iterator o = overhang.begin(); o != overhang.end(); ++o) { code <<= 6; if (*o != '=') { code += findCharacterValue(*o); n += 6; } } for (size_t i = 0; i < (n / 8); i++, code <<= 8) data.writeByte((byte) ((code & 0x00FF0000) >> 16)); overhang.clear(); } } } static size_t countLength(const UString &str, bool partial = false) { size_t dataLength = 0; for (const auto &c : str) { if ((c == '=') || ((c < 128) && kBase64Values[c] <= 0x3F)) ++dataLength; } if (!partial) if ((dataLength % 4) != 0) throw Exception("Invalid length for a base64-encoded string"); return dataLength; } static size_t countLength(const std::list<UString> &str) { size_t dataLength = 0; for (const auto &s : str) dataLength += countLength(s, true); if ((dataLength % 4) != 0) throw Exception("Invalid length for a base64-encoded string"); return dataLength; } void encodeBase64(ReadStream &data, UString &base64) { UString overhang; encodeBase64(data, base64, SIZE_MAX, overhang); } void encodeBase64(ReadStream &data, std::list<UString> &base64, size_t lineLength) { UString overhang; // Base64-encode the data, creating a new string after every lineLength characters do { base64.push_back(UString()); } while (encodeBase64(data, base64.back(), lineLength, overhang)); // Trim empty strings from the back while (!base64.empty() && base64.back().empty()) base64.pop_back(); } SeekableReadStream *decodeBase64(const UString &base64) { const size_t dataLength = (countLength(base64) / 4) * 3; std::unique_ptr<byte[]> data = std::make_unique<byte[]>(dataLength); MemoryWriteStream output(data.get(), dataLength); UString overhang; decodeBase64(output, base64, overhang); return new MemoryReadStream(data.release(), output.pos(), true); } SeekableReadStream *decodeBase64(const std::list<UString> &base64) { const size_t dataLength = (countLength(base64) / 4) * 3; std::unique_ptr<byte[]> data = std::make_unique<byte[]>(dataLength); MemoryWriteStream output(data.get(), dataLength); UString overhang; for (std::list<UString>::const_iterator b = base64.begin(); b != base64.end(); ++b) decodeBase64(output, *b, overhang); return new MemoryReadStream(data.release(), output.pos(), true); } } // End of namespace Common
Java
package org.jlinda.nest.gpf; import com.bc.ceres.core.ProgressMonitor; import org.apache.commons.math3.util.FastMath; import org.esa.beam.framework.datamodel.Band; import org.esa.beam.framework.datamodel.MetadataElement; import org.esa.beam.framework.datamodel.Product; import org.esa.beam.framework.datamodel.ProductData; import org.esa.beam.framework.gpf.Operator; import org.esa.beam.framework.gpf.OperatorException; import org.esa.beam.framework.gpf.OperatorSpi; import org.esa.beam.framework.gpf.Tile; import org.esa.beam.framework.gpf.annotations.OperatorMetadata; import org.esa.beam.framework.gpf.annotations.Parameter; import org.esa.beam.framework.gpf.annotations.SourceProduct; import org.esa.beam.framework.gpf.annotations.TargetProduct; import org.esa.beam.util.ProductUtils; import org.esa.snap.datamodel.AbstractMetadata; import org.esa.snap.datamodel.Unit; import org.esa.snap.gpf.OperatorUtils; import org.esa.snap.gpf.ReaderUtils; import org.jblas.ComplexDoubleMatrix; import org.jblas.DoubleMatrix; import org.jblas.MatrixFunctions; import org.jblas.Solve; import org.jlinda.core.Orbit; import org.jlinda.core.SLCImage; import org.jlinda.core.Window; import org.jlinda.core.utils.MathUtils; import org.jlinda.core.utils.PolyUtils; import org.jlinda.core.utils.SarUtils; import org.jlinda.nest.utils.BandUtilsDoris; import org.jlinda.nest.utils.CplxContainer; import org.jlinda.nest.utils.ProductContainer; import org.jlinda.nest.utils.TileUtilsDoris; import java.awt.*; import java.util.HashMap; import java.util.Map; @OperatorMetadata(alias = "Interferogram", category = "SAR Processing/Interferometric/Products", authors = "Petar Marinkovic", copyright = "Copyright (C) 2013 by PPO.labs", description = "Compute interferograms from stack of coregistered images : JBLAS implementation") public class InterferogramOp extends Operator { @SourceProduct private Product sourceProduct; @TargetProduct private Product targetProduct; @Parameter(valueSet = {"1", "2", "3", "4", "5", "6", "7", "8"}, description = "Order of 'Flat earth phase' polynomial", defaultValue = "5", label = "Degree of \"Flat Earth\" polynomial") private int srpPolynomialDegree = 5; @Parameter(valueSet = {"301", "401", "501", "601", "701", "801", "901", "1001"}, description = "Number of points for the 'flat earth phase' polynomial estimation", defaultValue = "501", label = "Number of 'Flat earth' estimation points") private int srpNumberPoints = 501; @Parameter(valueSet = {"1", "2", "3", "4", "5"}, description = "Degree of orbit (polynomial) interpolator", defaultValue = "3", label = "Orbit interpolation degree") private int orbitDegree = 3; @Parameter(defaultValue="false", label="Do NOT subtract flat-earth phase from interferogram.") private boolean doNotSubtract = false; // flat_earth_polynomial container private HashMap<String, DoubleMatrix> flatEarthPolyMap = new HashMap<String, DoubleMatrix>(); // source private HashMap<Integer, CplxContainer> masterMap = new HashMap<Integer, CplxContainer>(); private HashMap<Integer, CplxContainer> slaveMap = new HashMap<Integer, CplxContainer>(); // target private HashMap<String, ProductContainer> targetMap = new HashMap<String, ProductContainer>(); // operator tags private static final boolean CREATE_VIRTUAL_BAND = true; private String productName; public String productTag; private int sourceImageWidth; private int sourceImageHeight; /** * Initializes this operator and sets the one and only target product. * <p>The target product can be either defined by a field of type {@link org.esa.beam.framework.datamodel.Product} annotated with the * {@link org.esa.beam.framework.gpf.annotations.TargetProduct TargetProduct} annotation or * by calling {@link #setTargetProduct} method.</p> * <p>The framework calls this method after it has created this operator. * Any client code that must be performed before computation of tile data * should be placed here.</p> * * @throws org.esa.beam.framework.gpf.OperatorException * If an error occurs during operator initialisation. * @see #getTargetProduct() */ @Override public void initialize() throws OperatorException { try { // rename product if no subtraction of the flat-earth phase if (doNotSubtract) { productName = "ifgs"; productTag = "ifg"; } else { productName = "srp_ifgs"; productTag = "ifg_srp"; } checkUserInput(); constructSourceMetadata(); constructTargetMetadata(); createTargetProduct(); // final String[] masterBandNames = sourceProduct.getBandNames(); // for (int i = 0; i < masterBandNames.length; i++) { // if (masterBandNames[i].contains("mst")) { // masterBand1 = sourceProduct.getBand(masterBandNames[i]); // if (masterBand1.getUnit() != null && masterBand1.getUnit().equals(Unit.REAL)) { // masterBand2 = sourceProduct.getBand(masterBandNames[i + 1]); // } // break; // } // } // // getMetadata(); getSourceImageDimension(); if (!doNotSubtract) { constructFlatEarthPolynomials(); } } catch (Exception e) { throw new OperatorException(e); } } private void getSourceImageDimension() { sourceImageWidth = sourceProduct.getSceneRasterWidth(); sourceImageHeight = sourceProduct.getSceneRasterHeight(); } private void constructFlatEarthPolynomials() throws Exception { for (Integer keyMaster : masterMap.keySet()) { CplxContainer master = masterMap.get(keyMaster); for (Integer keySlave : slaveMap.keySet()) { CplxContainer slave = slaveMap.get(keySlave); flatEarthPolyMap.put(slave.name, estimateFlatEarthPolynomial(master.metaData, master.orbit, slave.metaData, slave.orbit)); } } } private void constructTargetMetadata() { for (Integer keyMaster : masterMap.keySet()) { CplxContainer master = masterMap.get(keyMaster); for (Integer keySlave : slaveMap.keySet()) { // generate name for product bands final String productName = keyMaster.toString() + "_" + keySlave.toString(); final CplxContainer slave = slaveMap.get(keySlave); final ProductContainer product = new ProductContainer(productName, master, slave, true); product.targetBandName_I = "i_" + productTag + "_" + master.date + "_" + slave.date; product.targetBandName_Q = "q_" + productTag + "_" + master.date + "_" + slave.date; // put ifg-product bands into map targetMap.put(productName, product); } } } private void constructSourceMetadata() throws Exception { // define sourceMaster/sourceSlave name tags final String masterTag = "mst"; final String slaveTag = "slv"; // get sourceMaster & sourceSlave MetadataElement final MetadataElement masterMeta = AbstractMetadata.getAbstractedMetadata(sourceProduct); final String slaveMetadataRoot = AbstractMetadata.SLAVE_METADATA_ROOT; /* organize metadata */ // put sourceMaster metadata into the masterMap metaMapPut(masterTag, masterMeta, sourceProduct, masterMap); // plug sourceSlave metadata into slaveMap MetadataElement slaveElem = sourceProduct.getMetadataRoot().getElement(slaveMetadataRoot); if(slaveElem == null) { slaveElem = sourceProduct.getMetadataRoot().getElement("Slave Metadata"); } MetadataElement[] slaveRoot = slaveElem.getElements(); for (MetadataElement meta : slaveRoot) { metaMapPut(slaveTag, meta, sourceProduct, slaveMap); } } private void metaMapPut(final String tag, final MetadataElement root, final Product product, final HashMap<Integer, CplxContainer> map) throws Exception { // TODO: include polarization flags/checks! // pull out band names for this product final String[] bandNames = product.getBandNames(); final int numOfBands = bandNames.length; // map key: ORBIT NUMBER int mapKey = root.getAttributeInt(AbstractMetadata.ABS_ORBIT); // metadata: construct classes and define bands final String date = OperatorUtils.getAcquisitionDate(root); final SLCImage meta = new SLCImage(root); final Orbit orbit = new Orbit(root, orbitDegree); // TODO: resolve multilook factors meta.setMlAz(1); meta.setMlRg(1); Band bandReal = null; Band bandImag = null; for (int i = 0; i < numOfBands; i++) { String bandName = bandNames[i]; if (bandName.contains(tag) && bandName.contains(date)) { final Band band = product.getBandAt(i); if (BandUtilsDoris.isBandReal(band)) { bandReal = band; } else if (BandUtilsDoris.isBandImag(band)) { bandImag = band; } } } try { map.put(mapKey, new CplxContainer(date, meta, orbit, bandReal, bandImag)); } catch (Exception e) { e.printStackTrace(); } } private void createTargetProduct() { // construct target product targetProduct = new Product(productName, sourceProduct.getProductType(), sourceProduct.getSceneRasterWidth(), sourceProduct.getSceneRasterHeight()); ProductUtils.copyProductNodes(sourceProduct, targetProduct); for (final Band band : targetProduct.getBands()) { targetProduct.removeBand(band); } for (String key : targetMap.keySet()) { String targetBandName_I = targetMap.get(key).targetBandName_I; targetProduct.addBand(targetBandName_I, ProductData.TYPE_FLOAT32); targetProduct.getBand(targetBandName_I).setUnit(Unit.REAL); String targetBandName_Q = targetMap.get(key).targetBandName_Q; targetProduct.addBand(targetBandName_Q, ProductData.TYPE_FLOAT32); targetProduct.getBand(targetBandName_Q).setUnit(Unit.IMAGINARY); final String tag0 = targetMap.get(key).sourceMaster.date; final String tag1 = targetMap.get(key).sourceSlave.date; if (CREATE_VIRTUAL_BAND) { String countStr = "_" + productTag + "_" + tag0 + "_" + tag1; ReaderUtils.createVirtualIntensityBand(targetProduct, targetProduct.getBand(targetBandName_I), targetProduct.getBand(targetBandName_Q), countStr); ReaderUtils.createVirtualPhaseBand(targetProduct, targetProduct.getBand(targetBandName_I), targetProduct.getBand(targetBandName_Q), countStr); } } // For testing: the optimal results with 1024x1024 pixels tiles, not clear whether it's platform dependent? // targetProduct.setPreferredTileSize(512, 512); } private void checkUserInput() throws OperatorException { // check for the logic in input paramaters final MetadataElement masterMeta = AbstractMetadata.getAbstractedMetadata(sourceProduct); final int isCoregStack = masterMeta.getAttributeInt(AbstractMetadata.coregistered_stack); if (isCoregStack != 1) { throw new OperatorException("Input should be a coregistered SLC stack"); } } private DoubleMatrix estimateFlatEarthPolynomial(SLCImage masterMetadata, Orbit masterOrbit, SLCImage slaveMetadata, Orbit slaveOrbit) throws Exception { // estimation window : this works only for NEST "crop" logic // long minLine = masterMetadata.getCurrentWindow().linelo; // long maxLine = masterMetadata.getCurrentWindow().linehi; // long minPixel = masterMetadata.getCurrentWindow().pixlo; // long maxPixel = masterMetadata.getCurrentWindow().pixhi; long minLine = 0; long maxLine = sourceImageHeight; long minPixel = 0; long maxPixel = sourceImageWidth; int numberOfCoefficients = PolyUtils.numberOfCoefficients(srpPolynomialDegree); int[][] position = MathUtils.distributePoints(srpNumberPoints, new Window(minLine,maxLine,minPixel,maxPixel)); // setup observation and design matrix DoubleMatrix y = new DoubleMatrix(srpNumberPoints); DoubleMatrix A = new DoubleMatrix(srpNumberPoints, numberOfCoefficients); double masterMinPi4divLam = (-4 * Math.PI * org.jlinda.core.Constants.SOL) / masterMetadata.getRadarWavelength(); double slaveMinPi4divLam = (-4 * Math.PI * org.jlinda.core.Constants.SOL) / slaveMetadata.getRadarWavelength(); // Loop through vector or distributedPoints() for (int i = 0; i < srpNumberPoints; ++i) { double line = position[i][0]; double pixel = position[i][1]; // compute azimuth/range time for this pixel final double masterTimeRange = masterMetadata.pix2tr(pixel + 1); // compute xyz of this point : sourceMaster org.jlinda.core.Point xyzMaster = masterOrbit.lp2xyz(line + 1, pixel + 1, masterMetadata); org.jlinda.core.Point slaveTimeVector = slaveOrbit.xyz2t(xyzMaster, slaveMetadata); final double slaveTimeRange = slaveTimeVector.x; // observation vector y.put(i, (masterMinPi4divLam * masterTimeRange) - (slaveMinPi4divLam * slaveTimeRange)); // set up a system of equations // ______Order unknowns: A00 A10 A01 A20 A11 A02 A30 A21 A12 A03 for degree=3______ double posL = PolyUtils.normalize2(line, minLine, maxLine); double posP = PolyUtils.normalize2(pixel, minPixel, maxPixel); int index = 0; for (int j = 0; j <= srpPolynomialDegree; j++) { for (int k = 0; k <= j; k++) { A.put(i, index, (FastMath.pow(posL, (double) (j - k)) * FastMath.pow(posP, (double) k))); index++; } } } // Fit polynomial through computed vector of phases DoubleMatrix Atranspose = A.transpose(); DoubleMatrix N = Atranspose.mmul(A); DoubleMatrix rhs = Atranspose.mmul(y); // this should be the coefficient of the reference phase // flatEarthPolyCoefs = Solve.solve(N, rhs); return Solve.solve(N, rhs); } /** * Called by the framework in order to compute a tile for the given target band. * <p>The default implementation throws a runtime exception with the message "not implemented".</p> * * @param targetTileMap The target tiles associated with all target bands to be computed. * @param targetRectangle The rectangle of target tile. * @param pm A progress monitor which should be used to determine computation cancelation requests. * @throws org.esa.beam.framework.gpf.OperatorException * If an error occurs during computation of the target raster. */ @Override public void computeTileStack(Map<Band, Tile> targetTileMap, Rectangle targetRectangle, ProgressMonitor pm) throws OperatorException { try { int y0 = targetRectangle.y; int yN = y0 + targetRectangle.height - 1; int x0 = targetRectangle.x; int xN = targetRectangle.x + targetRectangle.width - 1; final Window tileWindow = new Window(y0, yN, x0, xN); // Band flatPhaseBand; Band targetBand_I; Band targetBand_Q; for (String ifgKey : targetMap.keySet()) { ProductContainer product = targetMap.get(ifgKey); /// check out results from source /// Tile tileReal = getSourceTile(product.sourceMaster.realBand, targetRectangle); Tile tileImag = getSourceTile(product.sourceMaster.imagBand, targetRectangle); ComplexDoubleMatrix complexMaster = TileUtilsDoris.pullComplexDoubleMatrix(tileReal, tileImag); /// check out results from source /// tileReal = getSourceTile(product.sourceSlave.realBand, targetRectangle); tileImag = getSourceTile(product.sourceSlave.imagBand, targetRectangle); ComplexDoubleMatrix complexSlave = TileUtilsDoris.pullComplexDoubleMatrix(tileReal, tileImag); // if (srpPolynomialDegree > 0) { if (!doNotSubtract) { // normalize range and azimuth axis DoubleMatrix rangeAxisNormalized = DoubleMatrix.linspace(x0, xN, complexMaster.columns); rangeAxisNormalized = normalizeDoubleMatrix(rangeAxisNormalized, sourceImageWidth); DoubleMatrix azimuthAxisNormalized = DoubleMatrix.linspace(y0, yN, complexMaster.rows); azimuthAxisNormalized = normalizeDoubleMatrix(azimuthAxisNormalized, sourceImageHeight); // pull polynomial from the map DoubleMatrix polyCoeffs = flatEarthPolyMap.get(product.sourceSlave.name); // estimate the phase on the grid DoubleMatrix realReferencePhase = PolyUtils.polyval(azimuthAxisNormalized, rangeAxisNormalized, polyCoeffs, PolyUtils.degreeFromCoefficients(polyCoeffs.length)); // compute the reference phase ComplexDoubleMatrix complexReferencePhase = new ComplexDoubleMatrix(MatrixFunctions.cos(realReferencePhase), MatrixFunctions.sin(realReferencePhase)); complexSlave.muli(complexReferencePhase); // no conjugate here! } SarUtils.computeIfg_inplace(complexMaster, complexSlave.conji()); /// commit to target /// targetBand_I = targetProduct.getBand(product.targetBandName_I); Tile tileOutReal = targetTileMap.get(targetBand_I); TileUtilsDoris.pushDoubleMatrix(complexMaster.real(), tileOutReal, targetRectangle); targetBand_Q = targetProduct.getBand(product.targetBandName_Q); Tile tileOutImag = targetTileMap.get(targetBand_Q); TileUtilsDoris.pushDoubleMatrix(complexMaster.imag(), tileOutImag, targetRectangle); } } catch (Throwable e) { OperatorUtils.catchOperatorException(getId(), e); } } private DoubleMatrix normalizeDoubleMatrix(DoubleMatrix matrix, int factor) { matrix.subi(0.5 * (factor - 1)); matrix.divi(0.25 * (factor - 1)); return matrix; } /** * The SPI is used to register this operator in the graph processing framework * via the SPI configuration file * {@code META-INF/services/org.esa.beam.framework.gpf.OperatorSpi}. * This class may also serve as a factory for new operator instances. * * @see org.esa.beam.framework.gpf.OperatorSpi#createOperator() * @see org.esa.beam.framework.gpf.OperatorSpi#createOperator(java.util.Map, java.util.Map) */ public static class Spi extends OperatorSpi { public Spi() { super(InterferogramOp.class); } } }
Java
//========================================================================== // // include/sys/ioctl.h // // // //========================================================================== //####BSDCOPYRIGHTBEGIN#### // // ------------------------------------------- // // Portions of this software may have been derived from OpenBSD or other sources, // and are covered by the appropriate copyright disclaimers included herein. // // ------------------------------------------- // //####BSDCOPYRIGHTEND#### //========================================================================== //#####DESCRIPTIONBEGIN#### // // Author(s): gthomas // Contributors: gthomas // Date: 2000-01-10 // Purpose: // Description: // // //####DESCRIPTIONEND#### // //========================================================================== /* $OpenBSD: ioctl.h,v 1.3 1996/03/03 12:11:50 niklas Exp $ */ /* $NetBSD: ioctl.h,v 1.20 1996/01/30 18:21:47 thorpej Exp $ */ /*- * Copyright (c) 1982, 1986, 1990, 1993, 1994 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. * All or some portions of this file are derived from material licensed * to the University of California by American Telephone and Telegraph * Co. or Unix System Laboratories, Inc. and are reproduced herein with * the permission of UNIX System Laboratories, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)ioctl.h 8.6 (Berkeley) 3/28/94 */ #ifndef _SYS_IOCTL_H_ #define _SYS_IOCTL_H_ #ifndef __ECOS #include <sys/ttycom.h> /* * Pun for SunOS prior to 3.2. SunOS 3.2 and later support TIOCGWINSZ * and TIOCSWINSZ (yes, even 3.2-3.5, the fact that it wasn't documented * nonwithstanding). */ struct ttysize { unsigned short ts_lines; unsigned short ts_cols; unsigned short ts_xxx; unsigned short ts_yyy; }; #define TIOCGSIZE TIOCGWINSZ #define TIOCSSIZE TIOCSWINSZ #endif #include <sys/ioccom.h> #ifndef __ECOS #include <sys/dkio.h> #include <sys/filio.h> #endif #include <sys/sockio.h> #ifndef _KERNEL #include <sys/cdefs.h> __BEGIN_DECLS int ioctl __P((int, unsigned long, ...)); __END_DECLS #endif /* !_KERNEL */ #endif /* !_SYS_IOCTL_H_ */ /* * Keep outside _SYS_IOCTL_H_ * Compatability with old terminal driver * * Source level -> #define USE_OLD_TTY * Kernel level -> options COMPAT_43 or COMPAT_SUNOS or ... */ #if defined(USE_OLD_TTY) || defined(COMPAT_43) || defined(COMPAT_SUNOS) || \ defined(COMPAT_SVR4) || defined(COMPAT_FREEBSD) #include <sys/ioctl_compat.h> #endif
Java
using LightDirector.Domain; namespace LightDirector { public interface IEffectView<T> where T : EffectBase { } }
Java
package com.xxl.job.database.meta; import com.xxl.job.database.dboperate.DBManager; /** * 基于mysql的一些特殊处理定义 * */ public class MySQLDatabaseMeta extends DatabaseMeta { public MySQLDatabaseMeta() { this.dbType = DBManager.MYSQL_DB; } }
Java
<!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html;charset=utf-8"/> <!-- Incluimos los archivos Javascript externos --> <script src='jquery.js'></script> <script src='amazingslider.js'></script> <script src='initslider-1.js'></script> <style> a{ font-family:Tahoma; font-size:13px; color:#2E2E2E; text-decoration:none;} p{ text-align:right;} </style> </head> <body bgcolor="transparent"><br> <!-- Div contenedor general --> <div style="margin:70px auto;max-width:900px;"> <!-- Div donde se muestran las imágenes --> <div id="amazingslider-1" style="display:block;position:relative;margin:16px auto 86px;"> <ul class="amazingslider-slides" style="display:none;"> <!-- Código PHP que genera galería de fotos automática a partir de los archivos contenidos en carpeta imagenes --> <?php $directorio = opendir("imagenes"); //Ruta actual donde se encuentran las imágenes while ($archivo = readdir($directorio))//Obtiene archivos sucesivamente { if (is_dir($archivo))//verificamos si es o no un directorio {// si es directorio no hace nada } else//si no lo es muestra la imagen y su nombre(alt) { echo "<li> <img src='imagenes/$archivo'/ alt='$archivo'/> </li> "; } } ?> </ul> <!-- Div inferior donde se muestran barra con miniaturas--> <ul class="amazingslider-thumbnails" style="display:none;"> <!-- Código PHP que genera galería de miniaturas automática en la parte inferior, a partir de los archivos contenidos en carpeta imagenes --> <?php $directorio = opendir("imagenes"); //ruta actual while ($archivo = readdir($directorio))//Obtiene archivos sucesivamente { if (is_dir($archivo)) //verificamos si es o no un directorio {// si es directorio no hace nada } else//si no lo es muestra la imagen { echo "<li> <img src='imagenes/$archivo'/> </li> "; } } ?> </ul> </div> </div><br><br> <p> <a href="../../panelGalerias.php"> Volver al panel de Galerías <img src="../../iconos/flecha.png" height="40px" width="40px" align="right"> </a> </p> </body> </html>
Java
<?php namespace Volantus\FlightBase\Src\General\MSP; use Volantus\MSPProtocol\Src\Protocol\Response\Response; /** * Class MSPResponseMessage * * @package Volantus\FlightBase\Src\General\MSP */ class MSPResponseMessage { /** * @var string */ private $id; /** * @var Response */ private $mspResponse; /** * MSPResponseMessage constructor. * * @param string $id * @param Response $mspResponse */ public function __construct(string $id, Response $mspResponse) { $this->id = $id; $this->mspResponse = $mspResponse; } /** * @return string */ public function getId(): string { return $this->id; } /** * @return Response */ public function getMspResponse(): Response { return $this->mspResponse; } }
Java
<?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/>. /** * Strings for component 'plagiarism_turnitin', language 'hu', branch 'MOODLE_22_STABLE' * * @package plagiarism_turnitin * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); $string['adminlogin'] = 'Bejelentkezés a Turnitin alá rendszergazdaként'; $string['compareinstitution'] = 'Leadott fájlok és beadott dolgozatok összehasonlítása intézményen belül'; $string['compareinstitution_help'] = 'Csak akkor érhető el, ha egyedi csomópontot állított be/vásárolt. Ha bizonytalan, állítsa "Nem"-re.'; $string['compareinternet'] = 'Leadott fájlok összehasonlítása az internettel'; $string['compareinternet_help'] = 'Ezzel összehasonlíthatja a leadott munkákat azon internetes tartalmakkal, amelyeket a Turnitin jelenleg nyomon követ.'; $string['comparejournals'] = 'Leadott fájlok összehasonlítása folyóraitokkal, közleményekkel.'; $string['comparejournals_help'] = 'Ezzel összehasonlíthatja a leadott munkákat azon folyóraitokkal, közleményekkel, amelyeket a Turnitin jelenleg nyomon követ.'; $string['comparestudents'] = 'Leadott fájlok összehasonlítása más tanulók állományaival'; $string['comparestudents_help'] = 'Ezzel összehasonlíthatja a leadott munkákat más tanulók állományaival'; $string['configdefault'] = 'Ez az alapbeállítás a feladatok létrehozására való oldalon. Csakis plagiarism/turnitin:enableturnitin jogosultsággal rendelkező felhasználók módosíthatják a beállítást egyéni feladatra.'; $string['configusetiimodule'] = 'Turnitin-leadás bekapcsolása'; $string['defaultsdesc'] = 'Ha egy tevékenységmodulban bekapcsolja a Turnitint, az alábbiak lesznek az alapbeállítások.'; $string['defaultupdated'] = 'A Turnitin alapbeállításai frissítve.'; $string['draftsubmit'] = 'Mikor kell a fájlt a Turnitinba leadni?'; $string['excludebiblio'] = 'A szakirodalom kihagyása'; $string['excludebiblio_help'] = 'A szakirodalom az eredetiségi jelentés megtekintésekor ki-be kapcsolható. Ez a beállítás az első fájl leadása után nem módosítható.'; $string['excludematches'] = 'Csekély egyezések kihagyása'; $string['excludematches_help'] = 'A csekély mértékű egyezéseket százalék vagy szószám alapján kihagyhatja - az alábbi négyzetben válassza ki, melyiket kívánja használni.'; $string['excludequoted'] = 'Idézet kihagyása'; $string['excludequoted_help'] = 'Az idézetek az eredetiségi jelentés megtekintésekor ki-be kapcsolhatók. Ez a beállítás az első fájl leadása után nem módosítható.'; $string['file'] = 'Állomány'; $string['filedeleted'] = 'Az állomány a sorból törölve'; $string['fileresubmitted'] = 'Az állomány újbóli leadásra besorolva'; $string['module'] = 'Modul'; $string['name'] = 'Név'; $string['percentage'] = 'Százalék'; $string['pluginname'] = 'Turnitin plágium-ellenőrző segédprogram'; $string['reportgen'] = 'Mikor készüljenek eredetiségi jelentések?'; $string['reportgen_help'] = 'Ezzel adhatja meg, hogy mikor készüljenek el az eredetiségi jelentések'; $string['reportgenduedate'] = 'Határidőre'; $string['reportgenimmediate'] = 'Haladéktalanul (az első jelentés a végső)'; $string['reportgenimmediateoverwrite'] = 'Haladéktalanul (a jelentések felülírhatók)'; $string['resubmit'] = 'Újbóli leadás'; $string['savedconfigfailure'] = 'Nem sikerül csatlakoztatni/hitelesíteni a Turnitint - lehet, hogy rossz titkos kulcs/felhasználó azonosító párt használ, vagy a szerver nem tud az alkalmazással összekapcsolódni.'; $string['savedconfigsuccess'] = 'A Turnitin-beállítások elmentve, a tanári fiók létrejött'; $string['showstudentsreport'] = 'A hasonlósági jelentés megmutatása a tanulónak'; $string['showstudentsreport_help'] = 'A hasonlósági jelentés lebontva jeleníti meg a leadott munka azon részeit, amelyeket átvettek, valamint azt a helyet, ahol a Turnitin először észlelte ezt a tartalmat.'; $string['showstudentsscore'] = 'Hasonlósági arány megmutatása a tanulónak'; $string['showstudentsscore_help'] = 'A hasonlósági arány a leadott munkának az a százaléka, amely más tartalmakkal egyezik - a magas arány rendszerint rosszat jelent.'; $string['showwhenclosed'] = 'A tevékenység lezárásakor'; $string['similarity'] = 'Hasonlóság'; $string['status'] = 'Állapot'; $string['studentdisclosure'] = 'Tanulói nyilvánosságra hozatal'; $string['studentdisclosure_help'] = 'A szöveget az állományfeltöltő oldalon minden tanuló látja'; $string['studentdisclosuredefault'] = 'Minden feltöltött állományt megvizsgál a Turnitin.com plágium-ellenőrzője'; $string['submitondraft'] = 'Állomány leadása az első feltöltés alkalmával'; $string['submitonfinal'] = 'Állomány leadása, amikor a tanuló osztályozásra küldi be'; $string['teacherlogin'] = 'Bejelentkezés a Turnitin alá tanárként'; $string['tii'] = 'Turnitin'; $string['tiiaccountid'] = 'Turnitin felhasználói azonosító'; $string['tiiaccountid_help'] = 'Ez a felhasználói azonosítója, melyet a Turnitin.com-tól kapott'; $string['tiiapi'] = 'Turnitin alkalmazás'; $string['tiiapi_help'] = 'Ez a Turnitin alkalmazás címe - többnyire https://api.turnitin.com/api.asp'; $string['tiiconfigerror'] = 'Portál-beállítási hiba történt az állomány Turnitinhez küldése közben.'; $string['tiiemailprefix'] = 'Tanulói e-mail előtagja'; $string['tiiemailprefix_help'] = 'Állítsa be ezt, ha nem akarja, hogy a tanulók bejelentkezzenek a turnitin.com portálra és teljes jelentéseket tekintsenek meg.'; $string['tiienablegrademark'] = 'A Grademark (kísérleti) bekapcsolása'; $string['tiienablegrademark_help'] = 'A Grademark a Turnitin egyik választható funkciója. Használatához fel kell vennie a Turnitin-szolgáltatások közé. Bekapcsolása esetén a leadott oldalak lassan jelennek meg.'; $string['tiierror'] = 'TII-hiba'; $string['tiierror1007'] = 'A Turnitin nem tudta feldolgozni a fájlt, mert túl nagy.'; $string['tiierror1008'] = 'Hiba történt a fájl Turnitinhez küldése közben.-'; $string['tiierror1009'] = 'A Turnitin nem tudta feldolgozni a fájlt, mert nem támogatja a típusát. Érvényes állományformák: MS Word, Acrobat PDF, Postscript, egyszerű szöveg, HTML, WordPerfect és Rich Text.'; $string['tiierror1010'] = 'A Turnitin nem tudta feldolgozni a fájlt, mert 100-nál kevesebb nem nyomtatható karaktert tartalmaz.'; $string['tiierror1011'] = 'A Turnitin nem tudta feldolgozni a fájlt, mert hibás a formája és szóközök vannak a betűk között.'; $string['tiierror1012'] = 'A Turnitin nem tudta feldolgozni a fájlt, mert hossza meghaladja a megengedettet.'; $string['tiierror1013'] = 'A Turnitin nem tudta feldolgozni a fájlt, mert 20-nál kevesebb szót tartalmaz.'; $string['tiierror1020'] = 'A Turnitin nem tudta feldolgozni a fájlt, mert nem támogatott karaktereket tartalmaz.'; $string['tiierror1023'] = 'A Turnitin nem tudta feldolgozni a pdf-fájlt, mert jelszóval védett és képeket tartalmaz.'; $string['tiierror1024'] = 'A Turnitin nem tudta feldolgozni a fájlt, mert nem felel meg az érvényes dolgozat feltételeinek.'; $string['tiierrorpaperfail'] = 'A Turnitin nem tudta feldolgozni a fájlt.'; $string['tiierrorpending'] = 'A fájl vár a Turnitinhez való leadásra.'; $string['tiiexplain'] = 'A Turnitin kereskedelmi termék, a szolgáltatásra elő kell fizetni. További információk: <a href="http://docs.moodle.org/en/Turnitin_administration">http://docs.moodle.org/en/Turnitin_administration</a>'; $string['tiiexplainerrors'] = 'AZ oldalon szerepelnek azok a Turnitinhez leadott fájlok, amelyek hibásként vannak megjelölve. A hibakódokat és leírásukat lásd: :<a href="http://docs.moodle.org/en/Turnitin_errors">docs.moodle.org/en/Turnitin_errors</a><br/>Az állományok visszaállítása után a cron megpróbálja ismét leadni őket a Turnitinhez.<br/>Törlésük esetén viszont nem lehet őket ismételten leadni, ezért eltűnnek a tanárok és a tanulók elől a hibák is.'; $string['tiisecretkey'] = 'Titkos Turnitin-kulcs'; $string['tiisecretkey_help'] = 'Ennek beszerzéséhez jelentkezzen be a Turnitin.com alá portálja rendszergazdájaként.'; $string['tiisenduseremail'] = 'Felhasználói e-mail elküldése'; $string['tiisenduseremail_help'] = 'E-mail küldése a TII-rendszerben létrehozott összes felhasználónak olyan ugrópointtal, amelyről ideiglenes jelszóval be tudnak jelentkezni a www.turnitin.com portálra.'; $string['turnitin'] = 'Turnitin'; $string['turnitin:enable'] = 'Tanár számára a Turnitin ki-be kapcsolásának engedélyezése adott modulon belül.'; $string['turnitin:viewfullreport'] = 'Tanár számára a Turnitintól kapott teljes jelentés megtekintésének engedélyezése'; $string['turnitin:viewsimilarityscore'] = 'Tanár számára a Turnitintól kapott hasonlósági pont megtekintésének engedélyezése'; $string['turnitin_attemptcodes'] = 'Hibakódok automatikus újbóli leadáshoz'; $string['turnitin_attemptcodes_help'] = 'Olyan hibakódok, amilyeneket a Turnitin 2. próbálkozásra általában elfogad (a mező módosítása a szervert tovább terhelheti)'; $string['turnitin_attempts'] = 'Újrapróbálkozások száma'; $string['turnitin_attempts_help'] = 'A megadott kódok Turnitinnek való újbóli leadásának a száma. 1 újrapróbálkozás azt jelenti, hogy a megadott hibakódok leadására kétszer kerül sor.'; $string['turnitin_institutionnode'] = 'Intézményi csomópont bekapcsolása'; $string['turnitin_institutionnode_help'] = 'Ha a fiókjához intézményi csomópontot állított be, ennek bekapcsolásával választhatja ki a csomópontot feladatok létrehozása során. MEGJEGYZÉS: ha nincs intézményi csomópontja, ennek bekapcsolása esetén a dolgozat leadása nem fog sikerülni.'; $string['turnitindefaults'] = 'A Turnitin alapbeállításai'; $string['turnitinerrors'] = 'Turnitin-hibák'; $string['useturnitin'] = 'A Turnitin bekapcsolása'; $string['wordcount'] = 'Szószám';
Java