code
stringlengths 3
1.01M
| repo_name
stringlengths 5
116
| path
stringlengths 3
311
| language
stringclasses 30
values | license
stringclasses 15
values | size
int64 3
1.01M
|
|---|---|---|---|---|---|
extern void __assert_fail();
int main() {
int N;
int x = 0;
int i = 0;
while (i < N) {
if (!(x == 0)) {
__assert_fail();
return 1;
}
i = i+1;
}
if (!(x == 0)) {
__assert_fail();
return 1;
}
}
|
nishanttotla/predator
|
cpachecker/test/programs/induction/SAS_minimal.c
|
C
|
gpl-3.0
| 232
|
-- phpMyAdmin SQL Dump
-- version 3.2.0.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Nov 22, 2015 at 03:12 AM
-- Server version: 5.1.36
-- PHP Version: 5.3.0
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `healthcare`
--
-- --------------------------------------------------------
--
-- Table structure for table `user_primary`
--
CREATE TABLE IF NOT EXISTS `user_primary` (
`username` varchar(100) NOT NULL,
`address` varchar(150) NOT NULL,
`mhosname` varchar(80) NOT NULL,
`password` varchar(40) NOT NULL,
UNIQUE KEY `username` (`username`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `user_primary`
--
INSERT INTO `user_primary` (`username`, `address`, `mhosname`, `password`) VALUES
('Janchetna Hospital', 'xyz,abc road,new delhi', 'CGHS Hospital', 'abc123'),
(' Rao tula ram hospital', 'Jaffarpur Kalan, New Delhi', 'Safdarjung Hospital', 'abc123'),
(' Rural Health Training Centre', 'Najafgarh, New Delhi', 'Safdarjung Hospital', 'abc123'),
('DEEPAN HOSPITAL', 'Kapashera Village, New Delhi', 'Safdarjung Hospital', 'abc123'),
('Babu Jagjivan Ram Hospital', 'E Block,Bhalswa Jahangirpuri', 'Deen Dayal Upadhyay Hospital', 'abc123'),
('Swasthya Vibhag', 'Circle Number 13, Delhi Nagar Palika Parishad, Pandit Bhagwan Sahay Vats Vitthi, Block D, East Kidwai Nagar, Kidwai Nagar, New Delhi, Delhi 110023', 'Deen Dayal Upadhyay Hospital', 'abc123'),
('Delhi Government Dispensary', 'D-2/61, Jeevan Park, Pankha Road, Bindapur, New Delhi, Delhi 110059', 'CGHS Hospital', 'abc123'),
(' Incharge,Sanjay Gandhi Memorial Hospita', 'Mangol Puri,Delhi-83 ', 'Acharya Shree Bhikshu Hospital', 'abc123'),
(' MC-FW', 'Dakshinpuri & Tigri Dakshinpuri,New Delhi-62 ', 'Rajiv Gandhi Super Speciality Hospital', 'abc123'),
(' M & CW Centre Mat. Home', 'Kabir Nagar,Delhi-7 ', 'Rajiv Gandhi Super Speciality Hospital', 'abc123'),
(' MCH Centre,Sarai Mohalla', 'Sarai Mohalla,Inside MPL Primary School,Shahdara ', 'Rajiv Gandhi Super Speciality Hospital', 'abc123'),
('Hindu Rao Hospital', 'North Delhi Muncipal Corporation, Malka Ganj, New Delhi, Delhi 110007', 'Dr. Baba Saheb Ambedkar Hospital', 'abc123'),
('Girdhari Lal Maternity Hospital', 'Jawaharlal Nehru Marg, New Delhi, Delhi 110002', 'Dr. Baba Saheb Ambedkar Hospital', 'abc123'),
('Lok Nayak Hospital', ' 2, Near Delhi Gate, JN Marg, New Delhi, Delhi 110002', 'Acharya Shree Bhikshu Hospital', 'abc123'),
('Dharamshila Hospital And Research Centre', 'Vasundhara Enclave, Dharamshila Road, Near New Ashok Nagar Metro Station, New Delhi, Delhi 110096', 'Delhi State Cancer Institute', 'abc123'),
('Indian Cancer Society', '86/1 GF, Shahpur Jat, Siri Fort, New Delhi, Delhi 110049', 'Delhi State Cancer Institute', 'abc123');
|
Small-Start/Hospital
|
files/user_primary.sql
|
SQL
|
gpl-3.0
| 2,979
|
@ECHO OFF
REM Command file for Sphinx documentation
set SPHINXBUILD=sphinx-build
set BUILDDIR=_build
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
if NOT "%PAPER%" == "" (
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
)
if "%1" == "" goto help
if "%1" == "help" (
:help
echo.Please use `make ^<target^>` where ^<target^> is one of
echo. html to make standalone HTML files
echo. dirhtml to make HTML files named index.html in directories
echo. pickle to make pickle files
echo. json to make JSON files
echo. htmlhelp to make HTML files and a HTML help project
echo. qthelp to make HTML files and a qthelp project
echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
echo. changes to make an overview over all changed/added/deprecated items
echo. linkcheck to check all external links for integrity
echo. doctest to run all doctests embedded in the documentation if enabled
goto end
)
if "%1" == "clean" (
for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
del /q /s %BUILDDIR%\*
goto end
)
if "%1" == "html" (
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/html.
goto end
)
if "%1" == "dirhtml" (
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
goto end
)
if "%1" == "pickle" (
%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
echo.
echo.Build finished; now you can process the pickle files.
goto end
)
if "%1" == "json" (
%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
echo.
echo.Build finished; now you can process the JSON files.
goto end
)
if "%1" == "htmlhelp" (
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
echo.
echo.Build finished; now you can run HTML Help Workshop with the ^
.hhp project file in %BUILDDIR%/htmlhelp.
goto end
)
if "%1" == "qthelp" (
%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
echo.
echo.Build finished; now you can run "qcollectiongenerator" with the ^
.qhcp project file in %BUILDDIR%/qthelp, like this:
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\tml.qhcp
echo.To view the help file:
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\tml.ghc
goto end
)
if "%1" == "latex" (
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
echo.
echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
goto end
)
if "%1" == "changes" (
%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
echo.
echo.The overview file is in %BUILDDIR%/changes.
goto end
)
if "%1" == "linkcheck" (
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
echo.
echo.Link check complete; look for any errors in the above output ^
or in %BUILDDIR%/linkcheck/output.txt.
goto end
)
if "%1" == "doctest" (
%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
echo.
echo.Testing of doctests in the sources finished, look at the ^
results in %BUILDDIR%/doctest/output.txt.
goto end
)
:end
|
erdbeere/tml
|
docs/make.bat
|
Batchfile
|
gpl-3.0
| 3,065
|
package codes.simen.l50notifications.admin;
import android.app.admin.DeviceAdminReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import codes.simen.l50notifications.R;
public class AdminReceiver extends DeviceAdminReceiver {
public static ComponentName getComponentName(Context context) {
return new ComponentName(context.getApplicationContext(), AdminReceiver.class);
}
@Override
public CharSequence onDisableRequested(Context context, Intent intent) {
return context.getString(R.string.device_admin_disable_warning);
}
}
|
ja-som/heads-up
|
app/src/main/java/codes/simen/l50notifications/admin/AdminReceiver.java
|
Java
|
gpl-3.0
| 626
|
/*
* Copyright (C) 2010 Brockmann Consult GmbH (info@brockmann-consult.de)
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 3 of the License, or (at your option)
* any later version.
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, see http://www.gnu.org/licenses/
*/
package org.esa.snap.dataio.geotiff.internal;
import org.esa.snap.framework.datamodel.ProductData;
/**
* A TIFFValue implementation for the GeoTIFF format.
*
* @author Marco Peters
* @author Sabine Embacher
* @author Norman Fomferra
* @version $Revision: 2182 $ $Date: 2008-06-12 11:09:11 +0200 (Do, 12 Jun 2008) $
*/
class TiffDouble extends TiffValue {
public TiffDouble(final double value) {
setData(ProductData.createInstance(ProductData.TYPE_FLOAT64));
getData().setElemDouble(value);
}
public double getValue() {
return getData().getElemDouble();
}
}
|
arraydev/snap-engine
|
snap-geotiff/src/main/java/org/esa/snap/dataio/geotiff/internal/TiffDouble.java
|
Java
|
gpl-3.0
| 1,330
|
/*** Style for Enigma plugin ***/
/***** Messages displaying *****/
#enigma-message,
#messagebody div #enigma-message
{
margin: 0;
margin-bottom: 5px;
padding: 6px 12px 6px 30px;
font-weight: bold;
}
div.enigmaerror,
#messagebody div.enigmaerror
{
background: url(enigma_icons.png) 3px -201px no-repeat #f2cccd;
border: 1px solid #c00005;
color: #c00005;
}
div.enigmanotice,
#messagebody div.enigmanotice
{
background: url(enigma_icons.png) 3px -171px no-repeat #c9e6d3;
border: 1px solid #008a2e;
color: #008a2e;
}
div.enigmawarning,
#messagebody div.enigmawarning
{
background: url(enigma_icons.png) 3px -231px no-repeat #fef893;
border: 1px solid #ffdf0e;
color: #960;
}
#enigma-message a
{
color: #666666;
padding-left: 10px;
}
#enigma-message a:hover
{
color: #333333;
}
p.enigmaattachment {
margin: 0.5em 1em;
width: auto;
background: #f9f9f9;
border: 1px solid #d3d3d3;
border-radius: 4px;
}
p.enigmaattachment a {
display: block;
background: url(enigma_icons.png) 8px -78px no-repeat;
padding: 1em 0.5em 1em 46px;
}
/***** E-mail Compose Page *****/
#messagetoolbar a.button.enigma {
background-image: url(enigma_icons.png);
background-position: center -122px;
background-repeat: no-repeat;
}
#enigmamenu {
color: white;
padding: 2px 5px;
}
#enigmamenu div.row {
display: table-row;
}
#enigmamenu div.row > label {
display: table-cell;
width: 99%;
padding: 3px;
}
#enigmamenu div.row > div {
display: table-cell;
width: 1%;
padding: 3px;
}
/***** Keys/Certs Management *****/
#settings-sections .enigma.keys a {
background-image: url(enigma_icons.png);
background-position: 7px -345px;
background-repeat: no-repeat;
}
#settings-sections .enigma.keys.selected a {
background-image: url(enigma_icons.png);
background-position: 7px -368px;
background-repeat: no-repeat;
}
#sections-table #rcmrowenigma .section {
background-image: url(enigma_icons.png);
background-position: 5px -297px;
background-repeat: no-repeat;
}
#sections-table #rcmrowenigma.selected .section {
background-image: url(enigma_icons.png);
background-position: 5px -321px;
background-repeat: no-repeat;
}
#mainscreen.enigma #settings-sections,
#mainscreen.enigma #settings-right
{
top: 44px;
}
#enigmacontent-box
{
position: absolute;
top: 0px;
left: 272px;
right: 0px;
bottom: 0px;
}
#enigmakeyslist
{
position: absolute;
top: 0;
bottom: 0;
left: 0;
width: 260px;
}
#keylistcountbar
{
margin-top: 4px;
margin-left: 4px;
}
#keys-table
{
width: 100%;
table-layout: fixed;
}
#keys-table td
{
text-overflow: ellipsis;
}
#keyimportform fieldset div
{
background-color: #eee;
padding: 10px;
}
#keycreateform td > label {
display: block;
}
#keystoolbar
{
position: absolute;
top: -6px;
left: 0;
height: 40px;
white-space: nowrap;
z-index: 10;
}
#keystoolbar a.import {
background: url(enigma_icons.png) center 0 no-repeat transparent;
}
#keystoolbar a.export {
background: url(enigma_icons.png) center -40px no-repeat transparent;
}
|
gencer/roundcubemail
|
plugins/enigma/skins/larry/enigma.css
|
CSS
|
gpl-3.0
| 3,083
|
Given /^I try to approve a contract that has problems$/ do
@unapprovable_contract = @ip.contracts.submitted.shuffle.detect{|o| not o.approvable?}
find("[data-collapsed-toggle='#open-orders']").click unless all("[data-collapsed-toggle='#open-orders']").empty?
within(".line[data-id='#{@unapprovable_contract.id}']") do
find("[data-order-approve]", :text => _("Approve")).click
end
find(".modal")
end
Then /^I got an information that this contract has problems$/ do
find(".modal .row.emboss.red")
end
When /^I approve anyway$/ do
within(".modal") do
find(".dropdown-toggle").hover
find(".dropdown-item[data-approve-anyway]").click
end
page.has_no_selector?(".modal").should be_true
end
Then /^this contract is approved$/ do
find(".line[data-id='#{@unapprovable_contract.id}']").should have_content _("Approved")
find(".line[data-id='#{@unapprovable_contract.id}'] a[href='#{manage_hand_over_path(@ip, @unapprovable_contract.user)}']")
@unapprovable_contract.reload.status.should == :approved
end
|
suqld/leihs
|
features/step_definitions/manage/acknowledge/approve_anyway_steps.rb
|
Ruby
|
gpl-3.0
| 1,034
|
/****************************************************************************
*
* This file is part of the ustk software.
* Copyright (C) 2016 - 2017 by Inria. All rights reserved.
*
* This software is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* ("GPL") version 2 as published by the Free Software Foundation.
* See the file LICENSE.txt at the root directory of this source
* distribution for additional information about the GNU GPL.
*
* For using ustk with software that can not be combined with the GNU
* GPL, please contact Inria about acquiring a ViSP Professional
* Edition License.
*
* This software was developed at:
* Inria Rennes - Bretagne Atlantique
* Campus Universitaire de Beaulieu
* 35042 Rennes Cedex
* France
*
* If you have questions regarding the use of this file, please contact
* Inria at ustk@inria.fr
*
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* Authors:
* Marc Pouliquen
*
*****************************************************************************/
/**
* @file usMeterPixelConversion.cpp
* @brief Conversion from a position in meters in the space to the equivalent pixel position in the ultrasound image.
*/
#include <visp3/ustk_core/usMeterPixelConversion.h>
/**
* Conversion method for 2D ultrasound images.
*
* @param [in] image 2D Post-scan image with transducer settings well filled.
* @param [in] x Position in meters along x axis to convert.
* @param [in] y Position in meters along y axis to convert.
* @param [out] u Converted position in pixels along x axis.
* @param [out] v Converted position in pixels along y axis.
*/
void usMeterPixelConversion::convert(const usImagePostScan2D<unsigned char> &image, const double &x, const double &y,
double &u, double &v)
{
// checking transducer settings to apply corresponding transformation
// First convex probe type
if (image.isTransducerConvex()) {
u = (x + ((image.getWidth() * image.getWidthResolution()) / 2)) / image.getWidthResolution();
v = (y - image.getTransducerRadius() * std::cos((image.getScanLineNumber() - 1) * image.getScanLinePitch() / 2)) /
image.getHeightResolution();
}
// Then linear probe type
else {
u = (x + ((image.getWidth() * image.getWidthResolution()) / 2)) / image.getWidthResolution();
v = y / image.getHeightResolution();
}
}
/**
* Conversion method for 3D ultrasound images.
*
* @param [in] image 2D Post-scan image with voxels spacings, transducer settings and motor settings well filled.
* @param [in] x Position in meters along x axis to convert.
* @param [in] y Position in meters along y axis to convert.
* @param [in] z Position in meters along z axis to convert.
* @param [out] u Converted position in pixels along x axis.
* @param [out] v Converted position in pixels along y axis.
* @param [out] w Converted position in pixels along z axis.
*/
void usMeterPixelConversion::convert(const usImagePostScan3D<unsigned char> &image, const double &x, const double &y,
const double &z, double &u, double &v, double &w)
{
// checking transducer/motor settings to apply corresponding transformation
if (!image.isTransducerConvex()) { // linear transducer
if (image.getMotorType() == usMotorSettings::LinearMotor) { // linear motor
u = (x + ((image.getWidth() * image.getElementSpacingX()) / 2)) / image.getElementSpacingX();
v = y / image.getElementSpacingY();
w = (z + image.getNumberOfFrames() * image.getElementSpacingZ() / 2) / image.getElementSpacingZ();
} else if (image.getMotorType() == usMotorSettings::TiltingMotor) { // tilting motor
u = (x + ((image.getWidth() * image.getElementSpacingX()) / 2)) / image.getElementSpacingX();
v = (y - image.getMotorRadius() * std::cos((image.getFrameNumber() - 1) * image.getFramePitch() / 2) +
image.getMotorRadius()) /
image.getElementSpacingY();
w = (z + image.getNumberOfFrames() * image.getElementSpacingZ() / 2) / image.getElementSpacingZ();
} else
throw(vpException(vpException::notImplementedError, "Rotationnal Motor is not available yet."));
}
// Then convex transducer
else {
if (image.getMotorType() == usMotorSettings::LinearMotor) { // linear motor
u = (x + ((image.getWidth() * image.getElementSpacingX()) / 2)) / image.getElementSpacingX();
v = (y - image.getTransducerRadius() * std::cos((image.getScanLineNumber() - 1) * image.getScanLinePitch() / 2)) /
image.getElementSpacingY();
w = (z + image.getNumberOfFrames() * image.getElementSpacingZ() / 2) / image.getElementSpacingZ();
} else if (image.getMotorType() == usMotorSettings::TiltingMotor) { // tilting motor
u = (x + ((image.getWidth() * image.getElementSpacingX()) / 2)) / image.getElementSpacingX();
v = (y -
(image.getTransducerRadius() * // Rmin
std::cos((image.getScanLineNumber() - 1) * image.getScanLinePitch() / 2) // cos (FOV/2)
- (image.getTransducerRadius() - image.getMotorRadius())) // Delta R
* std::cos((image.getFrameNumber() - 1) * image.getFramePitch() / 2) // cos(Phi/2)
- (image.getTransducerRadius() - image.getMotorRadius())) // Delta R
/ image.getElementSpacingY();
w = (z + image.getNumberOfFrames() * image.getElementSpacingZ() / 2) / image.getElementSpacingZ();
} else
throw(vpException(vpException::notImplementedError, "Rotationnal Motor is not available yet."));
}
}
|
lagadic/ustk
|
modules/ustk_core/src/meterConversion/usMeterPixelConversion.cpp
|
C++
|
gpl-3.0
| 5,804
|
/*
* Copyright (c) 2012 Alexander Diener,
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.fhkn.in.uce.relaying.server;
import java.io.IOException;
import java.net.Socket;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.Executor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import de.fhkn.in.uce.relaying.message.RelayingAttributeTypeDecoder;
import de.fhkn.in.uce.relaying.message.RelayingMethod;
import de.fhkn.in.uce.relaying.message.RelayingMethodDecoder;
import de.fhkn.in.uce.stun.attribute.AttributeTypeDecoder;
import de.fhkn.in.uce.stun.attribute.ErrorCode.STUNErrorCode;
import de.fhkn.in.uce.stun.header.MessageMethodDecoder;
import de.fhkn.in.uce.stun.message.Message;
import de.fhkn.in.uce.stun.message.MessageReader;
import de.fhkn.in.uce.stun.message.MessageWriter;
/**
* Task that reads messages from the clients socket and handles them. Can handle
* allocation requests and and connection bind requests.
*
* @author thomas zink, daniel maier, Alexander Diener
* (aldiener@htwg-konstanz.de)
*
*/
public class MessageDispatcherTask implements Runnable {
private static final Logger logger = LoggerFactory.getLogger(MessageDispatcherTask.class);
private final Socket s;
private final MessageWriter controlConnectionWriter;
private final Map<UUID, BlockingQueue<Socket>> connIDToQueue;
// has to be unbounded
private final Executor controlConnectionHandlerExecutor;
// has to be unbounded
private final Executor relayExecutor;
/**
* Creates a new {@link MessageDispatcherTask}.
*
* @param s
* the socket to the client
* @param connIDToQueue
* map to match relay connection between client and peers
* @param controlConnectionHandlerExecutor
* the executor that gets used to execute the
* {@link RefreshMessageHandlerTask} for the given control
* connection
* @param relayExecutor
* the executor that gets used to execute task for the real relay
* stuff
* @throws IOException
* if an I/O error occurs while getting the output stream of the
* socket to the client
*/
public MessageDispatcherTask(Socket s, Map<UUID, BlockingQueue<Socket>> connIDToQueue,
Executor controlConnectionHandlerExecutor, Executor relayExecutor) throws IOException {
this.s = s;
this.controlConnectionWriter = new MessageWriter(s.getOutputStream());
this.connIDToQueue = connIDToQueue;
this.controlConnectionHandlerExecutor = controlConnectionHandlerExecutor;
this.relayExecutor = relayExecutor;
}
/**
* Reads the message from the input stream of the socket to the client. Then
* distinguishes two messages: allocation request and connection bind
* request. If the message is an allocation request an
* {@link RelayAllocationHandler} gets used to handle the message. Else if
* the message is an connection bind request a {@link ConnectionBindHandler}
* gets used to handle the message. If the message was of unknown type a bad
* request error is returned to the client.
*/
public void run() {
Message message;
try {
final MessageReader messageReader = this.createCustomRelayingMessageReader();
logger.debug("Reading incoming message from {}", s.toString()); //$NON-NLS-1$
message = messageReader.readSTUNMessage(s.getInputStream());
} catch (IOException e) {
logger.error("IOEXception while receiving message: {}", e.getMessage());
return;
}
if (message.isMethod(RelayingMethod.ALLOCATION) && message.isRequest()) {
logger.info("Received allocation request");
new RelayAllocationHandler(s, controlConnectionWriter, connIDToQueue, message,
controlConnectionHandlerExecutor, relayExecutor).handle();
} else if (message.isMethod(RelayingMethod.CONNECTION_BIND) && message.isRequest()) {
logger.info("Received connection bind");
new ConnectionBindHandler(s, message, connIDToQueue).handle();
} else {
// unknown message
logger.error("Received wrong message tye {}", message.getMessageMethod());
try {
Message errorResponse = message.buildFailureResponse(STUNErrorCode.BAD_REQUEST,
"Did not expect message " + message.getMessageMethod());
controlConnectionWriter.writeMessage(errorResponse);
} catch (IOException e) {
logger.error("IOException while sending error response");
}
}
}
private MessageReader createCustomRelayingMessageReader() {
logger.debug("Creating custom relaying message reader"); //$NON-NLS-1$
final List<MessageMethodDecoder> customMethodDecoders = new ArrayList<MessageMethodDecoder>();
customMethodDecoders.add(new RelayingMethodDecoder());
final List<AttributeTypeDecoder> customAttributeTypeDecoders = new ArrayList<AttributeTypeDecoder>();
customAttributeTypeDecoders.add(new RelayingAttributeTypeDecoder());
return MessageReader.createMessageReaderWithCustomDecoderLists(customMethodDecoders,
customAttributeTypeDecoders);
}
}
|
deschbach/de.htwg.teamprojekt.uce
|
relaying.server/src/main/java/de/fhkn/in/uce/relaying/server/MessageDispatcherTask.java
|
Java
|
gpl-3.0
| 6,271
|
import li_boost_shared_ptr
import gc
debug = False
# simple shared_ptr usage - created in C++
class li_boost_shared_ptr_runme:
def main(self):
if (debug):
print "Started"
li_boost_shared_ptr.cvar.debug_shared = debug
# Change loop count to run for a long time to monitor memory
loopCount = 1 #5000
for i in range (0,loopCount):
self.runtest()
# Expect 1 instance - the one global variable (GlobalValue)
if (li_boost_shared_ptr.Klass.getTotal_count() != 1):
raise RuntimeError("Klass.total_count=%s" % li_boost_shared_ptr.Klass.getTotal_count())
wrapper_count = li_boost_shared_ptr.shared_ptr_wrapper_count()
if (wrapper_count != li_boost_shared_ptr.NOT_COUNTING):
# Expect 1 instance - the one global variable (GlobalSmartValue)
if (wrapper_count != 1):
raise RuntimeError("shared_ptr wrapper count=%s" % wrapper_count)
if (debug):
print "Finished"
def runtest(self):
# simple shared_ptr usage - created in C++
k = li_boost_shared_ptr.Klass("me oh my")
val = k.getValue()
self.verifyValue("me oh my", val)
self.verifyCount(1, k)
# simple shared_ptr usage - not created in C++
k = li_boost_shared_ptr.factorycreate()
val = k.getValue()
self.verifyValue("factorycreate", val)
self.verifyCount(1, k)
# pass by shared_ptr
k = li_boost_shared_ptr.Klass("me oh my")
kret = li_boost_shared_ptr.smartpointertest(k)
val = kret.getValue()
self.verifyValue("me oh my smartpointertest", val)
self.verifyCount(2, k)
self.verifyCount(2, kret)
# pass by shared_ptr pointer
k = li_boost_shared_ptr.Klass("me oh my")
kret = li_boost_shared_ptr.smartpointerpointertest(k)
val = kret.getValue()
self.verifyValue("me oh my smartpointerpointertest", val)
self.verifyCount(2, k)
self.verifyCount(2, kret)
# pass by shared_ptr reference
k = li_boost_shared_ptr.Klass("me oh my")
kret = li_boost_shared_ptr.smartpointerreftest(k)
val = kret.getValue()
self.verifyValue("me oh my smartpointerreftest", val)
self.verifyCount(2, k)
self.verifyCount(2, kret)
# pass by shared_ptr pointer reference
k = li_boost_shared_ptr.Klass("me oh my")
kret = li_boost_shared_ptr.smartpointerpointerreftest(k)
val = kret.getValue()
self.verifyValue("me oh my smartpointerpointerreftest", val)
self.verifyCount(2, k)
self.verifyCount(2, kret)
# const pass by shared_ptr
k = li_boost_shared_ptr.Klass("me oh my")
kret = li_boost_shared_ptr.constsmartpointertest(k)
val = kret.getValue()
self.verifyValue("me oh my", val)
self.verifyCount(2, k)
self.verifyCount(2, kret)
# const pass by shared_ptr pointer
k = li_boost_shared_ptr.Klass("me oh my")
kret = li_boost_shared_ptr.constsmartpointerpointertest(k)
val = kret.getValue()
self.verifyValue("me oh my", val)
self.verifyCount(2, k)
self.verifyCount(2, kret)
# const pass by shared_ptr reference
k = li_boost_shared_ptr.Klass("me oh my")
kret = li_boost_shared_ptr.constsmartpointerreftest(k)
val = kret.getValue()
self.verifyValue("me oh my", val)
self.verifyCount(2, k)
self.verifyCount(2, kret)
# pass by value
k = li_boost_shared_ptr.Klass("me oh my")
kret = li_boost_shared_ptr.valuetest(k)
val = kret.getValue()
self.verifyValue("me oh my valuetest", val)
self.verifyCount(1, k)
self.verifyCount(1, kret)
# pass by pointer
k = li_boost_shared_ptr.Klass("me oh my")
kret = li_boost_shared_ptr.pointertest(k)
val = kret.getValue()
self.verifyValue("me oh my pointertest", val)
self.verifyCount(1, k)
self.verifyCount(1, kret)
# pass by reference
k = li_boost_shared_ptr.Klass("me oh my")
kret = li_boost_shared_ptr.reftest(k)
val = kret.getValue()
self.verifyValue("me oh my reftest", val)
self.verifyCount(1, k)
self.verifyCount(1, kret)
# pass by pointer reference
k = li_boost_shared_ptr.Klass("me oh my")
kret = li_boost_shared_ptr.pointerreftest(k)
val = kret.getValue()
self.verifyValue("me oh my pointerreftest", val)
self.verifyCount(1, k)
self.verifyCount(1, kret)
# null tests
k = None
if (li_boost_shared_ptr.smartpointertest(k) != None):
raise RuntimeError("return was not null")
if (li_boost_shared_ptr.smartpointerpointertest(k) != None):
raise RuntimeError("return was not null")
if (li_boost_shared_ptr.smartpointerreftest(k) != None):
raise RuntimeError("return was not null")
if (li_boost_shared_ptr.smartpointerpointerreftest(k) != None):
raise RuntimeError("return was not null")
if (li_boost_shared_ptr.nullsmartpointerpointertest(None) != "null pointer"):
raise RuntimeError("not null smartpointer pointer")
try:
li_boost_shared_ptr.valuetest(k)
raise RuntimeError("Failed to catch null pointer")
except ValueError:
pass
if (li_boost_shared_ptr.pointertest(k) != None):
raise RuntimeError("return was not null")
try:
li_boost_shared_ptr.reftest(k)
raise RuntimeError("Failed to catch null pointer")
except ValueError:
pass
# $owner
k = li_boost_shared_ptr.pointerownertest()
val = k.getValue()
self.verifyValue("pointerownertest", val)
self.verifyCount(1, k)
k = li_boost_shared_ptr.smartpointerpointerownertest()
val = k.getValue()
self.verifyValue("smartpointerpointerownertest", val)
self.verifyCount(1, k)
# //////////////////////////////// Derived class ////////////////////////////////////////
# derived pass by shared_ptr
k = li_boost_shared_ptr.KlassDerived("me oh my")
kret = li_boost_shared_ptr.derivedsmartptrtest(k)
val = kret.getValue()
self.verifyValue("me oh my derivedsmartptrtest-Derived", val)
self.verifyCount(2, k)
self.verifyCount(2, kret)
# derived pass by shared_ptr pointer
k = li_boost_shared_ptr.KlassDerived("me oh my")
kret = li_boost_shared_ptr.derivedsmartptrpointertest(k)
val = kret.getValue()
self.verifyValue("me oh my derivedsmartptrpointertest-Derived", val)
self.verifyCount(2, k)
self.verifyCount(2, kret)
# derived pass by shared_ptr ref
k = li_boost_shared_ptr.KlassDerived("me oh my")
kret = li_boost_shared_ptr.derivedsmartptrreftest(k)
val = kret.getValue()
self.verifyValue("me oh my derivedsmartptrreftest-Derived", val)
self.verifyCount(2, k)
self.verifyCount(2, kret)
# derived pass by shared_ptr pointer ref
k = li_boost_shared_ptr.KlassDerived("me oh my")
kret = li_boost_shared_ptr.derivedsmartptrpointerreftest(k)
val = kret.getValue()
self.verifyValue("me oh my derivedsmartptrpointerreftest-Derived", val)
self.verifyCount(2, k)
self.verifyCount(2, kret)
# derived pass by pointer
k = li_boost_shared_ptr.KlassDerived("me oh my")
kret = li_boost_shared_ptr.derivedpointertest(k)
val = kret.getValue()
self.verifyValue("me oh my derivedpointertest-Derived", val)
self.verifyCount(1, k)
self.verifyCount(1, kret)
# derived pass by ref
k = li_boost_shared_ptr.KlassDerived("me oh my")
kret = li_boost_shared_ptr.derivedreftest(k)
val = kret.getValue()
self.verifyValue("me oh my derivedreftest-Derived", val)
self.verifyCount(1, k)
self.verifyCount(1, kret)
# //////////////////////////////// Derived and base class mixed ////////////////////////////////////////
# pass by shared_ptr (mixed)
k = li_boost_shared_ptr.KlassDerived("me oh my")
kret = li_boost_shared_ptr.smartpointertest(k)
val = kret.getValue()
self.verifyValue("me oh my smartpointertest-Derived", val)
self.verifyCount(2, k)
self.verifyCount(2, kret)
# pass by shared_ptr pointer (mixed)
k = li_boost_shared_ptr.KlassDerived("me oh my")
kret = li_boost_shared_ptr.smartpointerpointertest(k)
val = kret.getValue()
self.verifyValue("me oh my smartpointerpointertest-Derived", val)
self.verifyCount(2, k)
self.verifyCount(2, kret)
# pass by shared_ptr reference (mixed)
k = li_boost_shared_ptr.KlassDerived("me oh my")
kret = li_boost_shared_ptr.smartpointerreftest(k)
val = kret.getValue()
self.verifyValue("me oh my smartpointerreftest-Derived", val)
self.verifyCount(2, k)
self.verifyCount(2, kret)
# pass by shared_ptr pointer reference (mixed)
k = li_boost_shared_ptr.KlassDerived("me oh my")
kret = li_boost_shared_ptr.smartpointerpointerreftest(k)
val = kret.getValue()
self.verifyValue("me oh my smartpointerpointerreftest-Derived", val)
self.verifyCount(2, k)
self.verifyCount(2, kret)
# pass by value (mixed)
k = li_boost_shared_ptr.KlassDerived("me oh my")
kret = li_boost_shared_ptr.valuetest(k)
val = kret.getValue()
self.verifyValue("me oh my valuetest", val) # note slicing
self.verifyCount(1, k)
self.verifyCount(1, kret)
# pass by pointer (mixed)
k = li_boost_shared_ptr.KlassDerived("me oh my")
kret = li_boost_shared_ptr.pointertest(k)
val = kret.getValue()
self.verifyValue("me oh my pointertest-Derived", val)
self.verifyCount(1, k)
self.verifyCount(1, kret)
# pass by ref (mixed)
k = li_boost_shared_ptr.KlassDerived("me oh my")
kret = li_boost_shared_ptr.reftest(k)
val = kret.getValue()
self.verifyValue("me oh my reftest-Derived", val)
self.verifyCount(1, k)
self.verifyCount(1, kret)
# //////////////////////////////// Overloading tests ////////////////////////////////////////
# Base class
k = li_boost_shared_ptr.Klass("me oh my")
self.verifyValue(li_boost_shared_ptr.overload_rawbyval(k), "rawbyval")
self.verifyValue(li_boost_shared_ptr.overload_rawbyref(k), "rawbyref")
self.verifyValue(li_boost_shared_ptr.overload_rawbyptr(k), "rawbyptr")
self.verifyValue(li_boost_shared_ptr.overload_rawbyptrref(k), "rawbyptrref")
self.verifyValue(li_boost_shared_ptr.overload_smartbyval(k), "smartbyval")
self.verifyValue(li_boost_shared_ptr.overload_smartbyref(k), "smartbyref")
self.verifyValue(li_boost_shared_ptr.overload_smartbyptr(k), "smartbyptr")
self.verifyValue(li_boost_shared_ptr.overload_smartbyptrref(k), "smartbyptrref")
# Derived class
k = li_boost_shared_ptr.KlassDerived("me oh my")
self.verifyValue(li_boost_shared_ptr.overload_rawbyval(k), "rawbyval")
self.verifyValue(li_boost_shared_ptr.overload_rawbyref(k), "rawbyref")
self.verifyValue(li_boost_shared_ptr.overload_rawbyptr(k), "rawbyptr")
self.verifyValue(li_boost_shared_ptr.overload_rawbyptrref(k), "rawbyptrref")
self.verifyValue(li_boost_shared_ptr.overload_smartbyval(k), "smartbyval")
self.verifyValue(li_boost_shared_ptr.overload_smartbyref(k), "smartbyref")
self.verifyValue(li_boost_shared_ptr.overload_smartbyptr(k), "smartbyptr")
self.verifyValue(li_boost_shared_ptr.overload_smartbyptrref(k), "smartbyptrref")
# 3rd derived class
k = li_boost_shared_ptr.Klass3rdDerived("me oh my")
val = k.getValue()
self.verifyValue("me oh my-3rdDerived", val)
self.verifyCount(1, k)
val = li_boost_shared_ptr.test3rdupcast(k)
self.verifyValue("me oh my-3rdDerived", val)
self.verifyCount(1, k)
# //////////////////////////////// Member variables ////////////////////////////////////////
# smart pointer by value
m = li_boost_shared_ptr.MemberVariables()
k = li_boost_shared_ptr.Klass("smart member value")
m.SmartMemberValue = k
val = k.getValue()
self.verifyValue("smart member value", val)
self.verifyCount(2, k)
kmember = m.SmartMemberValue
val = kmember.getValue()
self.verifyValue("smart member value", val)
self.verifyCount(3, kmember)
self.verifyCount(3, k)
del m
self.verifyCount(2, kmember)
self.verifyCount(2, k)
# smart pointer by pointer
m = li_boost_shared_ptr.MemberVariables()
k = li_boost_shared_ptr.Klass("smart member pointer")
m.SmartMemberPointer = k
val = k.getValue()
self.verifyValue("smart member pointer", val)
self.verifyCount(1, k)
kmember = m.SmartMemberPointer
val = kmember.getValue()
self.verifyValue("smart member pointer", val)
self.verifyCount(2, kmember)
self.verifyCount(2, k)
del m
self.verifyCount(2, kmember)
self.verifyCount(2, k)
# smart pointer by reference
m = li_boost_shared_ptr.MemberVariables()
k = li_boost_shared_ptr.Klass("smart member reference")
m.SmartMemberReference = k
val = k.getValue()
self.verifyValue("smart member reference", val)
self.verifyCount(2, k)
kmember = m.SmartMemberReference
val = kmember.getValue()
self.verifyValue("smart member reference", val)
self.verifyCount(3, kmember)
self.verifyCount(3, k)
# The C++ reference refers to SmartMemberValue...
kmemberVal = m.SmartMemberValue
val = kmember.getValue()
self.verifyValue("smart member reference", val)
self.verifyCount(4, kmemberVal)
self.verifyCount(4, kmember)
self.verifyCount(4, k)
del m
self.verifyCount(3, kmemberVal)
self.verifyCount(3, kmember)
self.verifyCount(3, k)
# plain by value
m = li_boost_shared_ptr.MemberVariables()
k = li_boost_shared_ptr.Klass("plain member value")
m.MemberValue = k
val = k.getValue()
self.verifyValue("plain member value", val)
self.verifyCount(1, k)
kmember = m.MemberValue
val = kmember.getValue()
self.verifyValue("plain member value", val)
self.verifyCount(1, kmember)
self.verifyCount(1, k)
del m
self.verifyCount(1, kmember)
self.verifyCount(1, k)
# plain by pointer
m = li_boost_shared_ptr.MemberVariables()
k = li_boost_shared_ptr.Klass("plain member pointer")
m.MemberPointer = k
val = k.getValue()
self.verifyValue("plain member pointer", val)
self.verifyCount(1, k)
kmember = m.MemberPointer
val = kmember.getValue()
self.verifyValue("plain member pointer", val)
self.verifyCount(1, kmember)
self.verifyCount(1, k)
del m
self.verifyCount(1, kmember)
self.verifyCount(1, k)
# plain by reference
m = li_boost_shared_ptr.MemberVariables()
k = li_boost_shared_ptr.Klass("plain member reference")
m.MemberReference = k
val = k.getValue()
self.verifyValue("plain member reference", val)
self.verifyCount(1, k)
kmember = m.MemberReference
val = kmember.getValue()
self.verifyValue("plain member reference", val)
self.verifyCount(1, kmember)
self.verifyCount(1, k)
del m
self.verifyCount(1, kmember)
self.verifyCount(1, k)
# null member variables
m = li_boost_shared_ptr.MemberVariables()
# shared_ptr by value
k = m.SmartMemberValue
if (k != None):
raise RuntimeError("expected null")
m.SmartMemberValue = None
k = m.SmartMemberValue
if (k != None):
raise RuntimeError("expected null")
self.verifyCount(0, k)
# plain by value
try:
m.MemberValue = None
raise RuntimeError("Failed to catch null pointer")
except ValueError:
pass
# ////////////////////////////////// Global variables ////////////////////////////////////////
# smart pointer
kglobal = li_boost_shared_ptr.cvar.GlobalSmartValue
if (kglobal != None):
raise RuntimeError("expected null")
k = li_boost_shared_ptr.Klass("smart global value")
li_boost_shared_ptr.cvar.GlobalSmartValue = k
self.verifyCount(2, k)
kglobal = li_boost_shared_ptr.cvar.GlobalSmartValue
val = kglobal.getValue()
self.verifyValue("smart global value", val)
self.verifyCount(3, kglobal)
self.verifyCount(3, k)
self.verifyValue("smart global value", li_boost_shared_ptr.cvar.GlobalSmartValue.getValue())
li_boost_shared_ptr.cvar.GlobalSmartValue = None
# plain value
k = li_boost_shared_ptr.Klass("global value")
li_boost_shared_ptr.cvar.GlobalValue = k
self.verifyCount(1, k)
kglobal = li_boost_shared_ptr.cvar.GlobalValue
val = kglobal.getValue()
self.verifyValue("global value", val)
self.verifyCount(1, kglobal)
self.verifyCount(1, k)
self.verifyValue("global value", li_boost_shared_ptr.cvar.GlobalValue.getValue())
try:
li_boost_shared_ptr.cvar.GlobalValue = None
raise RuntimeError("Failed to catch null pointer")
except ValueError:
pass
# plain pointer
kglobal = li_boost_shared_ptr.cvar.GlobalPointer
if (kglobal != None):
raise RuntimeError("expected null")
k = li_boost_shared_ptr.Klass("global pointer")
li_boost_shared_ptr.cvar.GlobalPointer = k
self.verifyCount(1, k)
kglobal = li_boost_shared_ptr.cvar.GlobalPointer
val = kglobal.getValue()
self.verifyValue("global pointer", val)
self.verifyCount(1, kglobal)
self.verifyCount(1, k)
li_boost_shared_ptr.cvar.GlobalPointer = None
# plain reference
kglobal
k = li_boost_shared_ptr.Klass("global reference")
li_boost_shared_ptr.cvar.GlobalReference = k
self.verifyCount(1, k)
kglobal = li_boost_shared_ptr.cvar.GlobalReference
val = kglobal.getValue()
self.verifyValue("global reference", val)
self.verifyCount(1, kglobal)
self.verifyCount(1, k)
try:
li_boost_shared_ptr.cvar.GlobalReference = None
raise RuntimeError("Failed to catch null pointer")
except ValueError:
pass
# ////////////////////////////////// Templates ////////////////////////////////////////
pid = li_boost_shared_ptr.PairIntDouble(10, 20.2)
if (pid.baseVal1 != 20 or pid.baseVal2 != 40.4):
raise RuntimeError("Base values wrong")
if (pid.val1 != 10 or pid.val2 != 20.2):
raise RuntimeError("Derived Values wrong")
def verifyValue(self, expected, got):
if (expected != got):
raise RuntimeError("verify value failed. Expected: ", expected, " Got: ", got)
def verifyCount(self, expected, k):
got = li_boost_shared_ptr.use_count(k)
if (expected != got):
raise RuntimeError("verify use_count failed. Expected: ", expected, " Got: ", got)
runme = li_boost_shared_ptr_runme()
runme.main()
|
jrversteegh/softsailor
|
deps/swig-2.0.4/Examples/test-suite/python/li_boost_shared_ptr_runme.py
|
Python
|
gpl-3.0
| 18,306
|
<!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_33) on Fri Jun 22 11:01:31 IST 2012 -->
<TITLE>
Uses of Class de.fuberlin.wiwiss.d2rq.expr.BooleanToIntegerCaseExpression (D2RQ)
</TITLE>
<META NAME="date" CONTENT="2012-06-22">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class de.fuberlin.wiwiss.d2rq.expr.BooleanToIntegerCaseExpression (D2RQ)";
}
}
</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> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../de/fuberlin/wiwiss/d2rq/expr/BooleanToIntegerCaseExpression.html" title="class in de.fuberlin.wiwiss.d2rq.expr"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../index.html?de/fuberlin/wiwiss/d2rq/expr//class-useBooleanToIntegerCaseExpression.html" target="_top"><B>FRAMES</B></A>
<A HREF="BooleanToIntegerCaseExpression.html" target="_top"><B>NO FRAMES</B></A>
<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>
<H2>
<B>Uses of Class<br>de.fuberlin.wiwiss.d2rq.expr.BooleanToIntegerCaseExpression</B></H2>
</CENTER>
No usage of de.fuberlin.wiwiss.d2rq.expr.BooleanToIntegerCaseExpression
<P>
<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> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../de/fuberlin/wiwiss/d2rq/expr/BooleanToIntegerCaseExpression.html" title="class in de.fuberlin.wiwiss.d2rq.expr"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../index.html?de/fuberlin/wiwiss/d2rq/expr//class-useBooleanToIntegerCaseExpression.html" target="_top"><B>FRAMES</B></A>
<A HREF="BooleanToIntegerCaseExpression.html" target="_top"><B>NO FRAMES</B></A>
<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>
|
morelab/c4a_data_repository
|
LinkedDataInterface/src/ruleEngine/doc/javadoc/de/fuberlin/wiwiss/d2rq/expr/class-use/BooleanToIntegerCaseExpression.html
|
HTML
|
gpl-3.0
| 6,199
|
"""
The basic module about log readers
"""
import os
import re
from ..utils.gzip2 import GzipFile
__author__ = 'chenxm'
__all__ = ["FileReader"]
class FileReader(object):
@staticmethod
def open_file(filename, mode='rb'):
""" open plain or compressed file
@return file handler
"""
parts = os.path.basename(filename).split('.')
try:
assert parts[-1] == 'gz'
fh = GzipFile(mode=mode, filename = filename)
except:
fh = open(filename, mode)
return fh
@staticmethod
def list_files(folder, regex_str=r'.', match=True):
""" find all files under 'folder' with names matching
some reguler expression
"""
assert os.path.isdir(folder)
all_files_path = []
for root, dirs, files in os.walk(folder):
for filename in files:
if match and re.match(regex_str, filename, re.IGNORECASE):
all_files_path.append(os.path.join(root, filename))
elif not match and re.search(regex_str, filename, re.IGNORECASE):
all_files_path.append(os.path.join(root, filename))
return all_files_path
class LogEntry(object):
def __init__(self):
self.data = {}
def get(self, property):
try:
return self[property]
except KeyError:
return None
def set(self, property, value):
self[property] = value
def __getitem__(self, property):
return self.data[property]
def __setitem__(self, property, value):
self.data[property] = value
def __str__(self):
return str(self.data)
class LogReader(object):
def __init__(self, filename):
self.filename = filename
self.filehandler = FileReader.open_file(filename)
def __iter__(self):
return self
def next(self):
try:
new_line = self.filehandler.next()
return new_line
except StopIteration:
self.filehandler.close()
raise StopIteration
|
pombreda/omnipy
|
omnipy/reader/_reader.py
|
Python
|
gpl-3.0
| 1,755
|
package generated.gio20.gio;
import org.bridj.BridJ;
import org.bridj.Pointer;
import org.bridj.StructObject;
import org.bridj.ann.Field;
import org.bridj.ann.Library;
import org.bridj.ann.Ptr;
@Library("gio-2.0")
public class GDBusSignalInfo
extends StructObject
{
static {
BridJ.register();
}
public GDBusSignalInfo() {
super();
}
public GDBusSignalInfo(Pointer pointer) {
super(pointer);
}
@Field(0)
public int gdbussignalinfo_field_ref_count() {
return this.io.getIntField(this, 0);
}
@Field(0)
public GDBusSignalInfo gdbussignalinfo_field_ref_count(int gdbussignalinfo_field_ref_count) {
this.io.setIntField(this, 0, gdbussignalinfo_field_ref_count);
return this;
}
@Field(1)
public Pointer gdbussignalinfo_field_name() {
return this.io.getPointerField(this, 1);
}
@Field(1)
public GDBusSignalInfo gdbussignalinfo_field_name(Pointer gdbussignalinfo_field_name) {
this.io.setPointerField(this, 1, gdbussignalinfo_field_name);
return this;
}
@Field(2)
public Pointer<Pointer<GDBusArgInfo>> gdbussignalinfo_field_args() {
return this.io.getPointerField(this, 2);
}
@Field(2)
public GDBusSignalInfo gdbussignalinfo_field_args(Pointer<Pointer<GDBusArgInfo>> gdbussignalinfo_field_args) {
this.io.setPointerField(this, 2, gdbussignalinfo_field_args);
return this;
}
@Field(3)
public Pointer<Pointer<GDBusAnnotationInfo>> gdbussignalinfo_field_annotations() {
return this.io.getPointerField(this, 3);
}
@Field(3)
public GDBusSignalInfo gdbussignalinfo_field_annotations(Pointer<Pointer<GDBusAnnotationInfo>> gdbussignalinfo_field_annotations) {
this.io.setPointerField(this, 3, gdbussignalinfo_field_annotations);
return this;
}
@Ptr
protected native long g_dbus_signal_info_ref(
@Ptr
long info);
public Pointer ref() {
return Pointer.pointerToAddress(this.g_dbus_signal_info_ref(Pointer.pointerTo(this, GDBusSignalInfo.class).getPeer()));
}
protected native void g_dbus_signal_info_unref(
@Ptr
long info);
public void unref() {
this.g_dbus_signal_info_unref(Pointer.pointerTo(this, GDBusSignalInfo.class).getPeer());
}
}
|
gstreamer-java/gir2java
|
generated-src/generated/gio20/gio/GDBusSignalInfo.java
|
Java
|
gpl-3.0
| 2,360
|
/*
This file is part of LilyPond, the GNU music typesetter.
Copyright (C) 1998--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>,
Erik Sandberg <mandolaerik@gmail.com>
LilyPond 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.
LilyPond 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 LilyPond. If not, see <http://www.gnu.org/licenses/>.
*/
#include "context.hh"
#include "input.hh"
#include "international.hh"
#include "music.hh"
#include "music-wrapper-iterator.hh"
#include "stream-event.hh"
/*
Iterates \times, by sending TupletSpanEvents at the start/end of each
tuplet bracket. Extra stop/start events are sent at regular
intervals if tupletSpannerDuration is set.
*/
class Tuplet_iterator : public Music_wrapper_iterator
{
public:
DECLARE_SCHEME_CALLBACK (constructor, ());
/* construction */
DECLARE_CLASSNAME (Tuplet_iterator);
Tuplet_iterator ();
protected:
virtual void process (Moment m);
virtual void construct_children ();
virtual void derived_mark () const;
virtual Moment pending_moment () const;
Music *create_event (Direction d);
private:
/* tupletSpannerDuration */
Moment spanner_duration_;
/* next time to add a stop/start pair */
Moment next_split_mom_;
/* Recycle start/stop events if tupletSpannerDuration is set. */
SCM synthesized_events_;
Context_handle tuplet_handler_;
};
Music *
Tuplet_iterator::create_event (Direction d)
{
SCM ev_scm = scm_call_2 (ly_lily_module_constant ("make-span-event"),
ly_symbol2scm ("TupletSpanEvent"),
scm_from_int (d));
Music *mus = get_music ();
Music *ev = unsmob_music (ev_scm);
ev->set_spot (*mus->origin ());
if (d == START)
{
ev->set_property ("numerator", mus->get_property ("numerator"));
ev->set_property ("denominator", mus->get_property ("denominator"));
ev->set_property ("tweaks", mus->get_property ("tweaks"));
ev->set_property ("length", spanner_duration_.smobbed_copy ());
}
synthesized_events_ = scm_cons (ev_scm, synthesized_events_);
return ev;
}
Tuplet_iterator::Tuplet_iterator ()
{
spanner_duration_ = next_split_mom_ = 0;
synthesized_events_ = SCM_EOL;
}
Moment
Tuplet_iterator::pending_moment () const
{
Moment next_mom = Music_wrapper_iterator::pending_moment ();
next_mom = min (next_mom, next_split_mom_);
return next_mom;
}
void
Tuplet_iterator::process (Moment m)
{
if (spanner_duration_.to_bool ()
&& m.main_part_ == next_split_mom_)
{
descend_to_bottom_context ();
if (tuplet_handler_.get_context ())
create_event (STOP)->send_to_context (tuplet_handler_.get_context ());
if (m.main_part_ < music_get_length ().main_part_)
{
tuplet_handler_.set_context (get_outlet ());
report_event (create_event (START));
next_split_mom_ += spanner_duration_;
}
else
tuplet_handler_.set_context (0);
}
Music_wrapper_iterator::process (m);
if (child_iter_ && child_iter_->ok ())
descend_to_child (child_iter_->get_outlet ());
}
void
Tuplet_iterator::construct_children ()
{
spanner_duration_ = music_get_length ();
Moment *mp
= unsmob_moment (get_outlet ()->get_property ("tupletSpannerDuration"));
if (mp)
spanner_duration_ = min (mp->main_part_, spanner_duration_);
Music_wrapper_iterator::construct_children ();
if (child_iter_ && child_iter_->ok ())
descend_to_child (child_iter_->get_outlet ());
}
void
Tuplet_iterator::derived_mark () const
{
scm_gc_mark (synthesized_events_);
Music_wrapper_iterator::derived_mark ();
}
IMPLEMENT_CTOR_CALLBACK (Tuplet_iterator);
|
sehe/Lilypond
|
lily/tuplet-iterator.cc
|
C++
|
gpl-3.0
| 4,119
|
/* This file is part of the db4o object database http://www.db4o.com
Copyright (C) 2004 - 2011 Versant Corporation http://www.versant.com
db4o is free software; you can redistribute it and/or modify it under
the terms of version 3 of the GNU General Public License as published
by the Free Software Foundation.
db4o 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/. */
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.CompilerServices;
using Db4objects.Db4o.Activation;
using Db4objects.Db4o.Foundation;
using Db4objects.Db4o.Internal;
using Db4objects.Db4o.TA;
using Db4oTool.Core;
using Mono.Cecil;
using Mono.Cecil.Cil;
using FieldAttributes = Mono.Cecil.FieldAttributes;
using MethodBody = Mono.Cecil.Cil.MethodBody;
namespace Db4oTool.TA
{
public class TAInstrumentation : AbstractAssemblyInstrumentation
{
private const string ITTransparentActivation = "TA";
public static readonly string CompilerGeneratedAttribute = typeof (CompilerGeneratedAttribute).FullName;
private readonly ITAInstrumentationStep _collectionsStep = NullTAInstrumentationStep.Instance;
private CustomAttribute _instrumentationAttribute;
private CecilReflector _reflector;
public TAInstrumentation(bool instrumentCollections)
{
if (instrumentCollections)
{
_collectionsStep = new TACollectionsStep();
}
}
protected override void BeforeAssemblyProcessing()
{
_reflector = new CecilReflector(_context);
_collectionsStep.Context = _context;
CreateTagAttribute();
}
protected override void ProcessModule(ModuleDefinition module)
{
if (AlreadyTAInstrumented())
{
_context.TraceWarning("Assembly already instrumented for Transparent Activation.");
return;
}
MarkAsInstrumented();
ProcessTypes(module.Types, MakeActivatable);
ProcessTypes(module.Types, NoFiltering, ProcessType);
}
private void CreateTagAttribute()
{
_instrumentationAttribute = new CustomAttribute(ImportConstructor(typeof (TagAttribute)));
_instrumentationAttribute.ConstructorArguments.Add(
new CustomAttributeArgument(_context.Import(typeof (string)), ITTransparentActivation));
}
private MethodReference ImportConstructor(Type type)
{
return _context.Import(type.GetConstructor(new[] {typeof (string)}));
}
private bool IsTATag(CustomAttribute ca)
{
return ca.Constructor.DeclaringType == _instrumentationAttribute.Constructor.DeclaringType &&
ca.Constructor.Parameters.Count == 1;
}
private bool AlreadyTAInstrumented()
{
foreach (var ca in _context.Assembly.CustomAttributes)
{
if (IsTATag(ca)) return true;
}
return false;
}
private void MarkAsInstrumented()
{
_context.Assembly.CustomAttributes.Add(_instrumentationAttribute);
}
private void MakeActivatable(TypeDefinition type)
{
if (!RequiresTA(type)) return;
if (ImplementsActivatable(type)) return;
if (HasInstrumentedBaseType(type)) return;
type.Interfaces.Add(Import(typeof (IActivatable)));
var activatorField = CreateActivatorField();
type.Fields.Add(activatorField);
type.Methods.Add(CreateActivateMethod(activatorField));
type.Methods.Add(CreateBindMethod(activatorField));
EmitWarningsForNonPrivateFields(type);
}
private void EmitWarningsForNonPrivateFields(TypeDefinition type)
{
foreach (var field in NonPrivateStorableFieldsIn(type))
{
_context.TraceWarning(
"Found non-private field '{0}' in instrumented type '{1}'. Make sure that any accessing classes are instrumented also.",
field.Name, type.Name);
}
}
private IEnumerable<FieldDefinition> NonPrivateStorableFieldsIn(TypeDefinition type)
{
foreach (var field in type.Fields)
{
if (!field.IsPrivate && IsStorable(field))
{
yield return field;
}
}
}
private bool HasInstrumentedBaseType(TypeDefinition type)
{
// is the base type defined in the same assembly?
var baseType = type.BaseType as TypeDefinition;
if (baseType == null) return false;
return RequiresTA(baseType);
}
private TypeDefinition ResolveTypeReference(TypeReference typeRef)
{
return _reflector.ResolveTypeReference(typeRef);
}
private bool RequiresTA(TypeDefinition type)
{
if (type.IsValueType) return false;
if (IsStaticClass(type)) return false;
if (type.IsInterface) return false;
if (type.Name == "<Module>") return false;
if (IsDelegate(type)) return false;
if (ByAttributeFilter.ContainsCustomAttribute(type, CompilerGeneratedAttribute)) return false;
if (!HasStorableFields(type) && type.BaseType.FullName == "System.Object") return false;
return true;
}
private static bool IsStaticClass(TypeDefinition type)
{
return type.IsAbstract && type.IsSealed;
}
private bool HasStorableFields(TypeDefinition type)
{
foreach (var field in type.Fields)
if (IsStorable(field))
return true;
return false;
}
private bool IsStorable(FieldDefinition field)
{
var fieldType = ResolveTypeReference(field.FieldType);
if (field.IsNotSerialized || (fieldType != null && (IsDelegate(fieldType) || IsWin32Handle(fieldType))))
{
return false;
}
return !IsPointer(field.FieldType);
}
private static bool IsWin32Handle(TypeReference type)
{
if (type == null) return false;
if (type.FullName == "System.Runtime.InteropServices.SafeHandle" || type.FullName == "System.IntPtr")
return true;
var typeDefinition = type as TypeDefinition;
if (typeDefinition == null) return false;
var baseType = typeDefinition.BaseType;
return IsWin32Handle(baseType);
}
private bool ImplementsActivatable(TypeDefinition type)
{
return _reflector.Implements(type, typeof (IActivatable));
}
private MethodDefinition CreateActivateMethod(FieldDefinition activatorField)
{
return new ActivateMethodEmitter(_context, activatorField).Emit();
}
private FieldDefinition CreateActivatorField()
{
return new FieldDefinition("db4o$$ta$$activator", FieldAttributes.Private | FieldAttributes.NotSerialized,
ActivatorType());
}
private MethodDefinition CreateBindMethod(FieldReference activatorField)
{
return new BindMethodEmitter(_context, activatorField).Emit();
}
private TypeReference ActivatorType()
{
return Import(typeof (IActivator));
}
protected override void ProcessMethod(MethodDefinition method)
{
if (!method.HasBody || method.IsCompilerControlled) return;
try
{
MethodEditor.SimplifyMacros(method.Body);
_collectionsStep.Process(method);
if (!HasFieldAccesses(method)) return;
InstrumentFieldAccesses(method);
PatchBaseConstructorInvocationOrderIfRequired(method);
}
finally
{
MethodEditor.OptimizeMacros(method.Body);
}
}
private static void PatchBaseConstructorInvocationOrderIfRequired(MethodDefinition method)
{
if (!method.IsConstructor) return;
if (!HasFieldAccessBeforeBaseConstructorInvocation(method)) return;
PatchBaseConstructorInvocationOrder(method);
}
private static void PatchBaseConstructorInvocationOrder(MethodDefinition method)
{
var ctorInvocation =
(Instruction)
Iterators.Next(InstrumentationUtil.Where(method.Body, IsBaseConstructorInvocation).GetEnumerator());
var loadThis = GetLoadThisReferenceFor(method.Body, ctorInvocation);
MoveInstructions(loadThis, ctorInvocation, method.Body.Instructions[0], method.Body.GetILProcessor());
}
private static void MoveInstructions(Instruction start, Instruction end, Instruction insertionPoint,
ILProcessor il)
{
IList<Instruction> toBeMoved = new List<Instruction>();
var boundary = end.Next;
while (start != boundary)
{
toBeMoved.Add(start);
var next = start.Next;
il.Remove(start);
start = next;
}
foreach (var instruction in toBeMoved)
{
il.InsertBefore(insertionPoint, instruction);
}
}
private static Instruction GetLoadThisReferenceFor(MethodBody body, Instruction ctorInvocation)
{
var current = ctorInvocation.Previous;
while (current != null)
{
if (IsLoadThis(body, current)) return current;
current = current.Previous;
}
return null;
}
private static bool HasFieldAccessBeforeBaseConstructorInvocation(MethodDefinition ctor)
{
var baseConstructorInvoked = false;
foreach (var instruction in BaseConstructorInvocationOrFieldAccesses(ctor))
{
if (IsBaseConstructorInvocation(instruction))
{
baseConstructorInvoked = true;
continue;
}
if (!baseConstructorInvoked)
{
return true;
}
}
return false;
}
private static IEnumerable<Instruction> BaseConstructorInvocationOrFieldAccesses(MethodDefinition ctor)
{
return InstrumentationUtil.Where(
ctor.Body,
delegate(Instruction instruction)
{
return IsFieldAccess(instruction) || IsBaseConstructorInvocation(instruction);
});
}
private static bool IsBaseConstructorInvocation(Instruction instruction)
{
return InstrumentationUtil.IsCallInstruction(instruction) && HasConstructorOperand(instruction);
}
private static bool IsLoadThis(MethodBody body, Instruction instruction)
{
if (instruction.OpCode == OpCodes.Ldarg)
{
var parameterReference = (ParameterReference) instruction.Operand;
return parameterReference == body.ThisParameter;
}
if (instruction.OpCode == OpCodes.Ldarg_0)
{
throw new InvalidOperationException(
"MethodBody.Simplify() should have translated 'ldarg_0' to 'ldarg 0'");
}
return false;
}
private static bool HasConstructorOperand(Instruction instruction)
{
var methodReference = (MethodReference) instruction.Operand;
return methodReference.Name == ".ctor";
}
private bool HasFieldAccesses(MethodDefinition method)
{
return FieldAccesses(method.Body).GetEnumerator().MoveNext();
}
private void InstrumentFieldAccesses(MethodDefinition method)
{
var editor = new MethodEditor(method);
foreach (var instruction in FieldAccesses(method.Body))
{
ProcessFieldAccess(editor, instruction);
}
}
private IEnumerable<Instruction> FieldAccesses(MethodBody body)
{
return InstrumentationUtil.Where(body, IsActivatableFieldAccess);
}
private bool IsActivatableFieldAccess(Instruction instruction)
{
if (!IsFieldAccess(instruction)) return false;
return IsActivatableField((FieldReference) instruction.Operand);
}
private void ProcessFieldAccess(MethodEditor cil, Instruction instruction)
{
if (IsFieldGetter(instruction))
{
ProcessFieldGetter(instruction, cil);
}
else
{
ProcessFieldSetter(instruction, cil);
}
}
private void ProcessFieldSetter(Instruction instruction, MethodEditor cil)
{
var oldStackTop = SaveStackTop(cil, instruction);
var insertionPoint = GetInsertionPoint(instruction);
InsertActivateCall(cil, insertionPoint, ActivationPurpose.Write);
cil.InsertBefore(insertionPoint, cil.Create(OpCodes.Ldloc, oldStackTop));
}
private static VariableDefinition SaveStackTop(MethodEditor cil, Instruction instruction)
{
var oldStackTop = cil.AddVariable(Resolve(instruction).FieldType);
cil.InsertBefore(GetInsertionPoint(instruction), cil.Create(OpCodes.Stloc, oldStackTop));
return oldStackTop;
}
private static FieldReference Resolve(Instruction instruction)
{
return (FieldReference) instruction.Operand;
}
private static bool IsFieldGetter(Instruction instruction)
{
return instruction.OpCode == OpCodes.Ldfld || instruction.OpCode == OpCodes.Ldflda;
}
private void ProcessFieldGetter(Instruction instruction, MethodEditor cil)
{
var insertionPoint = GetInsertionPoint(instruction);
InsertActivateCall(cil, insertionPoint, ActivationPurpose.Read);
}
private void InsertActivateCall(MethodEditor cil, Instruction insertionPoint,
ActivationPurpose activationPurpose)
{
var previous = insertionPoint.Previous;
if (previous.OpCode == OpCodes.Ldarg)
{
var newLoadInstruction = cil.Create(previous.OpCode, (ParameterDefinition) previous.Operand);
InsertActivateCall(cil,
previous,
newLoadInstruction,
activationPurpose);
}
else
{
InsertActivateCall(cil,
insertionPoint,
cil.Create(OpCodes.Dup),
activationPurpose);
}
}
private void InsertActivateCall(MethodEditor cil, Instruction insertionPoint,
Instruction loadReferenceInstruction, ActivationPurpose activationPurpose)
{
cil.InsertBefore(insertionPoint, loadReferenceInstruction);
cil.InsertBefore(insertionPoint, cil.Create(OpCodes.Ldc_I4, (int) activationPurpose));
cil.InsertBefore(insertionPoint, cil.Create(OpCodes.Callvirt, ActivateMethodRef()));
}
private MethodReference ActivateMethodRef()
{
return Import(ActivateMethod());
}
public FieldReference Import(FieldInfo field)
{
return _context.Assembly.MainModule.Import(field);
}
private static Instruction GetInsertionPoint(Instruction instruction)
{
return instruction.Previous.OpCode == OpCodes.Volatile
? instruction.Previous
: instruction;
}
private static MethodInfo ActivateMethod()
{
return typeof (IActivatable).GetMethod("Activate", new[] {typeof (ActivationPurpose)});
}
private bool IsActivatableField(FieldReference field)
{
if (DeclaredInNonActivatableType(field))
return false;
return IsActivatableFieldType(field);
}
private bool IsActivatableFieldType(FieldReference field)
{
if (IsPointer(field.FieldType)) return false;
var declaringType = ResolveTypeReference(field.DeclaringType);
if (declaringType == null) return false;
if (IsTransient(declaringType, field)) return false;
var fieldType = ResolveTypeReference(field.FieldType);
if (null == fieldType)
{
// we dont know the field type but it doesn't hurt
// to call Activate
// filtering would be only an optimization
return true;
}
return !IsDelegate(fieldType);
}
private bool DeclaredInNonActivatableType(MemberReference field)
{
var declaringType = ResolveTypeReference(field.DeclaringType);
if (declaringType == null) return true;
if (IsTransient(declaringType, field)) return true;
if (!Accept(declaringType)) return true;
if (!ImplementsActivatable(declaringType)) return true;
return false;
}
private static bool IsPointer(TypeReference type)
{
return type is PointerType;
}
private static bool IsDelegate(TypeDefinition type)
{
var baseType = type.BaseType;
if (null == baseType) return false;
var fullName = baseType.FullName;
return fullName == "System.Delegate"
|| fullName == "System.MulticastDelegate";
}
private static bool IsTransient(TypeDefinition type, MemberReference fieldRef)
{
var field = CecilReflector.GetField(type, fieldRef.Name);
if (field == null) return true;
return field.IsNotSerialized;
}
private static bool IsFieldAccess(Instruction instruction)
{
return instruction.OpCode == OpCodes.Ldfld
|| instruction.OpCode == OpCodes.Ldflda
|| instruction.OpCode == OpCodes.Stfld;
}
}
}
|
FerranSalguero/db4o
|
Db4oTool/Db4oTool/TA/TAInstrumentation.cs
|
C#
|
gpl-3.0
| 19,044
|
<!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_162) on Tue Apr 17 14:00:01 CEST 2018 -->
<title>equations</title>
<meta name="date" content="2018-04-17">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
<script type="text/javascript" src="../script.js"></script>
</head>
<body>
<h1 class="bar"><a href="../equations/package-summary.html" target="classFrame">equations</a></h1>
<div class="indexContainer">
<h2 title="Classes">Classes</h2>
<ul title="Classes">
<li><a href="LHSLengthComparator.html" title="class in equations" target="classFrame">LHSLengthComparator</a></li>
</ul>
</div>
</body>
</html>
|
thpar/jesse
|
doc/equations/package-frame.html
|
HTML
|
gpl-3.0
| 764
|
#ifndef QT3KLOADSENSORDATAOBJECT_H
#define QT3KLOADSENSORDATAOBJECT_H
#include <QObject>
#include "QT3kHIDObject.h"
#include "LogDataDef.h"
class QT3kLoadSensorDataObject : public QT3kHIDObject
{
Q_OBJECT
public:
explicit QT3kLoadSensorDataObject(QT3kDevice*& pHandle, QObject *parent = 0);
virtual ~QT3kLoadSensorDataObject();
enum eDataPart { DP_CM1 = 1, DP_CM2, DP_CM1_1, DP_CM2_1, DP_MM, DP_END };
// QT3kHIDObject
virtual bool Start( SensorLogData* pStorage );
protected:
void LoadNextCamData( eDataPart ePart );
void NextCommand();
void Push_Data(ResponsePart Part, PairRSP &stRSP, const char* sCmd);
protected:
// QT3kDeviceEventHandler::IListener
virtual void TPDP_OnRSP(T3K_DEVICE_INFO devInfo, ResponsePart Part, unsigned short ticktime, const char *partid, int id, bool bFinal, const char *cmd);
virtual void TPDP_OnRSE(T3K_DEVICE_INFO devInfo, ResponsePart Part, unsigned short ticktime, const char *partid, int id, bool bFinal, const char *cmd);
virtual void TPDP_OnVER(T3K_DEVICE_INFO devInfo, ResponsePart Part, unsigned short ticktime, const char *partid, t3kpacket::_body::_ver *ver);
protected:
long m_nNVIndex;
bool m_bFactoryCmd;
eDataPart m_eDataPart;
SensorLogData* m_pStorageHandle;
signals:
public slots:
};
#endif // QT3KLOADSENSORDATAOBJECT_H
|
habilience/habilience-t3ksensor-tools
|
T3kCfg/QT3kLoadSensorDataObject.h
|
C
|
gpl-3.0
| 1,474
|
/*
* Copyright (C) 2016-2021 phantombot.github.io/PhantomBot
*
* 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/>.
*/
// Function that querys all of the data we need.
$(run = function() {
// Get command settings.
socket.getDBValues('get_command_settings', {
tables: ['settings', 'settings', 'settings', 'settings', 'cooldownSettings',
'cooldownSettings'],
keys: ['permComMsgEnabled', 'priceComMsgEnabled', 'coolDownMsgEnabled',
'pricecomMods', 'modCooldown', 'defaultCooldownTime']
}, true, function(e) {
// Set cost message.
$('#cmd-cost-messages').val((e.priceComMsgEnabled === 'true' ? 'Yes' : 'No'));
// Set permission message.
$('#cmd-perm-messages').val((e.permComMsgEnabled === 'true' ? 'Yes' : 'No'));
// Set cooldown message.
$('#cmd-cooldown-messages').val((e.coolDownMsgEnabled === 'true' ? 'Yes' : 'No'));
// Set cost for mods.
$('#pricecom-mods').val((e.pricecomMods === 'true' ? 'No' : 'Yes'));
// Set cooldown for mods.
$('#cooldown-mods').val((e.modCooldown === 'true' ? 'No' : 'Yes'));
// Set global cooldown.
$('#global-cooldown').val(e.defaultCooldownTime);
});
});
// Function that handles events.
$(function() {
// Save button.
$('#cmd-save-btn').on('click', function() {
let cmdCostMessage = $('#cmd-cost-messages').find(':selected').text() === 'Yes',
cmdPermMessage = $('#cmd-perm-messages').find(':selected').text() === 'Yes',
cmdCooldownMessage = $('#cmd-cooldown-messages').find(':selected').text() === 'Yes',
priceComMods = $('#pricecom-mods').find(':selected').text() !== 'Yes',
cooldownMods = $('#cooldown-mods').find(':selected').text() !== 'Yes',
globalTime = $('#global-cooldown');
switch (false) {
case helpers.handleInputNumber(globalTime, 5):
break;
default:
socket.updateDBValues('update_cmd_settings', {
tables: ['settings', 'settings', 'settings', 'settings', 'cooldownSettings',
'cooldownSettings'],
keys: ['permComMsgEnabled', 'priceComMsgEnabled', 'coolDownMsgEnabled',
'pricecomMods', 'modCooldown', 'defaultCooldownTime'],
values: [cmdPermMessage, cmdCostMessage, cmdCooldownMessage,
priceComMods, cooldownMods, globalTime.val()]
}, function() {
socket.wsEvent('update_cmd_settings_ws', './core/commandCoolDown.js', null, ['update'], function() {
toastr.success('Successfully update command settings!');
});
});
}
});
});
|
Stargamers/PhantomBot
|
resources/web/panel/js/pages/settings/commandSettings.js
|
JavaScript
|
gpl-3.0
| 3,397
|
/*
File name: editbox.css
Author: paule
Description:
Example StyleSheet that controls the display of the editbox widget
*/
/* For the multi-line input boxes */
textarea {
}
/* This is for all html input boxes, use 'input.WidgetEditBox' for just
the single line editbox widgets
*/
input {
}
/* For HTML based checkboxes */
input.WidgetCheckBox {
}
/* Use this to highlight after the field */
span.editboxMandatorySuffix {
display: none;
}
span.editboxOptionalSuffix {
display: none;
}
/* Use this to highlight in front of the field */
span.editboxMandatoryPrefix {
display:none;
}
span.editboxOptionalPrefix {
display:none;
}
|
snavaneethan1/jaffa-framework
|
jaffa-core/source/html/jaffa/themes/default/css/widgets/editbox.css
|
CSS
|
gpl-3.0
| 666
|
#pragma warning disable 1587
using EloBuddy;
using LeagueSharp.SDK;
namespace ExorAIO.Champions.Lucian
{
using System;
using System.Linq;
using ExorAIO.Utilities;
using LeagueSharp;
using LeagueSharp.SDK;
using LeagueSharp.SDK.UI;
using LeagueSharp.SDK.Utils;
using SharpDX;
using Geometry = ExorAIO.Utilities.Geometry;
/// <summary>
/// The logics class.
/// </summary>
internal partial class Logics
{
#region Public Methods and Operators
/// <summary>
/// Called when the game updates itself.
/// </summary>
/// <param name="args">The <see cref="EventArgs" /> instance containing the event data.</param>
public static void Killsteal(EventArgs args)
{
/// <summary>
/// The Q Killsteal Logic.
/// </summary>
if (Vars.Q.IsReady())
{
/// <summary>
/// Normal Q KilLSteal Logic.
/// </summary>
if (Vars.Menu["spells"]["q"]["killsteal"].GetValue<MenuBool>().Value)
{
foreach (var target in
GameObjects.EnemyHeroes.Where(
t =>
!Invulnerable.Check(t) && t.IsValidTarget(Vars.Q.Range)
&& Vars.GetRealHealth(t) < (float)GameObjects.Player.GetSpellDamage(t, SpellSlot.Q)))
{
Vars.Q.CastOnUnit(target);
}
}
if (
!GameObjects.EnemyHeroes.Any(
t =>
!Invulnerable.Check(t) && !t.IsValidTarget(Vars.Q.Range) && t.IsValidTarget(Vars.Q2.Range - 50f)
&& Vars.GetRealHealth(t) < (float)GameObjects.Player.GetSpellDamage(t, SpellSlot.Q)))
{
return;
}
/// <summary>
/// Extended Q KilLSteal Logic.
/// </summary>
if (Vars.Menu["spells"]["q"]["extended"]["exkillsteal"].GetValue<MenuBool>().Value)
{
/// <summary>
/// Through enemy minions.
/// </summary>
foreach (var minion
in from minion in Targets.Minions.Where(m => m.IsValidTarget(Vars.Q.Range))
let polygon =
new Geometry.Rectangle(
GameObjects.Player.ServerPosition,
GameObjects.Player.ServerPosition.Extend(minion.ServerPosition, Vars.Q2.Range - 50f),
Vars.Q2.Width)
where
!polygon.IsOutside(
(Vector2)
Vars.Q2.GetPrediction(
GameObjects.EnemyHeroes.FirstOrDefault(
t =>
!Invulnerable.Check(t) && !t.IsValidTarget(Vars.Q.Range)
&& t.IsValidTarget(Vars.Q2.Range - 50f)
&& Vars.GetRealHealth(t)
< (float)GameObjects.Player.GetSpellDamage(t, SpellSlot.Q))).UnitPosition)
select minion)
{
Vars.Q.CastOnUnit(minion);
}
/// <summary>
/// Through enemy heroes.
/// </summary>
foreach (var target
in from target in GameObjects.EnemyHeroes.Where(t => t.IsValidTarget(Vars.Q.Range))
let polygon =
new Geometry.Rectangle(
GameObjects.Player.ServerPosition,
GameObjects.Player.ServerPosition.Extend(target.ServerPosition, Vars.Q2.Range - 50f),
Vars.Q2.Width)
where
!polygon.IsOutside(
(Vector2)
Vars.Q2.GetPrediction(
GameObjects.EnemyHeroes.FirstOrDefault(
t =>
!Invulnerable.Check(t) && !t.IsValidTarget(Vars.Q.Range)
&& t.IsValidTarget(Vars.Q2.Range - 50f)
&& Vars.GetRealHealth(t)
< (float)GameObjects.Player.GetSpellDamage(t, SpellSlot.Q))).UnitPosition)
select target)
{
Vars.Q.CastOnUnit(target);
}
}
}
/// <summary>
/// The KillSteal W Logic.
/// </summary>
if (Vars.W.IsReady() && Vars.Menu["spells"]["w"]["killsteal"].GetValue<MenuBool>().Value)
{
foreach (var target in
GameObjects.EnemyHeroes.Where(
t =>
!Invulnerable.Check(t) && t.IsValidTarget(Vars.W.Range) && !t.IsValidTarget(Vars.Q.Range)
&& Vars.GetRealHealth(t) < (float)GameObjects.Player.GetSpellDamage(t, SpellSlot.W)))
{
if (!Vars.W.GetPrediction(target).CollisionObjects.Any())
{
Vars.W.Cast(Vars.W.GetPrediction(target).UnitPosition);
}
}
}
}
#endregion
}
}
|
saophaisau/port
|
Core/SDK Ports/ExorAIO/AIO/Champions/Lucian/Properties/Modes/PvP/Killsteal.cs
|
C#
|
gpl-3.0
| 5,908
|
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Bruno Calogero <brunocalogero@hotmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = r'''
---
module: aci_access_port_to_interface_policy_leaf_profile
short_description: Manage Fabric interface policy leaf profile interface selectors (infra:HPortS, infra:RsAccBaseGrp, infra:PortBlk)
description:
- Manage Fabric interface policy leaf profile interface selectors on Cisco ACI fabrics.
notes:
- More information about the internal APIC classes B(infra:HPortS), B(infra:RsAccBaseGrp) and B(infra:PortBlk) from
L(the APIC Management Information Model reference,https://developer.cisco.com/docs/apic-mim-ref/)
author:
- Bruno Calogero (@brunocalogero)
version_added: '2.5'
options:
leaf_interface_profile:
description:
- The name of the Fabric access policy leaf interface profile.
required: yes
aliases: [ leaf_interface_profile_name ]
access_port_selector:
description:
- The name of the Fabric access policy leaf interface profile access port selector.
required: yes
aliases: [ name, access_port_selector_name ]
description:
description:
- The description to assign to the C(access_port_selector)
leaf_port_blk:
description:
- The name of the Fabric access policy leaf interface profile access port block.
required: yes
aliases: [ leaf_port_blk_name ]
leaf_port_blk_description:
description:
- The description to assign to the C(leaf_port_blk)
required: no
from:
description:
- The beggining (from range) of the port range block for the leaf access port block.
required: yes
aliases: [ fromPort, from_port_range ]
to:
description:
- The end (to range) of the port range block for the leaf access port block.
required: yes
aliases: [ toPort, to_port_range ]
policy_group:
description:
- The name of the fabric access policy group to be associated with the leaf interface profile interface selector.
aliases: [ policy_group_name ]
interface_type:
version_added: '2.6'
description:
- The type of interface for the static EPG deployement.
choices: [ fex, port_channel, switch_port, vpc ]
default: switch_port
state:
description:
- Use C(present) or C(absent) for adding or removing.
- Use C(query) for listing an object or multiple objects.
choices: [ absent, present, query ]
default: present
extends_documentation_fragment: aci
'''
EXAMPLES = r'''
- name: Associate an Interface Access Port Selector to an Interface Policy Leaf Profile with a Policy Group
aci_access_port_to_interface_policy_leaf_profile:
host: apic
username: admin
password: SomeSecretPassword
leaf_interface_profile: leafintprfname
access_port_selector: accessportselectorname
leaf_port_blk: leafportblkname
from: 13
to: 16
policy_group: policygroupname
state: present
- name: Associate an interface access port selector to an Interface Policy Leaf Profile (w/o policy group) (check if this works)
aci_access_port_to_interface_policy_leaf_profile:
host: apic
username: admin
password: SomeSecretPassword
leaf_interface_profile: leafintprfname
access_port_selector: accessportselectorname
leaf_port_blk: leafportblkname
from: 13
to: 16
state: present
- name: Remove an interface access port selector associated with an Interface Policy Leaf Profile
aci_access_port_to_interface_policy_leaf_profile:
host: apic
username: admin
password: SomeSecretPassword
leaf_interface_profile: leafintprfname
access_port_selector: accessportselectorname
state: absent
- name: Query Specific access_port_selector under given leaf_interface_profile
aci_access_port_to_interface_policy_leaf_profile:
host: apic
username: admin
password: SomeSecretPassword
leaf_interface_profile: leafintprfname
access_port_selector: accessportselectorname
state: query
'''
RETURN = r'''
current:
description: The existing configuration from the APIC after the module has finished
returned: success
type: list
sample:
[
{
"fvTenant": {
"attributes": {
"descr": "Production environment",
"dn": "uni/tn-production",
"name": "production",
"nameAlias": "",
"ownerKey": "",
"ownerTag": ""
}
}
}
]
error:
description: The error information as returned from the APIC
returned: failure
type: dict
sample:
{
"code": "122",
"text": "unknown managed object class foo"
}
raw:
description: The raw output returned by the APIC REST API (xml or json)
returned: parse error
type: string
sample: '<?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata>'
sent:
description: The actual/minimal configuration pushed to the APIC
returned: info
type: list
sample:
{
"fvTenant": {
"attributes": {
"descr": "Production environment"
}
}
}
previous:
description: The original configuration from the APIC before the module has started
returned: info
type: list
sample:
[
{
"fvTenant": {
"attributes": {
"descr": "Production",
"dn": "uni/tn-production",
"name": "production",
"nameAlias": "",
"ownerKey": "",
"ownerTag": ""
}
}
}
]
proposed:
description: The assembled configuration from the user-provided parameters
returned: info
type: dict
sample:
{
"fvTenant": {
"attributes": {
"descr": "Production environment",
"name": "production"
}
}
}
filter_string:
description: The filter string used for the request
returned: failure or debug
type: string
sample: ?rsp-prop-include=config-only
method:
description: The HTTP method used for the request to the APIC
returned: failure or debug
type: string
sample: POST
response:
description: The HTTP response from the APIC
returned: failure or debug
type: string
sample: OK (30 bytes)
status:
description: The HTTP status from the APIC
returned: failure or debug
type: int
sample: 200
url:
description: The HTTP url used for the request to the APIC
returned: failure or debug
type: string
sample: https://10.11.12.13/api/mo/uni/tn-production.json
'''
from ansible.module_utils.network.aci.aci import ACIModule, aci_argument_spec
from ansible.module_utils.basic import AnsibleModule
def main():
argument_spec = aci_argument_spec()
argument_spec.update({
'leaf_interface_profile': dict(type='str', aliases=['leaf_interface_profile_name']), # Not required for querying all objects
'access_port_selector': dict(type='str', aliases=['name', 'access_port_selector_name']), # Not required for querying all objects
'description': dict(typ='str'),
'leaf_port_blk': dict(type='str', aliases=['leaf_port_blk_name']),
'leaf_port_blk_description': dict(type='str'),
# NOTE: Keyword 'from' is a reserved word in python, so we need it as a string
'from': dict(type='str', aliases=['fromPort', 'from_port_range']),
'to': dict(type='str', aliases=['toPort', 'to_port_range']),
'policy_group': dict(type='str', aliases=['policy_group_name']),
'interface_type': dict(type='str', default='switch_port', choices=['fex', 'port_channel', 'switch_port', 'vpc']),
'state': dict(type='str', default='present', choices=['absent', 'present', 'query']),
})
module = AnsibleModule(
argument_spec=argument_spec,
supports_check_mode=True,
required_if=[
['state', 'absent', ['leaf_interface_profile', 'access_port_selector']],
['state', 'present', ['leaf_interface_profile', 'access_port_selector']],
],
)
leaf_interface_profile = module.params['leaf_interface_profile']
access_port_selector = module.params['access_port_selector']
description = module.params['description']
leaf_port_blk = module.params['leaf_port_blk']
leaf_port_blk_description = module.params['leaf_port_blk_description']
from_ = module.params['from']
to_ = module.params['to']
policy_group = module.params['policy_group']
interface_type = module.params['interface_type']
state = module.params['state']
aci = ACIModule(module)
aci.construct_url(
root_class=dict(
aci_class='infraAccPortP',
aci_rn='infra/accportprof-{0}'.format(leaf_interface_profile),
filter_target='eq(infraAccPortP.name, "{0}")'.format(leaf_interface_profile),
module_object=leaf_interface_profile
),
subclass_1=dict(
aci_class='infraHPortS',
# NOTE: normal rn: hports-{name}-typ-{type}, hence here hardcoded to range for purposes of module
aci_rn='hports-{0}-typ-range'.format(access_port_selector),
filter_target='eq(infraHPortS.name, "{0}")'.format(access_port_selector),
module_object=access_port_selector,
),
child_classes=['infraPortBlk', 'infraRsAccBaseGrp']
)
INTERFACE_TYPE_MAPPING = dict(
fex='uni/infra/funcprof/accportgrp-{0}'.format(policy_group),
port_channel='uni/infra/funcprof/accbundle-{0}'.format(policy_group),
switch_port='uni/infra/funcprof/accportgrp-{0}'.format(policy_group),
vpc='uni/infra/funcprof/accbundle-{0}'.format(policy_group),
)
aci.get_existing()
if state == 'present':
aci.payload(
aci_class='infraHPortS',
class_config=dict(
descr=description,
name=access_port_selector,
),
child_configs=[
dict(
infraPortBlk=dict(
attributes=dict(
descr=leaf_port_blk_description,
name=leaf_port_blk,
fromPort=from_,
toPort=to_,
),
),
),
dict(
infraRsAccBaseGrp=dict(
attributes=dict(
tDn=INTERFACE_TYPE_MAPPING[interface_type],
),
),
),
],
)
aci.get_diff(aci_class='infraHPortS')
aci.post_config()
elif state == 'absent':
aci.delete_config()
aci.exit_json()
if __name__ == "__main__":
main()
|
lmprice/ansible
|
lib/ansible/modules/network/aci/aci_access_port_to_interface_policy_leaf_profile.py
|
Python
|
gpl-3.0
| 11,226
|
import locale
import sys
from matplotlib import pylab as plt
from scipy.interpolate import interp1d
import numpy
def parse_pRDF(f):
pRDFs={}
count=0
for line in open(f).readlines():
words=line.split()
if words[0]=="dstep":
dstep=locale.atof(words[1])
continue
elif words[0]=="nstep":
nstep=locale.atof(words[1])
continue
else:
atom_type = words[0]
pRDF=[]
for word in words[1:]:
pRDF.append(locale.atof(word))
pRDFs[atom_type]=pRDF
return (pRDFs,dstep)
f=sys.argv[1]
(pRDFs, dstep)=parse_pRDF(f)
colors={"C":"k", "HC":"r", "N":"b", "HN":"g", "O":"m", "HO":"y", "S":"c"}
X = numpy.linspace(0, 10+dstep, int(10/dstep)+1)
scale=3
Xf = numpy.linspace(0, 10+dstep, (int(10/dstep)+1)*scale)
for atom_type, pRDF in pRDFs.iteritems():
Y=numpy.array(pRDF)
#f = interp1d(X,Y,kind='cubic')
plt.plot(X[:-1],Y[:-1],colors[atom_type], label=atom_type)
#plt.plot(Xf[:-scale],f(Xf)[:-scale],colors[atom_type], label=atom_type)
plt.hold(True)
plt.legend()
plt.xlabel("R (A)")
plt.ylabel("protons/A3")
plt.show()
|
madscatt/zazzie
|
src_2.7/sassie/calculate/old_sascalc/hypred_library/run_sassie/plot.py
|
Python
|
gpl-3.0
| 1,043
|
// Source file from duniter: Crypto-currency software to manage libre currency such as Ğ1
// Copyright (C) 2018 Cedric Moreau <cem.moreau@gmail.com>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
import {TestingServer} from "./toolbox"
const UNTIL_TIMEOUT = 115000;
export function until(server:TestingServer, eventName:string, count:number) {
let counted = 0;
const max = count == undefined ? 1 : count;
return new Promise(function (resolve, reject) {
let finished = false;
server._server.on(eventName, function () {
counted++;
if (counted == max) {
if (!finished) {
finished = true;
resolve();
}
}
});
setTimeout(function() {
if (!finished) {
finished = true;
reject('Received ' + counted + '/' + count + ' ' + eventName + ' after ' + UNTIL_TIMEOUT + ' ms');
}
}, UNTIL_TIMEOUT);
});
}
|
ucoin-io/ucoin
|
test/integration/tools/test-until.ts
|
TypeScript
|
gpl-3.0
| 1,374
|
Imports System.Runtime.InteropServices
Imports System.Security
Public Class IconInjector
<SuppressUnmanagedCodeSecurity()> _
Private Class NativeMethods
<DllImport("kernel32")> _
Public Shared Function BeginUpdateResource( _
ByVal fileName As String, _
<MarshalAs(UnmanagedType.Bool)> ByVal deleteExistingResources As Boolean) As IntPtr
End Function
<DllImport("kernel32")> _
Public Shared Function UpdateResource( _
ByVal hUpdate As IntPtr, _
ByVal type As IntPtr, _
ByVal name As IntPtr, _
ByVal language As Short, _
<MarshalAs(UnmanagedType.LPArray, SizeParamIndex:=5)> _
ByVal data() As Byte, _
ByVal dataSize As Integer) As <MarshalAs(UnmanagedType.Bool)> Boolean
End Function
<DllImport("kernel32")> _
Public Shared Function EndUpdateResource( _
ByVal hUpdate As IntPtr, _
<MarshalAs(UnmanagedType.Bool)> ByVal discard As Boolean) As <MarshalAs(UnmanagedType.Bool)> Boolean
End Function
End Class
<StructLayout(LayoutKind.Sequential)> _
Private Structure ICONDIR
Public Reserved As UShort
Public Type As UShort
Public Count As UShort
End Structure
<StructLayout(LayoutKind.Sequential)> _
Private Structure ICONDIRENTRY
Public Width As Byte
Public Height As Byte
Public ColorCount As Byte
Public Reserved As Byte
Public Planes As UShort
Public BitCount As UShort
Public BytesInRes As Integer
Public ImageOffset As Integer
End Structure
<StructLayout(LayoutKind.Sequential)> _
Private Structure BITMAPINFOHEADER
Public Size As UInteger
Public Width As Integer
Public Height As Integer
Public Planes As UShort
Public BitCount As UShort
Public Compression As UInteger
Public SizeImage As UInteger
Public XPelsPerMeter As Integer
Public YPelsPerMeter As Integer
Public ClrUsed As UInteger
Public ClrImportant As UInteger
End Structure
<StructLayout(LayoutKind.Sequential, Pack:=2)> _
Private Structure GRPICONDIRENTRY
Public Width As Byte
Public Height As Byte
Public ColorCount As Byte
Public Reserved As Byte
Public Planes As UShort
Public BitCount As UShort
Public BytesInRes As Integer
Public ID As UShort
End Structure
Public Shared Sub InjectIcon(ByVal exeFileName As String, ByVal iconFileName As String)
InjectIcon(exeFileName, iconFileName, 1, 1)
End Sub
Public Shared Sub InjectIcon(ByVal exeFileName As String, ByVal iconFileName As String, ByVal iconGroupID As UInteger, ByVal iconBaseID As UInteger)
Const RT_ICON = 3UI
Const RT_GROUP_ICON = 14UI
Dim iconFile As IconFile = iconFile.FromFile(iconFileName)
Dim hUpdate = NativeMethods.BeginUpdateResource(exeFileName, False)
Dim data = iconFile.CreateIconGroupData(iconBaseID)
NativeMethods.UpdateResource(hUpdate, New IntPtr(RT_GROUP_ICON), New IntPtr(iconGroupID), 0, data, data.Length)
For i = 0 To iconFile.ImageCount - 1
Dim image = iconFile.ImageData(i)
NativeMethods.UpdateResource(hUpdate, New IntPtr(RT_ICON), New IntPtr(iconBaseID + i), 0, image, image.Length)
Next
NativeMethods.EndUpdateResource(hUpdate, False)
End Sub
Private Class IconFile
Private iconDir As New ICONDIR
Private iconEntry() As ICONDIRENTRY
Private iconImage()() As Byte
Public ReadOnly Property ImageCount As Integer
Get
Return iconDir.Count
End Get
End Property
Public ReadOnly Property ImageData(ByVal index As Integer) As Byte()
Get
Return iconImage(index)
End Get
End Property
Private Sub New()
End Sub
Public Shared Function FromFile(ByVal filename As String) As IconFile
Dim instance As New IconFile
Dim fileBytes() As Byte = IO.File.ReadAllBytes(filename)
Dim pinnedBytes = GCHandle.Alloc(fileBytes, GCHandleType.Pinned)
instance.iconDir = DirectCast(Marshal.PtrToStructure(pinnedBytes.AddrOfPinnedObject, GetType(ICONDIR)), ICONDIR)
instance.iconEntry = New ICONDIRENTRY(instance.iconDir.Count - 1) {}
instance.iconImage = New Byte(instance.iconDir.Count - 1)() {}
Dim offset = Marshal.SizeOf(instance.iconDir)
Dim iconDirEntryType = GetType(ICONDIRENTRY)
Dim size = Marshal.SizeOf(iconDirEntryType)
For i = 0 To instance.iconDir.Count - 1
Dim entry = DirectCast(Marshal.PtrToStructure(New IntPtr(pinnedBytes.AddrOfPinnedObject.ToInt64 + offset), iconDirEntryType), ICONDIRENTRY)
instance.iconEntry(i) = entry
instance.iconImage(i) = New Byte(entry.BytesInRes - 1) {}
Buffer.BlockCopy(fileBytes, entry.ImageOffset, instance.iconImage(i), 0, entry.BytesInRes)
offset += size
Next
pinnedBytes.Free()
Return instance
End Function
Public Function CreateIconGroupData(ByVal iconBaseID As UInteger) As Byte()
Dim sizeOfIconGroupData As Integer = Marshal.SizeOf(GetType(ICONDIR)) + Marshal.SizeOf(GetType(GRPICONDIRENTRY)) * ImageCount
Dim data(sizeOfIconGroupData - 1) As Byte
Dim pinnedData = GCHandle.Alloc(data, GCHandleType.Pinned)
Marshal.StructureToPtr(iconDir, pinnedData.AddrOfPinnedObject, False)
Dim offset = Marshal.SizeOf(iconDir)
For i = 0 To ImageCount - 1
Dim grpEntry As New GRPICONDIRENTRY
Dim bitmapheader As New BITMAPINFOHEADER
Dim pinnedBitmapInfoHeader = GCHandle.Alloc(bitmapheader, GCHandleType.Pinned)
Marshal.Copy(ImageData(i), 0, pinnedBitmapInfoHeader.AddrOfPinnedObject, Marshal.SizeOf(GetType(BITMAPINFOHEADER)))
pinnedBitmapInfoHeader.Free()
grpEntry.Width = iconEntry(i).Width
grpEntry.Height = iconEntry(i).Height
grpEntry.ColorCount = iconEntry(i).ColorCount
grpEntry.Reserved = iconEntry(i).Reserved
grpEntry.Planes = bitmapheader.Planes
grpEntry.BitCount = bitmapheader.BitCount
grpEntry.BytesInRes = iconEntry(i).BytesInRes
grpEntry.ID = CType(iconBaseID + i, UShort)
Marshal.StructureToPtr(grpEntry, New IntPtr(pinnedData.AddrOfPinnedObject.ToInt64 + offset), False)
offset += Marshal.SizeOf(GetType(GRPICONDIRENTRY))
Next
pinnedData.Free()
Return data
End Function
End Class
End Class
|
hackersql/sq1map
|
Web/RAT-collection/BlackNessRAT/v1.0l/Client/Evil1.0a/icon.vb
|
Visual Basic
|
gpl-3.0
| 7,008
|
/* $Id: ncbi_math.h 351792 2012-02-01 16:20:19Z ucko $
* ===========================================================================
*
* PUBLIC DOMAIN NOTICE
* National Center for Biotechnology Information
*
* This software/database is a "United States Government Work" under the
* terms of the United States Copyright Act. It was written as part of
* the author's official duties as a United States Government employee and
* thus cannot be copyrighted. This software/database is freely available
* to the public for use. The National Library of Medicine and the U.S.
* Government have not placed any restriction on its use or reproduction.
*
* Although all reasonable efforts have been taken to ensure the accuracy
* and reliability of the software and data, the NLM and the U.S.
* Government do not and cannot warrant the performance or results that
* may be obtained by using this software or data. The NLM and the U.S.
* Government disclaim all warranties, express or implied, including
* warranties of performance, merchantability or fitness for any particular
* purpose.
*
* Please cite the author in any work or product based on this material.
*
* ===========================================================================
*
* Authors: Gish, Kans, Ostell, Schuler
*
* Version Creation Date: 10/23/91
*
* ==========================================================================
*/
/** @file ncbi_math.h
* Prototypes for portable math library (ported from C Toolkit)
*/
#ifndef ALGO_BLAST_CORE__NCBIMATH
#define ALGO_BLAST_CORE__NCBIMATH
/** Natural logarithm with shifted input
* @param x input operand (x > -1)
* @return log(x+1)
*/
double BLAST_Log1p (double x);
/** Exponentional with base e
* @param x input operand
* @return exp(x) - 1
*/
double BLAST_Expm1 (double x);
/** Factorial function
* @param n input operand
* @return (double)(1 * 2 * 3 * ... * n)
*/
double BLAST_Factorial(int32_t n);
/** Logarithm of the factorial
* @param x input operand
* @return log(1 * 2 * 3 * ... * x)
*/
double BLAST_LnFactorial (double x);
/** log(gamma(n)), integral n
* @param n input operand
* @return log(1 * 2 * 3 * ... (n-1))
*/
double BLAST_LnGammaInt (int32_t n);
/** Romberg numerical integrator
* @param f Pointer to the function to integrate; the first argument
* is the variable to integrate over, the second is a pointer
* to a list of additional arguments that f may need
* @param fargs Pointer to an array of extra arguments or parameters
* needed to compute the function to be integrated. None
* of the items in this list may vary over the region
* of integration
* @param p Left-hand endpoint of the integration interval
* @param q Right-hand endpoint of the integration interval
* (q is assumed > p)
* @param eps The relative error tolerance that indicates convergence
* @param epsit The number of consecutive diagonal entries in the
* Romberg array whose relative difference must be less than
* eps before convergence is assumed. This is presently
* limited to 1, 2, or 3
* @param itmin The minimum number of diagnonal Romberg entries that
* will be computed
* @return The computed integral of f() between p and q
*/
double BLAST_RombergIntegrate (double (*f) (double, void*),
void* fargs, double p, double q,
double eps, int32_t epsit, int32_t itmin);
/** Greatest common divisor
* @param a First operand (any integer)
* @param b Second operand (any integer)
* @return The largest integer that evenly divides a and b
*/
int32_t BLAST_Gcd (int32_t a, int32_t b);
/** Divide 3 numbers by their greatest common divisor
* @param a First integer [in] [out]
* @param b Second integer [in] [out]
* @param c Third integer [in] [out]
* @return The greatest common divisor
*/
int32_t BLAST_Gdb3(int32_t* a, int32_t* b, int32_t* c);
/** Nearest integer
* @param x Input to round (rounded value must be representable
* as a 32-bit signed integer)
* @return floor(x + 0.5);
*/
long BLAST_Nint (double x);
/** Integral power of x
* @param x floating-point base of the exponential
* @param n (integer) exponent
* @return x multiplied by itself n times
*/
double BLAST_Powi (double x, int32_t n);
/** The error function of x: the integral from 0 to x of e(-t*t) dt,
* scaled by 2/sqrt(pi) to fall within the range (-1,1). */
double BLAST_Erf (double x);
/** The complementary error function of x: 1 - erf(x), but calculated
* more accurately for large x (where erf(x) approaches unity). */
double BLAST_ErfC (double x);
/** Number of derivatives of log(x) to carry in gamma-related
computations */
#define LOGDERIV_ORDER_MAX 4
/** Number of derivatives of polygamma(x) to carry in gamma-related
computations for non-integral values of x */
#define POLYGAMMA_ORDER_MAX LOGDERIV_ORDER_MAX
/** value of pi is only used in gamma-related computations */
#define NCBIMATH_PI 3.1415926535897932384626433832795
/** Natural log(2) */
#define NCBIMATH_LN2 0.69314718055994530941723212145818
/** Natural log(PI) */
#define NCBIMATH_LNPI 1.1447298858494001741434273513531
#endif /* !ALGO_BLAST_CORE__NCBIMATH */
|
bbuchfink/diamond
|
src/lib/blast/ncbi_math.h
|
C
|
gpl-3.0
| 5,424
|
#region Copyright & License Information
/*
* Copyright 2007-2015 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using OpenRA.Activities;
using OpenRA.Mods.Common.Activities;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
public class AttackPlaneInfo : AttackFrontalInfo, Requires<AircraftInfo>
{
[Desc("Delay, in game ticks, before turning to attack.")]
public readonly int AttackTurnDelay = 50;
public override object Create(ActorInitializer init) { return new AttackPlane(init.Self, this); }
}
public class AttackPlane : AttackFrontal
{
public readonly AttackPlaneInfo AttackPlaneInfo;
readonly AircraftInfo aircraftInfo;
public AttackPlane(Actor self, AttackPlaneInfo info)
: base(self, info)
{
AttackPlaneInfo = info;
aircraftInfo = self.Info.TraitInfo<AircraftInfo>();
}
public override Activity GetAttackActivity(Actor self, Target newTarget, bool allowMove, bool forceAttack)
{
return new FlyAttack(self, newTarget);
}
protected override bool CanAttack(Actor self, Target target)
{
// Don't fire while landed or when outside the map.
return base.CanAttack(self, target)
&& self.World.Map.DistanceAboveTerrain(self.CenterPosition).Length >= aircraftInfo.MinAirborneAltitude
&& self.World.Map.Contains(self.Location);
}
}
}
|
SkzKatsushiro/OpenRA
|
OpenRA.Mods.Common/Traits/Air/AttackPlane.cs
|
C#
|
gpl-3.0
| 1,537
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>Cinder</title>
<link rel="stylesheet" href="cinder_doxygen.css" type="text/css" media="screen" />
</head>
<body>
<div class="wrapper">
<div id="header">
<h1><a href="http://libcinder.org">Cinder</a></h1>
</div>
<!-- Generated by Doxygen 1.8.7 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li class="current"><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<div id="navrow3" class="tabs2">
<ul class="tablist">
<li><a href="functions.html"><span>All</span></a></li>
<li><a href="functions_func.html"><span>Functions</span></a></li>
<li><a href="functions_vars.html"><span>Variables</span></a></li>
<li class="current"><a href="functions_type.html"><span>Typedefs</span></a></li>
<li><a href="functions_enum.html"><span>Enumerations</span></a></li>
<li><a href="functions_eval.html"><span>Enumerator</span></a></li>
<li><a href="functions_prop.html"><span>Properties</span></a></li>
<li><a href="functions_rela.html"><span>Related Functions</span></a></li>
</ul>
</div>
<div id="navrow4" class="tabs3">
<ul class="tablist">
<li><a href="functions_type.html#index_b"><span>b</span></a></li>
<li><a href="functions_type_c.html#index_c"><span>c</span></a></li>
<li class="current"><a href="functions_type_d.html#index_d"><span>d</span></a></li>
<li><a href="functions_type_e.html#index_e"><span>e</span></a></li>
<li><a href="functions_type_f.html#index_f"><span>f</span></a></li>
<li><a href="functions_type_g.html#index_g"><span>g</span></a></li>
<li><a href="functions_type_h.html#index_h"><span>h</span></a></li>
<li><a href="functions_type_i.html#index_i"><span>i</span></a></li>
<li><a href="functions_type_l.html#index_l"><span>l</span></a></li>
<li><a href="functions_type_m.html#index_m"><span>m</span></a></li>
<li><a href="functions_type_n.html#index_n"><span>n</span></a></li>
<li><a href="functions_type_o.html#index_o"><span>o</span></a></li>
<li><a href="functions_type_p.html#index_p"><span>p</span></a></li>
<li><a href="functions_type_r.html#index_r"><span>r</span></a></li>
<li><a href="functions_type_s.html#index_s"><span>s</span></a></li>
<li><a href="functions_type_t.html#index_t"><span>t</span></a></li>
<li><a href="functions_type_u.html#index_u"><span>u</span></a></li>
<li><a href="functions_type_v.html#index_v"><span>v</span></a></li>
<li><a href="functions_type_w.html#index_w"><span>w</span></a></li>
<li><a href="functions_type_y.html#index_y"><span>y</span></a></li>
</ul>
</div>
</div><!-- top -->
<div class="contents">
 
<h3><a class="anchor" id="index_d"></a>- d -</h3><ul>
<li>diag_type
: <a class="el" href="classcv_1_1_matx.html#a1803d38f2467b19c6811749f7d5bbdcc">cv::Matx< _Tp, m, n ></a>
</li>
<li>difference_type
: <a class="el" href="classcv_1_1_allocator.html#a2b21e4c026b5a64f53b1eea298b89735">cv::Allocator< _Tp ></a>
, <a class="el" href="classcv_1_1_mat_const_iterator.html#ae11eaf393d7a95387aa2f5298a296fb6">cv::MatConstIterator</a>
, <a class="el" href="classcv_1_1_mat_const_iterator__.html#afd6e21498919734f64f2957e87485a7e">cv::MatConstIterator_< _Tp ></a>
, <a class="el" href="classtesting_1_1internal_1_1_param_iterator.html#a6c37240a04ba3fc4c56f6c413cf4771d">testing::internal::ParamIterator< T ></a>
</li>
<li>DistanceType
: <a class="el" href="classcv_1_1flann_1_1_generic_index.html#a4b7623b6f2ebc7c1dc406460cd0cee02">cv::flann::GenericIndex< Distance ></a>
, <a class="el" href="classcv_1_1flann_1_1_index__.html#ab8aa6239032c0f4821d6fe0fc29159d7">cv::flann::Index_< T ></a>
, <a class="el" href="classcvflann_1_1_autotuned_index.html#af9e75c21685cbb82c25e5c3a254a9b5e">cvflann::AutotunedIndex< Distance ></a>
, <a class="el" href="classcvflann_1_1_composite_index.html#a9970db892c04fb4dcb0b8a1c2e80a165">cvflann::CompositeIndex< Distance ></a>
, <a class="el" href="classcvflann_1_1_hierarchical_clustering_index.html#af8e155c4fe99eaf41a492fddfcb87fcf">cvflann::HierarchicalClusteringIndex< Distance ></a>
, <a class="el" href="classcvflann_1_1_index.html#adce66132d9ad41de0181fddd214b5e51">cvflann::Index< Distance ></a>
, <a class="el" href="classcvflann_1_1_k_d_tree_index.html#a10ed3a3afa91fed415ab7c2d1b7c4014">cvflann::KDTreeIndex< Distance ></a>
, <a class="el" href="classcvflann_1_1_k_d_tree_single_index.html#ab32f2e8496ef780c2538576b8a330029">cvflann::KDTreeSingleIndex< Distance ></a>
, <a class="el" href="classcvflann_1_1_k_means_index.html#adcf3e940c1ab76474f113c4db65d36c5">cvflann::KMeansIndex< Distance ></a>
, <a class="el" href="classcvflann_1_1_linear_index.html#a2856b8b90987bac8737fdb08b5ad693f">cvflann::LinearIndex< Distance ></a>
, <a class="el" href="classcvflann_1_1_lsh_index.html#aed0c5e217eff759f37ef2b91a9ddaae6">cvflann::LshIndex< Distance ></a>
</li>
<li>DistIndex
: <a class="el" href="classcvflann_1_1_k_n_n_unique_result_set.html#aace6ad174a9fa6ac070ab7217612bf64">cvflann::KNNUniqueResultSet< DistanceType ></a>
</li>
</ul>
</div><!-- contents -->
<div class="footer">
<p> </p>
</div>
</div>
</body>
</html>
|
brittybaby/3DModelfitting
|
dependencies/include/cinder/blocks/OpenCV/docs/html/functions_type_d.html
|
HTML
|
gpl-3.0
| 6,043
|
// Metashell - Interactive C++ template metaprogramming shell
// Copyright (C) 2018, Abel Sinkovics (abel@sinkovics.hu)
//
// 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 <metashell/mdb/caching_disabled.hpp>
namespace metashell
{
namespace mdb
{
caching_disabled::caching_disabled(const std::string& operation_)
: exception("Caching is disabled in the debugger and " + operation_ +
" requires caching.")
{
}
} // namespace mdb
} // namespace metashell
|
sabel83/metashell
|
lib/mdb/src/caching_disabled.cpp
|
C++
|
gpl-3.0
| 1,103
|
/**
*
*/
package com.uaq.vo;
/**
* @author TACME
*
*/
public class PaymentHistoryVO {
private String purchaseId;
private String purchaseStatus;
private String paymentInProgress;
private String serviceId;
private String departmentId;
private String feeId;
private String customerId;
private String customerName;
private String transactionID;
private String action;
private String status;
private String statusMessage;
private String retrievalRefNumber;
private String eDirhamFees;
private String collectionCenterFees;
private String amount;
private String transcationAmount;
private String transcationDate;
private String confirmationId;
private String other;
private String ownerFees;
private String amountWithoutFees;
private String amountWithFees;
private String orginalTransactionID;
/**
* @return the purchaseId
*/
public String getPurchaseId() {
return purchaseId;
}
/**
* @param purchaseId the purchaseId to set
*/
public void setPurchaseId(String purchaseId) {
this.purchaseId = purchaseId;
}
/**
* @return the purchaseStatus
*/
public String getPurchaseStatus() {
return purchaseStatus;
}
/**
* @param purchaseStatus the purchaseStatus to set
*/
public void setPurchaseStatus(String purchaseStatus) {
this.purchaseStatus = purchaseStatus;
}
/**
* @return the paymentInProgress
*/
public String getPaymentInProgress() {
return paymentInProgress;
}
/**
* @param paymentInProgress the paymentInProgress to set
*/
public void setPaymentInProgress(String paymentInProgress) {
this.paymentInProgress = paymentInProgress;
}
/**
* @return the serviceId
*/
public String getServiceId() {
return serviceId;
}
/**
* @param serviceId the serviceId to set
*/
public void setServiceId(String serviceId) {
this.serviceId = serviceId;
}
/**
* @return the departmentId
*/
public String getDepartmentId() {
return departmentId;
}
/**
* @param departmentId the departmentId to set
*/
public void setDepartmentId(String departmentId) {
this.departmentId = departmentId;
}
/**
* @return the feeId
*/
public String getFeeId() {
return feeId;
}
/**
* @param feeId the feeId to set
*/
public void setFeeId(String feeId) {
this.feeId = feeId;
}
/**
* @return the customerId
*/
public String getCustomerId() {
return customerId;
}
/**
* @param customerId the customerId to set
*/
public void setCustomerId(String customerId) {
this.customerId = customerId;
}
/**
* @return the customerName
*/
public String getCustomerName() {
return customerName;
}
/**
* @param customerName the customerName to set
*/
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
/**
* @return the transactionID
*/
public String getTransactionID() {
return transactionID;
}
/**
* @param transactionID the transactionID to set
*/
public void setTransactionID(String transactionID) {
this.transactionID = transactionID;
}
/**
* @return the action
*/
public String getAction() {
return action;
}
/**
* @param action the action to set
*/
public void setAction(String action) {
this.action = action;
}
/**
* @return the status
*/
public String getStatus() {
return status;
}
/**
* @param status the status to set
*/
public void setStatus(String status) {
this.status = status;
}
/**
* @return the statusMessage
*/
public String getStatusMessage() {
return statusMessage;
}
/**
* @param statusMessage the statusMessage to set
*/
public void setStatusMessage(String statusMessage) {
this.statusMessage = statusMessage;
}
/**
* @return the retrievalRefNumber
*/
public String getRetrievalRefNumber() {
return retrievalRefNumber;
}
/**
* @param retrievalRefNumber the retrievalRefNumber to set
*/
public void setRetrievalRefNumber(String retrievalRefNumber) {
this.retrievalRefNumber = retrievalRefNumber;
}
/**
* @return the eDirhamFees
*/
public String geteDirhamFees() {
return eDirhamFees;
}
/**
* @param eDirhamFees the eDirhamFees to set
*/
public void seteDirhamFees(String eDirhamFees) {
this.eDirhamFees = eDirhamFees;
}
/**
* @return the collectionCenterFees
*/
public String getCollectionCenterFees() {
return collectionCenterFees;
}
/**
* @param collectionCenterFees the collectionCenterFees to set
*/
public void setCollectionCenterFees(String collectionCenterFees) {
this.collectionCenterFees = collectionCenterFees;
}
/**
* @return the amount
*/
public String getAmount() {
return amount;
}
/**
* @param amount the amount to set
*/
public void setAmount(String amount) {
this.amount = amount;
}
/**
* @return the transcationAmount
*/
public String getTranscationAmount() {
return transcationAmount;
}
/**
* @param transcationAmount the transcationAmount to set
*/
public void setTranscationAmount(String transcationAmount) {
this.transcationAmount = transcationAmount;
}
/**
* @return the transcationDate
*/
public String getTranscationDate() {
return transcationDate;
}
/**
* @param transcationDate the transcationDate to set
*/
public void setTranscationDate(String transcationDate) {
this.transcationDate = transcationDate;
}
/**
* @return the confirmationId
*/
public String getConfirmationId() {
return confirmationId;
}
/**
* @param confirmationId the confirmationId to set
*/
public void setConfirmationId(String confirmationId) {
this.confirmationId = confirmationId;
}
/**
* @return the other
*/
public String getOther() {
return other;
}
/**
* @param other the other to set
*/
public void setOther(String other) {
this.other = other;
}
/**
* @return the ownerFees
*/
public String getOwnerFees() {
return ownerFees;
}
/**
* @param ownerFees the ownerFees to set
*/
public void setOwnerFees(String ownerFees) {
this.ownerFees = ownerFees;
}
/**
* @return the amountWithoutFees
*/
public String getAmountWithoutFees() {
return amountWithoutFees;
}
/**
* @param amountWithoutFees the amountWithoutFees to set
*/
public void setAmountWithoutFees(String amountWithoutFees) {
this.amountWithoutFees = amountWithoutFees;
}
/**
* @return the amountWithFees
*/
public String getAmountWithFees() {
return amountWithFees;
}
/**
* @param amountWithFees the amountWithFees to set
*/
public void setAmountWithFees(String amountWithFees) {
this.amountWithFees = amountWithFees;
}
/**
* @return the orginalTransactionID
*/
public String getOrginalTransactionID() {
return orginalTransactionID;
}
/**
* @param orginalTransactionID the orginalTransactionID to set
*/
public void setOrginalTransactionID(String orginalTransactionID) {
this.orginalTransactionID = orginalTransactionID;
}
}
|
pritam176/UAQ
|
UaqDeptSites/src/com/uaq/vo/PaymentHistoryVO.java
|
Java
|
gpl-3.0
| 6,848
|
module.exports = {
// eslint-disable-next-line global-require
...require('@spotify/prettier-config'),
// your overrides here
printWidth: 100,
};
|
sectsect/google-spreadsheet-to-db
|
prettier.config.js
|
JavaScript
|
gpl-3.0
| 153
|
<?php // content="text/plain; charset=utf-8"
require_once ('jpgraph/jpgraph.php');
require_once ('jpgraph/jpgraph_line.php');
$datay = array(20,10,35,5,17,35,22);
// Setup the graph
$graph = new Graph(400,200);
$graph->SetMargin(40,40,20,30);
$graph->SetScale("intlin");
$graph->SetBox();
$graph->SetMarginColor('darkgreen@0.8');
// Setup a background gradient image
$graph->SetBackgroundGradient('darkred','yellow',GRAD_HOR,BGRAD_PLOT);
$graph->title->Set('Gradient filled line plot ex3');
$graph->yscale->SetAutoMin(0);
// Create the line
$p1 = new LinePlot($datay);
$p1->SetFillGradient('white','darkgreen',4);
$graph->Add($p1);
// Output line
$graph->Stroke();
?>
|
boabo/pxp
|
lib/jpgraph/src/Examples/gradlinefillex3.php
|
PHP
|
gpl-3.0
| 708
|
namespace Packager.Validators.Attributes
{
public class ValidateUriAttribute:PropertyValidationAttribute
{
}
}
|
BrianMcGough/IUMediaHelperApps
|
Packager/Validators/Attributes/ValidateUriAttribute.cs
|
C#
|
gpl-3.0
| 126
|
/*
========================================================================
D O O M R e t r o
The classic, refined DOOM source port. For Windows PC.
========================================================================
Copyright © 1993-2012 id Software LLC, a ZeniMax Media company.
Copyright © 2013-2018 Brad Harding.
DOOM Retro is a fork of Chocolate DOOM. For a list of credits, see
<https://github.com/bradharding/doomretro/wiki/CREDITS>.
This file is part of DOOM Retro.
DOOM Retro 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.
DOOM Retro 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 DOOM Retro. If not, see <https://www.gnu.org/licenses/>.
DOOM is a registered trademark of id Software LLC, a ZeniMax Media
company, in the US and/or other countries and is used without
permission. All other trademarks are the property of their respective
holders. DOOM Retro is in no way affiliated with nor endorsed by
id Software.
========================================================================
*/
#include "c_console.h"
#include "doomstat.h"
#include "g_game.h"
#include "i_swap.h"
#include "m_misc.h"
#include "m_random.h"
#include "p_setup.h"
#include "s_sound.h"
#include "v_data.h"
#include "v_video.h"
#include "w_wad.h"
#include "wi_stuff.h"
#include "z_zone.h"
//
// Data needed to add patches to full screen intermission pics.
// Patches are statistics messages, and animations.
// Loads of by-pixel layout and placement, offsets etc.
//
//
// Difference between registered DOOM (1994) and
// Ultimate DOOM - Final edition (retail, 1995?).
// This is supposedly ignored for commercial
// release (aka DOOM II), which had 34 maps
// in one episode. So there.
#define NUMEPISODES 4
#define NUMMAPS 9
// GLOBAL LOCATIONS
#define WI_TITLEY 2
// SINGLE-PLAYER STUFF
#define SP_STATSX 50
#define SP_STATSY 50
#define SP_TIMEX 16
#define SP_TIMEY (ORIGINALHEIGHT - 32)
typedef enum
{
ANIM_ALWAYS,
ANIM_LEVEL
} animenum_t;
typedef struct
{
int x, y;
} point_t;
//
// Animation.
// There is another anim_t used in p_spec.
//
typedef struct
{
animenum_t type;
// period in tics between animations
int period;
// number of animation frames
int nanims;
// location of animation
point_t loc;
// ALWAYS: n/a,
// LEVEL: level
int data1;
// actual graphics for frames of animations
patch_t *p[3];
// following must be initialized to zero before use!
// next value of bcnt (used in conjunction with period)
int nexttic;
// next frame number to animate
int ctr;
} anim_t;
static point_t lnodes[NUMEPISODES][NUMMAPS] =
{
// Episode 0 World Map
{
{ 185, 164 }, // location of level 0 (CJ)
{ 148, 143 }, // location of level 1 (CJ)
{ 69, 122 }, // location of level 2 (CJ)
{ 209, 102 }, // location of level 3 (CJ)
{ 116, 89 }, // location of level 4 (CJ)
{ 166, 55 }, // location of level 5 (CJ)
{ 71, 56 }, // location of level 6 (CJ)
{ 135, 29 }, // location of level 7 (CJ)
{ 71, 24 } // location of level 8 (CJ)
},
// Episode 1 World Map should go here
{
{ 254, 25 }, // location of level 0 (CJ)
{ 97, 50 }, // location of level 1 (CJ)
{ 188, 64 }, // location of level 2 (CJ)
{ 128, 78 }, // location of level 3 (CJ)
{ 214, 92 }, // location of level 4 (CJ)
{ 133, 130 }, // location of level 5 (CJ)
{ 208, 136 }, // location of level 6 (CJ)
{ 148, 140 }, // location of level 7 (CJ)
{ 235, 158 } // location of level 8 (CJ)
},
// Episode 2 World Map should go here
{
{ 156, 168 }, // location of level 0 (CJ)
{ 48, 154 }, // location of level 1 (CJ)
{ 174, 95 }, // location of level 2 (CJ)
{ 265, 75 }, // location of level 3 (CJ)
{ 130, 48 }, // location of level 4 (CJ)
{ 279, 23 }, // location of level 5 (CJ)
{ 198, 48 }, // location of level 6 (CJ)
{ 140, 25 }, // location of level 7 (CJ)
{ 281, 136 } // location of level 8 (CJ)
}
};
//
// Animation locations for episode 0 (1).
// Using patches saves a lot of space,
// as they replace 320x200 full screen frames.
//
#define ANIM(type, period, nanims, x, y, nexttic) { (type), (period), (nanims), { (x), (y) }, (nexttic) }
static anim_t epsd0animinfo[] =
{
ANIM(ANIM_ALWAYS, TICRATE / 3, 3, 224, 104, 0),
ANIM(ANIM_ALWAYS, TICRATE / 3, 3, 184, 160, 0),
ANIM(ANIM_ALWAYS, TICRATE / 3, 3, 112, 136, 0),
ANIM(ANIM_ALWAYS, TICRATE / 3, 3, 72, 112, 0),
ANIM(ANIM_ALWAYS, TICRATE / 3, 3, 88, 96, 0),
ANIM(ANIM_ALWAYS, TICRATE / 3, 3, 64, 48, 0),
ANIM(ANIM_ALWAYS, TICRATE / 3, 3, 192, 40, 0),
ANIM(ANIM_ALWAYS, TICRATE / 3, 3, 136, 16, 0),
ANIM(ANIM_ALWAYS, TICRATE / 3, 3, 80, 16, 0),
ANIM(ANIM_ALWAYS, TICRATE / 3, 3, 64, 24, 0)
};
static anim_t epsd1animinfo[] =
{
ANIM(ANIM_LEVEL, TICRATE / 3, 1, 128, 136, 1),
ANIM(ANIM_LEVEL, TICRATE / 3, 1, 128, 136, 2),
ANIM(ANIM_LEVEL, TICRATE / 3, 1, 128, 136, 3),
ANIM(ANIM_LEVEL, TICRATE / 3, 1, 128, 136, 4),
ANIM(ANIM_LEVEL, TICRATE / 3, 1, 128, 136, 5),
ANIM(ANIM_LEVEL, TICRATE / 3, 1, 128, 136, 6),
ANIM(ANIM_LEVEL, TICRATE / 3, 1, 128, 136, 7),
ANIM(ANIM_LEVEL, TICRATE / 3, 3, 192, 144, 8),
ANIM(ANIM_LEVEL, TICRATE / 3, 1, 128, 136, 8)
};
static anim_t epsd2animinfo[] =
{
ANIM(ANIM_ALWAYS, TICRATE / 3, 3, 104, 168, 0),
ANIM(ANIM_ALWAYS, TICRATE / 3, 3, 40, 136, 0),
ANIM(ANIM_ALWAYS, TICRATE / 3, 3, 160, 96, 0),
ANIM(ANIM_ALWAYS, TICRATE / 3, 3, 104, 80, 0),
ANIM(ANIM_ALWAYS, TICRATE / 3, 3, 120, 32, 0),
ANIM(ANIM_ALWAYS, TICRATE / 4, 3, 40, 0, 0)
};
static int NUMANIMS[NUMEPISODES] =
{
arrlen(epsd0animinfo),
arrlen(epsd1animinfo),
arrlen(epsd2animinfo)
};
static anim_t *anims[NUMEPISODES] =
{
epsd0animinfo,
epsd1animinfo,
epsd2animinfo
};
//
// GENERAL DATA
//
//
// Locally used stuff.
//
// in seconds
#define SHOWNEXTLOCDELAY 4
// used to accelerate or skip a stage
int acceleratestage;
// specifies current state
static stateenum_t state;
// contains information passed into intermission
static wbstartstruct_t *wbs;
// used for general timing
static int cnt;
// used for timing of background animation
static int bcnt;
static int cnt_kills;
static int cnt_items;
static int cnt_secret;
static int cnt_time;
static int cnt_par;
static int cnt_pause;
// # of commercial levels
static int NUMCMAPS;
//
// GRAPHICS
//
// You Are Here graphic
static patch_t *yah[3];
// splat
static patch_t *splat[2];
// %, : graphics
static patch_t *percent;
static patch_t *colon;
// 0-9 graphic
static patch_t *num[10];
// minus sign
static patch_t *wiminus;
// "Finished!" graphics
static patch_t *finished;
// "Entering" graphic
static patch_t *entering;
// "secret"
static patch_t *sp_secret;
// "Kills", "Scrt", "Items"
static patch_t *kills;
static patch_t *items;
// Time sucks.
static patch_t *timepatch;
static patch_t *par;
static patch_t *sucks;
// Name graphics of each level (centered)
static patch_t **lnames;
//
// CODE
//
// slam background
static void WI_slamBackground(void)
{
memcpy(screens[0], screens[1], SCREENWIDTH * SCREENHEIGHT);
}
// [BH] Draws character of "<Levelname>"
static void WI_drawWILVchar(int x, int y, int i)
{
int w = (int)strlen(wilv[i]) / 13;
for (int y1 = 0; y1 < 13; y1++)
for (int x1 = 0; x1 < w; x1++)
V_DrawPixel(x + x1, y + y1, (int)wilv[i][y1 * w + x1], true);
}
static char *mapname;
static char *nextmapname;
static const int chartoi[130] =
{
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 000 - 009
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 010 - 019
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 020 - 029
-1, -1, -1, 27, -1, -1, -1, -1, -1, 28, // 030 - 039
-1, -1, -1, -1, -1, 29, 26, 30, 31, 32, // 040 - 049
33, 34, 35, 36, 37, 38, 39, 40, -1, -1, // 050 - 059
-1, -1, -1, -1, -1, 0, 1, 2, 3, 4, // 060 - 069
5, 6, 7, 8, 9, 10, 11, 12, 13, 14, // 070 - 079
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, // 080 - 089
25, -1, -1, -1, -1, -1, -1, 0, 1, 2, // 090 - 099
3, 4, 5, 6, 7, 8, 9, 10, 11, 12, // 100 - 109
13, 14, 15, 16, 17, 18, 19, 20, 21, 22, // 110 - 119
23, 24, 25, -1, -1, -1, -1, -1, -1, -1 // 120 - 129
};
static void WI_drawWILV(int y, char *str)
{
int len = (int)strlen(str);
int w = 0;
int x;
for (int i = 0; i < len; i++)
{
int j = chartoi[(int)str[i]];
w += (j == -1 ? 6 : ((int)strlen(wilv[j]) / 13 - 2));
}
x = (ORIGINALWIDTH - w - 1) / 2;
for (int i = 0; i < len; i++)
{
int j = chartoi[(int)str[i]];
if (str[i] == '\'' && (!i || str[i - 1] == ' '))
j = 41;
if (j == -1)
x += 6;
else
{
WI_drawWILVchar(x, y, j);
x += (int)strlen(wilv[j]) / 13 - 2;
}
}
}
// Draws "<Levelname> Finished!"
static void WI_drawLF(void)
{
int x = (ORIGINALWIDTH - SHORT(finished->width)) / 2;
int y = WI_TITLEY;
int titlepatch = P_GetMapTitlePatch(wbs->epsd * 10 + wbs->last + 1);
// draw <LevelName>
if (titlepatch)
{
patch_t *patch = W_CacheLumpNum(titlepatch);
V_DrawPatchWithShadow((ORIGINALWIDTH - SHORT(patch->width)) / 2 + 1, y + 1, patch, false);
y += SHORT(patch->height) + 2;
}
else
{
char name[9];
if (gamemode == commercial)
M_snprintf(name, sizeof(name), "CWILV%2.2d", wbs->last);
else
M_snprintf(name, sizeof(name), "WILV%i%i", wbs->epsd, wbs->last);
if (W_CheckMultipleLumps(name) > 1 && !nerve)
{
V_DrawPatchWithShadow((ORIGINALWIDTH - SHORT(lnames[wbs->last]->width)) / 2 + 1, y + 1, lnames[wbs->last], false);
y += SHORT(lnames[wbs->last]->height) + 2;
}
else
{
WI_drawWILV(y, mapname);
y += 14;
}
}
if (y >= ORIGINALHEIGHT)
y = WI_TITLEY + 33;
// draw "Finished!"
V_DrawPatchWithShadow(x + 1, y + 1, finished, false);
}
// Draws "Entering <LevelName>"
static void WI_drawEL(void)
{
int x = (ORIGINALWIDTH - SHORT(entering->width)) / 2;
int y = WI_TITLEY;
int titlepatch = P_GetMapTitlePatch(wbs->epsd * 10 + wbs->next + 1);
// draw "Entering"
V_DrawPatchWithShadow(x + 1, y + 1, entering, false);
// draw level
y += SHORT(entering->height) + 2;
if (titlepatch)
{
patch_t *patch = W_CacheLumpNum(titlepatch);
V_DrawPatchWithShadow((ORIGINALWIDTH - SHORT(patch->width)) / 2 + 1, y + 1, patch, false);
}
else
{
char name[9];
if (gamemode == commercial)
M_snprintf(name, sizeof(name), "CWILV%2.2d", wbs->next);
else
M_snprintf(name, sizeof(name), "WILV%i%i", wbs->epsd, wbs->next);
if (W_CheckMultipleLumps(name) > 1 && !nerve)
V_DrawPatchWithShadow((ORIGINALWIDTH - SHORT(lnames[wbs->next]->width)) / 2 + 1, y + 1, lnames[wbs->next], false);
else
WI_drawWILV(y, nextmapname);
}
}
static void WI_drawOnLnode(int n, patch_t *c[])
{
dboolean fits = false;
int i = 0;
do
{
int left = lnodes[wbs->epsd][n].x - SHORT(c[i]->leftoffset);
int top = lnodes[wbs->epsd][n].y - SHORT(c[i]->topoffset);
int right = left + SHORT(c[i]->width);
int bottom = top + SHORT(c[i]->height);
if (left >= 0 && right < ORIGINALWIDTH && top >= 0 && bottom < ORIGINALHEIGHT)
fits = true;
else
i++;
} while (!fits && i != 2 && c[i]);
if (fits && i < 2)
{
if (c[i] == *splat)
V_DrawTranslucentNoGreenPatch(lnodes[wbs->epsd][n].x, lnodes[wbs->epsd][n].y, c[i]);
else if (c[i] == *yah)
V_DrawNoGreenPatchWithShadow(lnodes[wbs->epsd][n].x + 1, lnodes[wbs->epsd][n].y + 1, c[i]);
else
V_DrawPatch(lnodes[wbs->epsd][n].x, lnodes[wbs->epsd][n].y, 0, c[i]);
}
}
static void WI_initAnimatedBack(void)
{
if (gamemode == commercial)
return;
if (wbs->epsd > 2)
return;
for (int i = 0; i < NUMANIMS[wbs->epsd]; i++)
{
anim_t *a = &anims[wbs->epsd][i];
// init variables
a->ctr = -1;
// specify the next time to draw it
if (a->type == ANIM_ALWAYS)
a->nexttic = bcnt + 1 + (M_Random() % a->period);
else if (a->type == ANIM_LEVEL)
a->nexttic = bcnt + 1;
}
}
static void WI_updateAnimatedBack(void)
{
if (gamemode == commercial)
return;
if (wbs->epsd > 2)
return;
for (int i = 0; i < NUMANIMS[wbs->epsd]; i++)
{
anim_t *a = &anims[wbs->epsd][i];
if (bcnt == a->nexttic)
{
switch (a->type)
{
case ANIM_ALWAYS:
if (++a->ctr >= a->nanims)
a->ctr = 0;
a->nexttic = bcnt + a->period;
break;
case ANIM_LEVEL:
// gawd-awful hack for level anims
if (!(state == StatCount && i == 7) && wbs->next == a->data1)
{
if (++a->ctr == a->nanims)
a->ctr--;
a->nexttic = bcnt + a->period;
}
break;
}
}
}
}
static void WI_drawAnimatedBack(void)
{
anim_t *a;
if (gamemode == commercial)
return;
if (wbs->epsd > 2)
return;
for (int i = 0; i < NUMANIMS[wbs->epsd]; i++)
{
a = &anims[wbs->epsd][i];
if (a->ctr >= 0)
V_DrawPatch(a->loc.x, a->loc.y, 0, a->p[a->ctr]);
}
// [crispy] show Fortress Of Mystery if it has been completed
if (wbs->epsd == 1 && wbs->didsecret)
{
a = &anims[1][7];
V_DrawPatch(a->loc.x, a->loc.y, 0, a->p[2]);
}
}
//
// Draws a number.
// If digits > 0, then use that many digits minimum,
// otherwise only use as many as necessary.
// Returns new x position.
//
static int WI_drawNum(int x, int y, int n, int digits)
{
int fontwidth = SHORT(num[0]->width);
int neg;
if (digits < 0)
{
if (!n)
// make variable-length zeros 1 digit long
digits = 1;
else
{
int temp = n;
// figure out # of digits in #
digits = 0;
while (temp)
{
temp /= 10;
digits++;
}
}
}
neg = (n < 0);
if (neg)
n = -n;
// if non-number, do not draw it
if (n == 1994)
return 0;
// draw the new number
while (digits--)
{
x -= fontwidth;
x += 2 * (n % 10 == 1);
V_DrawPatchWithShadow(x + 1, y + 1, num[n % 10], true);
x -= 2 * (n % 10 == 1);
n /= 10;
}
// draw a minus sign if necessary
if (neg)
V_DrawPatch((x -= 8), y, 0, wiminus);
return x;
}
static void WI_drawPercent(int x, int y, int p)
{
if (p < 0)
return;
V_DrawPatchWithShadow(x + 1, y + 1, percent, false);
WI_drawNum(x, y, p, -1);
}
//
// Display level completion time and par,
// or "sucks" message if overflow.
//
static void WI_drawTime(int x, int y, int t)
{
if (t < 0)
return;
x += (SHORT(num[0]->width) - 11) * 4;
if (t <= 61 * 59)
{
int div = 1;
do
{
x = WI_drawNum(x, y, (t / div) % 60, 2) - SHORT(colon->width);
div *= 60;
// draw
if (div == 60 || t / div)
V_DrawPatchWithShadow(x + 1, y + 1, colon, true);
} while (t / div);
if (t < 60)
WI_drawNum(x, y, 0, 2);
}
else
// "sucks"
V_DrawPatchWithShadow(x + 13 - SHORT(sucks->width), y + 1, sucks, false);
}
static void WI_unloadData(void);
void WI_End(void)
{
WI_unloadData();
}
static void WI_initNoState(void)
{
state = NoState;
acceleratestage = 0;
cnt = (gamemode == commercial ? 1 * TICRATE : 10);
}
static void WI_updateNoState(void)
{
WI_updateAnimatedBack();
if (!--cnt)
G_WorldDone();
}
static dboolean snl_pointeron;
static void WI_initShowNextLoc(void)
{
if (gamemode != commercial && gamemap == 8)
{
G_WorldDone();
return;
}
state = ShowNextLoc;
acceleratestage = 0;
cnt = SHOWNEXTLOCDELAY * TICRATE;
WI_initAnimatedBack();
}
static void WI_updateShowNextLoc(void)
{
WI_updateAnimatedBack();
if (!--cnt || acceleratestage)
WI_initNoState();
else
snl_pointeron = ((cnt & 31) < 20);
}
static void WI_drawShowNextLoc(void)
{
WI_slamBackground();
// draw animated background
WI_drawAnimatedBack();
if (gamemode != commercial)
{
int last;
if (wbs->epsd > 2)
{
WI_drawEL();
return;
}
last = (wbs->last == 8 ? wbs->next - 1 : wbs->last);
// draw a splat on taken cities.
for (int i = 0; i <= last; i++)
WI_drawOnLnode(i, splat);
// splat the secret level?
if (wbs->didsecret)
WI_drawOnLnode(8, splat);
// draw flashing ptr
if (snl_pointeron)
WI_drawOnLnode(wbs->next, yah);
}
if (gamemission == pack_nerve && wbs->last == 7)
return;
// draws which level you are entering...
if (gamemode != commercial || wbs->next != 30 || (wbs->next == 30 && P_GetMapNext(wbs->last + 1)))
WI_drawEL();
}
static void WI_drawNoState(void)
{
snl_pointeron = true;
WI_drawShowNextLoc();
}
static int sp_state;
static void WI_initStats(void)
{
const int tabs[8] = { 65, 0, 0, 0, 0, 0, 0, 0 };
state = StatCount;
acceleratestage = 0;
sp_state = 1;
cnt_kills = -1;
cnt_items = -1;
cnt_secret = -1;
cnt_time = -1;
cnt_par = -1;
cnt_pause = TICRATE;
C_TabbedOutput(tabs, "Kills\t<b>%i%%</b>", (wbs->skills * 100) / wbs->maxkills);
C_TabbedOutput(tabs, "Items\t<b>%i%%</b>", (wbs->sitems * 100) / wbs->maxitems);
if (totalsecret)
C_TabbedOutput(tabs, "Secrets\t<b>%i%%</b>", (wbs->ssecret * 100) / wbs->maxsecret);
C_TabbedOutput(tabs, "Time\t<b>%.2i:%.2i</b>", wbs->stime / TICRATE / 60, wbs->stime / TICRATE % 60);
if (wbs->partime)
C_TabbedOutput(tabs, "Par\t<b>%.2i:%.2i</b>", wbs->partime / TICRATE / 60, wbs->partime / TICRATE % 60);
WI_initAnimatedBack();
}
static void WI_updateStats(void)
{
// e6y
static dboolean play_early_explosion = true;
WI_updateAnimatedBack();
if (acceleratestage && sp_state != 10)
{
acceleratestage = 0;
cnt_kills = (wbs->skills * 100) / wbs->maxkills;
cnt_items = (wbs->sitems * 100) / wbs->maxitems;
cnt_secret = (wbs->ssecret * 100) / wbs->maxsecret;
cnt_time = wbs->stime / TICRATE;
cnt_par = wbs->partime / TICRATE;
S_StartSound(NULL, sfx_barexp);
sp_state = 10;
}
if (sp_state == 2)
{
cnt_kills += 2;
if (!(bcnt & 3))
S_StartSound(NULL, sfx_pistol);
if (cnt_kills >= (wbs->skills * 100) / wbs->maxkills)
{
cnt_kills = (wbs->skills * 100) / wbs->maxkills;
S_StartSound(NULL, sfx_barexp);
sp_state++;
}
}
else if (sp_state == 4)
{
cnt_items += 2;
if (!(bcnt & 3))
S_StartSound(NULL, sfx_pistol);
if (cnt_items >= (wbs->sitems * 100) / wbs->maxitems)
{
cnt_items = (wbs->sitems * 100) / wbs->maxitems;
S_StartSound(NULL, sfx_barexp);
sp_state++;
}
}
else if (sp_state == 6)
{
cnt_secret += 2;
if (!(bcnt & 3))
S_StartSound(NULL, sfx_pistol);
if (cnt_secret >= (wbs->ssecret * 100) / wbs->maxsecret)
{
cnt_secret = (wbs->ssecret * 100) / wbs->maxsecret;
S_StartSound(NULL, sfx_barexp);
sp_state++;
}
}
else if (sp_state == 8)
{
// e6y: do not play count sound after explosion sound
if (!(bcnt & 3) && play_early_explosion)
S_StartSound(NULL, sfx_pistol);
cnt_time += 3;
if (cnt_time >= wbs->stime / TICRATE)
cnt_time = wbs->stime / TICRATE;
cnt_par += 3;
// e6y
// if par time is hidden (if modifiedgame is true)
// the game should play explosion sound immediately after
// the counter will reach level time instead of par time
if (modifiedgame && play_early_explosion)
if (cnt_time >= wbs->stime / TICRATE)
{
S_StartSound(NULL, sfx_barexp);
play_early_explosion = false; // do not play it twice or more
}
if (cnt_par >= wbs->partime / TICRATE)
{
cnt_par = wbs->partime / TICRATE;
if (cnt_time >= wbs->stime / TICRATE)
{
// e6y: do not play explosion sound if it was already played
if (!modifiedgame)
S_StartSound(NULL, sfx_barexp);
sp_state++;
}
}
}
else if (sp_state == 10)
{
if (acceleratestage)
{
S_StartSound(NULL, sfx_sgcock);
if (gamemode == commercial)
WI_initNoState();
else
WI_initShowNextLoc();
}
}
else if (sp_state & 1)
{
play_early_explosion = true; // e6y
if (!--cnt_pause)
{
sp_state++;
cnt_pause = TICRATE;
}
}
}
void M_DrawString(int x, int y, char *str);
static void WI_drawStats(void)
{
// line height
int lh = 3 * SHORT(num[0]->height) / 2;
WI_slamBackground();
// draw animated background
WI_drawAnimatedBack();
WI_drawLF();
V_DrawPatchWithShadow(SP_STATSX + 1, SP_STATSY + 1, kills, false);
WI_drawPercent(ORIGINALWIDTH - SP_STATSX - 14, SP_STATSY, cnt_kills);
V_DrawPatchWithShadow(SP_STATSX + 1, SP_STATSY + lh + 1, items, false);
WI_drawPercent(ORIGINALWIDTH - SP_STATSX - 14, SP_STATSY + lh, cnt_items);
if (totalsecret)
{
if (!WISCRT2)
M_DrawString(SP_STATSX, SP_STATSY + 2 * lh - 3, "secrets");
else
V_DrawPatchWithShadow(SP_STATSX + 1, SP_STATSY + 2 * lh + 1, sp_secret, false);
WI_drawPercent(ORIGINALWIDTH - SP_STATSX - 14, SP_STATSY + 2 * lh, cnt_secret);
}
V_DrawPatchWithShadow(SP_TIMEX + 1, SP_TIMEY + 1, timepatch, false);
WI_drawTime(ORIGINALWIDTH / 2 - SP_TIMEX * 2, SP_TIMEY, cnt_time);
if (wbs->partime)
{
V_DrawPatchWithShadow(ORIGINALWIDTH / 2 + SP_TIMEX + (BTSX ? 0 : SP_TIMEX - FREEDOOM * 17 + 3), SP_TIMEY + 1, par, false);
WI_drawTime(ORIGINALWIDTH - SP_TIMEX - 2 - (BTSX || FREEDOOM) * 17, SP_TIMEY, cnt_par);
}
}
void WI_checkForAccelerate(void)
{
const Uint8 *keystate = SDL_GetKeyboardState(NULL);
if ((viewplayer->cmd.buttons & BT_ATTACK) || keystate[SDL_SCANCODE_RETURN] || keystate[SDL_SCANCODE_KP_ENTER])
{
if (!viewplayer->attackdown)
acceleratestage = 1;
viewplayer->attackdown = true;
}
else
viewplayer->attackdown = false;
if ((viewplayer->cmd.buttons & BT_USE) || keystate[SDL_SCANCODE_SPACE])
{
if (!viewplayer->usedown)
acceleratestage = 1;
viewplayer->usedown = true;
}
else
viewplayer->usedown = false;
}
// Updates stuff each tick
void WI_Ticker(void)
{
if (menuactive || paused || consoleactive)
return;
// counter for general background animation
if (++bcnt == 1)
// intermission music
S_ChangeMusic((gamemode == commercial ? mus_dm2int : mus_inter), true, false, false);
WI_checkForAccelerate();
switch (state)
{
case StatCount:
WI_updateStats();
break;
case ShowNextLoc:
WI_updateShowNextLoc();
break;
case NoState:
WI_updateNoState();
break;
}
}
typedef void (*load_callback_t)(char *lumpname, patch_t **variable);
// Common load/unload function. Iterates over all the graphics
// lumps to be loaded/unloaded into memory.
static void WI_loadUnloadData(load_callback_t callback)
{
char name[9];
anim_t *a;
if (gamemode == commercial)
{
for (int i = 0; i < NUMCMAPS; i++)
{
M_snprintf(name, sizeof(name), "CWILV%2.2d", i);
callback(name, &lnames[i]);
}
}
else
{
for (int i = 0; i < NUMMAPS; i++)
{
M_snprintf(name, sizeof(name), "WILV%i%i", wbs->epsd, i);
callback(name, &lnames[i]);
}
// you are here
callback("WIURH0", &yah[0]);
// you are here (alt.)
callback("WIURH1", &yah[1]);
// splat
callback("WISPLAT", &splat[0]);
if (wbs->epsd < 3)
{
for (int j = 0; j < NUMANIMS[wbs->epsd]; j++)
{
a = &anims[wbs->epsd][j];
for (int i = 0; i < a->nanims; i++)
{
// MONDO HACK!
if (wbs->epsd != 1 || j != 8)
{
// animations
M_snprintf(name, sizeof(name), "WIA%i%.2d%.2d", wbs->epsd, j, i);
callback(name, &a->p[i]);
}
else
// HACK ALERT!
a->p[i] = anims[1][4].p[i];
}
}
}
}
// More hacks on minus sign.
callback("WIMINUS", &wiminus);
for (int i = 0; i < 10; i++)
{
// numbers 0-9
M_snprintf(name, sizeof(name), "WINUM%i", i);
callback(name, &num[i]);
}
// percent sign
callback("WIPCNT", &percent);
// "finished"
callback("WIF", &finished);
// "entering"
callback("WIENTER", &entering);
// "kills"
callback("WIOSTK", &kills);
// "secret"
callback("WISCRT2", &sp_secret);
// "items"
callback("WIOSTI", &items);
// ":"
callback("WICOLON", &colon);
// "time"
callback("WITIME", &timepatch);
// "sucks"
callback("WISUCKS", &sucks);
// "par"
callback("WIPAR", &par);
}
static void WI_loadCallback(char *name, patch_t **variable)
{
*variable = (patch_t *)W_CacheLumpName(name);
}
static void WI_loadData(void)
{
char bg_lumpname[9];
if (gamemode == commercial)
{
NUMCMAPS = 32 + (W_CheckNumForName("CWILV32") >= 0);
lnames = Z_Malloc(sizeof(patch_t *) * NUMCMAPS, PU_STATIC, NULL);
}
else
lnames = Z_Malloc(sizeof(patch_t *) * NUMMAPS, PU_STATIC, NULL);
WI_loadUnloadData(WI_loadCallback);
// These two graphics are special cased because we're sharing
// them with the status bar code
// Background image
if (gamemode == commercial || (gamemode == retail && wbs->epsd == 3))
{
M_StringCopy(bg_lumpname, (DMENUPIC && W_CheckMultipleLumps("INTERPIC") == 1 ? "DMENUPIC" : "INTERPIC"), sizeof(bg_lumpname));
bg_lumpname[8] = '\0';
}
else
M_snprintf(bg_lumpname, sizeof(bg_lumpname), "WIMAP%i", wbs->epsd);
V_DrawPatch(0, 0, 1, W_CacheLumpName(bg_lumpname));
}
static void WI_unloadCallback(char *name, patch_t **variable)
{
W_ReleaseLumpName(name);
*variable = NULL;
}
static void WI_unloadData(void)
{
WI_loadUnloadData(WI_unloadCallback);
}
void WI_Drawer(void)
{
switch (state)
{
case StatCount:
WI_drawStats();
break;
case ShowNextLoc:
WI_drawShowNextLoc();
break;
case NoState:
WI_drawNoState();
break;
}
}
extern char maptitle[128];
void P_MapName(int ep, int map);
static void WI_initVariables(wbstartstruct_t *wbstartstruct)
{
wbs = wbstartstruct;
acceleratestage = 0;
cnt = 0;
bcnt = 0;
if (!wbs->maxkills)
wbs->maxkills = 1;
if (!wbs->maxitems)
wbs->maxitems = 1;
if (!wbs->maxsecret)
wbs->maxsecret = 1;
if (gamemode != retail && wbs->epsd > 2)
wbs->epsd -= 3;
mapname = Z_Malloc(128, PU_STATIC, NULL);
strcpy(mapname, maptitle);
nextmapname = Z_Malloc(128, PU_STATIC, NULL);
P_MapName(wbs->epsd + 1, wbs->next + 1);
strcpy(nextmapname, maptitle);
}
void WI_Start(wbstartstruct_t *wbstartstruct)
{
WI_initVariables(wbstartstruct);
WI_loadData();
WI_initStats();
}
|
jasoncarlough/doomretro
|
src/wi_stuff.c
|
C
|
gpl-3.0
| 29,968
|
/*
* Copyright (C) 2008-2013 FreeIPMI Core Team
*
* 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 IPMI_CHASSIS_CONFIG_VALIDATE_H
#define IPMI_CHASSIS_CONFIG_VALIDATE_H
#include "ipmi-chassis-config.h"
#include "ipmi-chassis-config-sections.h"
config_validate_t power_restore_policy_number_validate (const char *section_name,
const char *key_name,
const char *value,
void *arg);
config_validate_t bios_boot_type_number_validate (const char *section_name,
const char *key_name,
const char *value,
void *arg);
config_validate_t boot_device_number_validate (const char *section_name,
const char *key_name,
const char *value,
void *arg);
config_validate_t device_instance_selector_number_validate (const char *section_name,
const char *key_name,
const char *value,
void *arg);
config_validate_t firmware_bios_verbosity_number_validate (const char *section_name,
const char *key_name,
const char *value,
void *arg);
config_validate_t console_redirection_number_validate (const char *section_name,
const char *key_name,
const char *value,
void *arg);
#endif /* IPMI_CHASSIS_CONFIG_VALIDATE_H */
|
elitak/freeipmi
|
ipmi-chassis-config/ipmi-chassis-config-validate.h
|
C
|
gpl-3.0
| 2,695
|
require 'package'
class Nvm < Package
description 'Node Version Manager - Simple bash script to manage multiple active node.js versions.'
homepage 'https://github.com/creationix/nvm'
version '0.33.2'
source_url 'https://github.com/creationix/nvm/archive/v0.33.2.tar.gz'
source_sha256 '2ad455a0752d5bae49ecff38a8a7778cc734c2d0ece9942dfdd164c2f01e80da'
binary_url ({
aarch64: 'https://dl.bintray.com/chromebrew/chromebrew/nvm-0.33.2-chromeos-armv7l.tar.xz',
armv7l: 'https://dl.bintray.com/chromebrew/chromebrew/nvm-0.33.2-chromeos-armv7l.tar.xz',
i686: 'https://dl.bintray.com/chromebrew/chromebrew/nvm-0.33.2-chromeos-i686.tar.xz',
x86_64: 'https://dl.bintray.com/chromebrew/chromebrew/nvm-0.33.2-chromeos-x86_64.tar.xz',
})
binary_sha256 ({
aarch64: 'f0d15c5ff6bac0d2cea927db6ed3cb778f73f1e25f5e8d3975f6ea73c7fc52f1',
armv7l: 'f0d15c5ff6bac0d2cea927db6ed3cb778f73f1e25f5e8d3975f6ea73c7fc52f1',
i686: 'a6a161692e32907872fc5864b0d2dee0509b7980d30594796aa72be897b66352',
x86_64: '67e327de8bcfb1ec8266827d2d7f1fd48486b7af4f9a0179caad9caf4e05d3c1',
})
def self.install
system "sed -i 's,\$HOME/.nvm,/usr/local/share/nvm,g' install.sh"
system "NVM_DIR=/usr/local/share/nvm && bash install.sh"
system "rm -rf /usr/local/share/nvm/.git*"
system "rm -rf /usr/local/share/nvm/test"
system "mkdir -p #{CREW_DEST_DIR}/usr/local/share"
system "cp -r /usr/local/share/nvm #{CREW_DEST_DIR}/usr/local/share"
puts ""
puts "To complete the installation, execute:".lightblue
puts "source ~/.bashrc".lightblue
puts ""
puts "To uninstall, in addition to 'crew remove nvm' you will".lightblue
puts "also need to delete any lines with NVM_DIR in ~/.bashrc.".lightblue
puts ""
end
end
|
jam7/chromebrew
|
packages/nvm.rb
|
Ruby
|
gpl-3.0
| 1,781
|
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'pagebreak', 'ar', {
alt: 'فاصل الصفحة',
toolbar: 'إدخال صفحة جديدة'
} );
|
vanpouckesven/cosnics
|
src/Chamilo/Libraries/Resources/Javascript/HtmlEditor/Ckeditor/src/plugins/pagebreak/lang/ar.js
|
JavaScript
|
gpl-3.0
| 280
|
<?php
try {
require_once "../app/config.php";
// Handle the request
$response = $application->handle();
$response->send();
} catch (\Exception $e) {
echo "Exception: ", $e->getMessage();
}
|
cedricjimenez/ai
|
public/index.php
|
PHP
|
gpl-3.0
| 215
|
/*
* Copyright (C) 2004 Derek James and Philip Tucker
*
* This file is part of ANJI (Another NEAT Java Implementation).
*
* ANJI is free software; you can redistribute it and/or modify it under the terms of the GNU
* General Public License as published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program; if
* not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA
*
* Created on Jul 9, 2005 by Philip Tucker
*/
package com.anji.neat;
import java.util.Comparator;
/**
* sorts ConnectionGenes in ascending order of weight magnitude
*/
public class WeightMagnitudeComparator implements Comparator {
private static WeightMagnitudeComparator instance = null;
private WeightMagnitudeComparator() {
super();
}
/**
* @return singleton
*/
public static WeightMagnitudeComparator getInstance() {
if (instance == null)
instance = new WeightMagnitudeComparator();
return instance;
}
/**
* @param o1
* @param o2
* @return compare absolute value of weights of <code>ConnectionAllele</code> objects; return 1 if <code>o1</code>>
* <code>o2</code>, 0 if <code>o1</code>==<code>o2</code>; -1 otherwise
*/
public int compare(Object o1, Object o2) {
ConnectionAllele connAllele1 = (ConnectionAllele) o1;
ConnectionAllele connAllele2 = (ConnectionAllele) o2;
double result = Math.abs(connAllele1.getWeight()) - Math.abs(connAllele2.getWeight());
if (result > 0)
return 1;
else if (result < 0)
return -1;
else
return 0;
}
}
|
jbrant/ahni
|
src/com/anji/neat/WeightMagnitudeComparator.java
|
Java
|
gpl-3.0
| 1,937
|
---
layout: page
permalink: /:basename/
---
<link rel="stylesheet" type="text/css" href="../css/promisepage.css">
<div class="container">
<div class="row">
<div class="col-md-12">
<h2>Deport, deport, deport - if not en masse, through a federal deportation force, at least expulsions in numbers far greater than the records President Obama already set.</h2>
<a class='btn facebook' target="_blank" href="https://www.facebook.com/sharer.php?u=https://trumptracker.github.io/deport-deport-deport-if-not-en-masse-through-a-federal-deportation-force-at-least-expulsions-in-numbe/&title=Deport%2C+deport%2C+deport+-+if+not+en+masse%2C+through+a+federal+deportation+force%2C+at+least+expulsions+in+numbers+far+greater+than+the+records+President+Obama+already+set."> <i class="fa fa-facebook-square fa-fw" aria-hidden="true"></i> Share</a>
<a class="btn twitter" href="https://twitter.com/share?url=https://trumptracker.github.io/&text=%40realDonaldTrump+hasn%27t+started+promise+no.+110%3A+Deport%2C+deport%2C+deport+-+if+not+en+masse%2C+through+...&hashtags=TrumpTracker" target="_blank"><i class="fa fa-fw fa-twitter" aria-hidden="true"></i> Tweet</a>
</div>
<div class="col-md-12">
<h3>Category: Indigenous</h3>
<h3>Status: <span style='color: #31708f;'>Not started</span></h3>
<p></p>
</div>
<div class="col-md-12">
<h3>Sources:</h3>
<ul class='sources'>
<li><a class='src' target='_blank' href='https://web.archive.org/web/20161110165423/http://www.nydailynews.com/news/politics/donald-trump-big-list-promises-article-1.2865483'>http://www.nydailynews.com/news/politics/donald-trump-big-list-promises-article-1.2865483</a></li>
</ul>
</div>
</div><BR>
<div id="reddit_comments">
<h3 class='comments'>Comments</h3>
<a target="_blank" href="https://redd.it/5d7sso" class="btn btn-primary placecomment"><i class="fa fa-pencil" aria-hidden="true"></i> Place comment</a>
<p class='commentcount'></p>
<div class="loader"></div>
<div class="panel-group"><div class="noscript">Please enable Javascript and disable any adblocker to view comments.</div></div>
</div>
</div>
<script>var redditid = '["5d7sso"]';</script>
<script src="../js/snuownd.min.js"></script>
<script src="../js/promisepage.js"></script>
|
janjiid/dki
|
promises/deport-deport-deport-if-not-en-masse-through-a-federal-deportation-force-at-least-expulsions-in-numbe.html
|
HTML
|
gpl-3.0
| 2,291
|
"""Tests for Lib/fractions.py."""
from decimal import Decimal
from test.support import run_unittest
import math
import numbers
import operator
import fractions
import unittest
from copy import copy, deepcopy
from pickle import dumps, loads
F = fractions.Fraction
gcd = fractions.gcd
class DummyFloat(object):
"""Dummy float class for testing comparisons with Fractions"""
def __init__(self, value):
if not isinstance(value, float):
raise TypeError("DummyFloat can only be initialized from float")
self.value = value
def _richcmp(self, other, op):
if isinstance(other, numbers.Rational):
return op(F.from_float(self.value), other)
elif isinstance(other, DummyFloat):
return op(self.value, other.value)
else:
return NotImplemented
def __eq__(self, other): return self._richcmp(other, operator.eq)
def __le__(self, other): return self._richcmp(other, operator.le)
def __lt__(self, other): return self._richcmp(other, operator.lt)
def __ge__(self, other): return self._richcmp(other, operator.ge)
def __gt__(self, other): return self._richcmp(other, operator.gt)
# shouldn't be calling __float__ at all when doing comparisons
def __float__(self):
assert False, "__float__ should not be invoked for comparisons"
# same goes for subtraction
def __sub__(self, other):
assert False, "__sub__ should not be invoked for comparisons"
__rsub__ = __sub__
class DummyRational(object):
"""Test comparison of Fraction with a naive rational implementation."""
def __init__(self, num, den):
g = gcd(num, den)
self.num = num // g
self.den = den // g
def __eq__(self, other):
if isinstance(other, fractions.Fraction):
return (self.num == other._numerator and
self.den == other._denominator)
else:
return NotImplemented
def __lt__(self, other):
return(self.num * other._denominator < self.den * other._numerator)
def __gt__(self, other):
return(self.num * other._denominator > self.den * other._numerator)
def __le__(self, other):
return(self.num * other._denominator <= self.den * other._numerator)
def __ge__(self, other):
return(self.num * other._denominator >= self.den * other._numerator)
# this class is for testing comparisons; conversion to float
# should never be used for a comparison, since it loses accuracy
def __float__(self):
assert False, "__float__ should not be invoked"
class GcdTest(unittest.TestCase):
def testMisc(self):
self.assertEquals(0, gcd(0, 0))
self.assertEquals(1, gcd(1, 0))
self.assertEquals(-1, gcd(-1, 0))
self.assertEquals(1, gcd(0, 1))
self.assertEquals(-1, gcd(0, -1))
self.assertEquals(1, gcd(7, 1))
self.assertEquals(-1, gcd(7, -1))
self.assertEquals(1, gcd(-23, 15))
self.assertEquals(12, gcd(120, 84))
self.assertEquals(-12, gcd(84, -120))
def _components(r):
return (r.numerator, r.denominator)
class FractionTest(unittest.TestCase):
def assertTypedEquals(self, expected, actual):
"""Asserts that both the types and values are the same."""
self.assertEquals(type(expected), type(actual))
self.assertEquals(expected, actual)
def assertRaisesMessage(self, exc_type, message,
callable, *args, **kwargs):
"""Asserts that callable(*args, **kwargs) raises exc_type(message)."""
try:
callable(*args, **kwargs)
except exc_type as e:
self.assertEquals(message, str(e))
else:
self.fail("%s not raised" % exc_type.__name__)
def testInit(self):
self.assertEquals((0, 1), _components(F()))
self.assertEquals((7, 1), _components(F(7)))
self.assertEquals((7, 3), _components(F(F(7, 3))))
self.assertEquals((-1, 1), _components(F(-1, 1)))
self.assertEquals((-1, 1), _components(F(1, -1)))
self.assertEquals((1, 1), _components(F(-2, -2)))
self.assertEquals((1, 2), _components(F(5, 10)))
self.assertEquals((7, 15), _components(F(7, 15)))
self.assertEquals((10**23, 1), _components(F(10**23)))
self.assertEquals((3, 77), _components(F(F(3, 7), 11)))
self.assertEquals((-9, 5), _components(F(2, F(-10, 9))))
self.assertEquals((2486, 2485), _components(F(F(22, 7), F(355, 113))))
self.assertRaisesMessage(ZeroDivisionError, "Fraction(12, 0)",
F, 12, 0)
self.assertRaises(TypeError, F, 1.5)
self.assertRaises(TypeError, F, 1.5 + 3j)
self.assertRaises(TypeError, F, "3/2", 3)
self.assertRaises(TypeError, F, 3, 0j)
self.assertRaises(TypeError, F, 3, 1j)
def testFromString(self):
self.assertEquals((5, 1), _components(F("5")))
self.assertEquals((3, 2), _components(F("3/2")))
self.assertEquals((3, 2), _components(F(" \n +3/2")))
self.assertEquals((-3, 2), _components(F("-3/2 ")))
self.assertEquals((13, 2), _components(F(" 013/02 \n ")))
self.assertEquals((16, 5), _components(F(" 3.2 ")))
self.assertEquals((-16, 5), _components(F(" -3.2 ")))
self.assertEquals((-3, 1), _components(F(" -3. ")))
self.assertEquals((3, 5), _components(F(" .6 ")))
self.assertEquals((1, 3125), _components(F("32.e-5")))
self.assertEquals((1000000, 1), _components(F("1E+06")))
self.assertEquals((-12300, 1), _components(F("-1.23e4")))
self.assertEquals((0, 1), _components(F(" .0e+0\t")))
self.assertEquals((0, 1), _components(F("-0.000e0")))
self.assertRaisesMessage(
ZeroDivisionError, "Fraction(3, 0)",
F, "3/0")
self.assertRaisesMessage(
ValueError, "Invalid literal for Fraction: '3/'",
F, "3/")
self.assertRaisesMessage(
ValueError, "Invalid literal for Fraction: '/2'",
F, "/2")
self.assertRaisesMessage(
ValueError, "Invalid literal for Fraction: '3 /2'",
F, "3 /2")
self.assertRaisesMessage(
# Denominators don't need a sign.
ValueError, "Invalid literal for Fraction: '3/+2'",
F, "3/+2")
self.assertRaisesMessage(
# Imitate float's parsing.
ValueError, "Invalid literal for Fraction: '+ 3/2'",
F, "+ 3/2")
self.assertRaisesMessage(
# Avoid treating '.' as a regex special character.
ValueError, "Invalid literal for Fraction: '3a2'",
F, "3a2")
self.assertRaisesMessage(
# Don't accept combinations of decimals and rationals.
ValueError, "Invalid literal for Fraction: '3/7.2'",
F, "3/7.2")
self.assertRaisesMessage(
# Don't accept combinations of decimals and rationals.
ValueError, "Invalid literal for Fraction: '3.2/7'",
F, "3.2/7")
self.assertRaisesMessage(
# Allow 3. and .3, but not .
ValueError, "Invalid literal for Fraction: '.'",
F, ".")
def testImmutable(self):
r = F(7, 3)
r.__init__(2, 15)
self.assertEquals((7, 3), _components(r))
self.assertRaises(AttributeError, setattr, r, 'numerator', 12)
self.assertRaises(AttributeError, setattr, r, 'denominator', 6)
self.assertEquals((7, 3), _components(r))
# But if you _really_ need to:
r._numerator = 4
r._denominator = 2
self.assertEquals((4, 2), _components(r))
# Which breaks some important operations:
self.assertNotEquals(F(4, 2), r)
def testFromFloat(self):
self.assertRaises(TypeError, F.from_float, 3+4j)
self.assertEquals((10, 1), _components(F.from_float(10)))
bigint = 1234567890123456789
self.assertEquals((bigint, 1), _components(F.from_float(bigint)))
self.assertEquals((0, 1), _components(F.from_float(-0.0)))
self.assertEquals((10, 1), _components(F.from_float(10.0)))
self.assertEquals((-5, 2), _components(F.from_float(-2.5)))
self.assertEquals((99999999999999991611392, 1),
_components(F.from_float(1e23)))
self.assertEquals(float(10**23), float(F.from_float(1e23)))
self.assertEquals((3602879701896397, 1125899906842624),
_components(F.from_float(3.2)))
self.assertEquals(3.2, float(F.from_float(3.2)))
inf = 1e1000
nan = inf - inf
self.assertRaisesMessage(
TypeError, "Cannot convert inf to Fraction.",
F.from_float, inf)
self.assertRaisesMessage(
TypeError, "Cannot convert -inf to Fraction.",
F.from_float, -inf)
self.assertRaisesMessage(
TypeError, "Cannot convert nan to Fraction.",
F.from_float, nan)
def testFromDecimal(self):
self.assertRaises(TypeError, F.from_decimal, 3+4j)
self.assertEquals(F(10, 1), F.from_decimal(10))
self.assertEquals(F(0), F.from_decimal(Decimal("-0")))
self.assertEquals(F(5, 10), F.from_decimal(Decimal("0.5")))
self.assertEquals(F(5, 1000), F.from_decimal(Decimal("5e-3")))
self.assertEquals(F(5000), F.from_decimal(Decimal("5e3")))
self.assertEquals(1 - F(1, 10**30),
F.from_decimal(Decimal("0." + "9" * 30)))
self.assertRaisesMessage(
TypeError, "Cannot convert Infinity to Fraction.",
F.from_decimal, Decimal("inf"))
self.assertRaisesMessage(
TypeError, "Cannot convert -Infinity to Fraction.",
F.from_decimal, Decimal("-inf"))
self.assertRaisesMessage(
TypeError, "Cannot convert NaN to Fraction.",
F.from_decimal, Decimal("nan"))
self.assertRaisesMessage(
TypeError, "Cannot convert sNaN to Fraction.",
F.from_decimal, Decimal("snan"))
def testLimitDenominator(self):
rpi = F('3.1415926535897932')
self.assertEqual(rpi.limit_denominator(10000), F(355, 113))
self.assertEqual(-rpi.limit_denominator(10000), F(-355, 113))
self.assertEqual(rpi.limit_denominator(113), F(355, 113))
self.assertEqual(rpi.limit_denominator(112), F(333, 106))
self.assertEqual(F(201, 200).limit_denominator(100), F(1))
self.assertEqual(F(201, 200).limit_denominator(101), F(102, 101))
self.assertEqual(F(0).limit_denominator(10000), F(0))
def testConversions(self):
self.assertTypedEquals(-1, math.trunc(F(-11, 10)))
self.assertTypedEquals(-2, math.floor(F(-11, 10)))
self.assertTypedEquals(-1, math.ceil(F(-11, 10)))
self.assertTypedEquals(-1, math.ceil(F(-10, 10)))
self.assertTypedEquals(-1, int(F(-11, 10)))
self.assertTypedEquals(0, round(F(-1, 10)))
self.assertTypedEquals(0, round(F(-5, 10)))
self.assertTypedEquals(-2, round(F(-15, 10)))
self.assertTypedEquals(-1, round(F(-7, 10)))
self.assertEquals(False, bool(F(0, 1)))
self.assertEquals(True, bool(F(3, 2)))
self.assertTypedEquals(0.1, float(F(1, 10)))
# Check that __float__ isn't implemented by converting the
# numerator and denominator to float before dividing.
self.assertRaises(OverflowError, float, int('2'*400+'7'))
self.assertAlmostEquals(2.0/3,
float(F(int('2'*400+'7'), int('3'*400+'1'))))
self.assertTypedEquals(0.1+0j, complex(F(1,10)))
def testRound(self):
self.assertTypedEquals(F(-200), round(F(-150), -2))
self.assertTypedEquals(F(-200), round(F(-250), -2))
self.assertTypedEquals(F(30), round(F(26), -1))
self.assertTypedEquals(F(-2, 10), round(F(-15, 100), 1))
self.assertTypedEquals(F(-2, 10), round(F(-25, 100), 1))
def testArithmetic(self):
self.assertEquals(F(1, 2), F(1, 10) + F(2, 5))
self.assertEquals(F(-3, 10), F(1, 10) - F(2, 5))
self.assertEquals(F(1, 25), F(1, 10) * F(2, 5))
self.assertEquals(F(1, 4), F(1, 10) / F(2, 5))
self.assertTypedEquals(2, F(9, 10) // F(2, 5))
self.assertTypedEquals(10**23, F(10**23, 1) // F(1))
self.assertEquals(F(2, 3), F(-7, 3) % F(3, 2))
self.assertEquals(F(8, 27), F(2, 3) ** F(3))
self.assertEquals(F(27, 8), F(2, 3) ** F(-3))
self.assertTypedEquals(2.0, F(4) ** F(1, 2))
z = pow(F(-1), F(1, 2))
self.assertAlmostEquals(z.real, 0)
self.assertEquals(z.imag, 1)
def testMixedArithmetic(self):
self.assertTypedEquals(F(11, 10), F(1, 10) + 1)
self.assertTypedEquals(1.1, F(1, 10) + 1.0)
self.assertTypedEquals(1.1 + 0j, F(1, 10) + (1.0 + 0j))
self.assertTypedEquals(F(11, 10), 1 + F(1, 10))
self.assertTypedEquals(1.1, 1.0 + F(1, 10))
self.assertTypedEquals(1.1 + 0j, (1.0 + 0j) + F(1, 10))
self.assertTypedEquals(F(-9, 10), F(1, 10) - 1)
self.assertTypedEquals(-0.9, F(1, 10) - 1.0)
self.assertTypedEquals(-0.9 + 0j, F(1, 10) - (1.0 + 0j))
self.assertTypedEquals(F(9, 10), 1 - F(1, 10))
self.assertTypedEquals(0.9, 1.0 - F(1, 10))
self.assertTypedEquals(0.9 + 0j, (1.0 + 0j) - F(1, 10))
self.assertTypedEquals(F(1, 10), F(1, 10) * 1)
self.assertTypedEquals(0.1, F(1, 10) * 1.0)
self.assertTypedEquals(0.1 + 0j, F(1, 10) * (1.0 + 0j))
self.assertTypedEquals(F(1, 10), 1 * F(1, 10))
self.assertTypedEquals(0.1, 1.0 * F(1, 10))
self.assertTypedEquals(0.1 + 0j, (1.0 + 0j) * F(1, 10))
self.assertTypedEquals(F(1, 10), F(1, 10) / 1)
self.assertTypedEquals(0.1, F(1, 10) / 1.0)
self.assertTypedEquals(0.1 + 0j, F(1, 10) / (1.0 + 0j))
self.assertTypedEquals(F(10, 1), 1 / F(1, 10))
self.assertTypedEquals(10.0, 1.0 / F(1, 10))
self.assertTypedEquals(10.0 + 0j, (1.0 + 0j) / F(1, 10))
self.assertTypedEquals(0, F(1, 10) // 1)
self.assertTypedEquals(0, F(1, 10) // 1.0)
self.assertTypedEquals(10, 1 // F(1, 10))
self.assertTypedEquals(10**23, 10**22 // F(1, 10))
self.assertTypedEquals(10, 1.0 // F(1, 10))
self.assertTypedEquals(F(1, 10), F(1, 10) % 1)
self.assertTypedEquals(0.1, F(1, 10) % 1.0)
self.assertTypedEquals(F(0, 1), 1 % F(1, 10))
self.assertTypedEquals(0.0, 1.0 % F(1, 10))
# No need for divmod since we don't override it.
# ** has more interesting conversion rules.
self.assertTypedEquals(F(100, 1), F(1, 10) ** -2)
self.assertTypedEquals(F(100, 1), F(10, 1) ** 2)
self.assertTypedEquals(0.1, F(1, 10) ** 1.0)
self.assertTypedEquals(0.1 + 0j, F(1, 10) ** (1.0 + 0j))
self.assertTypedEquals(4 , 2 ** F(2, 1))
z = pow(-1, F(1, 2))
self.assertAlmostEquals(0, z.real)
self.assertEquals(1, z.imag)
self.assertTypedEquals(F(1, 4) , 2 ** F(-2, 1))
self.assertTypedEquals(2.0 , 4 ** F(1, 2))
self.assertTypedEquals(0.25, 2.0 ** F(-2, 1))
self.assertTypedEquals(1.0 + 0j, (1.0 + 0j) ** F(1, 10))
def testMixingWithDecimal(self):
# Decimal refuses mixed comparisons.
self.assertRaisesMessage(
TypeError,
"unsupported operand type(s) for +: 'Fraction' and 'Decimal'",
operator.add, F(3,11), Decimal('3.1415926'))
self.assertNotEquals(F(5, 2), Decimal('2.5'))
def testComparisons(self):
self.assertTrue(F(1, 2) < F(2, 3))
self.assertFalse(F(1, 2) < F(1, 2))
self.assertTrue(F(1, 2) <= F(2, 3))
self.assertTrue(F(1, 2) <= F(1, 2))
self.assertFalse(F(2, 3) <= F(1, 2))
self.assertTrue(F(1, 2) == F(1, 2))
self.assertFalse(F(1, 2) == F(1, 3))
self.assertFalse(F(1, 2) != F(1, 2))
self.assertTrue(F(1, 2) != F(1, 3))
def testComparisonsDummyRational(self):
self.assertTrue(F(1, 2) == DummyRational(1, 2))
self.assertTrue(DummyRational(1, 2) == F(1, 2))
self.assertFalse(F(1, 2) == DummyRational(3, 4))
self.assertFalse(DummyRational(3, 4) == F(1, 2))
self.assertTrue(F(1, 2) < DummyRational(3, 4))
self.assertFalse(F(1, 2) < DummyRational(1, 2))
self.assertFalse(F(1, 2) < DummyRational(1, 7))
self.assertFalse(F(1, 2) > DummyRational(3, 4))
self.assertFalse(F(1, 2) > DummyRational(1, 2))
self.assertTrue(F(1, 2) > DummyRational(1, 7))
self.assertTrue(F(1, 2) <= DummyRational(3, 4))
self.assertTrue(F(1, 2) <= DummyRational(1, 2))
self.assertFalse(F(1, 2) <= DummyRational(1, 7))
self.assertFalse(F(1, 2) >= DummyRational(3, 4))
self.assertTrue(F(1, 2) >= DummyRational(1, 2))
self.assertTrue(F(1, 2) >= DummyRational(1, 7))
self.assertTrue(DummyRational(1, 2) < F(3, 4))
self.assertFalse(DummyRational(1, 2) < F(1, 2))
self.assertFalse(DummyRational(1, 2) < F(1, 7))
self.assertFalse(DummyRational(1, 2) > F(3, 4))
self.assertFalse(DummyRational(1, 2) > F(1, 2))
self.assertTrue(DummyRational(1, 2) > F(1, 7))
self.assertTrue(DummyRational(1, 2) <= F(3, 4))
self.assertTrue(DummyRational(1, 2) <= F(1, 2))
self.assertFalse(DummyRational(1, 2) <= F(1, 7))
self.assertFalse(DummyRational(1, 2) >= F(3, 4))
self.assertTrue(DummyRational(1, 2) >= F(1, 2))
self.assertTrue(DummyRational(1, 2) >= F(1, 7))
def testComparisonsDummyFloat(self):
x = DummyFloat(1./3.)
y = F(1, 3)
self.assertTrue(x != y)
self.assertTrue(x < y or x > y)
self.assertFalse(x == y)
self.assertFalse(x <= y and x >= y)
self.assertTrue(y != x)
self.assertTrue(y < x or y > x)
self.assertFalse(y == x)
self.assertFalse(y <= x and y >= x)
def testMixedLess(self):
self.assertTrue(2 < F(5, 2))
self.assertFalse(2 < F(4, 2))
self.assertTrue(F(5, 2) < 3)
self.assertFalse(F(4, 2) < 2)
self.assertTrue(F(1, 2) < 0.6)
self.assertFalse(F(1, 2) < 0.4)
self.assertTrue(0.4 < F(1, 2))
self.assertFalse(0.5 < F(1, 2))
self.assertFalse(float('inf') < F(1, 2))
self.assertTrue(float('-inf') < F(0, 10))
self.assertFalse(float('nan') < F(-3, 7))
self.assertTrue(F(1, 2) < float('inf'))
self.assertFalse(F(17, 12) < float('-inf'))
self.assertFalse(F(144, -89) < float('nan'))
def testMixedLessEqual(self):
self.assertTrue(0.5 <= F(1, 2))
self.assertFalse(0.6 <= F(1, 2))
self.assertTrue(F(1, 2) <= 0.5)
self.assertFalse(F(1, 2) <= 0.4)
self.assertTrue(2 <= F(4, 2))
self.assertFalse(2 <= F(3, 2))
self.assertTrue(F(4, 2) <= 2)
self.assertFalse(F(5, 2) <= 2)
self.assertFalse(float('inf') <= F(1, 2))
self.assertTrue(float('-inf') <= F(0, 10))
self.assertFalse(float('nan') <= F(-3, 7))
self.assertTrue(F(1, 2) <= float('inf'))
self.assertFalse(F(17, 12) <= float('-inf'))
self.assertFalse(F(144, -89) <= float('nan'))
def testBigFloatComparisons(self):
# Because 10**23 can't be represented exactly as a float:
self.assertFalse(F(10**23) == float(10**23))
# The first test demonstrates why these are important.
self.assertFalse(1e23 < float(F(math.trunc(1e23) + 1)))
self.assertTrue(1e23 < F(math.trunc(1e23) + 1))
self.assertFalse(1e23 <= F(math.trunc(1e23) - 1))
self.assertTrue(1e23 > F(math.trunc(1e23) - 1))
self.assertFalse(1e23 >= F(math.trunc(1e23) + 1))
def testBigComplexComparisons(self):
self.assertFalse(F(10**23) == complex(10**23))
self.assertTrue(F(10**23) > complex(10**23))
self.assertFalse(F(10**23) <= complex(10**23))
def testMixedEqual(self):
self.assertTrue(0.5 == F(1, 2))
self.assertFalse(0.6 == F(1, 2))
self.assertTrue(F(1, 2) == 0.5)
self.assertFalse(F(1, 2) == 0.4)
self.assertTrue(2 == F(4, 2))
self.assertFalse(2 == F(3, 2))
self.assertTrue(F(4, 2) == 2)
self.assertFalse(F(5, 2) == 2)
self.assertFalse(F(5, 2) == float('nan'))
self.assertFalse(float('nan') == F(3, 7))
self.assertFalse(F(5, 2) == float('inf'))
self.assertFalse(float('-inf') == F(2, 5))
def testStringification(self):
self.assertEquals("Fraction(7, 3)", repr(F(7, 3)))
self.assertEquals("Fraction(6283185307, 2000000000)",
repr(F('3.1415926535')))
self.assertEquals("Fraction(-1, 100000000000000000000)",
repr(F(1, -10**20)))
self.assertEquals("7/3", str(F(7, 3)))
self.assertEquals("7", str(F(7, 1)))
def testHash(self):
self.assertEquals(hash(2.5), hash(F(5, 2)))
self.assertEquals(hash(10**50), hash(F(10**50)))
self.assertNotEquals(hash(float(10**23)), hash(F(10**23)))
def testApproximatePi(self):
# Algorithm borrowed from
# http://docs.python.org/lib/decimal-recipes.html
three = F(3)
lasts, t, s, n, na, d, da = 0, three, 3, 1, 0, 0, 24
while abs(s - lasts) > F(1, 10**9):
lasts = s
n, na = n+na, na+8
d, da = d+da, da+32
t = (t * n) / d
s += t
self.assertAlmostEquals(math.pi, s)
def testApproximateCos1(self):
# Algorithm borrowed from
# http://docs.python.org/lib/decimal-recipes.html
x = F(1)
i, lasts, s, fact, num, sign = 0, 0, F(1), 1, 1, 1
while abs(s - lasts) > F(1, 10**9):
lasts = s
i += 2
fact *= i * (i-1)
num *= x * x
sign *= -1
s += num / fact * sign
self.assertAlmostEquals(math.cos(1), s)
def test_copy_deepcopy_pickle(self):
r = F(13, 7)
self.assertEqual(r, loads(dumps(r)))
self.assertEqual(id(r), id(copy(r)))
self.assertEqual(id(r), id(deepcopy(r)))
def test_slots(self):
# Issue 4998
r = F(13, 7)
self.assertRaises(AttributeError, setattr, r, 'a', 10)
def test_main():
run_unittest(FractionTest, GcdTest)
if __name__ == '__main__':
test_main()
|
mancoast/CPythonPyc_test
|
fail/312_test_fractions.py
|
Python
|
gpl-3.0
| 22,695
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Overview: module code — PyASTRAToolbox 1.6 documentation</title>
<link rel="stylesheet" href="../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '1.6',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="top" title="PyASTRAToolbox 1.6 documentation" href="../index.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li><a href="../index.html">PyASTRAToolbox 1.6 documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<h1>All modules for which code is available</h1>
<ul><li><a href="astra/ASTRAProjector.html">astra.ASTRAProjector</a></li>
<li><a href="astra/algorithm.html">astra.algorithm</a></li>
<li><a href="astra/astra.html">astra.astra</a></li>
<li><a href="astra/creators.html">astra.creators</a></li>
<li><a href="astra/data2d.html">astra.data2d</a></li>
<li><a href="astra/data3d.html">astra.data3d</a></li>
<li><a href="astra/functions.html">astra.functions</a></li>
<li><a href="astra/matlab.html">astra.matlab</a></li>
<li><a href="astra/matrix.html">astra.matrix</a></li>
<li><a href="astra/projector.html">astra.projector</a></li>
</ul>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li><a href="../index.html">PyASTRAToolbox 1.6 documentation</a> »</li>
</ul>
</div>
<div class="footer">
© Copyright 2013, Centrum Wiskunde & Informatica, Amsterdam.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-40340335-1', 'dmpelt.github.io');
ga('send', 'pageview');
</script>
</body>
</html>
|
decarlof/astra-toolbox
|
python/docSRC/_build/html/_modules/index.html
|
HTML
|
gpl-3.0
| 4,230
|
// ===================================================================================================
// _ __ _ _
// | |/ /__ _| | |_ _ _ _ _ __ _
// | ' </ _` | | _| || | '_/ _` |
// |_|\_\__,_|_|\__|\_,_|_| \__,_|
//
// This file is part of the Kaltura Collaborative Media Suite which allows users
// to do with audio, video, and animation what Wiki platfroms allow them to do with
// text.
//
// Copyright (C) 2006-2011 Kaltura Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// @ignore
// ===================================================================================================
using System;
using System.Xml;
using System.Collections.Generic;
namespace Kaltura
{
public class KalturaMetadataProfileFilter : KalturaMetadataProfileBaseFilter
{
#region Private Fields
private KalturaMetadataProfileOrderBy _OrderBy = null;
#endregion
#region Properties
public new KalturaMetadataProfileOrderBy OrderBy
{
get { return _OrderBy; }
set
{
_OrderBy = value;
OnPropertyChanged("OrderBy");
}
}
#endregion
#region CTor
public KalturaMetadataProfileFilter()
{
}
public KalturaMetadataProfileFilter(XmlElement node) : base(node)
{
foreach (XmlElement propertyNode in node.ChildNodes)
{
string txt = propertyNode.InnerText;
switch (propertyNode.Name)
{
case "orderBy":
this.OrderBy = (KalturaMetadataProfileOrderBy)KalturaStringEnum.Parse(typeof(KalturaMetadataProfileOrderBy), txt);
continue;
}
}
}
#endregion
#region Methods
public override KalturaParams ToParams()
{
KalturaParams kparams = base.ToParams();
kparams.AddReplace("objectType", "KalturaMetadataProfileFilter");
kparams.AddStringEnumIfNotNull("orderBy", this.OrderBy);
return kparams;
}
#endregion
}
}
|
buddyfavors/KalturaClient
|
KalturaClient/Types/KalturaMetadataProfileFilter.cs
|
C#
|
gpl-3.0
| 2,536
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
<!-- This file redirects to the location of a node or anchor -->
<head>
<title>GNU Octave: XREFt_test_2</title>
<meta name="description" content="GNU Octave: XREFt_test_2">
<meta name="keywords" content="GNU Octave: XREFt_test_2">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>
<meta http-equiv="Refresh" content="0; url=Tests.html#XREFt_005ftest_005f2">
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<p>The node you are looking for is at <a href="Tests.html#XREFt_005ftest_005f2">XREFt_test_2</a>.</p>
</body>
|
anooprh/GNU-Octave
|
doc/interpreter/octave.html/XREFt_005ftest_005f2.html
|
HTML
|
gpl-3.0
| 1,940
|
/*
* ffmpeg filter configuration
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "ffmpeg.h"
#include "libavfilter/avfilter.h"
#include "libavfilter/avfiltergraph.h"
#include "libavfilter/buffersink.h"
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/bprint.h"
#include "libavutil/channel_layout.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/pixfmt.h"
#include "libavutil/imgutils.h"
#include "libavutil/samplefmt.h"
enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodec *codec, enum AVPixelFormat target)
{
if (codec && codec->pix_fmts) {
const enum AVPixelFormat *p = codec->pix_fmts;
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(target);
int has_alpha = desc ? desc->nb_components % 2 == 0 : 0;
enum AVPixelFormat best= AV_PIX_FMT_NONE;
if (st->codec->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL) {
if (st->codec->codec_id == AV_CODEC_ID_MJPEG) {
p = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE };
} else if (st->codec->codec_id == AV_CODEC_ID_LJPEG) {
p = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUV420P,
AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_BGRA, AV_PIX_FMT_NONE };
}
}
for (; *p != AV_PIX_FMT_NONE; p++) {
best= avcodec_find_best_pix_fmt_of_2(best, *p, target, has_alpha, NULL);
if (*p == target)
break;
}
if (*p == AV_PIX_FMT_NONE) {
if (target != AV_PIX_FMT_NONE)
av_log(NULL, AV_LOG_WARNING,
"Incompatible pixel format '%s' for codec '%s', auto-selecting format '%s'\n",
av_get_pix_fmt_name(target),
codec->name,
av_get_pix_fmt_name(best));
return best;
}
}
return target;
}
void choose_sample_fmt(AVStream *st, AVCodec *codec)
{
if (codec && codec->sample_fmts) {
const enum AVSampleFormat *p = codec->sample_fmts;
for (; *p != -1; p++) {
if (*p == st->codec->sample_fmt)
break;
}
if (*p == -1) {
if((codec->capabilities & CODEC_CAP_LOSSLESS) && av_get_sample_fmt_name(st->codec->sample_fmt) > av_get_sample_fmt_name(codec->sample_fmts[0]))
av_log(NULL, AV_LOG_ERROR, "Conversion will not be lossless.\n");
if(av_get_sample_fmt_name(st->codec->sample_fmt))
av_log(NULL, AV_LOG_WARNING,
"Incompatible sample format '%s' for codec '%s', auto-selecting format '%s'\n",
av_get_sample_fmt_name(st->codec->sample_fmt),
codec->name,
av_get_sample_fmt_name(codec->sample_fmts[0]));
st->codec->sample_fmt = codec->sample_fmts[0];
}
}
}
static char *choose_pix_fmts(OutputStream *ost)
{
if (ost->keep_pix_fmt) {
if (ost->filter)
avfilter_graph_set_auto_convert(ost->filter->graph->graph,
AVFILTER_AUTO_CONVERT_NONE);
if (ost->st->codec->pix_fmt == AV_PIX_FMT_NONE)
return NULL;
return av_strdup(av_get_pix_fmt_name(ost->st->codec->pix_fmt));
}
if (ost->st->codec->pix_fmt != AV_PIX_FMT_NONE) {
return av_strdup(av_get_pix_fmt_name(choose_pixel_fmt(ost->st, ost->enc, ost->st->codec->pix_fmt)));
} else if (ost->enc && ost->enc->pix_fmts) {
const enum AVPixelFormat *p;
AVIOContext *s = NULL;
uint8_t *ret;
int len;
if (avio_open_dyn_buf(&s) < 0)
exit(1);
p = ost->enc->pix_fmts;
if (ost->st->codec->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL) {
if (ost->st->codec->codec_id == AV_CODEC_ID_MJPEG) {
p = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE };
} else if (ost->st->codec->codec_id == AV_CODEC_ID_LJPEG) {
p = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUV420P,
AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_BGRA, AV_PIX_FMT_NONE };
}
}
for (; *p != AV_PIX_FMT_NONE; p++) {
const char *name = av_get_pix_fmt_name(*p);
avio_printf(s, "%s:", name);
}
len = avio_close_dyn_buf(s, &ret);
ret[len - 1] = 0;
return ret;
} else
return NULL;
}
/* Define a function for building a string containing a list of
* allowed formats. */
#define DEF_CHOOSE_FORMAT(type, var, supported_list, none, get_name, separator)\
static char *choose_ ## var ## s(OutputStream *ost) \
{ \
if (ost->st->codec->var != none) { \
get_name(ost->st->codec->var); \
return av_strdup(name); \
} else if (ost->enc->supported_list) { \
const type *p; \
AVIOContext *s = NULL; \
uint8_t *ret; \
int len; \
\
if (avio_open_dyn_buf(&s) < 0) \
exit(1); \
\
for (p = ost->enc->supported_list; *p != none; p++) { \
get_name(*p); \
avio_printf(s, "%s" separator, name); \
} \
len = avio_close_dyn_buf(s, &ret); \
ret[len - 1] = 0; \
return ret; \
} else \
return NULL; \
}
// DEF_CHOOSE_FORMAT(enum AVPixelFormat, pix_fmt, pix_fmts, AV_PIX_FMT_NONE,
// GET_PIX_FMT_NAME, ":")
DEF_CHOOSE_FORMAT(enum AVSampleFormat, sample_fmt, sample_fmts,
AV_SAMPLE_FMT_NONE, GET_SAMPLE_FMT_NAME, ",")
DEF_CHOOSE_FORMAT(int, sample_rate, supported_samplerates, 0,
GET_SAMPLE_RATE_NAME, ",")
DEF_CHOOSE_FORMAT(uint64_t, channel_layout, channel_layouts, 0,
GET_CH_LAYOUT_NAME, ",")
FilterGraph *init_simple_filtergraph(InputStream *ist, OutputStream *ost)
{
FilterGraph *fg = av_mallocz(sizeof(*fg));
if (!fg)
exit(1);
fg->index = nb_filtergraphs;
GROW_ARRAY(fg->outputs, fg->nb_outputs);
if (!(fg->outputs[0] = av_mallocz(sizeof(*fg->outputs[0]))))
exit(1);
fg->outputs[0]->ost = ost;
fg->outputs[0]->graph = fg;
ost->filter = fg->outputs[0];
GROW_ARRAY(fg->inputs, fg->nb_inputs);
if (!(fg->inputs[0] = av_mallocz(sizeof(*fg->inputs[0]))))
exit(1);
fg->inputs[0]->ist = ist;
fg->inputs[0]->graph = fg;
GROW_ARRAY(ist->filters, ist->nb_filters);
ist->filters[ist->nb_filters - 1] = fg->inputs[0];
GROW_ARRAY(filtergraphs, nb_filtergraphs);
filtergraphs[nb_filtergraphs - 1] = fg;
return fg;
}
static void init_input_filter(FilterGraph *fg, AVFilterInOut *in)
{
InputStream *ist = NULL;
enum AVMediaType type = avfilter_pad_get_type(in->filter_ctx->input_pads, in->pad_idx);
int i;
// TODO: support other filter types
if (type != AVMEDIA_TYPE_VIDEO && type != AVMEDIA_TYPE_AUDIO) {
av_log(NULL, AV_LOG_FATAL, "Only video and audio filters supported "
"currently.\n");
exit(1);
}
if (in->name) {
AVFormatContext *s;
AVStream *st = NULL;
char *p;
int file_idx = strtol(in->name, &p, 0);
if (file_idx < 0 || file_idx >= nb_input_files) {
av_log(NULL, AV_LOG_FATAL, "Invalid file index %d in filtergraph description %s.\n",
file_idx, fg->graph_desc);
exit(1);
}
s = input_files[file_idx]->ctx;
for (i = 0; i < s->nb_streams; i++) {
enum AVMediaType stream_type = s->streams[i]->codec->codec_type;
if (stream_type != type &&
!(stream_type == AVMEDIA_TYPE_SUBTITLE &&
type == AVMEDIA_TYPE_VIDEO /* sub2video hack */))
continue;
if (check_stream_specifier(s, s->streams[i], *p == ':' ? p + 1 : p) == 1) {
st = s->streams[i];
break;
}
}
if (!st) {
av_log(NULL, AV_LOG_FATAL, "Stream specifier '%s' in filtergraph description %s "
"matches no streams.\n", p, fg->graph_desc);
exit(1);
}
ist = input_streams[input_files[file_idx]->ist_index + st->index];
} else {
/* find the first unused stream of corresponding type */
for (i = 0; i < nb_input_streams; i++) {
ist = input_streams[i];
if (ist->st->codec->codec_type == type && ist->discard)
break;
}
if (i == nb_input_streams) {
av_log(NULL, AV_LOG_FATAL, "Cannot find a matching stream for "
"unlabeled input pad %d on filter %s\n", in->pad_idx,
in->filter_ctx->name);
exit(1);
}
}
av_assert0(ist);
ist->discard = 0;
ist->decoding_needed++;
ist->st->discard = AVDISCARD_NONE;
GROW_ARRAY(fg->inputs, fg->nb_inputs);
if (!(fg->inputs[fg->nb_inputs - 1] = av_mallocz(sizeof(*fg->inputs[0]))))
exit(1);
fg->inputs[fg->nb_inputs - 1]->ist = ist;
fg->inputs[fg->nb_inputs - 1]->graph = fg;
GROW_ARRAY(ist->filters, ist->nb_filters);
ist->filters[ist->nb_filters - 1] = fg->inputs[fg->nb_inputs - 1];
}
static int configure_output_video_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out)
{
char *pix_fmts;
OutputStream *ost = ofilter->ost;
AVCodecContext *codec = ost->st->codec;
AVFilterContext *last_filter = out->filter_ctx;
int pad_idx = out->pad_idx;
int ret;
char name[255];
AVBufferSinkParams *buffersink_params = av_buffersink_params_alloc();
snprintf(name, sizeof(name), "output stream %d:%d", ost->file_index, ost->index);
ret = avfilter_graph_create_filter(&ofilter->filter,
avfilter_get_by_name("ffbuffersink"),
name, NULL, NULL, fg->graph);
av_freep(&buffersink_params);
if (ret < 0)
return ret;
if (codec->width || codec->height) {
char args[255];
AVFilterContext *filter;
snprintf(args, sizeof(args), "%d:%d:flags=0x%X",
codec->width,
codec->height,
(unsigned)ost->sws_flags);
snprintf(name, sizeof(name), "scaler for output stream %d:%d",
ost->file_index, ost->index);
if ((ret = avfilter_graph_create_filter(&filter, avfilter_get_by_name("scale"),
name, args, NULL, fg->graph)) < 0)
return ret;
if ((ret = avfilter_link(last_filter, pad_idx, filter, 0)) < 0)
return ret;
last_filter = filter;
pad_idx = 0;
}
if ((pix_fmts = choose_pix_fmts(ost))) {
AVFilterContext *filter;
snprintf(name, sizeof(name), "pixel format for output stream %d:%d",
ost->file_index, ost->index);
if ((ret = avfilter_graph_create_filter(&filter,
avfilter_get_by_name("format"),
"format", pix_fmts, NULL,
fg->graph)) < 0)
return ret;
if ((ret = avfilter_link(last_filter, pad_idx, filter, 0)) < 0)
return ret;
last_filter = filter;
pad_idx = 0;
av_freep(&pix_fmts);
}
if (ost->frame_rate.num && 0) {
AVFilterContext *fps;
char args[255];
snprintf(args, sizeof(args), "fps=%d/%d", ost->frame_rate.num,
ost->frame_rate.den);
snprintf(name, sizeof(name), "fps for output stream %d:%d",
ost->file_index, ost->index);
ret = avfilter_graph_create_filter(&fps, avfilter_get_by_name("fps"),
name, args, NULL, fg->graph);
if (ret < 0)
return ret;
ret = avfilter_link(last_filter, pad_idx, fps, 0);
if (ret < 0)
return ret;
last_filter = fps;
pad_idx = 0;
}
if ((ret = avfilter_link(last_filter, pad_idx, ofilter->filter, 0)) < 0)
return ret;
return 0;
}
static int configure_output_audio_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out)
{
OutputStream *ost = ofilter->ost;
AVCodecContext *codec = ost->st->codec;
AVFilterContext *last_filter = out->filter_ctx;
int pad_idx = out->pad_idx;
char *sample_fmts, *sample_rates, *channel_layouts;
char name[255];
int ret;
AVABufferSinkParams *params = av_abuffersink_params_alloc();
if (!params)
return AVERROR(ENOMEM);
params->all_channel_counts = 1;
snprintf(name, sizeof(name), "output stream %d:%d", ost->file_index, ost->index);
ret = avfilter_graph_create_filter(&ofilter->filter,
avfilter_get_by_name("ffabuffersink"),
name, NULL, params, fg->graph);
av_freep(¶ms);
if (ret < 0)
return ret;
#define AUTO_INSERT_FILTER(opt_name, filter_name, arg) do { \
AVFilterContext *filt_ctx; \
\
av_log(NULL, AV_LOG_INFO, opt_name " is forwarded to lavfi " \
"similarly to -af " filter_name "=%s.\n", arg); \
\
ret = avfilter_graph_create_filter(&filt_ctx, \
avfilter_get_by_name(filter_name), \
filter_name, arg, NULL, fg->graph); \
if (ret < 0) \
return ret; \
\
ret = avfilter_link(last_filter, pad_idx, filt_ctx, 0); \
if (ret < 0) \
return ret; \
\
last_filter = filt_ctx; \
pad_idx = 0; \
} while (0)
if (ost->audio_channels_mapped) {
int i;
AVBPrint pan_buf;
av_bprint_init(&pan_buf, 256, 8192);
av_bprintf(&pan_buf, "0x%"PRIx64,
av_get_default_channel_layout(ost->audio_channels_mapped));
for (i = 0; i < ost->audio_channels_mapped; i++)
if (ost->audio_channels_map[i] != -1)
av_bprintf(&pan_buf, ":c%d=c%d", i, ost->audio_channels_map[i]);
AUTO_INSERT_FILTER("-map_channel", "pan", pan_buf.str);
av_bprint_finalize(&pan_buf, NULL);
}
if (codec->channels && !codec->channel_layout)
codec->channel_layout = av_get_default_channel_layout(codec->channels);
sample_fmts = choose_sample_fmts(ost);
sample_rates = choose_sample_rates(ost);
channel_layouts = choose_channel_layouts(ost);
if (sample_fmts || sample_rates || channel_layouts) {
AVFilterContext *format;
char args[256];
args[0] = 0;
if (sample_fmts)
av_strlcatf(args, sizeof(args), "sample_fmts=%s:",
sample_fmts);
if (sample_rates)
av_strlcatf(args, sizeof(args), "sample_rates=%s:",
sample_rates);
if (channel_layouts)
av_strlcatf(args, sizeof(args), "channel_layouts=%s:",
channel_layouts);
av_freep(&sample_fmts);
av_freep(&sample_rates);
av_freep(&channel_layouts);
snprintf(name, sizeof(name), "audio format for output stream %d:%d",
ost->file_index, ost->index);
ret = avfilter_graph_create_filter(&format,
avfilter_get_by_name("aformat"),
name, args, NULL, fg->graph);
if (ret < 0)
return ret;
ret = avfilter_link(last_filter, pad_idx, format, 0);
if (ret < 0)
return ret;
last_filter = format;
pad_idx = 0;
}
if (audio_volume != 256 && 0) {
char args[256];
snprintf(args, sizeof(args), "%f", audio_volume / 256.);
AUTO_INSERT_FILTER("-vol", "volume", args);
}
if ((ret = avfilter_link(last_filter, pad_idx, ofilter->filter, 0)) < 0)
return ret;
return 0;
}
#define DESCRIBE_FILTER_LINK(f, inout, in) \
{ \
AVFilterContext *ctx = inout->filter_ctx; \
AVFilterPad *pads = in ? ctx->input_pads : ctx->output_pads; \
int nb_pads = in ? ctx->input_count : ctx->output_count; \
AVIOContext *pb; \
\
if (avio_open_dyn_buf(&pb) < 0) \
exit(1); \
\
avio_printf(pb, "%s", ctx->filter->name); \
if (nb_pads > 1) \
avio_printf(pb, ":%s", avfilter_pad_get_name(pads, inout->pad_idx));\
avio_w8(pb, 0); \
avio_close_dyn_buf(pb, &f->name); \
}
int configure_output_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out)
{
av_freep(&ofilter->name);
DESCRIBE_FILTER_LINK(ofilter, out, 0);
switch (avfilter_pad_get_type(out->filter_ctx->output_pads, out->pad_idx)) {
case AVMEDIA_TYPE_VIDEO: return configure_output_video_filter(fg, ofilter, out);
case AVMEDIA_TYPE_AUDIO: return configure_output_audio_filter(fg, ofilter, out);
default: av_assert0(0);
}
}
static int sub2video_prepare(InputStream *ist)
{
AVFormatContext *avf = input_files[ist->file_index]->ctx;
int i, ret, w, h;
uint8_t *image[4];
int linesize[4];
/* Compute the size of the canvas for the subtitles stream.
If the subtitles codec has set a size, use it. Otherwise use the
maximum dimensions of the video streams in the same file. */
w = ist->st->codec->width;
h = ist->st->codec->height;
if (!(w && h)) {
for (i = 0; i < avf->nb_streams; i++) {
if (avf->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
w = FFMAX(w, avf->streams[i]->codec->width);
h = FFMAX(h, avf->streams[i]->codec->height);
}
}
if (!(w && h)) {
w = FFMAX(w, 720);
h = FFMAX(h, 576);
}
av_log(avf, AV_LOG_INFO, "sub2video: using %dx%d canvas\n", w, h);
}
ist->sub2video.w = ist->st->codec->width = ist->resample_width = w;
ist->sub2video.h = ist->st->codec->height = ist->resample_height = h;
/* rectangles are AV_PIX_FMT_PAL8, but we have no guarantee that the
palettes for all rectangles are identical or compatible */
ist->st->codec->pix_fmt = AV_PIX_FMT_RGB32;
ret = av_image_alloc(image, linesize, w, h, AV_PIX_FMT_RGB32, 32);
if (ret < 0)
return ret;
memset(image[0], 0, h * linesize[0]);
ist->sub2video.ref = avfilter_get_video_buffer_ref_from_arrays(
image, linesize, AV_PERM_READ | AV_PERM_PRESERVE,
w, h, AV_PIX_FMT_RGB32);
if (!ist->sub2video.ref) {
av_free(image[0]);
return AVERROR(ENOMEM);
}
return 0;
}
static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
AVFilterInOut *in)
{
AVFilterContext *first_filter = in->filter_ctx;
AVFilter *filter = avfilter_get_by_name("buffer");
InputStream *ist = ifilter->ist;
AVRational tb = ist->framerate.num ? av_inv_q(ist->framerate) :
ist->st->time_base;
AVRational fr = ist->framerate.num ? ist->framerate :
ist->st->r_frame_rate;
AVRational sar;
AVBPrint args;
char name[255];
int pad_idx = in->pad_idx;
int ret;
if (!ist->framerate.num && ist->st->codec->ticks_per_frame>1) {
AVRational codec_fr = av_inv_q(ist->st->codec->time_base);
AVRational avg_fr = ist->st->avg_frame_rate;
codec_fr.den *= ist->st->codec->ticks_per_frame;
if ( codec_fr.num>0 && codec_fr.den>0 && av_q2d(codec_fr) < av_q2d(fr)*0.7
&& fabs(1.0 - av_q2d(av_div_q(avg_fr, fr)))>0.1)
fr = codec_fr;
}
if (ist->st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) {
ret = sub2video_prepare(ist);
if (ret < 0)
return ret;
}
sar = ist->st->sample_aspect_ratio.num ?
ist->st->sample_aspect_ratio :
ist->st->codec->sample_aspect_ratio;
if(!sar.den)
sar = (AVRational){0,1};
av_bprint_init(&args, 0, 1);
av_bprintf(&args,
"video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:"
"pixel_aspect=%d/%d:sws_param=flags=%d", ist->resample_width,
ist->resample_height, ist->resample_pix_fmt,
tb.num, tb.den, sar.num, sar.den,
SWS_BILINEAR + ((ist->st->codec->flags&CODEC_FLAG_BITEXACT) ? SWS_BITEXACT:0));
if (fr.num && fr.den)
av_bprintf(&args, ":frame_rate=%d/%d", fr.num, fr.den);
snprintf(name, sizeof(name), "graph %d input from stream %d:%d", fg->index,
ist->file_index, ist->st->index);
if ((ret = avfilter_graph_create_filter(&ifilter->filter, filter, name,
args.str, NULL, fg->graph)) < 0)
return ret;
if (ist->framerate.num) {
AVFilterContext *setpts;
snprintf(name, sizeof(name), "force CFR for input from stream %d:%d",
ist->file_index, ist->st->index);
if ((ret = avfilter_graph_create_filter(&setpts,
avfilter_get_by_name("setpts"),
name, "N", NULL,
fg->graph)) < 0)
return ret;
if ((ret = avfilter_link(setpts, 0, first_filter, pad_idx)) < 0)
return ret;
first_filter = setpts;
pad_idx = 0;
}
if ((ret = avfilter_link(ifilter->filter, 0, first_filter, pad_idx)) < 0)
return ret;
return 0;
}
static int configure_input_audio_filter(FilterGraph *fg, InputFilter *ifilter,
AVFilterInOut *in)
{
AVFilterContext *first_filter = in->filter_ctx;
AVFilter *filter = avfilter_get_by_name("abuffer");
InputStream *ist = ifilter->ist;
int pad_idx = in->pad_idx;
AVBPrint args;
char name[255];
int ret;
av_bprint_init(&args, 0, AV_BPRINT_SIZE_AUTOMATIC);
av_bprintf(&args, "time_base=%d/%d:sample_rate=%d:sample_fmt=%s",
1, ist->st->codec->sample_rate,
ist->st->codec->sample_rate,
av_get_sample_fmt_name(ist->st->codec->sample_fmt));
if (ist->st->codec->channel_layout)
av_bprintf(&args, ":channel_layout=0x%"PRIx64,
ist->st->codec->channel_layout);
else
av_bprintf(&args, ":channels=%d", ist->st->codec->channels);
snprintf(name, sizeof(name), "graph %d input from stream %d:%d", fg->index,
ist->file_index, ist->st->index);
if ((ret = avfilter_graph_create_filter(&ifilter->filter, filter,
name, args.str, NULL,
fg->graph)) < 0)
return ret;
#define AUTO_INSERT_FILTER_INPUT(opt_name, filter_name, arg) do { \
AVFilterContext *filt_ctx; \
\
av_log(NULL, AV_LOG_INFO, opt_name " is forwarded to lavfi " \
"similarly to -af " filter_name "=%s.\n", arg); \
\
snprintf(name, sizeof(name), "graph %d %s for input stream %d:%d", \
fg->index, filter_name, ist->file_index, ist->st->index); \
ret = avfilter_graph_create_filter(&filt_ctx, \
avfilter_get_by_name(filter_name), \
name, arg, NULL, fg->graph); \
if (ret < 0) \
return ret; \
\
ret = avfilter_link(filt_ctx, 0, first_filter, pad_idx); \
if (ret < 0) \
return ret; \
\
first_filter = filt_ctx; \
} while (0)
if (audio_sync_method > 0) {
char args[256] = {0};
av_strlcatf(args, sizeof(args), "async=%d", audio_sync_method);
if (audio_drift_threshold != 0.1)
av_strlcatf(args, sizeof(args), ":min_hard_comp=%f", audio_drift_threshold);
AUTO_INSERT_FILTER_INPUT("-async", "aresample", args);
}
// if (ost->audio_channels_mapped) {
// int i;
// AVBPrint pan_buf;
// av_bprint_init(&pan_buf, 256, 8192);
// av_bprintf(&pan_buf, "0x%"PRIx64,
// av_get_default_channel_layout(ost->audio_channels_mapped));
// for (i = 0; i < ost->audio_channels_mapped; i++)
// if (ost->audio_channels_map[i] != -1)
// av_bprintf(&pan_buf, ":c%d=c%d", i, ost->audio_channels_map[i]);
// AUTO_INSERT_FILTER_INPUT("-map_channel", "pan", pan_buf.str);
// av_bprint_finalize(&pan_buf, NULL);
// }
if (audio_volume != 256) {
char args[256];
av_log(NULL, AV_LOG_WARNING, "-vol has been deprecated. Use the volume "
"audio filter instead.\n");
snprintf(args, sizeof(args), "%f", audio_volume / 256.);
AUTO_INSERT_FILTER_INPUT("-vol", "volume", args);
}
if ((ret = avfilter_link(ifilter->filter, 0, first_filter, pad_idx)) < 0)
return ret;
return 0;
}
static int configure_input_filter(FilterGraph *fg, InputFilter *ifilter,
AVFilterInOut *in)
{
av_freep(&ifilter->name);
DESCRIBE_FILTER_LINK(ifilter, in, 1);
switch (avfilter_pad_get_type(in->filter_ctx->input_pads, in->pad_idx)) {
case AVMEDIA_TYPE_VIDEO: return configure_input_video_filter(fg, ifilter, in);
case AVMEDIA_TYPE_AUDIO: return configure_input_audio_filter(fg, ifilter, in);
default: av_assert0(0);
}
}
int configure_filtergraph(FilterGraph *fg)
{
AVFilterInOut *inputs, *outputs, *cur;
int ret, i, init = !fg->graph, simple = !fg->graph_desc;
const char *graph_desc = simple ? fg->outputs[0]->ost->avfilter :
fg->graph_desc;
avfilter_graph_free(&fg->graph);
if (!(fg->graph = avfilter_graph_alloc()))
return AVERROR(ENOMEM);
if (simple) {
OutputStream *ost = fg->outputs[0]->ost;
char args[255];
snprintf(args, sizeof(args), "flags=0x%X", (unsigned)ost->sws_flags);
fg->graph->scale_sws_opts = av_strdup(args);
args[0] = 0;
if (ost->swr_filter_type != SWR_FILTER_TYPE_KAISER)
av_strlcatf(args, sizeof(args), "filter_type=%d:", (int)ost->swr_filter_type);
if (ost->swr_dither_method)
av_strlcatf(args, sizeof(args), "dither_method=%d:", (int)ost->swr_dither_method);
if (ost->swr_dither_scale != 1.0)
av_strlcatf(args, sizeof(args), "dither_scale=%f:", ost->swr_dither_scale);
if (strlen(args))
args[strlen(args)-1] = 0;
av_opt_set(fg->graph, "aresample_swr_opts", args, 0);
}
if ((ret = avfilter_graph_parse2(fg->graph, graph_desc, &inputs, &outputs)) < 0)
return ret;
if (simple && (!inputs || inputs->next || !outputs || outputs->next)) {
av_log(NULL, AV_LOG_ERROR, "Simple filtergraph '%s' does not have "
"exactly one input and output.\n", graph_desc);
return AVERROR(EINVAL);
}
for (cur = inputs; !simple && init && cur; cur = cur->next)
init_input_filter(fg, cur);
for (cur = inputs, i = 0; cur; cur = cur->next, i++)
if ((ret = configure_input_filter(fg, fg->inputs[i], cur)) < 0)
return ret;
avfilter_inout_free(&inputs);
if (!init || simple) {
/* we already know the mappings between lavfi outputs and output streams,
* so we can finish the setup */
for (cur = outputs, i = 0; cur; cur = cur->next, i++)
configure_output_filter(fg, fg->outputs[i], cur);
avfilter_inout_free(&outputs);
if ((ret = avfilter_graph_config(fg->graph, NULL)) < 0)
return ret;
} else {
/* wait until output mappings are processed */
for (cur = outputs; cur;) {
GROW_ARRAY(fg->outputs, fg->nb_outputs);
if (!(fg->outputs[fg->nb_outputs - 1] = av_mallocz(sizeof(*fg->outputs[0]))))
exit(1);
fg->outputs[fg->nb_outputs - 1]->graph = fg;
fg->outputs[fg->nb_outputs - 1]->out_tmp = cur;
cur = cur->next;
fg->outputs[fg->nb_outputs - 1]->out_tmp->next = NULL;
}
}
return 0;
}
int ist_in_filtergraph(FilterGraph *fg, InputStream *ist)
{
int i;
for (i = 0; i < fg->nb_inputs; i++)
if (fg->inputs[i]->ist == ist)
return 1;
return 0;
}
|
Ivnz/iFrameExtracotrWithFFMPEG
|
ffmpeg/ffmpeg_filter.c
|
C
|
gpl-3.0
| 32,697
|
import _surface
import chimera
try:
import chimera.runCommand
except:
pass
from VolumePath import markerset as ms
try:
from VolumePath import Marker_Set, Link
new_marker_set=Marker_Set
except:
from VolumePath import volume_path_dialog
d= volume_path_dialog(True)
new_marker_set= d.new_marker_set
marker_sets={}
surf_sets={}
if "particle_0 geometry" not in marker_sets:
s=new_marker_set('particle_0 geometry')
marker_sets["particle_0 geometry"]=s
s= marker_sets["particle_0 geometry"]
mark=s.place_marker((3171.68, 9029.21, -1139.01), (0.7, 0.7, 0.7), 890.203)
if "particle_1 geometry" not in marker_sets:
s=new_marker_set('particle_1 geometry')
marker_sets["particle_1 geometry"]=s
s= marker_sets["particle_1 geometry"]
mark=s.place_marker((3173.32, 7641.65, -7.59267), (0.7, 0.7, 0.7), 792.956)
if "particle_2 geometry" not in marker_sets:
s=new_marker_set('particle_2 geometry')
marker_sets["particle_2 geometry"]=s
s= marker_sets["particle_2 geometry"]
mark=s.place_marker((3803.4, 8043.31, 1799.07), (0.7, 0.7, 0.7), 856.786)
if "particle_3 geometry" not in marker_sets:
s=new_marker_set('particle_3 geometry')
marker_sets["particle_3 geometry"]=s
s= marker_sets["particle_3 geometry"]
mark=s.place_marker((2666.72, 9556.45, 456.26), (0.7, 0.7, 0.7), 963.679)
if "particle_4 geometry" not in marker_sets:
s=new_marker_set('particle_4 geometry')
marker_sets["particle_4 geometry"]=s
s= marker_sets["particle_4 geometry"]
mark=s.place_marker((2401.45, 10810.3, 1711.38), (0.7, 0.7, 0.7), 761.442)
if "particle_5 geometry" not in marker_sets:
s=new_marker_set('particle_5 geometry')
marker_sets["particle_5 geometry"]=s
s= marker_sets["particle_5 geometry"]
mark=s.place_marker((3826.97, 10319.9, 3558.07), (0.7, 0.7, 0.7), 961.183)
if "particle_6 geometry" not in marker_sets:
s=new_marker_set('particle_6 geometry')
marker_sets["particle_6 geometry"]=s
s= marker_sets["particle_6 geometry"]
mark=s.place_marker((5267.4, 10161.5, 4525.44), (0.7, 0.7, 0.7), 753.151)
if "particle_7 geometry" not in marker_sets:
s=new_marker_set('particle_7 geometry')
marker_sets["particle_7 geometry"]=s
s= marker_sets["particle_7 geometry"]
mark=s.place_marker((4933.12, 10729, 4046.72), (1, 0.7, 0), 1098.07)
if "particle_8 geometry" not in marker_sets:
s=new_marker_set('particle_8 geometry')
marker_sets["particle_8 geometry"]=s
s= marker_sets["particle_8 geometry"]
mark=s.place_marker((6683.05, 9391.65, 5497.93), (0.7, 0.7, 0.7), 1010.42)
if "particle_9 geometry" not in marker_sets:
s=new_marker_set('particle_9 geometry')
marker_sets["particle_9 geometry"]=s
s= marker_sets["particle_9 geometry"]
mark=s.place_marker((8208.82, 10014.2, 5535.15), (1, 0.7, 0), 821.043)
if "particle_10 geometry" not in marker_sets:
s=new_marker_set('particle_10 geometry')
marker_sets["particle_10 geometry"]=s
s= marker_sets["particle_10 geometry"]
mark=s.place_marker((8867.56, 8468.95, 6393.47), (0.7, 0.7, 0.7), 873.876)
if "particle_11 geometry" not in marker_sets:
s=new_marker_set('particle_11 geometry')
marker_sets["particle_11 geometry"]=s
s= marker_sets["particle_11 geometry"]
mark=s.place_marker((8619.61, 7593.49, 5646.83), (0.7, 0.7, 0.7), 625.532)
if "particle_12 geometry" not in marker_sets:
s=new_marker_set('particle_12 geometry')
marker_sets["particle_12 geometry"]=s
s= marker_sets["particle_12 geometry"]
mark=s.place_marker((9013.94, 6288.27, 4803.55), (0.7, 0.7, 0.7), 880.474)
if "particle_13 geometry" not in marker_sets:
s=new_marker_set('particle_13 geometry')
marker_sets["particle_13 geometry"]=s
s= marker_sets["particle_13 geometry"]
mark=s.place_marker((8872.4, 7041.74, 3460.97), (0.7, 0.7, 0.7), 659.161)
if "particle_14 geometry" not in marker_sets:
s=new_marker_set('particle_14 geometry')
marker_sets["particle_14 geometry"]=s
s= marker_sets["particle_14 geometry"]
mark=s.place_marker((10190.2, 5903.46, 2028.9), (0.7, 0.7, 0.7), 831.745)
if "particle_15 geometry" not in marker_sets:
s=new_marker_set('particle_15 geometry')
marker_sets["particle_15 geometry"]=s
s= marker_sets["particle_15 geometry"]
mark=s.place_marker((9719.44, 3094.41, 731.581), (0.7, 0.7, 0.7), 803.065)
if "particle_16 geometry" not in marker_sets:
s=new_marker_set('particle_16 geometry')
marker_sets["particle_16 geometry"]=s
s= marker_sets["particle_16 geometry"]
mark=s.place_marker((8077.39, 2602.05, 1658.32), (0.7, 0.7, 0.7), 610.262)
if "particle_17 geometry" not in marker_sets:
s=new_marker_set('particle_17 geometry')
marker_sets["particle_17 geometry"]=s
s= marker_sets["particle_17 geometry"]
mark=s.place_marker((8868.48, 2528.27, 2892.63), (0.7, 0.7, 0.7), 741.265)
if "particle_18 geometry" not in marker_sets:
s=new_marker_set('particle_18 geometry')
marker_sets["particle_18 geometry"]=s
s= marker_sets["particle_18 geometry"]
mark=s.place_marker((9165.75, 3921.61, 3841.11), (0.7, 0.7, 0.7), 748.625)
if "particle_19 geometry" not in marker_sets:
s=new_marker_set('particle_19 geometry')
marker_sets["particle_19 geometry"]=s
s= marker_sets["particle_19 geometry"]
mark=s.place_marker((10301.5, 4486.01, 4688.54), (0.7, 0.7, 0.7), 677.181)
if "particle_20 geometry" not in marker_sets:
s=new_marker_set('particle_20 geometry')
marker_sets["particle_20 geometry"]=s
s= marker_sets["particle_20 geometry"]
mark=s.place_marker((8522.51, 5837.01, 5636.16), (0.7, 0.7, 0.7), 616.015)
if "particle_21 geometry" not in marker_sets:
s=new_marker_set('particle_21 geometry')
marker_sets["particle_21 geometry"]=s
s= marker_sets["particle_21 geometry"]
mark=s.place_marker((9493.49, 4172.69, 4953.76), (0.7, 0.7, 0.7), 653.154)
if "particle_22 geometry" not in marker_sets:
s=new_marker_set('particle_22 geometry')
marker_sets["particle_22 geometry"]=s
s= marker_sets["particle_22 geometry"]
mark=s.place_marker((9034.89, 3774.53, 5847.71), (0.7, 0.7, 0.7), 595.33)
if "particle_23 geometry" not in marker_sets:
s=new_marker_set('particle_23 geometry')
marker_sets["particle_23 geometry"]=s
s= marker_sets["particle_23 geometry"]
mark=s.place_marker((8777.35, 2523.89, 5440.65), (0.7, 0.7, 0.7), 627.901)
if "particle_24 geometry" not in marker_sets:
s=new_marker_set('particle_24 geometry')
marker_sets["particle_24 geometry"]=s
s= marker_sets["particle_24 geometry"]
mark=s.place_marker((8573.36, 2540.82, 4012.57), (0.7, 0.7, 0.7), 663.941)
if "particle_25 geometry" not in marker_sets:
s=new_marker_set('particle_25 geometry')
marker_sets["particle_25 geometry"]=s
s= marker_sets["particle_25 geometry"]
mark=s.place_marker((8998.9, 1643.92, 2683.61), (0.7, 0.7, 0.7), 663.899)
if "particle_26 geometry" not in marker_sets:
s=new_marker_set('particle_26 geometry')
marker_sets["particle_26 geometry"]=s
s= marker_sets["particle_26 geometry"]
mark=s.place_marker((8990.55, 2742.59, 3735.47), (0.7, 0.7, 0.7), 644.694)
if "particle_27 geometry" not in marker_sets:
s=new_marker_set('particle_27 geometry')
marker_sets["particle_27 geometry"]=s
s= marker_sets["particle_27 geometry"]
mark=s.place_marker((8309.5, 4779.28, 4133.88), (0.7, 0.7, 0.7), 896.802)
if "particle_28 geometry" not in marker_sets:
s=new_marker_set('particle_28 geometry')
marker_sets["particle_28 geometry"]=s
s= marker_sets["particle_28 geometry"]
mark=s.place_marker((8469.04, 4310.3, 5552.9), (0.7, 0.7, 0.7), 576.38)
if "particle_29 geometry" not in marker_sets:
s=new_marker_set('particle_29 geometry')
marker_sets["particle_29 geometry"]=s
s= marker_sets["particle_29 geometry"]
mark=s.place_marker((8405.08, 5264.39, 6396.31), (0.7, 0.7, 0.7), 635.092)
if "particle_30 geometry" not in marker_sets:
s=new_marker_set('particle_30 geometry')
marker_sets["particle_30 geometry"]=s
s= marker_sets["particle_30 geometry"]
mark=s.place_marker((8116.19, 4748.65, 6198.76), (0.7, 0.7, 0.7), 651.505)
if "particle_31 geometry" not in marker_sets:
s=new_marker_set('particle_31 geometry')
marker_sets["particle_31 geometry"]=s
s= marker_sets["particle_31 geometry"]
mark=s.place_marker((8458.16, 6381.13, 5980.73), (0.7, 0.7, 0.7), 718.042)
if "particle_32 geometry" not in marker_sets:
s=new_marker_set('particle_32 geometry')
marker_sets["particle_32 geometry"]=s
s= marker_sets["particle_32 geometry"]
mark=s.place_marker((9198.38, 4960.14, 6673.69), (0.7, 0.7, 0.7), 726.714)
if "particle_33 geometry" not in marker_sets:
s=new_marker_set('particle_33 geometry')
marker_sets["particle_33 geometry"]=s
s= marker_sets["particle_33 geometry"]
mark=s.place_marker((8369.35, 3853.39, 6088.2), (0.7, 0.7, 0.7), 673.585)
if "particle_34 geometry" not in marker_sets:
s=new_marker_set('particle_34 geometry')
marker_sets["particle_34 geometry"]=s
s= marker_sets["particle_34 geometry"]
mark=s.place_marker((8954.58, 3356.37, 5028.9), (0.7, 0.7, 0.7), 598.418)
if "particle_35 geometry" not in marker_sets:
s=new_marker_set('particle_35 geometry')
marker_sets["particle_35 geometry"]=s
s= marker_sets["particle_35 geometry"]
mark=s.place_marker((9942.46, 2604.05, 4445.91), (0.7, 0.7, 0.7), 693.382)
if "particle_36 geometry" not in marker_sets:
s=new_marker_set('particle_36 geometry')
marker_sets["particle_36 geometry"]=s
s= marker_sets["particle_36 geometry"]
mark=s.place_marker((8717.21, 4559.17, 5253.99), (0.7, 0.7, 0.7), 804.038)
if "particle_37 geometry" not in marker_sets:
s=new_marker_set('particle_37 geometry')
marker_sets["particle_37 geometry"]=s
s= marker_sets["particle_37 geometry"]
mark=s.place_marker((9086.66, 2734.02, 4935.49), (0.7, 0.7, 0.7), 816.178)
if "particle_38 geometry" not in marker_sets:
s=new_marker_set('particle_38 geometry')
marker_sets["particle_38 geometry"]=s
s= marker_sets["particle_38 geometry"]
mark=s.place_marker((8554.69, 3256.13, 5181.72), (0.7, 0.7, 0.7), 776.628)
if "particle_39 geometry" not in marker_sets:
s=new_marker_set('particle_39 geometry')
marker_sets["particle_39 geometry"]=s
s= marker_sets["particle_39 geometry"]
mark=s.place_marker((9247.67, 3166.59, 6786.78), (0.7, 0.7, 0.7), 750.656)
if "particle_40 geometry" not in marker_sets:
s=new_marker_set('particle_40 geometry')
marker_sets["particle_40 geometry"]=s
s= marker_sets["particle_40 geometry"]
mark=s.place_marker((8475.56, 4449.18, 7763.97), (0.7, 0.7, 0.7), 709.625)
if "particle_41 geometry" not in marker_sets:
s=new_marker_set('particle_41 geometry')
marker_sets["particle_41 geometry"]=s
s= marker_sets["particle_41 geometry"]
mark=s.place_marker((8596.68, 5576.75, 9330.28), (0.7, 0.7, 0.7), 927.681)
if "particle_42 geometry" not in marker_sets:
s=new_marker_set('particle_42 geometry')
marker_sets["particle_42 geometry"]=s
s= marker_sets["particle_42 geometry"]
mark=s.place_marker((8343.23, 4423.75, 11822.2), (0.7, 0.7, 0.7), 1088.21)
if "particle_43 geometry" not in marker_sets:
s=new_marker_set('particle_43 geometry')
marker_sets["particle_43 geometry"]=s
s= marker_sets["particle_43 geometry"]
mark=s.place_marker((7645.23, 6310.08, 11514.1), (0.7, 0.7, 0.7), 736.147)
if "particle_44 geometry" not in marker_sets:
s=new_marker_set('particle_44 geometry')
marker_sets["particle_44 geometry"]=s
s= marker_sets["particle_44 geometry"]
mark=s.place_marker((7651.25, 5112.44, 10427.6), (0.7, 0.7, 0.7), 861.101)
if "particle_45 geometry" not in marker_sets:
s=new_marker_set('particle_45 geometry')
marker_sets["particle_45 geometry"]=s
s= marker_sets["particle_45 geometry"]
mark=s.place_marker((7252.38, 5829.06, 8673.58), (0.7, 0.7, 0.7), 924.213)
if "particle_46 geometry" not in marker_sets:
s=new_marker_set('particle_46 geometry')
marker_sets["particle_46 geometry"]=s
s= marker_sets["particle_46 geometry"]
mark=s.place_marker((5822.24, 4545.28, 9000.62), (0.7, 0.7, 0.7), 881.828)
if "particle_47 geometry" not in marker_sets:
s=new_marker_set('particle_47 geometry')
marker_sets["particle_47 geometry"]=s
s= marker_sets["particle_47 geometry"]
mark=s.place_marker((7049.07, 3628.54, 10363), (0.7, 0.7, 0.7), 927.681)
if "particle_48 geometry" not in marker_sets:
s=new_marker_set('particle_48 geometry')
marker_sets["particle_48 geometry"]=s
s= marker_sets["particle_48 geometry"]
mark=s.place_marker((5790.73, 4510.11, 9353.05), (0.7, 0.7, 0.7), 831.576)
if "particle_49 geometry" not in marker_sets:
s=new_marker_set('particle_49 geometry')
marker_sets["particle_49 geometry"]=s
s= marker_sets["particle_49 geometry"]
mark=s.place_marker((5336.85, 5999.02, 8251.6), (0.7, 0.7, 0.7), 859.494)
if "particle_50 geometry" not in marker_sets:
s=new_marker_set('particle_50 geometry')
marker_sets["particle_50 geometry"]=s
s= marker_sets["particle_50 geometry"]
mark=s.place_marker((5443.04, 6367.25, 9673.41), (0.7, 0.7, 0.7), 704.845)
if "particle_51 geometry" not in marker_sets:
s=new_marker_set('particle_51 geometry')
marker_sets["particle_51 geometry"]=s
s= marker_sets["particle_51 geometry"]
mark=s.place_marker((5998.57, 6987.2, 8170.17), (0.7, 0.7, 0.7), 804.461)
if "particle_52 geometry" not in marker_sets:
s=new_marker_set('particle_52 geometry')
marker_sets["particle_52 geometry"]=s
s= marker_sets["particle_52 geometry"]
mark=s.place_marker((6305.8, 7375.7, 6388.49), (0.7, 0.7, 0.7), 934.111)
if "particle_53 geometry" not in marker_sets:
s=new_marker_set('particle_53 geometry')
marker_sets["particle_53 geometry"]=s
s= marker_sets["particle_53 geometry"]
mark=s.place_marker((6187.92, 8875.01, 6747.26), (0.7, 0.7, 0.7), 988.339)
if "particle_54 geometry" not in marker_sets:
s=new_marker_set('particle_54 geometry')
marker_sets["particle_54 geometry"]=s
s= marker_sets["particle_54 geometry"]
mark=s.place_marker((5813.94, 8918.86, 7379.07), (1, 0.7, 0), 803.7)
if "particle_55 geometry" not in marker_sets:
s=new_marker_set('particle_55 geometry')
marker_sets["particle_55 geometry"]=s
s= marker_sets["particle_55 geometry"]
mark=s.place_marker((5344.98, 6850.66, 7496.74), (0.7, 0.7, 0.7), 812.118)
if "particle_56 geometry" not in marker_sets:
s=new_marker_set('particle_56 geometry')
marker_sets["particle_56 geometry"]=s
s= marker_sets["particle_56 geometry"]
mark=s.place_marker((3547.24, 6649.15, 6261.57), (0.7, 0.7, 0.7), 1177.93)
if "particle_57 geometry" not in marker_sets:
s=new_marker_set('particle_57 geometry')
marker_sets["particle_57 geometry"]=s
s= marker_sets["particle_57 geometry"]
mark=s.place_marker((1739.99, 4938.35, 5834.09), (0.7, 0.7, 0.7), 1038.21)
if "particle_58 geometry" not in marker_sets:
s=new_marker_set('particle_58 geometry')
marker_sets["particle_58 geometry"]=s
s= marker_sets["particle_58 geometry"]
mark=s.place_marker((1359.58, 4478.74, 5766.47), (1, 0.7, 0), 758.016)
if "particle_59 geometry" not in marker_sets:
s=new_marker_set('particle_59 geometry')
marker_sets["particle_59 geometry"]=s
s= marker_sets["particle_59 geometry"]
mark=s.place_marker((962.469, 5161.48, 5521.67), (0.7, 0.7, 0.7), 824.046)
if "particle_60 geometry" not in marker_sets:
s=new_marker_set('particle_60 geometry')
marker_sets["particle_60 geometry"]=s
s= marker_sets["particle_60 geometry"]
mark=s.place_marker((1623.11, 5203.75, 5999.69), (0.7, 0.7, 0.7), 793.379)
if "particle_61 geometry" not in marker_sets:
s=new_marker_set('particle_61 geometry')
marker_sets["particle_61 geometry"]=s
s= marker_sets["particle_61 geometry"]
mark=s.place_marker((908.239, 5438.28, 6510.08), (0.7, 0.7, 0.7), 1011.56)
if "particle_62 geometry" not in marker_sets:
s=new_marker_set('particle_62 geometry')
marker_sets["particle_62 geometry"]=s
s= marker_sets["particle_62 geometry"]
mark=s.place_marker((2722.36, 5848.41, 6088.2), (0.7, 0.7, 0.7), 1097.01)
if "particle_63 geometry" not in marker_sets:
s=new_marker_set('particle_63 geometry')
marker_sets["particle_63 geometry"]=s
s= marker_sets["particle_63 geometry"]
mark=s.place_marker((844.664, 6076.2, 6217.11), (0.7, 0.7, 0.7), 851.626)
if "particle_64 geometry" not in marker_sets:
s=new_marker_set('particle_64 geometry')
marker_sets["particle_64 geometry"]=s
s= marker_sets["particle_64 geometry"]
mark=s.place_marker((-1152.26, 5619.77, 6199.34), (0.7, 0.7, 0.7), 869.434)
if "particle_65 geometry" not in marker_sets:
s=new_marker_set('particle_65 geometry')
marker_sets["particle_65 geometry"]=s
s= marker_sets["particle_65 geometry"]
mark=s.place_marker((-307.851, 5766.97, 7789.24), (0.7, 0.7, 0.7), 818.463)
if "particle_66 geometry" not in marker_sets:
s=new_marker_set('particle_66 geometry')
marker_sets["particle_66 geometry"]=s
s= marker_sets["particle_66 geometry"]
mark=s.place_marker((-820.689, 4185.61, 7920.82), (0.7, 0.7, 0.7), 759.539)
if "particle_67 geometry" not in marker_sets:
s=new_marker_set('particle_67 geometry')
marker_sets["particle_67 geometry"]=s
s= marker_sets["particle_67 geometry"]
mark=s.place_marker((1117.85, 5548.01, 7239.77), (0.7, 0.7, 0.7), 1088.59)
if "particle_68 geometry" not in marker_sets:
s=new_marker_set('particle_68 geometry')
marker_sets["particle_68 geometry"]=s
s= marker_sets["particle_68 geometry"]
mark=s.place_marker((-696.022, 5054.33, 6438.05), (0.7, 0.7, 0.7), 822.312)
if "particle_69 geometry" not in marker_sets:
s=new_marker_set('particle_69 geometry')
marker_sets["particle_69 geometry"]=s
s= marker_sets["particle_69 geometry"]
mark=s.place_marker((-1176.59, 3758.02, 7301.85), (0.7, 0.7, 0.7), 749.81)
if "particle_70 geometry" not in marker_sets:
s=new_marker_set('particle_70 geometry')
marker_sets["particle_70 geometry"]=s
s= marker_sets["particle_70 geometry"]
mark=s.place_marker((185.745, 3054.8, 7200.01), (0.7, 0.7, 0.7), 764.488)
for k in surf_sets.keys():
chimera.openModels.add([surf_sets[k]])
|
batxes/4Cin
|
SHH_WT_models/SHH_WT_models_final_output_0.1_-0.1_11000/SHH_WT_models12702.py
|
Python
|
gpl-3.0
| 17,583
|
//
// BAGEL - Brilliantly Advanced General Electronic Structure Library
// Filename: rnbatch.h
// Copyright (C) 2012 Toru Shiozaki
//
// Author: Hai-Anh Le <anh@u.northwestern.edu>
// Maintainer: Shiozaki group
//
// This file is part of the BAGEL package.
//
// 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 __SRC_RYSINT_RNBATCH_H
#define __SRC_RYSINT_RNBATCH_H
#include <src/integral/rys/coulombbatch_energy.h>
namespace bagel {
class RnBatch: public CoulombBatch_energy {
protected:
int get_max_rterms() const {
int out = 0;
for (auto& aiter : mol_->atoms())
if (aiter->use_ecp_basis())
if (aiter->ecp_parameters()->shell_maxl_ecp()->ecp_exponents().size() > out)
out = aiter->ecp_parameters()->shell_maxl_ecp()->ecp_exponents().size();
return out;
}
public:
RnBatch(const std::array<std::shared_ptr<const Shell>,2>& _info,
const std::shared_ptr<const Molecule> mol, std::shared_ptr<StackMem> stack = nullptr)
: CoulombBatch_energy (_info, mol, stack) {
max_rterms_ = get_max_rterms();
this->allocate_arrays(primsize_ * natom_ * max_rterms_);
}
~RnBatch() { }
};
}
#endif
|
nubakery/bagel
|
src/integral/rys/rnbatch.h
|
C
|
gpl-3.0
| 1,798
|
<?php
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Persistent\Controller\Index;
use Magento\Persistent\Controller\Index;
use Magento\Framework\Controller\ResultFactory;
/**
* @codeCoverageIgnore
*/
class ExpressCheckout extends Index
{
/**
* Add appropriate session message and redirect to shopping cart
*
* @return \Magento\Framework\Controller\Result\Redirect
*/
public function execute()
{
$this->messageManager->addNotice(__('Your shopping cart has been updated with new prices.'));
/** @var \Magento\Framework\Controller\Result\Redirect $resultRedirect */
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
$resultRedirect->setPath('checkout/cart');
return $resultRedirect;
}
}
|
rajmahesh/magento2-master
|
vendor/magento/module-persistent/Controller/Index/ExpressCheckout.php
|
PHP
|
gpl-3.0
| 862
|
package layout;
/*<applet code= MyGridBag width = 500 height = 500>
</applet>
*/
import java.awt.*;
import java.applet.Applet;
public class MyGridBag extends Applet
{
TextArea ObjTa;
TextField ObjTf;
Button butta, buttf;
CheckboxGroup cbg;
Checkbox cbbold,cbitalic,cbplain,cbboth;
GridBagLayout gb;
GridBagConstraints gbc;
public void init()
{
gb = new GridBagLayout();
setLayout(gb);
gbc = new GridBagConstraints();
ObjTa = new TextArea("Textarea ",5,10);
ObjTf = new TextField("enter your name");
butta = new Button("TextArea");
buttf = new Button("TextField");
cbg = new CheckboxGroup();
cbbold = new Checkbox("Bold",cbg,false);
cbitalic = new Checkbox("Italic",cbg,false);
cbplain = new Checkbox("Plain",cbg,false);
cbboth = new Checkbox("Bold/Italic",cbg,true);
gbc.fill = GridBagConstraints.BOTH;
addComponent(ObjTa,0,0,4,1);
gbc.fill = GridBagConstraints.HORIZONTAL;
addComponent(butta,0,1,1,1);
gbc.fill = GridBagConstraints.HORIZONTAL;
addComponent(buttf,0,2,1,1);
gbc.fill = GridBagConstraints.HORIZONTAL;
addComponent(cbbold,2,1,1,1);
gbc.fill = GridBagConstraints.HORIZONTAL;
addComponent(cbitalic,2,2,1,1);
gbc.fill = GridBagConstraints.HORIZONTAL;
addComponent(cbplain,3,1,1,1);
gbc.fill = GridBagConstraints.HORIZONTAL;
addComponent(cbboth,3,2,1,1);
gbc.fill = GridBagConstraints.HORIZONTAL;
addComponent(ObjTf,4,0,1,3);
}
public void addComponent(Component comp, int row, int col, int nrow, int ncol)
{
gbc.gridx = col;
gbc.gridy = row;
gbc.gridwidth = ncol;
gbc.gridheight = nrow;
gb.setConstraints(comp,gbc);
add(comp);
}
}
|
zluuluyenz/mtech
|
js/lab6/MyGridBag.java
|
Java
|
gpl-3.0
| 1,637
|
namespace FalloutSnip.UI.Docking
{
using FalloutSnip.UI.ObjectControls;
partial class PluginTreeContent
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (this.components != null))
{
this.components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PluginTreeContent));
this.pluginTreeControl = new PluginTreeView();
((System.ComponentModel.ISupportInitialize)(this.pluginTreeControl)).BeginInit();
this.SuspendLayout();
//
// pluginTreeControl
//
resources.ApplyResources(this.pluginTreeControl, "pluginTreeControl");
this.pluginTreeControl.Name = "pluginTreeControl";
this.pluginTreeControl.SelectedRecord = null;
//
// PluginTreeContent
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CloseButton = false;
this.CloseButtonVisible = false;
this.Controls.Add(this.pluginTreeControl);
this.DockAreas = ((WeifenLuo.WinFormsUI.Docking.DockAreas)(((((WeifenLuo.WinFormsUI.Docking.DockAreas.Float | WeifenLuo.WinFormsUI.Docking.DockAreas.DockLeft)
| WeifenLuo.WinFormsUI.Docking.DockAreas.DockRight)
| WeifenLuo.WinFormsUI.Docking.DockAreas.DockTop)
| WeifenLuo.WinFormsUI.Docking.DockAreas.DockBottom)));
this.HideOnClose = true;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "PluginTreeContent";
this.ShowHint = WeifenLuo.WinFormsUI.Docking.DockState.DockLeft;
this.ShowIcon = false;
this.ShowInTaskbar = false;
((System.ComponentModel.ISupportInitialize)(this.pluginTreeControl)).EndInit();
this.ResumeLayout(false);
}
#endregion
private PluginTreeView pluginTreeControl;
}
}
|
Emilgardis/falloutsnip
|
Application/UI/Docking/PluginTreeContent.Designer.cs
|
C#
|
gpl-3.0
| 2,829
|
--[[ -- تم التعديل و التعريب بواسطه @KNSLTHM
--[[
Dev @KNSLTHM
Dev @NAHAR2_BOT
CH > @NENO_CH
--]]
do
local function pre_process(msg)
local fwd = 'mate:'..msg.to.id
if redis:get(fwd) and not is_momod(msg) and msg.fwd_from then
delete_msg(msg.id, ok_cb, true)
return "ok"
end
return msg
end
local function moody(msg, matches)
chat_id = msg.to.id
if is_momod(msg) and matches[1] == 'قفل التوجيه' then
local hash = 'mate:'..msg.to.id
redis:set(hash, true)
return ""
elseif is_momod(msg) and matches[1] == 'فتح التوجيه' then
local hash = 'mate:'..msg.to.id
redis:del(hash)
return ""
end
end
return {
patterns = {
'^(قفل التوجيه)$',
'^(فتح التوجيه)$',
'^[/!#](قفل التوجيه)$',
'^[/!#](فتح التوجيه)$'
},
run = GENERAL,
pre_process = pre_process
}
end
--[[ -- تم التعديل و التعريب بواسطه @KNSLTHM
--[[
Dev @KNSLTHM
Dev @NAHAR2_BOT
CH > @NENO_CH
--]]
|
THEGENRRAL/GENERAL
|
plugins/lock_fwd.lua
|
Lua
|
gpl-3.0
| 1,392
|
"""User preferences for KlustaViewa."""
# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
import logging
import numpy as np
# -----------------------------------------------------------------------------
# Logging
# -----------------------------------------------------------------------------
# Console logging level, can be DEBUG, INFO or WARNING.
loglevel = logging.INFO
# Level of the logging file. DEBUG, INFO or WARNING, or just None to disable.
loglevel_file = logging.INFO
# -----------------------------------------------------------------------------
# Main window
# -----------------------------------------------------------------------------
# Should the software ask the user to save upon closing?
prompt_save_on_exit = True
delay_timer = .05
delay_buffer = .1
# -----------------------------------------------------------------------------
# Similarity matrix
# -----------------------------------------------------------------------------
similarity_measure = 'gaussian' # or 'kl' for KL divergence
# -----------------------------------------------------------------------------
# Waveform view
# -----------------------------------------------------------------------------
# Approximate maximum number of spikes pper cluster to show. Should be
# about 100 for low-end graphics cards, 1000 for high-end ones.
waveforms_nspikes_max_expected = 100
# The minimum number of spikes per cluster to display.
waveforms_nspikes_per_cluster_min = 10
# -----------------------------------------------------------------------------
# Feature view
# -----------------------------------------------------------------------------
# Opacity value of the background spikes.
feature_background_alpha = .25
# Opacity value of the spikes in the selected clusters.
feature_selected_alpha = .75
# Number of spikes to show in the background.
features_nspikes_background_max = 10000
# Maximum number of spikes per cluster to show.
features_nspikes_per_cluster_max = 1000
# Unit of the spike time in the feature view. Can be 'samples' or 'second'.
features_info_time_unit = 'second'
# -----------------------------------------------------------------------------
# Correlograms view
# -----------------------------------------------------------------------------
# Maximum number of clusters to show in the correlograms view.
correlograms_max_nclusters = 20
correlograms_nexcerpts = 100
correlograms_excerpt_size = 20000
# -----------------------------------------------------------------------------
# IPython import path
# -----------------------------------------------------------------------------
# Paths where all .py files are loaded in IPython view.
# "~" corresponds to the user home path, C:\Users\Username\ on Windows,
# /home/username/ on Linux, etc.
ipython_import_paths = ['~/.kwiklib/code']
# -----------------------------------------------------------------------------
# Unit tests
# -----------------------------------------------------------------------------
# Delay between two successive automatic operations in unit tests for views.
test_operator_delay = .1
# Whether to automatically close the views during unit testing.
test_auto_close = True
|
DavidTingley/ephys-processing-pipeline
|
installation/klustaviewa-0.3.0/kwiklib/utils/preferences_default.py
|
Python
|
gpl-3.0
| 3,402
|
//____________________________________________________________________________
/*!
\class genie::AlgId
\brief Algorithm ID (algorithm name + configuration set name)
\author Costas Andreopoulos <costas.andreopoulos \at stfc.ac.uk>
University of Liverpool & STFC Rutherford Appleton Lab
\created October 20, 2005
\cpright Copyright (c) 2003-2017, GENIE Neutrino MC Generator Collaboration
For the full text of the license visit http://copyright.genie-mc.org
or see $GENIE/LICENSE
*/
//____________________________________________________________________________
#ifndef _ALGID_H_
#define _ALGID_H_
#include <string>
#include <iostream>
#include "Registry/RegistryItemTypeDef.h"
using std::string;
using std::ostream;
namespace genie {
class AlgId;
ostream & operator << (ostream & stream, const AlgId & alg);
class AlgId {
public:
AlgId();
AlgId(string name, string config);
AlgId(const AlgId & id);
AlgId(const RgAlg & registry_item);
~AlgId();
string Name (void) const { return fName; }
string Config (void) const { return fConfig; }
string Key (void) const { return fKey; }
void SetId (string name, string config="");
void SetName (string name);
void SetConfig (string config);
void Copy (const AlgId & id);
void Copy (const RgAlg & registry_item);
void Print (ostream & stream) const;
friend ostream & operator << (ostream & stream, const AlgId & alg);
private:
void Init (void);
void UpdateKey (void);
string fName; ///< Algorithm name (including namespaces)
string fConfig; ///< Configuration set name
string fKey; ///< Unique key: namespace::alg_name/alg_config
};
} // genie namespace
#endif // _ALGID_H_
|
GENIEMC/GENIE
|
src/Algorithm/AlgId.h
|
C
|
gpl-3.0
| 1,771
|
package com.infox.common.util;
import net.sourceforge.pinyin4j.PinyinHelper;
import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType;
import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination;
public class PinyinUtil {
public static String getPinYin(String src) {
char[] t1 = null;
t1 = src.toCharArray();
String[] t2 = new String[t1.length];
// 设置汉字拼音输出的格式
HanyuPinyinOutputFormat t3 = new HanyuPinyinOutputFormat();
t3.setCaseType(HanyuPinyinCaseType.LOWERCASE);
t3.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
t3.setVCharType(HanyuPinyinVCharType.WITH_V);
String t4 = "";
int t0 = t1.length;
try {
for (int i = 0; i < t0; i++) {
// 判断是否为汉字字符
if (Character.toString(t1[i]).matches("[\\u4E00-\\u9FA5]+")) {
t2 = PinyinHelper.toHanyuPinyinStringArray(t1[i], t3);// 将汉字的几种全拼都存到t2数组中
t4 += t2[0];// 取出该汉字全拼的第一种读音并连接到字符串t4后
} else {
// 如果不是汉字字符,直接取出字符并连接到字符串t4后
t4 += Character.toString(t1[i]);
}
}
} catch (BadHanyuPinyinOutputFormatCombination e) {
}
return t4;
}
public static String getPinYinHeadChar(String str) {
if(null != str) {
String convert = "";
for (int j = 0; j < str.length(); j++) {
char word = str.charAt(j);
// 提取汉字的首字母
String[] pinyinArray = PinyinHelper.toHanyuPinyinStringArray(word);
if (pinyinArray != null) {
convert += pinyinArray[0].charAt(0);
} else {
convert += word;
}
}
return convert;
} else {
return null ;
}
}
public static String getCnASCII(String cnStr) {
StringBuffer strBuf = new StringBuffer();
// 将字符串转换成字节序列
byte[] bGBK = cnStr.getBytes();
for (int i = 0; i < bGBK.length; i++) {
strBuf.append(Integer.toHexString(bGBK[i] & 0xff));
}
return strBuf.toString();
}
public static void main(String[] args) {
String cnStr = "杨浩泉(A-C)";
System.out.println(getPinYin(cnStr));
System.out.println(getPinYinHeadChar(cnStr));
System.out.println(getCnASCII(cnStr));
}
}
|
yhqmcq/infox
|
src/main/java/com/infox/common/util/PinyinUtil.java
|
Java
|
gpl-3.0
| 2,457
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Qwt User's Guide: Class Members - Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Qwt User's Guide
 <span id="projectnumber">6.1.3</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="inherits.html"><span>Class Hierarchy</span></a></li>
<li class="current"><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<div id="navrow3" class="tabs2">
<ul class="tablist">
<li><a href="functions.html"><span>All</span></a></li>
<li class="current"><a href="functions_func.html"><span>Functions</span></a></li>
<li><a href="functions_vars.html"><span>Variables</span></a></li>
<li><a href="functions_type.html"><span>Typedefs</span></a></li>
<li><a href="functions_enum.html"><span>Enumerations</span></a></li>
<li><a href="functions_eval.html"><span>Enumerator</span></a></li>
</ul>
</div>
<div id="navrow4" class="tabs3">
<ul class="tablist">
<li><a href="functions_func.html#index_a"><span>a</span></a></li>
<li><a href="functions_func_b.html#index_b"><span>b</span></a></li>
<li><a href="functions_func_c.html#index_c"><span>c</span></a></li>
<li><a href="functions_func_d.html#index_d"><span>d</span></a></li>
<li><a href="functions_func_e.html#index_e"><span>e</span></a></li>
<li><a href="functions_func_f.html#index_f"><span>f</span></a></li>
<li><a href="functions_func_g.html#index_g"><span>g</span></a></li>
<li><a href="functions_func_h.html#index_h"><span>h</span></a></li>
<li><a href="functions_func_i.html#index_i"><span>i</span></a></li>
<li><a href="functions_func_k.html#index_k"><span>k</span></a></li>
<li><a href="functions_func_l.html#index_l"><span>l</span></a></li>
<li><a href="functions_func_m.html#index_m"><span>m</span></a></li>
<li><a href="functions_func_n.html#index_n"><span>n</span></a></li>
<li><a href="functions_func_o.html#index_o"><span>o</span></a></li>
<li><a href="functions_func_p.html#index_p"><span>p</span></a></li>
<li><a href="functions_func_r.html#index_r"><span>r</span></a></li>
<li class="current"><a href="functions_func_s.html#index_s"><span>s</span></a></li>
<li><a href="functions_func_t.html#index_t"><span>t</span></a></li>
<li><a href="functions_func_u.html#index_u"><span>u</span></a></li>
<li><a href="functions_func_v.html#index_v"><span>v</span></a></li>
<li><a href="functions_func_w.html#index_w"><span>w</span></a></li>
<li><a href="functions_func_x.html#index_x"><span>x</span></a></li>
<li><a href="functions_func_y.html#index_y"><span>y</span></a></li>
<li><a href="functions_func_z.html#index_z"><span>z</span></a></li>
<li><a href="functions_func_0x7e.html#index_0x7e"><span>~</span></a></li>
</ul>
</div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('functions_func_s.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="contents">
 
<h3><a class="anchor" id="index_s"></a>- s -</h3><ul>
<li>QwtSamplingThread()
: <a class="el" href="class_qwt_sampling_thread.html#afb02e4696306d5211b4b6470410afbfc">QwtSamplingThread</a>
</li>
<li>QwtScaleDiv()
: <a class="el" href="class_qwt_scale_div.html#a724dd19a63de442c0eb493308649ff19">QwtScaleDiv</a>
</li>
<li>QwtScaleDraw()
: <a class="el" href="class_qwt_scale_draw.html#adbd01ba8d7f19fb3122f917b1c74145b">QwtScaleDraw</a>
</li>
<li>QwtScaleEngine()
: <a class="el" href="class_qwt_scale_engine.html#a4ad501667558e5095d36cc190d12790d">QwtScaleEngine</a>
</li>
<li>QwtScaleMap()
: <a class="el" href="class_qwt_scale_map.html#a9576a2e19c0be1d036fee344ab68f542">QwtScaleMap</a>
</li>
<li>QwtScaleWidget()
: <a class="el" href="class_qwt_scale_widget.html#addfd5f0802f85f8abee1d3ff7a1617d6">QwtScaleWidget</a>
</li>
<li>QwtSeriesData()
: <a class="el" href="class_qwt_series_data.html#a3f075340d18fb112a342d74716eb8d9c">QwtSeriesData< T ></a>
</li>
<li>QwtSeriesStore()
: <a class="el" href="class_qwt_series_store.html#aa23545f522f87da936c0f095ee07c80e">QwtSeriesStore< T ></a>
</li>
<li>QwtSetSample()
: <a class="el" href="class_qwt_set_sample.html#af506c3484b65d5de2b6042755066ff81">QwtSetSample</a>
</li>
<li>QwtSetSeriesData()
: <a class="el" href="class_qwt_set_series_data.html#ae28991355a06876fcd14d760771e431b">QwtSetSeriesData</a>
</li>
<li>QwtSimpleCompassRose()
: <a class="el" href="class_qwt_simple_compass_rose.html#a66cc98efe5717eaf11fb0e713cd1aa21">QwtSimpleCompassRose</a>
</li>
<li>QwtSlider()
: <a class="el" href="class_qwt_slider.html#a6012d14e7a24752fca8828e1e1bedaa4">QwtSlider</a>
</li>
<li>QwtSpline()
: <a class="el" href="class_qwt_spline.html#a5d1e0ba35c637a88c66d9e4cbaf36e93">QwtSpline</a>
</li>
<li>QwtSplineCurveFitter()
: <a class="el" href="class_qwt_spline_curve_fitter.html#a98ae80240b254df85dcc44e1f3e4e830">QwtSplineCurveFitter</a>
</li>
<li>QwtSymbol()
: <a class="el" href="class_qwt_symbol.html#a710105d32ed915db46e4dbddc9cf6dc4">QwtSymbol</a>
</li>
<li>QwtSyntheticPointData()
: <a class="el" href="class_qwt_synthetic_point_data.html#ad2980a20669d9703046e9ded9cacf496">QwtSyntheticPointData</a>
</li>
<li>QwtSystemClock()
: <a class="el" href="class_qwt_system_clock.html#a384e20d6049376575bf28306154854fd">QwtSystemClock</a>
</li>
<li>s1()
: <a class="el" href="class_qwt_scale_map.html#a38b6a7040cd15a427f7631afa20cbad8">QwtScaleMap</a>
</li>
<li>s2()
: <a class="el" href="class_qwt_scale_map.html#a644fe199eecf30fcd1803be554cd21f7">QwtScaleMap</a>
</li>
<li>sample()
: <a class="el" href="class_qwt_array_series_data.html#a900ba90abf9a0852026099bdcae2ba7f">QwtArraySeriesData< T ></a>
, <a class="el" href="class_qwt_c_pointer_data.html#a5e01b287eca7d0c4b52bbf514c5244d2">QwtCPointerData</a>
, <a class="el" href="class_qwt_point_array_data.html#ad2fa2b92a88d216fb4a74cb4b6ccbb9f">QwtPointArrayData</a>
, <a class="el" href="class_qwt_sampling_thread.html#a67c4a524736808dc1ba3b81670c0cbd5">QwtSamplingThread</a>
, <a class="el" href="class_qwt_series_data.html#a302fb1409d00615601c7806bb4fbe2da">QwtSeriesData< T ></a>
, <a class="el" href="class_qwt_series_store.html#adbb86cd5cd59472f2f3137742ca74a48">QwtSeriesStore< T ></a>
, <a class="el" href="class_qwt_synthetic_point_data.html#a70d3ed6bfd764878f1709ab6b55e2f0e">QwtSyntheticPointData</a>
</li>
<li>samples()
: <a class="el" href="class_qwt_array_series_data.html#a2d3f931bd28f40bc6e13c4b507e5b502">QwtArraySeriesData< T ></a>
</li>
<li>sampleWidth()
: <a class="el" href="class_qwt_plot_abstract_bar_chart.html#aeb17b54d0ea782d72c94944b867e1946">QwtPlotAbstractBarChart</a>
</li>
<li>scaleChange()
: <a class="el" href="class_qwt_abstract_scale.html#a0dbb7bdc557c0a7b163643e41970ed6a">QwtAbstractScale</a>
, <a class="el" href="class_qwt_abstract_slider.html#a491fe8bbe771fb51bf35d429d4b92e05">QwtAbstractSlider</a>
, <a class="el" href="class_qwt_dial.html#a0cee4448e2753ed259917f1874a3e158">QwtDial</a>
, <a class="el" href="class_qwt_scale_widget.html#af151a963ea3cb7f04815db93e8f4882d">QwtScaleWidget</a>
, <a class="el" href="class_qwt_slider.html#a31ae4c53eb17d77ee0fd846ff6eea7e3">QwtSlider</a>
, <a class="el" href="class_qwt_thermo.html#a3f2f5077580235a5a776805a9721c8ba">QwtThermo</a>
</li>
<li>scaledBoundingRect()
: <a class="el" href="class_qwt_graphic.html#aa415b6f8be72408538c20c0cc60eb0bc">QwtGraphic</a>
</li>
<li>scaleDiv()
: <a class="el" href="class_qwt_abstract_scale.html#ae0ec7f1528981f15d8ede6a78530f065">QwtAbstractScale</a>
, <a class="el" href="class_qwt_abstract_scale_draw.html#a82510027cd5bee269628c9d6302a19a9">QwtAbstractScaleDraw</a>
, <a class="el" href="class_qwt_plot_scale_item.html#a06695f68519b2cc8660441d12d84ab13">QwtPlotScaleItem</a>
</li>
<li>scaleDivChanged()
: <a class="el" href="class_qwt_scale_widget.html#a55c52717ede368069f5f44b9901e3400">QwtScaleWidget</a>
</li>
<li>scaleDraw()
: <a class="el" href="class_qwt_dial.html#adaa9a23f4e19d3cd085db1c61665d1d6">QwtDial</a>
, <a class="el" href="class_qwt_knob.html#aa9c4c23e20fc59b3ca2bfed9fe1e3719">QwtKnob</a>
, <a class="el" href="class_qwt_plot_scale_item.html#abdcced6eb4179319aeeeba370ec54a0f">QwtPlotScaleItem</a>
, <a class="el" href="class_qwt_scale_widget.html#ad8603e84f851e5d91feb21beebf19896">QwtScaleWidget</a>
, <a class="el" href="class_qwt_slider.html#ab3394f8eb22b75cc6add3b8d3444ad30">QwtSlider</a>
, <a class="el" href="class_qwt_thermo.html#aaacb94a49eb05c91a3896d202f79ec46">QwtThermo</a>
</li>
<li>scaledSymbolWidth()
: <a class="el" href="class_qwt_plot_trading_curve.html#a327d6afbc4bc12794e9bd586c0fcafbc">QwtPlotTradingCurve</a>
</li>
<li>scaleEngine()
: <a class="el" href="class_qwt_abstract_scale.html#a5b8084cc735933ce9338fd2df1126f0e">QwtAbstractScale</a>
</li>
<li>scaleInnerRect()
: <a class="el" href="class_qwt_dial.html#ab793e4c15e9b32a7e8d13f0b28d1feb9">QwtDial</a>
</li>
<li>scaleMap()
: <a class="el" href="class_qwt_abstract_scale.html#a68f120e12e373796b5d74199a9b8a4b0">QwtAbstractScale</a>
, <a class="el" href="class_qwt_abstract_scale_draw.html#aac87f593525666a47a57d9e2b4f02c66">QwtAbstractScaleDraw</a>
</li>
<li>scaleMaxMajor()
: <a class="el" href="class_qwt_abstract_scale.html#a4cfbcd9880297b1ca28fa824e3f4c3e6">QwtAbstractScale</a>
</li>
<li>scaleMaxMinor()
: <a class="el" href="class_qwt_abstract_scale.html#a5b23fafbb56bb43fd241c1839256357f">QwtAbstractScale</a>
</li>
<li>scalePosition()
: <a class="el" href="class_qwt_slider.html#ac3f14f80cc92d1c267e2ae88df6f61c1">QwtSlider</a>
, <a class="el" href="class_qwt_thermo.html#a1cbfd720c1f8c7bf38c984999726086f">QwtThermo</a>
</li>
<li>scaleRect()
: <a class="el" href="class_qwt_plot_item.html#a186036cbee194b87b9bc4afb693c27f4">QwtPlotItem</a>
, <a class="el" href="class_qwt_plot_layout.html#a184c8134d58aff17f3a91ae1505917e2">QwtPlotLayout</a>
, <a class="el" href="class_qwt_plot_picker.html#a6becfde9ef447128a55c0675bf1c1524">QwtPlotPicker</a>
</li>
<li>scaleStepSize()
: <a class="el" href="class_qwt_abstract_scale.html#ad94ddd24f5f9742a577b19f9c6e00117">QwtAbstractScale</a>
</li>
<li>scrolledTo()
: <a class="el" href="class_qwt_abstract_slider.html#a3e7671e00a31e7b0ba4ef4a2c325125a">QwtAbstractSlider</a>
, <a class="el" href="class_qwt_dial.html#afc13ba2a48fc4f99a74f08d87dabc016">QwtDial</a>
, <a class="el" href="class_qwt_knob.html#a800716b7da7d41da1472c561d6e0b332">QwtKnob</a>
, <a class="el" href="class_qwt_slider.html#aa895f8b5fb3968d4ce3008f27792d3b9">QwtSlider</a>
</li>
<li>scrollExtent()
: <a class="el" href="class_qwt_abstract_legend.html#a51e8c45d2afc691e78b09c662d7a493e">QwtAbstractLegend</a>
, <a class="el" href="class_qwt_legend.html#ad75d747944921533aede5bfce518ec02">QwtLegend</a>
</li>
<li>sDist()
: <a class="el" href="class_qwt_scale_map.html#adf621246cfa7313280a35a44063972f3">QwtScaleMap</a>
</li>
<li>selected()
: <a class="el" href="class_qwt_picker.html#a283ec139021c9b5e95d1472a9c902c7e">QwtPicker</a>
, <a class="el" href="class_qwt_plot_picker.html#a28f6c8af0efd0abb6dc144670efbb31b">QwtPlotPicker</a>
</li>
<li>selection()
: <a class="el" href="class_qwt_picker.html#ac5bc0a5f7054c407195ce9ee1d0cf394">QwtPicker</a>
</li>
<li>selectionType()
: <a class="el" href="class_qwt_picker_machine.html#a9ccd6ccb3fa0e2a73730e69a8658c316">QwtPickerMachine</a>
</li>
<li>setAbortKey()
: <a class="el" href="class_qwt_panner.html#acbb1b9e30214354708e1d75db6b78289">QwtPanner</a>
</li>
<li>setAbstractScaleDraw()
: <a class="el" href="class_qwt_abstract_scale.html#a950c5bf521dc704b78f76c7951346288">QwtAbstractScale</a>
</li>
<li>setAlarmBrush()
: <a class="el" href="class_qwt_thermo.html#a1d6a0fae32e21fe6c5f54762073dbe8b">QwtThermo</a>
</li>
<li>setAlarmEnabled()
: <a class="el" href="class_qwt_thermo.html#abed75ea5e839ee4afed2c96f6927721e">QwtThermo</a>
</li>
<li>setAlarmLevel()
: <a class="el" href="class_qwt_thermo.html#ab42dff878632d210050be2be03535f6a">QwtThermo</a>
</li>
<li>setAlignCanvasToScale()
: <a class="el" href="class_qwt_plot_layout.html#ad243b9afc9b5ce9530b500dc35096d67">QwtPlotLayout</a>
</li>
<li>setAlignCanvasToScales()
: <a class="el" href="class_qwt_plot_layout.html#a147fcf4c59b34779b5a7dc7361a3b6c3">QwtPlotLayout</a>
</li>
<li>setAlignment()
: <a class="el" href="class_qwt_knob.html#ab84683292e11b7c3de4855d844b5471c">QwtKnob</a>
, <a class="el" href="class_qwt_plot_legend_item.html#a7f0bc77d242fe1977d8dee501fa5240f">QwtPlotLegendItem</a>
, <a class="el" href="class_qwt_plot_scale_item.html#af11343d14c4ee38e0527cedd52b3da85">QwtPlotScaleItem</a>
, <a class="el" href="class_qwt_scale_draw.html#a7a4de0055dc1358e55c3357366a54091">QwtScaleDraw</a>
, <a class="el" href="class_qwt_scale_widget.html#ab6421ace2bd56d5559689522336556e0">QwtScaleWidget</a>
</li>
<li>setAlpha()
: <a class="el" href="class_qwt_plot_raster_item.html#a14f2ab8ec0994384e6269f869c352273">QwtPlotRasterItem</a>
</li>
<li>setAngleRange()
: <a class="el" href="class_qwt_round_scale_draw.html#a5d85678fdb9fbb4d622425aab9ecc681">QwtRoundScaleDraw</a>
</li>
<li>setAspectRatio()
: <a class="el" href="class_qwt_plot_rescaler.html#a31f71937b4cff3e60f74db83beb6d2de">QwtPlotRescaler</a>
</li>
<li>setAttribute()
: <a class="el" href="class_qwt_plot_direct_painter.html#a498b9857a09e399010a3f8bc9c235a8d">QwtPlotDirectPainter</a>
, <a class="el" href="class_qwt_scale_engine.html#acf02a88f6e778edbc9e005960f35b3b7">QwtScaleEngine</a>
</li>
<li>setAttributes()
: <a class="el" href="class_qwt_scale_engine.html#acd73d5f27b5db0bc7ee673eb6fe9810d">QwtScaleEngine</a>
</li>
<li>setAutoDelete()
: <a class="el" href="class_qwt_plot_dict.html#a3291431f0a9cca5b2affc5adf17bbdfb">QwtPlotDict</a>
</li>
<li>setAutoReplot()
: <a class="el" href="class_qwt_plot.html#ab1cbce6d43ff9772735a9df9104f882f">QwtPlot</a>
</li>
<li>setAxes()
: <a class="el" href="class_qwt_plot_item.html#a6f6c7b34fe86e8029914b3b780b55ea4">QwtPlotItem</a>
</li>
<li>setAxis()
: <a class="el" href="class_qwt_plot_picker.html#aa901c86543585c7056133a5cb6652e3d">QwtPlotPicker</a>
, <a class="el" href="class_qwt_plot_zoomer.html#a6cb755e06b83e50e8353dd706f7fb6f0">QwtPlotZoomer</a>
</li>
<li>setAxisAutoScale()
: <a class="el" href="class_qwt_plot.html#a6fb58f90366920f234440fceead50432">QwtPlot</a>
</li>
<li>setAxisEnabled()
: <a class="el" href="class_qwt_plot_magnifier.html#ac8806df408b5ed9eac79cd38e5fc1508">QwtPlotMagnifier</a>
, <a class="el" href="class_qwt_plot_panner.html#acbd5d67684c5a20ea0115e66f69540e4">QwtPlotPanner</a>
</li>
<li>setAxisFont()
: <a class="el" href="class_qwt_plot.html#a9a14e57652c016f40388a68e556917e3">QwtPlot</a>
</li>
<li>setAxisLabelAlignment()
: <a class="el" href="class_qwt_plot.html#a19f1b67fa79b80c712cf5f52b97ea0c5">QwtPlot</a>
</li>
<li>setAxisLabelRotation()
: <a class="el" href="class_qwt_plot.html#ad5fa7aa01c88eab38ad64b131584f977">QwtPlot</a>
</li>
<li>setAxisMaxMajor()
: <a class="el" href="class_qwt_plot.html#a34df698558c9bd9c38bdd8ff04cc6c41">QwtPlot</a>
</li>
<li>setAxisMaxMinor()
: <a class="el" href="class_qwt_plot.html#aa45b271684d6202061f1afcfa70e7cf6">QwtPlot</a>
</li>
<li>setAxisScale()
: <a class="el" href="class_qwt_plot.html#acef5ea818944b93b8695d0c16924eed6">QwtPlot</a>
</li>
<li>setAxisScaleDiv()
: <a class="el" href="class_qwt_plot.html#a2365da57b983eb39752fa4f6378c225a">QwtPlot</a>
</li>
<li>setAxisScaleDraw()
: <a class="el" href="class_qwt_plot.html#a956a14b08e016eb83768ff4187d3849d">QwtPlot</a>
</li>
<li>setAxisScaleEngine()
: <a class="el" href="class_qwt_plot.html#abf09452377b53e584a5086354a134d78">QwtPlot</a>
</li>
<li>setAxisTitle()
: <a class="el" href="class_qwt_plot.html#a5d60f1836e05e5cc5c7fe9570d6a608a">QwtPlot</a>
</li>
<li>setAzimuth()
: <a class="el" href="class_qwt_point_polar.html#a32c6c64510fce3e087d332305b4aca9e">QwtPointPolar</a>
</li>
<li>setBackgroundBrush()
: <a class="el" href="class_qwt_plot_legend_item.html#a82c391eecd2752c3a85a274973f34b6e">QwtPlotLegendItem</a>
, <a class="el" href="class_qwt_text.html#af016a747b234aede9f0cbbeb06ed2802">QwtText</a>
</li>
<li>setBackgroundMode()
: <a class="el" href="class_qwt_plot_legend_item.html#a4974efd3548c1335f0969275a95e7cba">QwtPlotLegendItem</a>
</li>
<li>setBarTitles()
: <a class="el" href="class_qwt_plot_multi_bar_chart.html#ab519e583c3463e260c8f47be67aa9b8e">QwtPlotMultiBarChart</a>
</li>
<li>setBase()
: <a class="el" href="class_qwt_scale_engine.html#afdabe4fd2a89b7cd5a21cdc9ac2269d6">QwtScaleEngine</a>
</li>
<li>setBaseline()
: <a class="el" href="class_qwt_plot_abstract_bar_chart.html#adafbea42ddc3f7f639f2880a4bf683ad">QwtPlotAbstractBarChart</a>
, <a class="el" href="class_qwt_plot_curve.html#adbb5da6798a60138315b18194cf1ca1e">QwtPlotCurve</a>
, <a class="el" href="class_qwt_plot_histogram.html#a372314f4e2921673f74d46773d583cf2">QwtPlotHistogram</a>
</li>
<li>setBorderDist()
: <a class="el" href="class_qwt_scale_widget.html#a75477785c41114e4b2fc08bec64e5d26">QwtScaleWidget</a>
</li>
<li>setBorderDistance()
: <a class="el" href="class_qwt_plot_legend_item.html#a1238fb3d43f81bea8fa5d89fb6f24bfe">QwtPlotLegendItem</a>
, <a class="el" href="class_qwt_plot_scale_item.html#a34bb235d0715d9c13669fe90669fc545">QwtPlotScaleItem</a>
</li>
<li>setBorderFlags()
: <a class="el" href="class_qwt_interval.html#ad1bce23251519f0d44937413f8547dc5">QwtInterval</a>
</li>
<li>setBorderPen()
: <a class="el" href="class_qwt_plot_legend_item.html#a92d38a3db46df13cc325c3ec8ea63768">QwtPlotLegendItem</a>
, <a class="el" href="class_qwt_text.html#aca4dd700b7a182114a8c0eb864c4ec2f">QwtText</a>
</li>
<li>setBorderRadius()
: <a class="el" href="class_qwt_plot_canvas.html#a1e5c325697c0e892bf0e4e514d50177c">QwtPlotCanvas</a>
, <a class="el" href="class_qwt_plot_legend_item.html#afe9ab7925e12c81d7534343de29ae9cf">QwtPlotLegendItem</a>
, <a class="el" href="class_qwt_text.html#a7c62dfe82aa94f113cd4f8702bd2242c">QwtText</a>
</li>
<li>setBorderWidth()
: <a class="el" href="class_qwt_knob.html#a2e0a17648602bab3b1aaabfc3ba19441">QwtKnob</a>
, <a class="el" href="class_qwt_slider.html#a0d40da533b9417974240e127b5d701e4">QwtSlider</a>
, <a class="el" href="class_qwt_thermo.html#a25821f13d01848a1a37690d4796311bc">QwtThermo</a>
, <a class="el" href="class_qwt_wheel.html#a50a2046f1151af7599aee3ad8f4e3ff0">QwtWheel</a>
</li>
<li>setBoundingRect()
: <a class="el" href="class_qwt_point_mapper.html#a03910571df91575456e98134f6543650">QwtPointMapper</a>
</li>
<li>setBrush()
: <a class="el" href="class_qwt_interval_symbol.html#a2bf63ba6d8051ad890787b4762ae8b9a">QwtIntervalSymbol</a>
, <a class="el" href="class_qwt_plot_curve.html#adc52ea882ec1f994e2d2e23c7465b0c2">QwtPlotCurve</a>
, <a class="el" href="class_qwt_plot_histogram.html#a0bf40c3f9f9074cac5deecd4525583b3">QwtPlotHistogram</a>
, <a class="el" href="class_qwt_plot_interval_curve.html#a3102b513c27c54775fd371858aa31bba">QwtPlotIntervalCurve</a>
, <a class="el" href="class_qwt_plot_shape_item.html#ac73e7b2bc260f50dd997e078384a3d6b">QwtPlotShapeItem</a>
, <a class="el" href="class_qwt_plot_zone_item.html#a29d7add8c10cde3c5710354cd0d033a8">QwtPlotZoneItem</a>
, <a class="el" href="class_qwt_symbol.html#ae6aa7281d518bdd4adae8a37bbb5e09a">QwtSymbol</a>
</li>
<li>setCachePolicy()
: <a class="el" href="class_qwt_plot_raster_item.html#a31f74199f7e333c2683b0f18289e4c7f">QwtPlotRasterItem</a>
, <a class="el" href="class_qwt_symbol.html#a4c358a923bdcb122a59f21eb419f1bc6">QwtSymbol</a>
</li>
<li>setCanvas()
: <a class="el" href="class_qwt_plot.html#aea67c885034219789b360c0e624bfeaf">QwtPlot</a>
</li>
<li>setCanvasBackground()
: <a class="el" href="class_qwt_plot.html#adb0b2e68d86039f86e3240fb399fa0fe">QwtPlot</a>
</li>
<li>setCanvasMargin()
: <a class="el" href="class_qwt_plot_layout.html#a11667dad6675a7a58cc60ab1597b1203">QwtPlotLayout</a>
</li>
<li>setCanvasRect()
: <a class="el" href="class_qwt_plot_layout.html#ab3d6614684b96a5879300476d2df8f8f">QwtPlotLayout</a>
</li>
<li>setChecked()
: <a class="el" href="class_qwt_legend_label.html#aec4affb8dbd281a7a8c5511c3ebf5ff8">QwtLegendLabel</a>
</li>
<li>setChunkSize()
: <a class="el" href="class_qwt_weeding_curve_fitter.html#a9f17a819447cba0e733bd71d90ee2766">QwtWeedingCurveFitter</a>
</li>
<li>setClipping()
: <a class="el" href="class_qwt_plot_direct_painter.html#ac3d406aada74b7d9202c1017d8347708">QwtPlotDirectPainter</a>
</li>
<li>setClipRegion()
: <a class="el" href="class_qwt_plot_direct_painter.html#a0c97174b06957f9b20ea295ff403a557">QwtPlotDirectPainter</a>
</li>
<li>setColor()
: <a class="el" href="class_qwt_alpha_color_map.html#a372ba8791102270991473897fb36a965">QwtAlphaColorMap</a>
, <a class="el" href="class_qwt_symbol.html#a046443d76371c92add79e1f360bf3134">QwtSymbol</a>
, <a class="el" href="class_qwt_text.html#ac7de5839a5c3b1ee367cfbd5691aa105">QwtText</a>
</li>
<li>setColorBarEnabled()
: <a class="el" href="class_qwt_scale_widget.html#aeb337b8e67fc00ca98bf39a6d70aea61">QwtScaleWidget</a>
</li>
<li>setColorBarWidth()
: <a class="el" href="class_qwt_scale_widget.html#a76eb179267a572944d1ebdbf62c573f1">QwtScaleWidget</a>
</li>
<li>setColorInterval()
: <a class="el" href="class_qwt_linear_color_map.html#abfae35c30755c0bbd1447342055e9a13">QwtLinearColorMap</a>
</li>
<li>setColorMap()
: <a class="el" href="class_qwt_plot_spectro_curve.html#a67d046af16feeddc9bec08c698b46446">QwtPlotSpectroCurve</a>
, <a class="el" href="class_qwt_plot_spectrogram.html#a55375b61c01962b06ad222c980ca2dcc">QwtPlotSpectrogram</a>
, <a class="el" href="class_qwt_scale_widget.html#a3cfd919d042007accd3fdb3fcd75045c">QwtScaleWidget</a>
, <a class="el" href="class_qwt_thermo.html#ad2ac0e2d496fd3d28f83f61728b83337">QwtThermo</a>
</li>
<li>setColorRange()
: <a class="el" href="class_qwt_plot_spectro_curve.html#a133f4117e925a1faed456bd9524477e4">QwtPlotSpectroCurve</a>
</li>
<li>setCommands()
: <a class="el" href="class_qwt_graphic.html#a22cd36c524b08834bac74337aea9f7e8">QwtGraphic</a>
</li>
<li>setConrecFlag()
: <a class="el" href="class_qwt_plot_spectrogram.html#adcec06278d4ff4b8dd3a85e2ef188d7b">QwtPlotSpectrogram</a>
</li>
<li>setContourLevels()
: <a class="el" href="class_qwt_plot_spectrogram.html#a5b7669a3c390e30f0c51e5c4689095d2">QwtPlotSpectrogram</a>
</li>
<li>setCurrentTime()
: <a class="el" href="class_qwt_analog_clock.html#a1972a54ce59155ec7435103f11a775a7">QwtAnalogClock</a>
</li>
<li>setCursor()
: <a class="el" href="class_qwt_panner.html#ac8b0625fe155fff0132df85727f54a3e">QwtPanner</a>
</li>
<li>setCurveAttribute()
: <a class="el" href="class_qwt_plot_curve.html#a6ac9243e280f96cd149102a91271a473">QwtPlotCurve</a>
</li>
<li>setCurveFitter()
: <a class="el" href="class_qwt_plot_curve.html#ac15588c78d175906a30de501b4dd7957">QwtPlotCurve</a>
</li>
<li>setData()
: <a class="el" href="class_qwt_legend_label.html#abd0140174ae2f0818cc926f68a9f27cc">QwtLegendLabel</a>
, <a class="el" href="class_qwt_plot_spectrogram.html#a5ee036cdf8dbaf5f8fd82a3fc47b023a">QwtPlotSpectrogram</a>
, <a class="el" href="class_qwt_series_store.html#add3ce83fe90e976b75a0ebaa79caee4c">QwtSeriesStore< T ></a>
</li>
<li>setDateFormat()
: <a class="el" href="class_qwt_date_scale_draw.html#ae8eb41024970bec16987d0c736ae890e">QwtDateScaleDraw</a>
</li>
<li>setDefaultContourPen()
: <a class="el" href="class_qwt_plot_spectrogram.html#af883cb50d74057994b3179ab0e262e64">QwtPlotSpectrogram</a>
</li>
<li>setDefaultItemMode()
: <a class="el" href="class_qwt_legend.html#af977ff3e749f8281ee8ad4b926542b50">QwtLegend</a>
</li>
<li>setDefaultSize()
: <a class="el" href="class_qwt_graphic.html#acba8d73bc62bd15c15491d4a6e739869">QwtGraphic</a>
</li>
<li>setDiscardFlag()
: <a class="el" href="class_qwt_plot_renderer.html#a33439eb1407f3ba78fdd7b50461bbafc">QwtPlotRenderer</a>
</li>
<li>setDiscardFlags()
: <a class="el" href="class_qwt_plot_renderer.html#ac618f4d6605c2484c03140323e1bd639">QwtPlotRenderer</a>
</li>
<li>setDisplayMode()
: <a class="el" href="class_qwt_plot_spectrogram.html#a482a82bcf1b9f2a9a75f527063b394a2">QwtPlotSpectrogram</a>
</li>
<li>setDown()
: <a class="el" href="class_qwt_legend_label.html#ad79fbc910254d1607deb331ade69db90">QwtLegendLabel</a>
</li>
<li>setEnabled()
: <a class="el" href="class_qwt_magnifier.html#a03d892c58039fc864a452b7c636a1df7">QwtMagnifier</a>
, <a class="el" href="class_qwt_panner.html#a43e06c262c945fc7faeb729539bbde58">QwtPanner</a>
, <a class="el" href="class_qwt_picker.html#aa590756369efae6ebf323302a0af5d36">QwtPicker</a>
, <a class="el" href="class_qwt_plot_rescaler.html#a6f1c886d127ec4943552170dc63edf29">QwtPlotRescaler</a>
</li>
<li>setExpandingDirection()
: <a class="el" href="class_qwt_plot_rescaler.html#aa2ecffbc14d951ab9f1809c14bc4e21b">QwtPlotRescaler</a>
</li>
<li>setExpandingDirections()
: <a class="el" href="class_qwt_dyn_grid_layout.html#a56cd48dda979428402dd39d470674dee">QwtDynGridLayout</a>
</li>
<li>setFillBrush()
: <a class="el" href="class_qwt_thermo.html#af6ad0c2ca39afb30bb79a326484c9a21">QwtThermo</a>
</li>
<li>setFitMode()
: <a class="el" href="class_qwt_spline_curve_fitter.html#a8381be57ee16b5a2bdacafbd5d71908b">QwtSplineCurveFitter</a>
</li>
<li>setFlag()
: <a class="el" href="class_qwt_point_mapper.html#a6e03e14718d3d66a0f6a02fec7fcaeed">QwtPointMapper</a>
</li>
<li>setFlags()
: <a class="el" href="class_qwt_point_mapper.html#ab556bd339cca487f25e2d894c51abe85">QwtPointMapper</a>
</li>
<li>setFocusIndicator()
: <a class="el" href="class_qwt_plot_canvas.html#ae7330616dbb97128d01c5446ef0b006e">QwtPlotCanvas</a>
</li>
<li>setFont()
: <a class="el" href="class_qwt_plot_legend_item.html#aa63eae9c2b05cb92186a40dde19fedec">QwtPlotLegendItem</a>
, <a class="el" href="class_qwt_plot_scale_item.html#a8f2bc7a401bb3e1cf796ff024032e31d">QwtPlotScaleItem</a>
, <a class="el" href="class_qwt_text.html#ad071f3c4fae4512a1cc71554d95eb69a">QwtText</a>
</li>
<li>setFooter()
: <a class="el" href="class_qwt_plot.html#a30a098d942a1a9612b94e8fa5a3c9183">QwtPlot</a>
</li>
<li>setFooterRect()
: <a class="el" href="class_qwt_plot_layout.html#a60698767fe44c86ee4bcef27c1b48d26">QwtPlotLayout</a>
</li>
<li>setFrameShadow()
: <a class="el" href="class_qwt_dial.html#a272e17e53586a149df4dca437d5f9494">QwtDial</a>
, <a class="el" href="class_qwt_plot_g_l_canvas.html#aee1da52928fa1fb765fa9c5794f40a4a">QwtPlotGLCanvas</a>
</li>
<li>setFrameShape()
: <a class="el" href="class_qwt_plot_g_l_canvas.html#a579e3f0891236317742cb58d9cacb6f5">QwtPlotGLCanvas</a>
</li>
<li>setFrameStyle()
: <a class="el" href="class_qwt_column_symbol.html#a80826051d63efaf033868f05404ef565">QwtColumnSymbol</a>
, <a class="el" href="class_qwt_plot_g_l_canvas.html#a9e1a08cbed3d6fb4ba89a31591265d0d">QwtPlotGLCanvas</a>
</li>
<li>setGeometry()
: <a class="el" href="class_qwt_dyn_grid_layout.html#afdf23bb94de5258f14fb077b39a64391">QwtDynGridLayout</a>
</li>
<li>setGraphic()
: <a class="el" href="class_qwt_symbol.html#ab060930c548548b33441757dcc4b2f73">QwtSymbol</a>
</li>
<li>setGroove()
: <a class="el" href="class_qwt_slider.html#a4afc308735f59ffd51adb12d0a32bd81">QwtSlider</a>
</li>
<li>setHand()
: <a class="el" href="class_qwt_analog_clock.html#a643101aafbe7a6fc91cb550203a7d3ee">QwtAnalogClock</a>
</li>
<li>setHandleSize()
: <a class="el" href="class_qwt_slider.html#a83ecd72c7ca593ebd361ad8912ac9d39">QwtSlider</a>
</li>
<li>setIcon()
: <a class="el" href="class_qwt_legend_label.html#ae6113ca4894637f62f7e7df582672788">QwtLegendLabel</a>
</li>
<li>setIncSteps()
: <a class="el" href="class_qwt_counter.html#a6aa68e7fc717fb0e2e48a978301c96eb">QwtCounter</a>
</li>
<li>setIndent()
: <a class="el" href="class_qwt_text_label.html#aad25ab34c219f8d97ec7c39d064ed4a0">QwtTextLabel</a>
</li>
<li>setInterval()
: <a class="el" href="class_qwt_interval.html#a0373ca3cdb22ed507e4188fd06f68b17">QwtInterval</a>
, <a class="el" href="class_qwt_matrix_raster_data.html#a69db38d8f920edb9dc3f0953ca16db8f">QwtMatrixRasterData</a>
, <a class="el" href="class_qwt_plot_zone_item.html#acdf04297cd78f586e447318db60334e6">QwtPlotZoneItem</a>
, <a class="el" href="class_qwt_raster_data.html#a14abf60573989e2a2c97e21a98aee558">QwtRasterData</a>
, <a class="el" href="class_qwt_sampling_thread.html#a36c56404ef0042cf52f1e592edf94f5d">QwtSamplingThread</a>
, <a class="el" href="class_qwt_scale_div.html#aa5c61a5fef5f83f2735e4e1b8e545f0b">QwtScaleDiv</a>
, <a class="el" href="class_qwt_synthetic_point_data.html#a1a0b2548b496affcf65272acd86c6700">QwtSyntheticPointData</a>
</li>
<li>setIntervalHint()
: <a class="el" href="class_qwt_plot_rescaler.html#afefb0ec065ff855785d0198fc04a07d3">QwtPlotRescaler</a>
</li>
<li>setInverted()
: <a class="el" href="class_qwt_wheel.html#a66fec7ef7c7f889218f8ae0d0dcd90b5">QwtWheel</a>
</li>
<li>setInvertedControls()
: <a class="el" href="class_qwt_abstract_slider.html#a8344b634faf639447c707ef665d2d324">QwtAbstractSlider</a>
</li>
<li>setItemAttribute()
: <a class="el" href="class_qwt_plot_item.html#a5a335be8ff488809a2cf7f4b734ad1b6">QwtPlotItem</a>
</li>
<li>setItemInterest()
: <a class="el" href="class_qwt_plot_item.html#ab65cbfe489ff73e32a919a0633298fb7">QwtPlotItem</a>
</li>
<li>setItemMargin()
: <a class="el" href="class_qwt_plot_legend_item.html#a85933f3f34ce2ed226217e35eb0341be">QwtPlotLegendItem</a>
</li>
<li>setItemMode()
: <a class="el" href="class_qwt_legend_label.html#a2f469bcbc733332110d61d70f863df2e">QwtLegendLabel</a>
</li>
<li>setItemSpacing()
: <a class="el" href="class_qwt_plot_legend_item.html#a6f1f7d6e9161260ac703abc1118a63b9">QwtPlotLegendItem</a>
</li>
<li>setKeyFactor()
: <a class="el" href="class_qwt_magnifier.html#ac079b44e124fdaba1d894ef519bc4e4f">QwtMagnifier</a>
</li>
<li>setKeyPattern()
: <a class="el" href="class_qwt_event_pattern.html#ae3543f014372987ed1aff4b2b880f631">QwtEventPattern</a>
</li>
<li>setKnobStyle()
: <a class="el" href="class_qwt_knob.html#a3e69357a595407a73c23df7ad68bf117">QwtKnob</a>
</li>
<li>setKnobWidth()
: <a class="el" href="class_qwt_knob.html#a3c5fd9348d4fc0ffd39eb4d98daca831">QwtKnob</a>
</li>
<li>setLabel()
: <a class="el" href="class_qwt_plot_marker.html#ad90adc27ccd6a10a7d6d1bb4464bf7d1">QwtPlotMarker</a>
</li>
<li>setLabelAlignment()
: <a class="el" href="class_qwt_plot_marker.html#ab0c88d103cc68093ac7469ad421105e0">QwtPlotMarker</a>
, <a class="el" href="class_qwt_scale_draw.html#a3df0a1fe4a498ef028a5348e54bfaa7f">QwtScaleDraw</a>
, <a class="el" href="class_qwt_scale_widget.html#a8d16473c34f8eaea7e6c457a4de25949">QwtScaleWidget</a>
</li>
<li>setLabelMap()
: <a class="el" href="class_qwt_compass_scale_draw.html#a55c807e3399832b53b4a9783780f9dd0">QwtCompassScaleDraw</a>
</li>
<li>setLabelOrientation()
: <a class="el" href="class_qwt_plot_marker.html#a2bd6a30b0b04bd2c07505e1cfcdd2561">QwtPlotMarker</a>
</li>
<li>setLabelRotation()
: <a class="el" href="class_qwt_scale_draw.html#abf5881339fddde65a00c1dd391023320">QwtScaleDraw</a>
, <a class="el" href="class_qwt_scale_widget.html#aea277057b98a66ee8038f6a827e0f404">QwtScaleWidget</a>
</li>
<li>setLayoutAttribute()
: <a class="el" href="class_qwt_text.html#a2b621d3104ead2185d2d939b1f5b9d68">QwtText</a>
</li>
<li>setLayoutFlag()
: <a class="el" href="class_qwt_plot_renderer.html#ab06e26ebf2038b55e5f30bb14c90caec">QwtPlotRenderer</a>
, <a class="el" href="class_qwt_scale_widget.html#a6e3495e29ba5dfb4a75827ec1df03f6a">QwtScaleWidget</a>
</li>
<li>setLayoutFlags()
: <a class="el" href="class_qwt_plot_renderer.html#a475ee59a0a3078380b6da31567bd0a14">QwtPlotRenderer</a>
</li>
<li>setLayoutHint()
: <a class="el" href="class_qwt_plot_abstract_bar_chart.html#aff6bb52dad207c8396b359a248a00359">QwtPlotAbstractBarChart</a>
</li>
<li>setLayoutPolicy()
: <a class="el" href="class_qwt_plot_abstract_bar_chart.html#aabc7165ee75a38f444aa97e9b3dca16b">QwtPlotAbstractBarChart</a>
</li>
<li>setLegendAttribute()
: <a class="el" href="class_qwt_plot_curve.html#a0b1b7816e822607eb16e6eb2fd7bfa5c">QwtPlotCurve</a>
</li>
<li>setLegendIconSize()
: <a class="el" href="class_qwt_plot_item.html#a0827dd69bf19ec0145b6cc6efad2c11b">QwtPlotItem</a>
</li>
<li>setLegendMode()
: <a class="el" href="class_qwt_plot_bar_chart.html#a1ba4d1347a2d493fe3859a1c0fac6a6d">QwtPlotBarChart</a>
, <a class="el" href="class_qwt_plot_shape_item.html#a2daf96fc886bb84e4a55913fc0c39906">QwtPlotShapeItem</a>
</li>
<li>setLegendPosition()
: <a class="el" href="class_qwt_plot_layout.html#a11c9695a68f95135841cb23212589f18">QwtPlotLayout</a>
</li>
<li>setLegendRatio()
: <a class="el" href="class_qwt_plot_layout.html#aabe9f952046139667e055c661bee4dbb">QwtPlotLayout</a>
</li>
<li>setLegendRect()
: <a class="el" href="class_qwt_plot_layout.html#a5d5c1dacdfff8281acf0a909acaf866c">QwtPlotLayout</a>
</li>
<li>setLength()
: <a class="el" href="class_qwt_scale_draw.html#a002528e391ce07246a5d6b05b4bac9d9">QwtScaleDraw</a>
</li>
<li>setLinePen()
: <a class="el" href="class_qwt_plot_marker.html#a9414658a5980527326b87615d0fc1560">QwtPlotMarker</a>
</li>
<li>setLineStyle()
: <a class="el" href="class_qwt_plot_marker.html#ae4533f9f9f5a7dfbc85729215d4b5932">QwtPlotMarker</a>
</li>
<li>setLineWidth()
: <a class="el" href="class_qwt_column_symbol.html#af9348444ae2c21d3bcaff3217fc694fc">QwtColumnSymbol</a>
, <a class="el" href="class_qwt_dial.html#a7946ca363a97fd28de4993a5caa54507">QwtDial</a>
, <a class="el" href="class_qwt_plot_g_l_canvas.html#a9b831253eef4f77a0f580468cb5e41d6">QwtPlotGLCanvas</a>
</li>
<li>setLowerBound()
: <a class="el" href="class_qwt_abstract_scale.html#aa1b73da4589370fc14fd2ef49b02d142">QwtAbstractScale</a>
, <a class="el" href="class_qwt_scale_div.html#a7d334df11402bf3a5146a8232144bdf8">QwtScaleDiv</a>
</li>
<li>setMajorPen()
: <a class="el" href="class_qwt_plot_grid.html#a08aa0669817c8a797e7c22731a02a66d">QwtPlotGrid</a>
</li>
<li>setMargin()
: <a class="el" href="class_qwt_plot_abstract_bar_chart.html#a97946d3da8e9fe2e49494a882651e4fd">QwtPlotAbstractBarChart</a>
, <a class="el" href="class_qwt_plot_legend_item.html#a503f19f2c8b2b7549a74ef887081bb8d">QwtPlotLegendItem</a>
, <a class="el" href="class_qwt_plot_text_label.html#a28bba339d2996ae2a8a426575820a816">QwtPlotTextLabel</a>
, <a class="el" href="class_qwt_scale_widget.html#a36d92ef63d996fe1fd58a46431924ab6">QwtScaleWidget</a>
, <a class="el" href="class_qwt_text_label.html#a833d27574b72bbc135f2972c72382eba">QwtTextLabel</a>
</li>
<li>setMargins()
: <a class="el" href="class_qwt_scale_engine.html#aed2ab1fc105a25fa97bbecf4b2f541a7">QwtScaleEngine</a>
</li>
<li>setMarkerSize()
: <a class="el" href="class_qwt_knob.html#a88e06ffddd31d3c0df04771793173353">QwtKnob</a>
</li>
<li>setMarkerStyle()
: <a class="el" href="class_qwt_knob.html#aaa80356a3e3d3703070a6f2b1802646c">QwtKnob</a>
</li>
<li>setMaskMode()
: <a class="el" href="class_qwt_widget_overlay.html#a56828c036263679fc95087bd87496df0">QwtWidgetOverlay</a>
</li>
<li>setMass()
: <a class="el" href="class_qwt_wheel.html#a2af8b9b10ebff58b351027208c1e2b86">QwtWheel</a>
</li>
<li>setMaxColumns()
: <a class="el" href="class_qwt_dyn_grid_layout.html#a436bdce04ae004008acf2e1282941032">QwtDynGridLayout</a>
, <a class="el" href="class_qwt_legend.html#adc427eb1a6ee6a3c17f7c1b8867b48b2">QwtLegend</a>
, <a class="el" href="class_qwt_plot_legend_item.html#a8b6f1db48c05feb5d0f8525b41898be7">QwtPlotLegendItem</a>
</li>
<li>setMaximum()
: <a class="el" href="class_qwt_counter.html#a5ada3f5f233e93e79bfd84eb4dd99519">QwtCounter</a>
, <a class="el" href="class_qwt_wheel.html#a9d3cb6dceb49c33935277603610b7934">QwtWheel</a>
</li>
<li>setMaxScaleArc()
: <a class="el" href="class_qwt_dial.html#ad508f5c8bff6d0ae7023c834b7ed2ee6">QwtDial</a>
</li>
<li>setMaxStackDepth()
: <a class="el" href="class_qwt_plot_zoomer.html#a3965591944793790407ba91d6de3a882">QwtPlotZoomer</a>
</li>
<li>setMaxSymbolWidth()
: <a class="el" href="class_qwt_plot_trading_curve.html#af97b34d767ae5a89076ec79324739bc5">QwtPlotTradingCurve</a>
</li>
<li>setMaxValue()
: <a class="el" href="class_qwt_interval.html#a3eeedaf35966d535670863cb0f97613a">QwtInterval</a>
</li>
<li>setMaxWeeks()
: <a class="el" href="class_qwt_date_scale_engine.html#a0520441c198ee00c9d727340f639504b">QwtDateScaleEngine</a>
</li>
<li>setMidLineWidth()
: <a class="el" href="class_qwt_plot_g_l_canvas.html#a529cce50eea2c9a46fe9c41852f6cee3">QwtPlotGLCanvas</a>
</li>
<li>setMinBorderDist()
: <a class="el" href="class_qwt_scale_widget.html#a4299d99073231d977924c7e40ff9a6a9">QwtScaleWidget</a>
</li>
<li>setMinimum()
: <a class="el" href="class_qwt_counter.html#a511c9d97d31860d1720d8008fb8e2793">QwtCounter</a>
, <a class="el" href="class_qwt_wheel.html#af9c58c5a8097f6e6f87bbaed48e34abb">QwtWheel</a>
</li>
<li>setMinimumExtent()
: <a class="el" href="class_qwt_abstract_scale_draw.html#ac174255c334b995ca010a6964597d5f2">QwtAbstractScaleDraw</a>
</li>
<li>setMinorPen()
: <a class="el" href="class_qwt_plot_grid.html#aeac99ccce0d170a9500f238cf0321669">QwtPlotGrid</a>
</li>
<li>setMinScaleArc()
: <a class="el" href="class_qwt_dial.html#abed02cef48f26bafbf0a92c8c4e5abc9">QwtDial</a>
</li>
<li>setMinSymbolWidth()
: <a class="el" href="class_qwt_plot_trading_curve.html#a8411a6cd96cf521e95a06792a0b99a52">QwtPlotTradingCurve</a>
</li>
<li>setMinValue()
: <a class="el" href="class_qwt_interval.html#ab993dac41ca70402e0cb4f9f980d90f0">QwtInterval</a>
</li>
<li>setMode()
: <a class="el" href="class_qwt_dial.html#a6b070ba6251fa40bbd876551413c5639">QwtDial</a>
, <a class="el" href="class_qwt_linear_color_map.html#afca7397fb6d07d05bab83e83e274a9c2">QwtLinearColorMap</a>
, <a class="el" href="class_qwt_null_paint_device.html#a8b159556695136a58eec6e78fd88957b">QwtNullPaintDevice</a>
</li>
<li>setMouseButton()
: <a class="el" href="class_qwt_magnifier.html#ad814a5d9cb227d6fb56f8289dffe597c">QwtMagnifier</a>
, <a class="el" href="class_qwt_panner.html#a6f138454b2c1d7e814ae1975d6a7b8be">QwtPanner</a>
</li>
<li>setMouseFactor()
: <a class="el" href="class_qwt_magnifier.html#ada5dac479dc1e69c04760bb7dc197ac9">QwtMagnifier</a>
</li>
<li>setMousePattern()
: <a class="el" href="class_qwt_event_pattern.html#a0b786f31af2f8084ec361bc905beda3f">QwtEventPattern</a>
</li>
<li>setNeedle()
: <a class="el" href="class_qwt_dial.html#ac91311f8777eabdbcf6384f308d34a0c">QwtDial</a>
</li>
<li>setNumButtons()
: <a class="el" href="class_qwt_counter.html#ae9241fda2e375becdb484cc2cf7752f4">QwtCounter</a>
</li>
<li>setNumThornLevels()
: <a class="el" href="class_qwt_simple_compass_rose.html#ad91026da3b586a3193a264401221a275">QwtSimpleCompassRose</a>
</li>
<li>setNumThorns()
: <a class="el" href="class_qwt_simple_compass_rose.html#a3c86abb463eb4741d1776318d6fa557b">QwtSimpleCompassRose</a>
</li>
<li>setNumTurns()
: <a class="el" href="class_qwt_knob.html#a8d69c0c3bc110eaa68cfda26d31a8e98">QwtKnob</a>
</li>
<li>setOrientation()
: <a class="el" href="class_qwt_plot_series_item.html#a9d131249079ec3bc503831349bd1a051">QwtPlotSeriesItem</a>
, <a class="el" href="class_qwt_plot_zone_item.html#a0e957d092637846d8c7e7f6d1282e8ac">QwtPlotZoneItem</a>
, <a class="el" href="class_qwt_slider.html#a3a5d51f56dee5e51dc37bb6f546b16b5">QwtSlider</a>
, <a class="el" href="class_qwt_thermo.html#ae6c0926a7d4d163e08a0f940642b2ea9">QwtThermo</a>
, <a class="el" href="class_qwt_wheel.html#acae74c8161fd1df728f26253dd1defa8">QwtWheel</a>
</li>
<li>setOrientations()
: <a class="el" href="class_qwt_panner.html#aaa71a8b6f7f46ae8f5a8084094d7bd9a">QwtPanner</a>
</li>
<li>setOrigin()
: <a class="el" href="class_qwt_dial.html#a3f64c6fbac747f735e57c2073e93bc50">QwtDial</a>
, <a class="el" href="class_qwt_thermo.html#a00f3853e0fabfe89cbf47d35c15b0aa4">QwtThermo</a>
</li>
<li>setOriginMode()
: <a class="el" href="class_qwt_thermo.html#a95cca109a11bba24d8e8a422a3717ab0">QwtThermo</a>
</li>
<li>setPageStepCount()
: <a class="el" href="class_qwt_wheel.html#adeecd6e684163c92143908240f89ce1e">QwtWheel</a>
</li>
<li>setPageSteps()
: <a class="el" href="class_qwt_abstract_slider.html#ae2af9e818c0e7fb39a3a07174e4dabf2">QwtAbstractSlider</a>
</li>
<li>setPaintAttribute()
: <a class="el" href="class_qwt_plot_canvas.html#a7859beb87bcef4fd53f99e7c87104e27">QwtPlotCanvas</a>
, <a class="el" href="class_qwt_plot_curve.html#a7f9c70366415b5cb068af80be5bf3748">QwtPlotCurve</a>
, <a class="el" href="class_qwt_plot_interval_curve.html#ab962c4ad6896bc9d9450f6436f00bd81">QwtPlotIntervalCurve</a>
, <a class="el" href="class_qwt_plot_raster_item.html#a70d6b94821e5eafb29b1f045d1f3a2e6">QwtPlotRasterItem</a>
, <a class="el" href="class_qwt_plot_shape_item.html#acd66d009cd24cdfb418a5cc9486b5001">QwtPlotShapeItem</a>
, <a class="el" href="class_qwt_plot_spectro_curve.html#a3a2ddc8e46bc4414b5ce104e7c70f9b4">QwtPlotSpectroCurve</a>
, <a class="el" href="class_qwt_plot_trading_curve.html#ac0b8015b37a90a5ae995569158fae4e2">QwtPlotTradingCurve</a>
, <a class="el" href="class_qwt_text.html#aac80e3f05137173059b196206ceea9e8">QwtText</a>
</li>
<li>setPaintInterval()
: <a class="el" href="class_qwt_scale_map.html#a994240e446986112f196a65657dc9755">QwtScaleMap</a>
</li>
<li>setPalette()
: <a class="el" href="class_qwt_column_symbol.html#a7d2b17a4b8aef7ae098fd42bc663527b">QwtColumnSymbol</a>
, <a class="el" href="class_qwt_compass_rose.html#ad69f887ed012d6bf6bf2ffeb133e26d5">QwtCompassRose</a>
, <a class="el" href="class_qwt_dial_needle.html#ae850883a64501136bca64d6ea2d084b9">QwtDialNeedle</a>
, <a class="el" href="class_qwt_plot_scale_item.html#aff7adf18c2a6f679227c0fdaa54f39f7">QwtPlotScaleItem</a>
</li>
<li>setPath()
: <a class="el" href="class_qwt_symbol.html#a67a6005486f1ae864acfd4778e9282db">QwtSymbol</a>
</li>
<li>setPen()
: <a class="el" href="class_qwt_interval_symbol.html#a9c3bbee5ea764f246e66bd7bc9382b79">QwtIntervalSymbol</a>
, <a class="el" href="class_qwt_plot_curve.html#ae00bd073a2bcf7c3c810d70af1f86750">QwtPlotCurve</a>
, <a class="el" href="class_qwt_plot_grid.html#aa85de55eb3c28f15d4000a11d194b758">QwtPlotGrid</a>
, <a class="el" href="class_qwt_plot_histogram.html#a57d55a701251e55d52a142d417f12d38">QwtPlotHistogram</a>
, <a class="el" href="class_qwt_plot_interval_curve.html#a41a5be16fecb66885f5dd08779fbee6b">QwtPlotIntervalCurve</a>
, <a class="el" href="class_qwt_plot_shape_item.html#a7626d822bf3d7905a606a0e0c7079c11">QwtPlotShapeItem</a>
, <a class="el" href="class_qwt_plot_zone_item.html#a76a86eb41801930e5733bc509966ee4d">QwtPlotZoneItem</a>
, <a class="el" href="class_qwt_symbol.html#a144ca0e312c4a1e64c2d9e161c01fb7c">QwtSymbol</a>
</li>
<li>setPenWidth()
: <a class="el" href="class_qwt_abstract_scale_draw.html#a098e1f813077c9bb0c5f83266035943a">QwtAbstractScaleDraw</a>
, <a class="el" href="class_qwt_plot_spectro_curve.html#ac3246da1a881538149addc2f22401578">QwtPlotSpectroCurve</a>
</li>
<li>setPinPoint()
: <a class="el" href="class_qwt_symbol.html#a78643c91d94690b91745f10f0601579e">QwtSymbol</a>
</li>
<li>setPinPointEnabled()
: <a class="el" href="class_qwt_symbol.html#a570e07b342701bf37794bf1191917005">QwtSymbol</a>
</li>
<li>setPipeWidth()
: <a class="el" href="class_qwt_thermo.html#a9d3a55a818ebf0dd508e20ca9eef224b">QwtThermo</a>
</li>
<li>setPixmap()
: <a class="el" href="class_qwt_symbol.html#a69b548566bbd186992869b54777a0728">QwtSymbol</a>
</li>
<li>setPlainText()
: <a class="el" href="class_qwt_text_label.html#a02113ab776a00ab8bbc83197ce49445e">QwtTextLabel</a>
</li>
<li>setPlotLayout()
: <a class="el" href="class_qwt_plot.html#a08e258f9ba498662a8be9a559c9c7e44">QwtPlot</a>
</li>
<li>setPoint()
: <a class="el" href="class_qwt_point_polar.html#a8cd4f93356a8a8c07400c3ad9ff1b560">QwtPointPolar</a>
</li>
<li>setPoints()
: <a class="el" href="class_qwt_spline.html#a6ed13410b1d5f6b33ba0e3c2b07932cf">QwtSpline</a>
</li>
<li>setPolygon()
: <a class="el" href="class_qwt_plot_shape_item.html#a9810bd70cfdff88d14f88d9edf20c85b">QwtPlotShapeItem</a>
</li>
<li>setPolylineSplitting()
: <a class="el" href="class_qwt_painter.html#a174bca411198c64dfff828a15d80ddfb">QwtPainter</a>
</li>
<li>setPosition()
: <a class="el" href="class_qwt_plot_scale_item.html#a94536af312bb9d6de5bc7547c59e4faf">QwtPlotScaleItem</a>
</li>
<li>setRadius()
: <a class="el" href="class_qwt_point_polar.html#a31ae2f4d6fad44f51ad5e7444a7f21fe">QwtPointPolar</a>
, <a class="el" href="class_qwt_round_scale_draw.html#a219e0db15594f297ae6ff769fd6c0485">QwtRoundScaleDraw</a>
</li>
<li>setRange()
: <a class="el" href="class_qwt_counter.html#ad794d0d2589a38113933ae764e87ce22">QwtCounter</a>
, <a class="el" href="class_qwt_wheel.html#a572f0bc2c5cd4c4f5e0b0f48c914a0e5">QwtWheel</a>
</li>
<li>setRangeFlags()
: <a class="el" href="class_qwt_thermo.html#aa2ce6d6d20097fead0baca0ab31ef1b2">QwtThermo</a>
</li>
<li>setRawSamples()
: <a class="el" href="class_qwt_plot_curve.html#afd13c94e23520dacbc37b4d0fd036a8b">QwtPlotCurve</a>
</li>
<li>setReadOnly()
: <a class="el" href="class_qwt_abstract_slider.html#a9cc63283a2d4f0bcbb67fd331629a318">QwtAbstractSlider</a>
, <a class="el" href="class_qwt_counter.html#ad34441cf06c68478b826e5b85fbb3ba7">QwtCounter</a>
</li>
<li>setRect()
: <a class="el" href="class_qwt_pixel_matrix.html#ae8150f8d1f1922746172e9da1488e98b">QwtPixelMatrix</a>
, <a class="el" href="class_qwt_plot_shape_item.html#a0a448e4354f67a3957b8123214cd75bb">QwtPlotShapeItem</a>
</li>
<li>setRectOfInterest()
: <a class="el" href="class_qwt_abstract_series_store.html#a8a1cab11ce068f9c578a02d40e111b1a">QwtAbstractSeriesStore</a>
, <a class="el" href="class_qwt_series_data.html#a391b4601a7454b2f9582fbc2662d108e">QwtSeriesData< T ></a>
, <a class="el" href="class_qwt_series_store.html#a64971dd5eaed045b88ac06c9cd8fd6e9">QwtSeriesStore< T ></a>
, <a class="el" href="class_qwt_synthetic_point_data.html#a39cc8512e7d8beecde003f7781174b84">QwtSyntheticPointData</a>
</li>
<li>setReference()
: <a class="el" href="class_qwt_scale_engine.html#a89985ea69dbd858c8b9162ecd2be936e">QwtScaleEngine</a>
</li>
<li>setReferenceAxis()
: <a class="el" href="class_qwt_plot_rescaler.html#a6f13d60cc1e1071a6830ea30ccbcca37">QwtPlotRescaler</a>
</li>
<li>setRenderFlags()
: <a class="el" href="class_qwt_text.html#a2e71d427de766455323794f27d369a5d">QwtText</a>
</li>
<li>setRenderHint()
: <a class="el" href="class_qwt_graphic.html#a494b5de0452120653188828f6a1a6f55">QwtGraphic</a>
, <a class="el" href="class_qwt_plot_item.html#acd023c40f659c304ded324942865edc8">QwtPlotItem</a>
</li>
<li>setRenderMode()
: <a class="el" href="class_qwt_widget_overlay.html#a80fd06e2111993848f45a21627ec09b4">QwtWidgetOverlay</a>
</li>
<li>setRenderThreadCount()
: <a class="el" href="class_qwt_plot_item.html#a188ae18fbbce9adcf259ebe2f0de1f6b">QwtPlotItem</a>
</li>
<li>setRenderTolerance()
: <a class="el" href="class_qwt_plot_shape_item.html#a76f617b8662ed118382d49c5201791e2">QwtPlotShapeItem</a>
</li>
<li>setResampleMode()
: <a class="el" href="class_qwt_matrix_raster_data.html#a038effe6e4be13725b7a8d35370595fd">QwtMatrixRasterData</a>
</li>
<li>setRescalePolicy()
: <a class="el" href="class_qwt_plot_rescaler.html#ae6b7df41b5387d0aed532559546e40b6">QwtPlotRescaler</a>
</li>
<li>setResizeMode()
: <a class="el" href="class_qwt_picker.html#af85c8a3c709bd106d2b34b718a746e03">QwtPicker</a>
</li>
<li>setRose()
: <a class="el" href="class_qwt_compass.html#a06456c0c52107bfa8b1d1267fba5b86f">QwtCompass</a>
</li>
<li>setRoundingAlignment()
: <a class="el" href="class_qwt_painter.html#a49581f980f2c761852cda08502c96abb">QwtPainter</a>
</li>
<li>setRubberBand()
: <a class="el" href="class_qwt_picker.html#a83096bad2662e02e4914a7b40241c351">QwtPicker</a>
</li>
<li>setRubberBandPen()
: <a class="el" href="class_qwt_picker.html#a13117b1929f1ca00a75002f7f4c612bc">QwtPicker</a>
</li>
<li>setSamples()
: <a class="el" href="class_qwt_array_series_data.html#a4afaaf2602be769f4bdcc8fda6b737cb">QwtArraySeriesData< T ></a>
, <a class="el" href="class_qwt_plot_bar_chart.html#a669eb25dba458699465b317f2e96c1eb">QwtPlotBarChart</a>
, <a class="el" href="class_qwt_plot_curve.html#aa51cd3fa00f2a046ca5a9889c5db2413">QwtPlotCurve</a>
, <a class="el" href="class_qwt_plot_histogram.html#a6cc1fe6cd9f7dfc55a2bf5afd02ccce5">QwtPlotHistogram</a>
, <a class="el" href="class_qwt_plot_interval_curve.html#ac60fd04f3000b26ea82342065ba82afe">QwtPlotIntervalCurve</a>
, <a class="el" href="class_qwt_plot_multi_bar_chart.html#ad54633b91b7f602e376f3acb9e235e3c">QwtPlotMultiBarChart</a>
, <a class="el" href="class_qwt_plot_spectro_curve.html#a6374cf95ed6731d098328f2b8c317a8c">QwtPlotSpectroCurve</a>
, <a class="el" href="class_qwt_plot_trading_curve.html#a5675417b12acd80ff37ec66df2907c9f">QwtPlotTradingCurve</a>
</li>
<li>setScale()
: <a class="el" href="class_qwt_abstract_scale.html#ae9640e814b5029d7dd79cb3ba752102b">QwtAbstractScale</a>
</li>
<li>setScaleArc()
: <a class="el" href="class_qwt_dial.html#a8abc41e15c62017d3c3ffb98acb9677f">QwtDial</a>
</li>
<li>setScaleDiv()
: <a class="el" href="class_qwt_abstract_scale_draw.html#a4399aac94a294f5ed6c52114dde00d2f">QwtAbstractScaleDraw</a>
, <a class="el" href="class_qwt_plot_scale_item.html#a99032adf91892f73d06a4810cd78d26b">QwtPlotScaleItem</a>
, <a class="el" href="class_qwt_scale_widget.html#ac7959531c846b54d728b846635fc1406">QwtScaleWidget</a>
</li>
<li>setScaleDivFromAxis()
: <a class="el" href="class_qwt_plot_scale_item.html#a0b4660ad3d3fcf1f1de711b075b073c6">QwtPlotScaleItem</a>
</li>
<li>setScaleDraw()
: <a class="el" href="class_qwt_dial.html#a2ed8a0642e1c612013ba812c7e037404">QwtDial</a>
, <a class="el" href="class_qwt_knob.html#afea44f23da7f79a2b790178850c26edd">QwtKnob</a>
, <a class="el" href="class_qwt_plot_scale_item.html#a0224f2720f3df4fc781d10560a4a1590">QwtPlotScaleItem</a>
, <a class="el" href="class_qwt_scale_widget.html#af93459026340638898c11a799f4ae0c0">QwtScaleWidget</a>
, <a class="el" href="class_qwt_slider.html#a9039a6d5d5bb7b21c312637cf40f8319">QwtSlider</a>
, <a class="el" href="class_qwt_thermo.html#a8b5ab653b893e41116200570632ad1c3">QwtThermo</a>
</li>
<li>setScaleEngine()
: <a class="el" href="class_qwt_abstract_scale.html#aa00f44140af3f2b7595cb6e23371198f">QwtAbstractScale</a>
</li>
<li>setScaleInterval()
: <a class="el" href="class_qwt_scale_map.html#aaa33bc8e1aed7aa17d345053194e7094">QwtScaleMap</a>
</li>
<li>setScaleMaxMajor()
: <a class="el" href="class_qwt_abstract_scale.html#a40fdb4572ad8fdec8b93766ff5f8eda8">QwtAbstractScale</a>
</li>
<li>setScaleMaxMinor()
: <a class="el" href="class_qwt_abstract_scale.html#a6520bb1e52571f865b21b3710786a4db">QwtAbstractScale</a>
</li>
<li>setScalePosition()
: <a class="el" href="class_qwt_slider.html#a530aa52c218ad27e8eebbecc7a27e25a">QwtSlider</a>
, <a class="el" href="class_qwt_thermo.html#a0306a248194d2f8c08ba90506122d6ca">QwtThermo</a>
</li>
<li>setScaleRect()
: <a class="el" href="class_qwt_plot_layout.html#a842733777eb2b0bf2cacc4bb01c169c7">QwtPlotLayout</a>
</li>
<li>setScaleStepSize()
: <a class="el" href="class_qwt_abstract_scale.html#aac745efd9414e529794e2189f7c535cb">QwtAbstractScale</a>
</li>
<li>setShape()
: <a class="el" href="class_qwt_plot_shape_item.html#a0a8f3ed22324b23d04588cc749b74674">QwtPlotShapeItem</a>
</li>
<li>setShrinkFactor()
: <a class="el" href="class_qwt_simple_compass_rose.html#afaf84e19eb8eb2360306860b02d46cfc">QwtSimpleCompassRose</a>
</li>
<li>setSingleStep()
: <a class="el" href="class_qwt_counter.html#a7d1057b48f57d890bf5c60259b456350">QwtCounter</a>
, <a class="el" href="class_qwt_wheel.html#a63f5d4794cc1e624ab305083c7f4ed29">QwtWheel</a>
</li>
<li>setSingleSteps()
: <a class="el" href="class_qwt_abstract_slider.html#ad470727c9fa3da9c50e26138cf03623e">QwtAbstractSlider</a>
</li>
<li>setSize()
: <a class="el" href="class_qwt_symbol.html#afd5587cd1752594954ca6146f643acfb">QwtSymbol</a>
, <a class="el" href="class_qwt_synthetic_point_data.html#a321754c5acac77e0e5685968b1cdfdae">QwtSyntheticPointData</a>
</li>
<li>setSpacing()
: <a class="el" href="class_qwt_abstract_scale_draw.html#ae5bdaadb303510f7eb9dbec5c52f7a47">QwtAbstractScaleDraw</a>
, <a class="el" href="class_qwt_legend_label.html#ad19d9ee759551f1fe785dc0ad806fd59">QwtLegendLabel</a>
, <a class="el" href="class_qwt_plot_abstract_bar_chart.html#a0cb5bd5a653918b1513fa87ad75fa8b1">QwtPlotAbstractBarChart</a>
, <a class="el" href="class_qwt_plot_layout.html#a6508553ec1d66bede49e7767526c3d03">QwtPlotLayout</a>
, <a class="el" href="class_qwt_plot_legend_item.html#a9932f074e5861464a055fdce6394889c">QwtPlotLegendItem</a>
, <a class="el" href="class_qwt_plot_marker.html#a856c9c5c6e22d86461ee6df101534831">QwtPlotMarker</a>
, <a class="el" href="class_qwt_scale_widget.html#aaaad9f3d54fd329b16b738ca2df00ddf">QwtScaleWidget</a>
, <a class="el" href="class_qwt_slider.html#a947f384faba10690bbff780bfe9e420f">QwtSlider</a>
, <a class="el" href="class_qwt_thermo.html#a5d772862c760019a7797f45aa6b0690f">QwtThermo</a>
</li>
<li>setSpline()
: <a class="el" href="class_qwt_spline_curve_fitter.html#a7f819ad010b19d58179655e4ceb1c6f1">QwtSplineCurveFitter</a>
</li>
<li>setSplineSize()
: <a class="el" href="class_qwt_spline_curve_fitter.html#a8ecea80fb540b92cd22b6b0703636460">QwtSplineCurveFitter</a>
</li>
<li>setSplineType()
: <a class="el" href="class_qwt_spline.html#a222953661f01658a16042d587196aff8">QwtSpline</a>
</li>
<li>setState()
: <a class="el" href="class_qwt_picker_machine.html#a569c426543e4a6aa15c221eb7c4910f0">QwtPickerMachine</a>
</li>
<li>setStateMachine()
: <a class="el" href="class_qwt_picker.html#a5ff72a5658631bcad3857ca5cfd3e6d9">QwtPicker</a>
</li>
<li>setStepAlignment()
: <a class="el" href="class_qwt_abstract_slider.html#a758fe135e2ee173c98dac70777e6dd4c">QwtAbstractSlider</a>
, <a class="el" href="class_qwt_wheel.html#a5e5bf1d335538ff6971d48b914f26d51">QwtWheel</a>
</li>
<li>setStepButton1()
: <a class="el" href="class_qwt_counter.html#ae56a556a72955b6d10419f2c41779383">QwtCounter</a>
</li>
<li>setStepButton2()
: <a class="el" href="class_qwt_counter.html#a0d764a96706593d8c8b51338e92abfcc">QwtCounter</a>
</li>
<li>setStepButton3()
: <a class="el" href="class_qwt_counter.html#a8b55539578de083793b8310cb8909294">QwtCounter</a>
</li>
<li>setStyle()
: <a class="el" href="class_qwt_column_symbol.html#a3e2c72514fdc2e857ee2a34bc9f96e93">QwtColumnSymbol</a>
, <a class="el" href="class_qwt_interval_symbol.html#a24d64169355cc200a49af15c08fe93fc">QwtIntervalSymbol</a>
, <a class="el" href="class_qwt_plot_curve.html#a2de41014c2b87fd459d0c438a15dd33e">QwtPlotCurve</a>
, <a class="el" href="class_qwt_plot_histogram.html#a449af026888616f08b45e980d9da57fe">QwtPlotHistogram</a>
, <a class="el" href="class_qwt_plot_interval_curve.html#a74e6c2bf66e0436e827b5b017b943cad">QwtPlotIntervalCurve</a>
, <a class="el" href="class_qwt_plot_multi_bar_chart.html#a4daa7bdd0043eeafe5ab6e5db290181d">QwtPlotMultiBarChart</a>
, <a class="el" href="class_qwt_symbol.html#a4d3b9f3dd8c4ca034694b86372b74eb9">QwtSymbol</a>
</li>
<li>setSvgDocument()
: <a class="el" href="class_qwt_symbol.html#a5e6a790b3133c878fde132a7fcf91475">QwtSymbol</a>
</li>
<li>setSymbol()
: <a class="el" href="class_qwt_plot_bar_chart.html#a3e3c50c37484c3049dc9f433269e9a44">QwtPlotBarChart</a>
, <a class="el" href="class_qwt_plot_curve.html#a413b1a18de12ece4dec5ae0738ecd03f">QwtPlotCurve</a>
, <a class="el" href="class_qwt_plot_histogram.html#aa662f072a1758bfac9c0c86136ee27ad">QwtPlotHistogram</a>
, <a class="el" href="class_qwt_plot_interval_curve.html#a4bc2408868638a41f5baa70b759283a2">QwtPlotIntervalCurve</a>
, <a class="el" href="class_qwt_plot_marker.html#af44231c2b63bb277706e4f515297c7b1">QwtPlotMarker</a>
, <a class="el" href="class_qwt_plot_multi_bar_chart.html#ad08e420c6c450672694e9bf253dc8b3b">QwtPlotMultiBarChart</a>
</li>
<li>setSymbolBrush()
: <a class="el" href="class_qwt_plot_trading_curve.html#ac9ec84c2c75ff3a5597cd30aafbd76c2">QwtPlotTradingCurve</a>
</li>
<li>setSymbolExtent()
: <a class="el" href="class_qwt_plot_trading_curve.html#af52822a65584bbd19255e6b99fe9e8b2">QwtPlotTradingCurve</a>
</li>
<li>setSymbolPen()
: <a class="el" href="class_qwt_plot_trading_curve.html#aec9c455a3a877c36d408383e5b4700e0">QwtPlotTradingCurve</a>
</li>
<li>setSymbolStyle()
: <a class="el" href="class_qwt_plot_trading_curve.html#a0c9928481272af1487baa4e0dcd47202">QwtPlotTradingCurve</a>
</li>
<li>setText()
: <a class="el" href="class_qwt_legend_label.html#a2498e1b2e1a17abf63fa4d94a08ebb95">QwtLegendLabel</a>
, <a class="el" href="class_qwt_plot_text_label.html#adce2e99ef7816ff544c5a5525bf05006">QwtPlotTextLabel</a>
, <a class="el" href="class_qwt_text.html#a9ba9caa82fcfbc4bfbf8ce20ccea981e">QwtText</a>
, <a class="el" href="class_qwt_text_label.html#ac43ba313b78dccf7aa7433f26059b2e2">QwtTextLabel</a>
</li>
<li>setTextEngine()
: <a class="el" href="class_qwt_text.html#aef6a1e71b1feba3116ce69f6c9de70ad">QwtText</a>
</li>
<li>setTextPen()
: <a class="el" href="class_qwt_plot_legend_item.html#ae41a2af3f5353a01ed5d4dd786b84ef7">QwtPlotLegendItem</a>
</li>
<li>setTickCount()
: <a class="el" href="class_qwt_wheel.html#ae13600528c5b13a27b4220ac53b22153">QwtWheel</a>
</li>
<li>setTickLength()
: <a class="el" href="class_qwt_abstract_scale_draw.html#a7fed388e435aae791d61f48cc9ddf632">QwtAbstractScaleDraw</a>
</li>
<li>setTicks()
: <a class="el" href="class_qwt_scale_div.html#af67401fd5d16138eddede3381c559964">QwtScaleDiv</a>
</li>
<li>setTime()
: <a class="el" href="class_qwt_analog_clock.html#aa99a628b290789583052bcec9163d95c">QwtAnalogClock</a>
</li>
<li>setTimeSpec()
: <a class="el" href="class_qwt_date_scale_draw.html#a278fdb655a98dda440ce5c0f8fc82c4e">QwtDateScaleDraw</a>
, <a class="el" href="class_qwt_date_scale_engine.html#addbf8fdc00c2de0c6afe436ef25b3bef">QwtDateScaleEngine</a>
</li>
<li>setTitle()
: <a class="el" href="class_qwt_plot.html#a032ced8ddfad7483a372214954203719">QwtPlot</a>
, <a class="el" href="class_qwt_plot_item.html#a2db3214b23b78274fa6f8c0321a76839">QwtPlotItem</a>
, <a class="el" href="class_qwt_scale_widget.html#a28ad440a43978d2d50f19e17d0776403">QwtScaleWidget</a>
</li>
<li>setTitleRect()
: <a class="el" href="class_qwt_plot_layout.html#a82b49e88c7928224c4b0342b6302c086">QwtPlotLayout</a>
</li>
<li>setTolerance()
: <a class="el" href="class_qwt_weeding_curve_fitter.html#a62c303f6826fef2be7b7bbe82f530680">QwtWeedingCurveFitter</a>
</li>
<li>setTotalAngle()
: <a class="el" href="class_qwt_knob.html#a82c6a859d63833894a6e66f0fdbf8f05">QwtKnob</a>
, <a class="el" href="class_qwt_wheel.html#ae4e5dfd4c6683706716681cfd7e3d8bf">QwtWheel</a>
</li>
<li>setTotalSteps()
: <a class="el" href="class_qwt_abstract_slider.html#a60eea9d9996c99abcb7d50f5ed2634f8">QwtAbstractSlider</a>
</li>
<li>setTrackerFont()
: <a class="el" href="class_qwt_picker.html#a9f54cce7d2e3f6e06351315bf655d5d9">QwtPicker</a>
</li>
<li>setTrackerMode()
: <a class="el" href="class_qwt_picker.html#a94fc60c7223cdc470ae63156f6446d6f">QwtPicker</a>
</li>
<li>setTrackerPen()
: <a class="el" href="class_qwt_picker.html#af703bc51cda716e503cbd86731270e5b">QwtPicker</a>
</li>
<li>setTracking()
: <a class="el" href="class_qwt_abstract_slider.html#a58d37e22b616787793a9e62ec7c5adc3">QwtAbstractSlider</a>
, <a class="el" href="class_qwt_wheel.html#a181ca4c891e763ebe30a0ed74a329c2b">QwtWheel</a>
</li>
<li>setTransformation()
: <a class="el" href="class_qwt_abstract_scale_draw.html#a732d0e49c9092c48893b4f71cc7357db">QwtAbstractScaleDraw</a>
, <a class="el" href="class_qwt_scale_engine.html#ad063f4bb947996191be5c2a5fa0dbaf6">QwtScaleEngine</a>
, <a class="el" href="class_qwt_scale_map.html#ad8e971dd4be07801f0adc99549153718">QwtScaleMap</a>
, <a class="el" href="class_qwt_scale_widget.html#a749ea25d3e0ab0d7e6335982f3919055">QwtScaleWidget</a>
</li>
<li>setTrough()
: <a class="el" href="class_qwt_slider.html#ab4de4c649662416dc12c92c8e7cd0273">QwtSlider</a>
</li>
<li>setUpdateInterval()
: <a class="el" href="class_qwt_slider.html#aeaab96d3554d509dbdd93a539617b9e9">QwtSlider</a>
, <a class="el" href="class_qwt_wheel.html#a5c234f68f0ff9906e2861e6fcd9dcc54">QwtWheel</a>
</li>
<li>setUpperBound()
: <a class="el" href="class_qwt_abstract_scale.html#a1b2ea5c97eb19ccd55ec83713ab675fe">QwtAbstractScale</a>
, <a class="el" href="class_qwt_scale_div.html#a56545b9c67dcfb4bd0c7b5fc430ab70d">QwtScaleDiv</a>
</li>
<li>setUtcOffset()
: <a class="el" href="class_qwt_date_scale_draw.html#ab97b5fc37dc46dcf635a56e13d7b93a3">QwtDateScaleDraw</a>
, <a class="el" href="class_qwt_date_scale_engine.html#a47dc382bbdf3e415b40543fc2736537f">QwtDateScaleEngine</a>
</li>
<li>setValid()
: <a class="el" href="class_qwt_abstract_slider.html#a6b527ff0d2f96b85465fd73250d2e03f">QwtAbstractSlider</a>
, <a class="el" href="class_qwt_counter.html#aa06625ab417f82fdc82790e3376af708">QwtCounter</a>
</li>
<li>setValue()
: <a class="el" href="class_qwt_abstract_slider.html#ac3713f8989b647cb79f0a5894991e36a">QwtAbstractSlider</a>
, <a class="el" href="class_qwt_counter.html#a429a2e986aa46c1231643df5d4c78970">QwtCounter</a>
, <a class="el" href="class_qwt_legend_data.html#a1be4b4cf3c1df733744633ea6c02346a">QwtLegendData</a>
, <a class="el" href="class_qwt_matrix_raster_data.html#a4601944bceabd921cdaa544180576274">QwtMatrixRasterData</a>
, <a class="el" href="class_qwt_plot_marker.html#a290374903ca168104dbce7e2058774c3">QwtPlotMarker</a>
, <a class="el" href="class_qwt_thermo.html#ad54ebf4761c12f948d09cd45a26d1fd4">QwtThermo</a>
, <a class="el" href="class_qwt_wheel.html#a6f46526b283b7fde127bc595c96db7e8">QwtWheel</a>
</li>
<li>setValueMatrix()
: <a class="el" href="class_qwt_matrix_raster_data.html#a578ffc26f04a9099e2b31fc2d9360adb">QwtMatrixRasterData</a>
</li>
<li>setValues()
: <a class="el" href="class_qwt_legend_data.html#a68c3bc398c541f345a12fa9321ad52ed">QwtLegendData</a>
</li>
<li>setViewAngle()
: <a class="el" href="class_qwt_wheel.html#a7f15b6aef98ad6b52bebc749381bc753">QwtWheel</a>
</li>
<li>setVisible()
: <a class="el" href="class_qwt_plot_item.html#a5f0eeb2b72207fd8d33a95b0565657a1">QwtPlotItem</a>
</li>
<li>setWeek0Type()
: <a class="el" href="class_qwt_date_scale_draw.html#acd5e9ce4e1e98e849d6002d22b2f7198">QwtDateScaleDraw</a>
, <a class="el" href="class_qwt_date_scale_engine.html#a5e11c5e7c4f58063ded8f6d35d2816f4">QwtDateScaleEngine</a>
</li>
<li>setWheelBorderWidth()
: <a class="el" href="class_qwt_wheel.html#a4aa70134746908cef687e3c1bb7aa60c">QwtWheel</a>
</li>
<li>setWheelFactor()
: <a class="el" href="class_qwt_magnifier.html#ae3a33ab8776ed2122fecc821a32bb36a">QwtMagnifier</a>
</li>
<li>setWheelModifiers()
: <a class="el" href="class_qwt_magnifier.html#aadfc853d8619b43b21564d8d5fe50093">QwtMagnifier</a>
</li>
<li>setWheelWidth()
: <a class="el" href="class_qwt_wheel.html#ac434254039981344ccca22c76bce4f38">QwtWheel</a>
</li>
<li>setWidth()
: <a class="el" href="class_qwt_dial_simple_needle.html#ad7672543371e38c864e44d9240271c22">QwtDialSimpleNeedle</a>
, <a class="el" href="class_qwt_interval_symbol.html#adfacdeb67c9e6d194df4d3d627de23eb">QwtIntervalSymbol</a>
, <a class="el" href="class_qwt_simple_compass_rose.html#ae4067a436f45d2f2ca23d8233539566b">QwtSimpleCompassRose</a>
</li>
<li>setWrapping()
: <a class="el" href="class_qwt_abstract_slider.html#ada27ca51ab146554b981fafed38e41e0">QwtAbstractSlider</a>
, <a class="el" href="class_qwt_counter.html#a8fc7d115682f295dfcc64fa8312ccdeb">QwtCounter</a>
, <a class="el" href="class_qwt_wheel.html#a4ee4c2bcd6536f7639b5e275ab3235c2">QwtWheel</a>
</li>
<li>setX()
: <a class="el" href="class_qwt_point3_d.html#afe85919187fd62bc3db082d1e2b17bac">QwtPoint3D</a>
</li>
<li>setXAxis()
: <a class="el" href="class_qwt_plot_item.html#a81d3dd7feaadda4b0dbb8c13642046cf">QwtPlotItem</a>
</li>
<li>setXDiv()
: <a class="el" href="class_qwt_plot_grid.html#aeeb88397c2aaf5e763d57c898a2fcd13">QwtPlotGrid</a>
</li>
<li>setXValue()
: <a class="el" href="class_qwt_plot_marker.html#a0d53b0e0ed8b48478c02a0ecaf5852b2">QwtPlotMarker</a>
</li>
<li>setY()
: <a class="el" href="class_qwt_point3_d.html#a986ba13d44e6960b4fb72795be4ff66a">QwtPoint3D</a>
</li>
<li>setYAxis()
: <a class="el" href="class_qwt_plot_item.html#aa92dad876d76ce136925d5ae8f01db9a">QwtPlotItem</a>
</li>
<li>setYDiv()
: <a class="el" href="class_qwt_plot_grid.html#a9eb130275560bdaa65551e2f69232b72">QwtPlotGrid</a>
</li>
<li>setYValue()
: <a class="el" href="class_qwt_plot_marker.html#a47d8e3c0708ad02a9c7cc6aaf985e278">QwtPlotMarker</a>
</li>
<li>setZ()
: <a class="el" href="class_qwt_plot_item.html#a57d90e4146133b59d589c71b3a643e82">QwtPlotItem</a>
, <a class="el" href="class_qwt_point3_d.html#ae4bed4f5b955843dcf92302b16799e8b">QwtPoint3D</a>
</li>
<li>setZoomBase()
: <a class="el" href="class_qwt_plot_zoomer.html#a4376cd882cf72e1794cbbe7264ee96fb">QwtPlotZoomer</a>
</li>
<li>setZoomInKey()
: <a class="el" href="class_qwt_magnifier.html#a004d9e770ed745bbcb5dcdb7a7ecc0a9">QwtMagnifier</a>
</li>
<li>setZoomOutKey()
: <a class="el" href="class_qwt_magnifier.html#a095a8cc622175fafc5b3cc6eb274af07">QwtMagnifier</a>
</li>
<li>setZoomStack()
: <a class="el" href="class_qwt_plot_zoomer.html#afc12a6e757768a71d1c74b90931bfc70">QwtPlotZoomer</a>
</li>
<li>shape()
: <a class="el" href="class_qwt_plot_shape_item.html#ab14eeb97e17da5ee1f458ef9c74afb20">QwtPlotShapeItem</a>
</li>
<li>show()
: <a class="el" href="class_qwt_plot_item.html#a93a50fb9c86bc66617e28315e02281c3">QwtPlotItem</a>
</li>
<li>shrinkFactor()
: <a class="el" href="class_qwt_simple_compass_rose.html#a49ac7941c4a09f5a33e660b130d7bc2e">QwtSimpleCompassRose</a>
</li>
<li>singleStep()
: <a class="el" href="class_qwt_counter.html#a0057de1b365b6f18309c29c7b210cdd1">QwtCounter</a>
, <a class="el" href="class_qwt_wheel.html#a153e7629785d63a52b089c528a008578">QwtWheel</a>
</li>
<li>singleSteps()
: <a class="el" href="class_qwt_abstract_slider.html#a749174444d3e63c232492edba727adfe">QwtAbstractSlider</a>
</li>
<li>size()
: <a class="el" href="class_qwt_array_series_data.html#a52c123dcc321a03ccd18c2c138318025">QwtArraySeriesData< T ></a>
, <a class="el" href="class_qwt_c_pointer_data.html#a780b9ae434856509cef9bbe954f03a3e">QwtCPointerData</a>
, <a class="el" href="class_qwt_point_array_data.html#a2222b2ad6346dc6357a412fc50ec8f56">QwtPointArrayData</a>
, <a class="el" href="class_qwt_series_data.html#af18b57ccc6d9e0354662e53b41397a13">QwtSeriesData< T ></a>
, <a class="el" href="class_qwt_symbol.html#a3aba8eed9fcd85f4a4799e63543a2398">QwtSymbol</a>
, <a class="el" href="class_qwt_synthetic_point_data.html#a61b2cc26e1b5fa4a64e29273cf3e1599">QwtSyntheticPointData</a>
</li>
<li>sizeHint()
: <a class="el" href="class_qwt_arrow_button.html#a180ca16baa83c02e8dca4ffbe3dba2e8">QwtArrowButton</a>
, <a class="el" href="class_qwt_counter.html#a9ccdfd602ccd5ecd8595172cd22b2b27">QwtCounter</a>
, <a class="el" href="class_qwt_dial.html#a7d79a5c1cbaadb1ded9306044fa2a4a1">QwtDial</a>
, <a class="el" href="class_qwt_dyn_grid_layout.html#afed46e3a8e1b6e67dcf62eca0bc948d6">QwtDynGridLayout</a>
, <a class="el" href="class_qwt_knob.html#ac5f92af50fdcbf0b501f18efd07294fd">QwtKnob</a>
, <a class="el" href="class_qwt_legend.html#a2517a7d9d78ab7a3892125ecf755f33f">QwtLegend</a>
, <a class="el" href="class_qwt_legend_label.html#a58cf61eb9e87fe7a36266e687fe721eb">QwtLegendLabel</a>
, <a class="el" href="class_qwt_plot.html#a8e25bdd9b085344227a7f9e218ce557c">QwtPlot</a>
, <a class="el" href="class_qwt_scale_widget.html#a5ed815b5ac0ed7d43ab923fcd1f5da3d">QwtScaleWidget</a>
, <a class="el" href="class_qwt_slider.html#a31c4c636f8b762e390beaf501bedcffc">QwtSlider</a>
, <a class="el" href="class_qwt_text_label.html#a0217bc022e6f3b2f22819c84d5867ae7">QwtTextLabel</a>
, <a class="el" href="class_qwt_thermo.html#abdb43977b3628a0b42039bef071c81cd">QwtThermo</a>
, <a class="el" href="class_qwt_wheel.html#a77404d4e604a196bd4e809ec7d9f2076">QwtWheel</a>
</li>
<li>sizeMetrics()
: <a class="el" href="class_qwt_graphic.html#a8996e22267dc37c9bc18dd9392ec5916">QwtGraphic</a>
, <a class="el" href="class_qwt_null_paint_device.html#afb8da1b931a42cc370b77323ff6a28cc">QwtNullPaintDevice</a>
</li>
<li>sliderChange()
: <a class="el" href="class_qwt_abstract_slider.html#a36ac20a000d40b2fddf5c144d1133f77">QwtAbstractSlider</a>
, <a class="el" href="class_qwt_dial.html#a9e9e5a3aac1bc3752de8ab0a7ef71be2">QwtDial</a>
</li>
<li>sliderMoved()
: <a class="el" href="class_qwt_abstract_slider.html#ae59671d27931b545073e599a10967452">QwtAbstractSlider</a>
</li>
<li>sliderPressed()
: <a class="el" href="class_qwt_abstract_slider.html#afd92a0c79c113b3c5e9952d12cff80f5">QwtAbstractSlider</a>
</li>
<li>sliderRect()
: <a class="el" href="class_qwt_slider.html#af5355e9015fc49a3d978603cb8b9bbee">QwtSlider</a>
</li>
<li>sliderReleased()
: <a class="el" href="class_qwt_abstract_slider.html#ab94184da7a029a5f586671251ff380ea">QwtAbstractSlider</a>
</li>
<li>spacing()
: <a class="el" href="class_qwt_abstract_scale_draw.html#a93561d85e879402086f2607e45e89cc2">QwtAbstractScaleDraw</a>
, <a class="el" href="class_qwt_legend_label.html#aa976458d79004b7b29ebea3cf0a069de">QwtLegendLabel</a>
, <a class="el" href="class_qwt_plot_abstract_bar_chart.html#a0a2e625021bba3b9224b410281fddcf9">QwtPlotAbstractBarChart</a>
, <a class="el" href="class_qwt_plot_layout.html#ae93650a8f3208578f87348334b77a282">QwtPlotLayout</a>
, <a class="el" href="class_qwt_plot_legend_item.html#a4906d4e498c3b537a6354e2a1293a9c9">QwtPlotLegendItem</a>
, <a class="el" href="class_qwt_plot_marker.html#ad7655fdd7089b6c8058c238f1462f298">QwtPlotMarker</a>
, <a class="el" href="class_qwt_scale_widget.html#a1bdb5b6fa77a4535087f1c672ee394ce">QwtScaleWidget</a>
, <a class="el" href="class_qwt_slider.html#aafa34f60f76fb7786d992cc90116e6b6">QwtSlider</a>
, <a class="el" href="class_qwt_thermo.html#a16ca09c525bb05c7316ae6accb7aad79">QwtThermo</a>
</li>
<li>specialSymbol()
: <a class="el" href="class_qwt_plot_bar_chart.html#a4a1e222c476d5909b7479bad4197f62b">QwtPlotBarChart</a>
, <a class="el" href="class_qwt_plot_multi_bar_chart.html#af94cc6845797ada8a9be828401375e39">QwtPlotMultiBarChart</a>
</li>
<li>spline()
: <a class="el" href="class_qwt_spline_curve_fitter.html#ac501260a25953e1ded6bbc84c3250fa8">QwtSplineCurveFitter</a>
</li>
<li>splineSize()
: <a class="el" href="class_qwt_spline_curve_fitter.html#a09e5cb291c90db0aa8e6e51377bc9308">QwtSplineCurveFitter</a>
</li>
<li>splineType()
: <a class="el" href="class_qwt_spline.html#a36442cbb781422e5b97ae242265dd4b4">QwtSpline</a>
</li>
<li>start()
: <a class="el" href="class_qwt_system_clock.html#a3408bd55b49582f7847865aacc7beb37">QwtSystemClock</a>
</li>
<li>startBorderDist()
: <a class="el" href="class_qwt_scale_widget.html#ab82bb290d685dfaec3894f5892f04ef9">QwtScaleWidget</a>
</li>
<li>state()
: <a class="el" href="class_qwt_picker_machine.html#a9060b1036ef5125968fc7030681d73c0">QwtPickerMachine</a>
</li>
<li>stateData()
: <a class="el" href="class_qwt_painter_command.html#a12f846b9964f499a568d0b61876173ec">QwtPainterCommand</a>
</li>
<li>stateMachine()
: <a class="el" href="class_qwt_picker.html#afec1e9a7c913893f49df1dccf150e0ec">QwtPicker</a>
</li>
<li>stepAlignment()
: <a class="el" href="class_qwt_abstract_slider.html#a3c30c64a3bfc03a12131476e034e5a2c">QwtAbstractSlider</a>
, <a class="el" href="class_qwt_wheel.html#a3738470b6ea312ee47ba53ddfbdf355c">QwtWheel</a>
</li>
<li>stepButton1()
: <a class="el" href="class_qwt_counter.html#a8e0b28f111c45b3a2241fd8889bc8bce">QwtCounter</a>
</li>
<li>stepButton2()
: <a class="el" href="class_qwt_counter.html#a7d99de95e1c05e4994413e6d8cd641fe">QwtCounter</a>
</li>
<li>stepButton3()
: <a class="el" href="class_qwt_counter.html#abc6eb2073cc7d7b5f1d7e4c6c7b205c9">QwtCounter</a>
</li>
<li>stop()
: <a class="el" href="class_qwt_sampling_thread.html#ac644ff417342617a39dbd86e50d09132">QwtSamplingThread</a>
</li>
<li>stopFlying()
: <a class="el" href="class_qwt_wheel.html#af46272363dc06755e2d4c7e448664ff8">QwtWheel</a>
</li>
<li>stretchGrid()
: <a class="el" href="class_qwt_dyn_grid_layout.html#aba94fa07d16ec2d36589b777dc853605">QwtDynGridLayout</a>
</li>
<li>stretchSelection()
: <a class="el" href="class_qwt_picker.html#a24b0e4bcf6a9b7f41c81ea19305105a8">QwtPicker</a>
</li>
<li>strip()
: <a class="el" href="class_qwt_scale_engine.html#ab2b5b3c6081e1d0007f904dbc3f9f7f1">QwtScaleEngine</a>
</li>
<li>style()
: <a class="el" href="class_qwt_column_symbol.html#a3cf6f4e696a6df0936160d6bdb8e6b25">QwtColumnSymbol</a>
, <a class="el" href="class_qwt_interval_symbol.html#a301b219e05ee54fd49dafd969bc4ddd7">QwtIntervalSymbol</a>
, <a class="el" href="class_qwt_plot_curve.html#a2df43bdea2a17118c9114d6fa774e598">QwtPlotCurve</a>
, <a class="el" href="class_qwt_plot_histogram.html#a00915a951baa4fb251f5614cb0dd8aa9">QwtPlotHistogram</a>
, <a class="el" href="class_qwt_plot_interval_curve.html#ada1fea7fe0359c1bc175b3a2baf10c87">QwtPlotIntervalCurve</a>
, <a class="el" href="class_qwt_plot_multi_bar_chart.html#a8420d5b608303727564539e3b08ef7cc">QwtPlotMultiBarChart</a>
, <a class="el" href="class_qwt_symbol.html#a5e5811e1a1621e617716a2a62578b507">QwtSymbol</a>
</li>
<li>swapData()
: <a class="el" href="class_qwt_series_store.html#a5f47997d53d580e6a12a6ca61b7225b0">QwtSeriesStore< T ></a>
</li>
<li>symbol()
: <a class="el" href="class_qwt_plot_bar_chart.html#abf3aabedfb304ef4154dec6918cb9ff7">QwtPlotBarChart</a>
, <a class="el" href="class_qwt_plot_curve.html#a38e6e66301d602e80bf751f43820c080">QwtPlotCurve</a>
, <a class="el" href="class_qwt_plot_histogram.html#a5815e991c891210789fef0295047f790">QwtPlotHistogram</a>
, <a class="el" href="class_qwt_plot_interval_curve.html#a178654ee5b40932b06bbfcf5cb96ca7e">QwtPlotIntervalCurve</a>
, <a class="el" href="class_qwt_plot_marker.html#ac3f7385b517bb8d7f0f572bfdecbc222">QwtPlotMarker</a>
, <a class="el" href="class_qwt_plot_multi_bar_chart.html#a331b06acee387cd152a6ce440e7aeaca">QwtPlotMultiBarChart</a>
</li>
<li>symbolBrush()
: <a class="el" href="class_qwt_plot_trading_curve.html#a55377e71da70b9040bc0b7a410c6aa97">QwtPlotTradingCurve</a>
</li>
<li>symbolExtent()
: <a class="el" href="class_qwt_plot_trading_curve.html#abe2c4f7a1fd7b6643e7a4065313b0ff4">QwtPlotTradingCurve</a>
</li>
<li>symbolPen()
: <a class="el" href="class_qwt_plot_trading_curve.html#ae317bb564cbc142899d6832a34b6d225">QwtPlotTradingCurve</a>
</li>
<li>symbolStyle()
: <a class="el" href="class_qwt_plot_trading_curve.html#a0b4e200a5ff4f3c05bd0be6487f8ee27">QwtPlotTradingCurve</a>
</li>
<li>symmetrize()
: <a class="el" href="class_qwt_interval.html#a86dae3b22782b8548fd4e2c625bf1830">QwtInterval</a>
</li>
<li>syncScale()
: <a class="el" href="class_qwt_plot_rescaler.html#a1a83473ef31ff45d1595eca80c2d3b1d">QwtPlotRescaler</a>
</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
</ul>
</div>
</body>
</html>
|
PTDreamer/loraRC
|
configurator/loraapp/qwt/doc/html/functions_func_s.html
|
HTML
|
gpl-3.0
| 77,901
|
# -*- coding: utf-8 -*-
import re
import lxml.html
from billy.scrape.committees import CommitteeScraper, Committee
from openstates.utils import LXMLMixin
class NYCommitteeScraper(CommitteeScraper, LXMLMixin):
jurisdiction = "ny"
latest_only = True
def _parse_name(self, name):
"""
Split a committee membership string into name and role.
>>> parse_name('Felix Ortiz')
('Felix Ortiz', 'member')
>>> parse_name('Felix Ortiz (Chair)')
('Felix Ortiz', 'chair')
>>> parse_name('Hon. Felix Ortiz, Co-Chair')
('Felix Ortiz', 'co-chair')
>>> parse_name('Owen H.\\r\\nJohnson (Vice Chairperson)')
('Owen H. Johnson', 'vice chairperson')
"""
name = re.sub(r'^(Hon\.|Assemblyman|Assemblywoman)\s+', '', name)
name = re.sub(r'\s+', ' ', name)
roles = ['Chairwoman', 'Chairperson', 'Chair', 'Secretary',
'Treasurer', 'Parliamentarian', 'Chaplain']
match = re.match(
r'([^(]+),? \(?((Co|Vice)?-?\s*(%s))\)?' % '|'.join(roles),
name)
role = 'member'
if match:
name = match.group(1).strip(' ,')
role = match.group(2).lower()
name = name.replace('Sen.', '').replace('Rep.', '').strip()
return (name, role)
def scrape(self, chamber, term):
getattr(self, 'scrape_' + chamber + '_chamber')()
def scrape_lower_chamber(self, only_names=None):
url = 'http://assembly.state.ny.us/comm/'
page = self.lxmlize(url)
committees = []
link_nodes = self.get_nodes(
page,
'//a[contains(@href, "sec=mem")]')
for link_node in link_nodes:
committee_name_text = self.get_node(
link_node,
'../strong/text()')
if committee_name_text is not None:
committee_name = committee_name_text.strip()
assert committee_name
if 'Caucus' in committee_name:
continue
committees.append(committee_name)
url = link_node.attrib['href']
committee = self.scrape_lower_committee(committee_name, url)
self.save_committee(committee)
return committees
def scrape_lower_committee(self, name, url):
page = self.lxmlize(url)
committee = Committee('lower', name)
committee.add_source(url)
seen = set()
member_links = self.get_nodes(
page,
'//div[@class="commlinks"]//a[contains(@href, "mem")]')
for member_link in member_links:
member_name = None
member_role = None
member_text = member_link.text
if member_text is not None:
member = member_text.strip()
member = re.sub(r'\s+', ' ', member)
member_name, member_role = self._parse_name(member)
if member_name is None:
continue
# Figure out if this person is the chair.
role_type = self.get_node(
member_link,
'../../preceding-sibling::div[1]/text()')
if role_type in (['Chair'], ['Co-Chair']):
member_role = 'chair'
else:
member_role = 'member'
if name not in seen:
committee.add_member(member_name, member_role)
seen.add(member_name)
return committee
def scrape_upper_chamber(self):
url = 'http://www.nysenate.gov/senators-committees'
page = self.lxmlize(url)
committees = []
committee_nodes = self.get_nodes(
page,
'//div[@id="c-committees-container"][1]//'
'a[@class="c-committee-link"]')
for committee_node in committee_nodes:
name_text = self.get_node(
committee_node,
'./h4[@class="c-committee-title"][1]/text()')
if name_text is not None:
name = name_text.strip()
assert name
committees.append(name)
# Retrieve committee information.
committee_url = committee_node.attrib['href']
committee = self.scrape_upper_committee(name,
committee_url)
self.save_committee(committee)
return committees
def scrape_upper_committee(self, committee_name, url):
page = self.lxmlize(url)
committee = Committee('upper', committee_name)
committee.add_source(url)
# Committee member attributes.
member_name = None
member_role = None
# Attempt to record the committee chair.
committee_chair = self.get_node(
page,
'//div[@class="nys-senator" and div[@class="nys-senator--info"'
' and p[@class="nys-senator--title" and'
' normalize-space(text())="Chair"]]]')
if committee_chair is not None:
info_node = self.get_node(
committee_chair,
'div[@class="nys-senator--info" and p[@class='
'"nys-senator--title" and contains(text(), "Chair")]]')
if info_node is not None:
# Attempt to retrieve committee chair's name.
member_name_text = self.get_node(
info_node,
'./h4[@class="nys-senator--name"][1]/a[1]/text()')
if member_name_text is not None:
member_name = member_name_text.strip()
else:
warning = ('Could not find the name of the chair for the'
' {} committee')
self.logger.warning(warning.format(committee_name))
# Attempt to retrieve committee chair's role (explicitly).
member_role_text = self.get_node(
info_node,
'./p[@class="nys-senator--title" and contains(text(), '
'"Chair")][1]/text()')
if member_role_text is not None:
member_role = member_role_text.strip()
else:
# This seems like a silly case, but could still be useful
# to check for.
warning = ('Could not find the role of the chair for the'
' {} committee')
self.logger.warning(warning.format(committee_name))
if member_name is not None and member_role is not None:
committee.add_member(member_name, member_role)
else:
warning = ('Could not find information for the chair of the'
' {} committee.')
self.logger.warning(warning.format(committee_name))
else:
warning = 'Missing chairperson for the {} committee.'
self.logger.warning(warning.format(committee_name))
# Get list of regular committee members.
member_nodes = self.get_nodes(
page,
'//div[contains(concat(" ", @class, " "), '
'" c-senators-container ")]//div[@class="view-content"]/'
' div/a')
# Attempt to record each committee member.
for member_node in member_nodes:
member_name = None
member_name_text = self.get_node(
member_node,
'.//div[@class="nys-senator--info"][1]/h4[@class='
'"nys-senator--name"][1]/text()')
if member_name_text is not None:
member_name = member_name_text.strip()
if member_name is not None:
committee.add_member(member_name, 'member')
else:
warning = ('Could not find the name of a member in the {}'
' committee')
self.logger.warning(warning.format(committee_name))
return committee
|
cliftonmcintosh/openstates
|
openstates/ny/committees.py
|
Python
|
gpl-3.0
| 8,055
|
//-----------------------------------------------------------------------------
// Copyright (C) 2014 Tormod Haugland and Inge Edward Haulsaunet
//
// This file is part of WS-Nu.
//
// WS-Nu 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 3 of the License, or
// (at your option) any later version.
//
// WS-Nu 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.
//
// You should have received a copy of the GNU Lesser General Public License
// along with WS-Nu. If not, see <http://www.gnu.org/licenses/>.
//-----------------------------------------------------------------------------
package org.ntnunotif.wsnu.base.net;
import org.junit.*;
import org.ntnunotif.wsnu.base.util.InternalMessage;
import org.ntnunotif.wsnu.base.util.Log;
import org.oasis_open.docs.wsn.b_2.FilterType;
import org.oasis_open.docs.wsn.b_2.Notify;
import org.oasis_open.docs.wsn.b_2.Subscribe;
import org.w3._2001._12.soap_envelope.*;
import javax.xml.bind.JAXBElement;
import javax.xml.namespace.QName;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
/**
*
*/
public class XMLParserTest {
private static final String notifyResourcePlace = "/parse_test_notify.xml";
private static final String soapResourcePlace = "/server_test_soap.xml";
private static final String subscribeResourcePlace = "/server_test_subscribe.xml";
private InputStream notifyTestStream = null;
private InputStream soapTestStream = null;
private InputStream subscribeTestStream = null;
@BeforeClass
public static void setUpClass() {
Log.setEnableDebug(false);
Log.setEnableWarnings(false);
Log.setEnableErrors(false);
}
@Before
public void setup() {
try {
notifyTestStream = getClass().getResourceAsStream(notifyResourcePlace);
soapTestStream = getClass().getResourceAsStream(soapResourcePlace);
subscribeTestStream = getClass().getResourceAsStream(subscribeResourcePlace);
} catch (Exception e) {
Log.e("XMLParser", "Could not read test files");
e.printStackTrace();
}
}
@After
public void breakDown() throws IOException{
if (notifyTestStream != null)
notifyTestStream.close();
if (soapTestStream != null)
soapTestStream.close();
}
@Test
public void testNotificationParsing() throws Exception {
Object parsedObj = XMLParser.parse(notifyTestStream);
Assert.assertNotNull("Parser returned null object", parsedObj);
Assert.assertEquals("Parser returned wrong object type", Notify.class, ((InternalMessage) parsedObj).getMessage().getClass());
// This is dependent of content of file:
Notify message = (Notify) ((InternalMessage)parsedObj).getMessage();
Assert.assertEquals("Any elements of file were too many", 0, message.getAny().size());
Assert.assertEquals("Wrong number of NotificationMessages detected", 1, message.getNotificationMessage().size());
}
@Test
public void testSoapParsing() throws Exception {
Object parsedObject = XMLParser.parse(soapTestStream).getMessage();
Assert.assertNotNull("Parsed object was null", parsedObject);
JAXBElement element = (JAXBElement) parsedObject;
// TODO Complete test
Envelope env =(Envelope) ((JAXBElement) parsedObject).getValue();
}
@Test
public void testToXmlParse() throws Exception {
Object parsedObject1 = XMLParser.parse(notifyTestStream).getMessage();
Object parsedObject2 = XMLParser.parse(soapTestStream).getMessage();
Object parsedObject3 = XMLParser.parse(subscribeTestStream).getMessage();
// The following code is a consequence of questions of how things are parsed, and meant as a demonstration only.
try {
if (parsedObject3 instanceof JAXBElement) {
// This was discovered through printing of class names
JAXBElement<Envelope> jaxEl1 = (JAXBElement<Envelope>) parsedObject3;
Envelope env = jaxEl1.getValue();
Body body = env.getBody();
// This was discovered by printing class names. Might also be discovered by xml inspection.
Subscribe subscribe = (Subscribe)body.getAny().get(0);
FilterType ft = subscribe.getFilter();
for (Object o : ft.getAny()) {
JAXBElement el = (JAXBElement) o;
}
}
} catch (Exception e) {
e.printStackTrace();
}
// TODO write to real tests:
// Writing the three parsed objects to file for manual inspection:
FileOutputStream fileOutputStream = new FileOutputStream(getClass().getResource("/parser_n2xml.xml").getFile());
XMLParser.writeObjectToStream(parsedObject1, fileOutputStream);
fileOutputStream.close();
fileOutputStream = new FileOutputStream(getClass().getResource("/parser_s2xml.xml").getFile());
XMLParser.writeObjectToStream(parsedObject2, fileOutputStream);
fileOutputStream.close();
fileOutputStream = new FileOutputStream(getClass().getResource("/parser_sub2xml.xml").getFile());
XMLParser.writeObjectToStream(parsedObject3, fileOutputStream);
fileOutputStream.close();
}
@Test
public void testMarshallingFaultInEnvelope() throws Exception {
Envelope envelope = new Envelope();
Body body = new Body();
Header header = new Header();
envelope.setBody(body);
envelope.setHeader(header);
Fault fault = new Fault();
fault.setFaultcode(new QName("Server"));
fault.setFaultstring("Something went wrong");
body.getAny().add(new ObjectFactory().createFault(fault));
FileOutputStream fileOut = new FileOutputStream(getClass().getResource("/test_fault.xml").getFile());
XMLParser.writeObjectToStream(new ObjectFactory().createEnvelope(envelope), fileOut);
}
@Test
public void testParseWithHeader() throws Exception {
/* Envelope envelope = new Envelope();
Body body = new Body();
Header header = new Header();
AttributedURIType action = new AttributedURIType();
action.setValue("http://docs.oasis-open.org/wsn/bw-2/NotificationConsumer/Notify");
JAXBElement<AttributedURIType> el = new org.w3._2005._08.addressing.ObjectFactory().createAction(action);
header.getAny().add(action);
envelope.setBody(body);
envelope.setHeader(header);
JAXBElement<Envelope> element = new ObjectFactory().createEnvelope(envelope);
XMLParser.setFormattedOutput(true);
XMLParser.writeObjectToStream(element, System.out);
*/
}
}
|
tOgg1/WS-Nu
|
Base/src/test/java/org/ntnunotif/wsnu/base/net/XMLParserTest.java
|
Java
|
gpl-3.0
| 7,123
|
/*
* Copyright (c) 2019 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. The rights granted to you under the License
* may not be used to create, or enable the creation or redistribution of,
* unlawful or unlicensed copies of an Apple operating system, or to
* circumvent, violate, or enable the circumvention or violation of, any
* terms of an Apple operating system software license agreement.
*
* Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_END@
*/
/*
* @OSF_COPYRIGHT@
*/
/*
* Mach Operating System
* Copyright (c) 1991,1990,1989 Carnegie Mellon University
* All Rights Reserved.
*
* Permission to use, copy, modify and distribute this software and its
* documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*/
/*
* File: errorlib.h
* Author: Douglas Orr, Carnegie Mellon University
* Date: Mar. 1988
*
* Error bases for subsytems errors.
*/
#include <stddef.h>
#include <mach/error.h>
#include <mach/boolean.h>
#define MACH_IPC_SEND_MOD (err_mach_ipc|err_sub(0))
#define MACH_IPC_RCV_MOD (err_mach_ipc|err_sub(1))
#define MACH_IPC_MIG_MOD (err_mach_ipc|err_sub(2))
#define IPC_SEND_MOD (err_ipc|err_sub(0))
#define IPC_RCV_MOD (err_ipc|err_sub(1))
#define IPC_MIG_MOD (err_ipc|err_sub(2))
#define SERV_NETNAME_MOD (err_server|err_sub(0))
#define SERV_ENV_MOD (err_server|err_sub(1))
#define SERV_EXECD_MOD (err_server|err_sub(2))
#define NO_SUCH_ERROR "unknown error code"
struct error_sparse_map {
unsigned start;
unsigned end;
};
#define err_sub_map_entry(start, end) { err_get_sub(start), err_get_sub(end) }
#define err_code_map_entry(start, end) { err_get_code(start), err_get_code(end) }
struct error_subsystem {
const char *subsys_name;
int max_code;
const char * const *codes;
const struct error_sparse_map *map_table;
int map_count;
};
#define errorlib_system_null { NULL, 0, NULL, NULL, 0 }
struct error_system {
int max_sub;
const char *bad_sub;
const struct error_subsystem *subsystem;
const struct error_sparse_map *map_table;
int map_count;
};
#define errorlib_sub_null { 0, NULL, NULL, NULL, 0 }
extern const struct error_system _mach_errors[err_max_system + 1];
char *mach_error_string_int(mach_error_t, boolean_t *);
#define errlib_count(s) (sizeof(s)/sizeof(s[0]))
|
darlinghq/darling
|
src/kernel/libsyscall/mach/errorlib.h
|
C
|
gpl-3.0
| 4,188
|
/**************************************************************************
*
* File name: ompcore.h
*
* Ron Rubinstein
* Computer Science Department
* Technion, Haifa 32000 Israel
* ronrubin@cs
*
* Last Updated: 18.8.2009
*
* Contains the core implementation of Batch-OMP / OMP-Cholesky.
*
*************************************************************************/
#ifndef __OMP_CORE_H__
#define __OMP_CORE_H__
#include "mex.h"
/**************************************************************************
* Perform Batch-OMP or OMP-Cholesky on a specified set of signals, using
* either a fixed number of atoms or an error bound.
*
* Parameters (not all required):
*
* D - the dictionary, of size n X m
* x - the signals, of size n X L
* DtX - D'*x, of size m X L
* XtX - squared norms of the signals in x, sum(x.*x), of length L
* G - D'*D, of size m X m
* T - target sparsity, or maximal number of atoms for error-based OMP
* eps - target residual norm for error-based OMP
* gamma_mode - one of the constants FULL_GAMMA or SPARSE_GAMMA
* profile - if non-zero, profiling info is printed
* msg_delta - positive: the # of seconds between status prints, otherwise: nothing is printed
* erroromp - if nonzero indicates error-based OMP, otherwise fixed sparsity OMP
*
* Usage:
*
* The function can be called using different parameters, and will have
* different complexity depending on the parameters specified. Arrays which
* are not specified should be passed as null (0). When G is specified,
* Batch-OMP is performed. Otherwise, OMP-Cholesky is performed.
*
* Fixed-sparsity usage:
* ---------------------
* Either DtX, or D and x, must be specified. Specifying DtX is more efficient.
* XtX does not need to be specified.
* When D and x are specified, G is not required. However, not providing G
* will significantly degrade efficiency.
* The number of atoms must be specified in T. The value of eps is ignored.
* Finally, set erroromp to 0.
*
* Error-OMP usage:
* ----------------
* Either DtX and Xtx, or D and x, must be specified. Specifying DtX and XtX
* is more efficient.
* When D and x are specified, G is not required. However, not providing G
* will significantly degrade efficiency.
* The target error must be specified in eps. A hard limit on the number
* of atoms can also be specified via the parameter T. Otherwise, T should
* be negative. Finally, set erroromp to nonzero.
*
*
* Returns:
* An mxArray containing the sparse representations of the signals in x
* (allocated using the appropriate mxCreateXXX() function).
* The array is either full or sparse, depending on gamma_mode.
*
**************************************************************************/
mxArray* ompcore(double D[], double x[], double DtX[], double XtX[], double G[], mwSize n, mwSize m, mwSize L,
int T, double eps, int gamma_mode, int profile, double msg_delta, int erroromp);
#endif
|
davisnju/RepairingInTriangleMesh
|
mscripts/toolbox/ClassifierToolbox/lib/ompbox10/private/ompcore.h
|
C
|
gpl-3.0
| 3,038
|
<?php
require_once('core/init.php');
$options ='';
$title = 'Message';
$user = new User();
if(!$user->isLoggedIn()){
Redirect::to('login.php');
}
Session::put('CPage','Message.php');
$options = getNavBar($user->data()->GroupNo);
?>
<!DOCTYPE HTML>
<html manifest="MMC.appcahce" lang="en">
<head>
<meta charset="utf-8">
<title><?php echo $title?></title>
<link rel="stylesheet" type="text/css" href="css/hostelRegistration.css">
</head>
<body>
<!-- container -->
<div id="container">
<!-- header -->
<div id="header">
<img src="image/project header.jpg" width="1024" height="100" />
</div>
<!-- end of header -->
<!-- button -->
<div id="NavBar">
<ul>
<li><a href="index.php">Home</a></li>
<li><a href="EditForm.php">Edit Profile</a></li>
<?php echo $options ?>
<li><a href="Logout.php">Log Out</a></li>
</ul>
</div>
<!-- end of button -->
<!-- content -->
<div id="content">
<?php echo $title?>
<h1>Inbox</h1>
<?php
$message = new Message($user->data()->ID);
if(!$message->print_messages('private')){
echo 'No messages are inside the inbox';
}
?>
</div>
<!-- end of content -->
<!-- sidebar -->
<div id="sidebar">
<div id="Second_Box">
<div id="Second_Head">
<p align="center"> Messaging </p>
</div>
<div id="Second_Body">
<div id="MessagingForm">
<form action="MessageBox.php" method="post" enctype="multipart/form-data" name="messageform" id="messageform" onsubmit="return validate_form();">
<table align="center" cellpadding="1">
<tr><td valign="right">Title :</td><td align="left"><input name="msgTitle" type="text" id="msgTitle" size="18" maxlength="24" /></td></tr>
<tr><td valign="right">Body :<br><br><br><br><br><br><br><br><br><br></td><td align="left"><textarea name="msgBody" type="text" id="msgBody" size="15" cols="15" rows="10">Type your message here</textarea></td></tr>
<tr><td valign="right">Type :</td><td align="left">
<select name="msgType">
<option value="message">Private</option>
<option value="complaint" selected>Feed</option>
</select> </td>
</tr>
<tr>
<td> To : </td>
<td> <input name="msgReceipient" type="text" id="msgReceipient" size="18.5" maxlength="24"/> </td>
</tr>
<tr>
<td align="center" colspan="2">
<input name="token" type="hidden" value="<?php echo Token::generate();?>">
<input name="Send" type="submit" value="Send" /> </td>
</tr>
</table>
</form>
</div>
</div>
</div>
</div>
<!-- end of sidebar -->
</div>
<!-- end of container --?
</body>
</html>
|
MohdVara/Hostel-Management-System
|
ViewMessage.php
|
PHP
|
gpl-3.0
| 3,200
|
/*
* Copyright (c) 2003, 2007-8 Matteo Frigo
* Copyright (c) 2003, 2007-8 Massachusetts Institute of Technology
* Copyright (c) 2010-2013 Michael Pippig
*
* This file is part of PFFT.
*
* PFFT 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.
*
* PFFT 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 PFFT. If not, see <http://www.gnu.org/licenses/>.
*
*/
/* Functions in the PFFT Fortran API, mangled according to the
FORT(...) macro. This file is designed to be #included by
fortran_api.c, possibly multiple times in order to support multiple
compiler manglings (via redefinition of FORT). */
/* Generate prototypes from fortran-wrappers.h using the vim search/replace
* command :%s#)\n{[A-Za-z0-9_,\n ();*=&/\[\]-]*}\n#);#gc
*/
PFFT_VOIDFUNC FORT(init, INIT)(void);
PFFT_VOIDFUNC FORT(cleanup, CLEANUP)(void);
PFFT_VOIDFUNC FORT(execute, EXECUTE)(
PX(plan) * const p);
PFFT_VOIDFUNC FORT(destroy_plan, DESTROY_PLAN)(
PX(plan) *p
);
PFFT_VOIDFUNC FORT(init_input_c2c_3d, INIT_INPUT_C2C_3D)(
const INT *n, const INT *local_n, const INT *local_start,
C *data
);
PFFT_VOIDFUNC FORT(init_input_c2c, INIT_INPUT_C2C)(
int *rnk_n, const INT *n, const INT *local_n, const INT *local_start,
C *data
);
PFFT_VOIDFUNC FORT(init_input_r2c_3d, INIT_INPUT_R2C_3D)(
const INT *n, const INT *local_n, const INT *local_start,
R *data
);
PFFT_VOIDFUNC FORT(init_input_r2c, INIT_INPUT_R2C)(
int *rnk_n, const INT *n, const INT *local_n, const INT *local_start,
R *data
);
PFFT_VOIDFUNC FORT(init_input_r2r_3d, INIT_INPUT_R2R_3D)(
const INT *n, const INT *local_n, const INT *local_start,
R *data
);
PFFT_VOIDFUNC FORT(init_input_r2r, INIT_INPUT_R2R)(
int *rnk_n, const INT *n, const INT *local_n, const INT *local_start,
R *data
);
PFFT_VOIDFUNC FORT(check_output_c2c_3d, CHECK_OUTPUT_C2C_3D)(
R *err, const INT *n, const INT *local_n, const INT *local_start,
const C *data, MPI_Fint *comm
);
PFFT_VOIDFUNC FORT(check_output_c2c, CHECK_OUTPUT_C2C)(
R *err, int *rnk_n, const INT *n, const INT *local_n, const INT *local_start,
const C *data, MPI_Fint *comm
);
PFFT_VOIDFUNC FORT(check_output_c2r_3d, CHECK_OUTPUT_C2R_3D)(
R *err, const INT *n, const INT *local_n, const INT *local_start,
const R *data, MPI_Fint *comm
);
PFFT_VOIDFUNC FORT(check_output_c2r, CHECK_OUTPUT_C2R)(
R *err, int *rnk_n, const INT *n, const INT *local_n, const INT *local_start,
const R *data, MPI_Fint *comm
);
PFFT_VOIDFUNC FORT(check_output_r2r_3d, CHECK_OUTPUT_R2R_3D)(
R *err, const INT *n, const INT *local_n, const INT *local_start,
const R *data, MPI_Fint *comm
);
PFFT_VOIDFUNC FORT(check_output_r2r, CHECK_OUTPUT_R2R)(
R *err, int *rnk_n, const INT *n, const INT *local_n, const INT *local_start,
const R *data, MPI_Fint *comm
);
PFFT_VOIDFUNC FORT(local_size_dft_3d, LOCAL_SIZE_DFT_3D)(
INT *alloc_local,
const INT *n,
MPI_Fint *comm_cart, int *pfft_flags,
INT *local_ni, INT *local_i_start,
INT *local_no, INT *local_o_start
);
PFFT_VOIDFUNC FORT(local_size_dft_r2c_3d, LOCAL_SIZE_DFT_R2C_3D)(
INT *alloc_local,
const INT *n,
MPI_Fint *comm_cart, int *pfft_flags,
INT *local_ni, INT *local_i_start,
INT *local_no, INT *local_o_start
);
PFFT_VOIDFUNC FORT(local_size_dft_c2r_3d, LOCAL_SIZE_DFT_C2R_3D)(
INT *alloc_local,
const INT *n,
MPI_Fint *comm_cart, int *pfft_flags,
INT *local_ni, INT *local_i_start,
INT *local_no, INT *local_o_start
);
PFFT_VOIDFUNC FORT(local_size_r2r_3d, LOCAL_SIZE_DFT_R2R_3D)(
INT *alloc_local,
const INT *n,
MPI_Fint *comm_cart, int *pfft_flags,
INT *local_ni, INT *local_i_start,
INT *local_no, INT *local_o_start
);
PFFT_VOIDFUNC FORT(local_size_dft, LOCAL_SIZE_DFT)(
INT *alloc_local,
int *rnk_n, const INT *n,
MPI_Fint *comm_cart, int *pfft_flags,
INT *local_ni, INT *local_i_start,
INT *local_no, INT *local_o_start
);
PFFT_VOIDFUNC FORT(local_size_dft_r2c, LOCAL_SIZE_DFT_R2C)(
INT *alloc_local,
int *rnk_n, const INT *n,
MPI_Fint *comm_cart, int *pfft_flags,
INT *local_ni, INT *local_i_start,
INT *local_no, INT *local_o_start
);
PFFT_VOIDFUNC FORT(local_size_dft_c2r, LOCAL_SIZE_DFT_C2R)(
INT *alloc_local,
int *rnk_n, const INT *n,
MPI_Fint *comm_cart, int *pfft_flags,
INT *local_ni, INT *local_i_start,
INT *local_no, INT *local_o_start
);
PFFT_VOIDFUNC FORT(local_size_r2r, LOCAL_SIZE_R2R)(
INT *alloc_local,
int *rnk_n, const INT *n,
MPI_Fint *comm_cart, int *pfft_flags,
INT *local_ni, INT *local_i_start,
INT *local_no, INT *local_o_start
);
PFFT_VOIDFUNC FORT(local_size_many_dft, LOCAL_SIZE_MANY_DFT)(
INT *alloc_local,
int *rnk_n, const INT *n, const INT *ni, const INT *no,
INT *howmany, const INT *iblock, const INT *oblock,
MPI_Fint *comm_cart, int *pfft_flags,
INT *local_ni, INT *local_i_start,
INT *local_no, INT *local_o_start
);
PFFT_VOIDFUNC FORT(local_size_many_dft_r2c, LOCAL_SIZE_MANY_DFT_R2C)(
INT *alloc_local,
int *rnk_n, const INT *n, const INT *ni, const INT *no,
INT *howmany, const INT *iblock, const INT *oblock,
MPI_Fint *comm_cart, int *pfft_flags,
INT *local_ni, INT *local_i_start,
INT *local_no, INT *local_o_start
);
PFFT_VOIDFUNC FORT(local_size_many_dft_c2r, LOCAL_SIZE_MANY_DFT_C2R)(
INT *alloc_local,
int *rnk_n, const INT *n, const INT *ni, const INT *no,
INT *howmany, const INT *iblock, const INT *oblock,
MPI_Fint *comm_cart, int *pfft_flags,
INT *local_ni, INT *local_i_start,
INT *local_no, INT *local_o_start
);
PFFT_VOIDFUNC FORT(local_size_many_r2r, LOCAL_SIZE_MANY_R2R)(
INT *alloc_local,
int *rnk_n, const INT *n, const INT *ni, const INT *no,
INT *howmany, const INT *iblock, const INT *oblock,
MPI_Fint *comm_cart, int *pfft_flags,
INT *local_ni, INT *local_i_start,
INT *local_no, INT *local_o_start
);
PFFT_VOIDFUNC FORT(plan_dft_3d, PLAN_DFT_3D)(
PX(plan) *p,
const INT *n, C *in, C *out,
MPI_Fint *comm_cart, int *sign,
int *pfft_flags
);
PFFT_VOIDFUNC FORT(plan_dft_r2c_3d, PLAN_DFT_R2C_3D)(
PX(plan) *p,
const INT *n, R *in, C *out,
MPI_Fint *comm_cart, int *sign,
int *pfft_flags
);
PFFT_VOIDFUNC FORT(plan_dft_c2r_3d, PLAN_DFT_C2R_3D)(
PX(plan) *p,
const INT *n, C *in, R *out,
MPI_Fint *comm_cart, int *sign,
int *pfft_flags
);
PFFT_VOIDFUNC FORT(plan_r2r_3d, PLAN_R2R_3D)(
PX(plan) *p,
const INT *n, R *in, R *out,
MPI_Fint *comm_cart, int *kinds,
int *pfft_flags
);
PFFT_VOIDFUNC FORT(plan_dft, PLAN_DFT)(
PX(plan) *p,
int *rnk_n, const INT *n, C *in, C *out,
MPI_Fint *comm_cart, int *sign,
int *pfft_flags
);
PFFT_VOIDFUNC FORT(plan_dft_r2c, PLAN_DFT_R2C)(
PX(plan) *p,
int *rnk_n, const INT *n, R *in, C *out,
MPI_Fint *comm_cart, int *sign,
int *pfft_flags
);
PFFT_VOIDFUNC FORT(plan_dft_c2r, PLAN_DFT_C2R)(
PX(plan) *p,
int *rnk_n, const INT *n, C *in, R *out,
MPI_Fint *comm_cart, int *sign,
int *pfft_flags
);
PFFT_VOIDFUNC FORT(plan_r2r, PLAN_R2R)(
PX(plan) *p,
int *rnk_n, const INT *n, R *in, R *out,
MPI_Fint *comm_cart, int *kinds,
int *pfft_flags
);
PFFT_VOIDFUNC FORT(plan_many_dft, PLAN_MANY_DFT)(
PX(plan) *p,
int *rnk, const INT *n, const INT *ni, const INT *no,
INT *howmany, const INT *iblock, const INT *oblock,
C *in, C *out, MPI_Fint *comm_cart,
int *sign, int *pfft_flags
);
PFFT_VOIDFUNC FORT(plan_many_dft_r2c, PLAN_MANY_DFT_R2C)(
PX(plan) *p,
int *rnk, const INT *n, const INT *ni, const INT *no,
INT *howmany, const INT *iblock, const INT *oblock,
R *in, C *out, MPI_Fint *comm_cart,
int *sign, int *pfft_flags
);
PFFT_VOIDFUNC FORT(plan_many_dft_c2r, PLAN_MANY_DFT_C2R)(
PX(plan) *p,
int *rnk_n, const INT *n, const INT *ni, const INT *no,
INT *howmany, const INT *iblock, const INT *oblock,
C *in, R *out, MPI_Fint *comm_cart,
int *sign, int *pfft_flags
);
PFFT_VOIDFUNC FORT(plan_many_r2r, PLAN_MANY_R2R)(
PX(plan) *p,
int *rnk_n, const INT *n, const INT *ni, const INT *no,
INT *howmany, const INT *iblock, const INT *oblock,
R *in, R *out, MPI_Fint *comm_cart,
int *kinds, int *pfft_flags
);
PFFT_VOIDFUNC FORT(plan_many_dft_skipped, PLAN_MANY_DFT_SKIPPED)(
PX(plan) *p,
int *rnk, const INT *n, const INT *ni, const INT *no,
INT *howmany, const INT *iblock, const INT *oblock,
const int *skip_trafos, C *in, C *out, MPI_Fint *comm_cart,
int *sign, int *pfft_flags
);
PFFT_VOIDFUNC FORT(plan_rgc_3d, PLAN_RGC_3D)(
PX(gcplan) *p,
const INT *n, const INT *gc_below, const INT *gc_above,
R *data, MPI_Fint *comm_cart, int *gc_flags
);
PFFT_VOIDFUNC FORT(local_size_gc_3d, LOCAL_SIZE_GC_3D)(
INT *alloc_local_gc,
const INT *local_n, const INT *local_n_start, INT *alloc_local,
const INT *gc_below, const INT *gc_above,
INT *local_ngc, INT *local_gc_start
);
PFFT_VOIDFUNC FORT(plan_cgc_3d, PLAN_CGC_3D)(
PX(gcplan) *p,
const INT *n, const INT *gc_below, const INT *gc_above,
C *data, MPI_Fint *comm_cart, int *gc_flags
);
PFFT_VOIDFUNC FORT(local_size_gc, LOCAL_SIZE_GC)(
INT *alloc_local_gc,
int *rnk, const INT *local_n, const INT *local_n_start, INT *alloc_local,
const INT *gc_below, const INT *gc_above,
INT *local_ngc, INT *local_gc_start
);
PFFT_VOIDFUNC FORT(plan_rgc, PLAN_RGC)(
PX(gcplan) *p,
int *rnk, const INT *n, const INT *gc_below, const INT *gc_above,
R *data, MPI_Fint *comm_cart, int *gc_flags
);
PFFT_VOIDFUNC FORT(plan_cgc, PLAN_CGC)(
PX(gcplan) *p,
int *rnk, const INT *n, const INT *gc_below, const INT *gc_above,
C *data, MPI_Fint *comm_cart, int *gc_flags
);
PFFT_VOIDFUNC FORT(exchange, EXCHANGE)(
PX(gcplan) *p
);
PFFT_VOIDFUNC FORT(reduce, REDUCE)(
PX(gcplan) *p
);
PFFT_VOIDFUNC FORT(destroy_gcplan, DESTROY_GCPLAN)(
PX(gcplan) *p
);
PFFT_VOIDFUNC FORT(local_size_many_gc, LOCAL_SIZE_MANY_GC)(
INT *alloc_local_gc,
int *rnk, const INT *local_n, const INT *local_n_start, INT *alloc_local,
INT *howmany, const INT *gc_below, const INT *gc_above,
INT *local_ngc, INT *local_gc_start
);
PFFT_VOIDFUNC FORT(plan_many_rgc, PLAN_MANY_RGC)(
PX(gcplan) *p,
int *rnk_n, const INT *n,
INT *howmany, const INT *block,
const INT *gc_below, const INT *gc_above,
R *data, MPI_Fint *comm_cart, int *gc_flags
);
PFFT_VOIDFUNC FORT(plan_many_cgc, PLAN_MANY_CGC)(
PX(gcplan) *p,
int *rnk_n, const INT *n,
INT *howmany, const INT *block,
const INT *gc_below, const INT *gc_above,
C *data, MPI_Fint *comm_cart, int *gc_flags
);
PFFT_VOIDFUNC FORT(prod_INT, PROD_INT)(
INT *prod, int *d, const INT *vec
);
PFFT_VOIDFUNC FORT(sum_INT, SUM_INT)(
INT *sum, int *d, const INT *vec
);
PFFT_VOIDFUNC FORT(equal_INT, EQUAL_INT)(
INT *equal, int *d, const INT *vec1, const INT *vec2
);
PFFT_VOIDFUNC FORT(vcopy_INT, VCOPY_INT)(
int *d, const INT *vec1,
INT *vec2
);
PFFT_VOIDFUNC FORT(vadd_INT, VADD_INT)(
int *d, const INT *vec1, const INT *vec2,
INT *sum
);
PFFT_VOIDFUNC FORT(vsub_INT, VSUB_INT)(
int *d, const INT *vec1, const INT *vec2,
INT *sub
);
PFFT_VOIDFUNC FORT(apr_complex_3d, APR_COMPLEX_3D)(
const C *data, const INT *local_n, const INT *local_start,
const char *name, MPI_Fint *comm
);
PFFT_VOIDFUNC FORT(apr_complex_permuted_3d, APR_COMPLEX_PERMUTED_3D)(
const C *data, const INT *local_n, const INT *local_start,
int *perm1, int *perm2, int *perm3, const char *name, MPI_Fint *comm
);
PFFT_VOIDFUNC FORT(message, MESSAGE)(
MPI_Fint *comm, const char *msg
);
PFFT_VOIDFUNC FORT(error_message, ERROR_MESSAGE)(
MPI_Fint *comm, const char *msg
);
PFFT_VOIDFUNC FORT(create_procmesh, CREATE_PROCMESH)(
int *ierror,
int *rnk, MPI_Fint *comm, int *np,
MPI_Fint *comm_cart
);
PFFT_VOIDFUNC FORT(create_procmesh_2d, CREATE_PROCMESH_2D)(
int *ierror,
MPI_Fint *comm, int *np2, int *np3,
MPI_Fint *comm_cart_2d
);
|
rainwoodman/pfft-tarball
|
api/fortran-prototypes.h
|
C
|
gpl-3.0
| 12,794
|
require 'hammer_cli/i18n'
require 'hammer_cli/verbosity'
require 'hammer_cli/exceptions'
require 'hammer_cli/utils'
require 'hammer_cli/version'
require 'hammer_cli/modules'
require 'hammer_cli/exit_codes'
require 'hammer_cli/settings'
require 'hammer_cli/logger'
require 'hammer_cli/ca_cert_manager'
require 'hammer_cli/connection'
require 'hammer_cli/output'
require 'hammer_cli/options/normalizers'
require 'hammer_cli/completer'
require 'hammer_cli/option_builder'
require 'hammer_cli/abstract'
require 'hammer_cli/main'
require 'hammer_cli/context'
require 'hammer_cli/apipie'
# extend MainCommand
require 'hammer_cli/shell'
require 'hammer_cli/defaults'
require 'hammer_cli/full_help'
require 'hammer_cli/bash'
|
mmoll/hammer-cli
|
lib/hammer_cli.rb
|
Ruby
|
gpl-3.0
| 719
|
/*
* Vortex OpenSplice
*
* This software and documentation are Copyright 2006 to TO_YEAR ADLINK
* Technology Limited, its affiliated companies and licensors. All rights
* reserved.
*
* Licensed under the ADLINK Software License Agreement Rev 2.7 2nd October
* 2014 (the "License"); you may not use this file except in compliance with
* the License.
* You may obtain a copy of the License at:
* $OSPL_HOME/LICENSE
*
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#include "d_nameSpacesRequest.h"
#include "d_message.h"
#include "os_heap.h"
d_nameSpacesRequest
d_nameSpacesRequestNew(
d_admin admin)
{
d_nameSpacesRequest request;
request = NULL;
if(admin){
request = d_nameSpacesRequest(os_malloc(C_SIZEOF(d_nameSpacesRequest)));
if(request){
d_messageInit(d_message(request), admin);
}
}
return request;
}
void
d_nameSpacesRequestFree(
d_nameSpacesRequest request)
{
if(request){
d_messageDeinit(d_message(request));
os_free(request);
}
}
|
PrismTech/opensplice
|
src/services/durability/code/d_nameSpacesRequest.c
|
C
|
gpl-3.0
| 1,173
|
/*
Copyright 2015 esbtools Contributors and/or its affiliates.
This file is part of esbtools.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.esbtools.message.admin.common.extractor;
import java.io.StringReader;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpression;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;
import org.esbtools.message.admin.model.MetadataField;
import org.esbtools.message.admin.model.MetadataType;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
/**
* The KeyExtractor is a xpath based ValueExtractor implementation.
* It evaluates a list of xpath operations against the given payload
* and puts the value along with the name into map.
* The purpose is to enrich the payload with additional metadata so users
* can search by them.
*
* @author vrjain
* @author ykoer
*
*/
public class KeyExtractorUtil {
private static final Logger log = Logger.getLogger(KeyExtractorUtil.class.getName());
private String hash;
private Map<String, List<XPathExpression>> expressions;
public KeyExtractorUtil(List<MetadataField> searchKeys, String argHash) {
expressions = new HashMap<String, List<XPathExpression>>();
hash = argHash;
XPath xpath = XPathFactory.newInstance().newXPath();
for (MetadataField searchKey : searchKeys) {
for (MetadataField path : searchKey.getChildren()) {
if (path.getType() == MetadataType.XPATH) {
if (!expressions.containsKey(searchKey.getValue())) {
expressions.put(searchKey.getValue(), new LinkedList<XPathExpression>());
}
XPathExpression expr;
try {
expr = xpath.compile(path.getValue());
expressions.get(searchKey.getValue()).add(expr);
log.info("adding key:" + searchKey.getValue() + " with path:" + path.getValue());
} catch (XPathExpressionException e) {
log.warning("XPATH: " + path.getValue() + " is invalid. Ignoring it!");
}
}
}
}
}
public String getHash() {
return hash;
}
private void addToMap(Map<String, List<String>> keysMap, String key, String value) {
if (!keysMap.containsKey(key)) {
keysMap.put(key, new LinkedList<String>());
}
keysMap.get(key).add(value);
}
public Map<String, List<String>> getEntriesFromPayload(String payload) throws KeyExtractorException {
Map<String, List<String>> keysMap = new HashMap<String, List<String>>();
DocumentBuilderFactory domFactory = DocumentBuilderFactory
.newInstance();
try {
DocumentBuilder builder = domFactory.newDocumentBuilder();
Document doc = builder.parse(new InputSource(new StringReader(payload)));
Iterator<String> iter = expressions.keySet().iterator();
while (iter.hasNext()) {
String key = iter.next();
for (XPathExpression valuePath : expressions.get(key)) {
valuePath.evaluate(doc);
NodeList result;
try {
result = (NodeList) valuePath.evaluate(doc, XPathConstants.NODESET);
for (int index = 0; index < result.getLength(); index++) {
Node node = result.item(index);
String value = node.getFirstChild().getNodeValue();
addToMap(keysMap, key, value);
log.info("found key:" + key + "with value:" + value);
}
} catch (XPathExpressionException e) {
addToMap(keysMap, key, valuePath.evaluate(doc));
}
}
}
} catch (Exception e) {
throw new KeyExtractorException(e);
}
return keysMap;
}
}
|
vritant/esb-message-admin
|
common/src/main/java/org/esbtools/message/admin/common/extractor/KeyExtractorUtil.java
|
Java
|
gpl-3.0
| 5,051
|
package com.totsp.crossword.puz;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Calendar;
import java.util.Date;
import junit.framework.TestCase;
import com.totsp.crossword.io.IO;
import com.totsp.crossword.io.UclickXMLIO;
/**
* Tests for UclickXMLIO.
*/
public class UclickXMLIOTest extends TestCase {
private static final String TITLE = "12/15/09 LET'S BE HONEST";
private static final String AUTHOR = "by Billie Truitt, edited by Stanley Newman";
private static final Date DATE;
private static final String COPYRIGHT = "Stanley Newman, distributed by Creators Syndicate, Inc.";
static {
Calendar c = Calendar.getInstance();
c.set(2009, 11, 15);
DATE = c.getTime();
}
private InputStream is;
private DataOutputStream os;
private File tmp;
public UclickXMLIOTest(String testName) {
super(testName);
}
@Override
public void setUp() throws Exception {
super.setUp();
is = UclickXMLIOTest.class.getResourceAsStream("/crnet091215-data.xml");
tmp = File.createTempFile("uclick-test", ".puz");
os = new DataOutputStream(new FileOutputStream(tmp));
}
@Override
public void tearDown() throws Exception {
super.tearDown();
is.close();
os.close();
tmp.delete();
}
public void testConvert() throws IOException {
assertTrue(UclickXMLIO.convertUclickPuzzle(is, os, COPYRIGHT, DATE));
Puzzle puz = null;
puz = IO.load(tmp);
assertEquals(TITLE, puz.getTitle());
assertEquals(AUTHOR, puz.getAuthor());
assertEquals(COPYRIGHT, puz.getCopyright());
assertEquals("Film legend Greta", puz.findAcrossClue(1));
assertEquals("Ballerina's skirt", puz.findAcrossClue(49));
assertEquals("Equips for combat", puz.findAcrossClue(60));
assertEquals("Double curves", puz.findAcrossClue(65));
assertEquals("Squash or pumpkin", puz.findDownClue(1));
assertEquals("Toss in", puz.findDownClue(21));
assertEquals("Bullfight shouts", puz.findDownClue(56));
}
}
|
rappazzo/shortyz
|
puzlib/src/test/java/com/totsp/crossword/puz/UclickXMLIOTest.java
|
Java
|
gpl-3.0
| 2,130
|
/**
* \addtogroup rimequeuebuf
* @{
*/
/*
* Copyright (c) 2006, Swedish Institute of Computer Science.
* All rights reserved.
*
* 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. Neither the name of the Institute 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 INSTITUTE 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 INSTITUTE 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.
*
* This file is part of the Contiki operating system.
*
*/
/**
* \file
* Implementation of the Rime queue buffers
* \author
* Adam Dunkels <adam@sics.se>
*/
#include "contiki-net.h"
#if WITH_SWAP
#include "cfs/cfs.h"
#endif
#include <string.h> /* for memcpy() */
#ifdef QUEUEBUF_CONF_REF_NUM
#define QUEUEBUF_REF_NUM QUEUEBUF_CONF_REF_NUM
#else
#define QUEUEBUF_REF_NUM 2
#endif
/* Structure pointing to a buffer either stored
in RAM or swapped in CFS */
struct queuebuf {
#if QUEUEBUF_DEBUG
struct queuebuf *next;
const char *file;
int line;
clock_time_t time;
#endif /* QUEUEBUF_DEBUG */
#if WITH_SWAP
enum {IN_RAM, IN_CFS} location;
union {
#endif
struct queuebuf_data *ram_ptr;
#if WITH_SWAP
int swap_id;
};
#endif
};
/* The actual queuebuf data */
struct queuebuf_data {
uint16_t len;
uint8_t data[PACKETBUF_SIZE];
struct packetbuf_attr attrs[PACKETBUF_NUM_ATTRS];
struct packetbuf_addr addrs[PACKETBUF_NUM_ADDRS];
};
struct queuebuf_ref {
uint16_t len;
uint8_t *ref;
uint8_t hdr[PACKETBUF_HDR_SIZE];
uint8_t hdrlen;
};
MEMB(bufmem, struct queuebuf, QUEUEBUF_NUM);
MEMB(refbufmem, struct queuebuf_ref, QUEUEBUF_REF_NUM);
MEMB(buframmem, struct queuebuf_data, QUEUEBUFRAM_NUM);
#if WITH_SWAP
/* Swapping allows to store up to QUEUEBUF_NUM - QUEUEBUFRAM_NUM
queuebufs in CFS. The swap is made of several large CFS files.
Every buffer stored in CFS has a swap id, referring to a specific
offset in one of these files. */
#define NQBUF_FILES 4
#define NQBUF_PER_FILE 256
#define QBUF_FILE_SIZE (NQBUF_PER_FILE*sizeof(struct queuebuf_data))
#define NQBUF_ID (NQBUF_PER_FILE * NQBUF_FILES)
struct qbuf_file {
int fd;
int usage;
int renewable;
};
/* A statically allocated queuebuf used as a cache for swapped qbufs */
static struct queuebuf_data tmpdata;
/* A pointer to the qbuf associated to the data in tmpdata */
static struct queuebuf *tmpdata_qbuf = NULL;
/* The swap id counter */
static int next_swap_id = 0;
/* The swap files */
static struct qbuf_file qbuf_files[NQBUF_FILES];
/* The timer used to renew files during inactivity periods */
static struct ctimer renew_timer;
#endif
#if QUEUEBUF_DEBUG
#include "lib/list.h"
LIST(queuebuf_list);
#endif /* QUEUEBUF_DEBUG */
#define DEBUG 0
#if DEBUG
#include <stdio.h>
#define PRINTF(...) printf(__VA_ARGS__)
#else
#define PRINTF(...)
#endif
#ifdef QUEUEBUF_CONF_STATS
#define QUEUEBUF_STATS QUEUEBUF_CONF_STATS
#else
#define QUEUEBUF_STATS 0
#endif /* QUEUEBUF_CONF_STATS */
#if QUEUEBUF_STATS
uint8_t queuebuf_len, queuebuf_ref_len, queuebuf_max_len;
#endif /* QUEUEBUF_STATS */
#if WITH_SWAP
/*---------------------------------------------------------------------------*/
static void
qbuf_renew_file(int file)
{
int ret;
char name[2];
name[0] = 'a' + file;
name[1] = '\0';
if(qbuf_files[file].renewable == 1) {
PRINTF("qbuf_renew_file: removing file %d\n", file);
cfs_remove(name);
}
ret = cfs_open(name, CFS_READ | CFS_WRITE);
if(ret == -1) {
PRINTF("qbuf_renew_file: cfs open error\n");
}
qbuf_files[file].fd = ret;
qbuf_files[file].usage = 0;
qbuf_files[file].renewable = 0;
}
/*---------------------------------------------------------------------------*/
/* Renews every file with renewable flag set */
static void
qbuf_renew_all(void *unused)
{
int i;
for(i=0; i<NQBUF_FILES; i++) {
if(qbuf_files[i].renewable == 1) {
qbuf_renew_file(i);
}
}
}
/*---------------------------------------------------------------------------*/
/* Removes a queuebuf from its swap file */
static void
queuebuf_remove_from_file(int swap_id)
{
int fileid;
if(swap_id != -1) {
fileid = swap_id / NQBUF_PER_FILE;
qbuf_files[fileid].usage--;
/* The file is full but doesn't contain any more queuebuf, mark it as renewable */
if(qbuf_files[fileid].usage == 0 && fileid != next_swap_id / NQBUF_PER_FILE) {
qbuf_files[fileid].renewable = 1;
/* This file is renewable, set a timer to renew files */
ctimer_set(&renew_timer, 0, qbuf_renew_all, NULL);
}
if(tmpdata_qbuf->swap_id == swap_id) {
tmpdata_qbuf->swap_id = -1;
}
}
}
/*---------------------------------------------------------------------------*/
static int
get_new_swap_id(void)
{
int fileid;
int swap_id = next_swap_id;
fileid = swap_id / NQBUF_PER_FILE;
if(swap_id % NQBUF_PER_FILE == 0) { /* This is the first id in the file */
if(qbuf_files[fileid].renewable) {
qbuf_renew_file(fileid);
}
if(qbuf_files[fileid].usage>0) {
return -1;
}
}
qbuf_files[fileid].usage++;
next_swap_id = (next_swap_id+1) % NQBUF_ID;
return swap_id;
}
/*---------------------------------------------------------------------------*/
/* Flush tmpdata to CFS */
static int
queuebuf_flush_tmpdata(void)
{
int fileid, fd, ret;
cfs_offset_t offset;
if(tmpdata_qbuf) {
queuebuf_remove_from_file(tmpdata_qbuf->swap_id);
tmpdata_qbuf->swap_id = get_new_swap_id();
if(tmpdata_qbuf->swap_id == -1) {
return -1;
}
fileid = tmpdata_qbuf->swap_id / NQBUF_PER_FILE;
offset = (tmpdata_qbuf->swap_id % NQBUF_PER_FILE) * sizeof(struct queuebuf_data);
fd = qbuf_files[fileid].fd;
ret = cfs_seek(fd, offset, CFS_SEEK_SET);
if(ret == -1) {
PRINTF("queuebuf_flush_tmpdata: cfs seek error\n");
return -1;
}
ret = cfs_write(fd, &tmpdata, sizeof(struct queuebuf_data));
if(ret == -1) {
PRINTF("queuebuf_flush_tmpdata: cfs write error\n");
return -1;
}
}
return 0;
}
/*---------------------------------------------------------------------------*/
/* If the queuebuf is in CFS, load it to tmpdata */
static struct queuebuf_data *
queuebuf_load_to_ram(struct queuebuf *b)
{
int fileid, fd, ret;
cfs_offset_t offset;
if(b->location == IN_RAM) { /* the qbuf is loacted in RAM */
return b->ram_ptr;
} else { /* the qbuf is located in CFS */
if(tmpdata_qbuf && tmpdata_qbuf->swap_id == b->swap_id) { /* the qbuf is already in tmpdata */
return &tmpdata;
} else { /* the qbuf needs to be loaded from CFS */
tmpdata_qbuf = b;
/* read the qbuf from CFS */
fileid = b->swap_id / NQBUF_PER_FILE;
offset = (b->swap_id % NQBUF_PER_FILE) * sizeof(struct queuebuf_data);
fd = qbuf_files[fileid].fd;
ret = cfs_seek(fd, offset, CFS_SEEK_SET);
if(ret == -1) {
PRINTF("queuebuf_load_to_ram: cfs seek error\n");
}
ret = cfs_read(fd, &tmpdata, sizeof(struct queuebuf_data));
if(ret == -1) {
PRINTF("queuebuf_load_to_ram: cfs read error\n");
}
return &tmpdata;
}
}
}
#else /* WITH_SWAP */
/*---------------------------------------------------------------------------*/
static struct queuebuf_data *
queuebuf_load_to_ram(struct queuebuf *b)
{
return b->ram_ptr;
}
#endif /* WITH_SWAP */
/*---------------------------------------------------------------------------*/
void
queuebuf_init(void)
{
#if WITH_SWAP
int i;
for(i=0; i<NQBUF_FILES; i++) {
qbuf_files[i].renewable = 1;
qbuf_renew_file(i);
}
#endif
memb_init(&buframmem);
memb_init(&bufmem);
memb_init(&refbufmem);
#if QUEUEBUF_STATS
queuebuf_max_len = QUEUEBUF_NUM;
#endif /* QUEUEBUF_STATS */
}
/*---------------------------------------------------------------------------*/
#if QUEUEBUF_DEBUG
struct queuebuf *
queuebuf_new_from_packetbuf_debug(const char *file, int line)
#else /* QUEUEBUF_DEBUG */
struct queuebuf *
queuebuf_new_from_packetbuf(void)
#endif /* QUEUEBUF_DEBUG */
{
struct queuebuf *buf;
struct queuebuf_ref *rbuf;
if(packetbuf_is_reference()) {
rbuf = memb_alloc(&refbufmem);
if(rbuf != NULL) {
#if QUEUEBUF_STATS
++queuebuf_ref_len;
#endif /* QUEUEBUF_STATS */
rbuf->len = packetbuf_datalen();
rbuf->ref = packetbuf_reference_ptr();
rbuf->hdrlen = packetbuf_copyto_hdr(rbuf->hdr);
} else {
PRINTF("queuebuf_new_from_packetbuf: could not allocate a reference queuebuf\n");
}
return (struct queuebuf *)rbuf;
} else {
struct queuebuf_data *buframptr;
buf = memb_alloc(&bufmem);
if(buf != NULL) {
#if QUEUEBUF_DEBUG
list_add(queuebuf_list, buf);
buf->file = file;
buf->line = line;
buf->time = clock_time();
#endif /* QUEUEBUF_DEBUG */
buf->ram_ptr = memb_alloc(&buframmem);
#if WITH_SWAP
/* If the allocation failed, store the qbuf in swap files */
if(buf->ram_ptr != NULL) {
buf->location = IN_RAM;
buframptr = buf->ram_ptr;
} else {
buf->location = IN_CFS;
buf->swap_id = -1;
tmpdata_qbuf = buf;
buframptr = &tmpdata;
}
#else
if(buf->ram_ptr == NULL) {
PRINTF("queuebuf_new_from_packetbuf: could not queuebuf data\n");
return NULL;
}
buframptr = buf->ram_ptr;
#endif
buframptr->len = packetbuf_copyto(buframptr->data);
packetbuf_attr_copyto(buframptr->attrs, buframptr->addrs);
#if WITH_SWAP
if(buf->location == IN_CFS) {
if(queuebuf_flush_tmpdata() == -1) {
/* We were unable to write the data in the swap */
memb_free(&bufmem, buf);
return NULL;
}
}
#endif
#if QUEUEBUF_STATS
++queuebuf_len;
PRINTF("queuebuf len %d\n", queuebuf_len);
printf("#A q=%d\n", queuebuf_len);
if(queuebuf_len == queuebuf_max_len + 1) {
memb_free(&bufmem, buf);
queuebuf_len--;
return NULL;
}
#endif /* QUEUEBUF_STATS */
} else {
PRINTF("queuebuf_new_from_packetbuf: could not allocate a queuebuf\n");
}
return buf;
}
}
/*---------------------------------------------------------------------------*/
void
queuebuf_update_attr_from_packetbuf(struct queuebuf *buf)
{
struct queuebuf_data *buframptr = queuebuf_load_to_ram(buf);
packetbuf_attr_copyto(buframptr->attrs, buframptr->addrs);
#if WITH_SWAP
if(buf->location == IN_CFS) {
queuebuf_flush_tmpdata();
}
#endif
}
/*---------------------------------------------------------------------------*/
void
queuebuf_free(struct queuebuf *buf)
{
if(memb_inmemb(&bufmem, buf)) {
#if WITH_SWAP
if(buf->location == IN_RAM) {
memb_free(&buframmem, buf->ram_ptr);
} else {
queuebuf_remove_from_file(buf->swap_id);
}
#else
memb_free(&buframmem, buf->ram_ptr);
#endif
memb_free(&bufmem, buf);
#if QUEUEBUF_STATS
--queuebuf_len;
printf("#A q=%d\n", queuebuf_len);
#endif /* QUEUEBUF_STATS */
#if QUEUEBUF_DEBUG
list_remove(queuebuf_list, buf);
#endif /* QUEUEBUF_DEBUG */
} else if(memb_inmemb(&refbufmem, buf)) {
memb_free(&refbufmem, buf);
#if QUEUEBUF_STATS
--queuebuf_ref_len;
#endif /* QUEUEBUF_STATS */
}
}
/*---------------------------------------------------------------------------*/
void
queuebuf_to_packetbuf(struct queuebuf *b)
{
struct queuebuf_ref *r;
if(memb_inmemb(&bufmem, b)) {
struct queuebuf_data *buframptr = queuebuf_load_to_ram(b);
packetbuf_copyfrom(buframptr->data, buframptr->len);
packetbuf_attr_copyfrom(buframptr->attrs, buframptr->addrs);
} else if(memb_inmemb(&refbufmem, b)) {
r = (struct queuebuf_ref *)b;
packetbuf_clear();
packetbuf_copyfrom(r->ref, r->len);
packetbuf_hdralloc(r->hdrlen);
memcpy(packetbuf_hdrptr(), r->hdr, r->hdrlen);
}
}
/*---------------------------------------------------------------------------*/
void *
queuebuf_dataptr(struct queuebuf *b)
{
struct queuebuf_ref *r;
if(memb_inmemb(&bufmem, b)) {
struct queuebuf_data *buframptr = queuebuf_load_to_ram(b);
return buframptr->data;
} else if(memb_inmemb(&refbufmem, b)) {
r = (struct queuebuf_ref *)b;
return r->ref;
}
return NULL;
}
/*---------------------------------------------------------------------------*/
int
queuebuf_datalen(struct queuebuf *b)
{
struct queuebuf_data *buframptr = queuebuf_load_to_ram(b);
return buframptr->len;
}
/*---------------------------------------------------------------------------*/
linkaddr_t *
queuebuf_addr(struct queuebuf *b, uint8_t type)
{
struct queuebuf_data *buframptr = queuebuf_load_to_ram(b);
return &buframptr->addrs[type - PACKETBUF_ADDR_FIRST].addr;
}
/*---------------------------------------------------------------------------*/
packetbuf_attr_t
queuebuf_attr(struct queuebuf *b, uint8_t type)
{
struct queuebuf_data *buframptr = queuebuf_load_to_ram(b);
return buframptr->attrs[type].val;
}
/*---------------------------------------------------------------------------*/
void
queuebuf_debug_print(void)
{
#if QUEUEBUF_DEBUG
struct queuebuf *q;
printf("queuebuf_list: ");
for(q = list_head(queuebuf_list); q != NULL;
q = list_item_next(q)) {
printf("%s,%d,%lu ", q->file, q->line, q->time);
}
printf("\n");
#endif /* QUEUEBUF_DEBUG */
}
/*---------------------------------------------------------------------------*/
/** @} */
|
andreaazzara/pyot
|
contiki-tres/core/net/queuebuf.c
|
C
|
gpl-3.0
| 14,527
|
# coding=utf-8
HOSTNAME = 'localhost'
DATABASE = 'r'
USERNAME = 'web'
PASSWORD = 'web'
DB_URI = 'mysql://{}:{}@{}/{}'.format(
USERNAME, PASSWORD, HOSTNAME, DATABASE)
|
dongweiming/web_develop
|
chapter3/section4/consts.py
|
Python
|
gpl-3.0
| 170
|
<?php
/**
Copyright 2012-2017 Nick Korbel
This file is part of Booked Scheduler.
Booked Scheduler 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.
Booked Scheduler 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 Booked Scheduler. If not, see <http://www.gnu.org/licenses/>.
*/
interface IDisplayableReportPage
{
public function BindReport(IReport $report, IReportDefinition $definition, $selectedColumns);
public function DisplayError();
public function ShowResults();
public function PrintReport();
public function ShowCsv();
}
|
rafaelperazzo/ufca-web
|
booked/Pages/Reports/IDisplayableReportPage.php
|
PHP
|
gpl-3.0
| 974
|
/*
worker.hpp - Support file for writing LV2 plugins in C++
Copyright (C) 2012 Michael Fisher <mfisher31@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, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 01222-1307 USA
*/
#ifndef LVTK_WORKER_HPP
#define LVTK_WORKER_HPP
#include <cstring>
#include <lv2/lv2plug.in/ns/ext/worker/worker.h>
#include "lvtk/private/types.hpp"
namespace lvtk {
/** Convenience enum to get LV2_Worker_Status into a C++ namespace */
typedef enum {
WORKER_SUCCESS = LV2_WORKER_SUCCESS, /**< Work Completed. */
WORKER_ERR_UNKNOWN = LV2_WORKER_ERR_UNKNOWN, /**< Unknown error. */
WORKER_ERR_NO_SPACE = LV2_WORKER_ERR_NO_SPACE /**< Fail due to Lack of Space. */
} WorkerStatus;
/**
Worker reponse. This wraps an LV2_Worker_Respond_Function
and exeucutes via operator ()
*/
struct WorkerRespond {
WorkerRespond(LV2_Handle instance,
LV2_Worker_Respond_Function wrfunc,
LV2_Worker_Respond_Handle handle)
: p_instance(instance),
p_handle(handle),
p_wrfunc (wrfunc)
{ }
/**
Execute the worker retrieval functor.
@param size
@param data
@return WORKER_SUCCESS on success
*/
WorkerStatus operator () (uint32_t size, const void* data) const
{
return (WorkerStatus) p_wrfunc (p_handle, size, data);
}
private:
LV2_Handle p_instance;
LV2_Worker_Respond_Handle p_handle;
LV2_Worker_Respond_Function p_wrfunc;
};
/** The LV2 Worker Feature Mixin
@struct lvtk::Worker lvtk/ext/worker.hpp
@ingroup pluginmixins
*/
template <bool Required = true>
struct Worker
{
template <class Derived>
struct I : Extension<Required>
{
/** @skip */
static void
map_feature_handlers(FeatureHandlerMap& hmap)
{
hmap[LV2_WORKER__schedule] = &I<Derived>::handle_feature;
}
/** @skip */
static void
handle_feature(void* instance, FeatureData data)
{
Derived* d = reinterpret_cast<Derived*>(instance);
I<Derived>* fe = static_cast<I<Derived>*>(d);
LV2_Worker_Schedule *ws = reinterpret_cast<LV2_Worker_Schedule*>(data);
fe->m_work_schedule_handle = ws->handle;
fe->m_schedule_work_func = ws->schedule_work;
fe->m_ok = true;
}
/** Sanity check the mixin */
bool
check_ok()
{
if (LVTK_DEBUG) {
std::clog<<" [Worker] validation "
<<(this->m_ok ? "succeeded" : "failed")<<"."<<std::endl;
}
return this->m_ok;
}
/** @skip */
static const void*
extension_data (const char* uri)
{
if (!std::strcmp (uri, LV2_WORKER__interface)) {
static LV2_Worker_Interface worker = { &I<Derived>::_work,
&I<Derived>::_work_response,
&I<Derived>::_end_run };
return &worker;
}
return 0;
}
/* =============== LV2 Worker C++ Interface =============== */
/**
Request from run() that the host call the worker.
This function is in the audio threading class. It should be called from
run() to request that the host call the work() method in a non-realtime
context with the given arguments.
This function is always safe to call from run(), but it is not
guaranteed that the worker is actually called from a different thread.
In particular, when free-wheeling (e.g. for offline rendering), the
worker may be executed immediately. This allows single-threaded
processing with sample accuracy and avoids timing problems when run() is
executing much faster or slower than real-time.
Plugins SHOULD be written in such a way that if the worker runs
immediately, and responses from the worker are delivered immediately,
the effect of the work takes place immediately with sample accuracy.
The @p data MUST be safe for the host to copy and later pass to work(),
and the host MUST guarantee that it will be eventually passed to work()
if this function returns WORKER_SUCCESS.
@param size The size of @p data.
@param data Message to pass to work(), or NULL.
*/
WorkerStatus
schedule_work (uint32_t size, const void* data)
{
return (WorkerStatus)m_schedule_work_func (m_work_schedule_handle, size, data);
}
/**
This is called by the host in a non-realtime context as requested,
possibly with an arbitrary message to handle. A response can be sent
to run() using @p respond. The plugin MUST NOT make any assumptions
about which thread calls this method, other than the fact that there
are no real-time requirements.
@param respond A functor for sending a response to run().
@param size The size of @p data.
@param data Data from run(), or NULL.
*/
WorkerStatus
work (WorkerRespond &respond, uint32_t size, const void* data)
{
return WORKER_SUCCESS;
}
/**
Handle a response from the worker. This is called by the host in the
run() context when a response from the worker is ready.
@param size The size of @p body.
@param body Message body, or NULL.
*/
WorkerStatus
work_response (uint32_t size, const void* body)
{
return WORKER_SUCCESS;
}
/**
Called when all responses for this cycle have been delivered.
Since work_response() may be called after run() finished, this provides
a hook for code that must run after the cycle is completed.
This field may be NULL if the plugin has no use for it. Otherwise, the
host MUST call it after every run(), regardless of whether or not any
responses were sent that cycle.
*/
WorkerStatus
end_run()
{
return WORKER_SUCCESS;
}
protected:
/* LV2 Worker Implementation */
/** @internal */
LV2_Worker_Schedule_Handle m_work_schedule_handle;
/** @internal */
LV2_Worker_Status (*m_schedule_work_func)(LV2_Worker_Schedule_Handle handle,
uint32_t size,
const void* data);
/** @internal */
static LV2_Worker_Status _work(LV2_Handle instance,
LV2_Worker_Respond_Function respond,
LV2_Worker_Respond_Handle handle,
uint32_t size,
const void* data)
{
Derived* plugin = reinterpret_cast<Derived*>(instance);
WorkerRespond wrsp (instance, respond, handle);
return (LV2_Worker_Status)plugin->work(wrsp, size, data);
}
/** @internal */
static LV2_Worker_Status _work_response (LV2_Handle instance,
uint32_t size,
const void* body)
{
Derived* plugin = reinterpret_cast<Derived*>(instance);
return (LV2_Worker_Status)plugin->work_response (size, body);
}
/** @internal */
static LV2_Worker_Status _end_run (LV2_Handle instance)
{
Derived* plugin = reinterpret_cast<Derived*>(instance);
return (LV2_Worker_Status)plugin->end_run();
}
};
};
} /* namespace lvtk */
#endif /* LVTK_WORKER_HPP */
|
UIKit0/lvtk
|
lvtk/ext/worker.hpp
|
C++
|
gpl-3.0
| 9,047
|
#region License
// Copyright (c) 2013, ClearCanvas Inc.
// All rights reserved.
// http://www.ClearCanvas.ca
//
// This file is part of the ClearCanvas RIS/PACS open source project.
//
// The ClearCanvas RIS/PACS open source project is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// The ClearCanvas RIS/PACS open source project is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
// Public License for more details.
//
// You should have received a copy of the GNU General Public License along with
// the ClearCanvas RIS/PACS open source project. If not, see
// <http://www.gnu.org/licenses/>.
#endregion
using System;
using Macro.ImageViewer.Imaging;
using Macro.ImageViewer.Graphics;
namespace Macro.ImageViewer.Tools.Standard.PresetVoiLuts.Operations
{
public sealed class MinMaxAlgorithmPresetVoiLutOperationComponent : DefaultPresetVoiLutOperationComponent
{
public MinMaxAlgorithmPresetVoiLutOperationComponent()
{
}
public override string Name
{
get { return SR.MinMaxAlgorithmPresetVoiLutOperationComponentName; }
}
public override string Description
{
get { return SR.MinMaxAlgorithmPresetVoiLutOperationComponentDescription; }
}
public override bool AppliesTo(IPresentationImage presentationImage)
{
return base.AppliesTo(presentationImage) && LutHelper.IsGrayScaleImage(presentationImage);
}
public override void Apply(IPresentationImage presentationImage)
{
if (!AppliesTo(presentationImage))
throw new InvalidOperationException("The input presentation image is not supported.");
IVoiLutManager manager = ((IVoiLutProvider)presentationImage).VoiLutManager;
IVoiLut currentLut = manager.VoiLut;
if (currentLut is MinMaxPixelCalculatedLinearLut)
return;
GrayscalePixelData pixelData = (GrayscalePixelData)((IImageGraphicProvider) presentationImage).ImageGraphic.PixelData;
IModalityLutProvider modalityLutProvider = presentationImage as IModalityLutProvider;
if (modalityLutProvider != null)
manager.InstallVoiLut(new MinMaxPixelCalculatedLinearLut(pixelData, modalityLutProvider.ModalityLut));
else
manager.InstallVoiLut(new MinMaxPixelCalculatedLinearLut(pixelData));
}
}
}
|
mayioit/MacroMedicalSystem
|
ImageViewer/Tools/Standard/PresetVoiLuts/Operations/MinMaxAlgorithmPresetVoiLutOperationComponent.cs
|
C#
|
gpl-3.0
| 2,515
|
#define _GNU_SOURCE
#include "animation.h"
#include "testParameters.h"
#include "graphics.h"
#include <stdbool.h>
#include <string.h>
void init()
{
allegro_init();
set_gfx_mode(GFX_AUTODETECT_WINDOWED, XWIN, YWIN, 0, 0);
clear_to_color(screen, BGC);
install_keyboard();
install_mouse();
srand(time(NULL));
pmux_create_pi(&mxa);
}
/*--------------------------------------------------------------*/
/* MAIN process */
/*--------------------------------------------------------------*/
int main(void)
{
bool state_task [NUM_T_TEST]; /* state_i==true task created*/
int priority [NUM_T_TEST];
int i, id, k;
int c; /* character from keyboard */
int ntasks = 0; /* total number of activated tasks*/
int ret = 0;
int tipo_prio = PRIO_DIFF;
int sched = SCHED_OTHER;
int prot = NO_PROTOCOL;
int test = PART;
for (i = 0; i < NUM_T_TEST; i++){
state_task[NUM_T_TEST]=false;
}
init();
ret = select_part ();
if ( ret == -1 ) {
allegro_exit();
return 0;
}
init_vettore_prio(tipo_prio, priority, NUM_T_TEST);
ptask_init(sched, ret, prot);
draw_system_info(sched, ret, prot, tipo_prio, test);
/*Creation aperiodic task*/
for ( i=0; i < NUM_T_TEST; i++) {
tpars params = TASK_SPEC_DFL;
params.period = tspec_from(PER, MILLI);
params.priority = priority[i];
params.measure_flag = 0;
params.act_flag = DEFERRED;
params.processor = 0;
id = ptask_create_param(periodicBall_testPart, ¶ms);
if (id != -1) {
printf("Task %d created \n", id);
state_task[id] = true; // task create state=true
}
else {
allegro_exit();
printf("Error in creating task!\n");
exit(-1);
}
}
do {
k = 0;
if (keypressed()) {
c = readkey();
k = c >> 8;
}
/*section for task activation*/
if ((k >= KEY_1) && (k <= KEY_0 + NUM_T_TEST)) {
id = k - KEY_0 - 1;
if ( state_task[id] ){//if task is create but not activate
ret = ptask_activate(id);
if (ret != -1){
printf("Task %d activated\n", id);
draw_activation (ntasks, id, priority[id], false);
ntasks++;
state_task[id]=false;
}
}
}
} while (k != KEY_ESC);
pmux_destroy(&mxa);
allegro_exit();
return 0;
}
/*--------------------------------------------------------------*/
|
JoKeRGreGre/PJI
|
examples/system_example/testPart.c
|
C
|
gpl-3.0
| 2,625
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Qwt User's Guide: Class Members - Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Qwt User's Guide
 <span id="projectnumber">6.1.3</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="inherits.html"><span>Class Hierarchy</span></a></li>
<li class="current"><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<div id="navrow3" class="tabs2">
<ul class="tablist">
<li><a href="functions.html"><span>All</span></a></li>
<li class="current"><a href="functions_func.html"><span>Functions</span></a></li>
<li><a href="functions_vars.html"><span>Variables</span></a></li>
<li><a href="functions_type.html"><span>Typedefs</span></a></li>
<li><a href="functions_enum.html"><span>Enumerations</span></a></li>
<li><a href="functions_eval.html"><span>Enumerator</span></a></li>
</ul>
</div>
<div id="navrow4" class="tabs3">
<ul class="tablist">
<li><a href="functions_func.html#index_a"><span>a</span></a></li>
<li><a href="functions_func_b.html#index_b"><span>b</span></a></li>
<li><a href="functions_func_c.html#index_c"><span>c</span></a></li>
<li><a href="functions_func_d.html#index_d"><span>d</span></a></li>
<li><a href="functions_func_e.html#index_e"><span>e</span></a></li>
<li><a href="functions_func_f.html#index_f"><span>f</span></a></li>
<li><a href="functions_func_g.html#index_g"><span>g</span></a></li>
<li><a href="functions_func_h.html#index_h"><span>h</span></a></li>
<li><a href="functions_func_i.html#index_i"><span>i</span></a></li>
<li><a href="functions_func_k.html#index_k"><span>k</span></a></li>
<li><a href="functions_func_l.html#index_l"><span>l</span></a></li>
<li><a href="functions_func_m.html#index_m"><span>m</span></a></li>
<li><a href="functions_func_n.html#index_n"><span>n</span></a></li>
<li><a href="functions_func_o.html#index_o"><span>o</span></a></li>
<li><a href="functions_func_p.html#index_p"><span>p</span></a></li>
<li><a href="functions_func_r.html#index_r"><span>r</span></a></li>
<li><a href="functions_func_s.html#index_s"><span>s</span></a></li>
<li><a href="functions_func_t.html#index_t"><span>t</span></a></li>
<li><a href="functions_func_u.html#index_u"><span>u</span></a></li>
<li><a href="functions_func_v.html#index_v"><span>v</span></a></li>
<li><a href="functions_func_w.html#index_w"><span>w</span></a></li>
<li><a href="functions_func_x.html#index_x"><span>x</span></a></li>
<li><a href="functions_func_y.html#index_y"><span>y</span></a></li>
<li><a href="functions_func_z.html#index_z"><span>z</span></a></li>
<li class="current"><a href="functions_func_0x7e.html#index_0x7e"><span>~</span></a></li>
</ul>
</div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('functions_func_0x7e.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="contents">
 
<h3><a class="anchor" id="index_0x7e"></a>- ~ -</h3><ul>
<li>~QwtAbstractLegend()
: <a class="el" href="class_qwt_abstract_legend.html#a6d86d9c50679dea9fefafc457fc70814">QwtAbstractLegend</a>
</li>
<li>~QwtAbstractScale()
: <a class="el" href="class_qwt_abstract_scale.html#a73890593efff11427ea7a42a3ebadefd">QwtAbstractScale</a>
</li>
<li>~QwtAbstractScaleDraw()
: <a class="el" href="class_qwt_abstract_scale_draw.html#adc4d3f491b28ee39d728a4a4a9cdd494">QwtAbstractScaleDraw</a>
</li>
<li>~QwtAbstractSeriesStore()
: <a class="el" href="class_qwt_abstract_series_store.html#a3990acd8aba251e46d8c64d2154e3f72">QwtAbstractSeriesStore</a>
</li>
<li>~QwtAbstractSlider()
: <a class="el" href="class_qwt_abstract_slider.html#a31b9e0314988b7d547c9ded625014bbb">QwtAbstractSlider</a>
</li>
<li>~QwtAlphaColorMap()
: <a class="el" href="class_qwt_alpha_color_map.html#ac6445d25b9df0b565383b8189691bbad">QwtAlphaColorMap</a>
</li>
<li>~QwtAnalogClock()
: <a class="el" href="class_qwt_analog_clock.html#a3abdcecf88e3d3510d94e96e7e9e74ee">QwtAnalogClock</a>
</li>
<li>~QwtArrowButton()
: <a class="el" href="class_qwt_arrow_button.html#a506ab071fa7ee92928ace7dcea774a73">QwtArrowButton</a>
</li>
<li>~QwtColorMap()
: <a class="el" href="class_qwt_color_map.html#af20e4ffdb3c5d34f5a6dc301bcbb9f7e">QwtColorMap</a>
</li>
<li>~QwtColumnSymbol()
: <a class="el" href="class_qwt_column_symbol.html#a4ca8a7cb15c23be659f3bdcdb50ae20c">QwtColumnSymbol</a>
</li>
<li>~QwtCompass()
: <a class="el" href="class_qwt_compass.html#af6cc3b946f3761f7ce53d3a2ec000817">QwtCompass</a>
</li>
<li>~QwtCompassRose()
: <a class="el" href="class_qwt_compass_rose.html#a9e3e5086d7225152cad3a276096753be">QwtCompassRose</a>
</li>
<li>~QwtCounter()
: <a class="el" href="class_qwt_counter.html#a6469133eb210b470023a3dcc735aec4d">QwtCounter</a>
</li>
<li>~QwtCurveFitter()
: <a class="el" href="class_qwt_curve_fitter.html#a62919f309f0441d94adea94573d0f778">QwtCurveFitter</a>
</li>
<li>~QwtDateScaleDraw()
: <a class="el" href="class_qwt_date_scale_draw.html#af32e43b35fbc805400f907a5e1466b83">QwtDateScaleDraw</a>
</li>
<li>~QwtDateScaleEngine()
: <a class="el" href="class_qwt_date_scale_engine.html#a1e1d01f5ac297bcdb1458a35bcd8d554">QwtDateScaleEngine</a>
</li>
<li>~QwtDial()
: <a class="el" href="class_qwt_dial.html#a16cd1e45a78890c6c5f6e9c07b0180c7">QwtDial</a>
</li>
<li>~QwtDialNeedle()
: <a class="el" href="class_qwt_dial_needle.html#ac23b2af4af50042967c8cea87b474247">QwtDialNeedle</a>
</li>
<li>~QwtDynGridLayout()
: <a class="el" href="class_qwt_dyn_grid_layout.html#abb583f302fbf5d92b306841d414e52a4">QwtDynGridLayout</a>
</li>
<li>~QwtEventPattern()
: <a class="el" href="class_qwt_event_pattern.html#a3f8c2a2cca991000bafefd924b47895d">QwtEventPattern</a>
</li>
<li>~QwtGraphic()
: <a class="el" href="class_qwt_graphic.html#a1be9e3400a8d094cdf2deb1ff3eb9d65">QwtGraphic</a>
</li>
<li>~QwtIntervalSymbol()
: <a class="el" href="class_qwt_interval_symbol.html#ac983feda2d6417a24e430aa0cd0548b9">QwtIntervalSymbol</a>
</li>
<li>~QwtKnob()
: <a class="el" href="class_qwt_knob.html#a13f3e622b333c9918bc61844029f8a70">QwtKnob</a>
</li>
<li>~QwtLegend()
: <a class="el" href="class_qwt_legend.html#a2dd3bc628652909b74e7ddb5db021ea5">QwtLegend</a>
</li>
<li>~QwtLegendData()
: <a class="el" href="class_qwt_legend_data.html#a56608cc97875e7b3dd9340decd5231cb">QwtLegendData</a>
</li>
<li>~QwtLegendLabel()
: <a class="el" href="class_qwt_legend_label.html#ad9f7483fa0625a28aba97cca8c3167b7">QwtLegendLabel</a>
</li>
<li>~QwtLinearColorMap()
: <a class="el" href="class_qwt_linear_color_map.html#a82caa759e44d439aa9866bd03e2e3696">QwtLinearColorMap</a>
</li>
<li>~QwtLinearScaleEngine()
: <a class="el" href="class_qwt_linear_scale_engine.html#aa9e543118c60aa04f68123030821fedd">QwtLinearScaleEngine</a>
</li>
<li>~QwtLogScaleEngine()
: <a class="el" href="class_qwt_log_scale_engine.html#ad749149c492c7105fb6e5518abd323c9">QwtLogScaleEngine</a>
</li>
<li>~QwtLogTransform()
: <a class="el" href="class_qwt_log_transform.html#a39296a96bd30f5ea8f22cb79456c23f0">QwtLogTransform</a>
</li>
<li>~QwtMagnifier()
: <a class="el" href="class_qwt_magnifier.html#ac18a7858407951a335399ee6969a50da">QwtMagnifier</a>
</li>
<li>~QwtMathMLTextEngine()
: <a class="el" href="class_qwt_math_m_l_text_engine.html#a864d4265a7621e7389b21d419e6503ff">QwtMathMLTextEngine</a>
</li>
<li>~QwtMatrixRasterData()
: <a class="el" href="class_qwt_matrix_raster_data.html#a15284284966f25383fe67f2e278f4869">QwtMatrixRasterData</a>
</li>
<li>~QwtNullPaintDevice()
: <a class="el" href="class_qwt_null_paint_device.html#a050e40b6efff32a616f3e8326f4fd632">QwtNullPaintDevice</a>
</li>
<li>~QwtNullTransform()
: <a class="el" href="class_qwt_null_transform.html#aa2ee005d43d2532e3312eb50dd873f0a">QwtNullTransform</a>
</li>
<li>~QwtPainterCommand()
: <a class="el" href="class_qwt_painter_command.html#af2b2cc7b6d5ce371b3d2456c231f846e">QwtPainterCommand</a>
</li>
<li>~QwtPanner()
: <a class="el" href="class_qwt_panner.html#a19c9b9a08da05649f6d2ef5bf6fb391c">QwtPanner</a>
</li>
<li>~QwtPicker()
: <a class="el" href="class_qwt_picker.html#a5d0906a0d3b12e0e44499f855cb9dab1">QwtPicker</a>
</li>
<li>~QwtPickerMachine()
: <a class="el" href="class_qwt_picker_machine.html#aa1164dfb8ae6ac62fb3b6cb19efcb3e5">QwtPickerMachine</a>
</li>
<li>~QwtPixelMatrix()
: <a class="el" href="class_qwt_pixel_matrix.html#a6691629e198fb39e6f653038cfb74f6b">QwtPixelMatrix</a>
</li>
<li>~QwtPlainTextEngine()
: <a class="el" href="class_qwt_plain_text_engine.html#a0ada8796b2caaff7bb8d61e9fb1b5143">QwtPlainTextEngine</a>
</li>
<li>~QwtPlot()
: <a class="el" href="class_qwt_plot.html#a2b60620e3681810946dcc66002aad016">QwtPlot</a>
</li>
<li>~QwtPlotAbstractBarChart()
: <a class="el" href="class_qwt_plot_abstract_bar_chart.html#a80176eb6c7f95c5f5b9b90e595e1fdcd">QwtPlotAbstractBarChart</a>
</li>
<li>~QwtPlotBarChart()
: <a class="el" href="class_qwt_plot_bar_chart.html#ad09883b49e09cee21bb9d21cd7425271">QwtPlotBarChart</a>
</li>
<li>~QwtPlotCanvas()
: <a class="el" href="class_qwt_plot_canvas.html#a320320bbb1b511c0c37fb2452a7f4404">QwtPlotCanvas</a>
</li>
<li>~QwtPlotCurve()
: <a class="el" href="class_qwt_plot_curve.html#aa05ec6d3883821a8e62330fbeeb85dbd">QwtPlotCurve</a>
</li>
<li>~QwtPlotDict()
: <a class="el" href="class_qwt_plot_dict.html#a9199acfe3e8dcb095065bff3f90f518b">QwtPlotDict</a>
</li>
<li>~QwtPlotDirectPainter()
: <a class="el" href="class_qwt_plot_direct_painter.html#aab96bfd08e9041c2552210bbd3ee5ad0">QwtPlotDirectPainter</a>
</li>
<li>~QwtPlotGLCanvas()
: <a class="el" href="class_qwt_plot_g_l_canvas.html#a330939a56e289c42bcfbee2d82ef8347">QwtPlotGLCanvas</a>
</li>
<li>~QwtPlotGrid()
: <a class="el" href="class_qwt_plot_grid.html#af39443cd91b8a96a797af1d6b78bfab3">QwtPlotGrid</a>
</li>
<li>~QwtPlotHistogram()
: <a class="el" href="class_qwt_plot_histogram.html#a64bf6dad5655ef1ef3a0a1507d2feafb">QwtPlotHistogram</a>
</li>
<li>~QwtPlotIntervalCurve()
: <a class="el" href="class_qwt_plot_interval_curve.html#a1b04a9a4e327b8e33de2c02cf89fa574">QwtPlotIntervalCurve</a>
</li>
<li>~QwtPlotItem()
: <a class="el" href="class_qwt_plot_item.html#a282a1d0424a06737f80e1fe83ccf7a0c">QwtPlotItem</a>
</li>
<li>~QwtPlotLayout()
: <a class="el" href="class_qwt_plot_layout.html#a39653485c638535bc11f50d2e5ef936d">QwtPlotLayout</a>
</li>
<li>~QwtPlotLegendItem()
: <a class="el" href="class_qwt_plot_legend_item.html#adae55c1a6f185acc37a70df9008d4624">QwtPlotLegendItem</a>
</li>
<li>~QwtPlotMagnifier()
: <a class="el" href="class_qwt_plot_magnifier.html#a38c0508241885ea49542cc0f11c740df">QwtPlotMagnifier</a>
</li>
<li>~QwtPlotMarker()
: <a class="el" href="class_qwt_plot_marker.html#a920d2ddeb2041c03790d7c173e3ad0cf">QwtPlotMarker</a>
</li>
<li>~QwtPlotMultiBarChart()
: <a class="el" href="class_qwt_plot_multi_bar_chart.html#a171ad297d47ba4d4b74755a55af6db94">QwtPlotMultiBarChart</a>
</li>
<li>~QwtPlotPanner()
: <a class="el" href="class_qwt_plot_panner.html#aa72bb8323d5a8eb46900f978bf1e3623">QwtPlotPanner</a>
</li>
<li>~QwtPlotPicker()
: <a class="el" href="class_qwt_plot_picker.html#a0a13f683558c0e3bdb796a3b508be159">QwtPlotPicker</a>
</li>
<li>~QwtPlotRasterItem()
: <a class="el" href="class_qwt_plot_raster_item.html#a2715233827c346ab15504dc75d6e9714">QwtPlotRasterItem</a>
</li>
<li>~QwtPlotRenderer()
: <a class="el" href="class_qwt_plot_renderer.html#a572bea1c8400ba75c01d0bb8bdf391c3">QwtPlotRenderer</a>
</li>
<li>~QwtPlotRescaler()
: <a class="el" href="class_qwt_plot_rescaler.html#ae34a0dbae9074c211f36c765142d8ddd">QwtPlotRescaler</a>
</li>
<li>~QwtPlotScaleItem()
: <a class="el" href="class_qwt_plot_scale_item.html#a8f246e1e73704c1c40ae1294269b65fa">QwtPlotScaleItem</a>
</li>
<li>~QwtPlotSeriesItem()
: <a class="el" href="class_qwt_plot_series_item.html#aa4ef832ea5b6c65c9538943794702bc5">QwtPlotSeriesItem</a>
</li>
<li>~QwtPlotShapeItem()
: <a class="el" href="class_qwt_plot_shape_item.html#accacacbcdbf558ad3dfcba462bf2b0c3">QwtPlotShapeItem</a>
</li>
<li>~QwtPlotSpectroCurve()
: <a class="el" href="class_qwt_plot_spectro_curve.html#a8246490aaa9d47e77f5596f56fb073d6">QwtPlotSpectroCurve</a>
</li>
<li>~QwtPlotSpectrogram()
: <a class="el" href="class_qwt_plot_spectrogram.html#ae76415d290cf4a512d07a17260b7a84a">QwtPlotSpectrogram</a>
</li>
<li>~QwtPlotSvgItem()
: <a class="el" href="class_qwt_plot_svg_item.html#a4509baf861772124c71abd1b6514b319">QwtPlotSvgItem</a>
</li>
<li>~QwtPlotTextLabel()
: <a class="el" href="class_qwt_plot_text_label.html#a20e024910ca49b8fd7326cbfca77df22">QwtPlotTextLabel</a>
</li>
<li>~QwtPlotTradingCurve()
: <a class="el" href="class_qwt_plot_trading_curve.html#a93a040562cf897355196f127c7231194">QwtPlotTradingCurve</a>
</li>
<li>~QwtPlotZoneItem()
: <a class="el" href="class_qwt_plot_zone_item.html#a696327e3e806dd2cada33b8e2d4f18f8">QwtPlotZoneItem</a>
</li>
<li>~QwtPointMapper()
: <a class="el" href="class_qwt_point_mapper.html#aabe6a70dae5784e8b67f4527c51e0c09">QwtPointMapper</a>
</li>
<li>~QwtPowerTransform()
: <a class="el" href="class_qwt_power_transform.html#a33a82c2e0a67e7463646e7dbb64ccff1">QwtPowerTransform</a>
</li>
<li>~QwtRasterData()
: <a class="el" href="class_qwt_raster_data.html#a95b24c7cad42c5f7947e64e990def3e8">QwtRasterData</a>
</li>
<li>~QwtRoundScaleDraw()
: <a class="el" href="class_qwt_round_scale_draw.html#a81583432e629cd8a14524b05fabb4731">QwtRoundScaleDraw</a>
</li>
<li>~QwtSamplingThread()
: <a class="el" href="class_qwt_sampling_thread.html#a7a0b4d5c172f2ded5f6b6483c6ab56e5">QwtSamplingThread</a>
</li>
<li>~QwtScaleDraw()
: <a class="el" href="class_qwt_scale_draw.html#a9c907c8fa27ec7312e78145e3050c599">QwtScaleDraw</a>
</li>
<li>~QwtScaleEngine()
: <a class="el" href="class_qwt_scale_engine.html#ab9c21b4550d44d9a82c1865864cb8943">QwtScaleEngine</a>
</li>
<li>~QwtScaleMap()
: <a class="el" href="class_qwt_scale_map.html#aecafd09423984a5e0ffa935d1b45110c">QwtScaleMap</a>
</li>
<li>~QwtScaleWidget()
: <a class="el" href="class_qwt_scale_widget.html#a84213c50912000db319b2c7d704f9a33">QwtScaleWidget</a>
</li>
<li>~QwtSeriesData()
: <a class="el" href="class_qwt_series_data.html#a841a56f909879d599a385b9c3d046745">QwtSeriesData< T ></a>
</li>
<li>~QwtSeriesStore()
: <a class="el" href="class_qwt_series_store.html#ae500a3787e77e16d096f4e6c1d292101">QwtSeriesStore< T ></a>
</li>
<li>~QwtSimpleCompassRose()
: <a class="el" href="class_qwt_simple_compass_rose.html#a157304c9a535126d33a80df9a9dad292">QwtSimpleCompassRose</a>
</li>
<li>~QwtSlider()
: <a class="el" href="class_qwt_slider.html#a1d82f2f616f8cd3cc7c265948d1b7886">QwtSlider</a>
</li>
<li>~QwtSpline()
: <a class="el" href="class_qwt_spline.html#a90805882826469c94fdc871f18261bb6">QwtSpline</a>
</li>
<li>~QwtSplineCurveFitter()
: <a class="el" href="class_qwt_spline_curve_fitter.html#a933ecbf859698978104d0dd4ec2a2f6a">QwtSplineCurveFitter</a>
</li>
<li>~QwtSymbol()
: <a class="el" href="class_qwt_symbol.html#a5a30269273545d5ed25f7116a421eda2">QwtSymbol</a>
</li>
<li>~QwtSystemClock()
: <a class="el" href="class_qwt_system_clock.html#a79a46a34a317543a08a8424a333b9ee3">QwtSystemClock</a>
</li>
<li>~QwtText()
: <a class="el" href="class_qwt_text.html#aba243ac11b91979ad3f2ee7d3c700195">QwtText</a>
</li>
<li>~QwtTextEngine()
: <a class="el" href="class_qwt_text_engine.html#adda9e23494429c54b3cc3452940fb2bc">QwtTextEngine</a>
</li>
<li>~QwtTextLabel()
: <a class="el" href="class_qwt_text_label.html#adf8f363200c527a6af4259647304be5a">QwtTextLabel</a>
</li>
<li>~QwtThermo()
: <a class="el" href="class_qwt_thermo.html#ad0e2bd43eae2402ade490a5e6c4ef4ae">QwtThermo</a>
</li>
<li>~QwtTransform()
: <a class="el" href="class_qwt_transform.html#aa2653db3104e672464dc569592fc14ab">QwtTransform</a>
</li>
<li>~QwtWeedingCurveFitter()
: <a class="el" href="class_qwt_weeding_curve_fitter.html#abbd30a948fc6974f881678f80a29768c">QwtWeedingCurveFitter</a>
</li>
<li>~QwtWheel()
: <a class="el" href="class_qwt_wheel.html#a57f465a31a9d2d88cb7a1d0e6391535e">QwtWheel</a>
</li>
<li>~QwtWidgetOverlay()
: <a class="el" href="class_qwt_widget_overlay.html#af234383cb42288746b970fb3fa18395d">QwtWidgetOverlay</a>
</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
</ul>
</div>
</body>
</html>
|
PTDreamer/loraRC
|
configurator/loraapp/qwt/doc/html/functions_func_0x7e.html
|
HTML
|
gpl-3.0
| 20,111
|
#ifndef NCURSES_HOME_HPP
#define NCURSES_HOME_HPP
#include <ncurses.h>
#include <iostream>
#include <sstream>
#include <string>
#include "../utils/helper.hpp"
#include "ncurses_colors.hpp"
#include "../log/log_array.hpp"
#include "../utils/boot.hpp"
class NcursesHome {
public:
NcursesHome();
void render(WINDOW *w);
void renderStatus(WINDOW *w, unsigned char row, bool status, bool changing, bool working, std::string statusText);
std::shared_ptr<Boot> boot;
std::shared_ptr<LogArray> logArray;
};
#endif
|
HomeIO/homeio_backend
|
src/backend/ncurses/ncurses_home.hpp
|
C++
|
gpl-3.0
| 523
|
# Install script for directory: D:/C++/XWord/trunk/yajl/reformatter
# Set the install prefix
IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
SET(CMAKE_INSTALL_PREFIX "C:/Program Files/YetAnotherJSONParser")
ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX)
STRING(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
IF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
IF(BUILD_TYPE)
STRING(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
ELSE(BUILD_TYPE)
SET(CMAKE_INSTALL_CONFIG_NAME "Release")
ENDIF(BUILD_TYPE)
MESSAGE(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
ENDIF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
# Set the component getting installed.
IF(NOT CMAKE_INSTALL_COMPONENT)
IF(COMPONENT)
MESSAGE(STATUS "Install component: \"${COMPONENT}\"")
SET(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
ELSE(COMPONENT)
SET(CMAKE_INSTALL_COMPONENT)
ENDIF(COMPONENT)
ENDIF(NOT CMAKE_INSTALL_COMPONENT)
|
mrichards42/xword
|
yajl/build/reformatter/cmake_install.cmake
|
CMake
|
gpl-3.0
| 1,048
|
/*
* Copyright © 2012 Canonical Ltd.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License version 3,
* as published by the Free Software Foundation.
*
* 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 Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Alan Griffiths <alan@octopull.co.uk>
*/
#ifndef MIR_FRONTEND_SESSION_MEDIATOR_H_
#define MIR_FRONTEND_SESSION_MEDIATOR_H_
#include "mir_protobuf.pb.h"
#include <map>
#include <memory>
namespace mir
{
namespace graphics
{
class Platform;
class ViewableArea;
}
namespace compositor
{
class GraphicBufferAllocator;
}
/// Frontend interface. Mediates the interaction between client
/// processes and the core of the mir system.
namespace frontend
{
class Shell;
class Session;
class ResourceCache;
class SessionMediatorReport;
// SessionMediator relays requests from the client process into the server.
class SessionMediator : public mir::protobuf::DisplayServer
{
public:
SessionMediator(
std::shared_ptr<Shell> const& shell,
std::shared_ptr<graphics::Platform> const& graphics_platform,
std::shared_ptr<graphics::ViewableArea> const& viewable_area,
std::shared_ptr<compositor::GraphicBufferAllocator> const& buffer_allocator,
std::shared_ptr<SessionMediatorReport> const& report,
std::shared_ptr<ResourceCache> const& resource_cache);
/* Platform independent requests */
void connect(::google::protobuf::RpcController* controller,
const ::mir::protobuf::ConnectParameters* request,
::mir::protobuf::Connection* response,
::google::protobuf::Closure* done);
void create_surface(google::protobuf::RpcController* controller,
const mir::protobuf::SurfaceParameters* request,
mir::protobuf::Surface* response,
google::protobuf::Closure* done);
void next_buffer(
google::protobuf::RpcController* controller,
mir::protobuf::SurfaceId const* request,
mir::protobuf::Buffer* response,
google::protobuf::Closure* done);
void select_focus_by_lightdm_id(
google::protobuf::RpcController* controller,
mir::protobuf::LightdmId const* request,
mir::protobuf::Void* response,
google::protobuf::Closure* done);
void release_surface(google::protobuf::RpcController* controller,
const mir::protobuf::SurfaceId*,
mir::protobuf::Void*,
google::protobuf::Closure* done);
void disconnect(google::protobuf::RpcController* controller,
const mir::protobuf::Void* request,
mir::protobuf::Void* response,
google::protobuf::Closure* done);
/* Platform specific requests */
void drm_auth_magic(google::protobuf::RpcController* controller,
const mir::protobuf::DRMMagic* request,
mir::protobuf::DRMAuthMagicStatus* response,
google::protobuf::Closure* done);
void configure_surface(google::protobuf::RpcController* controller,
const mir::protobuf::SurfaceSetting*,
mir::protobuf::SurfaceSetting*,
google::protobuf::Closure* done);
private:
std::shared_ptr<Shell> const shell;
std::shared_ptr<graphics::Platform> const graphics_platform;
// TODO this is a dubious dependency - to get display_info (is there only one?)
std::shared_ptr<graphics::ViewableArea> const viewable_area;
// TODO this is a dubious dependency - to get supported_pixel_formats
std::shared_ptr<compositor::GraphicBufferAllocator> const buffer_allocator;
std::shared_ptr<SessionMediatorReport> const report;
std::shared_ptr<ResourceCache> const resource_cache;
std::shared_ptr<Session> session;
};
}
}
#endif /* MIR_FRONTEND_SESSION_MEDIATOR_H_ */
|
TomasMM/emir
|
include/server/mir/frontend/session_mediator.h
|
C
|
gpl-3.0
| 4,370
|
/* This file is part of HSPlasma.
*
* HSPlasma is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* HSPlasma is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with HSPlasma. If not, see <http://www.gnu.org/licenses/>.
*/
#include "pyBitmap.h"
#include <PRP/Surface/plMipmap.h>
#include "PRP/pyCreatable.h"
#include "Stream/pyStream.h"
PY_PLASMA_INIT_DECL(Mipmap)
{
const char* name = "";
int width, height, numLevels, compType, format;
int dxtLevel = plBitmap::kDXTError;
static char* kwlist[] = { _pycs("name"), _pycs("width"), _pycs("height"),
_pycs("numLevels"), _pycs("compType"),
_pycs("format"), _pycs("dxtLevel"), nullptr };
if (PyArg_ParseTupleAndKeywords(args, kwds, "siiiii|i", kwlist,
&name, &width, &height, &numLevels,
&compType, &format, &dxtLevel)) {
self->fThis->init(name);
self->fThis->Create(width, height, numLevels, compType,
(plBitmap::ColorFormat)format, dxtLevel);
return 0;
} else if (PyErr_Clear(), PyArg_ParseTuple(args, "|s", &name)) {
self->fThis->init(name);
return 0;
}
PyErr_SetString(PyExc_TypeError, "__init__ expects an optional string, or a set of creation parameters");
return -1;
}
PY_PLASMA_NEW(Mipmap, plMipmap)
PY_METHOD_VA(Mipmap, readData,
"Params: stream\n"
"Reads a plMipmap from a stream, exluding the plKey")
{
pyStream* stream;
if (!PyArg_ParseTuple(args, "O", &stream)) {
PyErr_SetString(PyExc_TypeError, "readData expects an hsStream");
return nullptr;
}
if (!pyStream_Check((PyObject*)stream)) {
PyErr_SetString(PyExc_TypeError, "readData expects an hsStream");
return nullptr;
}
self->fThis->readData(stream->fThis);
Py_RETURN_NONE;
}
PY_METHOD_VA(Mipmap, writeData,
"Params: stream\n"
"Writes a plMipmap to a stream, exluding the plKey")
{
pyStream* stream;
if (!PyArg_ParseTuple(args, "O", &stream)) {
PyErr_SetString(PyExc_TypeError, "writeData expects an hsStream");
return nullptr;
}
if (!pyStream_Check((PyObject*)stream)) {
PyErr_SetString(PyExc_TypeError, "writeData expects an hsStream");
return nullptr;
}
self->fThis->writeData(stream->fThis);
Py_RETURN_NONE;
}
PY_METHOD_VA(Mipmap, getLevelWidth,
"Params: level\n"
"Get the width of a specified mip level")
{
int level;
if (!PyArg_ParseTuple(args, "i", &level)) {
PyErr_SetString(PyExc_TypeError, "getLevelWidth expects an int");
return nullptr;
}
return pyPlasma_convert(self->fThis->getLevelWidth(level));
}
PY_METHOD_VA(Mipmap, getLevelHeight,
"Params: level\n"
"Get the height of a specified mip level")
{
int level;
if (!PyArg_ParseTuple(args, "i", &level)) {
PyErr_SetString(PyExc_TypeError, "getLevelHeight expects an int");
return nullptr;
}
return pyPlasma_convert(self->fThis->getLevelHeight(level));
}
PY_METHOD_VA(Mipmap, getLevel,
"Params: level\n"
"Get the image data buffer for a specified mip level")
{
int level;
if (!PyArg_ParseTuple(args, "i", &level)) {
PyErr_SetString(PyExc_TypeError, "getLevel expects an int");
return nullptr;
}
PyObject* data = PyBytes_FromStringAndSize((const char*)self->fThis->getLevelData(level),
self->fThis->getLevelSize(level));
return data;
}
PY_METHOD_VA(Mipmap, setRawImage,
"Params: data\n"
"Set the raw full image data (not for JPEG or RLE encoding)")
{
const char* data;
int dataSize;
if (!PyArg_ParseTuple(args, "s#", &data, &dataSize)) {
PyErr_SetString(PyExc_TypeError, "setRawImage expects a binary string");
return nullptr;
}
self->fThis->setImageData((const void*)data, dataSize);
Py_RETURN_NONE;
}
PY_METHOD_VA(Mipmap, setLevel,
"Params: level, data\n"
"Set the image data for a specified mip level")
{
const char* data;
int dataSize, level;
if (!PyArg_ParseTuple(args, "is#", &level, &data, &dataSize)) {
PyErr_SetString(PyExc_TypeError, "setLevel expects int, binary string");
return nullptr;
}
try {
self->fThis->setLevelData(level, (const void*)data, dataSize);
} catch (const hsBadParamException& ex) {
PyErr_SetString(PyExc_RuntimeError, ex.what());
return nullptr;
}
Py_RETURN_NONE;
}
PY_METHOD_VA(Mipmap, setImageJPEG,
"Params: jpegData\n"
"Set the image data as a JPEG stream")
{
const char* data;
int dataSize;
if (!PyArg_ParseTuple(args, "s#", &data, &dataSize)) {
PyErr_SetString(PyExc_TypeError, "setImageJPEG expects a binary string");
return nullptr;
}
try {
self->fThis->setImageJPEG((const void*)data, dataSize);
} catch (const hsBadParamException& ex) {
PyErr_SetString(PyExc_RuntimeError, ex.what());
return nullptr;
}
Py_RETURN_NONE;
}
PY_METHOD_VA(Mipmap, setAlphaJPEG,
"Params: jpegData\n"
"Set the alpha data as a JPEG stream")
{
const char* data;
int dataSize;
if (!PyArg_ParseTuple(args, "s#", &data, &dataSize)) {
PyErr_SetString(PyExc_TypeError, "setAlphaJPEG expects a binary string");
return nullptr;
}
try {
self->fThis->setAlphaJPEG((const void*)data, dataSize);
} catch (const hsBadParamException& ex) {
PyErr_SetString(PyExc_RuntimeError, ex.what());
return nullptr;
}
Py_RETURN_NONE;
}
PY_METHOD_VA(Mipmap, setColorData,
"Params: buffer\n"
"Set the RGB color data for a JPEG mipmap")
{
const char* data;
int dataSize;
if (!PyArg_ParseTuple(args, "s#", &data, &dataSize)) {
PyErr_SetString(PyExc_TypeError, "setColorData expects a binary string");
return nullptr;
}
try {
self->fThis->setColorData((const void*)data, dataSize);
} catch (const hsBadParamException& ex) {
PyErr_SetString(PyExc_RuntimeError, ex.what());
return nullptr;
}
Py_RETURN_NONE;
}
PY_METHOD_VA(Mipmap, setAlphaData,
"Params: buffer\n"
"Set the alpha data for a JPEG mipmap")
{
const char* data;
int dataSize;
if (!PyArg_ParseTuple(args, "s#", &data, &dataSize)) {
PyErr_SetString(PyExc_TypeError, "setAlphaData expects a binary string");
return nullptr;
}
try {
self->fThis->setAlphaData((const void*)data, dataSize);
} catch (const hsBadParamException& ex) {
PyErr_SetString(PyExc_RuntimeError, ex.what());
return nullptr;
}
Py_RETURN_NONE;
}
PY_METHOD_NOARGS(Mipmap, extractColorData,
"Extract an RGB color buffer from a JPEG mipmap")
{
size_t dataSize = self->fThis->getWidth() * self->fThis->getHeight() * 3;
PyObject* buf = PyBytes_FromStringAndSize(nullptr, dataSize);
char* data = PyBytes_AS_STRING(buf);
self->fThis->extractColorData(data, dataSize);
return buf;
}
PY_METHOD_NOARGS(Mipmap, extractAlphaData,
"Extract an alpha intensity buffer from a JPEG mipmap")
{
size_t dataSize = self->fThis->getWidth() * self->fThis->getHeight() * 1;
PyObject* buf = PyBytes_FromStringAndSize(nullptr, dataSize);
char* data = PyBytes_AS_STRING(buf);
self->fThis->extractAlphaData(data, dataSize);
return buf;
}
PY_METHOD_NOARGS(Mipmap, isImageJPEG,
"Returns whether the imageData member is a JPEG stream")
{
return pyPlasma_convert(self->fThis->isImageJPEG());
}
PY_METHOD_NOARGS(Mipmap, isAlphaJPEG,
"Returns whether the alphaData member is a JPEG stream")
{
return pyPlasma_convert(self->fThis->isAlphaJPEG());
}
PY_METHOD_VA(Mipmap, DecompressImage,
"Params: level\n"
"Decompresses the specified mip level and returns the uncompressed RGBA buffer")
{
int level;
if (!PyArg_ParseTuple(args, "i", &level)) {
PyErr_SetString(PyExc_TypeError, "DecompressImage expects an int");
return nullptr;
}
size_t size = self->fThis->GetUncompressedSize(level);
PyObject* img = PyBytes_FromStringAndSize(nullptr, size);
char* buf = PyBytes_AS_STRING(img);
try {
self->fThis->DecompressImage(level, buf, size);
} catch (const hsBadParamException& ex) {
PyErr_SetString(PyExc_RuntimeError, ex.what());
Py_DECREF(img);
return nullptr;
}
return img;
}
PY_METHOD_VA(Mipmap, CompressImage,
"Params: level, data\n"
"Compresses the specified mip level")
{
int level, dataSize;
char* data;
if (!PyArg_ParseTuple(args, "is#", &level, &data, &dataSize)) {
PyErr_SetString(PyExc_TypeError, "CompressImage expects an int and a binary string");
return nullptr;
}
try {
self->fThis->CompressImage(level, data, dataSize);
} catch (hsBadParamException& ex) {
PyErr_SetString(PyExc_RuntimeError, ex.what());
return nullptr;
} catch (const hsNotImplementedException& ex) {
PyErr_SetString(PyExc_NotImplementedError, ex.what());
return nullptr;
}
Py_RETURN_NONE;
}
static PyMethodDef pyMipmap_Methods[] = {
pyMipmap_readData_method,
pyMipmap_writeData_method,
pyMipmap_getLevelWidth_method,
pyMipmap_getLevelHeight_method,
pyMipmap_getLevel_method,
pyMipmap_setRawImage_method,
pyMipmap_setLevel_method,
pyMipmap_setImageJPEG_method,
pyMipmap_setAlphaJPEG_method,
pyMipmap_setColorData_method,
pyMipmap_setAlphaData_method,
pyMipmap_extractColorData_method,
pyMipmap_extractAlphaData_method,
pyMipmap_isImageJPEG_method,
pyMipmap_isAlphaJPEG_method,
pyMipmap_DecompressImage_method,
pyMipmap_CompressImage_method,
PY_METHOD_TERMINATOR
};
PY_PROPERTY_READ(Mipmap, width, getWidth)
PY_PROPERTY_SETTER_MSG(Mipmap, width, "To set the width, you must re-create the mipmap object")
PY_PROPERTY_GETSET_DECL(Mipmap, width)
PY_PROPERTY_READ(Mipmap, height, getHeight)
PY_PROPERTY_SETTER_MSG(Mipmap, height, "To set the height, you must re-create the mipmap object")
PY_PROPERTY_GETSET_DECL(Mipmap, height)
PY_GETSET_GETTER_DECL(Mipmap, imageData)
{
return PyBytes_FromStringAndSize((const char*)self->fThis->getImageData(),
self->fThis->getTotalSize());
}
PY_PROPERTY_SETTER_MSG(Mipmap, imageData, "To set the image data, use the mipmap set methods")
PY_PROPERTY_GETSET_DECL(Mipmap, imageData)
PY_PROPERTY_READ(Mipmap, numLevels, getNumLevels)
PY_PROPERTY_SETTER_MSG(Mipmap, numLevels, "To set the number of mip levels, you must re-create the mipmap object")
PY_PROPERTY_GETSET_DECL(Mipmap, numLevels)
static PyGetSetDef pyMipmap_GetSet[] = {
pyMipmap_width_getset,
pyMipmap_height_getset,
pyMipmap_imageData_getset,
pyMipmap_numLevels_getset,
PY_GETSET_TERMINATOR
};
PY_PLASMA_TYPE(Mipmap, plMipmap, "plMipmap wrapper")
PY_PLASMA_TYPE_INIT(Mipmap)
{
pyMipmap_Type.tp_init = pyMipmap___init__;
pyMipmap_Type.tp_new = pyMipmap_new;
pyMipmap_Type.tp_methods = pyMipmap_Methods;
pyMipmap_Type.tp_getset = pyMipmap_GetSet;
pyMipmap_Type.tp_base = &pyBitmap_Type;
if (PyType_CheckAndReady(&pyMipmap_Type) < 0)
return nullptr;
Py_INCREF(&pyMipmap_Type);
return (PyObject*)&pyMipmap_Type;
}
PY_PLASMA_IFC_METHODS(Mipmap, plMipmap)
|
Hoikas/libhsplasma
|
Python/PRP/Surface/pyMipmap.cpp
|
C++
|
gpl-3.0
| 11,874
|
/*
Generated by sbus code generator
Copyright (C) 2017 Red Hat
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 _SBUS_SSS_KEYGENS_H_
#define _SBUS_SSS_KEYGENS_H_
#include <talloc.h>
#include "sbus/sbus_request.h"
#include "sss_iface/sbus_sss_arguments.h"
const char *
_sbus_sss_key_
(TALLOC_CTX *mem_ctx,
struct sbus_request *sbus_req);
const char *
_sbus_sss_key_s_0
(TALLOC_CTX *mem_ctx,
struct sbus_request *sbus_req,
struct _sbus_sss_invoker_args_s *args);
const char *
_sbus_sss_key_u_0
(TALLOC_CTX *mem_ctx,
struct sbus_request *sbus_req,
struct _sbus_sss_invoker_args_u *args);
const char *
_sbus_sss_key_us_0_1
(TALLOC_CTX *mem_ctx,
struct sbus_request *sbus_req,
struct _sbus_sss_invoker_args_us *args);
const char *
_sbus_sss_key_uss_0_1
(TALLOC_CTX *mem_ctx,
struct sbus_request *sbus_req,
struct _sbus_sss_invoker_args_uss *args);
const char *
_sbus_sss_key_uusss_0_1_2_3_4
(TALLOC_CTX *mem_ctx,
struct sbus_request *sbus_req,
struct _sbus_sss_invoker_args_uusss *args);
#endif /* _SBUS_SSS_KEYGENS_H_ */
|
fidencio/sssd
|
src/sss_iface/sbus_sss_keygens.h
|
C
|
gpl-3.0
| 1,713
|
/*
Free Download Manager Copyright (c) 2003-2014 FreeDownloadManager.ORG
*/
#include "stdafx.h"
#include "Dlg_Options_Page.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
BEGIN_MESSAGE_MAP(CDlg_Options_Page, CDialog)
//{{AFX_MSG_MAP(CDlg_Options_StartupPage)
ON_COMMAND(IDOK, OnOK)
ON_COMMAND(IDCANCEL, OnCancel)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
CDlg_Options_Page::CDlg_Options_Page(UINT u, CWnd* wnd) :
CDialog (u, wnd)
{
m_nReflectLevel = 1;
m_bElevateRequired = false;
m_bRestartOfBrowserIsRequired = false;
}
CDlg_Options_Page::~CDlg_Options_Page()
{
}
LPCSTR CDlg_Options_Page::get_Template()
{
return m_lpszTemplateName;
}
void CDlg_Options_Page::OnCancel()
{
get_ReflectParent ()->PostMessage (WM_COMMAND, IDCANCEL);
}
void CDlg_Options_Page::OnOK ()
{
get_ReflectParent ()->PostMessage (WM_COMMAND, IDOK);
}
CWnd* CDlg_Options_Page::get_ReflectParent()
{
CWnd* wnd = this;
for (int i = 0; i < m_nReflectLevel; i++)
wnd = wnd->GetParent ();
return wnd;
}
bool CDlg_Options_Page::isElevateRequired()
{
return m_bElevateRequired;
}
void CDlg_Options_Page::setElevateRequired(bool bRequired)
{
m_bElevateRequired = bRequired;
}
|
DragonZX/fdm
|
Dlg_Options_Page.cpp
|
C++
|
gpl-3.0
| 1,280
|
/*
* Lumeer: Modern Data Definition and Processing Platform
*
* Copyright (C) since 2017 Lumeer.io, s.r.o. and/or its affiliates.
*
* 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/>.
*/
import {Pipe, PipeTransform} from '@angular/core';
import {TableConfigRow} from '../../../../../core/store/tables/table.model';
@Pipe({
name: 'expandable',
})
export class ExpandablePipe implements PipeTransform {
public transform(row: TableConfigRow): boolean {
return row && !row.expanded && row.linkedRows && row.linkedRows.length > 1;
}
}
|
livthomas/Lumeer-web-ui
|
src/app/view/perspectives/table/shared/pipes/expandable.pipe.ts
|
TypeScript
|
gpl-3.0
| 1,141
|
#pragma once
#include <AP_HAL/AP_HAL.h>
#include <AP_Param/AP_Param.h>
#include <Filter/Filter.h>
#include <Filter/DerivativeFilter.h>
// maximum number of sensor instances
#define BARO_MAX_INSTANCES 3
// maximum number of drivers. Note that a single driver can provide
// multiple sensor instances
#define BARO_MAX_DRIVERS 3
// timeouts for health reporting
#define BARO_TIMEOUT_MS 500 // timeout in ms since last successful read
#define BARO_DATA_CHANGE_TIMEOUT_MS 2000 // timeout in ms since last successful read that involved temperature of pressure changing
class AP_Baro_Backend;
class AP_Baro
{
friend class AP_Baro_Backend;
friend class AP_Baro_SITL; // for access to sensors[]
public:
AP_Baro();
/* Do not allow copies */
AP_Baro(const AP_Baro &other) = delete;
AP_Baro &operator=(const AP_Baro&) = delete;
// get singleton
static AP_Baro *get_singleton(void) {
return _singleton;
}
// barometer types
typedef enum {
BARO_TYPE_AIR,
BARO_TYPE_WATER
} baro_type_t;
// initialise the barometer object, loading backend drivers
void init(void);
// update the barometer object, asking backends to push data to
// the frontend
void update(void);
// healthy - returns true if sensor and derived altitude are good
bool healthy(void) const { return healthy(_primary); }
bool healthy(uint8_t instance) const { return sensors[instance].healthy && sensors[instance].alt_ok && sensors[instance].calibrated; }
// check if all baros are healthy - used for SYS_STATUS report
bool all_healthy(void) const;
// pressure in Pascal. Divide by 100 for millibars or hectopascals
float get_pressure(void) const { return get_pressure(_primary); }
float get_pressure(uint8_t instance) const { return sensors[instance].pressure; }
// temperature in degrees C
float get_temperature(void) const { return get_temperature(_primary); }
float get_temperature(uint8_t instance) const { return sensors[instance].temperature; }
// get pressure correction in Pascal. Divide by 100 for millibars or hectopascals
float get_pressure_correction(void) const { return get_pressure_correction(_primary); }
float get_pressure_correction(uint8_t instance) const { return sensors[instance].p_correction; }
// accumulate a reading on sensors. Some backends without their
// own thread or a timer may need this.
void accumulate(void);
// calibrate the barometer. This must be called on startup if the
// altitude/climb_rate/acceleration interfaces are ever used
void calibrate(bool save=true);
// update the barometer calibration to the current pressure. Can
// be used for incremental preflight update of baro
void update_calibration(void);
// get current altitude in meters relative to altitude at the time
// of the last calibrate() call
float get_altitude(void) const { return get_altitude(_primary); }
float get_altitude(uint8_t instance) const { return sensors[instance].altitude; }
// get altitude difference in meters relative given a base
// pressure in Pascal
float get_altitude_difference(float base_pressure, float pressure) const;
// get scale factor required to convert equivalent to true airspeed
float get_EAS2TAS(void);
// get air density / sea level density - decreases as altitude climbs
float get_air_density_ratio(void);
// get current climb rate in meters/s. A positive number means
// going up
float get_climb_rate(void);
// ground temperature in degrees C
// the ground values are only valid after calibration
float get_ground_temperature(void) const;
// ground pressure in Pascal
// the ground values are only valid after calibration
float get_ground_pressure(void) const { return get_ground_pressure(_primary); }
float get_ground_pressure(uint8_t i) const { return sensors[i].ground_pressure.get(); }
// set the temperature to be used for altitude calibration. This
// allows an external temperature source (such as a digital
// airspeed sensor) to be used as the temperature source
void set_external_temperature(float temperature);
// get last time sample was taken (in ms)
uint32_t get_last_update(void) const { return get_last_update(_primary); }
uint32_t get_last_update(uint8_t instance) const { return sensors[instance].last_update_ms; }
// settable parameters
static const struct AP_Param::GroupInfo var_info[];
float get_external_temperature(void) const { return get_external_temperature(_primary); };
float get_external_temperature(const uint8_t instance) const;
// HIL (and SITL) interface, setting altitude
void setHIL(float altitude_msl);
// HIL (and SITL) interface, setting pressure, temperature, altitude and climb_rate
// used by Replay
void setHIL(uint8_t instance, float pressure, float temperature, float altitude, float climb_rate, uint32_t last_update_ms);
// Set the primary baro
void set_primary_baro(uint8_t primary) { _primary_baro.set_and_save(primary); };
// Set the type (Air or Water) of a particular instance
void set_type(uint8_t instance, baro_type_t type) { sensors[instance].type = type; };
// Get the type (Air or Water) of a particular instance
baro_type_t get_type(uint8_t instance) { return sensors[instance].type; };
// HIL variables
struct {
float pressure;
float temperature;
float altitude;
float climb_rate;
uint32_t last_update_ms;
bool updated:1;
bool have_alt:1;
bool have_last_update:1;
} _hil;
// register a new sensor, claiming a sensor slot. If we are out of
// slots it will panic
uint8_t register_sensor(void);
// return number of registered sensors
uint8_t num_instances(void) const { return _num_sensors; }
// enable HIL mode
void set_hil_mode(void) { _hil_mode = true; }
// set baro drift amount
void set_baro_drift_altitude(float alt) { _alt_offset = alt; }
// get baro drift amount
float get_baro_drift_offset(void) { return _alt_offset_active; }
// simple atmospheric model
static void SimpleAtmosphere(const float alt, float &sigma, float &delta, float &theta);
// simple underwater atmospheric model
static void SimpleUnderWaterAtmosphere(float alt, float &rho, float &delta, float &theta);
// set a pressure correction from AP_TempCalibration
void set_pressure_correction(uint8_t instance, float p_correction);
uint8_t get_filter_range() const { return _filter_range; }
// indicate which bit in LOG_BITMASK indicates baro logging enabled
void set_log_baro_bit(uint32_t bit) { _log_baro_bit = bit; }
bool should_log() const;
// allow threads to lock against baro update
HAL_Semaphore &get_semaphore(void) {
return _rsem;
}
private:
// singleton
static AP_Baro *_singleton;
// how many drivers do we have?
uint8_t _num_drivers;
AP_Baro_Backend *drivers[BARO_MAX_DRIVERS];
// how many sensors do we have?
uint8_t _num_sensors;
// what is the primary sensor at the moment?
uint8_t _primary;
uint32_t _log_baro_bit = -1;
// bitmask values for GND_PROBE_EXT
enum {
PROBE_BMP085=(1<<0),
PROBE_BMP280=(1<<1),
PROBE_MS5611=(1<<2),
PROBE_MS5607=(1<<3),
PROBE_MS5637=(1<<4),
PROBE_FBM320=(1<<5),
PROBE_DPS280=(1<<6),
PROBE_LPS25H=(1<<7),
PROBE_KELLER=(1<<8),
PROBE_MS5837=(1<<9),
};
struct sensor {
baro_type_t type; // 0 for air pressure (default), 1 for water pressure
uint32_t last_update_ms; // last update time in ms
uint32_t last_change_ms; // last update time in ms that included a change in reading from previous readings
bool healthy:1; // true if sensor is healthy
bool alt_ok:1; // true if calculated altitude is ok
bool calibrated:1; // true if calculated calibrated successfully
float pressure; // pressure in Pascal
float temperature; // temperature in degrees C
float altitude; // calculated altitude
AP_Float ground_pressure;
float p_correction;
} sensors[BARO_MAX_INSTANCES];
AP_Float _alt_offset;
float _alt_offset_active;
AP_Int8 _primary_baro; // primary chosen by user
AP_Int8 _ext_bus; // bus number for external barometer
float _last_altitude_EAS2TAS;
float _EAS2TAS;
float _external_temperature;
uint32_t _last_external_temperature_ms;
DerivativeFilterFloat_Size7 _climb_rate_filter;
AP_Float _specific_gravity; // the specific gravity of fluid for an ROV 1.00 for freshwater, 1.024 for salt water
AP_Float _user_ground_temperature; // user override of the ground temperature used for EAS2TAS
bool _hil_mode:1;
float _guessed_ground_temperature; // currently ground temperature estimate using our best abailable source
// when did we last notify the GCS of new pressure reference?
uint32_t _last_notify_ms;
bool _add_backend(AP_Baro_Backend *backend);
void _probe_i2c_barometers(void);
AP_Int8 _filter_range; // valid value range from mean value
AP_Int32 _baro_probe_ext;
// semaphore for API access from threads
HAL_Semaphore_Recursive _rsem;
};
namespace AP {
AP_Baro &baro();
};
|
DonLakeFlyer/ardupilot
|
libraries/AP_Baro/AP_Baro.h
|
C
|
gpl-3.0
| 10,065
|
<?php
namespace biz\core\accounting\components;
use Yii;
use biz\core\accounting\models\Payment as MPayment;
use biz\core\accounting\models\PaymentDtl;
use biz\core\accounting\models\Invoice;
use yii\base\UserException;
/**
* Description of Payment
*
* @author Misbahul D Munir <misbahuldmunir@gmail.com>
* @since 3.0
*/
class Payment extends \biz\core\base\Api
{
/**
*
* @var string
*/
public $modelClass = 'biz\core\accounting\models\Payment';
/**
*
* @var string
*/
public $prefixEventName = 'e_payment';
/**
*
* @param type $data
* @param \biz\core\accounting\models\Payment $model
* @return \biz\core\accounting\models\Payment
*/
public function create($data, $model = null)
{
/* @var $model MPayment */
$model = $model ? : $this->createNewModel();
$success = false;
$model->scenario = MPayment::SCENARIO_DEFAULT;
$model->load($data, '');
if (!empty($data['details'])) {
$this->fire('_create', [$model]);
$success = $model->save();
$success = $model->saveRelated('paymentDtls', $data, $success, 'details');
if ($success) {
$this->fire('_created', [$model]);
} else {
if ($model->hasRelatedErrors('paymentDtls')) {
$model->addError('details', 'Details validation error');
}
}
} else {
$model->validate();
$model->addError('details', 'Details cannot be blank');
}
return $this->processOutput($success, $model);
}
/**
*
* @param string $id
* @param array $data
* @param \biz\core\accounting\models\Payment $model
* @return \biz\core\accounting\models\Payment
*/
public function update($id, $data, $model = null)
{
/* @var $model MPayment */
$model = $model ? : $this->findModel($id);
$success = false;
$model->scenario = MPayment::SCENARIO_DEFAULT;
$model->load($data, '');
if (!isset($data['details']) || $data['details'] !== []) {
$this->fire('_update', [$model]);
$success = $model->save();
if (!empty($data['details'])) {
$success = $model->saveRelated('paymentDtls', $data, $success, 'details');
}
if ($success) {
$this->fire('_updated', [$model]);
} else {
if ($model->hasRelatedErrors('paymentDtls')) {
$model->addError('details', 'Details validation error');
}
}
} else {
$model->validate();
$model->addError('details', 'Details cannot be blank');
}
return $this->processOutput($success, $model);
}
/**
*
* @param array $data
* @param \biz\core\accounting\models\Payment $model
* @return \biz\core\accounting\models\Payment
* @throws UserException
*/
public function createFromInvoice($data, $model = null)
{
/* @var $model MPayment */
$pay_vals = ArrayHelper::map($data['details'], 'id_invoice', 'value');
$ids = array_keys($pay_vals);
$invoice_values = Invoice::find()
->where(['id_invoice' => $ids])
->indexBy('id_invoice')
->asArray()
->all();
$vendor = $inv_type = null;
$vendors = $inv_types = [];
foreach ($invoice_values as $row) {
$vendor = $row['id_vendor'];
$vendors[$vendor] = true;
$inv_type = $row['invoice_type'];
$inv_types[$inv_type] = true;
}
if (count($vendors) !== 1) {
throw new UserException('Vendor harus sama');
}
if (count($inv_types) !== 1) {
throw new UserException('Type invoice harus sama');
}
$invoice_paid = PaymentDtl::find()
->select(['id_invoice', 'total' => 'sum(payment_value)'])
->where(['id_invoice' => $ids])
->groupBy('id_invoice')
->indexBy('id_invoice')
->asArray()
->all();
$data['id_vendor'] = $vendor;
$data['payment_type'] = $inv_type;
$details = [];
foreach ($inv_vals as $id => $value) {
$sisa = $invoice_values[$id]['invoice_value'];
if (isset($invoice_paid[$id])) {
$sisa -= $invoice_paid[$id]['total'];
}
if ($value > $sisa) {
throw new UserException('Tagihan lebih besar dari sisa');
}
$details[] = [
'id_invoice' => $id,
'payment_value' => $value,
];
}
$data['details'] = $details;
return $this->create($data, $model);
}
/**
*
* @param string $id
* @param array $data
* @param \biz\core\accounting\models\Payment $model
* @return \biz\core\accounting\models\Payment
*/
public function post($id, $data, $model = null)
{
/* @var $model MPayment */
$model = $model ? : $this->findModel($id);
$model->load($data, '');
return $this->processOutput($success, $model);
}
}
|
sangkil/application
|
libraries/biz/core/accounting/components/Payment.php
|
PHP
|
gpl-3.0
| 5,474
|
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
###########################################################################
# #
# ESPResSo++ Benchmark Python script for a polymer melt #
# #
###########################################################################
import sys
import time
import espresso
import mpi4py.MPI as MPI
import logging
from espresso import Real3D, Int3D
from espresso.tools import lammps, gromacs
from espresso.tools import decomp, timers, replicate
# simulation parameters (nvt = False is nve)
steps = 1000
rc = 1.12
skin = 0.3
nvt = True
timestep = 0.01
######################################################################
### IT SHOULD BE UNNECESSARY TO MAKE MODIFICATIONS BELOW THIS LINE ###
######################################################################
sys.stdout.write('Setting up simulation ...\n')
bonds, angles, x, y, z, Lx, Ly, Lz = lammps.read('espressopp_polymer_melt.start')
bonds, angles, x, y, z, Lx, Ly, Lz = replicate(bonds, angles, x, y, z, Lx, Ly, Lz, xdim=1, ydim=1, zdim=1)
num_particles = len(x)
density = num_particles / (Lx * Ly * Lz)
size = (Lx, Ly, Lz)
system = espresso.System()
system.rng = espresso.esutil.RNG()
system.bc = espresso.bc.OrthorhombicBC(system.rng, size)
system.skin = skin
comm = MPI.COMM_WORLD
nodeGrid = espresso.tools.decomp.nodeGrid(comm.size)
cellGrid = espresso.tools.decomp.cellGrid(size,nodeGrid,rc,skin)
system.storage = espresso.storage.DomainDecomposition(system, nodeGrid, cellGrid)
# add particles to the system and then decompose
# do this in chunks of 1000 particles to speed it up
props = ['id', 'type', 'mass', 'pos']
new_particles = []
for i in range(num_particles):
part = [i + 1, 0, 1.0, Real3D(x[i], y[i], z[i])]
new_particles.append(part)
if i % 1000 == 0:
system.storage.addParticles(new_particles, *props)
system.storage.decompose()
new_particles = []
system.storage.addParticles(new_particles, *props)
system.storage.decompose()
# Lennard-Jones with Verlet list
vl = espresso.VerletList(system, cutoff = rc + system.skin)
potLJ = espresso.interaction.LennardJones(1.0, 1.0, cutoff = rc, shift = False)
interLJ = espresso.interaction.VerletListLennardJones(vl)
interLJ.setPotential(type1 = 0, type2 = 0, potential = potLJ)
system.addInteraction(interLJ)
# FENE bonds
fpl = espresso.FixedPairList(system.storage)
fpl.addBonds(bonds)
potFENE = espresso.interaction.FENE(K=30.0, r0=0.0, rMax=1.5)
interFENE = espresso.interaction.FixedPairListFENE(system, fpl, potFENE)
system.addInteraction(interFENE)
# Cosine with FixedTriple list
ftl = espresso.FixedTripleList(system.storage)
ftl.addTriples(angles)
potCosine = espresso.interaction.Cosine(K=1.5, theta0=3.1415926)
interCosine = espresso.interaction.FixedTripleListCosine(system, ftl, potCosine)
#interCosine.setPotential(type1 = 0, type2 = 0, potential = potCosine)
system.addInteraction(interCosine)
# integrator
integrator = espresso.integrator.VelocityVerlet(system)
integrator.dt = timestep
if(nvt):
langevin = espresso.integrator.LangevinThermostat(system)
langevin.gamma = 1.0
langevin.temperature = 1.0
integrator.addExtension(langevin)
# print simulation parameters
print ''
print 'number of particles =', num_particles
print 'density = %.4f' % (density)
print 'rc =', rc
print 'dt =', integrator.dt
print 'skin =', system.skin
print 'nvt =', nvt
print 'steps =', steps
print 'NodeGrid = %s' % (nodeGrid)
print 'CellGrid = %s' % (cellGrid)
print ''
# analysis
# configurations = espresso.analysis.Configurations(system)
# configurations.gather()
temperature = espresso.analysis.Temperature(system)
pressure = espresso.analysis.Pressure(system)
pressureTensor = espresso.analysis.PressureTensor(system)
fmt = '%5d %8.4f %10.5f %8.5f %12.3f %12.3f %12.3f %12.3f %12.3f\n'
T = temperature.compute()
P = pressure.compute()
Pij = pressureTensor.compute()
Ek = 0.5 * T * (3 * num_particles)
Ep = interLJ.computeEnergy()
Eb = interFENE.computeEnergy()
Ea = interCosine.computeEnergy()
Etotal = Ek + Ep + Eb + Ea
sys.stdout.write(' step T P Pxy etotal ekinetic epair ebond eangle\n')
sys.stdout.write(fmt % (0, T, P, Pij[3], Etotal, Ek, Ep, Eb, Ea))
start_time = time.clock()
integrator.run(steps)
end_time = time.clock()
T = temperature.compute()
P = pressure.compute()
Pij = pressureTensor.compute()
Ek = 0.5 * T * (3 * num_particles)
Ep = interLJ.computeEnergy()
Eb = interFENE.computeEnergy()
Ea = interCosine.computeEnergy()
Etotal = Ek + Ep + Eb + Ea
sys.stdout.write(fmt % (steps, T, P, Pij[3], Etotal, Ek, Ep, Eb, Ea))
sys.stdout.write('\n')
# print timings and neighbor list information
timers.show(integrator.getTimers(), precision=2)
sys.stdout.write('Total # of neighbors = %d\n' % vl.totalSize())
sys.stdout.write('Ave neighs/atom = %.1f\n' % (vl.totalSize() / float(num_particles)))
sys.stdout.write('Neighbor list builds = %d\n' % vl.builds)
sys.stdout.write('Integration steps = %d\n' % integrator.step)
sys.stdout.write('CPUs = %i CPU time per CPU = %.1f\n' % (comm.size,end_time - start_time))
|
acfogarty/espressopp
|
bench/polymer_melt/espressopp/espressopp_polymer_melt.py
|
Python
|
gpl-3.0
| 5,227
|
/*
Copyright (c) 2012-2020 Maarten Baert <maarten-baert@hotmail.com>
This file is part of SimpleScreenRecorder.
SimpleScreenRecorder 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.
SimpleScreenRecorder 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 SimpleScreenRecorder. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "Global.h"
template<typename E>
class EnumStrings {
private:
static const EnumStrings SINGLETON;
private:
std::vector<std::pair<E, QString> > m_to_string, m_from_string;
private:
inline static bool CompareFirst(const std::pair<E, QString>& a, const std::pair<E, QString>& b) { return (a.first < b.first); }
inline static bool CompareSecond(const std::pair<E, QString>& a, const std::pair<E, QString>& b) { return (a.second < b.second); }
public:
EnumStrings(std::initializer_list<std::pair<E, QString> > list) {
m_to_string = m_from_string = list;
std::sort(m_to_string.begin(), m_to_string.end(), CompareFirst);
std::sort(m_from_string.begin(), m_from_string.end(), CompareSecond);
}
inline static QString ToString(E value) {
auto it = std::lower_bound(SINGLETON.m_to_string.begin(), SINGLETON.m_to_string.end(), std::make_pair(value, QString()), CompareFirst);
if(it == SINGLETON.m_to_string.end() || it->first != value) {
assert(false);
return QString();
}
return it->second;
}
inline static E FromString(const QString& string, E fallback) {
auto it = std::lower_bound(SINGLETON.m_from_string.begin(), SINGLETON.m_from_string.end(), std::make_pair((E) 0, string), CompareSecond);
if(it == SINGLETON.m_from_string.end() || it->second != string)
return fallback;
return it->first;
}
};
template<typename E>
inline QString EnumToString(E value) { return EnumStrings<E>::ToString(value); }
template<typename E>
inline E StringToEnum(const QString& string, E fallback) { return EnumStrings<E>::FromString(string, fallback); }
#define ENUMSTRINGS(E) template<> const EnumStrings<E> EnumStrings<E>::SINGLETON
|
sysms/ssr
|
src/common/EnumStrings.h
|
C
|
gpl-3.0
| 2,428
|
-----------------------------------
-- Area: Everbloom Hollow (86)
-- Mob: 7th_Cohors_Legionnaire
-----------------------------------
-- require("scripts/zones/Everbloom_Hollow/MobIDs");
-----------------------------------
-- onMobInitialize
-----------------------------------
function onMobInitialize(mob)
end;
-----------------------------------
-- onMobSpawn
-----------------------------------
function onMobSpawn(mob)
end;
-----------------------------------
-- onMobEngaged
-----------------------------------
function onMobEngaged(mob,target)
end;
-----------------------------------
-- onMobFight
-----------------------------------
function onMobFight(mob,target)
end;
-----------------------------------
-- onMobDeath
-----------------------------------
function onMobDeath(mob,killer)
end;
|
salamader/ffxi-a
|
scripts/zones/Everbloom_Hollow/mobs/7th_Cohors_Legionnaire.lua
|
Lua
|
gpl-3.0
| 822
|
html{
margin:0px;
padding:0px;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:80%;
}
body{
margin:0px;
padding:0px;
}
.topbar{
height:80px;
background-image:url(../images/TopBar.jpg);
background-repeat:repeat-x;
margin:0 auto;
width:910px;
}
.edit_topbar{
height:65px;
background-image:url(../images/edit_TopBar.jpg);
background-repeat:repeat-x;
margin:0 auto;
width:910px;
}
.title{
border-bottom:#f3eee2 1px dotted;
color:#aa9d71;
}
.title p{
font-size:200%;
margin:5px 0px;
}
.mainbody{
width:910px;
margin:0 auto;
}
.mainbody_left{
float:right;
position:relative;
}
.mainbody_div{
background-position:top left;
background-repeat:no-repeat;
background-image:url(../images/BackgroundLogin.gif);
float:left;
position:relative;
width:362px;
height:415px;
padding-top:380px;
}
.mainbody_holder{
float:right;
position:relative;
margin:20px auto;
height:500px;
}
.mainbody_div_2{
float:right;
position:relative;
width:250px;
}
.intro{
font-weight:bold;
}
.top_left{
float:left;
background-position:top left;
background-repeat:no-repeat;
}
.top_right{
float:right;
background-position:top right;
}
.bottom_left{
float:left;
background-position:bottom left;
}
.bottom_right{
float:right;
background-position:bottom right;
}
.sign_in_TL{
background-image:url(../images/RoundCornerTL.gif);
margin-bottom:10px;
}
.sign_in_TR{
background-image:url(../images/RoundCornerTR.gif);
}
.sign_in_BL{
background-image:url(../images/RoundCornerBL.gif);
}
.sign_in_BR{
background-image:url(../images/RoundCornerBR.gif);
}
.m_b_d_2_child{
background-repeat:no-repeat;
width:100%;
height:100%;
}
.bottom_right p{
padding:5px 0 0 10px;
color:#645f4f;
font-weight:bold;
}
.bottom_right div{
float:left;
padding-right:20px;
}
.bottom_right div form{
float:right;
}
.bottom_right div form p{
float:left;
margin:0px;
font-weight:normal;
color:#000;
padding:10px 1px 1px 10px;
}
.border{
height:1px;
width:100%;
float:left;
position:relative;
border-bottom:#f3eee2 1px dotted;
line-height:1px;
margin:0px;
padding:0px;
overflow:hidden
}
.copyright{
width:100%;
text-align:center;
color:#645f4f;
margin:25px 0;
width:100%;
float:left;
position:relative;
font-size:85%;
}
.news{
background-color:#f9f7f2;
float:left;
margin:10px 0 20px 0;
width:250px;
}
.news_title{
padding:10px 0 10px 10px;
font-weight:bold;
color:#645f4f;
margin:0px;
}
.news_story{
padding:0 0 10px 10px;
margin:0px;
color:#000000;
}
.news_story a{
font-weight:normal;
color:#000;
}
.tutorials{
background-color:#f9f7f2;
float:left;
margin:0px 0 40px 0;
width:260px;
margin-right:20px;
height:475px;
}
.tutorials_title{
padding:10px 0 10px 10px;
font-weight:bold;
color:#645f4f;
margin:0px;
}
.tutorials_story{
padding:0 0 10px 10px;
margin:0px;
color:#000000;
}
.tutorials_story a{
font-weight:normal;
color:#000;
}
.general{
font-weight:normal;
color:#000;
padding:0 10px 5px 10px;
margin:0px;
font-size:85%;
}
/* 2nd page css code */
.pagecontainer{
margin:0 auto;
width:910px
}
.file_mgt_area{
float:left;
width:582px;
position:relative;
margin:10px 0 10px 0;
}
.file_mgt_area_top{
width:582px;
float:left;
position:relative;
background:#f3eee2
}
.heading{
color:#645f4f;
font-weight:bold;
padding:0px;
margin:10px 0 5px 10px;
}
.file_mgt_area_middle{
float:left;
position:relative;
width:578px;
border:1px #f3eee2 solid;
background-color:#fff;
margin:0px;
padding:0px;
}
.file_mgt_area_middle_button{
float:left;
position:relative;
width:574px;
border:1px #b6b3a8 solid;
background-color:#e8edf3;
margin:1px;
}
.file_mgt_area_middle_button img, .file_mgt_area_middle_button button {
margin:4px;
}
.file_mgt_area_middle_button_left{
float:left;
position:relative;
border-right:#b6b3a8 1px solid;
height:30px;
}
.file_mgt_area_middle_button_right{
float:left;
position:relative;
}
div#file_area div p{
font-weight:bold;
font-size:85%;
margin:0px;
}
.file_mgt_area_bottom{
width:582px;
float:left;
position:relative;
background:#f3eee2;
height:20px;
}
.demo{
margin:0px;
color:#000;
margin:0px;
padding:0px 10px 10px 10px;
font-size:85%;
}
.demo a{
font-weight:bold;
color:#000;
text-decoration:none;
}
.help{
background-color:#f9f7f2;
float:left;
width:100%;
margin:10px 0;
height:150px;
min-height:150px;
overflow:visible;
}
.new_template_area{
width:310px;
float:right;
position:relative;
margin-top:10px;
}
.new_template_mod{
background-color:#f3eee2;
margin-bottom:0px;
}
.new_template_area_middle{
float:left;
position:relative;
background-color:#fff;
width:306px;
border:#f3eee2 1px solid;
padding:1px;
height:490px;
}
.new_template_area_middle_scroll{
float:left;
position:relative;
border:1px #b6b3a8 solid;
width:303px;
overflow:scroll;
height:490px;
}
.template{
float:left;
position:relative;
padding:0px;
border-bottom:1px #758389 dotted;
margin:5px 0 10px 10px;
padding-bottom:10px;
}
.template_icon{
float:left;
position:relative;
width:14px;
height:20px;
background-image:url(../images/Icon_Page.gif);
background-repeat:no-repeat;
background-position:top;
margin:5px 5px 0 0;
}
.template_desc{
float:left;
position:relative;
font-size:85%;
width:230px;
margin-top:5px
}
.template_name{
margin:0px;
font-weight:bold;
width:200px;
}
.template_desc_p{
margin:3px 0 13px 0;
}
.template_desc a{
padding:10px 0 0 0;
color:#000000;
font-weight:bold;
}
.template_border{
margin:5px auto;
width:290px;
background-color:#b6b3a8;
height:1px;
overflow:hidden
}
.template_name{
font-weight:bold;
}
.new_template_area_middle_scroll p a{
color:#000;
font-weight:bold;
}
.rename{
float:left;
position:relative;
padding:5px 0 0 20px;
margin:0px;
overflow:hidden;
display:none;
clear:left;
width:100%;
}
.rename span{
margin:5px 0 0 0;
padding:0px;
font-size:85%;
}
.rename form{
margin:5px 0 0 0;
padding:0px;
}
.form_button_pad{
margin:5px 0 0 0;
padding:0px
}
div#file_area{
height:300px;
overflow:scroll;
float:left;
position:relative;
width:100%;
background-color:#fff;
}
.folder{
float:left;
position:relative;
width:100%;
height:25px;
margin-left:15px;
z-index:0;
}
.file{
position:relative;
height:25px;
width:100%;
float:left;
margin-left:15px;
z-index:1;
}
.folder_content{
display:none;
margin-left:15px;
}
div#folder_workspace, div#recyclebin{
margin:0px;
}
.workspace{
display:block;
}
.error {
color: red;
font-weight:bold;
display: inline;
}
.info {
color: blue;
font-weight:bold;
display: inline;
}
.ok {
color: green;
font-weight:bold;
display: inline;
}
|
juliantenney/xerteonlinetoolkits
|
website_code/styles/frontpage.css
|
CSS
|
gpl-3.0
| 6,923
|
(function () {
"use strict";
angular
.module("philoApp")
.directive('searchForm', searchForm)
.directive('searchReports', searchReports)
.directive('searchTerms', searchTerms)
.directive('searchMethods', searchMethods)
.directive('metadataFields', metadataFields)
.directive('collocationOptions', collocationOptions)
.directive('timeSeriesOptions', timeSeriesOptions)
.directive('resultsPerPage', resultsPerPage)
.directive('autocompleteTerm', autocompleteTerm)
.directive('autocompleteMetadata', autocompleteMetadata)
.directive('sortResults', sortResults);
function searchForm($rootScope) {
return {
templateUrl: 'app/shared/searchForm/searchForm.html',
replace: true,
scope: false,
link: function (scope) {
scope.approximateValues = [50, 60, 70, 80, 90];
scope.approximateValue = "How approximate?";
scope.selectApproximate = function (value) {
scope.approximateValue = value;
$rootScope.formData.approximate_ratio = value;
}
}
};
}
function searchReports($rootScope, $location) {
var reportChange = function (report) {
if (report === 'landing_page') {
report = $rootScope.philoConfig.search_reports[0];
} else if (report === "collocation") {
if ($rootScope.philoConfig.stopwords.length > 0) {
$rootScope.formData.colloc_filter_choice = "stopwords"
} else {
$rootScope.formData.colloc_filter_choice = "frequency"
}
}
$rootScope.formData.report = report;
var reports = [];
for (var i = 0; i < $rootScope.philoConfig.search_reports.length; i++) {
var value = $rootScope.philoConfig.search_reports[i];
var label = value.replace('_', ' ');
reports.push({
value: value,
label: label
});
}
return reports
}
return {
restrict: 'E',
templateUrl: 'app/shared/searchForm/searchReports.html',
replace: true,
link: function (scope, element, attrs) {
scope.reportChange = reportChange;
scope.$watch('report', function (report) {
var reportToSelect = angular.copy(report);
if (reportToSelect === "bibliography") {
reportToSelect = "concordance";
} else if (reportToSelect === "textNavigation" || reportToSelect === "table-of-contents") {
reportToSelect = "concordance";
} else if (typeof (reportToSelect) == "undefined") {
reportToSelect = $location.search().report || "concordance";
}
scope.reports = reportChange(reportToSelect);
});
}
};
}
function searchTerms() {
return {
templateUrl: 'app/shared/searchForm/searchTerms.html',
replace: true
}
}
function searchMethods() {
return {
templateUrl: 'app/shared/searchForm/searchMethods.html',
replace: true
}
}
function metadataFields(philoConfig, $rootScope) {
var buildMetadata = function (scope, fields) {
var metadataFields = [];
for (var i = 0; i < fields.length; i++) {
var metadata = fields[i];
var metadataObject = {};
metadataObject.value = metadata;
if (metadata in scope.philoConfig.metadata_aliases) {
metadataObject.label = scope.philoConfig.metadata_aliases[metadata];
} else {
metadataObject.label = metadata[0].toUpperCase() + metadata.slice(1);
}
metadataObject.example = scope.philoConfig.search_examples[metadata];
metadataFields.push(metadataObject);
}
return metadataFields
}
return {
templateUrl: 'app/shared/searchForm/metadataFields.html',
replace: true,
link: function (scope, element, attrs) {
scope.dropdownValues = {};
scope.selectedDropdownValue = {};
for (var metadata in philoConfig.metadata_dropdown_values) {
scope.dropdownValues[metadata] = [];
var dropdownValue = philoConfig.metadata_dropdown_values[metadata];
if (typeof($rootScope.formData[metadata]) == 'undefined' || $rootScope.formData[metadata].length == 0) {
scope.selectedDropdownValue[metadata] = 'select';
}
for (var i = 0; i < dropdownValue.length; i++) {
var quotedValue = dropdownValue[i].value;
if (typeof($rootScope.formData[metadata]) != 'undefined' && $rootScope.formData[metadata] == quotedValue) {
scope.selectedDropdownValue[metadata] = dropdownValue[i].label;
}
scope.dropdownValues[metadata].push({
label: dropdownValue[i].label,
value: quotedValue
});
}
}
scope.metadataDropdownChoice = function(metadata, field) {
$rootScope.formData[metadata] = field.value;
scope.selectedDropdownValue[metadata] = field.label;
}
if (!attrs.field && !attrs.exclude) {
scope.metadataFields = buildMetadata(scope, scope.philoConfig.metadata);
scope.head = false;
scope.exclude = false;
} else if (attrs.field === "head") {
var head = [];
for (var i = 0; i < scope.philoConfig.metadata.length; i++) {
if (scope.philoConfig.metadata[i] === 'head') {
head.push(scope.philoConfig.metadata[i]);
break
}
}
scope.head = true;
scope.exclude = false;
scope.metadataFields = buildMetadata(scope, ["head"]);
} else if (attrs.exclude === "head") {
var fields = [];
for (var i = 0; i < scope.philoConfig.metadata.length; i++) {
if (scope.philoConfig.metadata[i] !== 'head') {
fields.push(scope.philoConfig.metadata[i]);
}
}
scope.head = false;
scope.exclude = true;
scope.metadataFields = buildMetadata(scope, fields);
}
}
}
}
function collocationOptions($rootScope) {
return {
templateUrl: 'app/shared/searchForm/collocationOptions.html',
replace: true,
link: function (scope, element, attrs) {
scope.stopwords = $rootScope.philoConfig.stopwords;
if (scope.stopwords.length > 0) { // Make stopwords the default if defined
if (!'colloc_filter_choice' in $rootScope.formData || typeof ($rootScope.formData.colloc_filter_choice) === 'undefined') {
$rootScope.formData.colloc_filter_choice = "stopwords";
}
} else {
if (!'colloc_filter_choice' in $rootScope.formData || typeof ($rootScope.formData.colloc_filter_choice) === 'undefined') {
$rootScope.formData.colloc_filter_choice = "frequency";
}
if (!'filter_frequency' in $rootScope.formData || typeof ($rootScope.formData.filter_frequency) === 'undefined') {
$rootScope.formData.filter_frequency = 100;
}
}
}
}
}
function timeSeriesOptions($rootScope, philoConfig) {
return {
templateUrl: 'app/shared/searchForm/timeSeriesOptions.html',
replace: true,
link: function () {
if (!$rootScope.formData.year_interval) {
$rootScope.formData.year_interval = philoConfig.time_series_interval;
}
}
}
}
function resultsPerPage() {
return {
templateUrl: 'app/shared/searchForm/resultsPerPage.html'
}
}
function autocompleteTerm($rootScope) {
var autocomplete = function (element) {
element.autocomplete({
source: 'scripts/autocomplete_term.py',
minLength: 2,
"dataType": "json",
focus: function (event, ui) {
var q = ui.item.label.replace(/<\/?span[^>]*?>/g, '');
return false;
},
select: function (event, ui) {
var q = ui.item.label.replace(/<\/?span[^>]*?>/g, '');
element.val(q);
$rootScope.formData.q = q;
return false;
}
}).data("ui-autocomplete")._renderItem = function (ul, item) {
var term = item.label.replace(/^[^<]*/g, '');
return angular.element("<li></li>")
.data("item.autocomplete", item)
.append(term)
.appendTo(ul);
}
}
return {
restrict: 'A',
link: function (scope, element) {
autocomplete(element);
}
}
}
function autocompleteMetadata($rootScope) {
var autocomplete = function (element, field) {
element.autocomplete({
source: 'scripts/autocomplete_metadata.py?field=' + field,
minLength: 2,
timeout: 1000,
dataType: "json",
focus: function (event, ui) {
var q = ui.item.label.replace(/<\/?span[^>]*?>/g, '');
q = q.replace(/ CUTHERE /, ' ');
return false;
},
select: function (event, ui) {
var q = ui.item.label.replace(/<\/?span[^>]*?>/g, '');
q = q.split(/(\||NOT)/);
q[q.length - 1] = q[q.length - 1].replace(/.*CUTHERE /, '');
q[q.length - 1] = '\"' + q[q.length - 1].replace(/^\s*/g, '') + '\"';
q = q.join(' ').replace(/""/g, '"');
element.val(q);
$rootScope.formData[field] = q
return false;
}
}).data("ui-autocomplete")._renderItem = function (ul, item) {
var term = item.label.replace(/.*(?=CUTHERE)CUTHERE /, '');
return angular.element("<li></li>")
.data("item.autocomplete", item)
.append(term)
.appendTo(ul);
};
}
return {
restrict: 'A',
link: function (scope, element, attrs) {
autocomplete(element, attrs.id);
}
}
}
function sortResults($rootScope, philoConfig) {
return {
templateUrl: 'app/shared/searchForm/sortResults.html',
link: function (scope) {
if ("sort_order" in $rootScope.formData && $rootScope.formData.sort_order.length >= 1) {
var label = []
if (typeof($rootScope.formData.sort_order) == "string") {
if ($rootScope.formData.sort_order in philoConfig.metadata_aliases) {
label = philoConfig.metadata_aliases[$rootScope.formData.sort_order];
} else {
label = $rootScope.formData.sort_order;
}
} else {
for (var j = 0; j < $rootScope.formData.sort_order.length; j += 1) {
if ($rootScope.formData.sort_order[j] in philoConfig.metadata_aliases) {
label.push(philoConfig.metadata_aliases[$rootScope.formData.sort_order[j]]);
} else {
label.push($rootScope.formData.sort_order[j]);
}
}
label = label.join(', ')
}
scope.selectedSortValues = label;
if (scope.selectedSortValues == "rowid") {
scope.selectedSortValues = "select";
}
} else {
scope.selectedSortValues = "select";
}
scope.sortValues = [{
value: [],
label: "select"
}];
for (var i = 0; i < philoConfig.concordance_biblio_sorting.length; i += 1) {
var sortValue = philoConfig.concordance_biblio_sorting[i];
if (typeof(sortValue) == 'string') {
sortValue = [sortValue];
}
var label = [];
for (var j = 0; j < sortValue.length; j += 1) {
if (sortValue[j] in philoConfig.metadata_aliases) {
label.push(philoConfig.metadata_aliases[sortValue[j]]);
} else {
label.push(sortValue[j]);
}
}
var value = {
label: label.join(', '),
value: sortValue
}
scope.sortValues.push(value);
}
scope.sortChoice = function (value) {
$rootScope.formData.sort_order = value.value;
scope.selectedSortValues = value.label;
if (scope.selectedSortValues == "rowid") {
scope.selectedSortValues = "select";
}
}
}
}
}
})();
|
ARTFL-Project/PhiloLogic5
|
www/app/shared/searchForm/searchFormDirectives.js
|
JavaScript
|
gpl-3.0
| 14,698
|
"""
Tests for serial.py.
"""
import cPickle
from cStringIO import StringIO
import gzip
import shutil
import tempfile
import unittest
from rdkit import Chem
from rdkit.Chem import AllChem
from vs_utils.utils.rdkit_utils import conformers, serial
class TestMolIO(unittest.TestCase):
"""
Base test class for molecule I/O.
"""
def setUp(self):
"""
Write SDF and SMILES molecules to temporary files.
"""
self.temp_dir = tempfile.mkdtemp()
# aspirin
self.aspirin = self._get_mol_from_smiles('CC(=O)OC1=CC=CC=C1C(=O)O',
'aspirin')
self.aspirin_h = Chem.AddHs(self.aspirin)
self.aspirin_sodium = self._get_mol_from_smiles(
'CC(=O)OC1=CC=CC=C1C(=O)[O-].[Na+]', 'aspirin sodium')
# levalbuterol (chiral)
self.levalbuterol = self._get_mol_from_smiles(
'CC(C)(C)NC[C@@H](C1=CC(=C(C=C1)O)CO)O', 'levalbuterol')
self.levalbuterol_hcl = self._get_mol_from_smiles(
'CC(C)(C)NC[C@@H](C1=CC(=C(C=C1)O)CO)O.Cl',
'levalbuterol hydrochloride')
self.ref_mols = [self.aspirin, self.levalbuterol]
self.reader = serial.MolReader(compute_2d_coords=False)
def _get_mol_from_smiles(self, smiles, name=None):
"""
Construct a molecule from a SMILES string.
Molecules loaded from SMILES strings have zero conformers, but
molecules loaded from SDF blocks are treated as 3D and have one
conformer even if coordinates are not set. This method dumps the
molecule to SDF and loads it again to obtain a molecule with one
conformer.
Parameters
----------
smiles : str
SMILES string.
name : str, optional
Molecule name.
"""
mol = Chem.MolFromSmiles(smiles)
if name is not None:
mol.SetProp('_Name', name)
AllChem.Compute2DCoords(mol) # required to preserve stereo
sdf = Chem.MolToMolBlock(mol, includeStereo=True)
mol_with_conf = Chem.MolFromMolBlock(sdf)
return mol_with_conf
def tearDown(self):
"""
Clean up temporary files.
"""
shutil.rmtree(self.temp_dir)
def test_guess_mol_format(self):
"""
Test MolIO.guess_mol_format.
"""
mol_formats = {
'pkl': ['test.pkl', 'test.pkl.gz', 'test.test.pkl',
'test.test.pkl.gz'],
'sdf': ['test.sdf', 'test.sdf.gz', 'test.test.sdf',
'test.test.sdf.gz'],
'smi': ['test.smi', 'test.smi.gz', 'test.can', 'test.can.gz',
'test.ism', 'test.ism.gz', 'test.test.smi',
'test.test.smi.gz']
}
for mol_format in mol_formats.keys():
for filename in mol_formats[mol_format]:
assert self.reader.guess_mol_format(filename) == mol_format
def test_close_context(self):
"""
Make sure MolIO closes files it opened.
"""
_, filename = tempfile.mkstemp(suffix='.sdf', dir=self.temp_dir)
self.reader.open(filename)
self.reader.close()
assert self.reader.f.closed
# also test the context manager
with self.reader.open(filename):
pass
assert self.reader.f.closed
def test_not_close_other(self):
"""
Make sure MolIO doesn't close files it didn't open.
"""
_, filename = tempfile.mkstemp(suffix='.sdf', dir=self.temp_dir)
with open(filename) as f:
reader = serial.MolReader(f, mol_format='sdf')
reader.close()
assert not f.closed
# also test the context manager
with open(filename) as g:
with serial.MolReader(g, mol_format='sdf'):
pass
assert not g.closed
class TestMolReader(TestMolIO):
"""
Test MolReader.
"""
def test_read_sdf(self):
"""
Read an SDF file.
"""
_, filename = tempfile.mkstemp(suffix='.sdf', dir=self.temp_dir)
with open(filename, 'wb') as f:
f.write(Chem.MolToMolBlock(self.aspirin))
self.reader.open(filename)
mols = self.reader.get_mols()
assert mols.next().ToBinary() == self.aspirin.ToBinary()
def test_read_sdf_gz(self):
"""
Read a compressed SDF file.
"""
_, filename = tempfile.mkstemp(suffix='.sdf.gz', dir=self.temp_dir)
with gzip.open(filename, 'wb') as f:
f.write(Chem.MolToMolBlock(self.aspirin))
self.reader.open(filename)
mols = self.reader.get_mols()
assert mols.next().ToBinary() == self.aspirin.ToBinary()
def test_read_smi(self):
"""
Read a SMILES file.
"""
self.aspirin.RemoveAllConformers() # SMILES are read without confs
_, filename = tempfile.mkstemp(suffix='.smi', dir=self.temp_dir)
with open(filename, 'wb') as f:
f.write(Chem.MolToSmiles(self.aspirin))
self.reader.open(filename)
mols = self.reader.get_mols()
assert mols.next().ToBinary() == self.aspirin.ToBinary()
def test_read_smi_title(self):
"""
Read a SMILES file with molecule titles.
"""
self.aspirin.RemoveAllConformers() # SMILES are read without confs
_, filename = tempfile.mkstemp(suffix='.smi', dir=self.temp_dir)
with open(filename, 'wb') as f:
f.write('{}\t{}'.format(Chem.MolToSmiles(self.aspirin), 'aspirin'))
self.reader.open(filename)
mols = self.reader.get_mols()
mol = mols.next()
assert mol.ToBinary() == self.aspirin.ToBinary()
assert mol.GetProp('_Name') == self.aspirin.GetProp('_Name')
def test_read_smi_gz(self):
"""
Read a compressed SMILES file.
"""
self.aspirin.RemoveAllConformers() # SMILES are read without confs
_, filename = tempfile.mkstemp(suffix='.smi.gz', dir=self.temp_dir)
with gzip.open(filename, 'wb') as f:
f.write(Chem.MolToSmiles(self.aspirin))
self.reader.open(filename)
mols = self.reader.get_mols()
assert mols.next().ToBinary() == self.aspirin.ToBinary()
def test_read_pickle(self):
"""
Read from a pickle.
"""
_, filename = tempfile.mkstemp(suffix='.pkl', dir=self.temp_dir)
with open(filename, 'wb') as f:
cPickle.dump([self.aspirin], f, cPickle.HIGHEST_PROTOCOL)
self.reader.open(filename)
mols = self.reader.get_mols()
assert mols.next().ToBinary() == self.aspirin.ToBinary()
def test_read_pickle_gz(self):
"""
Read from a compressed pickle.
"""
_, filename = tempfile.mkstemp(suffix='.pkl.gz', dir=self.temp_dir)
with gzip.open(filename, 'wb') as f:
cPickle.dump([self.aspirin], f, cPickle.HIGHEST_PROTOCOL)
self.reader.open(filename)
mols = self.reader.get_mols()
assert mols.next().ToBinary() == self.aspirin.ToBinary()
def test_read_file_like(self):
"""
Read from a file-like object.
"""
_, filename = tempfile.mkstemp(suffix='.sdf', dir=self.temp_dir)
with open(filename, 'wb') as f:
f.write(Chem.MolToMolBlock(self.aspirin))
with open(filename) as f:
reader = serial.MolReader(f, mol_format='sdf')
mols = reader.get_mols()
assert mols.next().ToBinary() == self.aspirin.ToBinary()
def test_read_compressed_file_like(self):
"""
Read from a file-like object using gzip.
"""
_, filename = tempfile.mkstemp(suffix='.sdf.gz', dir=self.temp_dir)
with gzip.open(filename, 'wb') as f:
f.write(Chem.MolToMolBlock(self.aspirin))
with gzip.open(filename) as f:
reader = serial.MolReader(f, mol_format='sdf')
mols = reader.get_mols()
assert mols.next().ToBinary() == self.aspirin.ToBinary()
def test_read_multiple_sdf(self):
"""
Read a multiple-molecule SDF file.
"""
_, filename = tempfile.mkstemp(suffix='.sdf', dir=self.temp_dir)
with open(filename, 'wb') as f:
for mol in self.ref_mols:
sdf = Chem.MolToMolBlock(mol)
f.write(sdf)
f.write('$$$$\n') # add molecule delimiter
self.reader.open(filename)
mols = self.reader.get_mols()
mols = list(mols)
assert len(mols) == 2
for i in xrange(len(mols)):
assert mols[i].ToBinary() == self.ref_mols[i].ToBinary()
def test_read_multiple_smiles(self):
"""
Read a multiple-molecule SMILES file.
"""
ref_mols = []
for mol in self.ref_mols:
mol = Chem.MolFromSmiles(Chem.MolToSmiles(mol))
ref_mols.append(mol)
_, filename = tempfile.mkstemp(suffix='.smi', dir=self.temp_dir)
with open(filename, 'wb') as f:
for mol in self.ref_mols:
smiles = Chem.MolToSmiles(mol)
name = mol.GetProp('_Name')
f.write('{}\t{}\n'.format(smiles, name))
self.reader.open(filename)
mols = self.reader.get_mols()
mols = list(mols)
assert len(mols) == 2
for i in xrange(len(mols)):
assert mols[i].ToBinary() == ref_mols[i].ToBinary()
def test_read_multiconformer(self):
"""
Read a multiconformer SDF file.
"""
# generate conformers
engine = conformers.ConformerGenerator(max_conformers=3,
pool_multiplier=1)
ref_mol = engine.generate_conformers(self.aspirin)
assert ref_mol.GetNumConformers() > 1
# write to disk
_, filename = tempfile.mkstemp(suffix='.sdf', dir=self.temp_dir)
with open(filename, 'wb') as f:
for conf in ref_mol.GetConformers():
f.write(Chem.MolToMolBlock(ref_mol, confId=conf.GetId()))
f.write('$$$$\n') # add molecule delimiter
# compare
self.reader.open(filename)
mols = self.reader.get_mols()
mols = list(mols)
assert len(mols) == 1
# FIXME get ToBinary test to work
# assert mols[0].ToBinary() == ref_mol.ToBinary()
assert Chem.MolToMolBlock(mols[0]) == Chem.MolToMolBlock(ref_mol)
def test_read_multiple_multiconformer(self):
"""
Read a multiconformer SDF file containing multiple molecules.
"""
# generate conformers
ref_mols = []
engine = conformers.ConformerGenerator(max_conformers=3,
pool_multiplier=1)
for mol in self.ref_mols:
expanded = engine.generate_conformers(mol)
assert expanded.GetNumConformers() > 1
ref_mols.append(expanded)
# write to disk
_, filename = tempfile.mkstemp(suffix='.sdf', dir=self.temp_dir)
with open(filename, 'wb') as f:
for mol in ref_mols:
for conf in mol.GetConformers():
f.write(Chem.MolToMolBlock(mol, includeStereo=1,
confId=conf.GetId()))
f.write('$$$$\n') # add molecule delimiter
# compare
self.reader.open(filename)
mols = self.reader.get_mols()
mols = list(mols)
assert len(mols) == 2
for mol, ref_mol in zip(mols, ref_mols):
# FIXME get ToBinary test to work
# assert mol.ToBinary() == ref_mol.ToBinary()
assert Chem.MolToMolBlock(
mol, includeStereo=1) == Chem.MolToMolBlock(ref_mol,
includeStereo=1)
def test_are_same_molecule(self):
"""
Test MolReader.are_same_molecule.
"""
assert self.reader.are_same_molecule(self.aspirin, self.aspirin)
assert not self.reader.are_same_molecule(self.aspirin,
self.levalbuterol)
def test_no_remove_hydrogens(self):
"""
Test hydrogen retention.
"""
_, filename = tempfile.mkstemp(suffix='.sdf', dir=self.temp_dir)
with open(filename, 'wb') as f:
f.write(Chem.MolToMolBlock(self.aspirin_h))
reader = serial.MolReader(remove_hydrogens=False, remove_salts=False)
reader.open(filename)
mols = reader.get_mols()
# FIXME get ToBinary test to work
# assert mols.next().ToBinary() == self.aspirin_h.ToBinary()
assert Chem.MolToMolBlock(mols.next()) == Chem.MolToMolBlock(
self.aspirin_h)
def test_remove_hydrogens(self):
"""
Test hydrogen removal.
"""
_, filename = tempfile.mkstemp(suffix='.sdf', dir=self.temp_dir)
with open(filename, 'wb') as f:
f.write(Chem.MolToMolBlock(self.aspirin_h))
reader = serial.MolReader(remove_hydrogens=True)
reader.open(filename)
mols = reader.get_mols()
assert mols.next().ToBinary() == self.aspirin.ToBinary()
def test_remove_salts(self):
"""
Test salt removal.
"""
_, filename = tempfile.mkstemp(suffix='.sdf', dir=self.temp_dir)
with open(filename, 'wb') as f:
for mol in [self.aspirin_sodium, self.levalbuterol_hcl]:
f.write(Chem.MolToMolBlock(mol))
f.write('$$$$\n') # molecule delimiter
ref_mols = [self.aspirin_sodium, self.levalbuterol_hcl]
self.reader = serial.MolReader(remove_salts=True)
self.reader.open(filename)
mols = self.reader.get_mols()
mols = list(mols)
assert len(mols) == 2
for mol, ref_mol in zip(mols, ref_mols):
assert mol.GetNumAtoms() < ref_mol.GetNumAtoms()
desalted = self.reader.clean_mol(ref_mol)
assert mol.ToBinary() == desalted.ToBinary()
def test_no_remove_salts(self):
"""
Test salt retention.
"""
_, filename = tempfile.mkstemp(suffix='.sdf', dir=self.temp_dir)
with open(filename, 'wb') as f:
for mol in [self.aspirin_sodium, self.levalbuterol_hcl]:
f.write(Chem.MolToMolBlock(mol))
f.write('$$$$\n') # molecule delimiter
ref_mols = [self.aspirin_sodium, self.levalbuterol_hcl]
self.reader = serial.MolReader(remove_salts=False)
self.reader.open(filename)
mols = self.reader.get_mols()
mols = list(mols)
assert len(mols) == 2
self.reader = serial.MolReader(remove_salts=True)
for mol, ref_mol in zip(mols, ref_mols):
assert mol.ToBinary() == ref_mol.ToBinary()
desalted = self.reader.clean_mol(ref_mol)
assert mol.GetNumAtoms() > desalted.GetNumAtoms()
def test_iterator(self):
"""
Test MolWriter.__iter__.
"""
_, filename = tempfile.mkstemp(suffix='.sdf', dir=self.temp_dir)
with open(filename, 'wb') as f:
for mol in self.ref_mols:
f.write(Chem.MolToMolBlock(mol))
f.write('$$$$\n') # molecule delimiter
self.reader.open(filename)
for i, mol in enumerate(self.reader):
assert mol.ToBinary() == self.ref_mols[i].ToBinary()
def test_context_manager(self):
"""
Test using 'with' statement to read molecules.
"""
_, filename = tempfile.mkstemp(suffix='.sdf', dir=self.temp_dir)
with open(filename, 'wb') as f:
for mol in self.ref_mols:
f.write(Chem.MolToMolBlock(mol))
f.write('$$$$\n') # molecule delimiter
with self.reader.open(filename) as reader:
for i, mol in enumerate(reader):
assert mol.ToBinary() == self.ref_mols[i].ToBinary()
def test_skip_failures(self):
"""
Test skip read failures.
"""
smiles = 'CO(C)C'
reader = serial.MolReader(StringIO(smiles), 'smi')
mols = list(reader.get_mols())
assert len(mols) == 0
def test_is_a_salt(self):
"""
Test that a molecule that _is_ a salt is not returned empty.
"""
smiles = 'C(=CC(=O)O)C(=O)O'
reader = serial.MolReader(StringIO(smiles), 'smi', remove_salts=True)
mols = list(reader.get_mols())
assert len(mols) == 1 and mols[0].GetNumAtoms()
def test_read_multiple_pickles(self):
"""
Test reading a file containing multiple pickles. This can occur if
MolWriter.write is called multiple times.
"""
_, filename = tempfile.mkstemp(suffix='.pkl', dir=self.temp_dir)
with serial.MolWriter().open(filename) as writer:
writer.write([self.aspirin])
writer.write([self.levalbuterol])
with self.reader.open(filename) as reader:
mols = list(reader)
assert len(mols) == 2
assert mols[0].ToBinary() == self.aspirin.ToBinary()
assert mols[1].ToBinary() == self.levalbuterol.ToBinary()
class TestMolWriter(TestMolIO):
"""
Test MolWriter.
"""
def setUp(self):
"""
Add writer to inherited setup.
"""
super(TestMolWriter, self).setUp()
self.writer = serial.MolWriter()
self.aspirin_sdf = Chem.MolToMolBlock(self.aspirin)
self.aspirin_smiles = Chem.MolToSmiles(self.aspirin) + '\taspirin'
def test_write_sdf(self):
"""
Write an SDF file.
"""
_, filename = tempfile.mkstemp(suffix='.sdf', dir=self.temp_dir)
self.writer.open(filename)
self.writer.write([self.aspirin])
self.writer.close()
self.reader.open(filename)
mols = self.reader.get_mols()
# compare molecules
assert mols.next().ToBinary() == self.aspirin.ToBinary()
# compare files
with open(filename) as f:
data = f.read()
assert data == self.aspirin_sdf + '$$$$\n'
def test_write_sdf_gz(self):
"""
Write a compressed SDF file.
"""
_, filename = tempfile.mkstemp(suffix='.sdf.gz', dir=self.temp_dir)
self.writer.open(filename)
self.writer.write([self.aspirin])
self.writer.close()
self.reader.open(filename)
mols = self.reader.get_mols()
# compare molecules
assert mols.next().ToBinary() == self.aspirin.ToBinary()
# compare files
with gzip.open(filename) as f:
data = f.read()
assert data == self.aspirin_sdf + '$$$$\n'
def test_write_smiles(self):
"""
Write a SMILES file.
"""
_, filename = tempfile.mkstemp(suffix='.smi', dir=self.temp_dir)
self.writer.open(filename)
self.writer.write([self.aspirin])
self.writer.close()
self.reader.open(filename)
mols = self.reader.get_mols()
# compare molecules
self.aspirin.RemoveAllConformers() # SMILES are read without confs
assert mols.next().ToBinary() == self.aspirin.ToBinary()
# compare files
with open(filename) as f:
data = f.read()
assert data.strip() == self.aspirin_smiles
def test_write_smiles_gz(self):
"""
Write a compressed SMILES file.
"""
_, filename = tempfile.mkstemp(suffix='.smi.gz', dir=self.temp_dir)
self.writer.open(filename)
self.writer.write([self.aspirin])
self.writer.close()
self.reader.open(filename)
mols = self.reader.get_mols()
# compare molecules
self.aspirin.RemoveAllConformers() # SMILES are read without confs
assert mols.next().ToBinary() == self.aspirin.ToBinary()
# compare files
with gzip.open(filename) as f:
data = f.read()
assert data.strip() == self.aspirin_smiles
def test_write_pickle(self):
"""
Write a pickle.
"""
_, filename = tempfile.mkstemp(suffix='.pkl', dir=self.temp_dir)
self.writer.open(filename)
self.writer.write([self.aspirin])
self.writer.close()
self.reader.open(filename)
mols = self.reader.get_mols()
# compare molecules
assert mols.next().ToBinary() == self.aspirin.ToBinary()
# compare files
with open(filename) as f:
data = f.read()
assert data == cPickle.dumps([self.aspirin],
cPickle.HIGHEST_PROTOCOL)
def test_write_pickle_gz(self):
"""
Write a compressed pickle.
"""
_, filename = tempfile.mkstemp(suffix='.pkl.gz', dir=self.temp_dir)
self.writer.open(filename)
self.writer.write([self.aspirin])
self.writer.close()
self.reader.open(filename)
mols = self.reader.get_mols()
# compare molecules
assert mols.next().ToBinary() == self.aspirin.ToBinary()
# compare files
with gzip.open(filename) as f:
data = f.read()
assert data == cPickle.dumps([self.aspirin],
cPickle.HIGHEST_PROTOCOL)
def test_stereo_setup(self):
"""
Make sure chiral reference molecule is correct.
"""
smiles = Chem.MolToSmiles(self.levalbuterol, isomericSmiles=True)
assert '@' in smiles # check for stereochemistry flag
# check that removing stereochemistry changes the molecule
original = self.levalbuterol.ToBinary()
AllChem.RemoveStereochemistry(self.levalbuterol)
assert self.levalbuterol.ToBinary() != original
def test_stereo_sdf(self):
"""
Test stereochemistry preservation when writing to SDF.
"""
_, filename = tempfile.mkstemp(suffix='.sdf', dir=self.temp_dir)
writer = serial.MolWriter(stereo=True)
writer.open(filename)
writer.write([self.levalbuterol])
writer.close()
self.reader.open(filename)
mols = self.reader.get_mols()
assert mols.next().ToBinary() == self.levalbuterol.ToBinary()
def test_stereo_smi(self):
"""
Test stereochemistry preservation when writing to SMILES.
"""
# FIXME avoid this and use self.levalbuterol.RemoveAllConformers()
ref_mol = Chem.MolFromSmiles(Chem.MolToSmiles(self.levalbuterol,
isomericSmiles=True))
_, filename = tempfile.mkstemp(suffix='.smi', dir=self.temp_dir)
writer = serial.MolWriter(stereo=True)
writer.open(filename)
writer.write([self.levalbuterol])
writer.close()
self.reader.open(filename)
mols = self.reader.get_mols()
assert mols.next().ToBinary() == ref_mol.ToBinary()
def test_no_stereo_sdf(self):
"""
Test stereochemistry removal when writing to SDF.
"""
_, filename = tempfile.mkstemp(suffix='.sdf', dir=self.temp_dir)
writer = serial.MolWriter(stereo=False)
writer.open(filename)
writer.write([self.levalbuterol])
writer.close()
self.reader.open(filename)
mols = self.reader.get_mols()
mol = mols.next()
# make sure the written molecule differs from the reference
assert mol.ToBinary() != self.levalbuterol.ToBinary()
# check again after removing stereochemistry
AllChem.RemoveStereochemistry(self.levalbuterol)
# FIXME get ToBinary test to work
# assert mol.ToBinary() == self.levalbuterol.ToBinary()
assert Chem.MolToMolBlock(
mol, includeStereo=True) == Chem.MolToMolBlock(
self.levalbuterol, includeStereo=True)
def test_no_stereo_smiles(self):
"""
Test stereochemistry removal when writing to SMILES.
"""
_, filename = tempfile.mkstemp(suffix='.smi', dir=self.temp_dir)
writer = serial.MolWriter(stereo=False)
writer.open(filename)
writer.write([self.levalbuterol])
writer.close()
self.reader.open(filename)
mols = self.reader.get_mols()
mol = mols.next()
# make sure the written molecule differs from the reference
assert mol.ToBinary() != self.levalbuterol.ToBinary()
# check again after removing stereochemistry
AllChem.RemoveStereochemistry(self.levalbuterol)
# FIXME get ToBinary test to work
# assert mol.ToBinary() == self.levalbuterol.ToBinary()
assert Chem.MolToSmiles(mol, isomericSmiles=True) == Chem.MolToSmiles(
self.levalbuterol, isomericSmiles=True)
def test_context_manager(self):
"""
Test use of 'with' statement to write molecules.
"""
_, filename = tempfile.mkstemp(suffix='.sdf', dir=self.temp_dir)
with self.writer.open(filename) as writer:
writer.write([self.aspirin])
self.reader.open(filename)
mols = self.reader.get_mols()
# compare molecules
assert mols.next().ToBinary() == self.aspirin.ToBinary()
# compare files
with open(filename) as f:
data = f.read()
assert data == self.aspirin_sdf + '$$$$\n'
|
rbharath/vs-utils
|
vs_utils/utils/rdkit_utils/tests/test_serial.py
|
Python
|
gpl-3.0
| 25,593
|
class RemoveUnusedFieldsFromDataResponse < ActiveRecord::Migration
def self.up
remove_column :data_responses, :complete
remove_column :data_responses, :submitted
remove_column :data_responses, :submitted_at
remove_column :data_responses, :submitted_for_final_at
remove_column :data_responses, :submitted_for_final
end
def self.down
add_column :data_responses, :complete, :boolean, :default => false
add_column :data_responses, :submitted, :boolean
add_column :data_responses, :submitted_at, :datetime
add_column :data_responses, :submitted_for_final_at, :boolean
add_column :data_responses, :submitted_for_final, :datetime
end
end
|
siyelo/hrtv1
|
db/migrate/20110915070139_remove_unused_fields_from_data_response.rb
|
Ruby
|
gpl-3.0
| 680
|
#region
using System;
using System.Collections.Generic;
using System.Linq;
using LeagueSharp;
using LeagueSharp.Common;
using SharpDX;
#endregion
namespace Syndra
{
public static class OrbManager
{
private static int _wobjectnetworkid = -1;
public static int WObjectNetworkId
{
get
{
if (ObjectManager.Player.Spellbook.GetSpell(SpellSlot.W).ToggleState == 1)
return -1;
return _wobjectnetworkid;
}
set
{
_wobjectnetworkid = value;
}
}
public static int tmpQOrbT;
public static Vector3 tmpQOrbPos = new Vector3();
public static int tmpWOrbT;
public static Vector3 tmpWOrbPos = new Vector3();
public static bool ActiveRecv = false;
public static Byte Activebyte = 0x00;
static OrbManager()
{
Game.OnGameProcessPacket += Game_OnGameProcessPacket;
Obj_AI_Base.OnProcessSpellCast += Obj_AI_Hero_OnProcessSpellCast;
}
private static void Obj_AI_Hero_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
{
if (sender.IsMe && args.SData.Name == "SyndraQ")
{
tmpQOrbT = Environment.TickCount;
tmpQOrbPos = args.End;
}
if (sender.IsMe && WObject(true) != null && (args.SData.Name == "SyndraW" || args.SData.Name == "syndraw2"))
{
tmpWOrbT = Environment.TickCount + 250;
tmpWOrbPos = args.End;
}
}
public static Obj_AI_Minion WObject(bool onlyOrb)
{
if (WObjectNetworkId == -1) return null;
var obj = ObjectManager.GetUnitByNetworkId<Obj_AI_Base>(WObjectNetworkId);
if (obj != null && obj.IsValid<Obj_AI_Minion>() && (obj.Name == "Seed" && onlyOrb || !onlyOrb)) return (Obj_AI_Minion)obj;
return null;
}
private static void Game_OnGameProcessPacket(GamePacketEventArgs args)
{
if (args.PacketData[0] == 0x8E)
{
var packet = new GamePacket(args.PacketData);
packet.Position = 2;
var networkId = packet.ReadInteger();
WObjectNetworkId = networkId;
}
}
public static List<Vector3> GetOrbs(bool toGrab = false)
{
var result = new List<Vector3>();
foreach (
var obj in
ObjectManager.Get<Obj_AI_Minion>()
.Where(obj => obj.IsValid && obj.Team == ObjectManager.Player.Team && obj.Name == "Seed"))
{
var valid = false;
if (obj.NetworkId != WObjectNetworkId)
if (
ObjectManager.Get<GameObject>()
.Any(
b =>
b.IsValid && b.Name.Contains("_Q_") && b.Name.Contains("Syndra_") &&
b.Name.Contains("idle") && obj.Position.Distance(b.Position) < 50))
valid = true;
if (valid && (!toGrab || !obj.IsMoving))
result.Add(obj.ServerPosition);
}
if (Environment.TickCount - tmpQOrbT < 400)
{
result.Add(tmpQOrbPos);
}
if (Environment.TickCount - tmpWOrbT < 400 && Environment.TickCount - tmpWOrbT > 0)
{
result.Add(tmpWOrbPos);
}
return result;
}
public static Vector3 GetOrbToGrab(int range)
{
var list = GetOrbs(true).Where(orb => ObjectManager.Player.Distance(orb) < range).ToList();
return list.Count > 0 ? list[0] : new Vector3();
}
}
}
|
cu0ngnb132/s
|
Syndra/OrbManager.cs
|
C#
|
gpl-3.0
| 3,975
|
package is.idega.block.nationalregister.data;
import java.rmi.RemoteException;
import java.util.Collection;
import javax.ejb.CreateException;
import javax.ejb.FinderException;
import com.idega.data.IDOFactory;
public class NationalRegisterDeceasedHomeImpl extends IDOFactory implements NationalRegisterDeceasedHome {
public Class getEntityInterfaceClass() {
return NationalRegisterDeceased.class;
}
public NationalRegisterDeceased create() throws CreateException {
return (NationalRegisterDeceased) super.createIDO();
}
public NationalRegisterDeceased findByPrimaryKey(Object pk) throws FinderException {
return (NationalRegisterDeceased) super.findByPrimaryKeyIDO(pk);
}
public Collection findAll() throws FinderException, RemoteException {
com.idega.data.IDOEntity entity = this.idoCheckOutPooledEntity();
java.util.Collection ids = ((NationalRegisterDeceasedBMPBean) entity).ejbFindAll();
this.idoCheckInPooledEntity(entity);
return this.getEntityCollectionForPrimaryKeys(ids);
}
public Collection findAllBySSN(String ssn) throws FinderException, RemoteException {
com.idega.data.IDOEntity entity = this.idoCheckOutPooledEntity();
java.util.Collection ids = ((NationalRegisterDeceasedBMPBean) entity).ejbFindAllBySSN(ssn);
this.idoCheckInPooledEntity(entity);
return this.getEntityCollectionForPrimaryKeys(ids);
}
}
|
idega/is.idega.block.nationalregister
|
src/java/is/idega/block/nationalregister/data/NationalRegisterDeceasedHomeImpl.java
|
Java
|
gpl-3.0
| 1,358
|
/*
* Copyright (C) 2013-2014, The Max Planck Institute for
* Psycholinguistics.
*
* 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, version 3 of the License.
*
* 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.
*
* A copy of the GNU General Public License is included in the file
* LICENSE. If that file is missing, see
* <http://www.gnu.org/licenses/>.
*/
package nl.mpi.mdmapper;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import nl.mpi.mdmapper.output.FacetList;
import org.apache.log4j.Logger;
import org.w3c.dom.Document;
/**
* A mapping rule for an individual field (facet) that always returns
* a string, irrespective of the content of the source. Variables can be
* embedded in the string, with syntax "${variable}", in which case they
* will be expanded (at the time the mapping is applied).
*
* @author Lari Lampen (MPI-PL)
*/
public class StringMapping extends Mapping {
private static final Logger logger = Logger.getLogger(StringMapping.class);
private final String string;
/**
* Parameters set in this configuration will be used for variable expansion.
*/
private Configuration vars;
/**
* Create a new string mapping with the given literal string.
*/
public StringMapping(String string) {
this.string = string;
this.vars = null;
}
/**
* Create a new string mapping with the specified string, with variable
* expansion performed from the given set of variable definitions. Note
* that expansion occurs at the time of call (not time of creating the
* StringMapping object) and reflects the values of the variables at that
* time.
*
* @param string the base string, possibly containing ${var} references
* @param variables configuration that defines values of variables
*/
public StringMapping(String string, Configuration variables) {
this.string = string;
this.vars = variables;
}
@Override
public boolean mapAndAdd(Document doc, String facetName, FacetList fl)
throws MappingException {
String s = apply(doc, fl);
if (!s.isEmpty()) {
fl.add(facetName, s);
return true;
}
return false;
}
@Override
public String apply(Document doc) throws MappingException {
return apply(doc, null);
}
/**
* Apply this mapping to the specified document tree.
*
* @param doc DOM tree representing a metadata record
* @param fl facet list representing the source context
* @return result of mapping as a string, or the empty string if
* there is no other result.
*/
public String apply(Document doc, FacetList fl) throws MappingException {
numUses++;
return expand(string, vars, fl);
}
/**
* Perform variable expansion on the string (syntax is ${var}). As a
* special case, ${filename} expands into the name, with full path,
* of the input file.
*
* @param str base string
* @param variables map of variable names and values
* @param fl facet list (used to get filename only)
* @return expanded string
*/
public static String expand(String str, Configuration variables,
FacetList fl) {
if (variables == null || str == null)
return str;
String res = str;
Pattern pattern = Pattern.compile("\\$\\{([^\\}]*)\\}");
for (;;) {
Matcher m = pattern.matcher(res);
if (!m.find())
break;
String varName = m.group(1);
String val;
if ("filename".equals(varName) && fl != null) {
val = fl.getSource();
} else {
val = variables.getParam(varName);
}
res = res.replace(m.group(0), (val == null) ? "" : val);
}
return res;
}
@Override
public String toString() {
return "'" + string + "'";
}
}
|
DASISH/md-mapper
|
src/main/java/nl/mpi/mdmapper/StringMapping.java
|
Java
|
gpl-3.0
| 4,080
|
/**
* Copyright (c) 2006-2012 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
**/
#ifndef LOVE_GRAPHICS_DRAWABLE_H
#define LOVE_GRAPHICS_DRAWABLE_H
// LOVE
#include <common/Object.h>
namespace love
{
namespace graphics
{
/**
* A Drawable is anything that can be drawn on screen with a
* position, scale and orientation.
**/
class Drawable : public Object
{
public:
/**
* Destructor.
**/
virtual ~Drawable();
/**
* Draws the object with the specified transformation.
*
* @param x The position of the object along the x-axis.
* @param y The position of the object along the y-axis.
* @param angle The angle of the object (in radians).
* @param sx The scale factor along the x-axis.
* @param sy The scale factor along the y-axis.
* @param ox The origin offset along the x-axis.
* @param oy The origin offset along the y-axis.
* @param kx Shear along the x-axis.
* @param ky Shear along the y-axis.
**/
virtual void draw(float x, float y, float angle, float sx, float sy, float ox, float oy, float kx, float ky) const = 0;
};
} // graphics
} // love
#endif // LOVE_GRAPHICS_DRAWABLE_H
|
binji/love-nacl
|
src/modules/graphics/Drawable.h
|
C
|
gpl-3.0
| 1,955
|
package org.sugarj.driver.transformations.extraction;
import org.strategoxt.stratego_lib.*;
import org.strategoxt.lang.*;
import org.spoofax.interpreter.terms.*;
import static org.strategoxt.lang.Term.*;
import org.spoofax.interpreter.library.AbstractPrimitive;
import java.util.ArrayList;
import java.lang.ref.WeakReference;
@SuppressWarnings("all") public class kernel_start_symbols_1_0 extends Strategy
{
public static kernel_start_symbols_1_0 instance = new kernel_start_symbols_1_0();
@Override public IStrategoTerm invoke(Context context, IStrategoTerm term, Strategy c_29)
{
ITermFactory termFactory = context.getFactory();
context.push("kernel_start_symbols_1_0");
Fail262:
{
IStrategoTerm e_147 = null;
IStrategoTerm d_147 = null;
if(term.getTermType() != IStrategoTerm.APPL || ext_out._conskernel_start_symbols_1 != ((IStrategoAppl)term).getConstructor())
break Fail262;
d_147 = term.getSubterm(0);
IStrategoList annos214 = term.getAnnotations();
e_147 = annos214;
term = c_29.invoke(context, d_147);
if(term == null)
break Fail262;
term = termFactory.annotateTerm(termFactory.makeAppl(ext_out._conskernel_start_symbols_1, new IStrategoTerm[]{term}), checkListAnnos(termFactory, e_147));
context.popOnSuccess();
if(true)
return term;
}
context.popOnFailure();
return null;
}
}
|
sugar-lang/compiler
|
src/org/sugarj/driver/transformations/extraction/kernel_start_symbols_1_0.java
|
Java
|
gpl-3.0
| 1,419
|
#!/usr/bin/env python
# -*- coding: UTF8 -*-
#
# Provides access to portaudio.
# Copyright (C) 2010 Josiah Gordon <josiahg@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/>.
""" A portaudio module.
"""
__all__ = ['_portaudio']
|
zepto/musio
|
musio/portaudio/__init__.py
|
Python
|
gpl-3.0
| 830
|
/*
* SaveRenderer.cpp
*
* Created on: Apr 3, 2012
* Author: Simon
*/
#include "SaveRenderer.h"
#include "client/GameSave.h"
#include "graphics/Graphics.h"
#include "Simulation.h"
#include "graphics/Renderer.h"
#include "search/Thumbnail.h"
SaveRenderer::SaveRenderer(){
g = new Graphics();
sim = new Simulation();
ren = new Renderer(g, sim);
ren->decorations_enable = true;
ren->blackDecorations = true;
#if defined(OGLR) || defined(OGLI)
glEnable(GL_TEXTURE_2D);
glGenTextures(1, &fboTex);
glBindTexture(GL_TEXTURE_2D, fboTex);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, XRES, YRES, 0, GL_RGBA, GL_FLOAT, NULL);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
//FBO
glGenFramebuffers(1, &fbo);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo);
glEnable(GL_BLEND);
glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, fboTex, 0);
glBindTexture(GL_TEXTURE_2D, 0);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); // Reset framebuffer binding
glDisable(GL_TEXTURE_2D);
#endif
}
Thumbnail * SaveRenderer::Render(GameSave * save, bool decorations, bool fire)
{
int width, height;
Thumbnail * tempThumb;
width = save->blockWidth;
height = save->blockHeight;
bool doCollapse = save->Collapsed();
g->Acquire();
g->Clear();
sim->clear_sim();
if(!sim->Load(save))
{
ren->decorations_enable = true;
ren->blackDecorations = !decorations;
#if defined(OGLR) || defined(OGLI)
pixel * pData = NULL;
unsigned char * texData = NULL;
glTranslated(0, MENUSIZE, 0);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo);
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
ren->clearScreen(1.0f);
ren->ClearAccumulation();
#ifdef OGLR
ren->RenderBegin();
ren->RenderEnd();
#else
if (fire)
{
int frame = 15;
while(frame)
{
frame--;
ren->render_parts();
ren->render_fire();
ren->clearScreen(1.0f);
}
}
ren->RenderBegin();
ren->RenderEnd();
#endif
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
glTranslated(0, -MENUSIZE, 0);
glEnable( GL_TEXTURE_2D );
glBindTexture(GL_TEXTURE_2D, fboTex);
pData = new pixel[XRES*YRES];
texData = new unsigned char[(XRES*YRES)*PIXELSIZE];
std::fill(texData, texData+(XRES*YRES)*PIXELSIZE, 0xDD);
glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, texData);
glDisable(GL_TEXTURE_2D);
for(int x = 0; x < width*CELL; x++)
{
for(int y = 0; y < height*CELL; y++)
{
unsigned char red = texData[((((YRES-1-y)*XRES)+x)*4)];
unsigned char green = texData[((((YRES-1-y)*XRES)+x)*4)+1];
unsigned char blue = texData[((((YRES-1-y)*XRES)+x)*4)+2];
pData[(y*(width*CELL))+x] = PIXRGBA(red, green, blue, 255);
}
}
tempThumb = new Thumbnail(0, 0, pData, ui::Point(width*CELL, height*CELL));
delete[] pData;
delete[] texData;
pData = NULL;
#else
pixel * pData = NULL;
pixel * dst;
pixel * src = g->vid;
ren->ClearAccumulation();
if (fire)
{
int frame = 15;
while(frame)
{
frame--;
ren->render_parts();
ren->render_fire();
ren->clearScreen(1.0f);
}
}
ren->RenderBegin();
ren->RenderEnd();
pData = (pixel *)malloc(PIXELSIZE * ((width*CELL)*(height*CELL)));
dst = pData;
for(int i = 0; i < height*CELL; i++)
{
memcpy(dst, src, (width*CELL)*PIXELSIZE);
dst+=(width*CELL);///PIXELSIZE;
src+=XRES+BARSIZE;
}
tempThumb = new Thumbnail(0, 0, pData, ui::Point(width*CELL, height*CELL));
if(pData)
free(pData);
#endif
}
if(doCollapse)
save->Collapse();
g->Release();
return tempThumb;
}
Thumbnail * SaveRenderer::Render(unsigned char * saveData, int dataSize, bool decorations, bool fire)
{
GameSave * tempSave;
try {
tempSave = new GameSave((char*)saveData, dataSize);
} catch (std::exception & e) {
//Todo: make this look a little less shit
VideoBuffer buffer(64, 64);
buffer.BlendCharacter(32, 32, 'x', 255, 255, 255, 255);
Thumbnail * thumb = new Thumbnail(0, 0, buffer.Buffer, ui::Point(64, 64));
return thumb;
}
Thumbnail * thumb = Render(tempSave, decorations, fire);
delete tempSave;
return thumb;
}
SaveRenderer::~SaveRenderer() {
// TODO Auto-generated destructor stub
}
|
jacksonmj/Powder-Toy-Mods
|
src/simulation/SaveRenderer.cpp
|
C++
|
gpl-3.0
| 4,290
|
Problem
===
Given a 2D board containing 'X' and 'O', capture all regions surrounded
by 'X'.
A region is captured by flipping all 'O's into 'X's in that surrounded
region .
For example,
X X X X
X O O X
X X O X
X O X X
After running your function, the board should be:
X X X X
X X X X
X X X X
X O X X
Solution
===
BFS from borders of the matrix, kind of a hackish solution
Notice some optimizations about the bfs, the frontier contains more nodes than the rest of it combined!
|
asraf209/leetcode
|
src/surroundedRegions/README.md
|
Markdown
|
gpl-3.0
| 519
|
<?php
/**
* Paging System for Lists.
*
* Copyright (c) 2007-2012 Christian Würker (ceusmedia.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/>.
*
* @category cmClasses
* @package UI.HTML
* @author Christian Würker <christian.wuerker@ceusmedia.de>
* @copyright 2007-2012 Christian Würker
* @license http://www.gnu.org/licenses/gpl-3.0.txt GPL 3
* @link http://code.google.com/p/cmclasses/
* @since 01.12.2005
* @version $Id$
*/
/**
* Paging System for Lists.
* @category cmClasses
* @package UI.HTML
* @extends ADT_OptionObject
* @uses UI_HTML_Elements
* @author Christian Würker <christian.wuerker@ceusmedia.de>
* @copyright 2007-2012 Christian Würker
* @license http://www.gnu.org/licenses/gpl-3.0.txt GPL 3
* @link http://code.google.com/p/cmclasses/
* @since 01.12.2005
* @version $Id$
*/
class UI_HTML_Paging extends ADT_OptionObject
{
/**
* Constructor.
* @access public
* @return void
*/
public function __construct()
{
$this->setOption( 'uri', "./" );
$this->setOption( 'param', array() );
$this->setOption( 'coverage', "2" );
$this->setOption( 'extreme', "1" );
$this->setOption( 'more', "1" );
$this->setOption( 'linebreak', "\n" );
$this->setOption( 'key_request', "?" );
$this->setOption( 'key_param', "&" );
$this->setOption( 'key_assign', "=" );
$this->setOption( 'key_offset', "offset" );
$this->setOption( 'class_span', "pagingSpan" );
$this->setOption( 'class_link', "pagingLink" );
$this->setOption( 'class_text', "pagingText" );
$this->setOption( 'text_first', "<<" );
$this->setOption( 'text_previous', "<" );
$this->setOption( 'text_next', ">" );
$this->setOption( 'text_last', ">>" );
$this->setOption( 'text_more', ".." );
$this->setOption( 'key_first', '' );
$this->setOption( 'key_previous', '' );
$this->setOption( 'key_next', '' );
$this->setOption( 'key_last', '' );
}
/**
* Builds HTML for Paging of Lists.
* @access public
* @param int $amount Total amount of entries
* @param int $limit Maximal amount of displayed entries
* @param int $offset Currently offset entries
* @return string
*/
public function build( $amount, $limit, $offset )
{
$pages = array();
if( $limit && $amount > $limit )
{
$cover = $this->getOption( 'coverage' );
$extreme = $this->getOption( 'extreme' );
$more = $this->getOption( 'more' );
$offset = ( (int)$offset >= 0 ) ? (int)$offset : 0; // reset invalid negative offsets
$offset = ( 0 !== $offset % $limit ) ? ceil( $offset / $limit ) * $limit : $offset; // synchronise invalid offsets
$here = ceil( $offset / $limit ); // current page
$before = (int)$offset / (int)$limit; // pages before
if( $before )
{
// -- FIRST PAGE -- //
if( $extreme && $before > $extreme ) // first page
$pages[] = $this->buildButton( 'text_first', 'class_link', 'class_link', 0 );
// -- PREVIOUS PAGE -- //
$previous = ( $here - 1 ) * $limit;
$pages[] = $this->buildButton( 'text_previous', 'class_link', 'class_link', $previous ); // previous page
// -- MORE PAGES -- //
if( $more && $before > $cover ) // more previous pages
$pages[] = $this->buildButton( 'text_more', 'class_text' );
// -- PREVIOUS PAGES -- //
for( $i=max( 0, $before - $cover ); $i<$here; $i++ ) // previous pages
$pages[] = $this->buildButton( $i + 1, 'class_link', 'class_link', $i * $limit );
/* if( $this->getOption( 'key_previous' ) )
{
$latest = count( $pages ) - 1;
$button = $this->buildButton( $i, 'class_link', 'class_link', ($i-1) * $limit, 'previous' );
$pages[$latest] = $button;
}*/
}
$pages[] = $this->buildButton( $here + 1, 'class_text' ); // page here
$after = ceil( ( ( $amount - $limit ) / $limit ) - $here ); // pages after
if( $after )
{
// -- NEXT PAGES -- //
for( $i=0; $i<min( $cover, $after ); $i++ ) // after pages
{
$offset = ( $here + $i + 1 ) * $limit;
$pages[] = $this->buildButton( $here + $i + 2, 'class_link', 'class_link', $offset );
}
// -- MORE PAGES -- //
if( $more && $after > $cover ) // more after pages
$pages[] = $this->buildButton( 'text_more', 'class_text' );
// -- NEXT PAGE -- //
$offset = ( $here + 1 ) * $limit;
$pages[] = $this->buildButton( 'text_next', 'class_link', 'class_link', $offset ); // next page
// -- LAST PAGE -- //
if( $extreme && $after > $extreme ) // last page
{
$offset = ( $here + $after ) * $limit;
$pages[] = $this->buildButton( 'text_last', 'class_link', 'class_link', $offset );
}
}
}
$pages = implode( $this->getOption( "linebreak" ), $pages );
return $pages;
}
/**
* Builds Paging Button.
* @access protected
* @param string $text Text or HTML of Paging Button Span
* @param string $spanClass Additive Style Class of Paging Button Span
* @param int $offset Currently offset entries
* @param string $linkClass Style Class of Paging Button Link
* @return string
*/
protected function buildButton( $text, $spanClass, $linkClass = NULL, $offset = NULL, $key = NULL )
{
$label = $this->hasOption( $text ) ? $this->getOption( $text ) : $text;
if( empty( $label ) )
throw new InvalidArgumentException( 'Button Label cannot be empty.' );
$spanClass = $this->getOption( $spanClass ) ? $this->getOption( $spanClass ) : "";
if( $offset !== NULL )
{
$linkClass = (string) $this->getOption( $linkClass );
$url = $this->buildLinkUrl( $offset );
$key = $key ? $this->getOption( 'key_'.$key ) : "";
# if( $label == $text )
# $linkClass .= " page";
$label = UI_HTML_Elements::Link( $url, $label, $linkClass, NULL, NULL, NULL, $key );
}
# if( $label == $text )
# $spanClass .= " page";
return $this->buildSpan( $label, $spanClass );
}
/**
* Builds Link URL of Paging Button.
* @access protected
* @param int $offset Currently offset entries
* @return string
*/
protected function buildLinkUrl( $offset )
{
$param = $this->getOption( 'param' );
$param[$this->getOption( 'key_offset' )] = $offset;
$list = array();
foreach( $param as $key => $value )
$list[] = $key.$this->getOption( 'key_assign' ).$value;
$param = implode( $this->getOption( 'key_param' ), $list );
$link = $this->getOption( 'uri' ).$this->getOption( 'key_request' ).$param;
return $link;
}
/**
* Builds Span Link of Paging Button.
* @access protected
* @param string $text Text or HTML of Paging Button Span
* @param string $class Additive Style Class of Paging Button Span
* @return string
*/
protected function buildSpan( $text, $class = NULL )
{
$class = $class ? $this->getOption( 'class_span' )." ".$class : $this->getOption( 'class_span' );
$span = UI_HTML_Tag::create( "span", $text, array( 'class' => $class ) );
return $span;
}
}
?>
|
kriss0r/cmclasses
|
src/UI/HTML/Paging.php
|
PHP
|
gpl-3.0
| 7,933
|
! BROMOC - CG-GCMC-BD
! Electrodiffusion, Gran Canonical Monte Carlo, Brownian,Dynamics
! and Coarse Grain Model DNA Simulation Program.
! Copyright (C) 2014 Pablo M. De Biase (pablodebiase@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/>.
subroutine FIXCOOR(xi,yi,zi)
use grandmod
use constamod
implicit none
real xi,yi,zi
real r,r2,lzrad
! spherical system
if (Qsphere) then
r2 = (xi-cx)**2+(yi-cy)**2+(zi-cz)**2
if (r2.gt.Rsphe2) then
lzrad=2.0*rsphe/sqrt(r2)-1.0
xi = lzrad*(xi-cx)+cx
yi = lzrad*(yi-cy)+cy
zi = lzrad*(zi-cz)+cz
endif
! cyllindrical system
elseif (Qecyl) then
r2=((xi-cx)*iecx)**2+((yi-cy)*iecy)**2
if (r2.gt.1.0) then
r=0.999999999999999/sqrt(r2)
xi = r*(xi-cx)+cx
yi = r*(yi-cy)+cy
endif
if (zi.lt.lz2m) then
zi = lz2m
else if (zi.gt.lz2p) then
zi = lz2p
endif
! rectangular system
else
if (xi.lt.lx2m) then
xi = lx2m
else if (xi.gt.lx2p) then !ge
xi = lx2p
endif
if (yi.lt.ly2m) then
yi = ly2m
else if (yi.gt.ly2p) then !ge
yi = ly2p
endif
if (zi.lt.lz2m) then
zi = lz2m
else if (zi.gt.lz2p) then
zi = lz2p
endif
endif
return
end
|
NoskovLab/BROMOC
|
cg-gcmc-bd/src/fixcoor.f90
|
FORTRAN
|
gpl-3.0
| 1,800
|
TARGET = bsim421
$(TARGET):
include makedefs
HDRS = bsim4def.h bsim4ext.h bsim4itf.h wrapper.h
SPICE_VERSION = SPICE_3f
include ../Make2
|
sksavant/gnucap
|
models-bsim/BSIM421/Makefile
|
Makefile
|
gpl-3.0
| 144
|
package org.esa.s2tbx.dataio.gdal.writer.plugins;
/**
* Writer plugin for products using the GDAL library.
*
* @author Jean Coravu
*/
public class GS7BGDriverProductWriterPlugIn extends AbstractDriverProductWriterPlugIn {
public GS7BGDriverProductWriterPlugIn() {
super(".grd", "GS7BG", "Golden Software 7 Binary Grid", "Byte Int16 UInt16 Float32 Float64");
}
}
|
oscarpicas/s2tbx
|
s2tbx-gdal-reader/src/main/java/org/esa/s2tbx/dataio/gdal/writer/plugins/GS7BGDriverProductWriterPlugIn.java
|
Java
|
gpl-3.0
| 384
|
/*
* Copyright (c) 2011 Google
* Copyright (c) 2015 Advanced Micro Devices, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met: redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer;
* 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;
* neither the name of the copyright holders 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 COPYRIGHT HOLDERS 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 COPYRIGHT
* OWNER 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.
*
* Authors: Gabe Black
*/
#ifndef __ARCH_X86_MEMHELPERS_HH__
#define __ARCH_X86_MEMHELPERS_HH__
#include <array>
#include "base/types.hh"
#include "cpu/exec_context.hh"
#include "sim/byteswap.hh"
#include "sim/insttracer.hh"
namespace X86ISA
{
/// Initiate a read from memory in timing mode.
static Fault
initiateMemRead(ExecContext *xc, Trace::InstRecord *traceData, Addr addr,
unsigned dataSize, Request::Flags flags)
{
return xc->initiateMemRead(addr, dataSize, flags);
}
static void
getMem(PacketPtr pkt, uint64_t &mem, unsigned dataSize,
Trace::InstRecord *traceData)
{
switch (dataSize) {
case 1:
mem = pkt->getLE<uint8_t>();
break;
case 2:
mem = pkt->getLE<uint16_t>();
break;
case 4:
mem = pkt->getLE<uint32_t>();
break;
case 8:
mem = pkt->getLE<uint64_t>();
break;
default:
panic("Unhandled size in getMem.\n");
}
if (traceData)
traceData->setData(mem);
}
template <typename T, size_t N>
static void
getPackedMem(PacketPtr pkt, std::array<uint64_t, N> &mem, unsigned dataSize)
{
std::array<T, N> real_mem = pkt->getLE<std::array<T, N> >();
for (int i = 0; i < N; i++)
mem[i] = real_mem[i];
}
template <size_t N>
static void
getMem(PacketPtr pkt, std::array<uint64_t, N> &mem, unsigned dataSize,
Trace::InstRecord *traceData)
{
switch (dataSize) {
case 4:
getPackedMem<uint32_t, N>(pkt, mem, dataSize);
break;
case 8:
getPackedMem<uint64_t, N>(pkt, mem, dataSize);
break;
default:
panic("Unhandled element size in getMem.\n");
}
if (traceData)
traceData->setData(mem[0]);
}
static Fault
readMemAtomic(ExecContext *xc, Trace::InstRecord *traceData, Addr addr,
uint64_t &mem, unsigned dataSize, Request::Flags flags)
{
memset(&mem, 0, sizeof(mem));
Fault fault = xc->readMem(addr, (uint8_t *)&mem, dataSize, flags);
if (fault == NoFault) {
// If LE to LE, this is a nop, if LE to BE, the actual data ends up
// in the right place because the LSBs where at the low addresses on
// access. This doesn't work for BE guests.
mem = gtoh(mem);
if (traceData)
traceData->setData(mem);
}
return fault;
}
template <typename T, size_t N>
static Fault
readPackedMemAtomic(ExecContext *xc, Addr addr, std::array<uint64_t, N> &mem,
unsigned flags)
{
std::array<T, N> real_mem;
Fault fault = xc->readMem(addr, (uint8_t *)&real_mem,
sizeof(T) * N, flags);
if (fault == NoFault) {
real_mem = gtoh(real_mem);
for (int i = 0; i < N; i++)
mem[i] = real_mem[i];
}
return fault;
}
template <size_t N>
static Fault
readMemAtomic(ExecContext *xc, Trace::InstRecord *traceData, Addr addr,
std::array<uint64_t, N> &mem, unsigned dataSize,
unsigned flags)
{
Fault fault = NoFault;
switch (dataSize) {
case 4:
fault = readPackedMemAtomic<uint32_t, N>(xc, addr, mem, flags);
break;
case 8:
fault = readPackedMemAtomic<uint64_t, N>(xc, addr, mem, flags);
break;
default:
panic("Unhandled element size in readMemAtomic\n");
}
if (fault == NoFault && traceData)
traceData->setData(mem[0]);
return fault;
}
template <typename T, size_t N>
static Fault
writePackedMem(ExecContext *xc, std::array<uint64_t, N> &mem, Addr addr,
unsigned flags, uint64_t *res)
{
std::array<T, N> real_mem;
for (int i = 0; i < N; i++)
real_mem[i] = mem[i];
real_mem = htog(real_mem);
return xc->writeMem((uint8_t *)&real_mem, sizeof(T) * N,
addr, flags, res);
}
static Fault
writeMemTiming(ExecContext *xc, Trace::InstRecord *traceData, uint64_t mem,
unsigned dataSize, Addr addr, Request::Flags flags,
uint64_t *res)
{
if (traceData)
traceData->setData(mem);
mem = TheISA::htog(mem);
return xc->writeMem((uint8_t *)&mem, dataSize, addr, flags, res);
}
template <size_t N>
static Fault
writeMemTiming(ExecContext *xc, Trace::InstRecord *traceData,
std::array<uint64_t, N> &mem, unsigned dataSize,
Addr addr, unsigned flags, uint64_t *res)
{
if (traceData)
traceData->setData(mem[0]);
switch (dataSize) {
case 4:
return writePackedMem<uint32_t, N>(xc, mem, addr, flags, res);
case 8:
return writePackedMem<uint64_t, N>(xc, mem, addr, flags, res);
default:
panic("Unhandled element size in writeMemTiming.\n");
}
}
static Fault
writeMemAtomic(ExecContext *xc, Trace::InstRecord *traceData, uint64_t mem,
unsigned dataSize, Addr addr, Request::Flags flags,
uint64_t *res)
{
if (traceData)
traceData->setData(mem);
uint64_t host_mem = TheISA::htog(mem);
Fault fault =
xc->writeMem((uint8_t *)&host_mem, dataSize, addr, flags, res);
if (fault == NoFault && res)
*res = gtoh(*res);
return fault;
}
template <size_t N>
static Fault
writeMemAtomic(ExecContext *xc, Trace::InstRecord *traceData,
std::array<uint64_t, N> &mem, unsigned dataSize,
Addr addr, unsigned flags, uint64_t *res)
{
if (traceData)
traceData->setData(mem[0]);
Fault fault;
switch (dataSize) {
case 4:
fault = writePackedMem<uint32_t, N>(xc, mem, addr, flags, res);
break;
case 8:
fault = writePackedMem<uint64_t, N>(xc, mem, addr, flags, res);
break;
default:
panic("Unhandled element size in writeMemAtomic.\n");
}
if (fault == NoFault && res)
*res = gtoh(*res);
return fault;
}
}
#endif
|
vineodd/PIMSim
|
GEM5Simulation/gem5/src/arch/x86/memhelpers.hh
|
C++
|
gpl-3.0
| 7,480
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.