answer
stringlengths
15
1.25M
package github import ( "context" "fmt" "net/url" "strings" "time" "github.com/hashicorp/errwrap" "github.com/hashicorp/vault/sdk/framework" "github.com/hashicorp/vault/sdk/helper/tokenutil" "github.com/hashicorp/vault/sdk/logical" ) func pathConfig(b *backend) *framework.Path { p := &framework.Path{ Pattern: "config", Fields: map[string]*framework.FieldSchema{ "organization": &framework.FieldSchema{ Type: framework.TypeString, Description: "The organization users must be part of", }, "base_url": &framework.FieldSchema{ Type: framework.TypeString, Description: `The API endpoint to use. Useful if you are running GitHub Enterprise or an API-compatible authentication server.`, DisplayAttrs: &framework.DisplayAttributes{ Name: "Base URL", Group: "GitHub Options", }, }, "ttl": &framework.FieldSchema{ Type: framework.TypeDurationSecond, Description: tokenutil.DeprecationText("token_ttl"), Deprecated: true, }, "max_ttl": &framework.FieldSchema{ Type: framework.TypeDurationSecond, Description: tokenutil.DeprecationText("token_max_ttl"), Deprecated: true, }, }, Callbacks: map[logical.Operation]framework.OperationFunc{ logical.UpdateOperation: b.pathConfigWrite, logical.ReadOperation: b.pathConfigRead, }, } tokenutil.AddTokenFields(p.Fields) p.Fields["token_policies"].Description += ". This will apply to all tokens generated by this auth method, in addition to any policies configured for specific users/groups." return p } func (b *backend) pathConfigWrite(ctx context.Context, req *logical.Request, data *framework.FieldData) (*logical.Response, error) { c, err := b.Config(ctx, req.Storage) if err != nil { return nil, err } if c == nil { c = &config{} } if organizationRaw, ok := data.GetOk("organization"); ok { c.Organization = organizationRaw.(string) } if baseURLRaw, ok := data.GetOk("base_url"); ok { baseURL := baseURLRaw.(string) _, err := url.Parse(baseURL) if err != nil { return logical.ErrorResponse(fmt.Sprintf("Error parsing given base_url: %s", err)), nil } if !strings.HasSuffix(baseURL, "/") { baseURL += "/" } c.BaseURL = baseURL } if err := c.ParseTokenFields(req, data); err != nil { return logical.ErrorResponse(err.Error()), logical.ErrInvalidRequest } // Handle upgrade cases { if err := tokenutil.UpgradeValue(data, "ttl", "token_ttl", &c.TTL, &c.TokenTTL); err != nil { return logical.ErrorResponse(err.Error()), nil } if err := tokenutil.UpgradeValue(data, "max_ttl", "token_max_ttl", &c.MaxTTL, &c.TokenMaxTTL); err != nil { return logical.ErrorResponse(err.Error()), nil } } entry, err := logical.StorageEntryJSON("config", c) if err != nil { return nil, err } if err := req.Storage.Put(ctx, entry); err != nil { return nil, err } return nil, nil } func (b *backend) pathConfigRead(ctx context.Context, req *logical.Request, data *framework.FieldData) (*logical.Response, error) { config, err := b.Config(ctx, req.Storage) if err != nil { return nil, err } if config == nil { return nil, nil } d := map[string]interface{}{ "organization": config.Organization, "base_url": config.BaseURL, } config.PopulateTokenData(d) if config.TTL > 0 { d["ttl"] = int64(config.TTL.Seconds()) } if config.MaxTTL > 0 { d["max_ttl"] = int64(config.MaxTTL.Seconds()) } return &logical.Response{ Data: d, }, nil } // Config returns the configuration for this backend. func (b *backend) Config(ctx context.Context, s logical.Storage) (*config, error) { entry, err := s.Get(ctx, "config") if err != nil { return nil, err } if entry == nil { return nil, nil } var result config if entry != nil { if err := entry.DecodeJSON(&result); err != nil { return nil, errwrap.Wrapf("error reading configuration: {{err}}", err) } } if result.TokenTTL == 0 && result.TTL > 0 { result.TokenTTL = result.TTL } if result.TokenMaxTTL == 0 && result.MaxTTL > 0 { result.TokenMaxTTL = result.MaxTTL } return &result, nil } type config struct { tokenutil.TokenParams Organization string `json:"organization" structs:"organization" mapstructure:"organization"` BaseURL string `json:"base_url" structs:"base_url" mapstructure:"base_url"` TTL time.Duration `json:"ttl" structs:"ttl" mapstructure:"ttl"` MaxTTL time.Duration `json:"max_ttl" structs:"max_ttl" mapstructure:"max_ttl"` }
package org.opennms.features.topology.plugins.browsers; import java.util.Collections; import java.util.HashSet; import java.util.Iterator; import java.util.Set; import java.util.TreeSet; import org.opennms.web.api.Authentication; import org.springframework.security.core.context.<API key>; import com.vaadin.data.Property; import com.vaadin.data.Container.ItemSetChangeEvent; import com.vaadin.data.Container.<API key>; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.ui.CheckBox; import com.vaadin.ui.Table; import com.vaadin.ui.Table.ColumnGenerator; public class CheckboxGenerator implements ColumnGenerator, <API key> { private static final long serialVersionUID = 2L; private final String m_valueProperty; protected final Set<CheckBox> m_checkboxes = new HashSet<CheckBox>(); protected Set<Integer> <API key> = new TreeSet<Integer>(); protected Set<Integer> <API key> = new TreeSet<Integer>(); //Explizit not set private boolean m_selectAll = false; public CheckboxGenerator(String valueProperty) { m_valueProperty = valueProperty; } @Override public Object generateCell(Table source, Object itemId, Object columnId) { final Property<Integer> property = source.<API key>(itemId, m_valueProperty); if (property.getValue() == null) { return null; } else { if (<API key>.getContext().toString().contains(Authentication.ROLE_READONLY)) { // Do not render the checkboxes for read-only users return null; } else { final CheckBox button = new CheckBox(); button.setData(property.getValue()); button.setValue(isSelected((Integer) property.getValue())); button.<API key>(new ValueChangeListener() { private static final long serialVersionUID = <API key>; @Override public void valueChange(ValueChangeEvent event) { if (Boolean.TRUE.equals(event.getProperty().getValue())) { <API key>.add(property.getValue()); <API key>.remove(property.getValue()); } else { <API key>.remove(property.getValue()); <API key>.add(property.getValue()); } } }); m_checkboxes.add(button); return button; } } } private boolean isSelected(Integer id) { return (m_selectAll || <API key>.contains(id)) && !<API key>.contains(id); } public Set<Integer> getSelectedIds(Table source) { if (m_selectAll) { Set<Integer> selected = new TreeSet<Integer>(); for (Object eachItemId : source.getItemIds()) { Property<Integer> property = source.<API key>(eachItemId, m_valueProperty); if (property == null) continue; selected.add(property.getValue()); } //remove unselected selected.removeAll(<API key>); return selected; } return Collections.unmodifiableSet(<API key>); } public void clearSelectedIds(Table source) { m_selectAll = false; // Uncheck all of the checkboxes for (CheckBox button : m_checkboxes) { button.setValue(false); } <API key>.clear(); <API key>.clear(); } public void selectAll(Table source) { m_selectAll = true; <API key>.clear(); <API key>.clear(); // Check all of the checkboxes for (CheckBox button : m_checkboxes) { button.setValue(true); <API key>.add((Integer)button.getData()); } } @Override public void <API key>(ItemSetChangeEvent event) { // Delete all of the checkboxes, they will be regenerated during Table.<API key>() m_checkboxes.clear(); // Remove any selected item IDs that are no longer present in the container Iterator<Integer> itr = <API key>.iterator(); while(itr.hasNext()) { if (!event.getContainer().getItemIds().contains(itr.next())) { itr.remove(); } } // Remove any not selected item IDs that are no longer present in the container itr = <API key>.iterator(); while(itr.hasNext()) { if (!event.getContainer().getItemIds().contains(itr.next())) { itr.remove(); } } } }
class <API key> < ActiveRecord::Migration def up change_column :proposals, :district, 'integer USING CAST(district AS integer)' end def down change_column :proposals, :district, :string end end
<?php $mess=array( "Skeleton Plugin" => "Leere Erweiterung", "This is an empty container to demonstrate the basics of plugins coding." => "Dies ist ein leerer Container um die Grundlagen der <API key> zu demonstrieren.", "Custom Footer" => "Angepasste Fusszeile", "Show a custom footer div" => "Eine angepasste Fusszeile anzeigen", "Footer Content" => "Fusszeile Inhalt", "Display this content in the footer" => "Zeigt diesen Inhalt in der Fusszeile an", "Button Target Url" => "Button Ziel-URL", "The target URL of the button that will be added to the application" => "Die Ziel-URL des Button der der Anwendung hinzugefügt wird.", );
<!DOCTYPE html PUBLIC "- <html xmlns="http: <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <title>Rgaa30 Test.4-1-2 Passed 01</title> </head> <body> <div> <h1>Rgaa30 Test.4-1-2 Passed 01</h1> <div class="test-detail" lang="fr"> Chaque <a href="http://references.modernisation.gouv.fr/<API key> <a href="http://references.modernisation.gouv.fr/<API key> <ul class="ssTests"> <li> Il existe une <a href="http://references.modernisation.gouv.fr/<API key> <li> Il existe une <a href="http://references.modernisation.gouv.fr/<API key>#mTranscriptTextuel">transcription textuelle</a> adjacente clairement identifiable</li> <li> Il existe une <a href="http://references.modernisation.gouv.fr/<API key> <li> Il existe une version alternative avec une <a href="http://references.modernisation.gouv.fr/<API key> </ul> </div> <div class="testcase"> </div> <div class="test-explanation"> Passed. </div> </div> </body> </html>
# -*- coding: utf-8 -*- from github_login import login ALL = ['OCA_PROJECTS', '<API key>', 'url'] OCA_PROJECTS = { 'accounting': ['account-analytic', 'account-budgeting', 'account-closing', '<API key>', '<API key>', '<API key>', '<API key>', 'account-invoicing', 'account-fiscal-rule', ], # 'backport': ['OCB', 'banking': ['banking', '<API key>', 'account-payment', ], 'community': ['maintainers-tools', '<API key>', 'runbot-addons', ], 'connector': ['connector', 'connector-ecommerce', ], 'account edge connector': ['<API key>'], 'connector LIMS': ['connector-lims'], 'connector CMIS': ['connector-cmis'], 'connector magento': ['connector-magento'], 'connector prestashop': ['<API key>'], 'connector sage': ['connector-sage-50'], 'crm sales marketing': ['sale-workflow', 'crm', 'partner-contact', 'sale-financial', 'sale-reporting', 'commission', 'event', 'survey', ], 'document': ['knowledge'], 'ecommerce': ['e-commerce'], 'financial control': ['margin-analysis'], 'geospatial': ['geospatial'], 'hr': ['hr-timesheet', 'hr', 'department', ], 'intercompany': ['multi-company'], 'l10n-argentina': ['l10n-argentina'], 'l10n-belgium': ['l10n-belgium'], 'l10n-brazil': ['l10n-brazil'], 'l10n-canada': ['l10n-canada'], 'l10n-china': ['l10n-china'], 'l10n-colombia': ['l10n-colombia'], 'l10n-costa-rica': ['l10n-costa-rica'], 'l10n-finland': ['l10n-finland'], 'l10n-france': ['l10n-france'], 'l10n-germany': ['l10n-germany'], 'l10n-india': ['l10n-india'], 'l10n-iran': ['l10n-iran'], 'l10n-ireland': ['l10n-ireland'], 'l10n-italy': ['l10n-italy'], 'l10n-luxemburg': ['l10n-luxemburg'], 'l10n-mexico': ['l10n-mexico'], 'l10n-netherlands': ['l10n-netherlands'], 'l10n-norway': ['l10n-norway'], 'l10n-portugal': ['l10n-portugal'], 'l10n-romania': ['l10n-romania'], 'l10n-spain': ['l10n-spain'], 'l10n-switzerland': ['l10n-switzerland'], 'l10n-taiwan': ['l10n-taiwan'], 'l10n-usa': ['l10n-usa'], 'l10n-venezuela': ['l10n-venezuela'], 'logistics': ['carrier-delivery', '<API key>', '<API key>', '<API key>', '<API key>', '<API key>', 'rma', ], 'manufacturing': ['manufacture', '<API key>', ], 'management system': ['management-system'], 'purchase': ['purchase-workflow', 'purchase-reporting', ], 'product': ['product-attribute', 'product-kitting', 'product-variant', ], 'project / services': ['project-reporting', 'project-service', 'contract', 'program', ], 'tools': ['reporting-engine', 'report-print-send', 'webkit-tools', 'server-tools', '<API key>', ], 'vertical hotel': ['vertical-hotel'], 'vertical ISP': ['vertical-isp'], 'vertical editing': ['vertical-editing'], 'vertical medical': ['vertical-medical'], 'vertical NGO': ['vertical-ngo', # XXX ], 'vertical construction': ['<API key>'], 'vertical travel': ['vertical-travel'], 'web': ['web'], } def get_repositories(): ignored = set([ 'odoo-community.org', '<API key>', '<API key>', 'website', ]) gh = login() all_repos = [repo.name for repo in gh.iter_user_repos('OCA') if repo not in ignored] return all_repos try: <API key> = get_repositories() except Exception as exc: print exc <API key> = [] for repos in OCA_PROJECTS.itervalues(): <API key> += repos <API key>.sort() <API key> = set(<API key>) _URL_MAPPINGS = {'git': 'git@github.com:%s/%s.git', 'https': 'https://github.com/%s/%s.git', } def url(project_name, protocol='git', org_name='OCA'): """get the URL for an OCA project repository""" if project_name not in <API key>: raise ValueError('Unknown project', project_name) return _URL_MAPPINGS[protocol] % (org_name, project_name)
package org.geomajas.plugin.printing.parser; import java.util.StringTokenizer; import com.lowagie.text.Rectangle; import com.thoughtworks.xstream.converters.basic.<API key>; /** * Adapter for converting an iText Rectangle to XML and back. * * @author Jan De Moerloose */ public class RectangleConverter extends <API key> { @Override public boolean canConvert(Class type) { return type.equals(Rectangle.class); } @Override public Object fromString(String str) { StringTokenizer st = new StringTokenizer(str, ","); if (st.countTokens() < 4) { throw new <API key>("Not enough tokens (<4) in rectangle " + str); } float left = Float.parseFloat(st.nextToken()); float bottom = Float.parseFloat(st.nextToken()); float right = Float.parseFloat(st.nextToken()); float top = Float.parseFloat(st.nextToken()); return new Rectangle(left, bottom, right, top); } @Override public String toString(Object obj) { Rectangle rectangle = (Rectangle) obj; if (obj == null) { return null; } return rectangle.getLeft() + "," + rectangle.getBottom() + "," + rectangle.getRight() + "," + rectangle.getTop(); } }
module Api module V1 require File.expand_path(File.dirname(__FILE__) + '../../../../lib/api/v1/course_json') describe Api::V1::CourseJson do let(:includes) { [] } let(:course) { stub(:course) } let(:user) { stub(:user) } let(:course_json) { CourseJson.new( course, nil, includes, [] ) } describe '#include_description' do let(:predicate){ course_json.include_description } it 'affirms when the public_description key is in the includes array' do includes << 'public_description' predicate.should be_true end it 'affirms when the public_description key is a symbol' do includes << :public_description predicate.should be_true end it 'negates when the public_description key is missing' do predicate.should be_false end end describe '#<API key>' do let(:predicate) { course_json.<API key> } let(:course_settings) { Hash.new } let(:course) { stub( course_settings ) } describe 'when total scores key is set' do before { includes << :total_scores } it 'is false if the final grade is hidden' do course_settings[:hide_final_grades?] = true predicate.should be_false end it 'is true if the course allows the grade to be seen' do course_settings[:hide_final_grades?] = false predicate.should be_true end end describe 'when total scores key is not set' do before { includes.clear } it 'is false if the final grade is hidden' do course_settings[:hide_final_grades?] = true predicate.should be_false end it 'is false even even if the final grade is NOT hidden' do course_settings[:hide_final_grades?] = false predicate.should be_false end end end describe '#allowed_attributes' do it 'just returns the base attributes when there are no includes' do includes.clear course_json.allowed_attributes.should == CourseJson::BASE_ATTRIBUTES end it 'tacks on any includes' do includes << :some << :other << :keys course_json.allowed_attributes.should == ( CourseJson::BASE_ATTRIBUTES + [:some, :other, :keys] ) end end describe '#methods_to_send' do it 'includes the end_at field' do course_json.methods_to_send.should include('end_at') end it 'includes the public_syllabus field' do course_json.methods_to_send.should include('public_syllabus') end it 'includes the hide_final_grades method if its in the includes array' do includes << :hide_final_grades course_json.methods_to_send.should include('hide_final_grades') end end describe '#<API key>' do let(:hash){ Hash.new } describe 'with an optional field' do before { hash['enrollments'] = [] } it 'kicks the key-value pair out if the value is nil' do hash['enrollments'] = nil course_json.<API key>(hash).should == { } end it 'keeps the key-value pair if the value is not nil' do course_json.<API key>(hash).should == {'enrollments' => [] } end end describe 'with any other field' do before { hash['some_other_key'] = 'some_value' } it 'keeps the key-value pair even if the value is nil' do hash['some_other_key'] = nil course_json.<API key>(hash).should == { 'some_other_key' => nil } end it 'keeps the key-value pair if the value is not nil' do course_json.<API key>(hash).should == {'some_other_key' => 'some_value' } end end end describe '#description' do let(:course) { stub(:public_description => 'an eloquent anecdote' ) } it 'returns the description when its configured for inclusion' do includes << :public_description course_json.include_description.should be_true course_json.description(course).should == 'an eloquent anecdote' end it 'is nil when configured not to be included' do includes.clear course_json.description(course).should be_nil end end describe '#initialization' do let(:enrollments) { stub(:enrollments) } let(:hash) { {:a => '1', :b => '2'} } let(:includes) { ['these', 'three', 'keys' ] } before(:each) do @json = CourseJson.new(course, user, includes, enrollments){ hash } end subject{ @json } its(:course) { should == course } its(:user) { should == user } its(:includes) { should == [:these, :three, :keys] } its(:enrollments) { should == enrollments } its(:hash) { should == hash } end describe '#set_sis_course_id' do let(:rights) { {} } let(:sis_course) { stub(:root_account => stub( :grants_rights? => rights ), :sis_source_id => @sis_id ) } let(:hash) { Hash.new } before { @sis_id = 1357 } describe 'when appropriate rights are granted' do before { rights[:read_sis] = :read_sis } it 'adds sis the key-value pair to the hash' do course_json.set_sis_course_id( hash, sis_course, user ) hash['sis_course_id'].should == 1357 end describe 'with a nil sis_id' do before do @sis_id = nil course_json.set_sis_course_id( hash, sis_course, user ) end it 'allows the nil value to go into the has' do hash['sis_course_id'].should == nil end it 'does not get cleared out before translation to json' do course_json.<API key>( hash ).should == { 'sis_course_id' => nil } end end end it 'doesnt add the sis_course_id key at all if the rights are NOT present' do course_json.set_sis_course_id( hash, sis_course, user) hash.should == {} end end end end end
<!DOCTYPE html PUBLIC "- <html xmlns="http: <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <title>AW22 Test.6.3.2 NMI 03</title> </head> <body> <div> <p class="test-detail"> <span lang="fr">Chaque intitulé de lien image (contenu de l'attribut alt ou contenu entre &lt;object&gt;&lt;/object&gt;) est-il explicite hors contexte (hors cas particulier) ? </span> </p> <h1> <a href="my-link.html" title=" <img src="image.jpg" alt="unpredictable content pertinence"/> </a> </h1> <p class="test-explanation">NMI : The text link pertinence is unpredictable (whatever the context)</p> </div> </body> </html>
# <API key>: true require "spec_helper" module Decidim describe "Conference Participatory Space" do let(:command) { Decidim::DestroyAccount.new(user, form) } let(:user) { create(:user, :confirmed) } let(:valid) { true } let(:data) do { delete_reason: "I want to delete my account" } end let(:form) do form = double( delete_reason: data[:delete_reason], valid?: valid ) form end context "when an account is removed" do it "deletes conference user role" do create(:<API key>, user: user) expect do command.call end.to change(ConferenceUserRole, :count).by(-1) end it "deletes conference speaker" do create(:conference_speaker, user: user) expect do command.call end.to change(ConferenceSpeaker, :count).by(-1) end end end end
package Kernel::System::Console::Command::Dev::Package::Build; use strict; use warnings; use parent qw(Kernel::System::Console::BaseCommand); our @ObjectDependencies = ( 'Kernel::System::Main', 'Kernel::System::Package', ); sub Configure { my ( $Self, %Param ) = @_; $Self->Description('Create an OTRS package (opm) file from an OTRS package source (sopm) file.'); $Self->AddOption( Name => 'version', Description => "Specify the version to be used (overrides version from sopm file).", Required => 0, HasValue => 1, ValueRegex => qr/^\d{1,4}[.]\d{1,4}[.]\d{1,4}$/smx, ); $Self->AddOption( Name => 'module-directory', Description => "Specify the directory containing the module sources (otherwise the OTRS home directory will be used).", Required => 0, HasValue => 1, ValueRegex => qr/.*/smx, ); $Self->AddArgument( Name => 'source-path', Description => "Specify the path to an OTRS package source (sopm) file that should be built.", Required => 1, ValueRegex => qr/.*/smx, ); $Self->AddArgument( Name => 'target-directory', Description => "Specify the directory where the generated package should be placed.", Required => 1, ValueRegex => qr/.*/smx, ); return; } sub PreRun { my ( $Self, %Param ) = @_; my $SourcePath = $Self->GetArgument('source-path'); if ( !-r $SourcePath ) { die "File $SourcePath does not exist / cannot be read.\n"; } my $TargetDirectory = $Self->GetArgument('target-directory'); if ( !-d $TargetDirectory ) { die "Directory $TargetDirectory does not exist.\n"; } my $ModuleDirectory = $Self->GetOption('module-directory'); if ( $ModuleDirectory && !-d $ModuleDirectory ) { die "Directory $ModuleDirectory does not exist.\n"; } return; } sub Run { my ( $Self, %Param ) = @_; $Self->Print("<yellow>Building package...</yellow>\n"); my $FileString; my $SourcePath = $Self->GetArgument('source-path'); my $ContentRef = $Kernel::OM->Get('Kernel::System::Main')->FileRead( Location => $SourcePath, Mode => 'utf8', # optional - binmode|utf8 Result => 'SCALAR', # optional - SCALAR|ARRAY ); if ( !$ContentRef || ref $ContentRef ne 'SCALAR' ) { $Self->PrintError("File $SourcePath is empty / could not be read."); return $Self->ExitCodeError(); } $FileString = ${$ContentRef}; my %Structure = $Kernel::OM->Get('Kernel::System::Package')->PackageParse( String => $FileString, ); # just build it if <API key> flag is enable if ( defined $Structure{<API key>} && !$Structure{<API key>}->{Content} ) { $Self->PrintError("Package cannot be built.\n"); return $Self->ExitCodeError(); } if ( $Self->GetOption('version') ) { $Structure{Version}->{Content} = $Self->GetOption('version'); } # build from given package directory, if any (otherwise default to OTRS home) if ( $Self->GetOption('module-directory') ) { $Structure{Home} = $Self->GetOption('module-directory'); } my $Filename = $Structure{Name}->{Content} . '-' . $Structure{Version}->{Content} . '.opm'; my $Content = $Kernel::OM->Get('Kernel::System::Package')->PackageBuild(%Structure); if ( !$Content ) { $Self->PrintError("Package build failed.\n"); return $Self->ExitCodeError(); } my $File = $Kernel::OM->Get('Kernel::System::Main')->FileWrite( Location => $Self->GetArgument('target-directory') . '/' . $Filename, Content => \$Content, Mode => 'utf8', # binmode|utf8 Type => 'Local', # optional - Local|Attachment|MD5 Permission => '644', ); if ( !$File ) { $Self->PrintError("File $File could not be written.\n"); return $Self->ExitCodeError(); } $Self->Print("<green>Done.</green>\n"); return $Self->ExitCodeOk(); } # sub PostRun { # my ( $Self, %Param ) = @_; # # This will be called after Run() (even in case of exceptions). Perform any cleanups here. # return; 1;
<?php // See the LICENCE file in the repository root for full licence text. namespace App\Mail; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; class ForumNewReply extends Mailable implements ShouldQueue { use Queueable, SerializesModels; public $topic; public $user; /** * Create a new message instance. * * @return void */ public function __construct($attributes) { $this->topic = $attributes['topic']; $this->user = $attributes['user']; } /** * Build the message. * * @return $this */ public function build() { return $this ->text('emails.forum.new_reply') ->subject(osu_trans('mail.forum_new_reply.subject', [ 'title' => $this->topic->topic_title, ])); } }
cur_frm.cscript.tname = "Multiple Qty Item"; cur_frm.cscript.fname = "multiple_qty_item"; cur_frm.cscript.other_fname = "other_charges"; cur_frm.cscript.sales_team_fname = "sales_team"; {% include 'selling/sales_common.js' %} {% include 'accounts/doctype/<API key>/<API key>.js' %} {% include 'utilities/doctype/sms_control/sms_control.js' %} {% include 'accounts/doctype/sales_invoice/pos.js' %} cur_frm.add_fetch('item_code', 'part_number', 'part_number'); erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({ onload: function(doc, dt, dn) { var me = this; this._super(doc, dt, dn); if(doc.__islocal){ get_server_fields('set_label','','',doc,dt,dn,1,function(r){refresh_field('multiple_qty_item'); refresh_field(['quantity_lable','qty_label','q1','q2','q3','q4','q5']) me.change_grid_labels() }) } }, refresh: function(doc, dt, dn) { this._super(doc, dt, dn); if(doc.docstatus == 1 && doc.status!=='Lost') { cur_frm.add_custom_button(__('Make Sales Order'), cur_frm.cscript['Make Sales Order']); if(doc.status!=="Ordered") { cur_frm.add_custom_button(__('Set as Lost'), cur_frm.cscript['Declare Order Lost'], "icon-exclamation"); } cur_frm.appframe.add_button(__('Send SMS'), cur_frm.cscript.send_sms, "icon-mobile-phone"); } if (!doc.__islocal) { cur_frm.communication_view = new frappe.views.CommunicationList({ list: frappe.get_list("Communication", {"parent": doc.name, "parenttype": "Quotation"}), parent: cur_frm.fields_dict.communication_html.wrapper, doc: doc, recipients: doc.contact_email }); } this.<API key>(); if (!doc.__islocal && doc.docstatus!=1) { cur_frm.add_custom_button(__('Create RFQ for Material'), cur_frm.cscript.rfq_material, "icon-mobile-phone"); cur_frm.add_custom_button(__('Create RFQ for PP'), cur_frm.cscript.rfq_pp, "icon-mobile-phone"); cur_frm.add_custom_button(__('Create RFQ for SP'), cur_frm.cscript.rfq_sp, "icon-mobile-phone"); cur_frm.add_custom_button(__('Create RFQ for SM'), cur_frm.cscript.rfq_sm, "icon-mobile-phone"); } }, quotation_to: function() { var me = this; if (this.frm.doc.quotation_to == "Lead") { this.frm.set_value("customer", null); this.frm.set_value("contact_person", null); } else if (this.frm.doc.quotation_to == "Customer") { this.frm.set_value("lead", null); } this.<API key>(); }, <API key>: function() { var me = this; this.frm.toggle_reqd("lead", this.frm.doc.quotation_to == "Lead"); this.frm.toggle_reqd("customer", this.frm.doc.quotation_to == "Customer"); // to overwrite the customer_filter trigger from queries.js $.each(["customer_address", "<API key>"], function(i, opts) { me.frm.set_query(opts, me.frm.doc.quotation_to==="Lead" ? erpnext.queries["lead_filter"] : erpnext.queries["customer_filter"]); } ); }, tc_name: function() { this.get_terms(); }, <API key>: function(party_field) { return this._super(party_field); }, lead: function() { var me = this; frappe.call({ method: "erpnext.selling.doctype.lead.lead.get_lead_details", args: { "lead": this.frm.doc.lead }, callback: function(r) { if(r.message) { me.frm.<API key> = true; me.frm.set_value(r.message); me.frm.refresh(); me.frm.<API key> = false; } } }) }, customer: function() { var me = this; frappe.call({ method: "erpnext.selling.doctype.quotation.quotation.get_customer_refno", args: { "customer": this.frm.doc.customer }, callback: function(r) { if(r.message) { me.frm.set_value("customer_ref_no", r.message[0][0]) refresh_field('customer_ref_no'); } } }) }, item_code:function(doc,cdt,cdn){ var row = frappe.get_doc(cdt, cdn); get_server_fields('get_item_details',row.item_code,'',doc,cdt,cdn,1,function(r){ refresh_field('multiple_qty_item') }) }, change_grid_labels:function(doc,cdt,cdn){ var me = this; var field_label_map = {}; label_fields_c=me.frm.doc.quantity_lable label_fields_t=me.frm.doc.qty_label label_fields_t1=me.frm.doc.t_label if (label_fields_c || label_fields_t || label_fields_t1){ if (label_fields_c){ label_dict_c=JSON.parse(label_fields_c) } if (label_fields_t){ label_dict_t=JSON.parse(label_fields_t) } if (label_fields_t1){ label_dict_t1=JSON.parse(label_fields_t1) } var <API key> = function(fields_list,parentfield) { var grid_doctype = me.frm.fields_dict[parentfield].grid.doctype; $.each(fields_list, function(i, fname) { var docfield = frappe.meta.docfield_map[grid_doctype][fname]; if(docfield) { if (label_dict_c){ var label = docfield.label='Qty '+label_dict_c[fname] field_label_map[grid_doctype + "-" + fname] = label.trim(); } } }); } var <API key> = function(fields_list,parentfield) { var grid_doctype = me.frm.fields_dict[parentfield].grid.doctype; $.each(fields_list, function(i, fname) { var docfield = frappe.meta.docfield_map[grid_doctype][fname]; if(docfield) { if (label_dict_t){ var label = docfield.label='Qty '+label_dict_t[fname] field_label_map[grid_doctype + "-" + fname] = label.trim(); } } }); } var <API key> = function(fields_list,parentfield) { var grid_doctype = me.frm.fields_dict[parentfield].grid.doctype; $.each(fields_list, function(i, fname) { var docfield = frappe.meta.docfield_map[grid_doctype][fname]; if(docfield) { if (label_dict_t1){ var label = docfield.label='Qty '+label_dict_t1[fname] field_label_map[grid_doctype + "-" + fname] = label.trim(); } } }); } <API key>(["qty1", "qty2","qty3","qty4","qty5"],this.fname); <API key>(["qty6", "qty7","qty8","qty9","qty10"],this.fname); <API key>(["qty11", "qty12","qty13","qty14","qty15"],this.fname); $.each(field_label_map, function(fname, label) { fname = fname.split("-"); var df = frappe.meta.get_docfield(fname[0], fname[1], me.frm.doc.name); if(df) df.label = label; }); } } }); cur_frm.script_manager.make(erpnext.selling.QuotationController); cur_frm.cscript['Make Sales Order'] = function() { frappe.model.open_mapped_doc({ method: "erpnext.selling.doctype.multiple_qty.multiple_qty.make_sales_order", frm: cur_frm }) } cur_frm.cscript['Declare Order Lost'] = function(){ var dialog = new frappe.ui.Dialog({ title: "Set as Lost", fields: [ {"fieldtype": "Text", "label": __("Reason for losing"), "fieldname": "reason", "reqd": 1 }, {"fieldtype": "Button", "label": __("Update"), "fieldname": "update"}, ] }); dialog.fields_dict.update.$input.click(function() { args = dialog.get_values(); if(!args) return; return cur_frm.call({ method: "declare_order_lost", doc: cur_frm.doc, args: args.reason, callback: function(r) { if(r.exc) { msgprint(__("There were errors.")); return; } dialog.hide(); cur_frm.refresh(); }, btn: this }) }); dialog.show(); } cur_frm.cscript.on_submit = function(doc, cdt, cdn) { if(cint(frappe.boot.<API key>.quotation)) cur_frm.email_doc(frappe.boot.<API key>.quotation_message); } cur_frm.fields_dict["multiple_qty_item"].grid.get_field("<API key>").get_query = function(doc) { return { query:"erpnext.selling.doctype.quotation.quotation.<API key>", filters: { 'from_quotation': doc.name } } } cur_frm.fields_dict["multiple_qty_item"].grid.get_field("<API key>").get_query = function(doc) { return { query:"erpnext.selling.doctype.quotation.quotation.<API key>", filters: { 'from_quotation': doc.name } } } cur_frm.fields_dict["multiple_qty_item"].grid.get_field("<API key>").get_query = function(doc) { return { query:"erpnext.selling.doctype.quotation.quotation.<API key>", filters: { 'from_quotation': doc.name } } } cur_frm.fields_dict["multiple_qty_item"].grid.get_field("<API key>").get_query = function(doc) { return { query:"erpnext.selling.doctype.quotation.quotation.<API key>", filters: { 'from_quotation': doc.name } } } //anand cur_frm.cscript.<API key>=function(doc,cdt,cdn){ var d = locals[cdt][cdn] if (d.<API key>){ return $c_obj(doc, 'get_rm_total_price', d.idx, function(r, rt) { refresh_field('multiple_qty_item'); }); } } //anand cur_frm.cscript.<API key>=function(doc,cdt,cdn){ var d = locals[cdt][cdn] if (d.<API key>){ return $c_obj(doc, 'get_pp_total_price', d.idx, function(r, rt) { refresh_field('multiple_qty_item'); }); } } //anand cur_frm.cscript.<API key>=function(doc,cdt,cdn){ var d = locals[cdt][cdn] if (d.<API key>){ return $c_obj(doc, 'get_sm_total_price', d.idx, function(r, rt) { refresh_field('multiple_qty_item'); }); } } //anand cur_frm.cscript.<API key>=function(doc,cdt,cdn){ var d = locals[cdt][cdn] if (d.<API key>){ return $c_obj(doc, 'get_sp_total_price', d.idx, function(r, rt) { refresh_field('multiple_qty_item'); }); } } cur_frm.cscript.qty1=function(doc,cdt,cdn){ var d = locals[cdt][cdn] return $c_obj(doc, 'set_rate', d.idx, function(r, rt) { refresh_field('multiple_qty_item'); }); } cur_frm.cscript.qty2=function(doc,cdt,cdn){ var d = locals[cdt][cdn] return $c_obj(doc, 'set_rate', d.idx, function(r, rt) { refresh_field('multiple_qty_item'); }); } cur_frm.cscript.qty3=function(doc,cdt,cdn){ var d = locals[cdt][cdn] return $c_obj(doc, 'set_rate', d.idx, function(r, rt) { refresh_field('multiple_qty_item'); }); } cur_frm.cscript.qty4=function(doc,cdt,cdn){ var d = locals[cdt][cdn] return $c_obj(doc, 'set_rate', d.idx, function(r, rt) { refresh_field('multiple_qty_item'); }); } cur_frm.cscript.qty5=function(doc,cdt,cdn){ var d = locals[cdt][cdn] return $c_obj(doc, 'set_rate', d.idx, function(r, rt) { refresh_field('multiple_qty_item'); }); } cur_frm.cscript.rfq_material = function() { return frappe.call({ doc: cur_frm.doc, method: "get_rfq", args:{ field_name:"<API key>", clild_doc_type:"Raw Material Costing Details", parent_cost:"Raw Material Cost Sheet", child_docname:"<API key>", rfq_doctype:"Material RFQ", rfq_child:"<API key>" } }); } cur_frm.cscript.rfq_pp = function() { return frappe.call({ doc: cur_frm.doc, method: "get_rfq", args:{ field_name:"<API key>", clild_doc_type:"Primary Process Details", parent_cost:"Primary Process Costing", child_docname:"primary_process", rfq_doctype:"Primary Process RFQ", rfq_child:"<API key>" }, callback: function(r) { if(r.exc) { msgprint(__("There were errors.")); return; } else if (r.message){ msgprint(__("{0} RFQ's Updated.",[r.message])); } cur_frm.refresh(); } }); } cur_frm.cscript.rfq_sp = function() { return frappe.call({ doc: cur_frm.doc, method: "get_rfq", args:{ field_name:"<API key>", clild_doc_type:"Secondary Process Details", parent_cost:"Secondary Process Costing", child_docname:"secondary_process", rfq_doctype:"Secondary Process RFQ", rfq_child:"<API key>" }, callback: function(r) { if(r.exc) { msgprint(__("There were errors.")); return; } else if (r.message){ msgprint(__("{0} RFQ's Updated.",[r.message])); } cur_frm.refresh(); } }); } cur_frm.cscript.rfq_sm = function() { return frappe.call({ doc: cur_frm.doc, method: "get_rfq", args:{ field_name:"<API key>", clild_doc_type:"Sub Machining Details", parent_cost:"Sub Machining Costing", child_docname:"sub_machining", rfq_doctype:"Sub Machining RFQ", rfq_child:"<API key>" }, callback: function(r) { if(r.exc) { msgprint(__("There were errors.")); return; } else if (r.message){ msgprint(__("{0} RFQ's Updated.",[r.message])); } cur_frm.refresh(); } }); }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Boost.Geometry (aka GGL, Generic Geometry Library)</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head> <table cellpadding="2" width="100%"> <tbody> <tr> <td valign="top"> <img alt="Boost.Geometry" src="images/ggl-logo-big.png" height="80" width="200"> &nbsp;&nbsp; </td> <td valign="top" align="right"> <a href="http: <img alt="Boost C++ Libraries" src="images/accepted_by_boost.png" height="80" width="230" border="0"> </a> </td> </tr> </tbody> </table> <!-- Generated by Doxygen 1.8.6 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="pages.html"><span>Related&#160;Pages</span></a></li> <li><a href="modules.html"><span>Modules</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> <li><a href="examples.html"><span>Examples</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li class="current"><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <div id="navrow3" class="tabs2"> <ul class="tablist"> <li class="current"><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><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_rela.html"><span>Related&#160;Functions</span></a></li> </ul> </div> <div id="navrow4" class="tabs3"> <ul class="tablist"> <li><a href="functions.html#index_a"><span>a</span></a></li> <li><a href="functions_b.html#index_b"><span>b</span></a></li> <li><a href="functions_c.html#index_c"><span>c</span></a></li> <li><a href="functions_d.html#index_d"><span>d</span></a></li> <li><a href="functions_e.html#index_e"><span>e</span></a></li> <li><a href="functions_f.html#index_f"><span>f</span></a></li> <li><a href="functions_g.html#index_g"><span>g</span></a></li> <li><a href="functions_h.html#index_h"><span>h</span></a></li> <li><a href="functions_i.html#index_i"><span>i</span></a></li> <li><a href="functions_j.html#index_j"><span>j</span></a></li> <li><a href="functions_l.html#index_l"><span>l</span></a></li> <li><a href="functions_m.html#index_m"><span>m</span></a></li> <li><a href="functions_n.html#index_n"><span>n</span></a></li> <li><a href="functions_o.html#index_o"><span>o</span></a></li> <li><a href="functions_p.html#index_p"><span>p</span></a></li> <li class="current"><a href="functions_r.html#index_r"><span>r</span></a></li> <li><a href="functions_s.html#index_s"><span>s</span></a></li> <li><a href="functions_t.html#index_t"><span>t</span></a></li> <li><a href="functions_u.html#index_u"><span>u</span></a></li> <li><a href="functions_v.html#index_v"><span>v</span></a></li> <li><a href="functions_w.html#index_w"><span>w</span></a></li> <li><a href="functions_x.html#index_x"><span>x</span></a></li> <li><a href="functions_y.html#index_y"><span>y</span></a></li> <li><a href="functions_z.html#index_z"><span>z</span></a></li> <li><a href="functions_~.html#index_~"><span>~</span></a></li> </ul> </div> </div><!-- top --> <div class="contents"> <div class="textblock">Here is a list of all class members with links to the classes they belong to:</div> <h3><a class="anchor" id="index_r"></a>- r -</h3><ul> <li>radius() : <a class="el" href="<API key>.html#<API key>">boost::geometry::strategy::distance::comparable::cross_track&lt; CalculationType, Strategy &gt;</a> , <a class="el" href="<API key>.html#<API key>">boost::geometry::strategy::distance::comparable::haversine&lt; RadiusType, CalculationType &gt;</a> , <a class="el" href="<API key>.html#<API key>">boost::geometry::strategy::distance::cross_track&lt; CalculationType, Strategy &gt;</a> , <a class="el" href="<API key>.html#<API key>">boost::geometry::strategy::distance::<API key>&lt; CalculationType, Strategy &gt;</a> , <a class="el" href="<API key>.html#<API key>">boost::geometry::strategy::distance::haversine&lt; RadiusType, CalculationType &gt;</a> </li> <li>radius_type : <a class="el" href="<API key>.html#<API key>">boost::geometry::strategy::distance::comparable::cross_track&lt; CalculationType, Strategy &gt;</a> , <a class="el" href="<API key>.html#<API key>">boost::geometry::strategy::distance::comparable::haversine&lt; RadiusType, CalculationType &gt;</a> , <a class="el" href="<API key>.html#<API key>">boost::geometry::strategy::distance::cross_track&lt; CalculationType, Strategy &gt;</a> , <a class="el" href="<API key>.html#<API key>">boost::geometry::strategy::distance::<API key>&lt; CalculationType, Strategy &gt;</a> , <a class="el" href="<API key>.html#<API key>">boost::geometry::strategy::distance::haversine&lt; RadiusType, CalculationType &gt;</a> </li> <li>range_count : <a class="el" href="<API key>.html#<API key>">boost::geometry::section&lt; Box, DimensionCount &gt;</a> </li> <li>read_wkt_exception() : <a class="el" href="<API key>.html#<API key>">boost::geometry::read_wkt_exception</a> </li> <li>referring_segment() : <a class="el" href="<API key>.html#<API key>">boost::geometry::model::referring_segment&lt; <API key> &gt;</a> </li> <li>rescale_policy_type : <a class="el" href="<API key>.html#<API key>">boost::geometry::<API key>&lt; Tag, Geometry1, Geometry2, IntersectionPoint, RobustPolicy, CalculationType &gt;</a> </li> <li>result() : <a class="el" href="<API key>.html#<API key>">boost::geometry::strategy::area::huiller&lt; PointOfSegment, CalculationType &gt;</a> , <a class="el" href="<API key>.html#<API key>">boost::geometry::strategy::area::surveyor&lt; PointOfSegment, CalculationType &gt;</a> , <a class="el" href="<API key>.html#<API key>">boost::geometry::strategy::centroid::average&lt; PointCentroid, Point &gt;</a> , <a class="el" href="<API key>.html#<API key>">boost::geometry::strategy::centroid::bashein_detmer&lt; Point, PointOfSegment, CalculationType &gt;</a> , <a class="el" href="<API key>.html#<API key>">boost::geometry::strategy::centroid::weighted_length&lt; Point, PointOfSegment &gt;</a> , <a class="el" href="<API key>.html#<API key>">boost::geometry::strategy::convex_hull::graham_andrew&lt; InputGeometry, OutputPoint &gt;</a> , <a class="el" href="<API key>.html#<API key>">boost::geometry::strategy::within::crossings_multiply&lt; Point, PointOfSegment, CalculationType &gt;</a> , <a class="el" href="<API key>.html#<API key>">boost::geometry::strategy::within::franklin&lt; Point, PointOfSegment, CalculationType &gt;</a> , <a class="el" href="<API key>.html#<API key>">boost::geometry::strategy::within::oriented_winding&lt; Reverse, Point, PointOfSegment, CalculationType &gt;</a> , <a class="el" href="<API key>.html#<API key>">boost::geometry::strategy::within::winding&lt; Point, PointOfSegment, CalculationType &gt;</a> </li> <li>result_type : <a class="el" href="<API key>.html#<API key>">boost::geometry::less&lt; Point, Dimension, Strategy &gt;</a> , <a class="el" href="structboost_1_1geometry_1_1resolve__variant_1_1length_3_01boost_1_1variant_3_01_b_o_o_s_t___v_a_b7de75c6fc280f06744e400add573826.html#<API key>">boost::geometry::resolve_variant::length&lt; boost::variant&lt; <API key>(T)&gt; &gt;</a> , <a class="el" href="structboost_1_1geometry_1_1resolve__variant_1_1perimeter_3_01boost_1_1variant_3_01_b_o_o_s_t___vbe819620bea9621b113d1f0c653a0ff4.html#<API key>">boost::geometry::resolve_variant::perimeter&lt; boost::variant&lt; <API key>(T)&gt; &gt;</a> </li> <li>return_type : <a class="el" href="<API key>.html#<API key>">boost::geometry::policies::relate::segments_direction</a> , <a class="el" href="<API key>.html#<API key>">boost::geometry::policies::relate::<API key>&lt; ReturnType &gt;</a> , <a class="el" href="<API key>.html#<API key>">boost::geometry::policies::relate::<API key>&lt; FractionType &gt;</a> , <a class="el" href="<API key>.html#<API key>">boost::geometry::policies::relate::segments_tupled&lt; Policy1, Policy2 &gt;</a> , <a class="el" href="<API key>.html#<API key>">boost::geometry::strategy::area::huiller&lt; PointOfSegment, CalculationType &gt;</a> , <a class="el" href="<API key>.html#<API key>">boost::geometry::strategy::area::surveyor&lt; PointOfSegment, CalculationType &gt;</a> , <a class="el" href="structboost_1_1geometry_1_1strategy_1_1intersection_1_1relate__spherical__segments.html#<API key>">boost::geometry::strategy::intersection::<API key>&lt; Policy, CalculationType &gt;</a> </li> <li>reverse() : <a class="el" href="<API key>.html#<API key>">boost::geometry::side_info</a> </li> <li>ring() : <a class="el" href="<API key>.html#<API key>">boost::geometry::model::ring&lt; Point, ClockWise, Closed, Container, Allocator &gt;</a> </li> <li>ring_id : <a class="el" href="<API key>.html#<API key>">boost::geometry::section&lt; Box, DimensionCount &gt;</a> </li> <li>ring_identifier() : <a class="el" href="<API key>.html#<API key>">boost::geometry::ring_identifier</a> </li> <li>ring_index : <a class="el" href="<API key>.html#<API key>">boost::geometry::ring_identifier</a> , <a class="el" href="<API key>.html#<API key>">boost::geometry::segment_identifier</a> </li> <li>ring_type : <a class="el" href="<API key>.html#<API key>">boost::geometry::model::polygon&lt; Point, ClockWise, Closed, PointList, RingList, PointAlloc, RingAlloc &gt;</a> </li> <li>robust_ra : <a class="el" href="<API key>.html#<API key>">boost::geometry::fraction_type&lt; SegmentRatio &gt;</a> , <a class="el" href="structboost_1_1geometry_1_1strategy_1_1intersection_1_1relate__spherical__segments_1_1segment__intersection__info.html#<API key>">boost::geometry::strategy::intersection::<API key>&lt; Policy, CalculationType &gt;::<API key>&lt; CoordinateType, SegmentRatio, Vector3d &gt;</a> </li> <li>robust_rb : <a class="el" href="<API key>.html#<API key>">boost::geometry::fraction_type&lt; SegmentRatio &gt;</a> , <a class="el" href="structboost_1_1geometry_1_1strategy_1_1intersection_1_1relate__spherical__segments_1_1segment__intersection__info.html#<API key>">boost::geometry::strategy::intersection::<API key>&lt; Policy, CalculationType &gt;::<API key>&lt; CoordinateType, SegmentRatio, Vector3d &gt;</a> </li> <li>rotate_transformer() : <a class="el" href="<API key>.html#<API key>">boost::geometry::strategy::transform::rotate_transformer&lt; DegreeOrRadian, CalculationType, Dimension1, Dimension2 &gt;</a> </li> </ul> </div><!-- contents --> <hr size="1"> <table width="100%"> <tbody> <tr> <td align="left"><small> <p>April 2, 2011</p> </small></td> <td align="right"> <small> Copyright &copy; 2007-2011 Barend Gehrels, Amsterdam, the Netherlands<br> Copyright &copy; 2008-2011 Bruno Lalande, Paris, France<br> Copyright &copy; 2009-2010 Mateusz Loskot, London, UK<br> </small> </td> </tr> </tbody> </table> <address style="text-align: right;"><small> Documentation is generated by&nbsp;<a href="http: </small></address> </body> </html>
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('credit', '<API key>'), ] operations = [ migrations.AlterModelOptions( name='creditrequirement', options={'ordering': ['sort_value']}, ), ]
# Software packages The software packages module enables searching the installed software of machines. ## Design Software configuration of machines is stored as a JSON column in the database. This requires MySQL 5.7. The stored JSON is a array of objects which MUST have a `name` and MAY have a `version`: [ { "name": "python", "version": "2.6" }, { "name":"openssh" }, { "name": "nmap", "version": "7.12"} ] Versions are strings as they can differ in format between packages and platform. Python on CentOS maybe looks like this: `{ "name" : "python", "version": "2.6.6-66.el6_8.x86_64" }` while on Debian it looks like this: `{ "name": "python", "2.6.6-3.22.201205211619" }` and Ubuntu like this: `{ "name": "python", "version": "2.7.11-1" }` ## Sources This column can only be filled automatically with data, no frontend for manual input exists. Currently two methods are supported to add software data to machines. API Currently the software configuration can be imported using the IDB-API. The relevant field for this is the `software` field containing a value like described above. Puppet Scripts are used to provide a custom `<API key>` fact. These scripts can be found at [https: The fact consists of a list enclosed by `[` and `]` of space seperated items which are returned from the individiual package manager, e.g. a python package would be listed as `python=2.6.6-3.22.201205211619` in an apt based system. A list of those items may look like this: [accountsservice=0.6.40-2ubuntu11.2 acl=2.2.52-3 acpid=1:2.0.26-1ubuntu2 ... zlib1g:amd64=1:1.2.8.dfsg-2ubuntu4] The individual items have to be split into package name and version. Currently only .deb and .rpm based systems are supported. ## Frontend Display packages of a machine If a machine has contents in its software field, a new tab named "Software" shows up in the detailed view of a machine. Search for packages When selecting "Software" in the top menu bar, a search field is displayed. To query the IDB for machines with a particular software configuration the following search syntax is used: NAME=VERSION NAME=VERSION NAME=VERSION ... Currently only conjunction is supported for multiple search terms. All terms must match. The `=VERSION` part can be omitted if any version should match. `VERSION` can also be a prefix, `1.2` matches any version starting with `1.2`.
<!DOCTYPE html PUBLIC "- <html xmlns="http: <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <title>Rgaa30 Test.6.3.2 Failed 12</title> </head> <body> <div> <div class="test-detail" lang="fr"> Chaque intitulé de lien image (contenu de l&apos;attribut <code>alt</code>, texte entre <code>&lt;canvas&gt;</code> et <code>&lt;/canvas&gt;</code> ou texte entre <code>&lt;object&gt;</code> et <code>&lt;/object&gt;</code>) est-il explicite hors contexte (hors cas particuliers) ? </div> <a href="my-link.html"> <object data="data.png"> --&gt;;* </object> </a> <p class="test-explanation">Failed : The link text only contains non alphanumeric characters (whatever the context). We can deduce it is not pertinent</p> </div> </body> </html>
/* Rupi Happyville Warp NPC */ var status = 0; function start() { cm.sendSimple ("What would you like from me today ?\r\n#b#L0#I want to go to Happyville !#l\r\n\#L1#I want to get out of Happyville !#l"); } function action(mode, type, selection) { if (mode == 1) status++; else { cm.dispose(); return; } if (status == 1) { if (selection == 0) { cm.gainItem(1472063, 1); cm.warp(209000000); } else cm.warp(101000000); cm.sendOk("Have fun!"); cm.dispose(); } }
package org.opennms.features.newts.converter; import java.io.File; import java.io.FileInputStream; import java.util.Properties; import org.opennms.core.db.DataSourceFactory; import org.opennms.core.utils.ConfigFileConstants; import org.opennms.core.xml.JaxbUtils; import org.opennms.netmgt.config.opennmsDataSources.<API key>; import org.opennms.netmgt.config.opennmsDataSources.JdbcDataSource; /** * The Class OnmsProperties. * * @author Alejandro Galue <agalue@opennms.org> */ public abstract class OnmsProperties { /** * Register properties. * * @param properties the properties */ private static void registerProperties(Properties properties) { for (Object o : properties.keySet()) { String key = (String) o; if (System.getProperty(key) == null) { System.setProperty(key, properties.getProperty(key)); } } } /** * Load properties. * * @param properties the properties * @param fileName the file name * @throws Exception the exception */ private static void loadProperties(Properties properties, String fileName) throws Exception { File propertiesFile = ConfigFileConstants.getConfigFileByName(fileName); properties.load(new FileInputStream(propertiesFile)); } /** * Initialize. */ public static void initialize() { try { final Properties mainProperties = new Properties(); loadProperties(mainProperties, "opennms.properties"); registerProperties(mainProperties); final File cfgFile = ConfigFileConstants.getFile(ConfigFileConstants.<API key>); final <API key> dsc = JaxbUtils.unmarshal(<API key>.class, cfgFile); boolean found = false; for (JdbcDataSource jds : dsc.<API key>()) { if (jds.getName().equals("opennms")) { SimpleDataSource ds = new SimpleDataSource(jds); DataSourceFactory.setInstance(ds); found = true; } } if (!found) { throw NewtsConverterError.create("Can't find OpenNMS database configuration"); } } catch (Exception e) { throw NewtsConverterError.create(e, "Can't initialize OpenNMS database connection factory: {}", e.getMessage()); } } }
// generator: ilarkesto.mda.legacy.generator.GwtActionGenerator package scrum.client.risks; import java.util.*; public abstract class GCreateRiskAction extends scrum.client.common.AScrumAction { public GCreateRiskAction() { } @Override public boolean isExecutable() { return true; } }
<?php class <API key> extends KOperationEngine { const URL_EXTENSION = "widevine/encryption?signature="; const SYSTEM_NAME = 'OVP'; /** * @var array * batch job parameters */ private $params; public function __construct($params, $outFilePath) { $this->params = $params; } /* (non-PHPdoc) * @see KOperationEngine::getCmdLine() */ protected function getCmdLine() {} /* * (non-PHPdoc) * @see KOperationEngine::doOperation() * cEnc operation engine */ protected function doOperation() { KalturaLog::debug("starting"); KBatchBase::impersonate($this->job->partnerId); $drmPlugin = <API key>::get(KBatchBase::$kClient); $profile = $drmPlugin->drmProfile->getByProvider(<API key>::CENC); KBatchBase::unimpersonate(); $udrmData = $this->getUDRMdata($profile->licenseServerUrl, $profile->signingKey); if (!isset($this->data->srcFileSyncs) || !isset($this->data->srcFileSyncs[0])) { $logMsg = "Did not get input file"; KalturaLog::err($logMsg); throw new <API key>($logMsg); } $encryptResult = $this->encryptWithEdash($udrmData); $mpdResult = $this->createMPD(); $mpdOutPath = $this->data-><API key>.".mpd"; $fsDescArr = array(); $fsDesc = new <API key>(); $fsDesc->fileSyncLocalPath = $mpdOutPath; $fsDesc-><API key> = 7; //<API key>; $fsDescArr[] = $fsDesc; $this->data->extraDestFileSyncs = $fsDescArr; return true; } private function getUDRMdata($licenseServerUrl, $signingKey) { $jsonPostData = '{"ca_system":"'. self::SYSTEM_NAME .'", "account_id":"'.$this->job->partnerId.'", "content_id":"'. $this->job->entryId.'", "files":"'.$this->data->flavorParamsOutput->flavorParamsId.'"}'; $signature = self::signDataWithKey($jsonPostData, $signingKey); $serviceURL = $licenseServerUrl. "" . self::URL_EXTENSION . "" .$signature; $ch = curl_init($serviceURL); curl_setopt($ch, CURLOPT_HTTPHEADER,array('Content-type: application/json') ); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonPostData); curl_setopt($ch, <API key>, 1); KalturaLog::debug("calling udrm service '".$serviceURL."' with data '".$jsonPostData."' "); $output = curl_exec($ch); if ($output === false) { $logMsg = "Could not get UDRM Data error message 'Curl had an error '".curl_error($ch)."' "; KalturaLog::err($logMsg); throw new <API key>($logMsg); } $ret_val = json_decode($output); if (!isset($ret_val->key_id)) { $logMsg = "did not get good result from udrm service, output is '".$output."'"; KalturaLog::err($logMsg); throw new <API key>($logMsg); } return $ret_val; } private function encryptWithEdash($udrmData) { $inputFile = $this->data->srcFileSyncs[0]-><API key>; $keyIdDecoded = self::strToHex(base64_decode($udrmData->key_id)); $udrmKey = self::strToHex(base64_decode($udrmData->key)); $cmdLine = $this->params->exePath."packager input=".$inputFile.",".$this->operator->params.",output=".$this->data-><API key>. " --output_media_info --<API key> --key_id ".$keyIdDecoded." --key ".$udrmKey; foreach ($udrmData->pssh as $currPssh) { $psshEncoded = self::strToHex(base64_decode($currPssh->data)); $cmdLine .= " --pssh ".$psshEncoded; } KalturaLog::debug("Going to run command '".$cmdLine."' "); $result = system($cmdLine, $system_ret_val); if ($system_ret_val != 0) { $logMsg = "There was a problem running the packager, got return value '$system_ret_val' got result '$result' "; KalturaLog::err($logMsg); throw new <API key>($logMsg); } return $result; } private function createMPD() { $cmdLine = $this->params->exePath."mpd_generator --input=".$this->data-><API key>. ".media_info --output=".$this->data-><API key>.".mpd "; KalturaLog::debug("Going to run command '".$cmdLine."' "); $result = system($cmdLine, $system_ret_val); if ($system_ret_val != 0) { $logMsg = "There was a problem running the mpd generator, got return value '$system_ret_val' got result '$result' "; KalturaLog::err($logMsg); throw new <API key>($logMsg); } return $result; } public static function strToHex($string) { $hex=''; for ($i=0; $i < strlen($string); $i++) { $currChar = dechex(ord($string[$i])); if (strlen($currChar) == 1) $currChar = "0".$currChar; $hex .= $currChar; } return strtoupper($hex); } public static function signDataWithKey($dataToSign, $signingKey) { return urlencode(base64_encode(sha1($signingKey.$dataToSign,TRUE))); } }
<?php /** * @see <API key> */ require_once "Zend/Soap/Wsdl/Strategy/Interface.php"; class <API key> implements <API key> { /** * Typemap of Complex Type => Strategy pairs. * * @var array */ protected $_typeMap = array(); /** * Default Strategy of this composite * * @var string|<API key> */ protected $_defaultStrategy; /** * Context WSDL file that this composite serves * * @var Zend_Soap_Wsdl|null */ protected $_context; /** * Construct Composite WSDL Strategy. * * @throws <API key> * @param array $typeMap * @param string|<API key> $defaultStrategy */ public function __construct(array $typeMap=array(), $defaultStrategy="<API key>") { foreach($typeMap AS $type => $strategy) { $this-><API key>($type, $strategy); } $this->_defaultStrategy = $defaultStrategy; } /** * Connect a complex type to a given strategy. * * @throws <API key> * @param string $type * @param string|<API key> $strategy * @return <API key> */ public function <API key>($type, $strategy) { if(!is_string($type)) { /** * @see <API key> */ require_once "Zend/Soap/Wsdl/Exception.php"; throw new <API key>("Invalid type given to Composite Type Map."); } $this->_typeMap[$type] = $strategy; return $this; } /** * Return default strategy of this composite * * @throws <API key> * @param string $type * @return <API key> */ public function getDefaultStrategy() { $strategy = $this->_defaultStrategy; if(is_string($strategy) && class_exists($strategy)) { $strategy = new $strategy; } if( !($strategy instanceof <API key>) ) { /** * @see <API key> */ require_once "Zend/Soap/Wsdl/Exception.php"; throw new <API key>( "Default Strategy for Complex Types is not a valid strategy object." ); } $this->_defaultStrategy = $strategy; return $strategy; } /** * Return specific strategy or the default strategy of this type. * * @throws <API key> * @param string $type * @return <API key> */ public function getStrategyOfType($type) { if(isset($this->_typeMap[$type])) { $strategy = $this->_typeMap[$type]; if(is_string($strategy) && class_exists($strategy)) { $strategy = new $strategy(); } if( !($strategy instanceof <API key>) ) { /** * @see <API key> */ require_once "Zend/Soap/Wsdl/Exception.php"; throw new <API key>( "Strategy for Complex Type '".$type."' is not a valid strategy object." ); } $this->_typeMap[$type] = $strategy; } else { $strategy = $this->getDefaultStrategy(); } return $strategy; } /** * Method accepts the current WSDL context file. * * @param Zend_Soap_Wsdl $context */ public function setContext(Zend_Soap_Wsdl $context) { $this->_context = $context; return $this; } /** * Create a complex type based on a strategy * * @throws <API key> * @param string $type * @return string XSD type */ public function addComplexType($type) { if(!($this->_context instanceof Zend_Soap_Wsdl) ) { /** * @see <API key> */ require_once "Zend/Soap/Wsdl/Exception.php"; throw new <API key>( "Cannot add complex type '".$type."', no context is set for this composite strategy." ); } $strategy = $this->getStrategyOfType($type); $strategy->setContext($this->_context); return $strategy->addComplexType($type); } }
package context import ( "sort" "github.com/juju/errors" "github.com/juju/loggo" "github.com/juju/juju/payload" ) var logger = loggo.GetLogger("juju.payload.context") // APIClient represents the API needs of a Context. type APIClient interface { // List requests the payload info for the given IDs. List(fullIDs ...string) ([]payload.Result, error) // Track sends a request to update state with the provided payloads. Track(payloads ...payload.Payload) ([]payload.Result, error) // Untrack removes the payloads from our list track. Untrack(fullIDs ...string) ([]payload.Result, error) // SetStatus sets the status for the given IDs. SetStatus(status string, fullIDs ...string) ([]payload.Result, error) } // TODO(ericsnow) Rename Get and Set to more specifically describe what // they are for. // Component provides the hook context data specific to payloads. type Component interface { // Get returns the payload info corresponding to the given ID. Get(class, id string) (*payload.Payload, error) // Track records the payload info in the hook context. Track(payload payload.Payload) error // Untrack removes the payload from our list of payloads to track. Untrack(class, id string) error // SetStatus sets the status of the payload. SetStatus(class, id, status string) error // List returns the list of registered payload IDs. List() ([]string, error) // Flush pushes the hook context data out to state. Flush() error } var _ Component = (*Context)(nil) // Context is the payload portion of the hook context. type Context struct { api APIClient dataDir string // TODO(ericsnow) Use the Juju ID for the key rather than Info.ID(). payloads map[string]payload.Payload updates map[string]payload.Payload } // NewContext returns a new hooks.ContextComponent for payloads. func NewContext(api APIClient, dataDir string) *Context { return &Context{ api: api, dataDir: dataDir, payloads: make(map[string]payload.Payload), updates: make(map[string]payload.Payload), } } // NewContextAPI returns a new hooks.ContextComponent for payloads. func NewContextAPI(api APIClient, dataDir string) (*Context, error) { results, err := api.List() if err != nil { return nil, errors.Trace(err) } ctx := NewContext(api, dataDir) for _, result := range results { pl := result.Payload // TODO(ericsnow) Use id instead of pl.FullID(). ctx.payloads[pl.FullID()] = pl.Payload } return ctx, nil } // HookContext is the portion of hooks.Context used in this package. type HookContext interface { // Component implements hooks.Context. Component(string) (Component, error) } // ContextComponent returns the hook context for the payload // payload component. func ContextComponent(ctx HookContext) (Component, error) { compCtx, err := ctx.Component(payload.ComponentName) if errors.IsNotFound(err) { return nil, errors.Errorf("component %q not registered", payload.ComponentName) } if err != nil { return nil, errors.Trace(err) } if compCtx == nil { return nil, errors.Errorf("component %q disabled", payload.ComponentName) } return compCtx, nil } // TODO(ericsnow) Should we build in refreshes in all the methods? // Payloads returns the payloads known to the context. func (c *Context) Payloads() ([]payload.Payload, error) { payloads := mergePayloadMaps(c.payloads, c.updates) var newPayloads []payload.Payload for _, pl := range payloads { newPayloads = append(newPayloads, pl) } return newPayloads, nil } func mergePayloadMaps(payloads, updates map[string]payload.Payload) map[string]payload.Payload { // At this point payloads and updates have already been checked for // nil values so we won't see any here. result := make(map[string]payload.Payload) for k, v := range payloads { result[k] = v } for k, v := range updates { result[k] = v } return result } // Get returns the payload info corresponding to the given ID. func (c *Context) Get(class, id string) (*payload.Payload, error) { fullID := payload.BuildID(class, id) logger.Tracef("getting %q from hook context", fullID) actual, ok := c.updates[fullID] if !ok { actual, ok = c.payloads[fullID] if !ok { return nil, errors.NotFoundf("%s", fullID) } } return &actual, nil } // List returns the sorted names of all registered payloads. func (c *Context) List() ([]string, error) { logger.Tracef("listing all payloads in hook context") payloads, err := c.Payloads() if err != nil { return nil, errors.Trace(err) } if len(payloads) == 0 { return nil, nil } var ids []string for _, wl := range payloads { ids = append(ids, wl.FullID()) } sort.Strings(ids) return ids, nil } // Track records the payload info in the hook context. func (c *Context) Track(pl payload.Payload) error { logger.Tracef("adding %q to hook context: %#v", pl.FullID(), pl) if err := pl.Validate(); err != nil { return errors.Trace(err) } // TODO(ericsnow) We are likely missing mechanism for local persistence. id := pl.FullID() c.updates[id] = pl return nil } // Untrack tells juju to stop tracking this payload. func (c *Context) Untrack(class, id string) error { fullID := payload.BuildID(class, id) logger.Tracef("Calling untrack on payload context %q", fullID) res, err := c.api.Untrack(fullID) if err != nil { return errors.Trace(err) } // TODO(ericsnow) We should not ignore a 0-len result. if len(res) > 0 && res[0].Error != nil { return errors.Trace(res[0].Error) } delete(c.payloads, id) return nil } // SetStatus sets the identified payload's status. func (c *Context) SetStatus(class, id, status string) error { fullID := payload.BuildID(class, id) logger.Tracef("Calling status-set on payload context %q", fullID) res, err := c.api.SetStatus(status, fullID) if err != nil { return errors.Trace(err) } // TODO(ericsnow) We should not ignore a 0-len result. if len(res) > 0 && res[0].Error != nil { // In a hook context, the case where the specified payload does // not exist is a special one. A hook tool is how a charm author // communicates the state of the charm. So returning an error // here in the "missing" case makes less sense than in other // places. We could simply ignore any error that surfaces for // that case. However, returning the error communicates to the // charm author that what they're trying to communicate doesn't // make sense. return errors.Trace(res[0].Error) } return nil } // TODO(ericsnow) The context machinery is not actually using this yet. // Flush implements hooks.ContextComponent. In this case that means all // added and updated payload.Payload in the hook context are pushed to // Juju state via the API. func (c *Context) Flush() error { logger.Tracef("flushing from hook context to state") // TODO(natefinch): make this a noop and move this code into set. if len(c.updates) > 0 { var updates []payload.Payload for _, pl := range c.updates { updates = append(updates, pl) } res, err := c.api.Track(updates...) if err != nil { return errors.Trace(err) } if len(res) > 0 && res[0].Error != nil { return errors.Trace(res[0].Error) } for k, v := range c.updates { c.payloads[k] = v } c.updates = map[string]payload.Payload{} } return nil }
/* * JavaScript for audit set-up page */ $(document).ready(function() { /* * Show / hide audit options */ <API key> = "<API key>"; masterAuditOption = $('.' + <API key>); auditOptionAnchorId = "audit-options"; toggleOptionLink = $('<a>', { 'href': '#' + auditOptionAnchorId, 'aria-expanded': 'false', 'aria-controls': auditOptionAnchorId }); masterAuditOption.wrap(toggleOptionLink); optionPanel = $('#' + auditOptionAnchorId); if (!masterAuditOption.hasClass('on-error')) { masterAuditOption.addClass('collapsed'); optionPanel.hide(); } else { masterAuditOption.addClass('expanded'); } $('a[href=#' + auditOptionAnchorId + ']').click(function() { if ($(this).attr('aria-expanded') == 'false') { $(this).attr('aria-expanded', true).children('span:first-child').removeClass('collapsed').addClass('expanded'); optionPanel.show(); } else { $(this).attr('aria-expanded', false).children('span:first-child').removeClass('expanded').addClass('collapsed'); optionPanel.hide(); } return false; }); /* * Show / hide audit urls */ <API key> = "master-input"; masterAuditInput = $('.' + <API key>); if (masterAuditInput !== null) { auditInputAnchorId = "extra-inputs"; toggleInputLink = $('<a>', { 'href': '#' + auditInputAnchorId, 'aria-expanded': 'false', 'aria-controls': auditInputAnchorId }); masterAuditInput.wrap(toggleInputLink); inputPanel = $('#' + auditInputAnchorId); if (!masterAuditInput.hasClass('on-error')) { masterAuditInput.addClass('collapsed'); inputPanel.hide(); } else { masterAuditInput.addClass('expanded'); } $('a[href=#' + auditInputAnchorId + ']').click(function() { if ($(this).attr('aria-expanded') == 'false') { $(this).attr('aria-expanded', true).children('span:first-child').removeClass('collapsed').addClass('expanded'); inputPanel.show(); } else { $(this).attr('aria-expanded', false).children('span:first-child').removeClass('expanded').addClass('collapsed'); inputPanel.hide(); } return false; }); } });
/** * Shopware Plugin Manager - Plugin Store * The plugin store contains all plugins of the shopware shop. * The plugins grouped by the active field. */ //{block name="backend/plugin_manager/store/detail"} Ext.define('Shopware.apps.PluginManager.store.Detail', { /** * Extend for the standard ExtJS 4 * @string */ extend:'Ext.data.Store', /** * Define the used model for this store * @string */ model:'Shopware.apps.PluginManager.model.Plugin', /** * The number of records considered to form a 'page'. This is used to power the built-in paging using the * nextPage and previousPage functions when the grid is paged using a PagingScroller Defaults to 25. */ pageSize: 1, /** * Configure the data communication * @object */ proxy:{ /** * Set proxy type to ajax * @string */ type:'ajax', /** * Configure the url mapping for the different * store operations based on * @object */ api: { read: '{url action="detail"}' }, /** * Configure the data reader * @object */ reader:{ type:'json', root:'data', totalProperty:'total' } } }); //{/block}
{# Votes info #} <span {% if current_user.user_id %}class="wideonly"{% endif %}>{% trans _('votos') %}: </span>{% if self.show_votes %}<a class="fancybox" href="{{ globals.base_url }}backend/get_p_v.php?id={{ self.id }}" title="{% trans _('información de votos') %}">{% endif %}<span id="vc-{{ self.id }}" class="votes-counter">{{ self.votes }}</span>{% if self.show_votes %}</a>{% endif %} &nbsp;&nbsp; <span {% if current_user.user_id %}class="wideonly"{% endif %}>{% trans _('karma') %}: </span><span class="votes-counter" id="vk-{{ self.id }}" title="{% trans _('karma') %}">{{ self.karma }}</span>
<%inherit file="base.html"/> <%def name="head()"> </%def> <%def name="main()"> <div class="jumbotron"> </div> <div class="row marketing"> <div class="col-lg-6"> <h4></h4> <p> <a href="http: <a href="http://weibo.com/"></a> - <a href="http: <a href="http://click.union.jd.com"></a> </p> <!-- <h4></h4> <p>Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Cras mattis consectetur purus sit amet fermentum.</p> </div> <div class="col-lg-6"> <h4></h4> <p> <a href="http: <a href="http: <a href="http: </p> <!-- <h4></h4> <p>Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Cras mattis consectetur purus sit amet fermentum.</p> </div> </div> </%def>
package org.jboss.as.domain.management.controller; import java.util.EnumSet; import java.util.Set; import org.jboss.as.controller.OperationContext; import org.jboss.as.controller.<API key>; import org.jboss.as.controller.<API key>; import org.jboss.as.controller.PathAddress; import org.jboss.as.controller.access.Action; import org.jboss.as.controller.access.management.AuthorizedAddress; import org.jboss.as.controller.descriptions.<API key>; import org.jboss.dmr.ModelNode; public class <API key> implements <API key> { private static final String HIDDEN = "<hidden>"; private static final Set<Action.ActionEffect> ADDRESS_EFFECT = EnumSet.of(Action.ActionEffect.ADDRESS); static final <API key> INSTANCE = new <API key>(); @Override public void execute(OperationContext context, ModelNode operation) throws <API key> { ModelNode model = context.readResource(PathAddress.EMPTY_ADDRESS).getModel(); AuthorizedAddress authorizedAddress = AuthorizedAddress.authorizeAddress(context, operation); String attribute = operation.require(<API key>.NAME).asString(); if (<API key>.OPERATION_NAME.getName().equals(attribute)) { if (authorizedAddress.isElided()) { context.getResult().set(HIDDEN); } else { context.getResult().set(model.get(attribute)); } } else if (<API key>.ADDRESS.getName().equals(attribute)) { if (authorizedAddress.isElided()) { context.getResult().set(authorizedAddress.getAddress()); } else { context.getResult().set(model.get(attribute)); } } else { // Programming error throw new <API key>(); } } }
#ifndef IMAGEVIEWER_H #define IMAGEVIEWER_H #include <coreplugin/editormanager/ieditor.h> #include <coreplugin/idocument.h> #include <QScopedPointer> #include <QStringList> QT_BEGIN_NAMESPACE class QAbstractButton; class QAction; QT_END_NAMESPACE namespace ImageViewer { namespace Internal { class ImageViewerFile; class ImageViewer : public Core::IEditor { Q_OBJECT public: explicit ImageViewer(QWidget *parent = 0); ~ImageViewer(); bool open(QString *errorString, const QString &fileName, const QString &realFileName); Core::IDocument *document(); QWidget *toolBar(); public slots: void imageSizeUpdated(const QSize &size); void scaleFactorUpdate(qreal factor); void <API key>(); void switchViewOutline(); void zoomIn(); void zoomOut(); void resetToOriginalSize(); void fitToScreen(); void togglePlay(); private slots: void playToggled(); private: bool <API key>(QAbstractButton *button, const QString &name); void setPaused(bool paused); private: struct ImageViewerPrivate *d; }; } // namespace Internal } // namespace ImageViewer #endif // IMAGEVIEWER_H
#include <time.h> #include "cpu.h" #include "periph/rtc.h" #include "periph_conf.h" /* guard file in case no RTC device was specified */ #if RTC_NUMOF #define <API key> (0xCA) #define <API key> (0x53) #define RTC_SYNC_PRESCALER (0xff) /**< prescaler for 32.768 kHz oscillator */ #define RTC_ASYNC_PRESCALER (0x7f) /**< prescaler for 32.768 kHz oscillator */ #define MCU_YEAR_OFFSET (100) /**< struct tm counts years since 1900 but RTC has only two-digit year hence the offset of 100 years. */ typedef struct { rtc_alarm_cb_t cb; /**< callback called from RTC interrupt */ void *arg; /**< argument passed to the callback */ } rtc_state_t; static rtc_state_t rtc_callback; static uint8_t byte2bcd(uint8_t value); /** * @brief Initializes the RTC to use LSE (external 32.768 kHz oscillator) as a * clocl source. Verify that your board has this oscillator. If other clock * source is used, then also the prescaler constants should be changed. */ void rtc_init(void) { /* Enable write access to RTC registers */ periph_clk_en(APB1, RCC_APB1ENR_PWREN); PWR->CR |= PWR_CR_DBP; /* Reset RTC domain */ RCC->BDCR |= RCC_BDCR_BDRST; RCC->BDCR &= ~(RCC_BDCR_BDRST); /* Enable the LSE clock (external 32.768 kHz oscillator) */ RCC->BDCR &= ~(RCC_BDCR_LSEON); RCC->BDCR &= ~(RCC_BDCR_LSEBYP); RCC->BDCR |= RCC_BDCR_LSEON; while ((RCC->BDCR & RCC_BDCR_LSERDY) == 0) {} /* Switch RTC to LSE clock source */ RCC->BDCR &= ~(RCC_BDCR_RTCSEL); RCC->BDCR |= RCC_BDCR_RTCSEL_LSE; /* Enable the RTC */ RCC->BDCR |= RCC_BDCR_RTCEN; /* Unlock RTC write protection */ RTC->WPR = <API key>; RTC->WPR = <API key>; /* Enter RTC Init mode */ RTC->ISR = 0; RTC->ISR |= RTC_ISR_INIT; while ((RTC->ISR & RTC_ISR_INITF) == 0) {} /* Set 24-h clock */ RTC->CR |= RTC_CR_FMT; /* Timestamps enabled */ RTC->CR |= RTC_CR_TSE; /* Configure the RTC PRER */ RTC->PRER = RTC_SYNC_PRESCALER; RTC->PRER |= (RTC_ASYNC_PRESCALER << 16); /* Exit RTC init mode */ RTC->ISR &= (uint32_t)~RTC_ISR_INIT; /* Enable RTC write protection */ RTC->WPR = 0xff; } int rtc_set_time(struct tm *time) { /* Enable write access to RTC registers */ periph_clk_en(APB1, RCC_APB1ENR_PWREN); PWR->CR |= PWR_CR_DBP; /* Unlock RTC write protection */ RTC->WPR = <API key>; RTC->WPR = <API key>; /* Enter RTC Init mode */ RTC->ISR |= RTC_ISR_INIT; while ((RTC->ISR & RTC_ISR_INITF) == 0) {} RTC->DR = ( (((uint32_t)byte2bcd(time->tm_year - MCU_YEAR_OFFSET) << 16) & (RTC_DR_YT | RTC_DR_YU) ) | (((uint32_t)byte2bcd(time->tm_mon+1)<< 8) & (RTC_DR_MT | RTC_DR_MU) ) | (((uint32_t)byte2bcd(time->tm_mday) << 0) & (RTC_DR_DT | RTC_DR_DU) ) ); RTC->TR = ( (((uint32_t)byte2bcd(time->tm_hour) << 16) & (RTC_TR_HT | RTC_TR_HU) ) | (((uint32_t)byte2bcd(time->tm_min) << 8) & (RTC_TR_MNT| RTC_TR_MNU)) | (((uint32_t)byte2bcd(time->tm_sec) << 0) & (RTC_TR_ST | RTC_TR_SU) ) ); /* Exit RTC init mode */ RTC->ISR &= (uint32_t)~RTC_ISR_INIT; /* Enable RTC write protection */ RTC->WPR = 0xFF; return 0; } int rtc_get_time(struct tm *time) { time->tm_year = MCU_YEAR_OFFSET; time->tm_year +=(((RTC->DR & RTC_DR_YT) >> 20) * 10) + ((RTC->DR & RTC_DR_YU) >> 16); time->tm_mon = (((RTC->DR & RTC_DR_MT) >> 12) * 10) + ((RTC->DR & RTC_DR_MU) >> 8) - 1; time->tm_mday = (((RTC->DR & RTC_DR_DT) >> 4) * 10) + ((RTC->DR & RTC_DR_DU) >> 0); time->tm_hour = (((RTC->TR & RTC_TR_HT) >> 20) * 10) + ((RTC->TR & RTC_TR_HU) >> 16); if ( RTC->TR & RTC_TR_PM ) time->tm_hour += 12; time->tm_min = (((RTC->TR & RTC_TR_MNT) >> 12) * 10) + ((RTC->TR & RTC_TR_MNU) >> 8); time->tm_sec = (((RTC->TR & RTC_TR_ST) >> 4) * 10) + ((RTC->TR & RTC_TR_SU) >> 0); return 0; } int rtc_set_alarm(struct tm *time, rtc_alarm_cb_t cb, void *arg) { /* Enable write access to RTC registers */ periph_clk_en(APB1, RCC_APB1ENR_PWREN); PWR->CR |= PWR_CR_DBP; /* Unlock RTC write protection */ RTC->WPR = <API key>; RTC->WPR = <API key>; /* Enter RTC Init mode */ RTC->ISR |= RTC_ISR_INIT; while ((RTC->ISR & RTC_ISR_INITF) == 0) {} RTC->CR &= ~(RTC_CR_ALRAE); while ((RTC->ISR & RTC_ISR_ALRAWF) == 0) {} RTC->ALRMAR &= ~(RTC_ALRMAR_MSK1 | RTC_ALRMAR_MSK2 | RTC_ALRMAR_MSK3 | RTC_ALRMAR_MSK4); RTC->ALRMAR = ( (((uint32_t)byte2bcd(time->tm_mday) << 24) & (RTC_ALRMAR_DT | RTC_ALRMAR_DU) ) | (((uint32_t)byte2bcd(time->tm_hour) << 16) & (RTC_ALRMAR_HT | RTC_ALRMAR_HU) ) | (((uint32_t)byte2bcd(time->tm_min) << 8) & (RTC_ALRMAR_MNT| RTC_ALRMAR_MNU)) | (((uint32_t)byte2bcd(time->tm_sec) << 0) & (RTC_ALRMAR_ST | RTC_ALRMAR_SU) ) ); /* Enable Alarm A */ RTC->CR |= RTC_CR_ALRAE; RTC->CR |= RTC_CR_ALRAIE; RTC->ISR &= ~(RTC_ISR_ALRAF); /* Exit RTC init mode */ RTC->ISR &= (uint32_t)~RTC_ISR_INIT; /* Enable RTC write protection */ RTC->WPR = 0xFF; EXTI->IMR |= EXTI_IMR_MR17; EXTI->RTSR |= EXTI_RTSR_TR17; NVIC_SetPriority(RTC_IRQn, 10); NVIC_EnableIRQ(RTC_IRQn); rtc_callback.cb = cb; rtc_callback.arg = arg; return 0; } int rtc_get_alarm(struct tm *time) { time->tm_year = MCU_YEAR_OFFSET; time->tm_year +=(((RTC->DR & RTC_DR_YT) >> 20) * 10) + ((RTC->DR & RTC_DR_YU) >> 16); time->tm_mon = (((RTC->DR & RTC_DR_MT) >> 12) * 10) + ((RTC->DR & RTC_DR_MU) >> 8) - 1; time->tm_mday = (((RTC->ALRMAR & RTC_ALRMAR_DT) >> 28) * 10) + ((RTC->ALRMAR & RTC_ALRMAR_DU) >> 24); time->tm_hour = (((RTC->ALRMAR & RTC_ALRMAR_HT) >> 20) * 10) + ((RTC->ALRMAR & RTC_ALRMAR_HU) >> 16); if ( (RTC->ALRMAR & RTC_ALRMAR_PM) && (RTC->CR & RTC_CR_FMT) ) time->tm_hour += 12; time->tm_min = (((RTC->ALRMAR & RTC_ALRMAR_MNT) >> 12) * 10) + ((RTC->ALRMAR & RTC_ALRMAR_MNU) >> 8); time->tm_sec = (((RTC->ALRMAR & RTC_ALRMAR_ST) >> 4) * 10) + ((RTC->ALRMAR & RTC_ALRMAR_SU) >> 0); return 0; } void rtc_clear_alarm(void) { /* Disable Alarm A */ RTC->CR &= RTC_CR_ALRAE; RTC->CR &= RTC_CR_ALRAIE; rtc_callback.cb = NULL; rtc_callback.arg = NULL; } void rtc_poweron(void) { /* RTC on STM32F0 is online even on sleep modes. No need to power on. */ } void rtc_poweroff(void) { /* Enable write access to RTC registers */ periph_clk_en(APB1, RCC_APB1ENR_PWREN); PWR->CR |= PWR_CR_DBP; /* Reset RTC domain */ RCC->BDCR |= RCC_BDCR_BDRST; RCC->BDCR &= ~(RCC_BDCR_BDRST); /* Disable the RTC */ RCC->BDCR &= ~RCC_BDCR_RTCEN; /* Disable LSE clock */ RCC->BDCR &= ~(RCC_BDCR_LSEON); } void isr_rtc(void) { if ((RTC->ISR & RTC_ISR_ALRAF) && (rtc_callback.cb != NULL)) { rtc_callback.cb(rtc_callback.arg); RTC->ISR &= ~RTC_ISR_ALRAF; } cortexm_isr_end(); } /** * Convert a number from unsigned to BCD * * @param[in] value to be converted * @return BCD representation of the value */ static uint8_t byte2bcd(uint8_t value) { uint8_t bcdhigh = 0; while (value >= 10) { bcdhigh++; value -= 10; } return ((uint8_t)(bcdhigh << 4) | value); } #endif /* RTC_NUMOF */
my $repo = "https://qgvdial.googlecode.com/svn/trunk"; my $s_make = "make.exe"; my $cmd; my $dest; my ($sec,$min,$hour,$day,$month,$yr19,@rest) = localtime(time); $yr19 += 1900; $month++; my $suffix = sprintf("%04d%02d%02d", $yr19, $month, $day); $dest = sprintf("J:/releases/qgvdial/%04d-%02d-%02d", $yr19, $month, $day); if ((!(-e $dest)) or (!(-d $dest))) { $cmd = "powershell mkdir $dest"; print("$cmd\n"); system($cmd); } # Get the latest version file from the repository $cmd = "del ver.cfg & svn export $repo/build-files/ver.cfg"; system($cmd); # Pull out the version from the file open(QVARFILE, "ver.cfg") or die; my $qver = <QVARFILE>; close QVARFILE; chomp $qver; # Get the subversion checkin version system("svn log $repo --limit=1 | grep \"^r\" > svnlog.txt"); open(QVARFILE, "svnlog.txt") or die; my $svnver = <QVARFILE>; close QVARFILE; unlink "svnlog.txt"; # Parse out the version number from the output we pulled out $svnver =~ m/^r(\d+)*/; $svnver = $1; # Create the version suffix $qver = "$qver.$svnver"; system("powershell Remove-Item -Recurse -Force qgvdial-*"); $cmd = "svn export $repo qgvdial-$qver"; print("$cmd\n"); system($cmd); # Append the version to the pro file open(PRO_FILE, ">>qgvdial-$qver/qgvdial/symbian/symbian.pro") || die "Cannot open pro file"; print PRO_FILE "VERSION=__QGVDIAL_VERSION__\n"; close PRO_FILE; # Version replacement $cmd = "cd qgvdial-$qver & perl ./build-files/version.pl __QGVDIAL_VERSION__ $qver"; print("$cmd\n"); system($cmd); # Cipher replacement open my $qgvcipfile, '<', "../cipher_qgvdial"; my $cipher = <$qgvcipfile>; close $qgvcipfile; chomp $cipher; $cmd = "perl qgvdial-$qver/build-files/version.pl <API key> \"$cipher\" qgvdial-$qver"; print "$cmd\n"; system($cmd); # Mixpanel replacement open my $mixpanel_token_file, '<', "../mixpanel.token"; my $mixpanel_token = <$mixpanel_token_file>; close $mixpanel_token_file; chomp $mixpanel_token; $cmd = "perl qgvdial-$qver/build-files/version.pl <API key> '$mixpanel_token' $basedir"; print "$cmd\n"; system($cmd); # Copy the client secret file to the api directory $cmd = "powershell cp ../client_<API key>.apps.googleusercontent.com.json qgvdial-$qver/api"; print "$cmd\n"; system($cmd); # Mosquitto is merged straight into the build $cmd = "cd qgvdial-$qver/qgvdial/symbian & prep_s3.bat"; print "$cmd\n"; system($cmd); # Symbian 3 (to including Belle) should not have qt-components $cmd = "cd qgvdial-$qver/src & echo something>no-qt-components"; print "$cmd\n"; system($cmd); # This is the way to enter a directory and setup the remainder variables my $enterdir = "cd qgvdial-$qver/qgvdial/symbian & set BUILDDIR=%CD% & set SOURCEDIR=%CD%"; # qmake, make release-gcce, make installer_sis $cmd = "$enterdir & qmake.exe symbian.pro -r -spec symbian-sbsv2 CONFIG+=release -after OBJECTS_DIR=obj MOC_DIR=moc UI_DIR=ui RCC_DIR=rcc & $s_make release-gcce -w & $s_make installer_sis -w QT_SIS_CERTIFICATE=%QGV_CERT% QT_SIS_KEY=%QGV_KEY%"; print("$cmd\n"); system($cmd); $cmd = "$enterdir & signsis.exe -u qgvdial.sis unsigned_qgvdial.sis"; print("$cmd\n"); system($cmd); # Copy the sis files to the outer directory $cmd = "$enterdir & powershell cp qgvdial.sis $dest/qgvdial_s3_$qver.sis & powershell cp unsigned_qgvdial.sis $dest/<API key>$qver.sis & powershell cp qgvdial_installer.sis $dest/<API key>$qver.sis"; print("$cmd\n"); system($cmd);
#include "cvssettings.h" #include <utils/environment.h> #include <utils/hostosinfo.h> #include <QSettings> #include <QTextStream> static const char groupC[] = "CVS"; static const char commandKeyC[] = "Command"; static const char rootC[] = "Root"; static const char promptToSubmitKeyC[] = "PromptForSubmit"; static const char diffOptionsKeyC[] = "DiffOptions"; static const char <API key>[] = "DescribeByCommitId"; static const char defaultDiffOptions[] = "-du"; static const char timeOutKeyC[] = "TimeOut"; enum { defaultTimeOutS = 30 }; static QString defaultCommand() { return QLatin1String("cvs" QTC_HOST_EXE_SUFFIX); } namespace Cvs { namespace Internal { CvsSettings::CvsSettings() : cvsCommand(defaultCommand()), cvsDiffOptions(QLatin1String(defaultDiffOptions)), timeOutS(defaultTimeOutS), promptToSubmit(true), describeByCommitId(true) { } void CvsSettings::fromSettings(QSettings *settings) { settings->beginGroup(QLatin1String(groupC)); cvsCommand = settings->value(QLatin1String(commandKeyC), defaultCommand()).toString(); cvsBinaryPath = Utils::Environment::systemEnvironment().searchInPath(cvsCommand); promptToSubmit = settings->value(QLatin1String(promptToSubmitKeyC), true).toBool(); cvsRoot = settings->value(QLatin1String(rootC), QString()).toString(); cvsDiffOptions = settings->value(QLatin1String(diffOptionsKeyC), QLatin1String(defaultDiffOptions)).toString(); describeByCommitId = settings->value(QLatin1String(<API key>), true).toBool(); timeOutS = settings->value(QLatin1String(timeOutKeyC), defaultTimeOutS).toInt(); settings->endGroup(); } void CvsSettings::toSettings(QSettings *settings) const { settings->beginGroup(QLatin1String(groupC)); settings->setValue(QLatin1String(commandKeyC), cvsCommand); settings->setValue(QLatin1String(promptToSubmitKeyC), promptToSubmit); settings->setValue(QLatin1String(rootC), cvsRoot); settings->setValue(QLatin1String(diffOptionsKeyC), cvsDiffOptions); settings->setValue(QLatin1String(timeOutKeyC), timeOutS); settings->setValue(QLatin1String(<API key>), describeByCommitId); settings->endGroup(); } bool CvsSettings::equals(const CvsSettings &s) const { return promptToSubmit == s.promptToSubmit && describeByCommitId == s.describeByCommitId && cvsCommand == s.cvsCommand && cvsRoot == s.cvsRoot && timeOutS == s.timeOutS && cvsDiffOptions == s.cvsDiffOptions; } QStringList CvsSettings::addOptions(const QStringList &args) const { if (cvsRoot.isEmpty()) return args; QStringList rc; rc.push_back(QLatin1String("-d")); rc.push_back(cvsRoot); rc.append(args); return rc; } } // namespace Internal } // namespace Cvs
/* MOOSE - Multiphysics Object Oriented Simulation Environment */ #include "<API key>.h" // MOOSE includes #include "MooseVariable.h" template <> InputParameters validParams<<API key>>() { InputParameters params = validParams<TimeKernel>(); params.addParam<bool>("<API key>", false, "When calculating nodal porosity that depends on strain, use the strain at " "the nearest quadpoint. This adds a small extra computational burden, and " "is not necessary for simulations involving only linear lagrange elements. " " If you set this to true, you will also want to set the same parameter to " "true for related Kernels and Materials"); params.addRequiredParam<UserObjectName>( "PorousFlowDictator", "The UserObject that holds the list of Porous-Flow variable names."); params.addClassDescription("Derivative of heat-energy-density wrt time"); return params; } <API key>::<API key>(const InputParameters & parameters) : TimeKernel(parameters), _dictator(getUserObject<PorousFlowDictator>("PorousFlowDictator")), _var_is_porflow_var(_dictator.<API key>(_var.number())), _num_phases(_dictator.numPhases()), _fluid_present(_num_phases > 0), <API key>(getParam<bool>("<API key>")), _porosity(getMaterialProperty<Real>("<API key>")), _porosity_old(<API key><Real>("<API key>")), _dporosity_dvar(getMaterialProperty<std::vector<Real>>("<API key>")), _dporosity_dgradvar( getMaterialProperty<std::vector<RealGradient>>("<API key>")), _nearest_qp(<API key> ? &getMaterialProperty<unsigned int>("<API key>") : nullptr), _rock_energy_nodal(getMaterialProperty<Real>("<API key>")), <API key>(<API key><Real>("<API key>")), <API key>( getMaterialProperty<std::vector<Real>>("<API key>")), _fluid_density( _fluid_present ? &getMaterialProperty<std::vector<Real>>("<API key>") : nullptr), _fluid_density_old( _fluid_present ? &<API key><std::vector<Real>>("<API key>") : nullptr), <API key>(_fluid_present ? &getMaterialProperty<std::vector<std::vector<Real>>>( "<API key>") : nullptr), <API key>( _fluid_present ? &getMaterialProperty<std::vector<Real>>("<API key>") : nullptr), <API key>( _fluid_present ? &<API key><std::vector<Real>>("<API key>") : nullptr), <API key>(_fluid_present ? &getMaterialProperty<std::vector<std::vector<Real>>>( "<API key>") : nullptr), _energy_nodal(_fluid_present ? &getMaterialProperty<std::vector<Real>>( "<API key>") : nullptr), _energy_nodal_old(_fluid_present ? &<API key><std::vector<Real>>( "<API key>") : nullptr), _denergy_nodal_dvar(_fluid_present ? &getMaterialProperty<std::vector<std::vector<Real>>>( "<API key>") : nullptr) { } Real <API key>::computeQpResidual() { Real energy = (1.0 - _porosity[_i]) * _rock_energy_nodal[_i]; Real energy_old = (1.0 - _porosity_old[_i]) * <API key>[_i]; for (unsigned ph = 0; ph < _num_phases; ++ph) { energy += (*_fluid_density)[_i][ph] * (*<API key>)[_i][ph] * (*_energy_nodal)[_i][ph] * _porosity[_i]; energy_old += (*_fluid_density_old)[_i][ph] * (*<API key>)[_i][ph] * (*_energy_nodal_old)[_i][ph] * _porosity_old[_i]; } return _test[_i][_qp] * (energy - energy_old) / _dt; } Real <API key>::computeQpJacobian() { If the variable is not a PorousFlow variable (very unusual), the diag Jacobian terms are 0 if (!_var_is_porflow_var) return 0.0; return computeQpJac(_dictator.<API key>(_var.number())); } Real <API key>::<API key>(unsigned int jvar) { If the variable is not a PorousFlow variable, the OffDiag Jacobian terms are 0 if (_dictator.<API key>(jvar)) return 0.0; return computeQpJac(_dictator.<API key>(jvar)); } Real <API key>::computeQpJac(unsigned int pvar) const { const unsigned nearest_qp = (<API key> ? (*_nearest_qp)[_i] : _i); // porosity is dependent on variables that are lumped to the nodes, // but it can depend on the gradient // of variables, which are NOT lumped to the nodes, hence: Real denergy = -_dporosity_dgradvar[_i][pvar] * _grad_phi[_j][_i] * _rock_energy_nodal[_i]; for (unsigned ph = 0; ph < _num_phases; ++ph) denergy += (*_fluid_density)[_i][ph] * (*<API key>)[_i][ph] * (*_energy_nodal)[_i][ph] * _dporosity_dgradvar[_i][pvar] * _grad_phi[_j][nearest_qp]; if (_i != _j) return _test[_i][_qp] * denergy / _dt; As the fluid energy is lumped to the nodes, only non-zero terms are for _i==_j denergy += -_dporosity_dvar[_i][pvar] * _rock_energy_nodal[_i]; denergy += (1.0 - _porosity[_i]) * <API key>[_i][pvar]; for (unsigned ph = 0; ph < _num_phases; ++ph) { denergy += (*<API key>)[_i][ph][pvar] * (*<API key>)[_i][ph] * (*_energy_nodal)[_i][ph] * _porosity[_i]; denergy += (*_fluid_density)[_i][ph] * (*<API key>)[_i][ph][pvar] * (*_energy_nodal)[_i][ph] * _porosity[_i]; denergy += (*_fluid_density)[_i][ph] * (*<API key>)[_i][ph] * (*_denergy_nodal_dvar)[_i][ph][pvar] * _porosity[_i]; denergy += (*_fluid_density)[_i][ph] * (*<API key>)[_i][ph] * (*_energy_nodal)[_i][ph] * _dporosity_dvar[_i][pvar]; } return _test[_i][_qp] * denergy / _dt; }
<?php class <API key> extends lmbMacroTestCase { function testOnceRender() { $root = lmb_env_get('LIMB_VAR_DIR').'/www/'; lmb_env_set('LIMB_DOCUMENT_ROOT', $root); lmbFs :: safeWrite($root . 'style/main.css', 'body {background-url: url("../images/one.jpg");}'); lmbFs :: safeWrite($root . 'images/one.jpg', 'simple content'); $template = '{{css_compiled src="style/main.css" dir="media/css" /}}'; $page = $this-><API key>($template, 'tpl.html'); $content = $page->render(); $src = $this->toolkit->addVersionToUrl('media/css/style-main.css'); $this->assertEqual('<link rel="stylesheet" type="text/css" href="'.$src.'" />', $content); $compiled_file = $root . 'media/css/style-main.css'; $src = $this->toolkit->addVersionToUrl('images/one.jpg'); $this->assertEqual('body {background-url: url('.$src.');}', file_get_contents($compiled_file)); } }
#ifndef <API key> #define <API key> #include <QAbstractItemModel> namespace ProjectExplorer { class Target; class BuildConfiguration; // Documentation inside. class <API key> : public QAbstractListModel { Q_OBJECT public: explicit <API key>(Target *target, QObject *parent = 0); int rowCount(const QModelIndex &parent = QModelIndex()) const; int columnCount(const QModelIndex &parent = QModelIndex()) const; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; BuildConfiguration *<API key>(int i); BuildConfiguration *<API key>(const QModelIndex &idx); QModelIndex indexFor(BuildConfiguration *rc); private slots: void <API key>(ProjectExplorer::BuildConfiguration*); void <API key>(ProjectExplorer::BuildConfiguration*); void displayNameChanged(); private: Target *m_target; QList<BuildConfiguration *> <API key>; }; } #endif // <API key>
package org.pentaho.agilebi.modeler.util; import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertNotNull; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.junit.Test; import org.pentaho.agilebi.modeler.AbstractModelerTest; import org.pentaho.agilebi.modeler.<API key>; import org.pentaho.agilebi.modeler.<API key>; import org.pentaho.agilebi.modeler.models.JoinFieldModel; import org.pentaho.agilebi.modeler.models.<API key>; import org.pentaho.agilebi.modeler.models.JoinTableModel; import org.pentaho.agilebi.modeler.models.SchemaModel; import org.pentaho.di.core.KettleEnvironment; import org.pentaho.di.core.Props; import org.pentaho.di.core.database.DatabaseMeta; import org.pentaho.metadata.model.Domain; import org.pentaho.metadata.model.LogicalModel; import org.pentaho.metadata.model.LogicalRelationship; import org.pentaho.metadata.model.olap.OlapCube; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class <API key> extends AbstractModelerTest { private static Logger logger = LoggerFactory.getLogger( <API key>.class ); static { try { KettleEnvironment.init(); Props.init( Props.<API key> ); } catch ( Exception e ) { // May be already initialized by another test } if ( <API key>.getMessages() == null ) { <API key>.setMessages( new <API key>() ); } } @Test public void testStarSchema() throws Exception { <API key> multiTable = new <API key>( this.getDatabase(), getSchemaModel1( true ), this.getDatabase().getName(), Arrays.asList( "CUSTOMERS", "PRODUCTS", "CUSTOMERNAME", "PRODUCTCODE" ) ); Domain domain = multiTable.generateDomain( true ); assertNotNull( domain ); LogicalModel olapModel = domain.getLogicalModels().get( 1 ); List<OlapCube> cubes = (List) olapModel.getProperty( "olap_cubes" ); OlapCube cube = cubes.get( 0 ); // Ensure cube has a fact table. assertNotNull( cube.getLogicalTable() ); // Ensure we have logical relationships (joins). assertEquals( true, olapModel.<API key>().size() > 0 ); // Ensure all joins use Olap tables. LogicalRelationship logicalRelationship = olapModel.<API key>().get( 0 ); assertEquals( true, logicalRelationship.getToTable().getId().endsWith( <API key>.OLAP_SUFFIX ) ); assertEquals( true, logicalRelationship.getFromTable().getId().endsWith( <API key>.OLAP_SUFFIX ) ); } @Test public void testReportingSchema() throws Exception { <API key> multiTable = new <API key>( this.getDatabase(), getSchemaModel1( false ), this.getDatabase().getName(), Arrays.asList( "CUSTOMERS", "PRODUCTS", "CUSTOMERNAME", "PRODUCTCODE" ) ); Domain domain = multiTable.generateDomain( false ); // Ensure domain was created. assertNotNull( domain ); // Ensure we have logical relationships (joins). assertEquals( true, domain.getLogicalModels().get( 0 ).<API key>().size() > 0 ); // Ensure all joins DO NOT use Olap tables. for ( LogicalRelationship logicalRelationship : domain.getLogicalModels().get( 0 ).<API key>() ) { assertEquals( true, !logicalRelationship.getToTable().getId().endsWith( <API key>.OLAP_SUFFIX ) ); assertEquals( true, !logicalRelationship.getFromTable().getId().endsWith( <API key>.OLAP_SUFFIX ) ); } } public static SchemaModel getSchemaModel1() { return getSchemaModel1( true ); } public static SchemaModel getSchemaModel1( boolean doOlap ) { List<<API key>> joins = new ArrayList<<API key>>(); JoinTableModel joinTable1 = new JoinTableModel(); joinTable1.setName( "ORDERFACT" ); JoinTableModel joinTable2 = new JoinTableModel(); joinTable2.setName( "CUSTOMERS" ); <API key> join1 = new <API key>(); JoinFieldModel lField1 = new JoinFieldModel(); lField1.setName( "CUSTOMERNUMBER" ); lField1.setParentTable( joinTable1 ); join1.<API key>( lField1 ); JoinFieldModel rField1 = new JoinFieldModel(); rField1.setName( "CUSTOMERNUMBER" ); rField1.setParentTable( joinTable2 ); join1.<API key>( rField1 ); joins.add( join1 ); SchemaModel model = new SchemaModel(); model.setJoins( joins ); if ( doOlap ) { model.setFactTable( joinTable1 ); } return model; } private DatabaseMeta getDatabase() { DatabaseMeta database = new DatabaseMeta(); database.setDatabaseType( "Hypersonic" ); database.setAccessType( DatabaseMeta.TYPE_ACCESS_JNDI ); database.setDBName( "SampleData" ); database.setName( "SampleData" ); return database; } }
#ifndef <API key> #define <API key> #include <websocketpp/common/thread.hpp> namespace websocketpp { namespace concurrency { Concurrency policy that uses std::mutex / boost::mutex class basic { public: typedef lib::mutex mutex_type; typedef lib::lock_guard<mutex_type> scoped_lock_type; }; } // namespace concurrency } // namespace websocketpp #endif // <API key>
// JSROOTIO.core.js // core methods for Javascript ROOT IO. var kBase = 0, kOffsetL = 20, kOffsetP = 40, kCounter = 6, kCharStar = 7, kChar = 1, kShort = 2, kInt = 3, kLong = 4, kFloat = 5, kDouble = 8, kDouble32 = 9, kLegacyChar = 10, kUChar = 11, kUShort = 12, kUInt = 13, kULong = 14, kBits = 15, kLong64 = 16, kULong64 = 17, kBool = 18, kFloat16 = 19, kObject = 61, kAny = 62, kObjectp = 63, kObjectP = 64, kTString = 65, kTObject = 66, kTNamed = 67, kAnyp = 68, kAnyP = 69, kAnyPnoVT = 70, kSTLp = 71, kSkip = 100, kSkipL = 120, kSkipP = 140, kConv = 200, kConvL = 220, kConvP = 240, kSTL = 300, kSTLstring = 365, kStreamer = 500, kStreamLoop = 501; var kMapOffset = 2; var kByteCountMask = 0x40000000; var kNewClassTag = 0xFFFFFFFF; var kClassMask = 0x80000000; (function(){ if (typeof JSROOTIO == "object"){ var e1 = new Error("JSROOTIO is already defined"); e1.source = "JSRootIOEvolution.js"; throw e1; } var Z_DEFLATED = 8; var HDRSIZE = 9; var kByteCountMask = 0x40000000; JSROOTIO = {}; JSROOTIO.version = "2.9 2014/05/12"; JSROOTIO.debug = false; JSROOTIO.fUserStreamers = null; // map of user-streamer function like func(buf,obj,prop,streamerinfo) JSROOTIO.addUserStreamer = function(type, user_streamer) { if (this.fUserStreamers == null) this.fUserStreamers = {}; this.fUserStreamers[type] = user_streamer; } JSROOTIO.BIT = function(bits, index) { var mask = 1 << index; return (bits & mask); }; JSROOTIO.R__unzip_header = function(str, off, noalert) { // Reads header envelope, and determines target size. if (off + HDRSIZE > str.length) { if (!noalert) alert("Error R__unzip_header: header size exceeds buffer size"); return -1; } /* C H E C K H E A D E R */ if (!(str.charAt(off) == 'Z' && str.charAt(off+1) == 'L' && str.charCodeAt(off+2) == Z_DEFLATED) && !(str.charAt(off) == 'C' && str.charAt(off+1) == 'S' && str.charCodeAt(off+2) == Z_DEFLATED) && !(str.charAt(off) == 'X' && str.charAt(off+1) == 'Z' && str.charCodeAt(off+2) == 0)) { if (!noalert) alert("Error R__unzip_header: error in header"); return -1; } return HDRSIZE + ((str.charCodeAt(off+3) & 0xff) | ((str.charCodeAt(off+4) & 0xff) << 8) | ((str.charCodeAt(off+5) & 0xff) << 16)); }; JSROOTIO.R__unzip = function(srcsize, str, off, noalert) { /* C H E C K H E A D E R */ if (srcsize < HDRSIZE) { if (!noalert) alert("R__unzip: too small source"); return null; } /* C H E C K H E A D E R */ if (!(str.charAt(off) == 'Z' && str.charAt(off+1) == 'L' && str.charCodeAt(off+2) == Z_DEFLATED) && !(str.charAt(off) == 'C' && str.charAt(off+1) == 'S' && str.charCodeAt(off+2) == Z_DEFLATED) && !(str.charAt(off) == 'X' && str.charAt(off+1) == 'Z' && str.charCodeAt(off+2) == 0)) { if (!noalert) alert("Error R__unzip: error in header"); return null; } var ibufcnt = ((str.charCodeAt(off+3) & 0xff) | ((str.charCodeAt(off+4) & 0xff) << 8) | ((str.charCodeAt(off+5) & 0xff) << 16)); if (ibufcnt + HDRSIZE != srcsize) { if (!noalert) alert("R__unzip: discrepancy in source length"); return null; } /* D E C O M P R E S S D A T A */ if (str.charAt(off) == 'Z' && str.charAt(off+1) == 'L') { /* New zlib format */ var data = str.substr(off + HDRSIZE + 2, srcsize); return RawInflate.inflate(data); } /* Old zlib format */ else { if (!noalert) alert("R__unzip: Old zlib format is not supported!"); return null; } return null; }; JSROOTIO.Print = function(str, what) { what = typeof(what) === 'undefined' ? 'info' : what; if ( (window['console'] !== undefined) ) { if (console[what] !== undefined) console[what](str + '\n'); } }; })(); JSROOTIO.core.js ends // JSROOTIO.TBuffer (function(){ JSROOTIO.TBuffer = function(_str, _o, _file) { if (! (this instanceof arguments.callee) ) { var error = new Error("you must use new to instantiate this class"); error.source = "JSROOTIO.TBuffer.ctor"; throw error; } JSROOTIO.TBuffer.prototype.locate = function(pos) { this.o = pos; } JSROOTIO.TBuffer.prototype.shift = function(cnt) { this.o += cnt; } JSROOTIO.TBuffer.prototype.ntou1 = function() { return (this.b.charCodeAt(this.o++) & 0xff) >>> 0; } JSROOTIO.TBuffer.prototype.ntou2 = function() { // convert (read) two bytes of buffer b into a UShort_t var n = ((this.b.charCodeAt(this.o) & 0xff) << 8) >>> 0; n += (this.b.charCodeAt(this.o+1) & 0xff) >>> 0; this.o += 2; return n; }; JSROOTIO.TBuffer.prototype.ntou4 = function() { // convert (read) four bytes of buffer b into a UInt_t var n = ((this.b.charCodeAt(this.o) & 0xff) << 24) >>> 0; n += ((this.b.charCodeAt(this.o+1) & 0xff) << 16) >>> 0; n += ((this.b.charCodeAt(this.o+2) & 0xff) << 8) >>> 0; n += (this.b.charCodeAt(this.o+3) & 0xff) >>> 0; this.o += 4; return n; }; JSROOTIO.TBuffer.prototype.ntou8 = function() { // convert (read) eight bytes of buffer b into a ULong_t var n = ((this.b.charCodeAt(this.o) & 0xff) << 56) >>> 0; n += ((this.b.charCodeAt(this.o+1) & 0xff) << 48) >>> 0; n += ((this.b.charCodeAt(this.o+2) & 0xff) << 40) >>> 0; n += ((this.b.charCodeAt(this.o+3) & 0xff) << 32) >>> 0; n += ((this.b.charCodeAt(this.o+4) & 0xff) << 24) >>> 0; n += ((this.b.charCodeAt(this.o+5) & 0xff) << 16) >>> 0; n += ((this.b.charCodeAt(this.o+6) & 0xff) << 8) >>> 0; n += (this.b.charCodeAt(this.o+7) & 0xff) >>> 0; this.op += 8; return n; }; JSROOTIO.TBuffer.prototype.ntoi1 = function() { return (this.b.charCodeAt(this.o++) & 0xff); } JSROOTIO.TBuffer.prototype.ntoi2 = function() { // convert (read) two bytes of buffer b into a Short_t var n = (this.b.charCodeAt(this.o) & 0xff) << 8; n += (this.b.charCodeAt(this.o+1) & 0xff); this.o += 2; return n; }; JSROOTIO.TBuffer.prototype.ntoi4 = function() { // convert (read) four bytes of buffer b into a Int_t var n = (this.b.charCodeAt(this.o) & 0xff) << 24; n += (this.b.charCodeAt(this.o+1) & 0xff) << 16; n += (this.b.charCodeAt(this.o+2) & 0xff) << 8; n += (this.b.charCodeAt(this.o+3) & 0xff); this.o += 4; return n; }; JSROOTIO.TBuffer.prototype.ntoi8 = function(b, o) { // convert (read) eight bytes of buffer b into a Long_t var n = (this.b.charCodeAt(this.o) & 0xff) << 56; n += (this.b.charCodeAt(this.o+1) & 0xff) << 48; n += (this.b.charCodeAt(this.o+2) & 0xff) << 40; n += (this.b.charCodeAt(this.o+3) & 0xff) << 32; n += (this.b.charCodeAt(this.o+4) & 0xff) << 24; n += (this.b.charCodeAt(this.o+5) & 0xff) << 16; n += (this.b.charCodeAt(this.o+6) & 0xff) << 8; n += (this.b.charCodeAt(this.o+7) & 0xff); this.o += 8; return n; }; JSROOTIO.TBuffer.prototype.ntof = function() { // IEEE-754 Floating-Point Conversion (single precision - 32 bits) var inString = this.b.substring(this.o, this.o + 4); this.o+=4; if (inString.length < 4) return Number.NaN; var bits = ""; for (var i=0; i<4; i++) { var curByte = (inString.charCodeAt(i) & 0xff).toString(2); var byteLen = curByte.length; if (byteLen < 8) { for (var bit=0; bit<(8-byteLen); bit++) curByte = '0' + curByte; } bits = bits + curByte; } //var bsign = parseInt(bits[0]) ? -1 : 1; var bsign = (bits.charAt(0) == '1') ? -1 : 1; var bexp = parseInt(bits.substring(1, 9), 2) - 127; var bman; if (bexp == -127) bman = 0; else { bman = 1; for (i=0; i<23; i++) { if (parseInt(bits.substr(9+i, 1)) == 1) bman = bman + 1 / Math.pow(2, i+1); } } return (bsign * Math.pow(2, bexp) * bman); }; JSROOTIO.TBuffer.prototype.ntod = function() { // IEEE-754 Floating-Point Conversion (double precision - 64 bits) var inString = this.b.substring(this.o, this.o + 8); this.o+=8; if (inString.length < 8) return Number.NaN; var bits = ""; for (var i=0; i<8; i++) { var curByte = (inString.charCodeAt(i) & 0xff).toString(2); var byteLen = curByte.length; if (byteLen < 8) { for (var bit=0; bit<(8-byteLen); bit++) curByte = '0' + curByte; } bits = bits + curByte; } //var bsign = parseInt(bits[0]) ? -1 : 1; var bsign = (bits.charAt(0) == '1') ? -1 : 1; var bexp = parseInt(bits.substring(1, 12), 2) - 1023; var bman; if (bexp == -127) bman = 0; else { bman = 1; for (i=0; i<52; i++) { if (parseInt(bits.substr(12+i, 1)) == 1) bman = bman + 1 / Math.pow(2, i+1); } } return (bsign * Math.pow(2, bexp) * bman); }; JSROOTIO.TBuffer.prototype.ReadFastArray = function(n, array_type) { // read array of n integers from the I/O buffer var array = new Array(); switch (array_type) { case 'D': for (var i = 0; i < n; ++i) { array[i] = this.ntod(); if (Math.abs(array[i]) < 1e-300) array[i] = 0.0; } break; case 'F': for (var i = 0; i < n; ++i) { array[i] = this.ntof(); if (Math.abs(array[i]) < 1e-300) array[i] = 0.0; } break; case 'L': for (var i = 0; i < n; ++i) array[i] = this.ntoi8(); break; case 'LU': for (var i = 0; i < n; ++i) array[i] = this.ntou8(); break; case 'I': for (var i = 0; i < n; ++i) array[i] = this.ntoi4(); break; case 'U': for (var i = 0; i < n; ++i) array[i] = this.ntou4(); break; case 'S': for (var i = 0; i < n; ++i) array[i] = this.ntoi2(); break; case 'C': for (var i = 0; i < n; ++i) array[i] = this.b.charCodeAt(this.o++) & 0xff; break; case 'TString': for (var i = 0; i < n; ++i) array[i] = this.ReadTString(); break; default: for (var i = 0; i < n; ++i) array[i] = this.ntou4(); break; } return array; }; JSROOTIO.TBuffer.prototype.ReadBasicPointer = function(len, array_type) { var isArray = this.b.charCodeAt(this.o++) & 0xff; if (isArray) return this.ReadFastArray(len, array_type); if (len==0) return new Array(); this.o return this.ReadFastArray(len, array_type); }; JSROOTIO.TBuffer.prototype.ReadString = function(max_len) { // stream a string from buffer max_len = typeof(max_len) != 'undefined' ? max_len : 0; var len = 0; var pos0 = this.o; while ((max_len==0) || (len<max_len)) { if ((this.b.charCodeAt(this.o++) & 0xff) == 0) break; len++; } return (len == 0) ? "" : this.b.substring(pos0, pos0 + len); }; JSROOTIO.TBuffer.prototype.ReadTString = function() { // stream a TString object from buffer var len = this.b.charCodeAt(this.o++) & 0xff; // large strings if (len == 255) len = this.ntou4(); var pos = this.o; this.o += len; return (this.b.charCodeAt(pos) == 0) ? '' : this.b.substring(pos, pos + len); }; JSROOTIO.TBuffer.prototype.GetMappedObject = function(tag) { return this.fObjectMap[tag]; }; JSROOTIO.TBuffer.prototype.MapObject = function(tag, obj) { if (obj==null) return; this.fObjectMap[tag] = obj; }; JSROOTIO.TBuffer.prototype.MapClass = function(tag, classname) { this.fClassMap[tag] = classname; }; JSROOTIO.TBuffer.prototype.GetMappedClass = function(tag) { if (tag in this.fClassMap) return this.fClassMap[tag]; return -1; }; JSROOTIO.TBuffer.prototype.ClearObjectMap = function() { this.fObjectMap = {}; this.fClassMap = {}; this.fObjectMap[0] = null; }; JSROOTIO.TBuffer.prototype.ReadVersion = function() { // read class version from I/O buffer var version = {}; var bytecnt = this.ntou4(); // byte count if (bytecnt & kByteCountMask) version['bytecnt'] = bytecnt - kByteCountMask - 2; // one can check between Read version and end of streamer version['val'] = this.ntou2(); version['off'] = this.o; return version; }; JSROOTIO.TBuffer.prototype.CheckBytecount = function(ver, where) { if (('bytecnt' in ver) && (ver['off'] + ver['bytecnt'] != this.o)) { if (where!=null) alert("Missmatch in " + where + " bytecount expected = " + ver['bytecnt'] + " got = " + (this.o-ver['off'])); this.o = ver['off'] + ver['bytecnt']; return false; } return true; } JSROOTIO.TBuffer.prototype.ReadTObject = function(tobj) { this.o += 2; // skip version if ((!'_typename' in tobj) || (tobj['_typename'] == '')) tobj['_typename'] = "JSROOTIO.TObject"; tobj['fUniqueID'] = this.ntou4(); tobj['fBits'] = this.ntou4(); return true; } JSROOTIO.TBuffer.prototype.ReadTNamed = function(tobj) { // read a TNamed class definition from I/O buffer var ver = this.ReadVersion(); this.ReadTObject(tobj); tobj['fName'] = this.ReadTString(); tobj['fTitle'] = this.ReadTString(); return this.CheckBytecount(ver, "ReadTNamed"); }; JSROOTIO.TBuffer.prototype.ReadTObjString = function(tobj) { // read a TObjString definition from I/O buffer var ver = this.ReadVersion(); this.ReadTObject(tobj); tobj['fString'] = this.ReadTString(); return this.CheckBytecount(ver, "ReadTObjString"); }; JSROOTIO.TBuffer.prototype.ReadTList = function(list) { // stream all objects in the list from the I/O buffer list['_typename'] = "JSROOTIO.TList"; list['name'] = ""; list['arr'] = new Array; list['opt'] = new Array; var ver = this.ReadVersion(); if (ver['val'] > 3) { this.ReadTObject(list); list['name'] = this.ReadTString(); var nobjects = this.ntou4(); for (var i = 0; i < nobjects; ++i) { var obj = this.ReadObjectAny(); list['arr'].push(obj); var opt = this.ReadTString(); list['opt'].push(opt); } } return this.CheckBytecount(ver); }; JSROOTIO.TBuffer.prototype.ReadTObjArray = function(list) { list['_typename'] = "JSROOTIO.TObjArray"; list['name'] = ""; list['arr'] = new Array(); var ver = this.ReadVersion(); if (ver['val'] > 2) this.ReadTObject(list); if (ver['val'] > 1) list['name'] = this.ReadTString(); var nobjects = this.ntou4(); var lowerbound = this.ntou4(); for (var i = 0; i < nobjects; i++) { var obj = this.ReadObjectAny(); list['arr'].push(obj); } return this.CheckBytecount(ver, "ReadTObjArray"); }; JSROOTIO.TBuffer.prototype.ReadTClonesArray = function(list) { list['_typename'] = "JSROOTIO.TClonesArray"; list['name'] = ""; list['arr'] = new Array(); var ver = this.ReadVersion(); if (ver['val'] > 2) this.ReadTObject(list); if (ver['val'] > 1) list['name'] = this.ReadTString(); var s = this.ReadTString(); var classv = s; var clv = 0; var pos = s.indexOf(";"); if (pos != -1) { classv = s.slice(0, pos); s = s.slice(pos+1, s.length()-pos-1); clv = parseInt(s); } var nobjects = this.ntou4(); if (nobjects < 0) nobjects = -nobjects; // for backward compatibility var lowerbound = this.ntou4(); for (var i = 0; i < nobjects; i++) { var obj = {}; this.ClassStreamer(obj, classv); list['arr'].push(obj); } return this.CheckBytecount(ver, "ReadTClonesArray"); }; JSROOTIO.TBuffer.prototype.ReadTCollection = function(list, str, o) { list['_typename'] = "JSROOTIO.TCollection"; list['name'] = ""; list['arr'] = new Array(); var ver = this.ReadVersion(); if (ver['val'] > 2) this.ReadTObject(list); if (ver['val'] > 1) list['name'] = this.ReadTString(); var nobjects = this.ntou4(); for (var i = 0; i < nobjects; i++) { o += 10; // skip object bits & unique id list['arr'].push(null); } return this.CheckBytecount(ver,"ReadTCollection"); }; JSROOTIO.TBuffer.prototype.ReadTStreamerInfo = function(streamerinfo) { // stream an object of class TStreamerInfo from the I/O buffer var R__v = this.ReadVersion(); if (R__v['val'] > 1) { this.ReadTNamed(streamerinfo); streamerinfo['name'] = streamerinfo['fName']; streamerinfo['title'] = streamerinfo['fTitle']; // console.log("name = " + streamerinfo['name']); streamerinfo['fCheckSum'] = this.ntou4(); streamerinfo['fClassVersion'] = this.ntou4(); streamerinfo['fElements'] = this.ReadObjectAny(); } return this.CheckBytecount(R__v, "ReadTStreamerInfo"); }; JSROOTIO.TBuffer.prototype.ReadStreamerElement = function(element) { // stream an object of class TStreamerElement var R__v = this.ReadVersion(); this.ReadTNamed(element); element['name'] = element['fName']; // TODO - should be removed element['title'] = element['fTitle']; // TODO - should be removed element['type'] = this.ntou4(); element['size'] = this.ntou4(); element['length'] = this.ntou4(); element['dim'] = this.ntou4(); if (R__v['val'] == 1) { var n = this.ntou4(); element['maxindex'] = this.ReadFastArray(n, 'U'); } else { element['maxindex'] = this.ReadFastArray(5, 'U'); } element['fTypeName'] = this.ReadTString(); element['typename'] = element['fTypeName']; // TODO - should be removed if ((element['type'] == 11) && (element['typename'] == "Bool_t" || element['typename'] == "bool")) element['type'] = 18; if (R__v['val'] > 1) { element['uuid'] = 0; } if (R__v['val'] <= 2) { // In TStreamerElement v2, fSize was holding the size of // the underlying data type. In later version it contains // the full length of the data member. } if (R__v['val'] == 3) { element['xmin'] = this.ntou4(); element['xmax'] = this.ntou4(); element['factor'] = this.ntou4(); //if (element['factor'] > 0) SetBit(kHasRange); } if (R__v['val'] > 3) { //if (TestBit(kHasRange)) GetRange(GetTitle(),fXmin,fXmax,fFactor); } return this.CheckBytecount(R__v, "ReadStreamerElement"); }; JSROOTIO.TBuffer.prototype.ReadStreamerBase = function(streamerbase) { // stream an object of class TStreamerBase var R__v = this.ReadVersion(); this.ReadStreamerElement(streamerbase); if (R__v['val'] > 2) { streamerbase['baseversion'] = this.ntou4(); } return this.CheckBytecount(R__v, "ReadStreamerBase"); }; JSROOTIO.TBuffer.prototype.<API key> = function(streamerbase) { // stream an object of class TStreamerBasicType var R__v = this.ReadVersion(); if (R__v['val'] > 1) { this.ReadStreamerElement(streamerbase); } return this.CheckBytecount(R__v, "<API key>"); }; JSROOTIO.TBuffer.prototype.<API key> = function(streamerbase) { // stream an object of class <API key> var R__v = this.ReadVersion(); if (R__v['val'] > 1) { this.ReadStreamerElement(streamerbase); streamerbase['countversion'] = this.ntou4(); streamerbase['countName'] = this.ReadTString(); streamerbase['countClass'] = this.ReadTString(); } return this.CheckBytecount(R__v, "<API key>"); }; JSROOTIO.TBuffer.prototype.ReadStreamerSTL = function(streamerSTL) { // stream an object of class TStreamerSTL var R__v = this.ReadVersion(); if (R__v['val'] > 2) { this.ReadStreamerElement(streamerSTL); streamerSTL['stltype'] = this.ntou4(); streamerSTL['ctype'] = this.ntou4(); } return this.CheckBytecount(R__v, "ReadStreamerSTL"); }; JSROOTIO.TBuffer.prototype.ReadTStreamerObject = function(streamerbase) { // stream an object of class TStreamerObject var R__v = this.ReadVersion(); if (R__v['val'] > 1) { this.ReadStreamerElement(streamerbase); } return this.CheckBytecount(R__v, "ReadTStreamerObject"); }; JSROOTIO.TBuffer.prototype.ReadClass = function() { // read class definition from I/O buffer var classInfo = {}; classInfo['name'] = -1; var tag = 0; var bcnt = this.ntou4(); var startpos = this.o; if (!(bcnt & kByteCountMask) || (bcnt == kNewClassTag)) { tag = bcnt; bcnt = 0; } else { // classInfo['fVersion'] = 1; tag = this.ntou4(); } if (!(tag & kClassMask)) { classInfo['objtag'] = tag; // indicate that we have deal with objects tag return classInfo; } if (tag == kNewClassTag) { // got a new class description followed by a new object classInfo['name'] = this.ReadString(); if (this.GetMappedClass(this.fTagOffset + startpos + kMapOffset)==-1) this.MapClass(this.fTagOffset + startpos + kMapOffset, classInfo['name']); } else { // got a tag to an already seen class var clTag = (tag & ~kClassMask); classInfo['name'] = this.GetMappedClass(clTag); if (classInfo['name']==-1) { alert("Did not found class with tag " + clTag); } } // classInfo['cnt'] = (bcnt & ~kByteCountMask); return classInfo; }; JSROOTIO.TBuffer.prototype.ReadObjectAny = function() { var startpos = this.o; var clRef = this.ReadClass(); // class identified as object and should be handled so if ('objtag' in clRef) return this.GetMappedObject(clRef['objtag']); if (clRef['name'] == -1) return null; var obj = {}; this.MapObject(this.fTagOffset + startpos + kMapOffset, obj); this.ClassStreamer(obj, clRef['name']); return obj; }; JSROOTIO.TBuffer.prototype.ClassStreamer = function(obj, classname) { //if (!'_typename' in obj) // obj['_typename'] = 'JSROOTIO.' + classname; // console.log("Start streaming of class " + classname); if (classname == 'TObject' || classname == 'TMethodCall') { this.ReadTObject(obj); } else if (classname == 'TQObject') { // skip TQObject } else if (classname == 'TObjString') { this.ReadTObjString(obj); } else if (classname == 'TObjArray') { this.ReadTObjArray(obj); } else if (classname == 'TClonesArray') { this.ReadTClonesArray(obj); } else if ((classname == 'TList') || (classname == 'THashList')) { this.ReadTList(obj); } else if (classname == 'TCollection') { this.ReadTCollection(obj); alert("Trying to read TCollection - wrong!!!"); } else if (classname == 'TCanvas') { var ver = this.ReadVersion(); this.ClassStreamer(obj, "TPad"); // we repair here correct position - no warning to outside this.CheckBytecount(ver); } else if (classname == "TStreamerInfo") { this.ReadTStreamerInfo(obj); } else if (classname == "TStreamerBase") { this.ReadStreamerBase(obj); } else if (classname == "TStreamerBasicType") { this.<API key>(obj); } else if ((classname == "<API key>") || (classname == "TStreamerLoop")) { this.<API key>(obj); } else if (classname == "TStreamerSTL") { this.ReadStreamerSTL(obj); } else if (classname == "TStreamerObject" || classname == "TStreamerObjectAny" || classname == "TStreamerString" || classname == "<API key>" ) { this.ReadTStreamerObject(obj); } else { var streamer = this.fFile.GetStreamer(classname); if (streamer != null) streamer.Stream(obj, this); else console.log("Did not found streamer for class " + classname); } // TODO: check how typename set obj['_typename'] = 'JSROOTIO.' + classname; JSROOTCore.addMethods(obj); } this.b = _str; this.o = (_o==null) ? 0 : _o; this.fFile = _file; this.ClearObjectMap(); this.fTagOffset = 0; } })(); // JSROOTIO.TStreamer.js // A TStreamer base class. // Depends on the JSROOTIO library functions. (function(){ var version = "2.8 2014/03/24"; // ctor JSROOTIO.TStreamer = function(file) { if (! (this instanceof arguments.callee) ) { var error = new Error("you must use new to instantiate this class"); error.source = "JSROOTIO.TStreamer.ctor"; throw error; } this.fFile = file; this._version = version; this._typename = "JSROOTIO.TStreamer"; JSROOTIO.TStreamer.prototype.ReadBasicType = function(buf, obj, prop) { // read basic types (known from the streamer info) switch (this[prop]['type']) { case kBase: break; case kOffsetL: break; case kOffsetP: break; case kCharStar: var n_el = obj[this[prop]['cntname']]; obj[prop] = buf.ReadBasicPointer(n_el, 'C'); break; case kChar: case kLegacyChar: obj[prop] = buf.b.charCodeAt(buf.o++) & 0xff; break; case kShort: obj[prop] = buf.ntoi2(); break; case kInt: case kCounter: obj[prop] = buf.ntoi4(); break; case kLong: obj[prop] = buf.ntoi8(); break; case kFloat: case kDouble32: obj[prop] = buf.ntof(); if (Math.abs(obj[prop]) < 1e-300) obj[prop] = 0.0; break; case kDouble: obj[prop] = buf.ntod(); if (Math.abs(obj[prop]) < 1e-300) obj[prop] = 0.0; break; case kUChar: obj[prop] = (buf.b.charCodeAt(buf.o++) & 0xff) >>> 0; break; case kUShort: obj[prop] = buf.ntou2(); break; case kUInt: obj[prop] = buf.ntou4(); break; case kULong: obj[prop] = buf.ntou8(); break; case kBits: alert('failed to stream ' + prop + ' (' + this[prop]['typename'] + ')'); break; case kLong64: obj[prop] = buf.ntoi8(); break; case kULong64: obj[prop] = buf.ntou8(); break; case kBool: obj[prop] = (buf.b.charCodeAt(buf.o++) & 0xff) != 0; break; case kFloat16: obj[prop] = 0; buf.o += 2; break; case kAny: case kAnyp: case kObjectp: case kObject: var classname = this[prop]['typename']; if (classname.endsWith("*")) classname = classname.substr(0, classname.length - 1); obj[prop] = {}; buf.ClassStreamer(obj[prop], classname); break; case kAnyP: case kObjectP: obj[prop] = buf.ReadObjectAny(); break; case kTString: obj[prop] = buf.ReadTString(); break; case kTObject: buf.ReadTObject(obj); break; case kTNamed: buf.ReadTNamed(obj); break; case kAnyPnoVT: case kSTLp: case kSkip: case kSkipL: case kSkipP: case kConv: case kConvL: case kConvP: case kSTL: case kSTLstring: case kStreamer: case kStreamLoop: alert('failed to stream ' + prop + ' (' + this[prop]['typename'] + ')'); break; case kOffsetL+kShort: case kOffsetL+kUShort: alert("Strange code was here????"); // var n_el = str.charCodeAt(o) & 0xff; var n_el = this[prop]['length']; obj[prop] = buf.ReadFastArray(n_el, 'S'); break; case kOffsetL+kInt: var n_el = this[prop]['length']; obj[prop] = buf.ReadFastArray(n_el, 'I'); break; case kOffsetL+kUInt: var n_el = this[prop]['length']; obj[prop] = buf.ReadFastArray(n_el, 'U'); break; case kOffsetL+kULong: case kOffsetL+kULong64: var n_el = this[prop]['length']; obj[prop] = buf.ReadFastArray(n_el, 'LU'); break; case kOffsetL+kLong: case kOffsetL+kLong64: var n_el = this[prop]['length']; obj[prop] = buf.ReadFastArray(n_el, 'L'); break; case kOffsetL+kFloat: case kOffsetL+kDouble32: //var n_el = str.charCodeAt(o) & 0xff; var n_el = this[prop]['length']; obj[prop] = buf.ReadFastArray(n_el, 'F'); break; case kOffsetL+kDouble: //var n_el = str.charCodeAt(o) & 0xff; var n_el = this[prop]['length']; obj[prop] = buf.ReadFastArray(n_el, 'D'); break; case kOffsetP+kChar: var n_el = obj[this[prop]['cntname']]; obj[prop] = buf.ReadBasicPointer(n_el, 'C'); break; case kOffsetP+kShort: case kOffsetP+kUShort: var n_el = obj[this[prop]['cntname']]; obj[prop] = buf.ReadBasicPointer(n_el, 'S'); break; case kOffsetP+kInt: var n_el = obj[this[prop]['cntname']]; obj[prop] = buf.ReadBasicPointer(n_el, 'I'); break; case kOffsetP+kUInt: var n_el = obj[this[prop]['cntname']]; obj[prop] = buf.ReadBasicPointer(n_el, 'U'); break; case kOffsetP+kULong: case kOffsetP+kULong64: var n_el = obj[this[prop]['cntname']]; obj[prop] = buf.ReadBasicPointer(n_el, 'LU'); break; case kOffsetP+kLong: case kOffsetP+kLong64: var n_el = obj[this[prop]['cntname']]; obj[prop] = buf.ReadBasicPointer(n_el, 'L'); break; case kOffsetP+kFloat: case kOffsetP+kDouble32: var n_el = obj[this[prop]['cntname']]; obj[prop] = buf.ReadBasicPointer(n_el, 'F'); break; case kOffsetP+kDouble: var n_el = obj[this[prop]['cntname']]; obj[prop] = buf.ReadBasicPointer(n_el, 'D'); break; default: alert('failed to stream ' + prop + ' (' + this[prop]['typename'] + ')'); break; } }; JSROOTIO.TStreamer.prototype.Stream = function(obj, buf) { var ver = buf.ReadVersion(); // first base classes for (var prop in this) { if (!this[prop] || typeof(this[prop]) === "function") continue; if (this[prop]['typename'] === 'BASE') { var clname = this[prop]['class']; if (this[prop]['class'].indexOf("TArray") == 0) { var array_type = this[prop]['class'].charAt(6); obj['fN'] = buf.ntou4(); obj['fArray'] = buf.ReadFastArray(obj['fN'], array_type); } else { buf.ClassStreamer(obj, this[prop]['class']); } } } // then class members for (var prop in this) { if (!this[prop] || typeof(this[prop]) === "function") continue; var prop_typename = this[prop]['typename']; if (typeof(prop_typename) === "undefined" || prop_typename === "BASE") continue; if (JSROOTIO.fUserStreamers !== null) { var user_func = JSROOTIO.fUserStreamers[prop_typename]; if (user_func !== undefined) { user_func(buf, obj, prop, this); continue; } } // special classes (custom streamers) switch (prop_typename) { case "TString*": // TODO: check how and when it used var r__v = buf.ReadVersion(); obj[prop] = new Array(); for (var i = 0; i<obj[this[prop]['cntname']]; ++i ) obj[prop][i] = buf.ReadTString(); buf.CheckBytecount(r__v, "TString* array"); break; case "TArrayC": case "TArrayD": case "TArrayF": case "TArrayI": case "TArrayL": case "TArrayL64": case "TArrayS": var array_type = this[prop]['typename'].charAt(6); var n = buf.ntou4(); obj[prop] = buf.ReadFastArray(n, array_type); break; case "TObject": // TODO: check why it is here buf.ReadTObject(obj); break; case "TQObject": // TODO: check why it is here // skip TQObject... break; default: // basic types and standard streamers this.ReadBasicType(buf, obj, prop); break; } } if (('fBits' in obj) && !('TestBit' in obj)) { obj['TestBit'] = function (f) { return ((obj['fBits'] & f) != 0); }; } buf.CheckBytecount(ver, "TStreamer.Stream"); return buf.o; }; return this; }; JSROOTIO.TStreamer.Version = version; })(); // JSROOTIO.TStreamer.js ends // JSROOTIO.TDirectory.js // A class that reads a TDirectory from a buffer. // Depends on the JSROOTIO library functions. (function(){ var version = "2.8 2014/03/18"; // ctor JSROOTIO.TDirectory = function(file, dirname, cycle) { if (! (this instanceof arguments.callee) ) { var error = new Error("you must use new to instantiate this class"); error.source = "JSROOTIO.TDirectory.ctor"; throw error; } this.fFile = file; this._version = version; this._typename = "JSROOTIO.TDirectory"; this['dirname'] = dirname; this['cycle'] = cycle; JSROOTIO.TDirectory.prototype.GetKey = function(keyname, cycle) { // retrieve a key by its name and cycle in the list of keys for (var i=0; i<this.fKeys.length; ++i) { if (this.fKeys[i]['name'] == keyname && this.fKeys[i]['cycle'] == cycle) return this.fKeys[i]; } return null; } JSROOTIO.TDirectory.prototype.ReadKeys = function(cycle, dir_id) { var thisdir = this; var callback2 = function(file, _buffer) { //headerkey->ReadKeyBuffer(buffer); var buf = new JSROOTIO.TBuffer(_buffer, 0, thisdir.fFile); var key = thisdir.fFile.ReadKey(buf); var nkeys = buf.ntoi4(); for (var i = 0; i < nkeys; i++) { key = thisdir.fFile.ReadKey(buf); thisdir.fKeys.push(key); } thisdir.fFile.fDirectories.push(thisdir); JSROOTPainter.displayListOfKeys(thisdir.fKeys, '#status', dir_id); delete buf; }; var callback1 = function(file, buffer) { var buf = new JSROOTIO.TBuffer(buffer, thisdir.fNbytesName, thisdir.fFile); thisdir.StreamHeader(buf); var largeKey = buf.o + nbytes > 2 * 1024 * 1024 * 1024 ;
#ifndef <API key> # define <API key> # include <stdio.h> # include "viralloc.h" # define EXIT_AM_SKIP 77 /* tell Automake we're skipping a test */ # define EXIT_AM_HARDFAIL 99 /* tell Automake that the framework is broken */ extern char *progname; extern char *abs_srcdir; double <API key>(double *items, int nitems); void virtTestResult(const char *name, int ret, const char *msg, ...) <API key>(3,4); int virtTestRun(const char *title, int nloops, int (*body)(const void *data), const void *data); int virtTestLoadFile(const char *file, char **buf); int <API key>(const char *const argv[], char **buf, int maxlen); int <API key>(const char *pattern, char *string); int virtTestDifference(FILE *stream, const char *expect, const char *actual); int <API key>(FILE *stream, const char *expect, const char *actual, size_t length); unsigned int virTestGetDebug(void); unsigned int virTestGetVerbose(void); char *<API key>(void); int virtTestMain(int argc, char **argv, int (*func)(void)); /* Setup, then call func() */ # define VIRT_TEST_MAIN(func) \ int main(int argc, char **argv) { \ return virtTestMain(argc, argv, func); \ } # define <API key>(func, lib) \ int main(int argc, char **argv) { \ const char *preload = getenv("LD_PRELOAD"); \ if (preload == NULL || strstr(preload, lib) == NULL) { \ char *newenv; \ if (virAsprintf(&newenv, "%s%s%s", preload ? preload : "", \ preload ? ":" : "", lib) < 0) { \ perror("virAsprintf"); \ exit(EXIT_FAILURE); \ } \ setenv("LD_PRELOAD", newenv, 1); \ execv(argv[0], argv); \ } \ return virtTestMain(argc, argv, func); \ } #endif /* <API key> */
\hypertarget{<API key>}{}\section{Cqrs.\+Messages.\+I\+Telemetered\+Message Interface Reference} \label{<API key>}\index{Cqrs.\+Messages.\+I\+Telemetered\+Message@{Cqrs.\+Messages.\+I\+Telemetered\+Message}} A message that can allows you to manually inform the telemetry system it\textquotesingle{}s name. \subsection*{Properties} \begin{DoxyCompactItemize} \item string \hyperlink{interfaceCqrs_1_1Messages_1_1ITelemeteredMessage_af8106e5bc763e16284567c334b733733_af8106e5bc763e16284567c334b733733}{Telemetry\+Name}\hspace{0.3cm}{\ttfamily \mbox{[}get, set\mbox{]}} \begin{DoxyCompactList}\small\item\em Gets or sets the Name of this message. \end{DoxyCompactList}\end{DoxyCompactItemize} \subsection{Detailed Description} A message that can allows you to manually inform the telemetry system it\textquotesingle{}s name. \subsection{Property Documentation} \mbox{\Hypertarget{interfaceCqrs_1_1Messages_1_1ITelemeteredMessage_af8106e5bc763e16284567c334b733733_af8106e5bc763e16284567c334b733733}\label{interfaceCqrs_1_1Messages_1_1ITelemeteredMessage_af8106e5bc763e16284567c334b733733_af8106e5bc763e16284567c334b733733}} \index{Cqrs\+::\+Messages\+::\+I\+Telemetered\+Message@{Cqrs\+::\+Messages\+::\+I\+Telemetered\+Message}!Telemetry\+Name@{Telemetry\+Name}} \index{Telemetry\+Name@{Telemetry\+Name}!Cqrs\+::\+Messages\+::\+I\+Telemetered\+Message@{Cqrs\+::\+Messages\+::\+I\+Telemetered\+Message}} \subsubsection{\texorpdfstring{Telemetry\+Name}{TelemetryName}} {\footnotesize\ttfamily string Cqrs.\+Messages.\+I\+Telemetered\+Message.\+Telemetry\+Name\hspace{0.3cm}{\ttfamily [get]}, {\ttfamily [set]}} Gets or sets the Name of this message.
#define PROFILE #include <assert.h> #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <math.h> #include "stm32f4xx_conf.h" #include "stm32f4xx.h" #include "gdb_stdio.h" #include "freedv_api.h" #include "machdep.h" #include "codec2_fdmdv.h" #ifdef __EMBEDDED__ #define printf gdb_stdio_printf #define fopen gdb_stdio_fopen #define fclose gdb_stdio_fclose #define fread gdb_stdio_fread #define fwrite gdb_stdio_fwrite #define fprintf gdb_stdio_fprintf #endif #define FREEDV_NSAMPLES_16K (2*FREEDV_NSAMPLES) int main(int argc, char *argv[]) { struct freedv *f; FILE *fin, *fout, *ftotal; int frame, nin_16k, nin, i, nout = 0; int n_samples, n_samples_16k; int sync; float snr_est; PROFILE_VAR(fdmdv_16_to_8_start, freedv_rx_start, fdmdv_8_to_16_start); <API key>(); f = freedv_open(FREEDV_MODE_1600); n_samples = <API key>(f); n_samples_16k = 2*n_samples; short adc16k[FDMDV_OS_TAPS_16K+n_samples_16k]; short dac16k[n_samples_16k]; short adc8k[n_samples]; short dac8k[FDMDV_OS_TAPS_8K+n_samples]; frame = 0; fin = fopen("mod_16k.raw", "rb"); if (fin == NULL) { printf("Error opening input file\n"); exit(1); } fout = fopen("speechout_16k.raw", "wb"); if (fout == NULL) { printf("Error opening output file\n"); exit(1); } ftotal = fopen("total.txt", "wt"); assert(ftotal != NULL); /* clear filter memories */ for(i=0; i<FDMDV_OS_TAPS_16K; i++) adc16k[i] = 0.0; for(i=0; i<FDMDV_OS_TAPS_8K; i++) dac8k[i] = 0.0; nin = freedv_nin(f); nin_16k = 2*nin; nout = nin; while (fread(&adc16k[FDMDV_OS_TAPS_16K], sizeof(short), nin_16k, fin) == nin_16k) { PROFILE_SAMPLE(fdmdv_16_to_8_start); fdmdv_16_to_8_short(adc8k, &adc16k[FDMDV_OS_TAPS_16K], nin); <API key>(freedv_rx_start, fdmdv_16_to_8_start, " fdmdv_16_to_8"); nout = freedv_rx(f, &dac8k[FDMDV_OS_TAPS_8K], adc8k); nin = freedv_nin(f); nin_16k = 2*nin; <API key>(fdmdv_8_to_16_start, freedv_rx_start, " freedv_rx"); fdmdv_8_to_16_short(dac16k, &dac8k[FDMDV_OS_TAPS_8K], nout); <API key>(fdmdv_8_to_16_start, " fdmdv_8_to_16"); fprintf(ftotal, "%d\n", <API key>() - fdmdv_16_to_8_start); <API key>(); fwrite(dac16k, sizeof(short), 2*nout, fout); <API key>(f, &sync, &snr_est); printf("frame: %d nin_16k: %d sync: %d SNR: %3.2f \n", ++frame, nin_16k, sync, (double)snr_est); } fclose(fin); fclose(fout); fclose(ftotal); return 0; }
--Copyright (C) 2007 <SWGEmu> --This File is part of Core3. --This program 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 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 Lesser 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, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --which carries forward this exception. --true = 1, false = 0 <API key> = { name = "launchfirework", } AddCommand(<API key>)
<!DOCTYPE html PUBLIC "- <html xmlns="http: <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Offline - Matecat</title> <link href="/public/css/common.css" rel="stylesheet" type="text/css" /> </head> <body class="offline"> <header> <div class="wrapper "> <a href="/" class="logo"></a> </div> </header> <div class="claim"> <div class="cat"></div> <h1><span>404</span> Page not found</h1> <h2>Oops! We can't find the content you're looking for.</h2> </div> </body> </html>
#include "config.h" #include "SamplingTool.h" #include "CodeBlock.h" #include "Interpreter.h" #include "Opcode.h" #if !OS(WINDOWS) #include <unistd.h> #endif namespace JSC { #if ENABLE(SAMPLING_FLAGS) void SamplingFlags::sample() { uint32_t mask = static_cast<uint32_t>(1 << 31); unsigned index; for (index = 0; index < 32; ++index) { if (mask & s_flags) break; mask >>= 1; } s_flagCounts[32 - index]++; } void SamplingFlags::start() { for (unsigned i = 0; i <= 32; ++i) s_flagCounts[i] = 0; } void SamplingFlags::stop() { uint64_t total = 0; for (unsigned i = 0; i <= 32; ++i) total += s_flagCounts[i]; if (total) { dataLogF("\nSamplingFlags: sample counts with flags set: (%lld total)\n", total); for (unsigned i = 0; i <= 32; ++i) { if (s_flagCounts[i]) dataLogF(" [ %02d ] : %lld\t\t(%03.2f%%)\n", i, s_flagCounts[i], (100.0 * s_flagCounts[i]) / total); } dataLogF("\n"); } else dataLogF("\nSamplingFlags: no samples.\n\n"); } uint64_t SamplingFlags::s_flagCounts[33]; #else void SamplingFlags::start() {} void SamplingFlags::stop() {} #endif #if ENABLE(SAMPLING_REGIONS) volatile uintptr_t SamplingRegion::s_currentOrReserved; Spectrum<const char*>* SamplingRegion::s_spectrum; unsigned long SamplingRegion::s_noneOfTheAbove; unsigned SamplingRegion::<API key>; SamplingRegion::Locker::Locker() { uintptr_t previous; while (true) { previous = s_currentOrReserved; if (previous & 1) { #if OS(UNIX) sched_yield(); #endif continue; } if (WTF::<API key>(&s_currentOrReserved, previous, previous | 1)) break; } } SamplingRegion::Locker::~Locker() { // We don't need the CAS, but we do it out of an // abundance of caution (and because it gives us a memory fence, which is // never bad). uintptr_t previous; do { previous = s_currentOrReserved; } while (!WTF::<API key>(&s_currentOrReserved, previous, previous & ~1)); } void SamplingRegion::sample() { // Make sure we lock s_current. Locker locker; // Create a spectrum if we don't have one already. if (!s_spectrum) s_spectrum = new Spectrum<const char*>(); ASSERT(s_currentOrReserved & 1); // Walk the region stack, and record each region we see. SamplingRegion* region = bitwise_cast<SamplingRegion*>(s_currentOrReserved & ~1); if (region) { for (; region; region = region->m_previous) s_spectrum->add(region->m_name); } else s_noneOfTheAbove++; if (<API key>++ == SamplingThread::s_hertz) { <API key> = 0; dumpInternal(); } } void SamplingRegion::dump() { Locker locker; dumpInternal(); } void SamplingRegion::dumpInternal() { if (!s_spectrum) { dataLogF("\nSamplingRegion: was never sampled.\n\n"); return; } Vector<Spectrum<const char*>::KeyAndCount> list = s_spectrum->buildList(); unsigned long total = s_noneOfTheAbove; for (unsigned i = list.size(); i total += list[i].count; dataLogF("\nSamplingRegion: sample counts for regions: (%lu samples)\n", total); for (unsigned i = list.size(); i dataLogF(" %3.2lf%% %s\n", (100.0 * list[i].count) / total, list[i].key); } #else // ENABLE(SAMPLING_REGIONS) void SamplingRegion::dump() { } #endif // ENABLE(SAMPLING_REGIONS) /* Start with flag 16 set. By doing this the monitoring of lower valued flags will be masked out until flag 16 is explictly cleared. */ uint32_t SamplingFlags::s_flags = 1 << 15; #if OS(WINDOWS) static void <API key>(unsigned us) { unsigned ms = us / 1000; if (us && !ms) ms = 1; Sleep(ms); } #else static void <API key>(unsigned us) { usleep(us); } #endif static inline unsigned hertz2us(unsigned hertz) { return 1000000 / hertz; } SamplingTool* SamplingTool::s_samplingTool = 0; bool SamplingThread::s_running = false; unsigned SamplingThread::s_hertz = 10000; ThreadIdentifier SamplingThread::s_samplingThread; void SamplingThread::threadStartFunc(void*) { while (s_running) { <API key>(hertz2us(s_hertz)); #if ENABLE(SAMPLING_FLAGS) SamplingFlags::sample(); #endif #if ENABLE(SAMPLING_REGIONS) SamplingRegion::sample(); #endif #if ENABLE(OPCODE_SAMPLING) SamplingTool::sample(); #endif } } void SamplingThread::start(unsigned hertz) { ASSERT(!s_running); s_running = true; s_hertz = hertz; s_samplingThread = createThread(threadStartFunc, 0, "JavaScriptCore::Sampler"); } void SamplingThread::stop() { ASSERT(s_running); s_running = false; <API key>(s_samplingThread); } void ScriptSampleRecord::sample(CodeBlock* codeBlock, Instruction* vPC) { if (!m_samples) { m_size = codeBlock->instructions().size(); m_samples = static_cast<int*>(calloc(m_size, sizeof(int))); m_codeBlock = codeBlock; } ++m_sampleCount; unsigned offest = vPC - codeBlock->instructions().begin(); // Since we don't read and write codeBlock and vPC atomically, this check // can fail if we sample mid op_call / op_ret. if (offest < m_size) { m_samples[offest]++; m_opcodeSampleCount++; } } void SamplingTool::doRun() { Sample sample(m_sample, m_codeBlock); ++m_sampleCount; if (sample.isNull()) return; if (!sample.inHostFunction()) { unsigned opcodeID = m_interpreter->getOpcodeID(sample.vPC()[0].u.opcode); ++m_opcodeSampleCount; ++m_opcodeSamples[opcodeID]; if (sample.inCTIFunction()) <API key>[opcodeID]++; } #if ENABLE(CODEBLOCK_SAMPLING) if (CodeBlock* codeBlock = sample.codeBlock()) { MutexLocker locker(<API key>); ScriptSampleRecord* record = m_scopeSampleMap->get(codeBlock->ownerExecutable()); ASSERT(record); record->sample(codeBlock, sample.vPC()); } #endif } void SamplingTool::sample() { s_samplingTool->doRun(); } void SamplingTool::notifyOfScope(JSGlobalData& globalData, ScriptExecutable* script) { #if ENABLE(CODEBLOCK_SAMPLING) MutexLocker locker(<API key>); m_scopeSampleMap->set(script, adoptPtr(new ScriptSampleRecord(globalData, script))); #else UNUSED_PARAM(globalData); UNUSED_PARAM(script); #endif } void SamplingTool::setup() { s_samplingTool = this; } #if ENABLE(OPCODE_SAMPLING) struct OpcodeSampleInfo { OpcodeID opcode; long long count; long long countInCTIFunctions; }; struct LineCountInfo { unsigned line; unsigned count; }; static int <API key>(const void* left, const void* right) { const OpcodeSampleInfo* leftSampleInfo = reinterpret_cast<const OpcodeSampleInfo*>(left); const OpcodeSampleInfo* rightSampleInfo = reinterpret_cast<const OpcodeSampleInfo*>(right); return (leftSampleInfo->count < rightSampleInfo->count) ? 1 : (leftSampleInfo->count > rightSampleInfo->count) ? -1 : 0; } #if ENABLE(CODEBLOCK_SAMPLING) static int <API key>(const void* left, const void* right) { const LineCountInfo* leftLineCount = reinterpret_cast<const LineCountInfo*>(left); const LineCountInfo* rightLineCount = reinterpret_cast<const LineCountInfo*>(right); return (leftLineCount->line > rightLineCount->line) ? 1 : (leftLineCount->line < rightLineCount->line) ? -1 : 0; } static int <API key>(const void* left, const void* right) { const ScriptSampleRecord* const leftValue = *static_cast<const ScriptSampleRecord* const *>(left); const ScriptSampleRecord* const rightValue = *static_cast<const ScriptSampleRecord* const *>(right); return (leftValue->m_sampleCount < rightValue->m_sampleCount) ? 1 : (leftValue->m_sampleCount > rightValue->m_sampleCount) ? -1 : 0; } #endif void SamplingTool::dump(ExecState* exec) { // Tidies up SunSpider output by removing short scripts - such a small number of samples would likely not be useful anyhow. if (m_sampleCount < 10) return; // (1) Build and sort 'opcodeSampleInfo' array. OpcodeSampleInfo opcodeSampleInfo[numOpcodeIDs]; for (int i = 0; i < numOpcodeIDs; ++i) { opcodeSampleInfo[i].opcode = static_cast<OpcodeID>(i); opcodeSampleInfo[i].count = m_opcodeSamples[i]; opcodeSampleInfo[i].countInCTIFunctions = <API key>[i]; } qsort(opcodeSampleInfo, numOpcodeIDs, sizeof(OpcodeSampleInfo), <API key>); // (2) Print Opcode sampling results. dataLogF("\nBytecode samples [*]\n"); dataLogF(" sample %% of %% of | cti cti %%\n"); dataLogF("opcode count VM total | count of self\n"); dataLogF(" for (int i = 0; i < numOpcodeIDs; ++i) { long long count = opcodeSampleInfo[i].count; if (!count) continue; OpcodeID opcodeID = opcodeSampleInfo[i].opcode; const char* opcodeName = opcodeNames[opcodeID]; const char* opcodePadding = padOpcodeName(opcodeID, 28); double percentOfVM = (static_cast<double>(count) * 100) / m_opcodeSampleCount; double percentOfTotal = (static_cast<double>(count) * 100) / m_sampleCount; long long countInCTIFunctions = opcodeSampleInfo[i].countInCTIFunctions; double <API key> = (static_cast<double>(countInCTIFunctions) * 100) / count; debugDebugPrintf("%s:%s%-6lld %.3f%%\t%.3f%%\t | %-6lld %.3f%%\n", opcodeName, opcodePadding, count, percentOfVM, percentOfTotal, countInCTIFunctions, <API key>); } dataLogF("\n[*] Samples inside host code are not charged to any Bytecode.\n\n"); dataLogF("\tSamples inside VM:\t\t%lld / %lld (%.3f%%)\n", m_opcodeSampleCount, m_sampleCount, (static_cast<double>(m_opcodeSampleCount) * 100) / m_sampleCount); dataLogF("\tSamples inside host code:\t%lld / %lld (%.3f%%)\n\n", m_sampleCount - m_opcodeSampleCount, m_sampleCount, (static_cast<double>(m_sampleCount - m_opcodeSampleCount) * 100) / m_sampleCount); dataLogF("\tsample count:\tsamples inside this opcode\n"); dataLogF("\t%% of VM:\tsample count / all opcode samples\n"); dataLogF("\t%% of total:\tsample count / all samples\n"); dataLogF("\t dataLogF("\tcti count:\tsamples inside a CTI function called by this opcode\n"); dataLogF("\tcti %% of self:\tcti count / sample count\n"); #if ENABLE(CODEBLOCK_SAMPLING) // (3) Build and sort 'codeBlockSamples' array. int scopeCount = m_scopeSampleMap->size(); Vector<ScriptSampleRecord*> codeBlockSamples(scopeCount); <API key>::iterator iter = m_scopeSampleMap->begin(); for (int i = 0; i < scopeCount; ++i, ++iter) codeBlockSamples[i] = iter->value.get(); qsort(codeBlockSamples.begin(), scopeCount, sizeof(ScriptSampleRecord*), <API key>); // (4) Print data from 'codeBlockSamples' array. dataLogF("\nCodeBlock samples\n\n"); for (int i = 0; i < scopeCount; ++i) { ScriptSampleRecord* record = codeBlockSamples[i]; CodeBlock* codeBlock = record->m_codeBlock; double blockPercent = (record->m_sampleCount * 100.0) / m_sampleCount; if (blockPercent >= 1) { //Instruction* code = codeBlock->instructions().begin(); dataLogF("#%d: %s:%d: %d / %lld (%.3f%%)\n", i + 1, record->m_executable->sourceURL().utf8().data(), codeBlock-><API key>(0), record->m_sampleCount, m_sampleCount, blockPercent); if (i < 10) { HashMap<unsigned,unsigned> lineCounts; codeBlock->dump(exec); dataLogF(" Opcode and line number samples [*]\n\n"); for (unsigned op = 0; op < record->m_size; ++op) { int count = record->m_samples[op]; if (count) { dataLogF(" [% 4d] has sample count: % 4d\n", op, count); unsigned line = codeBlock-><API key>(op); lineCounts.set(line, (lineCounts.contains(line) ? lineCounts.get(line) : 0) + count); } } dataLogF("\n"); int linesCount = lineCounts.size(); Vector<LineCountInfo> lineCountInfo(linesCount); int lineno = 0; for (HashMap<unsigned,unsigned>::iterator iter = lineCounts.begin(); iter != lineCounts.end(); ++iter, ++lineno) { lineCountInfo[lineno].line = iter->key; lineCountInfo[lineno].count = iter->value; } qsort(lineCountInfo.begin(), linesCount, sizeof(LineCountInfo), <API key>); for (lineno = 0; lineno < linesCount; ++lineno) { dataLogF(" Line #%d has sample count %d.\n", lineCountInfo[lineno].line, lineCountInfo[lineno].count); } dataLogF("\n"); dataLogF(" [*] Samples inside host code are charged to the calling Bytecode.\n"); dataLogF(" Samples on a call / return boundary are not charged to a specific opcode or line.\n\n"); dataLogF(" Samples on a call / return boundary: %d / %d (%.3f%%)\n\n", record->m_sampleCount - record->m_opcodeSampleCount, record->m_sampleCount, (static_cast<double>(record->m_sampleCount - record->m_opcodeSampleCount) * 100) / record->m_sampleCount); } } } #else UNUSED_PARAM(exec); #endif } #else void SamplingTool::dump(ExecState*) { } #endif } // namespace JSC
#ifndef <API key> #define <API key> #include "cpptools_global.h" #include "cppmodelmanager.h" #include <coreplugin/find/searchresultwindow.h> #include <coreplugin/find/textfindconstants.h> #include <QFuture> #include <QStringList> namespace CppTools { class CPPTOOLS_EXPORT SymbolSearcher: public QObject { Q_OBJECT public: enum SymbolType { Classes = 0x1, Functions = 0x2, Enums = 0x4, Declarations = 0x8 }; Q_DECLARE_FLAGS(SymbolTypes, SymbolType) enum SearchScope { SearchProjectsOnly, SearchGlobal }; struct Parameters { QString text; Core::FindFlags flags; SymbolTypes types; SearchScope scope; }; public: SymbolSearcher(QObject *parent = 0); virtual ~SymbolSearcher() = 0; virtual void runSearch(QFutureInterface<Core::SearchResultItem> &future) = 0; }; class CPPTOOLS_EXPORT CppIndexingSupport { public: virtual ~CppIndexingSupport() = 0; virtual QFuture<void> refreshSourceFiles(const QSet<QString> &sourceFiles, CppModelManager::<API key> mode) = 0; virtual SymbolSearcher *<API key>(SymbolSearcher::Parameters parameters, QSet<QString> fileNames) = 0; }; } // namespace CppTools Q_DECLARE_METATYPE(CppTools::SymbolSearcher::SearchScope) Q_DECLARE_METATYPE(CppTools::SymbolSearcher::Parameters) Q_DECLARE_METATYPE(CppTools::SymbolSearcher::SymbolTypes) #endif // <API key>
namespace StockSharp.BitStamp { using System; using System.Linq; using Ecng.Collections; using Ecng.Common; using MoreLinq; using StockSharp.Algo; using StockSharp.BitStamp.Native; using StockSharp.Messages; partial class <API key> { private readonly <API key><SecurityId, int> _subscribedDepths = new <API key><SecurityId, int>(); private readonly <API key><SecurityId> _subscribedTicks = new <API key><SecurityId>(); private DateTimeOffset _prevLevel1Time; private static readonly TimeSpan _level1Interval = TimeSpan.FromSeconds(10); private void SessionOnNewTrade(Trade trade) { SendOutMessage(new ExecutionMessage { ExecutionType = ExecutionTypes.Tick, SecurityId = _btcUsd, TradeId = trade.Id, TradePrice = (decimal)trade.Price, Volume = (decimal)trade.Amount, ServerTime = CurrentTime.Convert(TimeZoneInfo.Utc), }); } private void <API key>(OrderBook book) { SendOutMessage(new QuoteChangeMessage { SecurityId = _btcUsd, Bids = book.Bids.Select(b => b.ToStockSharp(Sides.Buy)), Asks = book.Asks.Select(b => b.ToStockSharp(Sides.Sell)), ServerTime = CurrentTime.Convert(TimeZoneInfo.Utc), }); } private void ProcessMarketData(MarketDataMessage mdMsg) { switch (mdMsg.DataType) { case MarketDataTypes.Level1: { //if (mdMsg.IsSubscribe) // _subscribedLevel1.Add(secCode); //else // _subscribedLevel1.Remove(secCode); break; } case MarketDataTypes.MarketDepth: { if (mdMsg.IsSubscribe) { _subscribedDepths.Add(mdMsg.SecurityId, mdMsg.MaxDepth); if (_subscribedDepths.Count == 1) _pusherClient.SubscribeDepths(); } else { _subscribedDepths.Remove(mdMsg.SecurityId); if (_subscribedDepths.Count == 0) _pusherClient.UnSubscribeDepths(); } break; } case MarketDataTypes.Trades: { if (mdMsg.IsSubscribe) { if (mdMsg.From == DateTime.Today) { _httpClient.RequestTransactions().Select(t => new ExecutionMessage { ExecutionType = ExecutionTypes.Tick, SecurityId = _btcUsd, TradeId = t.Id, TradePrice = (decimal)t.Price, Volume = (decimal)t.Amount, ServerTime = t.Time.ApplyTimeZone(TimeZoneInfo.Utc) }).ForEach(SendOutMessage); } _subscribedTicks.Add(mdMsg.SecurityId); if (_subscribedTicks.Count == 1) _pusherClient.SubscribeTrades(); } else { _subscribedTicks.Remove(mdMsg.SecurityId); if (_subscribedTicks.Count == 0) _pusherClient.UnSubscribeTrades(); } break; } default: { <API key>(mdMsg.TransactionId); return; } } var reply = (MarketDataMessage)mdMsg.Clone(); reply.<API key> = mdMsg.<API key>; SendOutMessage(reply); } private void <API key>(<API key> message) { SendOutMessage(new SecurityMessage { <API key> = message.TransactionId, SecurityId = _btcUsd, SecurityType = SecurityTypes.CryptoCurrency, VolumeStep = 0.00000001m, PriceStep = 0.01m, }); SendOutMessage(new SecurityMessage { <API key> = message.TransactionId, SecurityId = _eurUsd, SecurityType = SecurityTypes.Currency, PriceStep = 0.0001m, }); SendOutMessage(new <API key> { <API key> = message.TransactionId }); } private void ProcessLevel1() { var currTime = CurrentTime; if ((currTime - _prevLevel1Time) < _level1Interval) return; _prevLevel1Time = currTime; var btcUsd = _httpClient.RequestBtcUsd(); if (btcUsd != null) { SendOutMessage(new Level1ChangeMessage { SecurityId = _btcUsd, ServerTime = btcUsd.Time.ApplyTimeZone(TimeZoneInfo.Utc) } .TryAdd(Level1Fields.HighBidPrice, (decimal)btcUsd.High) .TryAdd(Level1Fields.LowAskPrice, (decimal)btcUsd.Low) .TryAdd(Level1Fields.VWAP, (decimal)btcUsd.VWAP) .TryAdd(Level1Fields.LastTradePrice, (decimal)btcUsd.Last) .TryAdd(Level1Fields.Volume, (decimal)btcUsd.Volume) .TryAdd(Level1Fields.BestBidPrice, (decimal)btcUsd.Bid) .TryAdd(Level1Fields.BestAskPrice, (decimal)btcUsd.Ask)); } var eurUsd = _httpClient.RequestEurUsd(); if (eurUsd != null) { SendOutMessage(new Level1ChangeMessage { SecurityId = _eurUsd, ServerTime = CurrentTime.Convert(TimeZoneInfo.Utc), } .TryAdd(Level1Fields.BestBidPrice, (decimal)eurUsd.Buy) .TryAdd(Level1Fields.BestAskPrice, (decimal)eurUsd.Sell)); } } } }
var searchData= [ ['headerfooter',['HeaderFooter',['../<API key>.html',1,'wkhtmltopdf::settings']]] ];
#include <stdio.h> #include <stdlib.h> #ifndef REGTEST #include <_PDCLIB_io.h> #include <_PDCLIB_glue.h> #include <string.h> #include <errno.h> extern FILE * _PDCLIB_filelist; FILE * fopen( const char * _PDCLIB_restrict filename, const char * _PDCLIB_restrict mode ) { int imode = _PDCLIB_filemode( mode ); if( imode == 0 || filename == NULL ) return NULL; _PDCLIB_fd_t fd; const _PDCLIB_fileops_t * ops; if(!_PDCLIB_open( &fd, &ops, filename, imode )) { return NULL; } FILE * f = _PDCLIB_fvopen( fd, ops, imode, filename ); if(!f) { int saveErrno = errno; ops->close(fd); errno = saveErrno; } return f; } #endif #ifdef TEST #include <_PDCLIB_test.h> int main( void ) { /* Some of the tests are not executed for regression tests, as the libc on my system is at once less forgiving (segfaults on mode NULL) and more forgiving (accepts undefined modes). */ FILE * fh; remove( testfile ); TESTCASE_NOREG( fopen( NULL, NULL ) == NULL ); TESTCASE( fopen( NULL, "w" ) == NULL ); TESTCASE_NOREG( fopen( "", NULL ) == NULL ); TESTCASE( fopen( "", "w" ) == NULL ); TESTCASE( fopen( "foo", "" ) == NULL ); TESTCASE_NOREG( fopen( testfile, "wq" ) == NULL ); /* Undefined mode */ TESTCASE_NOREG( fopen( testfile, "wr" ) == NULL ); /* Undefined mode */ TESTCASE( ( fh = fopen( testfile, "w" ) ) != NULL ); TESTCASE( fclose( fh ) == 0 ); TESTCASE( remove( testfile ) == 0 ); return TEST_RESULTS; } #endif
-- https: import System.Random import Control.Monad (replicateM) main = replicateM 10 (randomIO :: IO Float) >>= print
""" Setuptools configuration for Pubs Warehouse. This setup script requires that static assets have been built into the `assets/dist` directory prior to the build. """ import os from setuptools import setup, find_packages def read_requirements(): """ Get application requirements from the requirements.txt file. :return: portal_ui Python requirements :rtype: list """ with open('requirements.txt', 'r') as req: requirements = req.readlines() install_requires = [r.strip() for r in requirements if r.find('git+') != 0] dependency_links = [r.strip() for r in requirements if r.find('git+') == 0] return {'install_requires': install_requires, 'dependency_links': dependency_links} def read(filepath): """ Read the contents from a file. :param str filepath: path to the file to be read :return: file contents :rtype: str """ with open(filepath, 'r') as file: content = file.read() return content def identify_data_files(data_dirs, exclusions=('.gitignore', '.webassets-cache')): """ Recursively introspect the contents of a directory. Once the contents have been introspected, generate a list directories and sub-directories with their contents as lists. Any files listed in exclusions will not be included as a data file. Please note that the list generated by this function will override any exclusions defined in MANIFEST.in. This means that if one specifies a file to be excluded in MANIFEST.in, but this function includes that file as a data file, then it's going to be in the distributable. :param list data_dirs: list of tuples each of the form: (`installation directory`, `source directory`) the installation directory can be None to preserve the source directory's structure in the wheel's data directory :param tuple exclusions: tuple of all the files or directories NOT to include as a data file :return: all contents of the directories as a list of tuples :rtype: list """ <API key> = [] for <API key>, directory_name in data_dirs: for root, _, files in os.walk(directory_name, followlinks=True): pathnames = [ os.path.relpath(os.path.join(root, filename)) for filename in files if not any(ex in os.path.join(root, filename) for ex in exclusions) ] if pathnames: data_install_path = ( <API key> if <API key> else os.path.relpath(root).strip('../') ) data_file_element = (data_install_path, pathnames) <API key>.append(data_file_element) return <API key> PARSED_REQUIREMENTS = read_requirements() setup( name='usgs_flask_pubs_ui', version='2.26.0dev', description='USGS Publications Warehouse User Interface', long_description=read('../README.md'), author='Mary Bucknell, James Kreft, Andrew Yan', author_email='mbucknell@usgs.gov, jkreft@usgs.gov, ayan@usgs.gov', url='https://github.com/USGS-CIDA/PubsWarehouse_UI', classifiers=[ 'Environment :: Web Environment', 'Framework :: Flask', 'License :: Public Domain', 'Programming Language :: Python :: 3.6' ], packages=find_packages(), <API key>=True, install_requires=PARSED_REQUIREMENTS['install_requires'], test_suite='nose.collector', tests_require=PARSED_REQUIREMENTS['install_requires'], zip_safe=False, # include the tier agnostic configuration file in the distributable # the file gets placed in site-packages upon dist installation py_modules=['config'], # include static files in the distributable # they will appear in the root of the virtualenv upon dist installation data_files=identify_data_files([ (None, 'static') ]) )
/* Generated by camel build tools - do NOT edit this file! */ package org.apache.camel.component.kubernetes.resources_quota; import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.spi.<API key>; import org.apache.camel.spi.<API key>; import org.apache.camel.util.CaseInsensitiveMap; import org.apache.camel.support.component.<API key>; /** * Generated by camel build tools - do NOT edit this file! */ @SuppressWarnings("unchecked") public class <API key> extends <API key> implements <API key>, <API key> { @Override public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) { <API key> target = (<API key>) obj; switch (ignoreCase ? name.toLowerCase() : name) { case "<API key>": case "<API key>": target.<API key>(property(camelContext, boolean.class, value)); return true; case "lazystartproducer": case "lazyStartProducer": target.<API key>(property(camelContext, boolean.class, value)); return true; default: return false; } } @Override public Map<String, Object> getAllOptions(Object target) { Map<String, Object> answer = new CaseInsensitiveMap(); answer.put("<API key>", boolean.class); answer.put("lazyStartProducer", boolean.class); return answer; } @Override public Object getOptionValue(Object obj, String name, boolean ignoreCase) { <API key> target = (<API key>) obj; switch (ignoreCase ? name.toLowerCase() : name) { case "<API key>": case "<API key>": return target.<API key>(); case "lazystartproducer": case "lazyStartProducer": return target.isLazyStartProducer(); default: return null; } } }
// <auto-generated> // This code was generated by a tool. // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> namespace DataTests.Inheritance.LTS { using System; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Runtime.Serialization; using System.ServiceModel; using System.Threading; using System.Threading.Tasks; using OpenRiaServices.DomainServices; using OpenRiaServices.DomainServices.Client; using OpenRiaServices.DomainServices.Client.ApplicationServices; <summary> The 'A' entity class. </summary> [DataContract(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Inheritance.LTS")] [KnownType(typeof(B))] [KnownType(typeof(C))] public abstract partial class A : Entity { private string _address; private string _city; private string _companyName; private string _contactName; private string _contactTitle; private string _country; private string _customerID; private string _postalCode; private string _region; #region Extensibility Method Definitions <summary> This method is invoked from the constructor once initialization is complete and can be used for further object setup. </summary> partial void OnCreated(); partial void OnAddressChanging(string value); partial void OnAddressChanged(); partial void OnCityChanging(string value); partial void OnCityChanged(); partial void <API key>(string value); partial void <API key>(); partial void <API key>(string value); partial void <API key>(); partial void <API key>(string value); partial void <API key>(); partial void OnCountryChanging(string value); partial void OnCountryChanged(); partial void <API key>(string value); partial void OnCustomerIDChanged(); partial void <API key>(string value); partial void OnPostalCodeChanged(); partial void OnRegionChanging(string value); partial void OnRegionChanged(); #endregion <summary> Initializes a new instance of the <see cref="A"/> class. </summary> protected A() { this.OnCreated(); } <summary> Gets or sets the 'Address' value. </summary> [ConcurrencyCheck()] [DataMember()] [RoundtripOriginal()] [StringLength(60)] public string Address { get { return this._address; } set { if ((this._address != value)) { this.OnAddressChanging(value); this.<API key>("Address"); this.ValidateProperty("Address", value); this._address = value; this.<API key>("Address"); this.OnAddressChanged(); } } } <summary> Gets or sets the 'City' value. </summary> [ConcurrencyCheck()] [DataMember()] [RoundtripOriginal()] [StringLength(15)] public string City { get { return this._city; } set { if ((this._city != value)) { this.OnCityChanging(value); this.<API key>("City"); this.ValidateProperty("City", value); this._city = value; this.<API key>("City"); this.OnCityChanged(); } } } <summary> Gets or sets the 'CompanyName' value. </summary> [ConcurrencyCheck()] [DataMember()] [Required()] [RoundtripOriginal()] [StringLength(40)] public string CompanyName { get { return this._companyName; } set { if ((this._companyName != value)) { this.<API key>(value); this.<API key>("CompanyName"); this.ValidateProperty("CompanyName", value); this._companyName = value; this.<API key>("CompanyName"); this.<API key>(); } } } <summary> Gets or sets the 'ContactName' value. </summary> [ConcurrencyCheck()] [DataMember()] [RoundtripOriginal()] [StringLength(30)] public string ContactName { get { return this._contactName; } set { if ((this._contactName != value)) { this.<API key>(value); this.<API key>("ContactName"); this.ValidateProperty("ContactName", value); this._contactName = value; this.<API key>("ContactName"); this.<API key>(); } } } <summary> Gets or sets the 'ContactTitle' value. </summary> [ConcurrencyCheck()] [DataMember()] [RoundtripOriginal()] [StringLength(30)] public string ContactTitle { get { return this._contactTitle; } set { if ((this._contactTitle != value)) { this.<API key>(value); this.<API key>("ContactTitle"); this.ValidateProperty("ContactTitle", value); this._contactTitle = value; this.<API key>("ContactTitle"); this.<API key>(); } } } <summary> Gets or sets the 'Country' value. </summary> [ConcurrencyCheck()] [DataMember()] [RoundtripOriginal()] [StringLength(15)] public string Country { get { return this._country; } set { if ((this._country != value)) { this.OnCountryChanging(value); this.<API key>("Country"); this.ValidateProperty("Country", value); this._country = value; this.<API key>("Country"); this.OnCountryChanged(); } } } <summary> Gets or sets the 'CustomerID' value. </summary> [ConcurrencyCheck()] [DataMember()] [Editable(false, AllowInitialValue=true)] [Key()] [Required()] [RoundtripOriginal()] [StringLength(5)] public string CustomerID { get { return this._customerID; } set { if ((this._customerID != value)) { this.<API key>(value); this.ValidateProperty("CustomerID", value); this._customerID = value; this.<API key>("CustomerID"); this.OnCustomerIDChanged(); } } } <summary> Gets or sets the 'PostalCode' value. </summary> [ConcurrencyCheck()] [DataMember()] [RoundtripOriginal()] [StringLength(10)] public string PostalCode { get { return this._postalCode; } set { if ((this._postalCode != value)) { this.<API key>(value); this.<API key>("PostalCode"); this.ValidateProperty("PostalCode", value); this._postalCode = value; this.<API key>("PostalCode"); this.OnPostalCodeChanged(); } } } <summary> Gets or sets the 'Region' value. </summary> [ConcurrencyCheck()] [DataMember()] [RoundtripOriginal()] [StringLength(15)] public string Region { get { return this._region; } set { if ((this._region != value)) { this.OnRegionChanging(value); this.<API key>("Region"); this.ValidateProperty("Region", value); this._region = value; this.<API key>("Region"); this.OnRegionChanged(); } } } <summary> Computes a value from the key fields that uniquely identifies this entity instance. </summary> <returns>An object instance that uniquely identifies this entity instance.</returns> public override object GetIdentity() { return this._customerID; } } <summary> The 'B' entity class. </summary> [DataContract(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Inheritance.LTS")] public sealed partial class B : A { private string _phone; #region Extensibility Method Definitions <summary> This method is invoked from the constructor once initialization is complete and can be used for further object setup. </summary> partial void OnCreated(); partial void OnPhoneChanging(string value); partial void OnPhoneChanged(); #endregion <summary> Initializes a new instance of the <see cref="B"/> class. </summary> public B() { this.OnCreated(); } <summary> Gets or sets the 'Phone' value. </summary> [ConcurrencyCheck()] [DataMember()] [RoundtripOriginal()] [StringLength(24)] public string Phone { get { return this._phone; } set { if ((this._phone != value)) { this.OnPhoneChanging(value); this.<API key>("Phone"); this.ValidateProperty("Phone", value); this._phone = value; this.<API key>("Phone"); this.OnPhoneChanged(); } } } } <summary> The 'C' entity class. </summary> [DataContract(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Inheritance.LTS")] public sealed partial class C : A { private string _fax; #region Extensibility Method Definitions <summary> This method is invoked from the constructor once initialization is complete and can be used for further object setup. </summary> partial void OnCreated(); partial void OnFaxChanging(string value); partial void OnFaxChanged(); #endregion <summary> Initializes a new instance of the <see cref="C"/> class. </summary> public C() { this.OnCreated(); } <summary> Gets or sets the 'Fax' value. </summary> [ConcurrencyCheck()] [DataMember()] [RoundtripOriginal()] [StringLength(24)] public string Fax { get { return this._fax; } set { if ((this._fax != value)) { this.OnFaxChanging(value); this.<API key>("Fax"); this.ValidateProperty("Fax", value); this._fax = value; this.<API key>("Fax"); this.OnFaxChanged(); } } } } <summary> The DomainContext corresponding to the '<API key>' DomainService. </summary> public sealed partial class <API key> : DomainContext { #region Extensibility Method Definitions <summary> This method is invoked from the constructor once initialization is complete and can be used for further object setup. </summary> partial void OnCreated(); #endregion <summary> Initializes a new instance of the <see cref="<API key>"/> class. </summary> public <API key>() : this(new Uri("<API key>.svc", UriKind.Relative)) { } <summary> Initializes a new instance of the <see cref="<API key>"/> class with the specified service URI. </summary> <param name="serviceUri">The <API key> service URI.</param> public <API key>(Uri serviceUri) : this(DomainContext.CreateDomainClient(typeof(<API key>), serviceUri, false)) { } <summary> Initializes a new instance of the <see cref="<API key>"/> class with the specified <paramref name="domainClient"/>. </summary> <param name="domainClient">The DomainClient instance to use for this DomainContext.</param> public <API key>(DomainClient domainClient) : base(domainClient) { this.OnCreated(); } <summary> Gets the set of <see cref="A"/> entity instances that have been loaded into this <see cref="<API key>"/> instance. </summary> public EntitySet<A> As { get { return base.EntityContainer.GetEntitySet<A>(); } } <summary> Gets an EntityQuery instance that can be used to load <see cref="A"/> entity instances using the 'GetA' query. </summary> <returns>An EntityQuery that can be loaded to retrieve <see cref="A"/> entity instances.</returns> public EntityQuery<A> GetAQuery() { this.ValidateMethod("GetAQuery", null); return base.CreateQuery<A>("GetA", null, false, true); } <summary> Gets an EntityQuery instance that can be used to load <see cref="B"/> entity instances using the 'GetB' query. </summary> <returns>An EntityQuery that can be loaded to retrieve <see cref="B"/> entity instances.</returns> public EntityQuery<B> GetBQuery() { this.ValidateMethod("GetBQuery", null); return base.CreateQuery<B>("GetB", null, false, true); } <summary> Gets an EntityQuery instance that can be used to load <see cref="C"/> entity instances using the 'GetC' query. </summary> <returns>An EntityQuery that can be loaded to retrieve <see cref="C"/> entity instances.</returns> public EntityQuery<C> GetCQuery() { this.ValidateMethod("GetCQuery", null); return base.CreateQuery<C>("GetC", null, false, true); } <summary> Gets an EntityQuery instance that can be used to load <see cref="B"/> entity instances using the 'GetOneB' query. </summary> <returns>An EntityQuery that can be loaded to retrieve <see cref="B"/> entity instances.</returns> public EntityQuery<B> GetOneBQuery() { this.ValidateMethod("GetOneBQuery", null); return base.CreateQuery<B>("GetOneB", null, false, false); } <summary> Gets an EntityQuery instance that can be used to load <see cref="C"/> entity instances using the 'GetOneC' query. </summary> <returns>An EntityQuery that can be loaded to retrieve <see cref="C"/> entity instances.</returns> public EntityQuery<C> GetOneCQuery() { this.ValidateMethod("GetOneCQuery", null); return base.CreateQuery<C>("GetOneC", null, false, false); } <summary> Asynchronously invokes the 'InvokeOnB' method of the DomainService. </summary> <param name="b">The value for the 'b' parameter of this action.</param> <param name="callback">Callback to invoke when the operation completes.</param> <param name="userState">Value to pass to the callback. It can be <c>null</c>.</param> <returns>An operation instance that can be used to manage the asynchronous request.</returns> public InvokeOperation<int> InvokeOnB(B b, Action<InvokeOperation<int>> callback, object userState) { Dictionary<string, object> parameters = new Dictionary<string, object>(); parameters.Add("b", b); this.ValidateMethod("InvokeOnB", parameters); return this.InvokeOperation<int>("InvokeOnB", typeof(int), parameters, true, callback, userState); } <summary> Asynchronously invokes the 'InvokeOnB' method of the DomainService. </summary> <param name="b">The value for the 'b' parameter of this action.</param> <returns>An operation instance that can be used to manage the asynchronous request.</returns> public InvokeOperation<int> InvokeOnB(B b) { Dictionary<string, object> parameters = new Dictionary<string, object>(); parameters.Add("b", b); this.ValidateMethod("InvokeOnB", parameters); return this.InvokeOperation<int>("InvokeOnB", typeof(int), parameters, true, null, null); } <summary> Asynchronously invokes the 'InvokeOnB' method of the DomainService. </summary> <param name="b">The value for the 'b' parameter of this action.</param> <param name="cancellationToken">A cancellation token that can be used to cancel the work</param> <returns>An operation instance that can be used to manage the asynchronous request.</returns> public System.Threading.Tasks.Task<InvokeResult<int>> InvokeOnBAsync(B b, Cancellation<API key> = default(CancellationToken)) { Dictionary<string, object> parameters = new Dictionary<string, object>(); parameters.Add("b", b); this.ValidateMethod("InvokeOnB", parameters); return this.<API key><int>("InvokeOnB", parameters, true, cancellationToken); } <summary> Creates a new EntityContainer for this DomainContext's EntitySets. </summary> <returns>A new container instance.</returns> protected override EntityContainer <API key>() { return new <API key>(); } <summary> Service contract for the '<API key>' DomainService. </summary> [ServiceContract()] public interface <API key> { <summary> Asynchronously invokes the 'GetA' operation. </summary> <param name="callback">Callback to invoke on completion.</param> <param name="asyncState">Optional state object.</param> <returns>An IAsyncResult that can be used to monitor the request.</returns> [HasSideEffects(false)] [OperationContract(AsyncPattern=true, Action="http: IAsyncResult BeginGetA(AsyncCallback callback, object asyncState); <summary> Completes the asynchronous operation begun by 'BeginGetA'. </summary> <param name="result">The IAsyncResult returned from 'BeginGetA'.</param> <returns>The 'QueryResult' returned from the 'GetA' operation.</returns> QueryResult<A> EndGetA(IAsyncResult result); <summary> Asynchronously invokes the 'GetB' operation. </summary> <param name="callback">Callback to invoke on completion.</param> <param name="asyncState">Optional state object.</param> <returns>An IAsyncResult that can be used to monitor the request.</returns> [HasSideEffects(false)] [OperationContract(AsyncPattern=true, Action="http: IAsyncResult BeginGetB(AsyncCallback callback, object asyncState); <summary> Completes the asynchronous operation begun by 'BeginGetB'. </summary> <param name="result">The IAsyncResult returned from 'BeginGetB'.</param> <returns>The 'QueryResult' returned from the 'GetB' operation.</returns> QueryResult<B> EndGetB(IAsyncResult result); <summary> Asynchronously invokes the 'GetC' operation. </summary> <param name="callback">Callback to invoke on completion.</param> <param name="asyncState">Optional state object.</param> <returns>An IAsyncResult that can be used to monitor the request.</returns> [HasSideEffects(false)] [OperationContract(AsyncPattern=true, Action="http: IAsyncResult BeginGetC(AsyncCallback callback, object asyncState); <summary> Completes the asynchronous operation begun by 'BeginGetC'. </summary> <param name="result">The IAsyncResult returned from 'BeginGetC'.</param> <returns>The 'QueryResult' returned from the 'GetC' operation.</returns> QueryResult<C> EndGetC(IAsyncResult result); <summary> Asynchronously invokes the 'GetOneB' operation. </summary> <param name="callback">Callback to invoke on completion.</param> <param name="asyncState">Optional state object.</param> <returns>An IAsyncResult that can be used to monitor the request.</returns> [HasSideEffects(false)] [OperationContract(AsyncPattern=true, Action="http: IAsyncResult BeginGetOneB(AsyncCallback callback, object asyncState); <summary> Completes the asynchronous operation begun by 'BeginGetOneB'. </summary> <param name="result">The IAsyncResult returned from 'BeginGetOneB'.</param> <returns>The 'QueryResult' returned from the 'GetOneB' operation.</returns> QueryResult<B> EndGetOneB(IAsyncResult result); <summary> Asynchronously invokes the 'GetOneC' operation. </summary> <param name="callback">Callback to invoke on completion.</param> <param name="asyncState">Optional state object.</param> <returns>An IAsyncResult that can be used to monitor the request.</returns> [HasSideEffects(false)] [OperationContract(AsyncPattern=true, Action="http: IAsyncResult BeginGetOneC(AsyncCallback callback, object asyncState); <summary> Completes the asynchronous operation begun by 'BeginGetOneC'. </summary> <param name="result">The IAsyncResult returned from 'BeginGetOneC'.</param> <returns>The 'QueryResult' returned from the 'GetOneC' operation.</returns> QueryResult<C> EndGetOneC(IAsyncResult result); <summary> Asynchronously invokes the 'InvokeOnB' operation. </summary> <param name="b">The value for the 'b' parameter of this action.</param> <param name="callback">Callback to invoke on completion.</param> <param name="asyncState">Optional state object.</param> <returns>An IAsyncResult that can be used to monitor the request.</returns> [HasSideEffects(true)] [OperationContract(AsyncPattern=true, Action="http: IAsyncResult BeginInvokeOnB(B b, AsyncCallback callback, object asyncState); <summary> Completes the asynchronous operation begun by 'BeginInvokeOnB'. </summary> <param name="result">The IAsyncResult returned from 'BeginInvokeOnB'.</param> <returns>The 'Int32' returned from the 'InvokeOnB' operation.</returns> int EndInvokeOnB(IAsyncResult result); <summary> Asynchronously invokes the 'SubmitChanges' operation. </summary> <param name="changeSet">The change-set to submit.</param> <param name="callback">Callback to invoke on completion.</param> <param name="asyncState">Optional state object.</param> <returns>An IAsyncResult that can be used to monitor the request.</returns> [OperationContract(AsyncPattern=true, Action="http: IAsyncResult BeginSubmitChanges(IEnumerable<ChangeSetEntry> changeSet, AsyncCallback callback, object asyncState); <summary> Completes the asynchronous operation begun by 'BeginSubmitChanges'. </summary> <param name="result">The IAsyncResult returned from 'BeginSubmitChanges'.</param> <returns>The collection of change-set entry elements returned from 'SubmitChanges'.</returns> IEnumerable<ChangeSetEntry> EndSubmitChanges(IAsyncResult result); } internal sealed class <API key> : EntityContainer { public <API key>() { this.CreateEntitySet<A>(EntitySetOperations.Edit); } } } }
#include <cstring> #include "stringrep.h" StringRep::StringRep(const char *s) : _count(1) { _rep = new char[strlen(s)+1]; strcpy(_rep, s); } StringRep::~StringRep() { delete [] _rep; }
Release log: 2016-04-13 Release 3.0.5 klightspeed: 3dMaps Beeing able to show multiple maps on the Y=0 plane, and being able to filter by expedition or by date. Add support for map textures to 3D map Order maps by order clicked Add ability to filter 3DMap visited systems by date Camera now centers correctly on requested system again. Improves the performance of the 3D map significantly by using Vertex Buffer Objects. This along with Vsync should give smooth movement using the keyboard. Reduce the amount of CPU and GPU time being used when no movement is occurring, and stops the map being updated when the map window is not active, as requested in #60. This should also fix #161. Set active commander when saving netlogs Iainross; Prevent error centring 3D map on nonexistent system Merge remote-tracking branch 'blessed/master' Prevent error clicking on header row of wanted systems list Finwen: Added a custom toolstrip renderer. To make theming of menues and toolsstrip (still some work to do) Solved some exceptions usesers reported. Added a button to show all stars on 2D Map. Probably solved a expeption in 3D graph some users get then using a XBox controller. 2016-04-05 Release 3.0.4 Iainross: 3D Map is now centred properly and references lines drawn correctly when launched from the trilateration tab if default centre is set to Home System. Added 3D Map button to Route tab, plotted route is drawn onto the map when launched from there. Added 'Add to trilateration' context menu to Nearest Systems grid on Travel History control. Added context menu to Distances grid on trilateration to copy systems to wanted systems list - local wanted systems are shown in the wanted systems grid, can be added to the distances grid by clicking and are persisted between sessions. Added context menu to Wanted Systems grid on trilateration for deletion of locally added Wanted Systems. Corrected check that systems are known on EDSM so it works again (site has started returning [] rather than -1 for bad system names) Systems can be added to wanted from travel history klightspeed: 3DMap updates This adds the option for perspective rendering as an alternative to the current orthogonal rendering. This also maps Right-drag to Y-axis translation, and Left+Right-drag to panning on the X and Z axes. This adds the ability to see what star is at a given position in the 3D map, and to center the map on that star. A single-click on a star will select the star, but not set it as the center system. Double-clicking on a star will select the star, set it as the center system, and center the map on it. It was suggested in #160 that when the centered system is changed, the camera angle should not change. This implements this, and also slews the camera in order to reduce confusion as to where the camera moved to. This currently uses a sinusoidal velocity curve with a fixed 1 second slew duration regardless of distance or zoom. Clicking the mouse or pressing a movement button cancels the slew. Finwen: Fix rare exception in GetSystemsCount function After 3d map was opened the close button failed to exit EDDiscovery 2016-03-23 Beta 3.0.0 * First version of Theme support. (Robby) * Perform log file parsing using a regular expression Fixes bug then ED logs position incorrectly (Myshka) * Prevent runtime error on deleting distance in trilateration. (Ian666) * Check for actual current system when clicking the Trilaterate button (Ian666) * Update to routing (Robby) * Reduced memory usage for distances. (Finwen) 2016-03-13 Version 2.7.6 * Solve a DirectoryInfo exception then path is not valid. * Get pushed systems from EDSM in a thread so UI do not need to wait for request.. * Show a messagebox if another EDDiscovery is running 2016-03-11 Version 2.7.5 * Changed EDSM sync option from Full/Push only to 2 checkboxes with ToEDSM/FromEDSM * Shows Wanted systems from EDSM instead of Closestsystems for last known positions in tril tab. * Support for DW4 map in 2DMaps * Check so we only start one EDDiscovery (mwerle). * Add Help -> About Box. * Allot of improvments in Routing (Robby) * Bug fix: with duplicate entries in Trilateration View (mwerle) * Bug fix: add additional checks for NULL system (mwerle) * Lots of improvment in imageconversion from Robby Rewrite of the Image conversion to fix issues picking Problem with deleting files which have been cropped. Added more output file formats Fixed it so it renames them _1, _2 if multiples exist Can delete if you crop. Have checked it for cropping, deleting, both, all formats, BMP warning * Trilateration UI improvements (mwerle) * Allow sending distances to systems if current system has known coordinates without trilaterating (mwerle). * Automatically copy "Last System" to clipboard when control is activated (mwerle) 2016-02-19 Version 2.7.4 * Removed systems from Proving ground * Multicommander bug fix: Forst commander did read EDSM api key from commander 2.... 2016-02-17 Version 2.7.3 Robby: Can write note directly in the travelhistorylist now! Mwerle : Trilateration: Tab skip over readonly fields So pressing tab in distance field moves you to next system name. Iain: Option to only send travelhistory to EDSM. Iain: Bugfix with logfiles passing over midnight. Mwerle: Option to croop image on conversion. Mwerle: Menu to copy selected systems from Travelhistory to trilateration. Finwen: Better switching between multicommandes. Finwen: Trilateration Tab to systemname copes name to clipboard (no need to do CTRL+C) 2016-01-03 Version 2.6.2 3DMap * 3DMap now open maximized * Created keyboard bindings (WASDG) to travel around in the galaxy. * Can transform the camera in all directions and rotations * Statusbar with information about position and more. * Grid 2DMap * Support for the new map of the whole galaxy made by Finwen and Marlon Blake 2016-12-28 Version 2.6.1 3dMap *Show All known stars (on/off) *Show all known stations (On/off) EDDB: *Bug: did not update system with population information from EDDB. *Added in Admin menu a item to Force EDDB update. EDSM *Optional logging of EDSM communication 2015-11-04 Version 2.5.2 * Stores Travel log in local DB. * Can sync Travellog with EDSM and sync log with several computers. * Trilateration window enchanced. Copy systemname to clipboard on click. (No need to CTRL+C anymore.) 3D map in trilateration window shows lines to reference stars. Added icons to Remove unused references and to remove all. 2015-09-04 Version 2.4.8 * Support for 2D maps made by Corbin Moran * Autoconvert ED screenshots to png or jpeg and renames them to Systemname with time. * Better integration with EDSM * Trilateration is now better on suggesting good reference stars 2015-08-04 Version 2.3.7 * Moved trilateration to an own tab. * Trilateration has a 3d star map button that show reference systems and suggested references- * Star map works again * Travel history age selection will remember the selection to next usage. And we added last 20 systems as option. * EDStarCoordinator homepage has been down allot last days so we now have support for EDSM also. * Moved status login to bottom of window. * Can select installation directory 2015-07-10 Version 2.3.5 * The search box now moves when the window is resized * New alternate installer instead of the auto updating click once installer. Also checks if new installer is available. * 3d map did show government instead of normal plotting... 2015-07-10 Version 2.3.4 * Search in travel history. Search works on all fields. So you can search for a system name or something in your notes. * Downloaded json files from EDDB and EDSC is now stored in appdata instead of current directory. This is for the the future (next version) alternative installer that will a more regular installer instead of the current auto updating clickonce installer. Both installers will be available. * EDDiscovery should not xrach if netlogmain has invalid path 2015-06-26 Version 2.3.0 Together with Cmdr Majkl we have created allot of new things in this version. * Trilateration routine to get coordinates for unknown stars. * Eddiscovery also creates an AppConfigLocal.xml file to automatically to add verbose logging in ED. * EDDiscovery starts faster with more work running in different threads. * Easy way to add distance to next system. * And a long list of other small bugfixes and small changes. 2016-06-18 Version 2.2.0 * Updates UI better during startuo. * Travel history list is allot faster. * EDDB integration. Get data about systems from http://EDDB.io Added 2 buttons to view a system in eddb or edit information i Ross. 2015-06-14 Version 2.1.27 * Allow regions with , as decimal separator to also use . as decimal separator * Test button removed.. * Added more time span options (6 hrs, 12 hrs, 3 days, 2 weeks) - Thanks Majkl 2015-06-12 Version 2.1.26 * Much smaller installation package. Instead of bundling corrected TGC data from Redwizzard EDDiscovery now checks if a new version exists on my mirrored server and then download it on demand. 2015-06-10 Version 2.1.25 * Shows how many visits you have done to a system. * Added some statistics Tolls menu and Statistics open up a form with some statistics. Will add more later. 2015-05-07 Version 2.1.22 * Refresh in travel history now gets new systems from EDSC. * New corrected star database from Redwizzard. 2015-05-05 Version 2.1.21 * I had inverted Z axis in the 3d map. Should be correct now. * Now shows coordinates for a system with full precision. 2014-04-24 Version 2.1.18 Only some small changes in this update * Getting distances from EDSC in a thread -> EDDiscovery stars allot faster * Added a menu. With links to forum threads and quick ways to open Elite Dangerous directory and the log file directory.
#include <sys/cdefs.h> #if !defined(lint) __RCSID("$NetBSD: util.c,v 1.1 2004/07/02 00:05:23 sjg Exp $"); #endif /* not lint */ #include <sys/types.h> #include "crypt.h" static const unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */ "./<API key>"; void __crypt_to64(char *s, u_int32_t v, int n) { while (--n >= 0) { *s++ = itoa64[v & 0x3f]; v >>= 6; } }
"""Helpers for testing Met Office DataPoint.""" from homeassistant.components.metoffice.const import DOMAIN from homeassistant.const import CONF_API_KEY, CONF_LATITUDE, CONF_LONGITUDE, CONF_NAME <API key> = "2020-04-25T12:00:00+00:00" TEST_<TwitterConsumerkey>" <API key> = 53.38374 <API key> = -2.90929 <API key> = "Wavertree" <API key> = 52.75556 <API key> = 0.44231 <API key> = "King's Lynn" <API key> = { CONF_<TwitterConsumerkey>, CONF_LATITUDE: <API key>, CONF_LONGITUDE: <API key>, CONF_NAME: <API key>, } <API key> = { CONF_<TwitterConsumerkey>, CONF_LATITUDE: <API key>, CONF_LONGITUDE: <API key>, CONF_NAME: <API key>, } <API key> = { "weather": ("weather", "sunny"), "visibility": ("visibility", "Very Good"), "visibility_distance": ("visibility_distance", "20-40"), "temperature": ("temperature", "14"), "<API key>": ("<API key>", "13"), "uv": ("uv_index", "6"), "precipitation": ("<API key>", "0"), "wind_direction": ("wind_direction", "E"), "wind_gust": ("wind_gust", "7"), "wind_speed": ("wind_speed", "2"), "humidity": ("humidity", "60"), } <API key> = { "weather": ("weather", "sunny"), "visibility": ("visibility", "Good"), "visibility_distance": ("visibility_distance", "10-20"), "temperature": ("temperature", "17"), "<API key>": ("<API key>", "14"), "uv": ("uv_index", "5"), "precipitation": ("<API key>", "0"), "wind_direction": ("wind_direction", "SSE"), "wind_gust": ("wind_gust", "16"), "wind_speed": ("wind_speed", "9"), "humidity": ("humidity", "50"), } <API key> = { (DOMAIN, f"{<API key>}_{<API key>}") } <API key> = { (DOMAIN, f"{<API key>}_{<API key>}") }
package org.jnbis.internal.record.reader; import org.jnbis.internal.NistHelper; import org.jnbis.api.model.record.<API key>; /** * @author ericdsoto */ public class <API key> extends RecordReader { @Override public <API key> read(NistHelper.Token token) { if (token.pos >= token.buffer.length) { throw new RuntimeException("T1::NULL pointer to T1 record"); } <API key> transaction = new <API key>(); while (true) { NistHelper.Tag tag = getTagInfo(token); if (tag.type != NistHelper.RT_TRANSACTION_INFO) { throw new RuntimeException("T1::Invalid Record Type : " + tag.type); } String value = nextWord(token, NistHelper.TAG_SEP_GSFS, NistHelper.FIELD_MAX_LENGTH - 1, false); switch(tag.field) { case 1: transaction.<API key>(value); break; case 2: transaction.setVersion(value); break; case 3: token.header = value; transaction.setFileContent(value); break; case 4: transaction.<API key>(value); break; case 5: transaction.setDate(value); break; case 6: transaction.setPriority(value); break; case 7: transaction.<API key>(value); break; case 8: transaction.<API key>(value); break; case 9: transaction.setControlNumber(value); break; case 10: transaction.<API key>(value); break; case 11: transaction.<API key>(value); break; case 12: transaction.<API key>(value); break; case 13: transaction.setDomainName(value); break; case 14: transaction.<API key>(value); break; case 15: token.setCharSetDecoder(value); transaction.<API key>(value); break; } if (token.buffer[token.pos++] == NistHelper.SEP_FS) { break; } } return transaction; } }
$(document).ready(function() { var form = $('#form1'); form.submit(function () { $.post({ type: "post", url: "UserServlet", data: value, success: function (data) { var result = data; $('#login').html(result); } }); return false; }); })
package org.chromium.chrome.browser.fullscreen; import org.chromium.chrome.browser.tab.<API key>; import java.util.ArrayList; import java.util.List; /** * Delegate for the visibility of browser controls that combines the results of other delegates. */ public class <API key> implements <API key> { private final List<<API key>> mDelegates; /** * Constructs a composed visibility delegate that will generate results based on the delegates * passed in. */ public <API key>( <API key>... delegates) { mDelegates = new ArrayList<>(); for (int i = 0; i < delegates.length; i++) mDelegates.add(delegates[i]); } @Override public boolean <API key>() { for (int i = 0; i < mDelegates.size(); i++) { if (!mDelegates.get(i).<API key>()) return false; } return true; } @Override public boolean <API key>() { for (int i = 0; i < mDelegates.size(); i++) { if (!mDelegates.get(i).<API key>()) return false; } return true; } }
# Running Exporters Running exporters and scraping them with Prometheus configured by the prometheus-operator. ## The goal of ServiceMonitor(s) The goal for one ServiceMonitor should be to cover a large number of `Service`s. This can be achieved by creating a generic `ServiceMonitor`. ## Create a service that exposes Pod(s) For scraping an exporter or separate metrics port you need a service that targets the pod(s) of the exporter or application. An example for the `kube-state-metrics` is the below `Service` and a generic `ServiceMonitor` that covers more than just the `kube-state-metrics` `Service`. After you have created the `Service`, you then continue on by creating the `ServiceMonitor` for it. The order in which the `Service` and `ServiceMonitor` is created is not important. `kube-state-metrics` Service example apiVersion: v1 kind: Service metadata: labels: app: kube-state-metrics k8s-app: kube-state-metrics annotations: alpha.monitoring.coreos.com/non-namespaced: "true" name: kube-state-metrics spec: ports: - name: http-metrics port: 8080 targetPort: metrics protocol: TCP selector: app: kube-state-metrics This Service targets all pods with the label `k8s-app: kube-state-metrics`. ## Create a matching ServiceMonitor Generic `ServiceMonitor` example apiVersion: monitoring.coreos.com/v1alpha1 kind: ServiceMonitor metadata: name: k8s-apps-http labels: k8s-apps: http spec: jobLabel: k8s-app selector: matchExpressions: - {key: k8s-app, operator: Exists} namespaceSelector: matchNames: - kube-system - monitoring endpoints: - port: http-metrics interval: 15s (A better example for monitoring Kubernetes cluster components can be found [User Guide "Cluster Monitoring"](user-guides/cluster-monitoring.md)) This ServiceMonitor targets **all** Services with the label `k8s-app` (`spec.selector`) any value, in the namespaces `kube-system` and `monitoring` (`spec.namespaceSelector`). ## Troubleshooting Namespace "limits"/things to keep in mind See the ServiceMonitor Documentation: > While `ServiceMonitor`s must live in the same namespace as the `Prometheus` TPR, discovered targets may come from any namespace. This is important to allow cross-namespace monitoring use cases, e.g. for meta-monitoring. Using the `namespaceSelector` of the `ServiceMonitorSpec`, one can restrict the namespaces the `Endpoints` objects are allowed to be discovered from.
var merge$ = function() { function isNestedObject(obj) { return (obj !== null && obj !== undefined && typeof obj === 'object' && !(obj instanceof Array)); } function hasOwnProp(source, property) { var hasProp = false; if(property.match(/^merge/)) return hasProp; try{ hasProp = source.hasOwnProperty(property); } catch(e){ hasProp = !!source[property]; } return hasProp; } var args = Array.prototype.slice.call(arguments); var target = args[0]; var source; for (var i=1,length=args.length; i<length; i++) { source = args[i]; if (source) { for (var property in source) { if (hasOwnProp(source, property)) { if (isNestedObject(target[property]) && isNestedObject(source[property])) { target[property] = merge(target[property],source[property]); } else { target[property] = source[property]; } } } } } return target; }; var merge = function() { var args = Array.prototype.slice.call(arguments); args.unshift({}); return merge$.apply(null,args); }; module.exports = merge;
package org.camunda.bpm.engine; /** * Runtime exception indicating the requested class was not found or an error occurred * while loading the class. * * @author Frederik Heremans */ public class <API key> extends <API key> { private static final long serialVersionUID = 1L; protected String className; public <API key>(String message, Throwable cause) { super(message, cause); } public <API key>(String message, String className, Throwable cause) { this(message, cause); this.className = className; } /** * Returns the name of the class this exception is related to. */ public String getClassName() { return className; } }
CKEDITOR.plugins.setLang( 'uicolor', 'vi', { uicolor : { title : 'Giao diện người dùng Color Picker', preview : 'Xem trước trực tiếp', config : 'Dán chuỗi này vào tập tin config.js của bạn', predefined : 'Tập màu định nghĩa sẵn' } });
// file at the top-level directory of this distribution and at // option. This file may not be copied, modified, or distributed // except according to those terms. #[derive(Clone, Show)] enum foo { a(uint), b(String), } fn check_log<T: std::fmt::Show>(exp: String, v: T) { assert_eq!(exp, format!("{:?}", v)); } pub fn main() { let mut x = Some(foo::a(22u)); let exp = "Some(a(22u))".to_string(); let act = format!("{:?}", x); assert_eq!(act, exp); check_log(exp, x); x = None; let exp = "None".to_string(); let act = format!("{:?}", x); assert_eq!(act, exp); check_log(exp, x); }
#ifndef <API key> #define <API key> #pragma message("AutoGemm's <API key> overriden by user.") #ifndef STRINGIFY #define STRINGIFY(S) STRINGIFY2(S) #define STRINGIFY2(S) #endif const unsigned int <API key> = 8; const unsigned int <API key> = 8; const unsigned int <API key> = 6; const unsigned int <API key> = 6; const unsigned int <API key> = 8; const char * const <API key> = STRINGIFY( \n \ntypedef union _GPtr { \n __global float *f; \n __global double *d; \n __global float2 *f2v; \n __global double2 *d2v; \n} GPtr; \n #define M6x6 \ rA[0] = lA[offA + 0]; \ rA[1] = lA[offA + 1]; \ rA[2] = lA[offA + 16]; \ rA[3] = lA[offA + 17]; \ rA[4] = lA[offA + 32]; \ rA[5] = lA[offA + 33]; \ rB[0] = lB[offB + 0]; \ rB[1] = lB[offB + 1]; \ rB[2] = lB[offB + 16]; \ rB[3] = lB[offB + 17]; \ rB[4] = lB[offB + 32]; \ rB[5] = lB[offB + 33]; \ offA += 48; \ offB += 48; \ rC[0][0] = mad(rA[0],rB[0],rC[0][0]); \ rC[0][1] = mad(rA[1],rB[0],rC[0][1]); \ rC[0][2] = mad(rA[2],rB[0],rC[0][2]); \ rC[0][3] = mad(rA[3],rB[0],rC[0][3]); \ rC[0][4] = mad(rA[4],rB[0],rC[0][4]); \ rC[0][5] = mad(rA[5],rB[0],rC[0][5]); \ rC[1][0] = mad(rA[0],rB[1],rC[1][0]); \ rC[1][1] = mad(rA[1],rB[1],rC[1][1]); \ rC[1][2] = mad(rA[2],rB[1],rC[1][2]); \ rC[1][3] = mad(rA[3],rB[1],rC[1][3]); \ rC[1][4] = mad(rA[4],rB[1],rC[1][4]); \ rC[1][5] = mad(rA[5],rB[1],rC[1][5]); \ rC[2][0] = mad(rA[0],rB[2],rC[2][0]); \ rC[2][1] = mad(rA[1],rB[2],rC[2][1]); \ rC[2][2] = mad(rA[2],rB[2],rC[2][2]); \ rC[2][3] = mad(rA[3],rB[2],rC[2][3]); \ rC[2][4] = mad(rA[4],rB[2],rC[2][4]); \ rC[2][5] = mad(rA[5],rB[2],rC[2][5]); \ rC[3][0] = mad(rA[0],rB[3],rC[3][0]); \ rC[3][1] = mad(rA[1],rB[3],rC[3][1]); \ rC[3][2] = mad(rA[2],rB[3],rC[3][2]); \ rC[3][3] = mad(rA[3],rB[3],rC[3][3]); \ rC[3][4] = mad(rA[4],rB[3],rC[3][4]); \ rC[3][5] = mad(rA[5],rB[3],rC[3][5]); \ rC[4][0] = mad(rA[0],rB[4],rC[4][0]); \ rC[4][1] = mad(rA[1],rB[4],rC[4][1]); \ rC[4][2] = mad(rA[2],rB[4],rC[4][2]); \ rC[4][3] = mad(rA[3],rB[4],rC[4][3]); \ rC[4][4] = mad(rA[4],rB[4],rC[4][4]); \ rC[4][5] = mad(rA[5],rB[4],rC[4][5]); \ rC[5][0] = mad(rA[0],rB[5],rC[5][0]); \ rC[5][1] = mad(rA[1],rB[5],rC[5][1]); \ rC[5][2] = mad(rA[2],rB[5],rC[5][2]); \ rC[5][3] = mad(rA[3],rB[5],rC[5][3]); \ rC[5][4] = mad(rA[4],rB[5],rC[5][4]); \ rC[5][5] = mad(rA[5],rB[5],rC[5][5]); \ mem_fence(CLK_LOCAL_MEM_FENCE);\n \n \n \n__attribute__((<API key>(8,8,1))) \n__kernel void <API key> ( \n __global double2 const * restrict A, \n __global double2 const * restrict B, \n __global double * C, \n double const alpha, \n double const beta, \n uint const M, \n uint const N, \n uint const K, \n uint lda, \n uint ldb, \n uint ldc, \n uint offsetA, \n uint offsetB, \n uint offsetC) \n{ \n GPtr uA; \n GPtr uB; \n uA.d2v = (__global double2 *)A; \n uB.d2v = (__global double2 *)B; \n \n uA.d += offsetA; \n uB.d += offsetB; \n C += offsetC; \n \n \n double rC[6][6] = {(double)0}; \n double rA[6]; \n double rB[6]; \n \n __local double lA[392]; \n __local double lB[392]; \n \n int gidx = get_group_id(0); \n int gidy = get_group_id(1); \n int idx = get_local_id(0); \n int idy = get_local_id(1); \n \n \n uA.d += 2*(gidx*24 + idx) + idy*lda; \n uB.d += 2*(gidy*24 + idx) + idy*ldb; \n \n int block_k = K >> 3; \n do { \n __local double2* plA = (__local double2*)(lA + idy*48 + 2*idx); \n __local double2* plB = (__local double2*)(lB + idy*48 + 2*idx); \n barrier(CLK_LOCAL_MEM_FENCE); \n plB[0 ] = uB.d2v[0 ]; \n plB[8 ] = uB.d2v[8 ]; \n plB[16] = uB.d2v[16]; \n plA[0 ] = uA.d2v[0 ]; \n plA[8 ] = uA.d2v[8 ]; \n plA[16] = uA.d2v[16]; \n \n barrier(CLK_LOCAL_MEM_FENCE); \n int offA = idx << 1; \n int offB = idy << 1; \n M6x6 \n M6x6 \n M6x6 \n M6x6 \n M6x6 \n M6x6 \n M6x6 \n M6x6 \n uA.d += lda << 3; \n uB.d += ldb << 3; \n } while (--block_k > 0); \n \n int offset_x = gidx*48+ idx*2; \n int offset_y = gidy*48+ idy*2; \n (C[(offset_x + 0) + (offset_y + 0) * ldc] = mad(beta, C[(offset_x + 0) + (offset_y + 0) * ldc], alpha * rC[0][0])); \n (C[(offset_x + 1) + (offset_y + 0) * ldc] = mad(beta, C[(offset_x + 1) + (offset_y + 0) * ldc], alpha * rC[0][1])); \n (C[(offset_x + 0) + (offset_y + 1) * ldc] = mad(beta, C[(offset_x + 0) + (offset_y + 1) * ldc], alpha * rC[1][0])); \n (C[(offset_x + 1) + (offset_y + 1) * ldc] = mad(beta, C[(offset_x + 1) + (offset_y + 1) * ldc], alpha * rC[1][1])); \n (C[(offset_x + 0) + (offset_y + 16) * ldc] = mad(beta, C[(offset_x + 0) + (offset_y + 16) * ldc], alpha * rC[2][0])); \n (C[(offset_x + 1) + (offset_y + 16) * ldc] = mad(beta, C[(offset_x + 1) + (offset_y + 16) * ldc], alpha * rC[2][1])); \n (C[(offset_x + 0) + (offset_y + 17) * ldc] = mad(beta, C[(offset_x + 0) + (offset_y + 17) * ldc], alpha * rC[3][0])); \n (C[(offset_x + 1) + (offset_y + 17) * ldc] = mad(beta, C[(offset_x + 1) + (offset_y + 17) * ldc], alpha * rC[3][1])); \n (C[(offset_x + 0) + (offset_y + 32) * ldc] = mad(beta, C[(offset_x + 0) + (offset_y + 32) * ldc], alpha * rC[4][0])); \n (C[(offset_x + 1) + (offset_y + 32) * ldc] = mad(beta, C[(offset_x + 1) + (offset_y + 32) * ldc], alpha * rC[4][1])); \n (C[(offset_x + 0) + (offset_y + 33) * ldc] = mad(beta, C[(offset_x + 0) + (offset_y + 33) * ldc], alpha * rC[5][0])); \n (C[(offset_x + 1) + (offset_y + 33) * ldc] = mad(beta, C[(offset_x + 1) + (offset_y + 33) * ldc], alpha * rC[5][1])); \n (C[(offset_x + 16) + (offset_y + 0) * ldc] = mad(beta, C[(offset_x + 16) + (offset_y + 0) * ldc], alpha * rC[0][2])); \n (C[(offset_x + 17) + (offset_y + 0) * ldc] = mad(beta, C[(offset_x + 17) + (offset_y + 0) * ldc], alpha * rC[0][3])); \n (C[(offset_x + 16) + (offset_y + 1) * ldc] = mad(beta, C[(offset_x + 16) + (offset_y + 1) * ldc], alpha * rC[1][2])); \n (C[(offset_x + 17) + (offset_y + 1) * ldc] = mad(beta, C[(offset_x + 17) + (offset_y + 1) * ldc], alpha * rC[1][3])); \n (C[(offset_x + 16) + (offset_y + 16) * ldc] = mad(beta, C[(offset_x + 16) + (offset_y + 16) * ldc], alpha * rC[2][2])); \n (C[(offset_x + 17) + (offset_y + 16) * ldc] = mad(beta, C[(offset_x + 17) + (offset_y + 16) * ldc], alpha * rC[2][3])); \n (C[(offset_x + 16) + (offset_y + 17) * ldc] = mad(beta, C[(offset_x + 16) + (offset_y + 17) * ldc], alpha * rC[3][2])); \n (C[(offset_x + 17) + (offset_y + 17) * ldc] = mad(beta, C[(offset_x + 17) + (offset_y + 17) * ldc], alpha * rC[3][3])); \n (C[(offset_x + 16) + (offset_y + 32) * ldc] = mad(beta, C[(offset_x + 16) + (offset_y + 32) * ldc], alpha * rC[4][2])); \n (C[(offset_x + 17) + (offset_y + 32) * ldc] = mad(beta, C[(offset_x + 17) + (offset_y + 32) * ldc], alpha * rC[4][3])); \n (C[(offset_x + 16) + (offset_y + 33) * ldc] = mad(beta, C[(offset_x + 16) + (offset_y + 33) * ldc], alpha * rC[5][2])); \n (C[(offset_x + 17) + (offset_y + 33) * ldc] = mad(beta, C[(offset_x + 17) + (offset_y + 33) * ldc], alpha * rC[5][3])); \n (C[(offset_x + 32) + (offset_y + 0) * ldc] = mad(beta, C[(offset_x + 32) + (offset_y + 0) * ldc], alpha * rC[0][4])); \n (C[(offset_x + 33) + (offset_y + 0) * ldc] = mad(beta, C[(offset_x + 33) + (offset_y + 0) * ldc], alpha * rC[0][5])); \n (C[(offset_x + 32) + (offset_y + 1) * ldc] = mad(beta, C[(offset_x + 32) + (offset_y + 1) * ldc], alpha * rC[1][4])); \n (C[(offset_x + 33) + (offset_y + 1) * ldc] = mad(beta, C[(offset_x + 33) + (offset_y + 1) * ldc], alpha * rC[1][5])); \n (C[(offset_x + 32) + (offset_y + 16) * ldc] = mad(beta, C[(offset_x + 32) + (offset_y + 16) * ldc], alpha * rC[2][4])); \n (C[(offset_x + 33) + (offset_y + 16) * ldc] = mad(beta, C[(offset_x + 33) + (offset_y + 16) * ldc], alpha * rC[2][5])); \n (C[(offset_x + 32) + (offset_y + 17) * ldc] = mad(beta, C[(offset_x + 32) + (offset_y + 17) * ldc], alpha * rC[3][4])); \n (C[(offset_x + 33) + (offset_y + 17) * ldc] = mad(beta, C[(offset_x + 33) + (offset_y + 17) * ldc], alpha * rC[3][5])); \n (C[(offset_x + 32) + (offset_y + 32) * ldc] = mad(beta, C[(offset_x + 32) + (offset_y + 32) * ldc], alpha * rC[4][4])); \n (C[(offset_x + 33) + (offset_y + 32) * ldc] = mad(beta, C[(offset_x + 33) + (offset_y + 32) * ldc], alpha * rC[4][5])); \n (C[(offset_x + 32) + (offset_y + 33) * ldc] = mad(beta, C[(offset_x + 32) + (offset_y + 33) * ldc], alpha * rC[5][4])); \n (C[(offset_x + 33) + (offset_y + 33) * ldc] = mad(beta, C[(offset_x + 33) + (offset_y + 33) * ldc], alpha * rC[5][5])); \n} ); #endif
<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http: <html> <head> <title>convMatrixToOctave (Octave)</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> </head> <body class="standalone-code"> <pre> <span class="ruby-comment cmt"># File Octave/Octave.rb, line 169</span> 169: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">convMatrixToOctave</span>(<span class="ruby-identifier">mat</span>) 170: <span class="ruby-identifier">str</span> = <span class="ruby-value str">&quot;[&quot;</span> ; 171: <span class="ruby-identifier">str</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">mat</span>.<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">raw</span><span class="ruby-operator">|</span> 172: <span class="ruby-keyword kw">if</span>(<span class="ruby-identifier">raw</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>)) <span class="ruby-keyword kw">then</span> 173: <span class="ruby-identifier">raw</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;,&quot;</span>) ; 174: <span class="ruby-keyword kw">else</span> 175: <span class="ruby-identifier">raw</span>.<span class="ruby-identifier">to_f</span> ; 176: <span class="ruby-keyword kw">end</span> 177: }.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;;&quot;</span>) ; 178: <span class="ruby-identifier">str</span> <span class="ruby-operator">+=</span> <span class="ruby-value str">&quot;]&quot;</span> ; 179: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">str</span> ; 180: <span class="ruby-keyword kw">end</span></pre> </body> </html>
/** * This class is generated by jOOQ */ package io.cattle.platform.core.model.tables; /** * This class is generated by jOOQ. */ @javax.annotation.Generated(value = { "http: comments = "This class is generated by jOOQ") @java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class <API key> extends org.jooq.impl.TableImpl<io.cattle.platform.core.model.tables.records.<API key>> { private static final long serialVersionUID = -2123889792; /** * The singleton instance of <code>cattle.cluster_membership</code> */ public static final io.cattle.platform.core.model.tables.<API key> CLUSTER_MEMBERSHIP = new io.cattle.platform.core.model.tables.<API key>(); /** * The class holding records for this type */ @Override public java.lang.Class<io.cattle.platform.core.model.tables.records.<API key>> getRecordType() { return io.cattle.platform.core.model.tables.records.<API key>.class; } /** * The column <code>cattle.cluster_membership.id</code>. */ public final org.jooq.TableField<io.cattle.platform.core.model.tables.records.<API key>, java.lang.Long> ID = createField("id", org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, ""); /** * The column <code>cattle.cluster_membership.name</code>. */ public final org.jooq.TableField<io.cattle.platform.core.model.tables.records.<API key>, java.lang.String> NAME = createField("name", org.jooq.impl.SQLDataType.VARCHAR.length(255), this, ""); /** * The column <code>cattle.cluster_membership.uuid</code>. */ public final org.jooq.TableField<io.cattle.platform.core.model.tables.records.<API key>, java.lang.String> UUID = createField("uuid", org.jooq.impl.SQLDataType.VARCHAR.length(128).nullable(false), this, ""); /** * The column <code>cattle.cluster_membership.heartbeat</code>. */ public final org.jooq.TableField<io.cattle.platform.core.model.tables.records.<API key>, java.lang.Long> HEARTBEAT = createField("heartbeat", org.jooq.impl.SQLDataType.BIGINT, this, ""); /** * The column <code>cattle.cluster_membership.config</code>. */ public final org.jooq.TableField<io.cattle.platform.core.model.tables.records.<API key>, java.lang.String> CONFIG = createField("config", org.jooq.impl.SQLDataType.CLOB.length(16777215), this, ""); /** * The column <code>cattle.cluster_membership.clustered</code>. */ public final org.jooq.TableField<io.cattle.platform.core.model.tables.records.<API key>, java.lang.Boolean> CLUSTERED = createField("clustered", org.jooq.impl.SQLDataType.BIT.nullable(false).defaulted(true), this, ""); /** * Create a <code>cattle.cluster_membership</code> table reference */ public <API key>() { this("cluster_membership", null); } /** * Create an aliased <code>cattle.cluster_membership</code> table reference */ public <API key>(java.lang.String alias) { this(alias, io.cattle.platform.core.model.tables.<API key>.CLUSTER_MEMBERSHIP); } private <API key>(java.lang.String alias, org.jooq.Table<io.cattle.platform.core.model.tables.records.<API key>> aliased) { this(alias, aliased, null); } private <API key>(java.lang.String alias, org.jooq.Table<io.cattle.platform.core.model.tables.records.<API key>> aliased, org.jooq.Field<?>[] parameters) { super(alias, io.cattle.platform.core.model.CattleTable.CATTLE, aliased, parameters, ""); } /** * {@inheritDoc} */ @Override public org.jooq.Identity<io.cattle.platform.core.model.tables.records.<API key>, java.lang.Long> getIdentity() { return io.cattle.platform.core.model.Keys.<API key>; } /** * {@inheritDoc} */ @Override public org.jooq.UniqueKey<io.cattle.platform.core.model.tables.records.<API key>> getPrimaryKey() { return io.cattle.platform.core.model.Keys.<API key>; } /** * {@inheritDoc} */ @Override public java.util.List<org.jooq.UniqueKey<io.cattle.platform.core.model.tables.records.<API key>>> getKeys() { return java.util.Arrays.<org.jooq.UniqueKey<io.cattle.platform.core.model.tables.records.<API key>>>asList(io.cattle.platform.core.model.Keys.<API key>, io.cattle.platform.core.model.Keys.<API key>); } /** * {@inheritDoc} */ @Override public io.cattle.platform.core.model.tables.<API key> as(java.lang.String alias) { return new io.cattle.platform.core.model.tables.<API key>(alias, this); } /** * Rename this table */ public io.cattle.platform.core.model.tables.<API key> rename(java.lang.String name) { return new io.cattle.platform.core.model.tables.<API key>(name, null); } }
package org.collectionspace.services.client; import java.io.File; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.core.Response; import org.apache.commons.io.FileUtils; import org.collectionspace.services.TaxonJAXBSchema; import org.collectionspace.services.client.test.ServiceRequestType; import org.collectionspace.services.common.api.Tools; import org.collectionspace.services.taxonomy.CommonNameGroupList; import org.collectionspace.services.taxonomy.<API key>; import org.collectionspace.services.taxonomy.TaxonCitationList; import org.collectionspace.services.taxonomy.TaxonCommon; import org.collectionspace.services.taxonomy.TaxonTermGroup; import org.collectionspace.services.taxonomy.TaxonTermGroupList; import org.collectionspace.services.taxonomy.<API key>; import org.dom4j.DocumentException; import org.jboss.resteasy.client.ClientResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class Taxonomy<API key> { private static final Logger logger = LoggerFactory.getLogger(Taxonomy<API key>.class); /** * Creates a new Taxonomy Authority * * @param displayName The displayName used in UI, etc. * @param refName The proper refName for this authority * @param headerLabel The common part label * @return The PoxPayloadOut payload for the create call */ public static PoxPayloadOut <API key>( String displayName, String shortIdentifier, String headerLabel) { <API key> Taxonomyauthority = new <API key>(); Taxonomyauthority.setDisplayName(displayName); Taxonomyauthority.setShortIdentifier(shortIdentifier); // String refName = <API key>(shortIdentifier, displayName); // Taxonomyauthority.setRefName(refName); Taxonomyauthority.setVocabType("Taxonomyauthority"); //FIXME: REM - Should this really be hard-coded? PoxPayloadOut multipart = new PoxPayloadOut(<API key>.<API key>); PayloadOutputPart commonPart = multipart.addPart(Taxonomyauthority, MediaType.<API key>); commonPart.setLabel(headerLabel); if (logger.isDebugEnabled()) { logger.debug("to be created, Taxonomyauthority common ", Taxonomyauthority, <API key>.class); } return multipart; } /** * @param taxonomyAuthRefName The proper refName for this authority. * @param taxonInfo the properties for the new instance of a term in this * authority. * @param <API key> an author group list (values of a repeatable * group in the term record). * @param taxonCitationList a citation list (values of a repeatable scalar * in the term record). * @param headerLabel The common part label * @return The PoxPayloadOut payload for the create call */ public static PoxPayloadOut createTaxonInstance( String taxonomyAuthRefName, Map<String, String> taxonInfo, List<TaxonTermGroup> terms, <API key> <API key>, TaxonCitationList taxonCitationList, CommonNameGroupList commonNameGroupList, String headerLabel) { TaxonCommon taxon = new TaxonCommon(); String shortId = taxonInfo.get(TaxonJAXBSchema.SHORT_IDENTIFIER); taxon.setShortIdentifier(shortId); // Set values in the Term Information Group String displayName = taxonInfo.get(TaxonJAXBSchema.DISPLAY_NAME); TaxonTermGroupList termList = new TaxonTermGroupList(); if (terms == null || terms.isEmpty()) { if (Tools.notBlank(displayName)) { terms = <API key>(displayName); } else { terms = <API key>(<API key>()); } } terms.get(0).setTermDisplayName(taxonInfo.get(TaxonJAXBSchema.NAME)); terms.get(0).setTermName(taxonInfo.get(TaxonJAXBSchema.NAME)); terms.get(0).setTermStatus(taxonInfo.get(TaxonJAXBSchema.TERM_STATUS)); terms.get(0).setTaxonomicStatus(taxonInfo.get(TaxonJAXBSchema.TAXONOMIC_STATUS)); termList.getTaxonTermGroup().addAll(terms); taxon.<API key>(termList); String value = null; // Fields specific to this authority record type. if ((value = (String) taxonInfo.get(TaxonJAXBSchema.TAXON_RANK)) != null) { taxon.setTaxonRank(value); } if ((value = (String) taxonInfo.get(TaxonJAXBSchema.TAXON_CURRENCY)) != null) { taxon.setTaxonCurrency(value); } if ((value = (String) taxonInfo.get(TaxonJAXBSchema.TAXON_YEAR)) != null) { taxon.setTaxonYear(value); } if (taxonCitationList != null) { taxon.<API key>(taxonCitationList); } if (<API key> != null) { taxon.<API key>(<API key>); } if (commonNameGroupList != null) { taxon.<API key>(commonNameGroupList); } taxon.<API key>(Boolean.parseBoolean( taxonInfo.get(TaxonJAXBSchema.<API key>))); PoxPayloadOut multipart = new PoxPayloadOut(<API key>.<API key>); PayloadOutputPart commonPart = multipart.addPart(taxon, MediaType.<API key>); commonPart.setLabel(headerLabel); if (logger.isDebugEnabled()) { logger.debug("to be created, taxon common ", taxon, TaxonCommon.class); } return multipart; } /** * @param vcsid CSID of the authority to create a new taxon in * @param <API key> The refName for the authority * @param taxonMap the properties for the new Taxon * @param client the service client * @return the CSID of the new item */ public static String <API key>(String vcsid, String <API key>, Map<String, String> taxonMap, List<TaxonTermGroup> terms, <API key> <API key>, TaxonCitationList taxonCitationList, CommonNameGroupList commonNameGroupList, <API key> client) { // Expected status code: 201 Created int <API key> = Response.Status.CREATED.getStatusCode(); // Type of service request being tested ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE; String displayName = taxonMap.get(TaxonJAXBSchema.DISPLAY_NAME); String <API key> = taxonMap.get(TaxonJAXBSchema.<API key>); boolean displayNameComputed = (<API key> == null) || <API key>.equalsIgnoreCase("true"); if (displayName == null) { if (!displayNameComputed) { throw new RuntimeException( "CreateItem: Must supply a displayName if displayNameComputed is set to false."); } displayName = <API key>( taxonMap.get(TaxonJAXBSchema.NAME)); } if (logger.isDebugEnabled()) { logger.debug("Import: Create Item: \"" + displayName + "\" in Taxonomyauthority: \"" + <API key> + "\""); } PoxPayloadOut multipart = createTaxonInstance(<API key>, taxonMap, terms, <API key>, taxonCitationList, commonNameGroupList, client.<API key>()); String newID = null; Response res = client.createItem(vcsid, multipart); try { int statusCode = res.getStatus(); if (!REQUEST_TYPE.isValidStatusCode(statusCode)) { throw new RuntimeException("Could not create Item: \"" + taxonMap.get(TaxonJAXBSchema.SHORT_IDENTIFIER) + "\" in Taxonomyauthority: \"" + <API key> + "\" " + <API key>(REQUEST_TYPE, statusCode)); } if (statusCode != <API key>) { throw new RuntimeException("Unexpected Status when creating Item: \"" + taxonMap.get(TaxonJAXBSchema.SHORT_IDENTIFIER) + "\" in Taxonomyauthority: \"" + <API key> + "\", Status:" + statusCode); } newID = extractId(res); } finally { res.close(); } return newID; } public static PoxPayloadOut createTaxonInstance( String commonPartXML, String headerLabel) throws DocumentException { PoxPayloadOut multipart = new PoxPayloadOut(<API key>.<API key>); PayloadOutputPart commonPart = multipart.addPart(commonPartXML, MediaType.<API key>); commonPart.setLabel(headerLabel); if (logger.isDebugEnabled()) { logger.debug("to be created, Taxon common ", commonPartXML); } return multipart; } public static String <API key>(String vcsid, String commonPartXML, <API key> client) throws DocumentException { // Expected status code: 201 Created int <API key> = Response.Status.CREATED.getStatusCode(); // Type of service request being tested ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE; PoxPayloadOut multipart = createTaxonInstance(commonPartXML, client.<API key>()); String newID = null; Response res = client.createItem(vcsid, multipart); try { int statusCode = res.getStatus(); if (!REQUEST_TYPE.isValidStatusCode(statusCode)) { throw new RuntimeException("Could not create Item: \"" + commonPartXML + "\" in Taxonomyauthority: \"" + vcsid + "\" " + <API key>(REQUEST_TYPE, statusCode)); } if (statusCode != <API key>) { throw new RuntimeException("Unexpected Status when creating Item: \"" + commonPartXML + "\" in Taxonomyauthority: \"" + vcsid + "\", Status:" + statusCode); } newID = extractId(res); } finally { res.close(); } return newID; } /** * Creates the from xml file. * * @param fileName the file name * @return new CSID as string * @throws Exception the exception */ private String createItemIn<API key>(String vcsid, String commonPartFileName, <API key> client) throws Exception { byte[] b = FileUtils.readFileToByteArray(new File(commonPartFileName)); String commonPartXML = new String(b); return <API key>(vcsid, commonPartXML, client); } /** * Creates the Taxonomyauthority ref name. * * @param shortId the Taxonomyauthority shortIdentifier * @param displaySuffix displayName to be appended, if non-null * @return the string */ public static String <API key>(String shortId, String displaySuffix) { String refName = "urn:cspace:org.collectionspace.demo:taxonomyauthority:name(" + shortId + ")"; if (displaySuffix != null && !displaySuffix.isEmpty()) { refName += "'" + displaySuffix + "'"; } return refName; } /** * Creates the taxon ref name. * * @param taxonomyAuthRefName the Taxonomyauthority ref name * @param shortId the taxon shortIdentifier * @param displaySuffix displayName to be appended, if non-null * @return the string */ public static String <API key>( String taxonomyAuthRefName, String shortId, String displaySuffix) { String refName = taxonomyAuthRefName + ":taxon:name(" + shortId + ")"; if (displaySuffix != null && !displaySuffix.isEmpty()) { refName += "'" + displaySuffix + "'"; } return refName; } public static String extractId(Response res) { MultivaluedMap<String, Object> mvm = res.getMetadata(); String uri = (String) ((ArrayList<Object>) mvm.get("Location")).get(0); if (logger.isDebugEnabled()) { logger.debug("extractId:uri=" + uri); } String[] segments = uri.split("/"); String id = segments[segments.length - 1]; if (logger.isDebugEnabled()) { logger.debug("id=" + id); } return id; } /** * Returns an error message indicating that the status code returned by a * specific call to a service does not fall within a set of valid status * codes for that service. * * @param serviceRequestType A type of service request (e.g. CREATE, * DELETE). * * @param statusCode The invalid status code that was returned in the * response, from submitting that type of request to the service. * * @return An error message. */ public static String <API key>(ServiceRequestType requestType, int statusCode) { return "Status code '" + statusCode + "' in response is NOT within the expected set: " + requestType.<API key>(); } /** * Produces a default displayName from the basic name and dates fields. * * @see <API key>.<API key>() which * duplicates this logic, until we define a service-general utils package * that is neither client nor service specific. * @param name * @return */ public static String <API key>( String name) { StringBuilder newStr = new StringBuilder(); newStr.append(name); return newStr.toString(); } public static List<TaxonTermGroup> <API key>(String identifier) { if (Tools.isBlank(identifier)) { identifier = <API key>(); } List<TaxonTermGroup> terms = new ArrayList<TaxonTermGroup>(); TaxonTermGroup term = new TaxonTermGroup(); term.setTermDisplayName(identifier); term.setTermName(identifier); terms.add(term); return terms; } private static String <API key>() { return "id" + new Date().getTime(); } }
<?php slot('submenu') ?> <?php include_partial('submenu') ?> <?php end_slot() ?> <?php slot('title') ?> <?php echo __('Manage Apps') ?> <?php end_slot() ?> <table> <?php echo $searchForm->renderFormTag(url_for('@op_opensocial_list'), array('method' => 'get')) ?> <?php echo $searchForm ?> <td colspan="2"><input type="submit" value="<?php echo __('Search') ?>"/></td> </table> <?php if ($pager->getNbResults()): ?> <?php slot('pager') ?> <?php <API key>($pager, '@op_opensocial_list?page=%d', array('<API key>' => true)) ?> <?php end_slot(); ?> <?php include_slot('pager') ?> <ul> <?php foreach ($pager->getResults() as $application): ?> <li><?php echo link_to($application->getTitle(),'@op_opensocial_info?id='.$application->getId()) ?></li> <?php endforeach; ?> </ul> <?php include_slot('pager') ?> <?php else: ?> <?php echo __('There are no app.') ?> <?php echo __('The app can be installed from %0%.', array('%0%' => link_to(__('Add App'), '@op_opensocial_add'))) ?> <?php endif; ?>
<head> <title>gd Alpha Channel Test</title> <head> <body bgcolor="#c0c0FF"> <h1>gd Alpha Channel Test</h1> If your browser fully supports PNG alpha channels, the "blended" and "alpha channel" images should appear identical to the naked eye. Miniscule mathematical differences may exist due to the 7-bit alpha channel resolution of gd. <p> Palette and truecolor images will look slightly different, as the palette versions are limited to 256 palette entries, which are used as well as possible to approach the effect of the original truecolor version. <table> <tr> <th colspan=2>Truecolor Images</th> <tr> <th>Blending against light blue, Half Size<td><img src="<API key>.png"> <tr> <th>Alpha channel, Half Size<td><img src="<API key>.png"> <tr> <th>Blending against light blue, Full Size<td><img src="<API key>.png"> <tr> <th>Alpha channel, Full Size<td><img src="<API key>.png"> <tr> <th>Blending against light blue, Double Size<td><img src="<API key>.png"> <tr> <th>Alpha channel, Double Size<td><img src="<API key>.png"> <tr> <th colspan=2>Palette Images</th> <tr> <th>Blending against light blue, Half Size<td><img src="<API key>.png"> <tr> <th>Alpha channel, Half Size<td><img src="<API key>.png"> <tr> <th>Blending against light blue, Full Size<td><img src="<API key>.png"> <tr> <th>Alpha channel, Full Size<td><img src="<API key>.png"> <tr> <th>Blending against light blue, Double Size<td><img src="<API key>.png"> <tr> <th>Alpha channel, Double Size<td><img src="<API key>.png"></table> </body>
$packageName = '<API key>' $installerType = 'exe' $checksum = '<SHA1-like>' $checksumType = 'sha1' $silentArgs = '/S /NCRC' $validExitCodes = @(0) $pwdPath = "$(Split-Path -Parent $MyInvocation.MyCommand.Definition)" $ahkFile = "$pwdPath\shockwave.ahk" $fileHippoName = "shockwave" Import-Module "$($pwdPath)\<API key>.ps1" $url1 = <API key> 'http: Write-Host "Found URL which contains the download URL 1: $url1" $url2 = <API key> "$url1" 'download_shockwave/download/([\w\d]+)/' 'http: Write-Host "Found URL which contains the download URL 2: $url2" $url3 = <API key> "$url2" '/download/file/([\w\d]+)/' 'http: Write-Host "Found download URL: $url3" Start-Process 'AutoHotKey' $ahkFile <API key> $packageName $installerType $silentArgs $url3 -validExitCodes $validExitCodes -Checksum "$checksum" -ChecksumType "$checksumType"
<!-- MAIN CONTENT --> <div id="content" > <div class="row"> <div class="col-xs-12 col-sm-9 col-md-9 col-lg-9"> <h1 class="page-title txt-color-blueDark"> <a class="backHome" href="/bo"><i class="fa fa-home"></i> Menu</a> <span> > <a href="/bo/configuracion/"> Configuración</a> > <a href="/bo/configuracion/formaspago"> Formas de Pago</a> > Banco </span> </h1> </div> </div> <section id="widget-grid" class=""> <!-- START ROW --> <div class="row"> <!-- NEW COL START --> <article class="col-sm-12 col-md-12 col-lg-12"> <!-- Widget ID (each widget will need unique ID)--> <div class="jarviswidget" id="wid-id-1" <API key>="false" <API key>="false" <API key>="false" <API key>="false" <API key>="false" <API key>="false" <API key>="false" <API key>="false"> <div> <!-- widget edit box --> <div class="<API key>"> <!-- This area used as dropdown edit box --> </div> <!-- end widget edit box --> <!-- widget content --> <div class="widget-body no-padding smart-form"> <fieldset> <div class="contenidoBotones"> <div class="row"> <div class="col-sm-3 link"> </div> <div class="col-sm-6 link"> <div class="col-sm-4 link"> <a href="/bo/bancos/alta"> <div class="minh well well-sm txt-color-white text-center link_dashboard" style="background:<?=$style[0]->btn_2_color?>;"> <i class="fa fa-edit fa-3x"></i> <h1>Alta</h1> </div> </a> </div> <div class="col-sm-4 link"> <a href="/bo/bancos/listar"> <div class="minh well well-sm txt-color-white text-center link_dashboard" style="background:<?=$style[0]->btn_1_color?>"> <i class="fa fa-list-alt fa-3x"></i> <h1>Listar</h1> </div> </a> </div> </div> </div> </div> </fieldset> </div> <!-- end widget content --> </div> <!-- end widget div --> </div> <!-- end widget --> </article> <!-- END COL --> </div> <div class="row"> <!-- a blank row to get started --> <div class="col-sm-12"> <br /> <br /> </div> </div> </div> <!-- END MAIN CONTENT --> <style> .link { margin: 0.5rem; } .minh { padding: 50px; } .link a:hover { text-decoration: none !important; } </style>
// file at the top-level directory of this distribution and at // option. This file may not be copied, modified, or distributed // except according to those terms. // ignore-gdb // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155 // compile-flags:-g // gdbg-command:print/d 'simple_tuple::NO_PADDING_8' // gdbr-command:print simple_tuple::NO_PADDING_8 // gdbg-check:$1 = {__0 = -50, __1 = 50} // gdbr-check:$1 = (-50, 50) // gdbg-command:print 'simple_tuple::NO_PADDING_16' // gdbr-command:print simple_tuple::NO_PADDING_16 // gdbg-check:$2 = {__0 = -1, __1 = 2, __2 = 3} // gdbr-check:$2 = (-1, 2, 3) // gdbg-command:print 'simple_tuple::NO_PADDING_32' // gdbr-command:print simple_tuple::NO_PADDING_32 // gdbg-check:$3 = {__0 = 4, __1 = 5, __2 = 6} // gdbr-check:$3 = (4, 5, 6) // gdbg-command:print 'simple_tuple::NO_PADDING_64' // gdbr-command:print simple_tuple::NO_PADDING_64 // gdbg-check:$4 = {__0 = 7, __1 = 8, __2 = 9} // gdbr-check:$4 = (7, 8, 9) // gdbg-command:print 'simple_tuple::INTERNAL_PADDING_1' // gdbr-command:print simple_tuple::INTERNAL_PADDING_1 // gdbg-check:$5 = {__0 = 10, __1 = 11} // gdbr-check:$5 = (10, 11) // gdbg-command:print 'simple_tuple::INTERNAL_PADDING_2' // gdbr-command:print simple_tuple::INTERNAL_PADDING_2 // gdbg-check:$6 = {__0 = 12, __1 = 13, __2 = 14, __3 = 15} // gdbr-check:$6 = (12, 13, 14, 15) // gdbg-command:print 'simple_tuple::PADDING_AT_END' // gdbr-command:print simple_tuple::PADDING_AT_END // gdbg-check:$7 = {__0 = 16, __1 = 17} // gdbr-check:$7 = (16, 17) // gdb-command:run // gdbg-command:print/d noPadding8 // gdbr-command:print noPadding8 // gdbg-check:$8 = {__0 = -100, __1 = 100} // gdbr-check:$8 = (-100, 100) // gdb-command:print noPadding16 // gdbg-check:$9 = {__0 = 0, __1 = 1, __2 = 2} // gdbr-check:$9 = (0, 1, 2) // gdb-command:print noPadding32 // gdbg-check:$10 = {__0 = 3, __1 = 4.5, __2 = 5} // gdbr-check:$10 = (3, 4.5, 5) // gdb-command:print noPadding64 // gdbg-check:$11 = {__0 = 6, __1 = 7.5, __2 = 8} // gdbr-check:$11 = (6, 7.5, 8) // gdb-command:print internalPadding1 // gdbg-check:$12 = {__0 = 9, __1 = 10} // gdbr-check:$12 = (9, 10) // gdb-command:print internalPadding2 // gdbg-check:$13 = {__0 = 11, __1 = 12, __2 = 13, __3 = 14} // gdbr-check:$13 = (11, 12, 13, 14) // gdb-command:print paddingAtEnd // gdbg-check:$14 = {__0 = 15, __1 = 16} // gdbr-check:$14 = (15, 16) // gdbg-command:print/d 'simple_tuple::NO_PADDING_8' // gdbr-command:print simple_tuple::NO_PADDING_8 // gdbg-check:$15 = {__0 = -127, __1 = 127} // gdbr-check:$15 = (-127, 127) // gdbg-command:print 'simple_tuple::NO_PADDING_16' // gdbr-command:print simple_tuple::NO_PADDING_16 // gdbg-check:$16 = {__0 = -10, __1 = 10, __2 = 9} // gdbr-check:$16 = (-10, 10, 9) // gdbg-command:print 'simple_tuple::NO_PADDING_32' // gdbr-command:print simple_tuple::NO_PADDING_32 // gdbg-check:$17 = {__0 = 14, __1 = 15, __2 = 16} // gdbr-check:$17 = (14, 15, 16) // gdbg-command:print 'simple_tuple::NO_PADDING_64' // gdbr-command:print simple_tuple::NO_PADDING_64 // gdbg-check:$18 = {__0 = 17, __1 = 18, __2 = 19} // gdbr-check:$18 = (17, 18, 19) // gdbg-command:print 'simple_tuple::INTERNAL_PADDING_1' // gdbr-command:print simple_tuple::INTERNAL_PADDING_1 // gdbg-check:$19 = {__0 = 110, __1 = 111} // gdbr-check:$19 = (110, 111) // gdbg-command:print 'simple_tuple::INTERNAL_PADDING_2' // gdbr-command:print simple_tuple::INTERNAL_PADDING_2 // gdbg-check:$20 = {__0 = 112, __1 = 113, __2 = 114, __3 = 115} // gdbr-check:$20 = (112, 113, 114, 115) // gdbg-command:print 'simple_tuple::PADDING_AT_END' // gdbr-command:print simple_tuple::PADDING_AT_END // gdbg-check:$21 = {__0 = 116, __1 = 117} // gdbr-check:$21 = (116, 117) // lldb-command:run // lldb-command:print/d noPadding8 // lldbg-check:[...]$0 = (-100, 100) // lldbr-check:((i8, u8)) noPadding8 = { = -100 -100 = 100 100 } // lldb-command:print noPadding16 // lldbg-check:[...]$1 = (0, 1, 2) // lldbr-check:((i16, i16, u16)) noPadding16 = { = 0 = 1 = 2 } // lldb-command:print noPadding32 // lldbg-check:[...]$2 = (3, 4.5, 5) // lldbr-check:((i32, f32, u32)) noPadding32 = { = 3 = 4.5 = 5 } // lldb-command:print noPadding64 // lldbg-check:[...]$3 = (6, 7.5, 8) // lldbr-check:((i64, f64, u64)) noPadding64 = { = 6 = 7.5 = 8 } // lldb-command:print internalPadding1 // lldbg-check:[...]$4 = (9, 10) // lldbr-check:((i16, i32)) internalPadding1 = { = 9 = 10 } // lldb-command:print internalPadding2 // lldbg-check:[...]$5 = (11, 12, 13, 14) // lldbr-check:((i16, i32, u32, u64)) internalPadding2 = { = 11 = 12 = 13 = 14 } // lldb-command:print paddingAtEnd // lldbg-check:[...]$6 = (15, 16) // lldbr-check:((i32, i16)) paddingAtEnd = { = 15 = 16 } #![allow(unused_variables)] #![allow(dead_code)] #![feature(<API key>)] #![<API key>] static mut NO_PADDING_8: (i8, u8) = (-50, 50); static mut NO_PADDING_16: (i16, i16, u16) = (-1, 2, 3); static mut NO_PADDING_32: (i32, f32, u32) = (4, 5.0, 6); static mut NO_PADDING_64: (i64, f64, u64) = (7, 8.0, 9); static mut INTERNAL_PADDING_1: (i16, i32) = (10, 11); static mut INTERNAL_PADDING_2: (i16, i32, u32, u64) = (12, 13, 14, 15); static mut PADDING_AT_END: (i32, i16) = (16, 17); fn main() { let noPadding8: (i8, u8) = (-100, 100); let noPadding16: (i16, i16, u16) = (0, 1, 2); let noPadding32: (i32, f32, u32) = (3, 4.5, 5); let noPadding64: (i64, f64, u64) = (6, 7.5, 8); let internalPadding1: (i16, i32) = (9, 10); let internalPadding2: (i16, i32, u32, u64) = (11, 12, 13, 14); let paddingAtEnd: (i32, i16) = (15, 16); unsafe { NO_PADDING_8 = (-127, 127); NO_PADDING_16 = (-10, 10, 9); NO_PADDING_32 = (14, 15.0, 16); NO_PADDING_64 = (17, 18.0, 19); INTERNAL_PADDING_1 = (110, 111); INTERNAL_PADDING_2 = (112, 113, 114, 115); PADDING_AT_END = (116, 117); } zzz(); // #break } fn zzz() {()}
package org.maltparserx.core.syntaxgraph; import java.util.<API key>; import java.util.Observable; import java.util.SortedMap; import java.util.SortedSet; import java.util.TreeMap; import java.util.TreeSet; import org.maltparserx.core.exception.<API key>; import org.maltparserx.core.pool.ObjectPoolList; import org.maltparserx.core.symbol.SymbolTableHandler; import org.maltparserx.core.syntaxgraph.node.Token; import org.maltparserx.core.syntaxgraph.node.TokenNode; /** * * * @author Johan Hall */ public class Sentence extends SyntaxGraph implements TokenStructure { protected final ObjectPoolList<Token> terminalPool; protected final SortedMap<Integer,Token> terminalNodes; protected int sentenceID; public Sentence(SymbolTableHandler symbolTables) throws <API key> { super(symbolTables); terminalNodes = new TreeMap<Integer,Token>(); terminalPool = new ObjectPoolList<Token>() { protected Token create() throws <API key> { return new Token(); } public void resetObject(Token o) throws <API key> { o.clear(); } }; } public TokenNode addTokenNode(int index) throws <API key> { if (index > 0) { return <API key>(index); } return null; } public TokenNode addTokenNode() throws <API key> { int index = <API key>(); if (index > 0) { return <API key>(index+1); } return <API key>(1); } public int nTokenNode() { return terminalNodes.size(); } public boolean hasTokens() { return !terminalNodes.isEmpty(); } protected <API key>(int index) throws <API key> { Token node = terminalNodes.get(index); if (node == null) { // if (!terminalNodes.containsKey(index)) { if (index > 0){ node = terminalPool.checkOut(); node.setIndex(index); node.setBelongsToGraph(this); if (index > 1) { Token prev = terminalNodes.get(index-1); if (prev == null) { try { prev = terminalNodes.get(terminalNodes.headMap(index).lastKey()); } catch (<API key> e) { } } if (prev != null) { prev.setSuccessor(node); node.setPredecessor(prev); } if (terminalNodes.lastKey() > index) { Token succ = terminalNodes.get(index+1); if (succ == null) { try { succ = terminalNodes.get(terminalNodes.tailMap(index).firstKey()); } catch (<API key> e) { } } if (succ != null) { succ.setPredecessor(node); node.setSuccessor(succ); } } } } terminalNodes.put(index,node); numberOfComponents++; } // else { // node = terminalNodes.get(index); return node; } public SortedSet<Integer> getTokenIndices() { return new TreeSet<Integer>(terminalNodes.keySet()); } public int <API key>() { try { return terminalNodes.lastKey(); } catch (<API key> e) { return 0; } } public TokenNode getTokenNode(int index) { if (index > 0) { return terminalNodes.get(index); } return null; } public int getSentenceID() { return sentenceID; } public void setSentenceID(int sentenceID) { this.sentenceID = sentenceID; } public void clear() throws <API key> { terminalPool.checkInAll(); terminalNodes.clear(); sentenceID = 0; super.clear(); } public void update(Observable o, Object str) { } public String toString() { final StringBuilder sb = new StringBuilder(); for (int index : terminalNodes.keySet()) { sb.append(terminalNodes.get(index).toString().trim()); sb.append('\n'); } sb.append("\n"); return sb.toString(); } }
package mil.nga.giat.geowave.core.geotime.ingest; import mil.nga.giat.geowave.core.geotime.DimensionalityType; import mil.nga.giat.geowave.core.ingest.<API key>; import mil.nga.giat.geowave.core.ingest.<API key>; import mil.nga.giat.geowave.core.store.index.Index; public class <API key> implements <API key> { @Override public <API key> <API key>() { return new <API key>(); } @Override public String <API key>() { return "spatial"; } @Override public String <API key>() { return "This dimensionality type matches all indices that only require Latitude and Longitude definitions."; } @Override public int getPriority() { // arbitrary - just higher than spatial temporal so that the default // will be spatial over spatial-temporal return 10; } private static final class <API key> implements <API key> { @Override public boolean isCompatible( final Index index ) { return DimensionalityType.SPATIAL.isCompatible(index); } } }
// Flags: --<API key> --stress-compaction // To reliably reproduce the crash use --verify-heap --random-seed=-133185440 function __f_2(o) { return o.field.b.x; } %<API key>(__f_2); try { %<API key>(__f_2); __v_1 = __f_2(); } catch (e) { } function __f_3() { __f_3(/./.test()); }; try { __f_3(); } catch (e) { }
import Ember from 'ember'; import Un<API key> from 'ember-simple-auth/mixins/un<API key>; const { Route } = Ember; export default Route.extend(Un<API key>, { titleToken() { return this.l10n.t('Login'); } });
package org.camunda.bpm.integrationtest.jobexecutor.beans; import java.io.Serializable; import javax.ejb.Stateless; import javax.inject.Named; /** * @author Thorben Lindhauer * */ @Named @Stateless public class PriorityBean implements Serializable { private static final long serialVersionUID = 1L; public static final int PRIORITY = 52; public int getPriority() { return PRIORITY; } }
"""Entity representing a Sonos power sensor.""" from __future__ import annotations import logging from typing import Any from homeassistant.components.binary_sensor import ( <API key>, BinarySensorEntity, ) from homeassistant.helpers.dispatcher import <API key> from .const import <API key> from .entity import SonosEntity from .speaker import SonosSpeaker _LOGGER = logging.getLogger(__name__) <API key> = "power_source" async def async_setup_entry(hass, config_entry, async_add_entities): """Set up Sonos from a config entry.""" async def <API key>(speaker: SonosSpeaker) -> None: entity = SonosPowerEntity(speaker) async_add_entities([entity]) config_entry.async_on_unload( <API key>(hass, <API key>, <API key>) ) class SonosPowerEntity(SonosEntity, BinarySensorEntity): """Representation of a Sonos power entity.""" @property def unique_id(self) -> str: """Return the unique ID of the sensor.""" return f"{self.soco.uid}-power" @property def name(self) -> str: """Return the name of the sensor.""" return f"{self.speaker.zone_name} Power" @property def device_class(self) -> str: """Return the entity's device class.""" return <API key> async def async_update(self) -> None: """Poll the device for the current state.""" await self.speaker.async_poll_battery() @property def is_on(self) -> bool | None: """Return the state of the binary sensor.""" return self.speaker.charging @property def <API key>(self) -> dict[str, Any]: """Return entity specific state attributes.""" return { <API key>: self.speaker.power_source, } @property def available(self) -> bool: """Return whether this device is available.""" return self.speaker.available and (self.speaker.charging is not None)
// System.Web.UI.WebControls.<API key>.cs // Authors: // Chris Toshok (toshok@ximian.com) // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // included in all copies or substantial portions of the Software. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. using System; namespace System.Configuration { public interface <API key> { <API key> GetPreviousVersion (SettingsContext context, SettingsProperty property); void Reset (SettingsContext context); void Upgrade (SettingsContext context, <API key> properties); } }
# -*- coding: utf-8 -*- from __future__ import absolute_import from django.db.models import Q from django.conf import settings from django.http import HttpResponse from django.test import TestCase, override_settings from django.utils import timezone from zerver.lib import bugdown from zerver.decorator import JsonableError from zerver.lib.test_runner import slow from zilencer.models import Deployment from zerver.lib.message import ( MessageDict, message_to_dict, ) from zerver.lib.test_helpers import ( get_user_messages, make_client, message_ids, <API key>, most_recent_message, <API key>, queries_captured, ) from zerver.lib.test_classes import ( ZulipTestCase, ) from zerver.models import ( MAX_MESSAGE_LENGTH, MAX_SUBJECT_LENGTH, Message, Realm, Recipient, Stream, UserMessage, UserProfile, Attachment, RealmAlias, <API key>, get_stream, <API key>, Reaction, <API key> ) from zerver.lib.actions import ( check_message, check_send_message, do_create_user, get_client, get_recipient, ) from zerver.lib.upload import create_attachment from zerver.views.messages import <API key> import datetime import DNS import mock import time import ujson from six.moves import range from typing import Any, Optional, Text class TopicHistoryTest(ZulipTestCase): def test_topics_history(self): # type: () -> None # verified: int(UserMessage.flags.read) == 1 email = 'iago@zulip.com' stream_name = 'Verona' self.login(email) user_profile = <API key>(email) stream = Stream.objects.get(name=stream_name) recipient = get_recipient(Recipient.STREAM, stream.id) def create_test_message(topic, read, starred=False): # type: (str, bool, bool) -> None hamlet = <API key>('hamlet@zulip.com') message = Message.objects.create( sender=hamlet, recipient=recipient, subject=topic, content='whatever', pub_date=timezone.now(), sending_client=get_client('whatever'), ) flags = 0 if read: flags |= UserMessage.flags.read # use this to make sure our query isn't confused # by other flags if starred: flags |= UserMessage.flags.starred UserMessage.objects.create( user_profile=user_profile, message=message, flags=flags, ) create_test_message('topic2', read=False) create_test_message('toPIc1', read=False, starred=True) create_test_message('topic2', read=False) create_test_message('topic2', read=True) create_test_message('topic2', read=False, starred=True) create_test_message('Topic2', read=False) create_test_message('already_read', read=True) endpoint = '/json/users/me/%d/topics' % (stream.id,) result = self.client_get(endpoint, dict()) self.assert_json_success(result) history = ujson.loads(result.content)['topics'] # We only look at the most recent three topics, because # the prior fixture data may be unreliable. self.assertEqual(history[:3], [ [u'already_read', 0], [u'Topic2', 4], [u'toPIc1', 1], ]) def test_bad_stream_id(self): # type: () -> None email = 'iago@zulip.com' self.login(email) # non-sensible stream id endpoint = '/json/users/me/9999999999/topics' result = self.client_get(endpoint, dict()) self.assert_json_error(result, 'Invalid stream id') # out of realm bad_stream = self.make_stream( 'mit_stream', realm=<API key>('mit') ) endpoint = '/json/users/me/%s/topics' % (bad_stream.id,) result = self.client_get(endpoint, dict()) self.assert_json_error(result, 'Invalid stream id') # private stream to which I am not subscribed private_stream = self.make_stream( 'private_stream', invite_only=True ) endpoint = '/json/users/me/%s/topics' % (private_stream.id,) result = self.client_get(endpoint, dict()) self.assert_json_error(result, 'Invalid stream id') class TestCrossRealmPMs(ZulipTestCase): def make_realm(self, domain): # type: (Text) -> Realm realm = Realm.objects.create(string_id=domain, domain=domain, invite_required=False) RealmAlias.objects.create(realm=realm, domain=domain) return realm def setUp(self): # type: () -> None dep = Deployment() dep.base_api_url = "https://zulip.com/api/" dep.base_site_url = "https://zulip.com/" # We need to save the object before we can access # the many-to-many relationship 'realms' dep.save() dep.realms = [<API key>("zulip")] dep.save() def create_user(self, email): # type: (Text) -> UserProfile username, domain = email.split('@') self.register(username, 'test', domain=domain) return <API key>(email) @override_settings(<API key>=['feedback@zulip.com', 'support@3.example.com']) def <API key>(self): # type: () -> None r1 = self.make_realm('1.example.com') r2 = self.make_realm('2.example.com') r3 = self.make_realm('3.example.com') deployment = Deployment.objects.filter()[0] deployment.realms.add(r1) deployment.realms.add(r2) deployment.realms.add(r3) def <API key>(to_user, from_user): # type: (UserProfile, UserProfile) -> None messages = get_user_messages(to_user) self.assertEqual(messages[-1].sender.pk, from_user.pk) def assert_disallowed(): # type: () -> Any return self.assertRaisesRegex( JsonableError, 'You can\'t send private messages outside of your organization.') random_zulip_email = 'random@zulip.com' user1_email = 'user1@1.example.com' user1a_email = 'user1a@1.example.com' user2_email = 'user2@2.example.com' user3_email = 'user3@3.example.com' feedback_email = 'feedback@zulip.com' support_email = 'support@3.example.com' # note: not zulip.com self.create_user(random_zulip_email) user1 = self.create_user(user1_email) user1a = self.create_user(user1a_email) user2 = self.create_user(user2_email) self.create_user(user3_email) feedback_bot = <API key>(feedback_email) support_bot = self.create_user(support_email) # Users can PM themselves self.send_message(user1_email, user1_email, Recipient.PERSONAL) <API key>(user1, user1) # Users on the same realm can PM each other self.send_message(user1_email, user1a_email, Recipient.PERSONAL) <API key>(user1a, user1) # Cross-realm bots in the zulip.com realm can PM any realm self.send_message(feedback_email, user2_email, Recipient.PERSONAL) <API key>(user2, feedback_bot) # All users can PM cross-realm bots in the zulip.com realm self.send_message(user1_email, feedback_email, Recipient.PERSONAL) <API key>(feedback_bot, user1) # Users can PM cross-realm bots on non-zulip realms. # (The support bot represents some theoretical bot that we may # create in the future that does not have zulip.com as its realm.) self.send_message(user1_email, [support_email], Recipient.PERSONAL) <API key>(support_bot, user1) # Allow sending PMs to two different cross-realm bots simultaneously. # (We don't particularly need this feature, but since users can # already individually send PMs to cross-realm bots, we shouldn't # prevent them from sending multiple bots at once. We may revisit # this if it's a nuisance for huddles.) self.send_message(user1_email, [feedback_email, support_email], Recipient.PERSONAL) <API key>(feedback_bot, user1) <API key>(support_bot, user1) # Prevent old loophole where I could send PMs to other users as long # as I copied a cross-realm bot from the same realm. with assert_disallowed(): self.send_message(user1_email, [user3_email, support_email], Recipient.PERSONAL) # Users on three different realms can't PM each other, # even if one of the users is a cross-realm bot. with assert_disallowed(): self.send_message(user1_email, [user2_email, feedback_email], Recipient.PERSONAL) with assert_disallowed(): self.send_message(feedback_email, [user1_email, user2_email], Recipient.PERSONAL) # Users on the different realms can not PM each other with assert_disallowed(): self.send_message(user1_email, user2_email, Recipient.PERSONAL) # Users on non-zulip realms can't PM "ordinary" Zulip users with assert_disallowed(): self.send_message(user1_email, random_zulip_email, Recipient.PERSONAL) # Users on three different realms can not PM each other with assert_disallowed(): self.send_message(user1_email, [user2_email, user3_email], Recipient.PERSONAL) class <API key>(ZulipTestCase): def <API key>(self): # type: () -> None """ Newly created users are auto-subbed to the ability to receive personals. """ self.register("test", "test") user_profile = <API key>('test@zulip.com') old_messages_count = <API key>(user_profile) self.send_message("test@zulip.com", "test@zulip.com", Recipient.PERSONAL) new_messages_count = <API key>(user_profile) self.assertEqual(new_messages_count, old_messages_count + 1) recipient = Recipient.objects.get(type_id=user_profile.id, type=Recipient.PERSONAL) message = most_recent_message(user_profile) self.assertEqual(message.recipient, recipient) with mock.patch('zerver.models.<API key>', return_value='recip'): self.assertEqual(str(message), u'<Message: recip / / ' '<UserProfile: test@zulip.com <Realm: zulip.com 1>>>') user_message = <API key>(user_profile) self.assertEqual(str(user_message), u'<UserMessage: recip / test@zulip.com ([])>' ) @slow("checks several profiles") def <API key>(self): # type: () -> None """ If you send a personal to yourself, only you see it. """ old_user_profiles = list(UserProfile.objects.all()) self.register("test1", "test1") old_messages = [] for user_profile in old_user_profiles: old_messages.append(<API key>(user_profile)) self.send_message("test1@zulip.com", "test1@zulip.com", Recipient.PERSONAL) new_messages = [] for user_profile in old_user_profiles: new_messages.append(<API key>(user_profile)) self.assertEqual(old_messages, new_messages) user_profile = <API key>("test1@zulip.com") recipient = Recipient.objects.get(type_id=user_profile.id, type=Recipient.PERSONAL) self.assertEqual(most_recent_message(user_profile).recipient, recipient) def assert_personal(self, sender_email, receiver_email, content="test content"): # type: (Text, Text, Text) -> None """ Send a private message from `sender_email` to `receiver_email` and check that only those two parties actually received the message. """ sender = <API key>(sender_email) receiver = <API key>(receiver_email) sender_messages = <API key>(sender) receiver_messages = <API key>(receiver) other_user_profiles = UserProfile.objects.filter(~Q(email=sender_email) & ~Q(email=receiver_email)) old_other_messages = [] for user_profile in other_user_profiles: old_other_messages.append(<API key>(user_profile)) self.send_message(sender_email, receiver_email, Recipient.PERSONAL, content) # Users outside the conversation don't get the message. new_other_messages = [] for user_profile in other_user_profiles: new_other_messages.append(<API key>(user_profile)) self.assertEqual(old_other_messages, new_other_messages) # The personal message is in the streams of both the sender and receiver. self.assertEqual(<API key>(sender), sender_messages + 1) self.assertEqual(<API key>(receiver), receiver_messages + 1) recipient = Recipient.objects.get(type_id=receiver.id, type=Recipient.PERSONAL) self.assertEqual(most_recent_message(sender).recipient, recipient) self.assertEqual(most_recent_message(receiver).recipient, recipient) @slow("assert_personal checks several profiles") def test_personal(self): # type: () -> None """ If you send a personal, only you and the recipient see it. """ self.login("hamlet@zulip.com") self.assert_personal("hamlet@zulip.com", "othello@zulip.com") @slow("assert_personal checks several profiles") def <API key>(self): # type: () -> None """ Sending a PM containing non-ASCII characters succeeds. """ self.login("hamlet@zulip.com") self.assert_personal("hamlet@zulip.com", "othello@zulip.com", u"hümbüǵ") class StreamMessagesTest(ZulipTestCase): def <API key>(self, stream_name, subject="test subject", content="test content"): # type: (Text, Text, Text) -> None """ Check that messages sent to a stream reach all subscribers to that stream. """ realm = <API key>('zulip') subscribers = self.<API key>(stream_name, realm) <API key> = [] for subscriber in subscribers: <API key>.append(<API key>(subscriber)) non_subscribers = [user_profile for user_profile in UserProfile.objects.all() if user_profile not in subscribers] <API key> = [] for non_subscriber in non_subscribers: <API key>.append(<API key>(non_subscriber)) non_bot_subscribers = [user_profile for user_profile in subscribers if not user_profile.is_bot] a_subscriber_email = non_bot_subscribers[0].email self.login(a_subscriber_email) self.send_message(a_subscriber_email, stream_name, Recipient.STREAM, subject, content) # Did all of the subscribers get the message? <API key> = [] for subscriber in subscribers: <API key>.append(<API key>(subscriber)) # Did non-subscribers not get the message? <API key> = [] for non_subscriber in non_subscribers: <API key>.append(<API key>(non_subscriber)) self.assertEqual(<API key>, <API key>) self.assertEqual(<API key>, [elt + 1 for elt in <API key>]) def <API key>(self): # type: () -> None recipient_list = ['hamlet@zulip.com', 'iago@zulip.com', 'cordelia@zulip.com', 'othello@zulip.com'] for email in recipient_list: self.subscribe_to_stream(email, "Denmark") sender_email = 'hamlet@zulip.com' sender = <API key>(sender_email) message_type_name = "stream" sending_client = make_client(name="test suite") stream = 'Denmark' subject = 'foo' content = 'whatever' realm = sender.realm def send_message(): # type: () -> None check_send_message(sender, sending_client, message_type_name, [stream], subject, content, <API key>=sender, realm=realm) send_message() # prime the caches with queries_captured() as queries: send_message() self.assert_max_length(queries, 8) def <API key>(self): # type: () -> None user_profile = <API key>("iago@zulip.com") self.subscribe_to_stream(user_profile.email, "Denmark") self.send_message("hamlet@zulip.com", "Denmark", Recipient.STREAM, content="whatever", subject="my topic") message = most_recent_message(user_profile) self.assertEqual(str(message), u'<Message: Denmark / my topic / ' '<UserProfile: hamlet@zulip.com <Realm: zulip.com 1>>>') def <API key>(self): # type: () -> None user_profile = <API key>("iago@zulip.com") self.subscribe_to_stream(user_profile.email, "Denmark") self.send_message("hamlet@zulip.com", "Denmark", Recipient.STREAM, content="test @**Iago** rules") message = most_recent_message(user_profile) assert(UserMessage.objects.get(user_profile=user_profile, message=message).flags.mentioned.is_set) def <API key>(self): # type: () -> None from zerver.lib.actions import do_change_is_admin email = "iago@zulip.com" user_profile = <API key>(email) do_change_is_admin(user_profile, True, 'api_super_user') result = self.client_post("/api/v1/messages", {"type": "stream", "to": "Verona", "sender": "cordelia@zulip.com", "client": "test suite", "subject": "announcement", "content": "Everyone knows Iago rules", "forged": "true"}, **self.api_auth(email)) self.assert_json_success(result) do_change_is_admin(user_profile, False, 'api_super_user') result = self.client_post("/api/v1/messages", {"type": "stream", "to": "Verona", "sender": "cordelia@zulip.com", "client": "test suite", "subject": "announcement", "content": "Everyone knows Iago rules", "forged": "true"}, **self.api_auth(email)) self.assert_json_error(result, "User not authorized for this query") @slow('checks all users') def <API key>(self): # type: () -> None """ If you send a message to a stream, everyone subscribed to the stream receives the messages. """ self.<API key>("Scotland") @slow('checks all users') def <API key>(self): # type: () -> None """ Sending a stream message containing non-ASCII characters in the stream name, subject, or message body succeeds. """ self.login("hamlet@zulip.com") # Subscribe everyone to a stream with non-ASCII characters. <API key> = u"hümbüǵ" realm = <API key>("zulip") stream = self.make_stream(<API key>) for user_profile in UserProfile.objects.filter(realm=realm): self.subscribe_to_stream(user_profile.email, stream.name) self.<API key>(<API key>, subject=u"hümbüǵ", content=u"hümbüǵ") class MessageDictTest(ZulipTestCase): @slow('builds lots of messages') def <API key>(self): # type: () -> None sender = <API key>('othello@zulip.com') receiver = <API key>('hamlet@zulip.com') pm_recipient = Recipient.objects.get(type_id=receiver.id, type=Recipient.PERSONAL) stream_name = u'Çiğdem' stream = self.make_stream(stream_name) stream_recipient = Recipient.objects.get(type_id=stream.id, type=Recipient.STREAM) sending_client = make_client(name="test suite") for i in range(300): for recipient in [pm_recipient, stream_recipient]: message = Message( sender=sender, recipient=recipient, subject='whatever', content='whatever %d' % i, pub_date=timezone.now(), sending_client=sending_client, last_edit_time=timezone.now(), edit_history='[]' ) message.save() Reaction.objects.create(user_profile=sender, message=message, emoji_name='simple_smile') ids = [row['id'] for row in Message.objects.all().values('id')] num_ids = len(ids) self.assertTrue(num_ids >= 600) t = time.time() with queries_captured() as queries: rows = list(Message.get_raw_db_rows(ids)) for row in rows: MessageDict.<API key>(row, False) delay = time.time() - t # Make sure we don't take longer than 1ms per message to extract messages. self.assertTrue(delay < 0.001 * num_ids) self.assert_max_length(queries, 7) self.assertEqual(len(rows), num_ids) def <API key>(self): # type: () -> None sender = <API key>('othello@zulip.com') receiver = <API key>('hamlet@zulip.com') recipient = Recipient.objects.get(type_id=receiver.id, type=Recipient.PERSONAL) sending_client = make_client(name="test suite") message = Message( sender=sender, recipient=recipient, subject='whatever', content='hello **world**', pub_date=timezone.now(), sending_client=sending_client, last_edit_time=timezone.now(), edit_history='[]' ) message.save() # An important part of this test is to get the message through this exact code path, # because there is an ugly hack we need to cover. So don't just say "row = message". row = Message.get_raw_db_rows([message.id])[0] dct = MessageDict.<API key>(row, apply_markdown=True) expected_content = '<p>hello <strong>world</strong></p>' self.assertEqual(dct['content'], expected_content) message = Message.objects.get(id=message.id) self.assertEqual(message.rendered_content, expected_content) self.assertEqual(message.<API key>, bugdown.version) def test_reaction(self): # type: () -> None sender = <API key>('othello@zulip.com') receiver = <API key>('hamlet@zulip.com') recipient = Recipient.objects.get(type_id=receiver.id, type=Recipient.PERSONAL) sending_client = make_client(name="test suite") message = Message( sender=sender, recipient=recipient, subject='whatever', content='hello **world**', pub_date=timezone.now(), sending_client=sending_client, last_edit_time=timezone.now(), edit_history='[]' ) message.save() reaction = Reaction.objects.create( message=message, user_profile=sender, emoji_name='simple_smile') row = Message.get_raw_db_rows([message.id])[0] msg_dict = MessageDict.<API key>( row, apply_markdown=True) self.assertEqual(msg_dict['reactions'][0]['emoji_name'], reaction.emoji_name) self.assertEqual(msg_dict['reactions'][0]['user']['id'], sender.id) self.assertEqual(msg_dict['reactions'][0]['user']['email'], sender.email) self.assertEqual(msg_dict['reactions'][0]['user']['full_name'], sender.full_name) class <API key>(ZulipTestCase): def <API key>(self): # type: () -> None sender = <API key>('othello@zulip.com') receiver = <API key>('hamlet@zulip.com') pm_recipient = Recipient.objects.get(type_id=receiver.id, type=Recipient.PERSONAL) stream_name = u'Çiğdem' stream = self.make_stream(stream_name) stream_recipient = Recipient.objects.get(type_id=stream.id, type=Recipient.STREAM) sending_client = make_client(name="test suite") needed_ids = [] for i in range(5): for recipient in [pm_recipient, stream_recipient]: message = Message( sender=sender, recipient=recipient, subject='whatever', content='whatever %d' % i, pub_date=timezone.now(), sending_client=sending_client, last_edit_time=timezone.now(), edit_history='[]' ) message.save() needed_ids.append(message.id) reaction = Reaction(user_profile=sender, message=message, emoji_name='simple_smile') reaction.save() messages = Message.objects.filter(id__in=needed_ids).values( *['id', 'content']) reactions = Reaction.get_raw_db_rows(needed_ids) tied_data = <API key>(messages, reactions) for data in tied_data: self.assertEqual(len(data['reactions']), 1) self.assertEqual(data['reactions'][0]['emoji_name'], 'simple_smile') self.assertTrue(data['id']) self.assertTrue(data['content']) class MessagePOSTTest(ZulipTestCase): def <API key>(self): # type: () -> None """ Sending a message to a stream to which you are subscribed is successful. """ self.login("hamlet@zulip.com") result = self.client_post("/json/messages", {"type": "stream", "to": "Verona", "client": "test suite", "content": "Test message", "subject": "Test subject"}) self.assert_json_success(result) def <API key>(self): # type: () -> None """ Same as above, but for the API view """ email = "hamlet@zulip.com" result = self.client_post("/api/v1/messages", {"type": "stream", "to": "Verona", "client": "test suite", "content": "Test message", "subject": "Test subject"}, **self.api_auth(email)) self.assert_json_success(result) def <API key>(self): # type: () -> None """ Sending messages without a to field should be sent to the default stream for the user_profile. """ email = "hamlet@zulip.com" user_profile = <API key>(email) user_profile.<API key> = get_stream('Verona', user_profile.realm) user_profile.save() result = self.client_post("/api/v1/messages", {"type": "stream", "client": "test suite", "content": "Test message no to", "subject": "Test subject"}, **self.api_auth(email)) self.assert_json_success(result) sent_message = self.get_last_message() self.assertEqual(sent_message.content, "Test message no to") def <API key>(self): # type: () -> None """ Sending a message to a nonexistent stream fails. """ self.login("hamlet@zulip.com") self.assertFalse(Stream.objects.filter(name="nonexistent_stream")) result = self.client_post("/json/messages", {"type": "stream", "to": "nonexistent_stream", "client": "test suite", "content": "Test message", "subject": "Test subject"}) self.assert_json_error(result, "Stream 'nonexistent_stream' does not exist") def <API key>(self): # type: () -> None """ Nonexistent stream name with bad characters should be escaped properly. """ self.login("hamlet@zulip.com") self.assertFalse(Stream.objects.filter(name="""&<"'><non-existent>""")) result = self.client_post("/json/messages", {"type": "stream", "to": """&<"'><non-existent>""", "client": "test suite", "content": "Test message", "subject": "Test subject"}) self.assert_json_error(result, "Stream '&amp;&lt;&quot;&#39;&gt;&lt;non-existent&gt;' does not exist") def <API key>(self): # type: () -> None """ Sending a personal message to a valid username is successful. """ self.login("hamlet@zulip.com") result = self.client_post("/json/messages", {"type": "private", "content": "Test message", "client": "test suite", "to": "othello@zulip.com"}) self.assert_json_success(result) def <API key>(self): # type: () -> None """ Sending a personal message to an invalid email returns error JSON. """ self.login("hamlet@zulip.com") result = self.client_post("/json/messages", {"type": "private", "content": "Test message", "client": "test suite", "to": "nonexistent"}) self.assert_json_error(result, "Invalid email 'nonexistent'") def test_invalid_type(self): # type: () -> None """ Sending a message of unknown type returns error JSON. """ self.login("hamlet@zulip.com") result = self.client_post("/json/messages", {"type": "invalid type", "content": "Test message", "client": "test suite", "to": "othello@zulip.com"}) self.assert_json_error(result, "Invalid message type") def test_empty_message(self): # type: () -> None """ Sending a message that is empty or only whitespace should fail """ self.login("hamlet@zulip.com") result = self.client_post("/json/messages", {"type": "private", "content": " ", "client": "test suite", "to": "othello@zulip.com"}) self.assert_json_error(result, "Message must not be empty") def <API key>(self): # type: () -> None """ Sending a mirrored huddle message works """ self.login("starnine@mit.edu") result = self.client_post("/json/messages", {"type": "private", "sender": "sipbtest@mit.edu", "content": "Test message", "client": "zephyr_mirror", "to": ujson.dumps(["starnine@mit.edu", "espuser@mit.edu"])}) self.assert_json_success(result) def <API key>(self): # type: () -> None """ Sending a mirrored personal message works """ self.login("starnine@mit.edu") result = self.client_post("/json/messages", {"type": "private", "sender": "sipbtest@mit.edu", "content": "Test message", "client": "zephyr_mirror", "to": "starnine@mit.edu"}) self.assert_json_success(result) def <API key>(self): # type: () -> None """ Sending two mirrored huddles in the row return the same ID """ msg = {"type": "private", "sender": "sipbtest@mit.edu", "content": "Test message", "client": "zephyr_mirror", "to": ujson.dumps(["espuser@mit.edu", "starnine@mit.edu"])} with mock.patch('DNS.dnslookup', return_value=[['starnine:*:84233:101:Athena Consulting Exchange User,,,:/mit/starnine:/bin/bash']]): self.login("starnine@mit.edu") result1 = self.client_post("/json/messages", msg) with mock.patch('DNS.dnslookup', return_value=[['espuser:*:95494:101:Esp Classroom,,,:/mit/espuser:/bin/athena/bash']]): self.login("espuser@mit.edu") result2 = self.client_post("/json/messages", msg) self.assertEqual(ujson.loads(result1.content)['id'], ujson.loads(result2.content)['id']) def test_long_message(self): # type: () -> None """ Sending a message longer than the maximum message length succeeds but is truncated. """ self.login("hamlet@zulip.com") long_message = "A" * (MAX_MESSAGE_LENGTH + 1) post_data = {"type": "stream", "to": "Verona", "client": "test suite", "content": long_message, "subject": "Test subject"} result = self.client_post("/json/messages", post_data) self.assert_json_success(result) sent_message = self.get_last_message() self.assertEqual(sent_message.content, "A" * (MAX_MESSAGE_LENGTH - 3) + "...") def test_long_topic(self): # type: () -> None """ Sending a message with a topic longer than the maximum topic length succeeds, but the topic is truncated. """ self.login("hamlet@zulip.com") long_topic = "A" * (MAX_SUBJECT_LENGTH + 1) post_data = {"type": "stream", "to": "Verona", "client": "test suite", "content": "test content", "subject": long_topic} result = self.client_post("/json/messages", post_data) self.assert_json_success(result) sent_message = self.get_last_message() self.assertEqual(sent_message.topic_name(), "A" * (MAX_SUBJECT_LENGTH - 3) + "...") def <API key>(self): # type: () -> None self.login("hamlet@zulip.com") result = self.client_post("/json/messages", {"type": "stream", "to": "Verona", "client": "test suite", "content": "Test message", "subject": "Test subject", "forged": True}) self.assert_json_error(result, "User not authorized for this query") def <API key>(self): # type: () -> None self.login("hamlet@zulip.com") result = self.client_post("/json/messages", {"type": "stream", "to": "Verona", "client": "test suite", "content": "Test message", "subject": "Test subject", "domain": "mit.edu"}) self.assert_json_error(result, "User not authorized for this query") def <API key>(self): # type: () -> None email = "emailgateway@zulip.com" user = <API key>(email) password = "test_password" user.set_password(password) user.is_api_super_user = True user.save() self.login(email, password) result = self.client_post("/json/messages", {"type": "stream", "to": "Verona", "client": "test suite", "content": "Test message", "subject": "Test subject", "domain": "non-existing"}) user.is_api_super_user = False user.save() self.assert_json_error(result, "Unknown domain non-existing") def <API key>(self): # type: () -> None self.login("starnine@mit.edu") result = self.client_post("/json/messages", {"type": "private", "content": "Test message", "client": "zephyr_mirror", "to": "starnine@mit.edu"}) self.assert_json_error(result, "Missing sender") def <API key>(self): # type: () -> None self.login("starnine@mit.edu") result = self.client_post("/json/messages", {"type": "not-private", "sender": "sipbtest@mit.edu", "content": "Test message", "client": "zephyr_mirror", "to": "starnine@mit.edu"}) self.assert_json_error(result, "User not authorized for this query") @mock.patch("zerver.views.messages.<API key>") def <API key>(self, <API key>): # type: (Any) -> None <API key>.return_value = (False, True) self.login("starnine@mit.edu") result = self.client_post("/json/messages", {"type": "private", "sender": "sipbtest@mit.edu", "content": "Test message", "client": "zephyr_mirror", "to": "starnine@mit.edu"}) self.assert_json_error(result, "Invalid mirrored message") @mock.patch("zerver.views.messages.<API key>") def <API key>(self, <API key>): # type: (Any) -> None <API key>.return_value = (True, True) email = "starnine@mit.edu" user = <API key>(email) domain = user.realm.domain user.realm.domain = 'not_mit.edu' user.realm.save() self.login("starnine@mit.edu") result = self.client_post("/json/messages", {"type": "private", "sender": "sipbtest@mit.edu", "content": "Test message", "client": "zephyr_mirror", "to": "starnine@mit.edu"}, name='gownooo') self.assert_json_error(result, "Invalid mirrored realm") user.realm.domain = domain user.realm.save() class EditMessageTest(ZulipTestCase): def check_message(self, msg_id, subject=None, content=None): # type: (int, Optional[Text], Optional[Text]) -> Message msg = Message.objects.get(id=msg_id) cached = message_to_dict(msg, False) uncached = MessageDict.<API key>(msg, False) self.assertEqual(cached, uncached) if subject: self.assertEqual(msg.topic_name(), subject) if content: self.assertEqual(msg.content, content) return msg def test_save_message(self): # type: () -> None """This is also tested by a client test, but here we can verify the cache against the database""" self.login("hamlet@zulip.com") msg_id = self.send_message("hamlet@zulip.com", "Scotland", Recipient.STREAM, subject="editing", content="before edit") result = self.client_patch("/json/messages/" + str(msg_id), { 'message_id': msg_id, 'content': 'after edit' }) self.assert_json_success(result) self.check_message(msg_id, content="after edit") result = self.client_patch("/json/messages/" + str(msg_id), { 'message_id': msg_id, 'subject': 'edited' }) self.assert_json_success(result) self.check_message(msg_id, subject="edited") def <API key>(self): # type: () -> None self.login("hamlet@zulip.com") msg_id = self.send_message("hamlet@zulip.com", "cordelia@zulip.com", Recipient.PERSONAL, subject="editing", content="**before** edit") result = self.client_get('/json/messages/' + str(msg_id)) self.assert_json_success(result) data = ujson.loads(result.content) self.assertEqual(data['raw_content'], '**before** edit') # Test error cases result = self.client_get('/json/messages/999999') self.assert_json_error(result, 'Invalid message(s)') self.login("cordelia@zulip.com") result = self.client_get('/json/messages/' + str(msg_id)) self.assert_json_success(result) self.login("othello@zulip.com") result = self.client_get('/json/messages/' + str(msg_id)) self.assert_json_error(result, 'Invalid message(s)') def <API key>(self): # type: () -> None email = "hamlet@zulip.com" self.login(email) stream = self.make_stream('public_stream') self.subscribe_to_stream(email, stream.name) msg_id = self.send_message(email, stream.name, Recipient.STREAM, subject="test", content="test") result = self.client_get('/json/messages/' + str(msg_id)) self.assert_json_success(result) self.login("sipbtest@mit.edu") result = self.client_get('/json/messages/' + str(msg_id)) self.assert_json_error(result, 'Invalid message(s)') def <API key>(self): # type: () -> None email = "hamlet@zulip.com" self.login(email) stream = self.make_stream('private_stream', invite_only=True) self.subscribe_to_stream(email, stream.name) msg_id = self.send_message(email, stream.name, Recipient.STREAM, subject="test", content="test") result = self.client_get('/json/messages/' + str(msg_id)) self.assert_json_success(result) self.login("othello@zulip.com") result = self.client_get('/json/messages/' + str(msg_id)) self.assert_json_error(result, 'Invalid message(s)') def <API key>(self): # type: () -> None self.login("hamlet@zulip.com") msg_id = self.send_message("hamlet@zulip.com", "Scotland", Recipient.STREAM, subject="editing", content="before edit") result = self.client_patch("/json/messages/" + str(msg_id), { 'message_id': msg_id, }) self.assert_json_error(result, "Nothing to change") def <API key>(self): # type: () -> None self.login("hamlet@zulip.com") msg_id = self.send_message("hamlet@zulip.com", "Scotland", Recipient.STREAM, subject="editing", content="before edit") result = self.client_patch("/json/messages/" + str(msg_id), { 'message_id': msg_id, 'subject': ' ' }) self.assert_json_error(result, "Topic can't be empty") def <API key>(self): # type: () -> None self.login("hamlet@zulip.com") msg_id = self.send_message("hamlet@zulip.com", "Scotland", Recipient.STREAM, subject="editing", content="before edit") result = self.client_patch("/json/messages/" + str(msg_id), { 'message_id': msg_id, 'content': ' ' }) self.assert_json_success(result) content = Message.objects.filter(id=msg_id).values_list('content', flat = True)[0] self.assertEqual(content, "(deleted)") def <API key>(self): # type: () -> None def <API key>(<API key>, <API key>): # type: (bool, int) -> None result = self.client_patch("/json/realm", { '<API key>': ujson.dumps(<API key>), '<API key>': <API key> }) self.assert_json_success(result) def <API key>(id_, unique_str, topic_only = False): # type: (int, Text, bool) -> None new_subject = 'subject' + unique_str new_content = 'content' + unique_str params_dict = {'message_id': id_, 'subject': new_subject} if not topic_only: params_dict['content'] = new_content result = self.client_patch("/json/messages/" + str(id_), params_dict) self.assert_json_success(result) if topic_only: self.check_message(id_, subject=new_subject) else: self.check_message(id_, subject=new_subject, content=new_content) def <API key>(id_, unique_str, error, topic_only = False): # type: (int, Text, Text, bool) -> None message = Message.objects.get(id=id_) old_subject = message.topic_name() old_content = message.content new_subject = 'subject' + unique_str new_content = 'content' + unique_str params_dict = {'message_id': id_, 'subject': new_subject} if not topic_only: params_dict['content'] = new_content result = self.client_patch("/json/messages/" + str(id_), params_dict) message = Message.objects.get(id=id_) self.assert_json_error(result, error) self.check_message(id_, subject=old_subject, content=old_content) self.login("iago@zulip.com") # send a message in the past id_ = self.send_message("iago@zulip.com", "Scotland", Recipient.STREAM, content="content", subject="subject") message = Message.objects.get(id=id_) message.pub_date = message.pub_date - datetime.timedelta(seconds=180) message.save() # test the various possible message editing settings # high enough time limit, all edits allowed <API key>(True, 240) <API key>(id_, 'A') # out of time, only topic editing allowed <API key>(True, 120) <API key>(id_, 'B', True) <API key>(id_, 'C', "The time limit for editing this message has past") # infinite time, all edits allowed <API key>(True, 0) <API key>(id_, 'D') # without <API key>, nothing is allowed <API key>(False, 240) <API key>(id_, 'E', "Your organization has turned off message editing.", True) <API key>(False, 120) <API key>(id_, 'F', "Your organization has turned off message editing.", True) <API key>(False, 0) <API key>(id_, 'G', "Your organization has turned off message editing.", True) def <API key>(self): # type: () -> None self.login("hamlet@zulip.com") id1 = self.send_message("hamlet@zulip.com", "Scotland", Recipient.STREAM, subject="topic1") id2 = self.send_message("iago@zulip.com", "Scotland", Recipient.STREAM, subject="topic1") id3 = self.send_message("iago@zulip.com", "Rome", Recipient.STREAM, subject="topic1") id4 = self.send_message("hamlet@zulip.com", "Scotland", Recipient.STREAM, subject="topic2") id5 = self.send_message("iago@zulip.com", "Scotland", Recipient.STREAM, subject="topic1") result = self.client_patch("/json/messages/" + str(id1), { 'message_id': id1, 'subject': 'edited', 'propagate_mode': 'change_later' }) self.assert_json_success(result) self.check_message(id1, subject="edited") self.check_message(id2, subject="edited") self.check_message(id3, subject="topic1") self.check_message(id4, subject="topic2") self.check_message(id5, subject="edited") def <API key>(self): # type: () -> None self.login("hamlet@zulip.com") id1 = self.send_message("hamlet@zulip.com", "Scotland", Recipient.STREAM, subject="topic1") id2 = self.send_message("hamlet@zulip.com", "Scotland", Recipient.STREAM, subject="topic1") id3 = self.send_message("iago@zulip.com", "Rome", Recipient.STREAM, subject="topic1") id4 = self.send_message("hamlet@zulip.com", "Scotland", Recipient.STREAM, subject="topic2") id5 = self.send_message("iago@zulip.com", "Scotland", Recipient.STREAM, subject="topic1") id6 = self.send_message("iago@zulip.com", "Scotland", Recipient.STREAM, subject="topic3") result = self.client_patch("/json/messages/" + str(id2), { 'message_id': id2, 'subject': 'edited', 'propagate_mode': 'change_all' }) self.assert_json_success(result) self.check_message(id1, subject="edited") self.check_message(id2, subject="edited") self.check_message(id3, subject="topic1") self.check_message(id4, subject="topic2") self.check_message(id5, subject="edited") self.check_message(id6, subject="topic3") class <API key>(TestCase): class Request(object): pass def test_invalid_sender(self): # type: () -> None user = <API key>('hamlet@zulip.com') recipients = [] # type: List[Text] request = self.Request() request.POST = dict() # no sender (valid_input, mirror_sender) = \ <API key>(request, user, recipients) self.assertEqual(valid_input, False) self.assertEqual(mirror_sender, None) def test_invalid_client(self): # type: () -> None client = get_client(name='banned_mirror') # Invalid!!! user = <API key>('hamlet@zulip.com') sender = user recipients = [] # type: List[Text] request = self.Request() request.POST = dict( sender=sender.email, type='private') request.client = client (valid_input, mirror_sender) = \ <API key>(request, user, recipients) self.assertEqual(valid_input, False) self.assertEqual(mirror_sender, None) def test_invalid_email(self): # type: () -> None invalid_email = 'alice AT example.com' recipients = [invalid_email] # We use an MIT user here to maximize code coverage user = <API key>('starnine@mit.edu') sender = user for client_name in ['zephyr_mirror', 'irc_mirror', 'jabber_mirror']: client = get_client(name=client_name) request = self.Request() request.POST = dict( sender=sender.email, type='private') request.client = client (valid_input, mirror_sender) = \ <API key>(request, user, recipients) self.assertEqual(valid_input, False) self.assertEqual(mirror_sender, None) @mock.patch('DNS.dnslookup', return_value=[['sipbtest:*:20922:101:Fred Sipb,,,:/mit/sipbtest:/bin/athena/tcsh']]) def <API key>(self, ignored): # type: (Any) -> None """Test mirror dummy user creation for PM recipients""" client = get_client(name='zephyr_mirror') user = <API key>('starnine@mit.edu') sender = <API key>('sipbtest@mit.edu') new_user_email = 'bob_the_new_user@mit.edu' recipients = [user.email, new_user_email] # Now make the request. request = self.Request() request.POST = dict( sender=sender.email, type='private') request.client = client (valid_input, mirror_sender) = \ <API key>(request, user, recipients) self.assertTrue(valid_input) self.assertEqual(mirror_sender, sender) realm_users = UserProfile.objects.filter(realm=sender.realm) realm_emails = {user.email for user in realm_users} self.assertIn(user.email, realm_emails) self.assertIn(new_user_email, realm_emails) bob = <API key>(new_user_email) self.assertTrue(bob.is_mirror_dummy) @mock.patch('DNS.dnslookup', return_value=[['sipbtest:*:20922:101:Fred Sipb,,,:/mit/sipbtest:/bin/athena/tcsh']]) def <API key>(self, ignored): # type: (Any) -> None """Test mirror dummy user creation for sender when sending to stream""" client = get_client(name='zephyr_mirror') user = <API key>('starnine@mit.edu') sender_email = 'new_sender@mit.edu' recipients = ['stream_name'] # Now make the request. request = self.Request() request.POST = dict( sender=sender_email, type='stream') request.client = client (valid_input, mirror_sender) = \ <API key>(request, user, recipients) self.assertTrue(valid_input) self.assertEqual(mirror_sender.email, sender_email) self.assertTrue(mirror_sender.is_mirror_dummy) def test_irc_mirror(self): # type: () -> None client = get_client(name='irc_mirror') sender = <API key>('hamlet@zulip.com') user = sender recipients = ['alice@zulip.com', 'bob@irc.zulip.com', 'cordelia@zulip.com'] # Now make the request. request = self.Request() request.POST = dict( sender=sender.email, type='private') request.client = client (valid_input, mirror_sender) = \ <API key>(request, user, recipients) self.assertEqual(valid_input, True) self.assertEqual(mirror_sender, sender) realm_users = UserProfile.objects.filter(realm=sender.realm) realm_emails = {user.email for user in realm_users} self.assertIn('alice@zulip.com', realm_emails) self.assertIn('bob@irc.zulip.com', realm_emails) bob = <API key>('bob@irc.zulip.com') self.assertTrue(bob.is_mirror_dummy) def test_jabber_mirror(self): # type: () -> None client = get_client(name='jabber_mirror') sender = <API key>('hamlet@zulip.com') user = sender recipients = ['alice@zulip.com', 'bob@zulip.com', 'cordelia@zulip.com'] # Now make the request. request = self.Request() request.POST = dict( sender=sender.email, type='private') request.client = client (valid_input, mirror_sender) = \ <API key>(request, user, recipients) self.assertEqual(valid_input, True) self.assertEqual(mirror_sender, sender) realm_users = UserProfile.objects.filter(realm=sender.realm) realm_emails = {user.email for user in realm_users} self.assertIn('alice@zulip.com', realm_emails) self.assertIn('bob@zulip.com', realm_emails) bob = <API key>('bob@zulip.com') self.assertTrue(bob.is_mirror_dummy) class StarTests(ZulipTestCase): def change_star(self, messages, add=True): # type: (List[int], bool) -> HttpResponse return self.client_post("/json/messages/flags", {"messages": ujson.dumps(messages), "op": "add" if add else "remove", "flag": "starred"}) def test_change_star(self): # type: () -> None """ You can set a message as starred/un-starred through POST /json/messages/flags. """ self.login("hamlet@zulip.com") message_ids = [self.send_message("hamlet@zulip.com", "hamlet@zulip.com", Recipient.PERSONAL, "test")] # Star a message. result = self.change_star(message_ids) self.assert_json_success(result) for msg in self.get_old_messages(): if msg['id'] in message_ids: self.assertEqual(msg['flags'], ['starred']) else: self.assertEqual(msg['flags'], ['read']) result = self.change_star(message_ids, False) self.assert_json_success(result) # Remove the stars. for msg in self.get_old_messages(): if msg['id'] in message_ids: self.assertEqual(msg['flags'], []) def <API key>(self): # type: () -> None """ You can set a message as starred/un-starred through POST /json/messages/flags. """ stream_name = "new_stream" self.subscribe_to_stream("hamlet@zulip.com", stream_name) self.login("hamlet@zulip.com") message_ids = [self.send_message("hamlet@zulip.com", stream_name, Recipient.STREAM, "test")] # Now login as another user who wasn't on that stream self.login("cordelia@zulip.com") # We can't change flags other than "starred" on historical messages: result = self.client_post("/json/messages/flags", {"messages": ujson.dumps(message_ids), "op": "add", "flag": "read"}) self.assert_json_error(result, 'Invalid message(s)') # Trying to change a list of more than one historical message fails result = self.change_star(message_ids * 2) self.assert_json_error(result, 'Invalid message(s)') # Confirm that one can change the historical flag now result = self.change_star(message_ids) self.assert_json_success(result) for msg in self.get_old_messages(): if msg['id'] in message_ids: self.assertEqual(set(msg['flags']), {'starred', 'historical', 'read'}) else: self.assertEqual(msg['flags'], ['read']) result = self.change_star(message_ids, False) self.assert_json_success(result) # But it still doesn't work if you're in another realm self.login("sipbtest@mit.edu") result = self.change_star(message_ids) self.assert_json_error(result, 'Invalid message(s)') def <API key>(self): # type: () -> None """ You can set a message as starred/un-starred through POST /json/messages/flags. """ self.login("hamlet@zulip.com") message_ids = [self.send_message("hamlet@zulip.com", "hamlet@zulip.com", Recipient.PERSONAL, "test")] # Starring private messages you didn't receive fails. self.login("cordelia@zulip.com") result = self.change_star(message_ids) self.assert_json_error(result, 'Invalid message(s)') def <API key>(self): # type: () -> None stream_name = "private_stream" self.make_stream(stream_name, invite_only=True) self.subscribe_to_stream("hamlet@zulip.com", stream_name) self.login("hamlet@zulip.com") message_ids = [self.send_message("hamlet@zulip.com", stream_name, Recipient.STREAM, "test")] # Starring private stream messages you received works result = self.change_star(message_ids) self.assert_json_success(result) # Starring private stream messages you didn't receive fails. self.login("cordelia@zulip.com") result = self.change_star(message_ids) self.assert_json_error(result, 'Invalid message(s)') def test_new_message(self): # type: () -> None """ New messages aren't starred. """ test_email = "hamlet@zulip.com" self.login(test_email) content = "Test message for star" self.send_message(test_email, "Verona", Recipient.STREAM, content=content) sent_message = UserMessage.objects.filter( user_profile=<API key>(test_email) ).order_by("id").reverse()[0] self.assertEqual(sent_message.message.content, content) self.assertFalse(sent_message.flags.starred) class AttachmentTest(ZulipTestCase): def test_basics(self): # type: () -> None self.assertFalse(Message.<API key>('whatever')) self.assertFalse(Message.<API key>('yo http://foo.com')) self.assertTrue(Message.<API key>('yo\n https://staging.zulip.com/user_uploads/')) self.assertTrue(Message.<API key>('yo\n /user_uploads/1/<API key>/photo-10.jpg foo')) self.assertFalse(Message.content_has_image('whatever')) self.assertFalse(Message.content_has_image('yo http://foo.com')) self.assertFalse(Message.content_has_image('yo\n /user_uploads/1/<API key>/photo-10.pdf foo')) for ext in [".bmp", ".gif", ".jpg", "jpeg", ".png", ".webp", ".JPG"]: content = 'yo\n /user_uploads/1/<API key>/photo-10.%s foo' % (ext,) self.assertTrue(Message.content_has_image(content)) self.assertFalse(Message.content_has_link('whatever')) self.assertTrue(Message.content_has_link('yo\n http://foo.com')) self.assertTrue(Message.content_has_link('yo\n https://example.com?spam=1&eggs=2')) self.assertTrue(Message.content_has_link('yo /user_uploads/1/<API key>/photo-10.pdf foo')) def <API key>(self): # type: () -> None # Create dummy DB entry sender_email = "hamlet@zulip.com" user_profile = <API key>(sender_email) dummy_files = [ ('zulip.txt', '1/31/<API key>/zulip.txt'), ('temp_file.py', '1/31/<API key>/temp_file.py'), ('abc.py', '1/31/<API key>/abc.py') ] for file_name, path_id in dummy_files: create_attachment(file_name, path_id, user_profile) # Send message referring the attachment self.subscribe_to_stream(sender_email, "Denmark") body = "Some files here ...[zulip.txt](http://localhost:9991/user_uploads/1/31/<API key>/zulip.txt)" + \ "http://localhost:9991/user_uploads/1/31/<API key>/temp_file.py.... Some more...." + \ "http://localhost:9991/user_uploads/1/31/<API key>/abc.py" self.send_message(sender_email, "Denmark", Recipient.STREAM, body, "test") for file_name, path_id in dummy_files: attachment = Attachment.objects.get(path_id=path_id) self.assertTrue(attachment.is_claimed()) class LogDictTest(ZulipTestCase): def test_to_log_dict(self): # type: () -> None email = 'hamlet@zulip.com' stream_name = 'Denmark' topic_name = 'Copenhagen' content = 'find me some good coffee shops' # self.login("hamlet@zulip.com") message_id = self.send_message(email, stream_name, message_type=Recipient.STREAM, subject=topic_name, content=content) message = Message.objects.get(id=message_id) dct = message.to_log_dict() self.assertTrue('timestamp' in dct) self.assertEqual(dct['content'], 'find me some good coffee shops') self.assertEqual(dct['id'], message.id) self.assertEqual(dct['recipient'], 'Denmark') self.assertEqual(dct['sender_domain'], 'zulip.com') self.assertEqual(dct['sender_email'], 'hamlet@zulip.com') self.assertEqual(dct['sender_full_name'], 'King Hamlet') self.assertEqual(dct['sender_id'], <API key>(email).id) self.assertEqual(dct['sender_short_name'], 'hamlet') self.assertEqual(dct['sending_client'], 'test suite') self.assertEqual(dct['subject'], 'Copenhagen') self.assertEqual(dct['type'], 'stream') class CheckMessageTest(ZulipTestCase): def <API key>(self): # type: () -> None sender = <API key>('othello@zulip.com') client = make_client(name="test suite") stream_name = u'España y Francia' self.make_stream(stream_name) message_type_name = 'stream' message_to = None message_to = [stream_name] subject_name = 'issue' message_content = 'whatever' ret = check_message(sender, client, message_type_name, message_to, subject_name, message_content) self.assertEqual(ret['message'].sender.email, 'othello@zulip.com') def test_bot_pm_feature(self): # type: () -> None """We send a PM to a bot's owner if their bot sends a message to an unsubscribed stream""" parent = <API key>('othello@zulip.com') bot = do_create_user( email='othello-bot@zulip.com', password='', realm=parent.realm, full_name='', short_name='', active=True, bot_type=UserProfile.DEFAULT_BOT, bot_owner=parent ) bot.last_reminder = None sender = bot client = make_client(name="test suite") stream_name = u'Россия' message_type_name = 'stream' message_to = None message_to = [stream_name] subject_name = 'issue' message_content = 'whatever' old_count = <API key>(parent) # Try sending to stream that doesn't exist sends a reminder to # the sender with self.assertRaises(JsonableError): check_message(sender, client, message_type_name, message_to, subject_name, message_content) new_count = <API key>(parent) self.assertEqual(new_count, old_count + 1) self.assertIn("that stream does not yet exist.", most_recent_message(parent).content) # Try sending to stream that exists with no subscribers soon # after; due to rate-limiting, this should send nothing. self.make_stream(stream_name) ret = check_message(sender, client, message_type_name, message_to, subject_name, message_content) new_count = <API key>(parent) self.assertEqual(new_count, old_count + 1) # Try sending to stream that exists with no subscribers longer # after; this should send an error to the bot owner that the # stream doesn't exist sender.last_reminder = sender.last_reminder - datetime.timedelta(hours=1) sender.save(update_fields=["last_reminder"]) ret = check_message(sender, client, message_type_name, message_to, subject_name, message_content) new_count = <API key>(parent) self.assertEqual(new_count, old_count + 2) self.assertEqual(ret['message'].sender.email, 'othello-bot@zulip.com') self.assertIn("there are no subscribers to that stream", most_recent_message(parent).content)
package org.zstack.sdk; import java.util.HashMap; import java.util.Map; import org.zstack.sdk.*; public class <API key> extends AbstractAction { private static final HashMap<String, Parameter> parameterMap = new HashMap<>(); private static final HashMap<String, Parameter> nonAPIParameterMap = new HashMap<>(); public static class Result { public ErrorCode error; public org.zstack.sdk.<API key> value; public Result <API key>() { if (error != null) { throw new ApiException( String.format("error[code: %s, description: %s, details: %s]", error.code, error.description, error.details) ); } return this; } } @Param(required = true, nonempty = false, nullElements = false, emptyString = true, noTrim = false) public java.lang.String pciDeviceUuid; @Param(required = true, nonempty = false, nullElements = false, emptyString = true, noTrim = false) public java.lang.String vmInstanceUuid; @Param(required = false) public java.util.List systemTags; @Param(required = false) public java.util.List userTags; @Param(required = false) public String sessionId; @Param(required = false) public String accessKeyId; @Param(required = false) public String accessKeySecret; @Param(required = false) public String requestIp; @NonAPIParam public long timeout = -1; @NonAPIParam public long pollingInterval = -1; private Result makeResult(ApiResult res) { Result ret = new Result(); if (res.error != null) { ret.error = res.error; return ret; } org.zstack.sdk.<API key> value = res.getResult(org.zstack.sdk.<API key>.class); ret.value = value == null ? new org.zstack.sdk.<API key>() : value; return ret; } public Result call() { ApiResult res = ZSClient.call(this); return makeResult(res); } public void call(final Completion<Result> completion) { ZSClient.call(this, new InternalCompletion() { @Override public void complete(ApiResult res) { completion.complete(makeResult(res)); } }); } protected Map<String, Parameter> getParameterMap() { return parameterMap; } protected Map<String, Parameter> <API key>() { return nonAPIParameterMap; } protected RestInfo getRestInfo() { RestInfo info = new RestInfo(); info.httpMethod = "POST"; info.path = "/pci-device/pci-devices/{pciDeviceUuid}/attach"; info.needSession = true; info.needPoll = true; info.parameterName = "params"; return info; } }
package gov.va.isaac.gui.mapping; public enum MappingColumnType { STATUS_CONDENSED("Status Condensed"), NAME("Name"), DESCRIPTION("Description"), PURPOSE("Purpose"), EDITOR_STATUS("Editor Status", true), INVERSE_NAME("Inverse Name"), SOURCE("Source Concept", true), TARGET("Target Concept", true), QUALIFIER("Qualifier", true), COMMENTS("Comments"), CONCEPT("Concept", true), CODE_SYSTEM("Code System", true), STAMP("STAMP"), STATUS_STRING("Status"), TIME("Time"), AUTHOR("Author",true), MODULE("Module",true), PATH("Path",true); private String niceName_; private boolean isConcept_ = false; private MappingColumnType(String name) { this(name, false); } private MappingColumnType(String name, boolean isConcept) { niceName_ = name; isConcept_ = isConcept; } @Override public String toString() { return niceName_; } public boolean isConcept() { return isConcept_; } }
namespace StockSharp.Algo.Indicators { using System.ComponentModel; using StockSharp.Algo.Candles; using StockSharp.Localization; <summary> Money Flow Index. </summary> [DisplayName("MFI")] [DescriptionLoc(LocalizedStrings.MoneyFlowIndexKey)] public class MoneyFlowIndex : LengthIndicator<decimal> { private decimal _previousPrice; private readonly Sum _positiveFlow = new Sum(); private readonly Sum _negativeFlow = new Sum(); <summary> Initializes a new instance of the <see cref="MoneyFlowIndex"/>. </summary> public MoneyFlowIndex() { Length = 14; } <summary> Initializes a new instance of the <see cref="MoneyFlowIndex"/> using a specified length. </summary> public MoneyFlowIndex(int length) { Length = length; } <summary> To reset the indicator status to initial. The method is called each time when initial settings are changed (for example, the length of period). </summary> public override void Reset() { base.Reset(); _positiveFlow.Length = _negativeFlow.Length = Length; _previousPrice = 0; } <summary> Whether the indicator is set. </summary> public override bool IsFormed => _positiveFlow.IsFormed && _negativeFlow.IsFormed; <summary> To handle the input value. </summary> <param name="input">The input value.</param> <returns>The resulting value.</returns> protected override IIndicatorValue OnProcess(IIndicatorValue input) { var candle = input.GetValue<Candle>(); var typicalPrice = (candle.HighPrice + candle.LowPrice + candle.ClosePrice) / 3.0m; var moneyFlow = typicalPrice * candle.TotalVolume; var positiveFlow = _positiveFlow.Process(input.SetValue(this, typicalPrice > _previousPrice ? moneyFlow : 0.0m)).GetValue<decimal>(); var negativeFlow = _negativeFlow.Process(input.SetValue(this, typicalPrice < _previousPrice ? moneyFlow : 0.0m)).GetValue<decimal>(); _previousPrice = typicalPrice; if (negativeFlow == 0) return new <API key>(this, 100m); if (positiveFlow / negativeFlow == 1) return new <API key>(this, 0m); return negativeFlow != 0 ? new <API key>(this, 100m - 100m / (1m + positiveFlow / negativeFlow)) : new <API key>(this); } } }
package com.intellij.java.dependencies; import com.intellij.JavaTestUtil; import com.intellij.analysis.AnalysisScope; import com.intellij.analysis.JavaAnalysisScope; import com.intellij.openapi.util.text.StringUtil; import com.intellij.packageDependencies.<API key>; import com.intellij.packageDependencies.DependenciesBuilder; import com.intellij.packageDependencies.FindDependencyUtil; import com.intellij.packageDependencies.<API key>; import com.intellij.psi.JavaPsiFacade; import com.intellij.psi.PsiClass; import com.intellij.psi.PsiFile; import com.intellij.psi.PsiPackage; import com.intellij.psi.search.GlobalSearchScope; import com.intellij.testFramework.IdeaTestUtil; import com.intellij.testFramework.PsiTestCase; import com.intellij.testFramework.PsiTestUtil; import com.intellij.usageView.UsageInfo; import com.intellij.usages.TextChunk; import com.intellij.usages.Usage; import com.intellij.usages.<API key>; import com.intellij.util.containers.JBIterable; import org.jetbrains.annotations.NotNull; import java.util.HashSet; import java.util.Set; public class <API key> extends PsiTestCase { @Override protected void setUp() throws Exception { super.setUp(); String root = JavaTestUtil.getJavaTestDataPath() + "/dependencies/search/" + getTestName(true); PsiTestUtil.removeAllRoots(myModule, IdeaTestUtil.getMockJdk17()); <API key>( root); } @SuppressWarnings("ConstantConditions") public void <API key>() { PsiPackage bPackage = JavaPsiFacade.getInstance(myPsiManager.getProject()).findPackage("com.b"); DependenciesBuilder builder = new <API key>(myProject, new JavaAnalysisScope(bPackage, null)); builder.analyze(); Set<PsiFile> searchFor = new HashSet<>(); searchFor.add(myJavaFacade.findClass("com.a.A", GlobalSearchScope.allScope(myProject)).getContainingFile()); Set<PsiFile> searchIn = new HashSet<>(); PsiClass bClass = myJavaFacade.findClass("com.b.B", GlobalSearchScope.allScope(myProject)); searchIn.add(bClass.getContainingFile()); PsiClass cClass = myJavaFacade.findClass("com.b.C", GlobalSearchScope.allScope(myProject)); searchIn.add(cClass.getContainingFile()); UsageInfo[] usagesInfos = FindDependencyUtil.findDependencies(builder, searchIn, searchFor); <API key>[] usages = <API key>.convert(usagesInfos); String[] psiUsages = new String[usagesInfos.length]; for (int i = 0; i < usagesInfos.length; i++) { psiUsages[i] = toString(usages[i]); } checkResult(new String[]{ "2 import com.a.A;", "4 A myA = new A();", "4 A myA = new A();", "6 myA.aa();", "2 import com.a.A;", "4 A myA = new A();", "4 A myA = new A();", "6 myA.aa();"}, psiUsages); } @NotNull private static String toString(@NotNull Usage usage) { JBIterable<TextChunk> it = JBIterable.of(usage.getPresentation().getText()); TextChunk first = it.first(); assert first != null; JBIterable<TextChunk> rest = it.skip(1); return first.toString() + " " + StringUtil.join(rest, Object::toString, ""); } @SuppressWarnings("ConstantConditions") public void <API key>() { PsiPackage bPackage = JavaPsiFacade.getInstance(myPsiManager.getProject()).findPackage("com.a"); DependenciesBuilder builder = new <API key>(myProject, new JavaAnalysisScope(bPackage, null)); builder.analyze(); Set<PsiFile> searchFor = new HashSet<>(); searchFor.add(myJavaFacade.findClass("com.a.A", GlobalSearchScope.allScope(myProject)).getContainingFile()); Set<PsiFile> searchIn = new HashSet<>(); PsiClass bClass = myJavaFacade.findClass("com.b.B", GlobalSearchScope.allScope(myProject)); searchIn.add(bClass.getContainingFile()); PsiClass cClass = myJavaFacade.findClass("com.a.C", GlobalSearchScope.allScope(myProject)); searchFor.add(cClass.getContainingFile()); UsageInfo[] usagesInfos = FindDependencyUtil.<API key>(builder, searchIn, searchFor); <API key>[] usages = <API key>.convert(usagesInfos); String[] psiUsages = new String[usagesInfos.length]; for (int i = 0; i < usagesInfos.length; i++) { psiUsages[i] = toString(usages[i]); } checkResult(new String[]{ "4 A myA = new A();", "4 A myA = new A();", "5 C myC = new C();", "5 C myC = new C();", "7 myA.aa();", "8 myC.cc();"}, psiUsages); } @SuppressWarnings("ConstantConditions") public void testForwardSimple() { DependenciesBuilder builder = new <API key>(myProject, new AnalysisScope(myProject)); builder.analyze(); Set<PsiFile> searchIn = new HashSet<>(); PsiClass aClass = myJavaFacade.findClass("A", GlobalSearchScope.allScope(myProject)); searchIn.add(aClass.getContainingFile()); Set<PsiFile> searchFor = new HashSet<>(); PsiClass bClass = myJavaFacade.findClass("B", GlobalSearchScope.allScope(myProject)); searchFor.add(bClass.getContainingFile()); UsageInfo[] usagesInfos = FindDependencyUtil.findDependencies(builder, searchIn, searchFor); <API key>[] usages = <API key>.convert(usagesInfos); String[] psiUsages = new String[usagesInfos.length]; for (int i = 0; i < usagesInfos.length; i++) { psiUsages[i] = toString(usages[i]); } checkResult(new String[]{ "2 B myB = new B();", "2 B myB = new B();", "4 myB.bb();"}, psiUsages); } @SuppressWarnings("ConstantConditions") public void <API key>() { DependenciesBuilder builder = new <API key>(myProject, new AnalysisScope(myProject)); builder.analyze(); Set<PsiFile> searchIn = new HashSet<>(); PsiClass aClass = myJavaFacade.findClass("A", GlobalSearchScope.allScope(myProject)); searchIn.add(aClass.getContainingFile()); Set<PsiFile> searchFor = new HashSet<>(); PsiClass stringClass = myJavaFacade.findClass("java.lang.String", GlobalSearchScope.allScope(myProject)); searchFor.add((PsiFile)stringClass.getContainingFile().<API key>()); UsageInfo[] usagesInfos = FindDependencyUtil.findDependencies(builder, searchIn, searchFor); <API key>[] usages = <API key>.convert(usagesInfos); String[] psiUsages = new String[usagesInfos.length]; for (int i = 0; i < usagesInfos.length; i++) { psiUsages[i] = toString(usages[i]); } checkResult(new String[]{"2 String myName;"}, psiUsages); } private static void checkResult(@NotNull String[] usages, @NotNull String[] psiUsages) { assertEquals(usages.length, psiUsages.length); for (int i = 0; i < psiUsages.length; i++) { assertEquals(usages[i], psiUsages[i]); } } }
package com.jetbrains.python.refactoring.classes; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.command.CommandProcessor; import com.intellij.openapi.project.Project; import com.intellij.refactoring.<API key>; import com.jetbrains.python.fixtures.PyTestCase; import com.jetbrains.python.psi.PyClass; import com.jetbrains.python.psi.PyElement; import com.jetbrains.python.psi.PyFunction; import com.jetbrains.python.psi.PyTargetExpression; import com.jetbrains.python.psi.stubs.PyClassNameIndex; import com.jetbrains.python.refactoring.classes.membersManager.MembersManager; import com.jetbrains.python.refactoring.classes.membersManager.PyMemberInfo; import org.hamcrest.Matchers; import org.jetbrains.annotations.NotNull; import org.junit.Assert; import java.util.Collection; /** * @author Dennis.Ushakov */ public abstract class <API key> extends PyTestCase { @NotNull private final String myRefactoringName; /** * @param refactoringName name of the refactoring. It will be used as folder name for tests */ protected <API key>(@NotNull final String refactoringName) { myRefactoringName = refactoringName; } /** * Finds memberInfo by class name and member name. * * @param clazzName name of class * @param memberName name of member (See {@link #findMember(String, String)} for naming protocol) * @return member info * @see #findMember(String, String) */ @NotNull protected PyMemberInfo<PyElement> findMemberInfo(@NotNull final String clazzName, @NotNull final String memberName) { final PyClass clazz = findClass(clazzName); return MembersManager.findMember(clazz, findMember(clazzName, memberName)); } /** * @param className class where member should be found * @param memberName member that starts with dot ({@code .}) is treated as method. * member that starts with dash ({@code #}) is treated as attribute. * It is treated parent class otherwise * @return member or null if not found */ @NotNull protected PyElement findMember(@NotNull final String className, @NotNull String memberName) { final PyElement result; //TODO: Get rid of this chain of copy pastes if (memberName.contains(".")) { result = findMethod(className, memberName.substring(1)); } else if (memberName.contains(" result = findField(className, memberName.substring(1)); } else { result = findClass(memberName); } Assert.assertNotNull(String.format("No member %s found in class %s", memberName, className), result); return result; } private PyElement findField(final String className, final String memberName) { final PyClass aClass = findClass(className); final PyTargetExpression attribute = aClass.findClassAttribute(memberName, false, null); if (attribute != null) { return attribute; } return aClass.<API key>(memberName, false); } private PyFunction findMethod(final String className, final String name) { final PyClass clazz = findClass(className); return clazz.findMethodByName(name, false, null); } protected PyClass findClass(final String name) { final Project project = myFixture.getProject(); final Collection<PyClass> classes = PyClassNameIndex.find(name, project, false); Assert.assertThat(String.format("Expected one class named %s", name), classes, Matchers.hasSize(1)); return classes.iterator().next(); } protected void moveViaProcessor(@NotNull Project project, @NotNull final <API key> processor) { CommandProcessor.getInstance().executeCommand(project, () -> ApplicationManager.getApplication().runWriteAction(processor), null, null); } /** * Adds several files to project from folder {@link #myRefactoringName} with extension <pre>py</pre>. * Call it <strong>before</strong> refactoring. * After refactoring use {@link #checkMultiFile(String...)} to make sure refactoring is ok. * * @param <API key> file (module) names to add with out of extensions * @see #checkMultiFile(String...) */ protected void configureMultiFile(@NotNull final String... <API key>) { final String baseName = <API key>() + "/"; for (final String fileNameNoExtension : <API key>) { final String fileNameBefore = String.format("%s.py", fileNameNoExtension); myFixture.copyFileToProject(baseName + fileNameBefore, fileNameBefore); } } /** * Checks files <strong>after</strong> refactoring. See {@link #configureMultiFile(String...)} for more info. * * @param <API key> file names to check with out of extension * @see #configureMultiFile(String...) */ protected void checkMultiFile(@NotNull final String... <API key>) { for (final String fileNameNoExtension : <API key>) { final String fileNameAfter = String.format("%s.after.py", fileNameNoExtension); final String fileNameBefore = String.format("%s.py", fileNameNoExtension); myFixture.checkResultByFile(fileNameBefore, "/" + <API key>() + "/" + fileNameAfter, true); } } /** * @return folder name with {@link #myRefactoringName} and test name added */ @NotNull protected String <API key>() { return "refactoring/" + myRefactoringName + "/" + getTestName(true); } }
package com.mikepenz.materialdrawer.app; import android.graphics.Color; import android.os.Build; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.support.v7.view.ActionMode; import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; import android.view.View; import com.mikepenz.<API key>.FontAwesome; import com.mikepenz.<API key>.GoogleMaterial; import com.mikepenz.iconics.IconicsDrawable; import com.mikepenz.materialdrawer.AccountHeader; import com.mikepenz.materialdrawer.<API key>; import com.mikepenz.materialdrawer.Drawer; import com.mikepenz.materialdrawer.DrawerBuilder; import com.mikepenz.materialdrawer.model.PrimaryDrawerItem; import com.mikepenz.materialdrawer.model.ProfileDrawerItem; import com.mikepenz.materialdrawer.model.<API key>; import com.mikepenz.materialdrawer.model.SecondaryDrawerItem; import com.mikepenz.materialdrawer.model.SectionDrawerItem; import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem; import com.mikepenz.materialdrawer.model.interfaces.IProfile; import com.mikepenz.materialdrawer.model.interfaces.Nameable; import com.mikepenz.materialize.util.UIUtils; public class <API key> extends AppCompatActivity { private static final int PROFILE_SETTING = 1; //save our header or result private AccountHeader headerResult = null; private Drawer result = null; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_sample); // Handle Toolbar final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setTitle(R.string.<API key>); // Create a few sample profile final IProfile profile = new ProfileDrawerItem().withName("Mike Penz").withEmail("mikepenz@gmail.com").withIcon(R.drawable.profile); final IProfile profile2 = new ProfileDrawerItem().withName("Max Muster").withEmail("max.mustermann@gmail.com").withIcon(R.drawable.profile2); final IProfile profile3 = new ProfileDrawerItem().withName("Felix House").withEmail("felix.house@gmail.com").withIcon(R.drawable.profile3); final IProfile profile4 = new ProfileDrawerItem().withName("Mr. X").withEmail("mister.x.super@gmail.com").withIcon(R.drawable.profile4); final IProfile profile5 = new ProfileDrawerItem().withName("Batman").withEmail("batman@gmail.com").withIcon(R.drawable.profile5); // Create the AccountHeader headerResult = new <API key>() .withActivity(this) .withCompactStyle(true) .<API key>(R.drawable.header) .addProfiles( profile, profile2, profile3, profile4, profile5, //don't ask but google uses 14dp for the add account icon in gmail but 20dp for the normal icons (like manage account) new <API key>().withName("Add Account").withDescription("Add new GitHub Account").withIcon(new IconicsDrawable(this, GoogleMaterial.Icon.gmd_plus).actionBar().paddingDp(5).colorRes(R.color.<API key>)).withIdentifier(PROFILE_SETTING), new <API key>().withName("Manage Account").withIcon(GoogleMaterial.Icon.gmd_settings) ) .withSavedInstance(savedInstanceState) .build(); //Create the drawer result = new DrawerBuilder() .withActivity(this) .withAccountHeader(headerResult) //set the AccountHeader we created earlier for the header .addDrawerItems( new PrimaryDrawerItem().withName(R.string.drawer_item_home).withIcon(FontAwesome.Icon.faw_home).withIdentifier(1), new PrimaryDrawerItem().withName(R.string.<API key>).withIcon(FontAwesome.Icon.faw_gamepad), new PrimaryDrawerItem().withName(R.string.drawer_item_custom).withIcon(FontAwesome.Icon.faw_eye).withIdentifier(5), new SectionDrawerItem().withName(R.string.<API key>), new SecondaryDrawerItem().withName(R.string.<API key>).withIcon(FontAwesome.Icon.faw_cog), new SecondaryDrawerItem().withName(R.string.drawer_item_help).withIcon(FontAwesome.Icon.faw_question).withEnabled(false), new SecondaryDrawerItem().withName(R.string.<API key>).withIcon(FontAwesome.Icon.faw_github), new SecondaryDrawerItem().withName(R.string.drawer_item_contact).withIcon(FontAwesome.Icon.faw_bullhorn) ) .<API key>(new Drawer.<API key>() { @Override public boolean onItemClick(View view, int position, IDrawerItem drawerItem) { if (drawerItem != null && drawerItem.getIdentifier() == 1) { <API key>(new ActionBarCallBack()); findViewById(R.id.action_mode_bar).setBackgroundColor(UIUtils.<API key>(<API key>.this, R.attr.colorPrimary, R.color.<API key>)); } if (drawerItem instanceof Nameable) { toolbar.setTitle(((Nameable) drawerItem).getName().getText(<API key>.this)); } return false; } }) .withSavedInstance(savedInstanceState) .build(); // set the selection to the item with the identifier 5 if (savedInstanceState == null) { result.setSelection(5, false); } //set the back arrow in the toolbar getSupportActionBar().<API key>(true); getSupportActionBar().<API key>(false); } @Override protected void onSaveInstanceState(Bundle outState) { //add the values which need to be saved from the drawer to the bundle outState = result.saveInstanceState(outState); //add the values which need to be saved from the accountHeader to the bundle outState = headerResult.saveInstanceState(outState); super.onSaveInstanceState(outState); } @Override public boolean <API key>(MenuItem item) { //handle the click on the back arrow click switch (item.getItemId()) { case android.R.id.home: onBackPressed(); return true; default: return super.<API key>(item); } } @Override public void onBackPressed() { //handle the back press :D close the drawer first and if the drawer is closed close the activity if (result != null && result.isDrawerOpen()) { result.closeDrawer(); } else { super.onBackPressed(); } } class ActionBarCallBack implements ActionMode.Callback { @Override public boolean onActionItemClicked(ActionMode mode, MenuItem item) { return false; } @Override public boolean onCreateActionMode(ActionMode mode, Menu menu) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { getWindow().setStatusBarColor(UIUtils.<API key>(<API key>.this, R.attr.colorPrimaryDark, R.color.<API key>)); } mode.getMenuInflater().inflate(R.menu.cab, menu); return true; } @Override public void onDestroyActionMode(ActionMode mode) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { getWindow().setStatusBarColor(Color.TRANSPARENT); } } @Override public boolean onPrepareActionMode(ActionMode mode, Menu menu) { return false; } } }
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2014.09.30 at 06:15:10 PM PDT package org.w3._1999.xhtml; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlType; @XmlType(name = "Shape") @XmlEnum public enum Shape { @XmlEnumValue("rect") RECT("rect"), @XmlEnumValue("circle") CIRCLE("circle"), @XmlEnumValue("poly") POLY("poly"), @XmlEnumValue("default") DEFAULT("default"); private final String value; Shape(String v) { value = v; } public String value() { return value; } public static Shape fromValue(String v) { for (Shape c: Shape.values()) { if (c.value.equals(v)) { return c; } } throw new <API key>(v); } }
.<API key> { background : <API key>; } span.<API key>.smart-folder{ font-style: italic; } /* Project organizer icons */ span.<API key> { display: inline-block; width: 16px; height: 16px; vertical-align: middle; background-image: url('/static/img/hgrid/folder.png'); background-repeat: no-repeat; } span.<API key> { display: inline-block; width: 16px; height: 16px; vertical-align: middle; background-image: url('/static/img/hgrid/smart-folder.png'); background-repeat: no-repeat; } span.<API key> { display: inline-block; width: 16px; height: 16px; vertical-align: middle; background-image: url('/static/img/hgrid/project.png'); background-repeat: no-repeat; } span.<API key>:hover { display: inline-block; width: 16px; height: 16px; vertical-align: middle; background-image: url('/static/img/hgrid/project-hover.png'); background-repeat: no-repeat; } span.<API key> { display: inline-block; width: 16px; height: 16px; vertical-align: middle; background-image: url('/static/img/hgrid/component.png'); background-repeat: no-repeat; } span.<API key>:hover { display: inline-block; width: 16px; height: 16px; vertical-align: middle; background-image: url('/static/img/hgrid/component-hover.png'); background-repeat: no-repeat; } span.<API key> { display: inline-block; width: 16px; height: 16px; vertical-align: middle; background-image: url('/static/img/hgrid/pointer.png'); background-repeat: no-repeat; } span.<API key> { display: inline-block; width: 16px; height: 16px; vertical-align: middle; background-image: url('/static/img/hgrid/reg-pointer.png'); background-repeat: no-repeat; } span.<API key>:hover { background-image: url('/static/img/hgrid/pointer-hover.png'); background-repeat: no-repeat; } span.<API key>:hover { display: inline-block; width: 16px; height: 16px; vertical-align: middle; background-image: url('/static/img/hgrid/pointer-hover.png'); background-repeat: no-repeat; } span.<API key> { display: inline-block; width: 16px; height: 16px; vertical-align: middle; background-image: url('/static/img/hgrid/reg-project.png'); background-repeat: no-repeat; } span.<API key>:hover { display: inline-block; width: 16px; height: 16px; vertical-align: middle; background-image: url('/static/img/hgrid/reg-project-hover.png'); background-repeat: no-repeat; } span.<API key> { display: inline-block; width: 16px; height: 16px; vertical-align: middle; background-image: url('/static/img/hgrid/reg-component.png'); background-repeat: no-repeat; } span.<API key>:hover { display: inline-block; width: 16px; height: 16px; vertical-align: middle; background-image: url('/static/img/hgrid/reg-component-hover.png'); background-repeat: no-repeat; } button.<API key> { width: 20px; height: 20px; background-image: url('/static/img/hgrid/info.png'); background-repeat: no-repeat; } button.<API key> { width: 20px; height: 20px; background-image: url('/static/img/hgrid/visit.png'); background-repeat: no-repeat; } button.hg-btn { background-color: transparent; border: 0px; } /* Preventing folders that are HGrid leaves from showing underlines when hovered over */ .project-folder:hover { text-decoration: none !important; } span.project-folder { text-decoration: none; } .hg-item-name:hover { text-decoration: none !important; cursor: default; } /* Controls above the HGrid */ div.project-grid-menu { text-align: right; margin-top: -20px; } div.project-grid-menu span.pg-expand-all { color: #468cc8; text-decoration: underline; cursor: pointer; margin-right: 10px; } div.project-grid-menu span.pg-collapse-all { color: #468cc8; text-decoration: underline; cursor: pointer; margin-right: 7px; } .page-header .btn { margin-right: 5px; } /* Project details box */ span.project-details { visibility: hidden; } span.add-link-warning { color: #808080; } div.<API key> { display: none; } span.rename-container{ display: none; } div.project-details span.title { display: inline; overflow-x: hidden; font-size: 15px; overflow-x: hidden; } .<API key> img { margin-right: 4px; cursor:pointer;cursor:hand } div.project-details { display: inline-block; width: 100%; background-color: #EEE; padding: 7px; margin-bottom: 10px; } div.contributors { overflow-x: hidden; } .<API key> { z-index: 11; } div.<API key> { display: block; position: relative; bottom: 0; width: 100%; text-align: right; } .<API key> .organizeBtn.btn.btn-default { display: block; margin-right: 10px; float: left; margin-bottom: 10px; } /* Typeahead autocomplete box */ .<API key> span.<TwitterConsumerkey> { width: 100%; } /* Typeahead scaffolding */ .tt-dropdown-menu, .gist { text-align: left; overflow-x: hidden; } /* Typeahead base styles */ .typeahead, .tt-query { width: 100%; height: 30px; font-size: 16px; border: 1px solid rgb(204, 204, 204); -<API key>: 4px; -moz-border-radius: 4px; border-radius: 4px; outline: none; } input.typeahead.tt-input { height: 32px ; } .typeahead { background-color: #fff; } .tt-query { -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); } /* rgb of glow 106 176 232 */ .tt-input, .typeahead { padding: 4px 10px; } .tt-hint { color: #999; padding: 0px 12px 3px 8px } h3.category { font-size: 18px; margin-top: 4px; margin-left: 5px; } .tt-dropdown-menu { width: 422px; padding: 8px 0; background-color: #fff; border: 1px solid #ccc; border: 1px solid rgba(0, 0, 0, 0.2); -<API key>: 5px; -moz-border-radius: 5px; border-radius: 5px; -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, .2); -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, .2); box-shadow: 0 5px 10px rgba(0, 0, 0, .2); margin-top: 6px; } .tt-suggestion { padding: 3px 5px; font-size: 12px; line-height: 14px; } .tt-suggestion.tt-cursor { color: #fff; background-color: #0097cf; } /*.tt-suggestion p { margin: 0; }*/ .gist { font-size: 14px; } .tb-row { font-size: 13px; line-height: 30px; } .po-hover { background : #E0EBF3; } .tb-td { height: inherit; padding-top: 4px; } /* Project Toolbar New Additions and Changes */ .po-placeholder { line-height: 30px; } #project-grid { margin-bottom: 5px; } .organizer-legend { font-size: 13px; padding-left: 4px; } .organizer-legend img { vertical-align: bottom; margin-right: 4px; } .tb-h-success { background: #B8ECC0; } .po-icon-registered { color: #D4D4D4; } .po-icon { color: #5E5E5E; } .fangorn-selected .po-icon-registered { color: #CCCCCC; } .fangorn-selected .po-icon { color: #FFFFFF; } .po-modal { width: auto; } .smaller { font-size: 75%; } .<API key> { cursor: default; }
package utils import ( log "github.com/sirupsen/logrus" gofig "github.com/akutz/gofig/types" "github.com/rexray/rexray/libstorage/api/types" ) // LoggingConfig is the logging configuration. type LoggingConfig struct { // Level is the log level. Level log.Level // Stdout is the path to the file to which to log stdout. Stdout string // Stderr is the path to the file to which to log stderr. Stderr string // HTTPRequests is a flag indicating whether or not to log HTTP requests. HTTPRequests bool // HTTPResponses is a flag indicating whether or not to log HTTP responses. HTTPResponses bool } // ParseLoggingConfig returns a new LoggingConfig instance. func ParseLoggingConfig( config gofig.Config, fields log.Fields, roots ...string) (*LoggingConfig, error) { f := func(k string, v interface{}) { if fields == nil { return } fields[k] = v } logConfig := &LoggingConfig{ Level: log.WarnLevel, } if lvl, err := log.ParseLevel( getString(config, types.ConfigLogLevel, roots...)); err == nil { logConfig.Level = lvl f(types.ConfigLogLevel, lvl) } stdOutPath := getString(config, types.ConfigLogStdout, roots...) if stdOutPath != "" { logConfig.Stdout = stdOutPath f(types.ConfigLogStdout, stdOutPath) } stdErrPath := getString(config, types.ConfigLogStderr, roots...) if stdErrPath != "" { logConfig.Stderr = stdErrPath f(types.ConfigLogStderr, stdErrPath) } if isSet(config, types.<API key>, roots...) { logConfig.HTTPRequests = getBool( config, types.<API key>, roots...) f(types.<API key>, logConfig.HTTPRequests) } if isSet(config, types.<API key>, roots...) { logConfig.HTTPResponses = getBool( config, types.<API key>, roots...) f(types.<API key>, logConfig.HTTPResponses) } return logConfig, nil }
define( ({ commonMedia: { mediaSelector: { lblSelect1: "", lblSelect2: "", lblMap: "", lblImage: "", lblVideo: "", lblExternal: "Web ", disabled: "", url: " web ", userLookup: "", notImplemented: "", noData: "" }, imageSelector: { lblStep1: "", lblStep2: "", lblStep3: "" }, imageSelectorHome: { explain: "<br /> URL " }, imageSelectorFlickr: { userInputLbl: "", signInMsg2: "", loadingFailed: "" }, <API key>: { leftHeader: "Facebook ", rightHeader: "Facebook ", pageExplain: "Facebook / <b>esrigis</b> URL '/' ", pageInputLbl: "", lookupMsgError: "" }, imageSelectorPicasa: { userInputLbl: " Picasa/Google+ ID", signInMsg2: "", howToFind: " Picasa Google+ ID", howToFind2: " Picasa G+ '/' " }, videoSelectorCommon: { check: "", notFound: "", found: "", select: "" }, videoSelectorHome: { other: "" }, <API key>: { url: "Youtube URL", pageInputLbl: "", lookupMsgError: "", howToFind: " YouTube ", howToFind2: "", found: "", noData: "", videoNotChecked: " YouTube ", checkFailedAPI: "YouTube YouTube API " }, videoSelectorVimeo: { url: "Vimeo URL" }, videoSelectorOther: { explain1: "( avimpeg)( YouTube Vimeo)", explain2: " %WEBPAGE%", explain3: "( %EXAMPLE%) HTML %WEBPAGE%", webpage: "" }, webpageSelectorHome: { lblUrl: " URL", lblEmbed: "", lblOR: "OR", lblError1: "", lblError2: " %IFRAMETAG%", configure: "" }, mediaConfigure: { lblURL: "URL", lblURLPH: " URL http:// .jpg .png ", lblURLError: "(URL .jpg .png )", lblURLCheck: "...", lblLabel: "", lblLabel1: "", lblLabel2: "", lblLabel3: "", lblLabelPH: "...", lblMaximize: "", lblMaximizeHelp: "", lblPosition: "", lblPosition1: "", lblPosition2: "", lblPosition3: "", lblPosition4: "", lblPosition5: "", tooltipDimension: " 'px' '%' ", tooltipDimension2: " 'px'", lblPosition2Explain: "", lblPosition3Explain: "", <API key>: "()", lblPosition4Explain: "", unloadLbl: "", unloadHelp: "<br />" }, editorActionGeocode: { lblTitle: "", mapMarkerExplain: "" }, editorActionMedia: { lblTitle: "" }, editorInlineMedia: { lblTitle: "" } } }) );
<!DOCTYPE HTML PUBLIC "- <!--NewPage <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_31) on Thu Jan 31 02:05:01 UTC 2013 --> <TITLE> Uses of Class org.apache.hadoop.examples.RandomWriter (Hadoop 1.1.2 API) </TITLE> <META NAME="date" CONTENT="2013-01-31"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.apache.hadoop.examples.RandomWriter (Hadoop 1.1.2 API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <A NAME="navbar_top"></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../org/apache/hadoop/examples/RandomWriter.html" title="class in org.apache.hadoop.examples"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/apache/hadoop/examples//<API key>.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="RandomWriter.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <! if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <HR> <CENTER> <H2> <B>Uses of Class<br>org.apache.hadoop.examples.RandomWriter</B></H2> </CENTER> No usage of org.apache.hadoop.examples.RandomWriter <P> <HR> <A NAME="navbar_bottom"></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="<API key>"></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../org/apache/hadoop/examples/RandomWriter.html" title="class in org.apache.hadoop.examples"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/apache/hadoop/examples//<API key>.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="RandomWriter.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <! if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <HR> Copyright &copy; 2009 The Apache Software Foundation </BODY> </HTML>
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc --> <title>FileDetector</title> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../script.js"></script> </head> <body> <script type="text/javascript"><! try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="FileDetector"; } } catch(err) { } var methods = {"i0":6}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <div class="topNav"><a name="navbar.top"> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/openqa/selenium/remote/ExecuteMethod.html" title="interface in org.openqa.selenium.remote"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../org/openqa/selenium/remote/HttpCommandExecutor.html" title="class in org.openqa.selenium.remote"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/openqa/selenium/remote/FileDetector.html" target="_top">Frames</a></li> <li><a href="FileDetector.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> </a></div> <div class="header"> <div class="subTitle">org.openqa.selenium.remote</div> <h2 title="Interface FileDetector" class="title">Interface FileDetector</h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Known Implementing Classes:</dt> <dd><a href="../../../../org/openqa/selenium/remote/LocalFileDetector.html" title="class in org.openqa.selenium.remote">LocalFileDetector</a>, <a href="../../../../org/openqa/selenium/remote/UselessFileDetector.html" title="class in org.openqa.selenium.remote">UselessFileDetector</a></dd> </dl> <hr> <br> <pre>public interface <span class="typeNameLabel">FileDetector</span></pre> <div class="block">Used for identifying whether a sequence of chars represents the path to a file.</div> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="method.summary"> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code>java.io.File</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/openqa/selenium/remote/FileDetector.html#getLocalFile-java.lang.CharSequence...-">getLocalFile</a></span>(java.lang.CharSequence...&nbsp;keys)</code>&nbsp;</td> </tr> </table> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="method.detail"> </a> <h3>Method Detail</h3> <a name="getLocalFile-java.lang.CharSequence...-"> </a> <ul class="blockListLast"> <li class="blockList"> <h4>getLocalFile</h4> <pre>java.io.File&nbsp;getLocalFile(java.lang.CharSequence...&nbsp;keys)</pre> </li> </ul> </li> </ul> </li> </ul> </div> </div> <div class="bottomNav"><a name="navbar.bottom"> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/openqa/selenium/remote/ExecuteMethod.html" title="interface in org.openqa.selenium.remote"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../org/openqa/selenium/remote/HttpCommandExecutor.html" title="class in org.openqa.selenium.remote"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/openqa/selenium/remote/FileDetector.html" target="_top">Frames</a></li> <li><a href="FileDetector.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> </a></div> </body> </html>
#include <iostream> #include <string> #include <fstream> #include <gtest/gtest.h> using namespace std; #include "../headers.h" static const std::string PATH_PREFIX("src/test/"); void diffTest(const std::string& outputStr){ std::string validOutputStr(outputStr + ".valid"); std::ifstream validFile(validOutputStr.c_str()); // If there is no valid file then generate one. if(!validFile.good()){ std::ifstream newOutputFile(outputStr.c_str()); std::stringbuf sbuf; newOutputFile >> &sbuf; std::ofstream newValidFile(validOutputStr.c_str()); newValidFile << sbuf.str(); } else { // Verify output against the valid file. std::stringbuf newStrBuf, validStrBuf; std::ifstream fNew(outputStr.c_str()), fValid(validOutputStr.c_str()); fNew >> &newStrBuf; fValid >> &validStrBuf; ASSERT_EQ(newStrBuf.str() == validStrBuf.str(), true); } } void runARAPlannerTest(const std::string& problem){ try { double allocated_time_secs = 0.5; // in seconds MDPConfig MDPCfg; EnvironmentNAV2D environment_nav2D; std::string problemStr = PATH_PREFIX + problem; ASSERT_EQ(environment_nav2D.InitializeEnv(problemStr.c_str()), true); ASSERT_EQ(environment_nav2D.InitializeMDPCfg(&MDPCfg), true); // plan a path vector<int> solution_stateIDs_V; ARAPlanner ara_planner(&environment_nav2D, false); ASSERT_EQ(ara_planner.set_start(MDPCfg.startstateid), true); ASSERT_EQ(ara_planner.set_goal(MDPCfg.goalstateid), true); ASSERT_EQ(ara_planner.replan(allocated_time_secs, &solution_stateIDs_V), true); // output the path std::string outputStr = problemStr + ".out"; FILE* fSol = SBPL_FOPEN(outputStr.c_str(), "w"); for(unsigned int i = 0; i < solution_stateIDs_V.size(); i++) { environment_nav2D.PrintState(solution_stateIDs_V[i], true, fSol); } SBPL_FCLOSE(fSol); // Now apply the file diff test diffTest(outputStr); } catch(...) { FAIL() << "Uncaught exception : " << "This is OK on OS X"; } } TEST(araplanner, env1) { runARAPlannerTest("env1.cfg"); } int main(int argc, char *argv[]) { testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }
<html><body> <style> body, h1, h2, h3, div, span, p, pre, a { margin: 0; padding: 0; border: 0; font-weight: inherit; font-style: inherit; font-size: 100%; font-family: inherit; vertical-align: baseline; } body { font-size: 13px; padding: 1em; } h1 { font-size: 26px; margin-bottom: 1em; } h2 { font-size: 24px; margin-bottom: 1em; } h3 { font-size: 20px; margin-bottom: 1em; margin-top: 1em; } pre, code { line-height: 1.5; font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; } pre { margin-top: 0.5em; } h1, h2, h3, p { font-family: Arial, sans serif; } h1, h2, h3 { border-bottom: solid #CCC 1px; } .toc_element { margin-top: 0.5em; } .firstline { margin-left: 2 em; } .method { margin-top: 1em; border: solid 1px #CCC; padding: 1em; background: #EEE; } .details { font-weight: bold; font-size: 14px; } </style> <h1><a href="apikeys_v2.html">API Keys API</a></h1> <h2>Instance Methods</h2> <p class="toc_element"> <code><a href="apikeys_v2.keys.html">keys()</a></code> </p> <p class="firstline">Returns the keys Resource.</p> <p class="toc_element"> <code><a href="apikeys_v2.operations.html">operations()</a></code> </p> <p class="firstline">Returns the operations Resource.</p> <p class="toc_element"> <code><a href="apikeys_v2.projects.html">projects()</a></code> </p> <p class="firstline">Returns the projects Resource.</p> <p class="toc_element"> <code><a href="#close">close()</a></code></p> <p class="firstline">Close httplib2 connections.</p> <p class="toc_element"> <code><a href="#<API key>"><API key>()</a></code></p> <p class="firstline">Create a BatchHttpRequest object based on the discovery document.</p> <h3>Method Details</h3> <div class="method"> <code class="details" id="close">close()</code> <pre>Close httplib2 connections.</pre> </div> <div class="method"> <code class="details" id="<API key>"><API key>()</code> <pre>Create a BatchHttpRequest object based on the discovery document. Args: callback: callable, A callback to be called for each response, of the form callback(id, response, exception). The first parameter is the request id, and the second is the deserialized response object. The third is an apiclient.errors.HttpError exception object if an HTTP error occurred while processing the request, or None if no error occurred. Returns: A BatchHttpRequest object based on the discovery document. </pre> </div> </body></html>
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; } .thumbnails { z-index: 1; position: absolute; bottom: 0; left: 0; top: 0; width: 400px; box-shadow: inset -3px 0 3px -2px rgba(0,0,0,0.4); background: #fff; } .main { position: absolute; bottom: 0; left: 400px; right: 0; top: 0; background: #f2f2f2; border-left: 1px solid #eee; } .presentation { width: 100%; height: 100%; } .presentation .crocodoc-viewport { overflow: visible; } .controls-container { position: absolute; bottom: 10px; width: 0; left: 50%; overflow: visible; height: 26px; z-index: 1; } .controls-wrapper { position: absolute; } .controls { background: black; background: rgba(0,0,0,0.7); color: white; font-family: Calibri,Arial,sans-serif; font-size: 12px; white-space: nowrap; border-radius: 4px; margin-left: -50%; width: 100%; } .crocodoc-page-inner { box-shadow: 1px 1px 3px rgba(0,0,0,0.6); } .<API key>.<API key> .crocodoc-page-inner { background: #fff url('../../src/images/spinner.gif') center center no-repeat; } .thumbnails .crocodoc-page { padding: 40px; } .thumbnails .crocodoc-page .crocodoc-page-svg { opacity: 0.8; } .thumbnails .current-thumbnail .crocodoc-page-svg { opacity: 1; } .thumbnails .crocodoc-page-inner { box-shadow: 0 0 2px rgba(0,0,0,0.6); } .thumbnails .crocodoc-page:hover .crocodoc-page-inner { box-shadow: 0 0 4px 2px rgb(60, 130, 200); } .thumbnails .current-thumbnail .crocodoc-page-inner { box-shadow: 0 0 4px 2px rgb(253, 165, 20) !important; } .thumbnails .crocodoc-page-inner .thumbnail-controls { position: absolute; bottom: 0; left: 0; width: 100%; height: 10%; } /* align the thumbnail pages to the left instead of center */ .thumbnails .crocodoc-pages { text-align: left; } .thumbnails .<API key> { display: none; } .presentation .crocodoc-page { -webkit-transition: opacity 0.2s, -webkit-transform 0.4s; -moz-transition: opacity 0.2s, -moz-transform 0.4s; transition: opacity 0.2s, transform 0.4s; visibility: visible; } .presentation .<API key> { -webkit-transform: none; -moz-transform: none; -ms-transform: none; transform: none; -<API key>: 0s, 0s; -<API key>: 0s, 0s; transition-delay: 0s, 0s; opacity: 1; } .presentation .<API key> { -webkit-transform: translateX(-100%); -moz-transform: translateX(-100%); -ms-transform: translateX(-100%); transform: translateX(-100%); -<API key>: 0.2s, 0s; -<API key>: 0.2s, 0s; transition-delay: 0.2s, 0s; opacity: 0; } .presentation .crocodoc-page-after { -webkit-transform: translateX(100%); -moz-transform: translateX(100%); -ms-transform: translateX(100%); transform: translateX(100%); -<API key>: 0.2s, 0s; -<API key>: 0.2s, 0s; transition-delay: 0.2s, 0s; opacity: 0; }
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <title>Uses of Class org.deidentifier.arx.metric.MetricNMPrecision (ARX GUI Documentation)</title> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><! if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.deidentifier.arx.metric.MetricNMPrecision (ARX GUI Documentation)"; } </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <div class="topNav"><a name="navbar_top"> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../org/deidentifier/arx/metric/MetricNMPrecision.html" title="class in org.deidentifier.arx.metric">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/deidentifier/arx/metric/class-use/MetricNMPrecision.html" target="_top">Frames</a></li> <li><a href="MetricNMPrecision.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip-navbar_top"> </a></div> <div class="header"> <h2 title="Uses of Class org.deidentifier.arx.metric.MetricNMPrecision" class="title">Uses of Class<br>org.deidentifier.arx.metric.MetricNMPrecision</h2> </div> <div class="classUseContainer">No usage of org.deidentifier.arx.metric.MetricNMPrecision</div> <div class="bottomNav"><a name="navbar_bottom"> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="<API key>"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../org/deidentifier/arx/metric/MetricNMPrecision.html" title="class in org.deidentifier.arx.metric">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/deidentifier/arx/metric/class-use/MetricNMPrecision.html" target="_top">Frames</a></li> <li><a href="MetricNMPrecision.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip-navbar_bottom"> </a></div> </body> </html>
package com.github.devnied.emvnfccard.adapter; import java.util.List; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import com.github.devnied.emvnfccard.fragment.viewPager.IFragment; /** * View Pager Adapter * * @author julien * */ public class ViewPagerAdapter extends <API key> { /** * List fragments */ private final List<IFragment> mFragments; /** * * @param fm * @param pFragments */ public ViewPagerAdapter(final FragmentManager fm, final List<IFragment> pFragments) { super(fm); mFragments = pFragments; } @Override public Fragment getItem(final int position) { int val = 0; for (IFragment f : mFragments) { if (f.isEnable() && val++ == position) { return (Fragment) f; } } return null; } @Override public int getCount() { int ret = 0; if (mFragments != null) { for (IFragment f : mFragments) { if (f.isEnable()) { ret++; } } } return ret; } public int <API key>(final int pPosition) { int ret = 0; int activePosition = 0; for (IFragment f : mFragments) { if (f.isEnable() && activePosition++ == pPosition) { break; } ret++; } return ret; } @Override public CharSequence getPageTitle(final int position) { String ret = null; IFragment f = (IFragment) getItem(position); if (f != null) { ret = f.getTitle(); } return ret; } @Override public int getItemPosition(final Object object) { int position = 0; for (IFragment f : mFragments) { if (f == object) { if (!f.isEnable()) { position = POSITION_NONE; } break; } else if (f.isEnable()) { position++; } } return position; } @Override public long getItemId(final int position) { return mFragments.indexOf(getItem(position)); } }
/** * @file * Base TCP API definitions shared by TCP and ALTCP\n * See also @ref tcp_raw */ #ifndef LWIP_HDR_TCPBASE_H #define LWIP_HDR_TCPBASE_H #include "lwip/opt.h" #if LWIP_TCP /* don't build if not configured for use in lwipopts.h */ #ifdef __cplusplus extern "C" { #endif #if LWIP_WND_SCALE typedef u32_t tcpwnd_size_t; #else typedef u16_t tcpwnd_size_t; #endif enum tcp_state { CLOSED = 0, LISTEN = 1, SYN_SENT = 2, SYN_RCVD = 3, ESTABLISHED = 4, FIN_WAIT_1 = 5, FIN_WAIT_2 = 6, CLOSE_WAIT = 7, CLOSING = 8, LAST_ACK = 9, TIME_WAIT = 10 }; /* ATTENTION: this depends on state number ordering! */ #define <API key>(state) ((state) >= FIN_WAIT_1) /* Flags for "apiflags" parameter in tcp_write */ #define TCP_WRITE_FLAG_COPY 0x01 #define TCP_WRITE_FLAG_MORE 0x02 #define TCP_PRIO_MIN 1 #define TCP_PRIO_NORMAL 64 #define TCP_PRIO_MAX 127 const char* tcp_debug_state_str(enum tcp_state s); #ifdef __cplusplus } #endif #endif /* LWIP_TCP */ #endif /* LWIP_HDR_TCPBASE_H */
return (getrtmm$$(this.meta).pa&1) > 0;