code
stringlengths
3
1.05M
repo_name
stringlengths
4
116
path
stringlengths
3
942
language
stringclasses
30 values
license
stringclasses
15 values
size
int32
3
1.05M
# Exoacantha cryptantha Rech.f. SPECIES #### Status ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Apiales/Apiaceae/Exoacantha/Exoacantha cryptantha/README.md
Markdown
apache-2.0
187
# Phyllachora concinna Syd., 1938 SPECIES #### Status ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in Annls mycol. 36(2/3): 160 (1938) #### Original name Phyllachora concinna Syd., 1938 ### Remarks null
mdoering/backbone
life/Fungi/Ascomycota/Sordariomycetes/Phyllachorales/Phyllachoraceae/Phyllachora/Phyllachora concinna/README.md
Markdown
apache-2.0
244
# Rhaphiodendron Moebius, 1876 GENUS #### Status ACCEPTED #### According to Interim Register of Marine and Nonmarine Genera #### Published in Beil. Tegebl. , 49. #### Original name null ### Remarks null
mdoering/backbone
life/incertae sedis/Rhaphiodendron/README.md
Markdown
apache-2.0
207
# Gymnosporangium nanwutaianum F.L. Tai & C.C. Cheo, 1937 SPECIES #### Status SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name Gymnosporangium nanwutaianum F.L. Tai & C.C. Cheo, 1937 ### Remarks null
mdoering/backbone
life/Fungi/Basidiomycota/Pucciniomycetes/Pucciniales/Pucciniaceae/Roestelia/Roestelia nanwutaiana/ Syn. Gymnosporangium nanwutaianum/README.md
Markdown
apache-2.0
263
# Biconidinium M.A. Islam, 1983 GENUS #### Status ACCEPTED #### According to Interim Register of Marine and Nonmarine Genera #### Published in Palynology 7: 84. #### Original name null ### Remarks null
mdoering/backbone
life/Protozoa/Dinophyta/Dinophyceae/Gonyaulacales/Goniodomataceae/Biconidinium/README.md
Markdown
apache-2.0
206
# Clavaria megalorrhiza Berk. & Broome SPECIES #### Status ACCEPTED #### According to Index Fungorum #### Published in null #### Original name Clavaria megalorrhiza Berk. & Broome ### Remarks null
mdoering/backbone
life/Fungi/Basidiomycota/Agaricomycetes/Agaricales/Clavariaceae/Clavaria/Clavaria megalorrhiza/README.md
Markdown
apache-2.0
201
# Conostylis serrulata R.Br. SPECIES #### Status ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Liliopsida/Commelinales/Haemodoraceae/Conostylis/Conostylis serrulata/README.md
Markdown
apache-2.0
184
# Erythrotrichia porphyroides N.L. Gardner SPECIES #### Status ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Rhodophyta/Compsopogonophyceae/Erythropeltidales/Erythrotrichiaceae/Erythrotrichia/Erythrotrichia porphyroides/README.md
Markdown
apache-2.0
198
# Magonia martei Kuntze SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Caryophyllales/Polygonaceae/Magonia/Magonia martei/README.md
Markdown
apache-2.0
171
# Flexibacter elegans (ex Lewin, 1969, non Soriano, 1945) Reichenbach, 1989 SPECIES #### Status ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Bacteria/Bacteroidetes/Sphingobacteria/Sphingobacteriales/Flexibacteraceae/Flexibacter/Flexibacter elegans/README.md
Markdown
apache-2.0
231
# Primula calyptrata X.Gong & R.C.Fang SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Ericales/Primulaceae/Primula/Primula calyptrata/README.md
Markdown
apache-2.0
186
/* ------------------------------------------------------------------------- */ // // Copyright (c) 2010 CubeSoft, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // /* ------------------------------------------------------------------------- */ using System.Linq; using System.Windows.Forms; using Cube.Mixin.String; namespace Cube.Forms.Behaviors { /* --------------------------------------------------------------------- */ /// /// OpenFileBehavior /// /// <summary> /// Provides functionality to show a open-file dialog. /// </summary> /// /* --------------------------------------------------------------------- */ public class OpenFileBehavior : MessageBehavior<OpenFileMessage> { /* ----------------------------------------------------------------- */ /// /// OpenFileBehavior /// /// <summary> /// Initializes a new instance of the OpenFileBehavior class /// with the specified presentable object. /// </summary> /// /// <param name="aggregator">Aggregator object.</param> /// /* ----------------------------------------------------------------- */ public OpenFileBehavior(IAggregator aggregator) : base(aggregator, e => { var view = new OpenFileDialog { CheckPathExists = e.CheckPathExists, Multiselect = e.Multiselect, Filter = e.GetFilterText(), FilterIndex = e.GetFilterIndex(), }; if (e.Text.HasValue()) view.Title = e.Text; if (e.Value.Any()) view.FileName = e.Value.First(); if (e.InitialDirectory.HasValue()) view.InitialDirectory = e.InitialDirectory; e.Cancel = view.ShowDialog() != DialogResult.OK; if (!e.Cancel) e.Value = view.FileNames; }) { } } }
cube-soft/Cube.Core
Libraries/Forms/Sources/Behaviors/Messages/OpenFileBehavior.cs
C#
apache-2.0
2,433
package javassist.build; /** * A generic build exception when applying a transformer. * Wraps the real cause of the (probably javassist) root exception. * @author SNI */ @SuppressWarnings("serial") public class JavassistBuildException extends Exception { public JavassistBuildException() { super(); } public JavassistBuildException(String message, Throwable throwable) { super(message, throwable); } public JavassistBuildException(String message) { super(message); } public JavassistBuildException(Throwable throwable) { super(throwable); } }
stephanenicolas/javassist-build-plugin-api
src/main/java/javassist/build/JavassistBuildException.java
Java
apache-2.0
569
package com.hcentive.webservice.soap; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.ws.server.endpoint.annotation.Endpoint; import org.springframework.ws.server.endpoint.annotation.PayloadRoot; import org.springframework.ws.server.endpoint.annotation.RequestPayload; import org.springframework.ws.server.endpoint.annotation.ResponsePayload; import com.hcentive.service.FormResponse; import com.hcentive.webservice.exception.HcentiveSOAPException; import org.apache.log4j.Logger; /** * @author Mebin.Jacob *Endpoint class. */ @Endpoint public final class FormEndpoint { private static final String NAMESPACE_URI = "http://hcentive.com/service"; Logger logger = Logger.getLogger(FormEndpoint.class); @Autowired FormRepository formRepo; @PayloadRoot(namespace = NAMESPACE_URI, localPart = "FormResponse") @ResponsePayload public FormResponse submitForm(@RequestPayload FormResponse request) throws HcentiveSOAPException { // GetCountryResponse response = new GetCountryResponse(); // response.setCountry(countryRepository.findCountry(request.getName())); FormResponse response = null; logger.debug("AAGAYA"); try{ response = new FormResponse(); response.setForm1(formRepo.findForm("1")); //make API call }catch(Exception exception){ throw new HcentiveSOAPException("Something went wrong!!! The exception is --- " + exception); } return response; // return null; } }
mebinjacob/spring-boot-soap
src/main/java/com/hcentive/webservice/soap/FormEndpoint.java
Java
apache-2.0
1,458
/* * Copyright 2015 Luca Capra <[email protected]>. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.createnet.compose.data; /** * * @author Luca Capra <[email protected]> */ public class GeoPointRecord extends Record<String> { public Point point; protected String value; public GeoPointRecord() {} public GeoPointRecord(String point) { this.point = new Point(point); } public GeoPointRecord(double latitude, double longitude) { this.point = new Point(latitude, longitude); } @Override public String getValue() { return point.toString(); } @Override public void setValue(Object value) { this.value = parseValue(value); this.point = new Point(this.value); } @Override public String parseValue(Object raw) { return (String)raw; } @Override public String getType() { return "geo_point"; } public class Point { public double latitude; public double longitude; public Point(double latitude, double longitude) { this.latitude = latitude; this.longitude = longitude; } public Point(String val) { String[] coords = val.split(","); longitude = Double.parseDouble(coords[0].trim()); latitude = Double.parseDouble(coords[1].trim()); } @Override public String toString() { return this.longitude + "," + this.latitude; } } }
muka/compose-java-client
src/main/java/org/createnet/compose/data/GeoPointRecord.java
Java
apache-2.0
2,062
/* * Copyright 2012-present Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain * a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */ package com.facebook.buck.ide.intellij; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; import com.facebook.buck.android.AssumeAndroidPlatform; import com.facebook.buck.testutil.ProcessResult; import com.facebook.buck.testutil.TemporaryPaths; import com.facebook.buck.testutil.integration.ProjectWorkspace; import com.facebook.buck.testutil.integration.TestDataHelper; import com.facebook.buck.util.environment.Platform; import com.facebook.buck.util.xml.XmlDomParser; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import java.io.File; import java.io.IOException; import org.hamcrest.Matchers; import org.junit.Assume; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.w3c.dom.Node; public class ProjectIntegrationTest { @Rule public TemporaryPaths temporaryFolder = new TemporaryPaths(); @Before public void setUp() throws Exception { // These tests consistently fail on Windows due to path separator issues. Assume.assumeFalse(Platform.detect() == Platform.WINDOWS); } @Test public void testAndroidLibraryProject() throws InterruptedException, IOException { runBuckProjectAndVerify("android_library"); } @Test public void testAndroidBinaryProject() throws InterruptedException, IOException { runBuckProjectAndVerify("android_binary"); } @Test public void testVersion2BuckProject() throws InterruptedException, IOException { runBuckProjectAndVerify("project1"); } @Test public void testVersion2BuckProjectWithoutAutogeneratingSources() throws InterruptedException, IOException { runBuckProjectAndVerify("project_without_autogeneration"); } @Test public void testVersion2BuckProjectSlice() throws InterruptedException, IOException { runBuckProjectAndVerify("project_slice", "--without-tests", "modules/dep1:dep1"); } @Test public void testVersion2BuckProjectSourceMerging() throws InterruptedException, IOException { runBuckProjectAndVerify("aggregation"); } @Test public void testBuckProjectWithCustomAndroidSdks() throws InterruptedException, IOException { runBuckProjectAndVerify("project_with_custom_android_sdks"); } @Test public void testBuckProjectWithCustomJavaSdks() throws InterruptedException, IOException { runBuckProjectAndVerify("project_with_custom_java_sdks"); } @Test public void testBuckProjectWithIntellijSdk() throws InterruptedException, IOException { runBuckProjectAndVerify("project_with_intellij_sdk"); } @Test public void testVersion2BuckProjectWithProjectSettings() throws InterruptedException, IOException { runBuckProjectAndVerify("project_with_project_settings"); } @Test public void testVersion2BuckProjectWithScripts() throws InterruptedException, IOException { runBuckProjectAndVerify("project_with_scripts", "//modules/dep1:dep1"); } @Test public void testVersion2BuckProjectWithUnusedLibraries() throws IOException { ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario( this, "project_with_unused_libraries", temporaryFolder); workspace.setUp(); ProcessResult result = workspace.runBuckCommand("project"); result.assertSuccess("buck project should exit cleanly"); assertFalse(workspace.resolve(".idea/libraries/library_libs_jsr305.xml").toFile().exists()); } @Test public void testVersion2BuckProjectWithExcludedResources() throws InterruptedException, IOException { runBuckProjectAndVerify("project_with_excluded_resources"); } @Test public void testVersion2BuckProjectWithAssets() throws InterruptedException, IOException { runBuckProjectAndVerify("project_with_assets"); } @Test public void testVersion2BuckProjectWithLanguageLevel() throws InterruptedException, IOException { runBuckProjectAndVerify("project_with_language_level"); } @Test public void testVersion2BuckProjectWithOutputUrl() throws InterruptedException, IOException { runBuckProjectAndVerify("project_with_output_url"); } @Test public void testVersion2BuckProjectWithJavaResources() throws InterruptedException, IOException { runBuckProjectAndVerify("project_with_java_resources"); } public void testVersion2BuckProjectWithExtraOutputModules() throws InterruptedException, IOException { runBuckProjectAndVerify("project_with_extra_output_modules"); } @Test public void testVersion2BuckProjectWithGeneratedSources() throws InterruptedException, IOException { runBuckProjectAndVerify("project_with_generated_sources"); } @Test public void testBuckProjectWithSubdirGlobResources() throws InterruptedException, IOException { runBuckProjectAndVerify("project_with_subdir_glob_resources"); } @Test public void testRobolectricTestRule() throws InterruptedException, IOException { runBuckProjectAndVerify("robolectric_test"); } @Test public void testAndroidResourcesInDependencies() throws InterruptedException, IOException { runBuckProjectAndVerify("project_with_android_resources"); } @Test public void testPrebuiltJarWithJavadoc() throws InterruptedException, IOException { runBuckProjectAndVerify("project_with_prebuilt_jar"); } @Test public void testZipFile() throws InterruptedException, IOException { runBuckProjectAndVerify("project_with_zipfile"); } @Test public void testAndroidResourcesAndLibraryInTheSameFolder() throws InterruptedException, IOException { runBuckProjectAndVerify("android_resources_in_the_same_folder"); } @Test public void testAndroidResourcesWithPackagesAtTheSameLocation() throws InterruptedException, IOException { runBuckProjectAndVerify("project_with_multiple_resources_with_package_names"); } @Test public void testCxxLibrary() throws InterruptedException, IOException { runBuckProjectAndVerify("project_with_cxx_library"); } @Test public void testAggregatingCxxLibrary() throws InterruptedException, IOException { runBuckProjectAndVerify("aggregation_with_cxx_library"); } @Test public void testSavingGeneratedFilesList() throws InterruptedException, IOException { runBuckProjectAndVerify( "save_generated_files_list", "--file-with-list-of-generated-files", ".idea/generated-files.txt"); } @Test public void testMultipleLibraries() throws InterruptedException, IOException { runBuckProjectAndVerify("project_with_multiple_libraries"); } @Test public void testProjectWithIgnoredTargets() throws InterruptedException, IOException { runBuckProjectAndVerify("project_with_ignored_targets"); } @Test public void testProjectWithCustomPackages() throws InterruptedException, IOException { runBuckProjectAndVerify("aggregation_with_custom_packages"); } @Test public void testAndroidResourceAggregation() throws InterruptedException, IOException { runBuckProjectAndVerify("android_resource_aggregation"); } @Test public void testAndroidResourceAggregationWithLimit() throws InterruptedException, IOException { runBuckProjectAndVerify("android_resource_aggregation_with_limit"); } @Test public void testProjectIncludesTestsByDefault() throws InterruptedException, IOException { runBuckProjectAndVerify("project_with_tests_by_default", "//modules/lib:lib"); } @Test public void testProjectExcludesTestsWhenRequested() throws InterruptedException, IOException { runBuckProjectAndVerify("project_without_tests", "--without-tests", "//modules/lib:lib"); } @Test public void testProjectExcludesDepTestsWhenRequested() throws InterruptedException, IOException { runBuckProjectAndVerify( "project_without_dep_tests", "--without-dependencies-tests", "//modules/lib:lib"); } @Test public void testUpdatingExistingWorkspace() throws InterruptedException, IOException { runBuckProjectAndVerify("update_existing_workspace"); } @Test public void testCreateNewWorkspace() throws InterruptedException, IOException { runBuckProjectAndVerify("create_new_workspace"); } @Test public void testUpdateMalformedWorkspace() throws InterruptedException, IOException { runBuckProjectAndVerify("update_malformed_workspace"); } @Test public void testUpdateWorkspaceWithoutIgnoredNodes() throws InterruptedException, IOException { runBuckProjectAndVerify("update_workspace_without_ignored_nodes"); } @Test public void testUpdateWorkspaceWithoutManagerNode() throws InterruptedException, IOException { runBuckProjectAndVerify("update_workspace_without_manager_node"); } @Test public void testUpdateWorkspaceWithoutProjectNode() throws InterruptedException, IOException { runBuckProjectAndVerify("update_workspace_without_project_node"); } @Test public void testProjectWthPackageBoundaryException() throws InterruptedException, IOException { runBuckProjectAndVerify("project_with_package_boundary_exception", "//project2:lib"); } @Test public void testProjectWithProjectRoot() throws InterruptedException, IOException { runBuckProjectAndVerify( "project_with_project_root", "--intellij-project-root", "project1", "--intellij-include-transitive-dependencies", "--intellij-module-group-name", "", "//project1/lib:lib"); } @Test public void testGeneratingAndroidManifest() throws InterruptedException, IOException { runBuckProjectAndVerify("generate_android_manifest"); } @Test public void testGeneratingAndroidManifestWithMinSdkWithDifferentVersionsFromManifest() throws InterruptedException, IOException { runBuckProjectAndVerify("min_sdk_version_different_from_manifests"); } @Test public void testGeneratingAndroidManifestWithMinSdkFromBinaryManifest() throws InterruptedException, IOException { runBuckProjectAndVerify("min_sdk_version_from_binary_manifest"); } @Test public void testGeneratingAndroidManifestWithMinSdkFromBuckConfig() throws InterruptedException, IOException { runBuckProjectAndVerify("min_sdk_version_from_buck_config"); } @Test public void testGeneratingAndroidManifestWithNoMinSdkConfig() throws InterruptedException, IOException { runBuckProjectAndVerify("min_sdk_version_with_no_config"); } @Test public void testPreprocessScript() throws InterruptedException, IOException { ProcessResult result = runBuckProjectAndVerify("preprocess_script_test"); assertEquals("intellij", result.getStdout().trim()); } @Test public void testScalaProject() throws InterruptedException, IOException { runBuckProjectAndVerify("scala_project"); } @Test public void testIgnoredPathAddedToExcludedFolders() throws InterruptedException, IOException { runBuckProjectAndVerify("ignored_excluded"); } @Test public void testBuckModuleRegenerateSubproject() throws Exception { AssumeAndroidPlatform.assumeSdkIsAvailable(); ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario( this, "incrementalProject", temporaryFolder.newFolder()) .setUp(); final String extraModuleFilePath = "modules/extra/modules_extra.iml"; final File extraModuleFile = workspace.getPath(extraModuleFilePath).toFile(); workspace .runBuckCommand("project", "--intellij-aggregation-mode=none", "//modules/tip:tip") .assertSuccess(); assertFalse(extraModuleFile.exists()); final String modulesBefore = workspace.getFileContents(".idea/modules.xml"); final String fileXPath = String.format( "/project/component/modules/module[contains(@filepath,'%s')]", extraModuleFilePath); assertThat(XmlDomParser.parse(modulesBefore), Matchers.not(Matchers.hasXPath(fileXPath))); // Run regenerate on the new modules workspace .runBuckCommand( "project", "--intellij-aggregation-mode=none", "--update", "//modules/extra:extra") .assertSuccess(); assertTrue(extraModuleFile.exists()); final String modulesAfter = workspace.getFileContents(".idea/modules.xml"); assertThat(XmlDomParser.parse(modulesAfter), Matchers.hasXPath(fileXPath)); workspace.verify(); } @Test public void testBuckModuleRegenerateSubprojectNoOp() throws InterruptedException, IOException { AssumeAndroidPlatform.assumeSdkIsAvailable(); ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario( this, "incrementalProject", temporaryFolder.newFolder()) .setUp(); workspace .runBuckCommand( "project", "--intellij-aggregation-mode=none", "//modules/tip:tip", "//modules/extra:extra") .assertSuccess(); workspace.verify(); // Run regenerate, should be a no-op relative to previous workspace .runBuckCommand( "project", "--intellij-aggregation-mode=none", "--update", "//modules/extra:extra") .assertSuccess(); workspace.verify(); } @Test public void testCrossCellIntelliJProject() throws Exception { AssumeAndroidPlatform.assumeSdkIsAvailable(); ProjectWorkspace primary = TestDataHelper.createProjectWorkspaceForScenario( this, "inter-cell/primary", temporaryFolder.newFolder()); primary.setUp(); ProjectWorkspace secondary = TestDataHelper.createProjectWorkspaceForScenario( this, "inter-cell/secondary", temporaryFolder.newFolder()); secondary.setUp(); TestDataHelper.overrideBuckconfig( primary, ImmutableMap.of( "repositories", ImmutableMap.of("secondary", secondary.getPath(".").normalize().toString()))); // First try with cross-cell enabled String target = "//apps/sample:app_with_cross_cell_android_lib"; ProcessResult result = primary.runBuckCommand( "project", "--config", "project.embedded_cell_buck_out_enabled=true", "--ide", "intellij", target); result.assertSuccess(); String libImlPath = ".idea/libraries/secondary__java_com_crosscell_crosscell.xml"; Node doc = XmlDomParser.parse(primary.getFileContents(libImlPath)); String urlXpath = "/component/library/CLASSES/root/@url"; // Assert that the library URL is inside the project root assertThat( doc, Matchers.hasXPath( urlXpath, Matchers.startsWith("jar://$PROJECT_DIR$/buck-out/cells/secondary/gen/"))); result = primary.runBuckCommand( "project", "--config", "project.embedded_cell_buck_out_enabled=false", "--ide", "intellij", target); result.assertSuccess(); Node doc2 = XmlDomParser.parse(primary.getFileContents(libImlPath)); // Assert that the library URL is outside the project root assertThat(doc2, Matchers.hasXPath(urlXpath, Matchers.startsWith("jar://$PROJECT_DIR$/.."))); } private ProcessResult runBuckProjectAndVerify(String folderWithTestData, String... commandArgs) throws InterruptedException, IOException { AssumeAndroidPlatform.assumeSdkIsAvailable(); ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, folderWithTestData, temporaryFolder); workspace.setUp(); ProcessResult result = workspace.runBuckCommand(Lists.asList("project", commandArgs).toArray(new String[0])); result.assertSuccess("buck project should exit cleanly"); workspace.verify(); return result; } }
clonetwin26/buck
test/com/facebook/buck/ide/intellij/ProjectIntegrationTest.java
Java
apache-2.0
16,432
// ---------------------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. // ---------------------------------------------------------------------------- namespace Microsoft.WindowsAzure.MobileServices.Eventing { /// <summary> /// Represents a mobile service event. /// </summary> public interface IMobileServiceEvent { /// <summary> /// Gets the event name. /// </summary> string Name { get; } } }
Azure/azure-mobile-apps-net-client
src/Microsoft.Azure.Mobile.Client/Eventing/IMobileServiceEvent.cs
C#
apache-2.0
526
/* * Copyright 2016 John Grosh <[email protected]>. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.jagrosh.jmusicbot.commands; import java.util.List; import java.util.concurrent.TimeUnit; import com.jagrosh.jdautilities.commandclient.CommandEvent; import com.jagrosh.jdautilities.menu.pagination.PaginatorBuilder; import com.jagrosh.jmusicbot.Bot; import com.jagrosh.jmusicbot.audio.AudioHandler; import com.jagrosh.jmusicbot.audio.QueuedTrack; import com.jagrosh.jmusicbot.utils.FormatUtil; import net.dv8tion.jda.core.Permission; import net.dv8tion.jda.core.exceptions.PermissionException; /** * * @author John Grosh <[email protected]> */ public class QueueCmd extends MusicCommand { private final PaginatorBuilder builder; public QueueCmd(Bot bot) { super(bot); this.name = "queue"; this.help = "shows the current queue"; this.arguments = "[pagenum]"; this.aliases = new String[]{"list"}; this.bePlaying = true; this.botPermissions = new Permission[]{Permission.MESSAGE_ADD_REACTION,Permission.MESSAGE_EMBED_LINKS}; builder = new PaginatorBuilder() .setColumns(1) .setFinalAction(m -> {try{m.clearReactions().queue();}catch(PermissionException e){}}) .setItemsPerPage(10) .waitOnSinglePage(false) .useNumberedItems(true) .showPageNumbers(true) .setEventWaiter(bot.getWaiter()) .setTimeout(1, TimeUnit.MINUTES) ; } @Override public void doCommand(CommandEvent event) { int pagenum = 1; try{ pagenum = Integer.parseInt(event.getArgs()); }catch(NumberFormatException e){} AudioHandler ah = (AudioHandler)event.getGuild().getAudioManager().getSendingHandler(); List<QueuedTrack> list = ah.getQueue().getList(); if(list.isEmpty()) { event.replyWarning("There is no music in the queue!" +(!ah.isMusicPlaying() ? "" : " Now playing:\n\n**"+ah.getPlayer().getPlayingTrack().getInfo().title+"**\n"+FormatUtil.embedformattedAudio(ah))); return; } String[] songs = new String[list.size()]; long total = 0; for(int i=0; i<list.size(); i++) { total += list.get(i).getTrack().getDuration(); songs[i] = list.get(i).toString(); } long fintotal = total; builder.setText((i1,i2) -> getQueueTitle(ah, event.getClient().getSuccess(), songs.length, fintotal)) .setItems(songs) .setUsers(event.getAuthor()) .setColor(event.getSelfMember().getColor()) ; builder.build().paginate(event.getChannel(), pagenum); } private String getQueueTitle(AudioHandler ah, String success, int songslength, long total) { StringBuilder sb = new StringBuilder(); if(ah.getPlayer().getPlayingTrack()!=null) sb.append("**").append(ah.getPlayer().getPlayingTrack().getInfo().title).append("**\n").append(FormatUtil.embedformattedAudio(ah)).append("\n\n"); return sb.append(success).append(" Current Queue | ").append(songslength).append(" entries | `").append(FormatUtil.formatTime(total)).append("` ").toString(); } }
Blankscar/NothingToSeeHere
src/main/java/com/jagrosh/jmusicbot/commands/QueueCmd.java
Java
apache-2.0
3,885
import { Configuration } from "./configuration"; import { ConfigurationParser } from "./configuration-parser"; import { CustomReporterResult } from "./custom-reporter-result"; import { ExecutionDisplay } from "./execution-display"; import { ExecutionMetrics } from "./execution-metrics"; import CustomReporter = jasmine.CustomReporter; import SuiteInfo = jasmine.SuiteInfo; import RunDetails = jasmine.RunDetails; export class HtmlSpecReporter implements CustomReporter { private started: boolean = false; private finished: boolean = false; private display: ExecutionDisplay; private metrics: ExecutionMetrics; private configuration: Configuration; constructor(configuration?: Configuration) { this.configuration = ConfigurationParser.parse(configuration); this.display = new ExecutionDisplay(this.configuration); this.metrics = new ExecutionMetrics(); } public jasmineStarted(suiteInfo: SuiteInfo): void { this.started = true; this.metrics.start(suiteInfo); this.display.jasmineStarted(suiteInfo); } public jasmineDone(runDetails: RunDetails): void { this.metrics.stop(runDetails); this.display.summary(runDetails, this.metrics); this.finished = true; } public suiteStarted(result: CustomReporterResult): void { this.display.suiteStarted(result); } public suiteDone(result: CustomReporterResult): void { this.display.suiteDone(); } public specStarted(result: CustomReporterResult): void { this.metrics.startSpec(); this.display.specStarted(result); } public specDone(result: CustomReporterResult): void { this.metrics.stopSpec(result); if (result.status === "pending") { this.metrics.pendingSpecs++; this.display.pending(result); } else if (result.status === "passed") { this.metrics.successfulSpecs++; this.display.successful(result); } else if (result.status === "failed") { this.metrics.failedSpecs++; this.display.failed(result); } this.display.specDone(result); } }
nbuso/protractor-html-spec-reporter
src/html-spec-reporter.ts
TypeScript
apache-2.0
2,180
/* * Copyright 2014-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.opsworks.model; import java.io.Serializable; import javax.annotation.Generated; /** * * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeregisterEcsCluster" target="_top">AWS API * Documentation</a> */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class DeregisterEcsClusterResult extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata> implements Serializable, Cloneable { /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DeregisterEcsClusterResult == false) return false; DeregisterEcsClusterResult other = (DeregisterEcsClusterResult) obj; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; return hashCode; } @Override public DeregisterEcsClusterResult clone() { try { return (DeregisterEcsClusterResult) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }
jentfoo/aws-sdk-java
aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/model/DeregisterEcsClusterResult.java
Java
apache-2.0
2,373
#! /usr/bin/python import sys import os import json import grpc import time import subprocess from google.oauth2 import service_account import google.oauth2.credentials import google.auth.transport.requests import google.auth.transport.grpc from google.firestore.v1beta1 import firestore_pb2 from google.firestore.v1beta1 import firestore_pb2_grpc from google.firestore.v1beta1 import document_pb2 from google.firestore.v1beta1 import document_pb2_grpc from google.firestore.v1beta1 import common_pb2 from google.firestore.v1beta1 import common_pb2_grpc from google.firestore.v1beta1 import write_pb2 from google.firestore.v1beta1 import write_pb2_grpc from google.protobuf import empty_pb2 from google.protobuf import timestamp_pb2 def first_message(database, write): messages = [ firestore_pb2.WriteRequest(database = database, writes = []) ] for msg in messages: yield msg def generate_messages(database, writes, stream_id, stream_token): # writes can be an array and append to the messages, so it can write multiple Write # here just write one as example messages = [ firestore_pb2.WriteRequest(database=database, writes = []), firestore_pb2.WriteRequest(database=database, writes = [writes], stream_id = stream_id, stream_token = stream_token) ] for msg in messages: yield msg def main(): fl = os.path.dirname(os.path.abspath(__file__)) fn = os.path.join(fl, 'grpc.json') with open(fn) as grpc_file: item = json.load(grpc_file) creds = item["grpc"]["Write"]["credentials"] credentials = service_account.Credentials.from_service_account_file("{}".format(creds)) scoped_credentials = credentials.with_scopes(['https://www.googleapis.com/auth/datastore']) http_request = google.auth.transport.requests.Request() channel = google.auth.transport.grpc.secure_authorized_channel(scoped_credentials, http_request, 'firestore.googleapis.com:443') stub = firestore_pb2_grpc.FirestoreStub(channel) database = item["grpc"]["Write"]["database"] name = item["grpc"]["Write"]["name"] first_write = write_pb2.Write() responses = stub.Write(first_message(database, first_write)) for response in responses: print("Received message %s" % (response.stream_id)) print(response.stream_token) value_ = document_pb2.Value(string_value = "foo_boo") update = document_pb2.Document(name=name, fields={"foo":value_}) writes = write_pb2.Write(update_mask=common_pb2.DocumentMask(field_paths = ["foo"]), update=update) r2 = stub.Write(generate_messages(database, writes, response.stream_id, response.stream_token)) for r in r2: print(r.write_results) if __name__ == "__main__": main()
GoogleCloudPlatform/grpc-gcp-python
firestore/examples/end2end/src/Write.py
Python
apache-2.0
2,967
using Lucene.Net.Support; using System; using System.Collections.Generic; using System.IO; using System.Reflection; using System.Text; using System.Threading; namespace Lucene.Net.Util { /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using Directory = Lucene.Net.Store.Directory; /// <summary> /// This class emulates the new Java 7 "Try-With-Resources" statement. /// Remove once Lucene is on Java 7. /// <para/> /// @lucene.internal /// </summary> [ExceptionToClassNameConvention] public sealed class IOUtils { /// <summary> /// UTF-8 <see cref="Encoding"/> instance to prevent repeated /// <see cref="Encoding.UTF8"/> lookups </summary> [Obsolete("Use Encoding.UTF8 instead.")] public static readonly Encoding CHARSET_UTF_8 = Encoding.UTF8; /// <summary> /// UTF-8 charset string. /// <para/>Where possible, use <see cref="Encoding.UTF8"/> instead, /// as using the <see cref="string"/> constant may slow things down. </summary> /// <seealso cref="Encoding.UTF8"/> public static readonly string UTF_8 = "UTF-8"; private IOUtils() // no instance { } /// <summary> /// <para>Disposes all given <c>IDisposable</c>s, suppressing all thrown exceptions. Some of the <c>IDisposable</c>s /// may be <c>null</c>, they are ignored. After everything is disposed, method either throws <paramref name="priorException"/>, /// if one is supplied, or the first of suppressed exceptions, or completes normally.</para> /// <para>Sample usage: /// <code> /// IDisposable resource1 = null, resource2 = null, resource3 = null; /// ExpectedException priorE = null; /// try /// { /// resource1 = ...; resource2 = ...; resource3 = ...; // Acquisition may throw ExpectedException /// ..do..stuff.. // May throw ExpectedException /// } /// catch (ExpectedException e) /// { /// priorE = e; /// } /// finally /// { /// IOUtils.CloseWhileHandlingException(priorE, resource1, resource2, resource3); /// } /// </code> /// </para> /// </summary> /// <param name="priorException"> <c>null</c> or an exception that will be rethrown after method completion. </param> /// <param name="objects"> Objects to call <see cref="IDisposable.Dispose()"/> on. </param> [Obsolete("Use DisposeWhileHandlingException(Exception, params IDisposable[]) instead.")] public static void CloseWhileHandlingException(Exception priorException, params IDisposable[] objects) { DisposeWhileHandlingException(priorException, objects); } /// <summary> /// Disposes all given <see cref="IDisposable"/>s, suppressing all thrown exceptions. </summary> /// <seealso cref="DisposeWhileHandlingException(Exception, IDisposable[])"/> [Obsolete("Use DisposeWhileHandlingException(Exception, IEnumerable<IDisposable>) instead.")] public static void CloseWhileHandlingException(Exception priorException, IEnumerable<IDisposable> objects) { DisposeWhileHandlingException(priorException, objects); } /// <summary> /// Disposes all given <see cref="IDisposable"/>s. Some of the /// <see cref="IDisposable"/>s may be <c>null</c>; they are /// ignored. After everything is closed, the method either /// throws the first exception it hit while closing, or /// completes normally if there were no exceptions. /// </summary> /// <param name="objects"> /// Objects to call <see cref="IDisposable.Dispose()"/> on </param> [Obsolete("Use Dispose(params IDisposable[]) instead.")] public static void Close(params IDisposable[] objects) { Dispose(objects); } /// <summary> /// Disposes all given <see cref="IDisposable"/>s. </summary> /// <seealso cref="Dispose(IDisposable[])"/> [Obsolete("Use Dispose(IEnumerable<IDisposable>) instead.")] public static void Close(IEnumerable<IDisposable> objects) { Dispose(objects); } /// <summary> /// Disposes all given <see cref="IDisposable"/>s, suppressing all thrown exceptions. /// Some of the <see cref="IDisposable"/>s may be <c>null</c>, they are ignored. /// </summary> /// <param name="objects"> /// Objects to call <see cref="IDisposable.Dispose()"/> on </param> [Obsolete("Use DisposeWhileHandlingException(params IDisposable[]) instead.")] public static void CloseWhileHandlingException(params IDisposable[] objects) { DisposeWhileHandlingException(objects); } /// <summary> /// Disposes all given <see cref="IDisposable"/>s, suppressing all thrown exceptions. </summary> /// <seealso cref="DisposeWhileHandlingException(IEnumerable{IDisposable})"/> /// <seealso cref="DisposeWhileHandlingException(IDisposable[])"/> [Obsolete("Use DisposeWhileHandlingException(IEnumerable<IDisposable>) instead.")] public static void CloseWhileHandlingException(IEnumerable<IDisposable> objects) { DisposeWhileHandlingException(objects); } // LUCENENET specific - added overloads starting with Dispose... instead of Close... /// <summary> /// <para>Disposes all given <c>IDisposable</c>s, suppressing all thrown exceptions. Some of the <c>IDisposable</c>s /// may be <c>null</c>, they are ignored. After everything is disposed, method either throws <paramref name="priorException"/>, /// if one is supplied, or the first of suppressed exceptions, or completes normally.</para> /// <para>Sample usage: /// <code> /// IDisposable resource1 = null, resource2 = null, resource3 = null; /// ExpectedException priorE = null; /// try /// { /// resource1 = ...; resource2 = ...; resource3 = ...; // Acquisition may throw ExpectedException /// ..do..stuff.. // May throw ExpectedException /// } /// catch (ExpectedException e) /// { /// priorE = e; /// } /// finally /// { /// IOUtils.DisposeWhileHandlingException(priorE, resource1, resource2, resource3); /// } /// </code> /// </para> /// </summary> /// <param name="priorException"> <c>null</c> or an exception that will be rethrown after method completion. </param> /// <param name="objects"> Objects to call <see cref="IDisposable.Dispose()"/> on. </param> public static void DisposeWhileHandlingException(Exception priorException, params IDisposable[] objects) { Exception th = null; foreach (IDisposable @object in objects) { try { if (@object != null) { @object.Dispose(); } } catch (Exception t) { AddSuppressed(priorException ?? th, t); if (th == null) { th = t; } } } if (priorException != null) { throw priorException; } else { ReThrow(th); } } /// <summary> /// Disposes all given <see cref="IDisposable"/>s, suppressing all thrown exceptions. </summary> /// <seealso cref="DisposeWhileHandlingException(Exception, IDisposable[])"/> public static void DisposeWhileHandlingException(Exception priorException, IEnumerable<IDisposable> objects) { Exception th = null; foreach (IDisposable @object in objects) { try { if (@object != null) { @object.Dispose(); } } catch (Exception t) { AddSuppressed(priorException ?? th, t); if (th == null) { th = t; } } } if (priorException != null) { throw priorException; } else { ReThrow(th); } } /// <summary> /// Disposes all given <see cref="IDisposable"/>s. Some of the /// <see cref="IDisposable"/>s may be <c>null</c>; they are /// ignored. After everything is closed, the method either /// throws the first exception it hit while closing, or /// completes normally if there were no exceptions. /// </summary> /// <param name="objects"> /// Objects to call <see cref="IDisposable.Dispose()"/> on </param> public static void Dispose(params IDisposable[] objects) { Exception th = null; foreach (IDisposable @object in objects) { try { if (@object != null) { @object.Dispose(); } } catch (Exception t) { AddSuppressed(th, t); if (th == null) { th = t; } } } ReThrow(th); } /// <summary> /// Disposes all given <see cref="IDisposable"/>s. </summary> /// <seealso cref="Dispose(IDisposable[])"/> public static void Dispose(IEnumerable<IDisposable> objects) { Exception th = null; foreach (IDisposable @object in objects) { try { if (@object != null) { @object.Dispose(); } } catch (Exception t) { AddSuppressed(th, t); if (th == null) { th = t; } } } ReThrow(th); } /// <summary> /// Disposes all given <see cref="IDisposable"/>s, suppressing all thrown exceptions. /// Some of the <see cref="IDisposable"/>s may be <c>null</c>, they are ignored. /// </summary> /// <param name="objects"> /// Objects to call <see cref="IDisposable.Dispose()"/> on </param> public static void DisposeWhileHandlingException(params IDisposable[] objects) { foreach (var o in objects) { try { if (o != null) { o.Dispose(); } } catch (Exception) { //eat it } } } /// <summary> /// Disposes all given <see cref="IDisposable"/>s, suppressing all thrown exceptions. </summary> /// <seealso cref="DisposeWhileHandlingException(IDisposable[])"/> public static void DisposeWhileHandlingException(IEnumerable<IDisposable> objects) { foreach (IDisposable @object in objects) { try { if (@object != null) { @object.Dispose(); } } catch (Exception) { //eat it } } } /// <summary> /// Since there's no C# equivalent of Java's Exception.AddSuppressed, we add the /// suppressed exceptions to a data field via the /// <see cref="Support.ExceptionExtensions.AddSuppressed(Exception, Exception)"/> method. /// <para/> /// The exceptions can be retrieved by calling <see cref="ExceptionExtensions.GetSuppressed(Exception)"/> /// or <see cref="ExceptionExtensions.GetSuppressedAsList(Exception)"/>. /// </summary> /// <param name="exception"> this exception should get the suppressed one added </param> /// <param name="suppressed"> the suppressed exception </param> private static void AddSuppressed(Exception exception, Exception suppressed) { if (exception != null && suppressed != null) { exception.AddSuppressed(suppressed); } } /// <summary> /// Wrapping the given <see cref="Stream"/> in a reader using a <see cref="Encoding"/>. /// Unlike Java's defaults this reader will throw an exception if your it detects /// the read charset doesn't match the expected <see cref="Encoding"/>. /// <para/> /// Decoding readers are useful to load configuration files, stopword lists or synonym files /// to detect character set problems. However, its not recommended to use as a common purpose /// reader. /// </summary> /// <param name="stream"> The stream to wrap in a reader </param> /// <param name="charSet"> The expected charset </param> /// <returns> A wrapping reader </returns> public static TextReader GetDecodingReader(Stream stream, Encoding charSet) { return new StreamReader(stream, charSet); } /// <summary> /// Opens a <see cref="TextReader"/> for the given <see cref="FileInfo"/> using a <see cref="Encoding"/>. /// Unlike Java's defaults this reader will throw an exception if your it detects /// the read charset doesn't match the expected <see cref="Encoding"/>. /// <para/> /// Decoding readers are useful to load configuration files, stopword lists or synonym files /// to detect character set problems. However, its not recommended to use as a common purpose /// reader. </summary> /// <param name="file"> The file to open a reader on </param> /// <param name="charSet"> The expected charset </param> /// <returns> A reader to read the given file </returns> public static TextReader GetDecodingReader(FileInfo file, Encoding charSet) { FileStream stream = null; bool success = false; try { stream = file.OpenRead(); TextReader reader = GetDecodingReader(stream, charSet); success = true; return reader; } finally { if (!success) { IOUtils.Dispose(stream); } } } /// <summary> /// Opens a <see cref="TextReader"/> for the given resource using a <see cref="Encoding"/>. /// Unlike Java's defaults this reader will throw an exception if your it detects /// the read charset doesn't match the expected <see cref="Encoding"/>. /// <para/> /// Decoding readers are useful to load configuration files, stopword lists or synonym files /// to detect character set problems. However, its not recommended to use as a common purpose /// reader. </summary> /// <param name="clazz"> The class used to locate the resource </param> /// <param name="resource"> The resource name to load </param> /// <param name="charSet"> The expected charset </param> /// <returns> A reader to read the given file </returns> public static TextReader GetDecodingReader(Type clazz, string resource, Encoding charSet) { Stream stream = null; bool success = false; try { stream = clazz.GetTypeInfo().Assembly.FindAndGetManifestResourceStream(clazz, resource); TextReader reader = GetDecodingReader(stream, charSet); success = true; return reader; } finally { if (!success) { IOUtils.Dispose(stream); } } } /// <summary> /// Deletes all given files, suppressing all thrown <see cref="Exception"/>s. /// <para/> /// Note that the files should not be <c>null</c>. /// </summary> public static void DeleteFilesIgnoringExceptions(Directory dir, params string[] files) { foreach (string name in files) { try { dir.DeleteFile(name); } catch (Exception) { // ignore } } } /// <summary> /// Copy one file's contents to another file. The target will be overwritten /// if it exists. The source must exist. /// </summary> public static void Copy(FileInfo source, FileInfo target) { FileStream fis = null; FileStream fos = null; try { fis = source.OpenRead(); fos = target.OpenWrite(); byte[] buffer = new byte[1024 * 8]; int len; while ((len = fis.Read(buffer, 0, buffer.Length)) > 0) { fos.Write(buffer, 0, len); } } finally { Dispose(fis, fos); } } /// <summary> /// Simple utilty method that takes a previously caught /// <see cref="Exception"/> and rethrows either /// <see cref="IOException"/> or an unchecked exception. If the /// argument is <c>null</c> then this method does nothing. /// </summary> public static void ReThrow(Exception th) { if (th != null) { if (th is System.IO.IOException) { throw th; } ReThrowUnchecked(th); } } /// <summary> /// Simple utilty method that takes a previously caught /// <see cref="Exception"/> and rethrows it as an unchecked exception. /// If the argument is <c>null</c> then this method does nothing. /// </summary> public static void ReThrowUnchecked(Exception th) { if (th != null) { throw th; } } // LUCENENET specific: Fsync is pointless in .NET, since we are // calling FileStream.Flush(true) before the stream is disposed // which means we never need it at the point in Java where it is called. // /// <summary> // /// Ensure that any writes to the given file is written to the storage device that contains it. </summary> // /// <param name="fileToSync"> The file to fsync </param> // /// <param name="isDir"> If <c>true</c>, the given file is a directory (we open for read and ignore <see cref="IOException"/>s, // /// because not all file systems and operating systems allow to fsync on a directory) </param> // public static void Fsync(string fileToSync, bool isDir) // { // // Fsync does not appear to function properly for Windows and Linux platforms. In Lucene version // // they catch this in IOException branch and return if the call is for the directory. // // In Lucene.Net the exception is UnauthorizedAccessException and is not handled by // // IOException block. No need to even attempt to fsync, just return if the call is for directory // if (isDir) // { // return; // } // var retryCount = 1; // while (true) // { // FileStream file = null; // bool success = false; // try // { // // If the file is a directory we have to open read-only, for regular files we must open r/w for the fsync to have an effect. // // See http://blog.httrack.com/blog/2013/11/15/everything-you-always-wanted-to-know-about-fsync/ // file = new FileStream(fileToSync, // FileMode.Open, // We shouldn't create a file when syncing. // // Java version uses FileChannel which doesn't create the file if it doesn't already exist, // // so there should be no reason for attempting to create it in Lucene.Net. // FileAccess.Write, // FileShare.ReadWrite); // //FileSupport.Sync(file); // file.Flush(true); // success = true; // } //#pragma warning disable 168 // catch (IOException e) //#pragma warning restore 168 // { // if (retryCount == 5) // { // throw; // } //#if !NETSTANDARD1_6 // try // { //#endif // // Pause 5 msec // Thread.Sleep(5); //#if !NETSTANDARD1_6 // } // catch (ThreadInterruptedException ie) // { // var ex = new ThreadInterruptedException(ie.ToString(), ie); // ex.AddSuppressed(e); // throw ex; // } //#endif // } // finally // { // if (file != null) // { // file.Dispose(); // } // } // if (success) // { // return; // } // retryCount++; // } // } } }
laimis/lucenenet
src/Lucene.Net/Util/IOUtils.cs
C#
apache-2.0
24,051
// /******************************************************************************* // * Copyright 2012-2018 Esri // * // * Licensed under the Apache License, Version 2.0 (the "License"); // * you may not use this file except in compliance with the License. // * You may obtain a copy of the License at // * // * http://www.apache.org/licenses/LICENSE-2.0 // * // * Unless required by applicable law or agreed to in writing, software // * distributed under the License is distributed on an "AS IS" BASIS, // * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // * See the License for the specific language governing permissions and // * limitations under the License. // ******************************************************************************/ using System; using System.Collections.ObjectModel; using System.Diagnostics.CodeAnalysis; using System.Threading; using Android.Content; using Android.Runtime; using Android.Util; using Android.Views; using Android.Widget; using Esri.ArcGISRuntime.Mapping; using Esri.ArcGISRuntime.Toolkit.Internal; namespace Esri.ArcGISRuntime.Toolkit.UI.Controls { [Register("Esri.ArcGISRuntime.Toolkit.UI.Controls.LayerLegend")] public partial class LayerLegend { private ListView _listView; private Android.OS.Handler _uithread; /// <summary> /// Initializes a new instance of the <see cref="LayerLegend"/> class. /// </summary> /// <param name="context">The Context the view is running in, through which it can access resources, themes, etc.</param> public LayerLegend(Context context) : base(context ?? throw new ArgumentNullException(nameof(context))) { Initialize(); } /// <summary> /// Initializes a new instance of the <see cref="LayerLegend"/> class. /// </summary> /// <param name="context">The Context the view is running in, through which it can access resources, themes, etc.</param> /// <param name="attr">The attributes of the AXML element declaring the view.</param> public LayerLegend(Context context, IAttributeSet? attr) : base(context ?? throw new ArgumentNullException(nameof(context)), attr) { Initialize(); } [MemberNotNull(nameof(_listView), nameof(_uithread))] private void Initialize() { _uithread = new Android.OS.Handler(Context!.MainLooper!); _listView = new ListView(Context) { ClipToOutline = true, Clickable = false, ChoiceMode = ChoiceMode.None, LayoutParameters = new LayoutParams(LayoutParams.WrapContent, LayoutParams.WrapContent), ScrollingCacheEnabled = false, PersistentDrawingCache = PersistentDrawingCaches.NoCache, }; AddView(_listView); } private void Refresh() { if (_listView == null) { return; } if (LayerContent == null) { _listView.Adapter = null; return; } if (LayerContent is ILoadable loadable) { if (loadable.LoadStatus != LoadStatus.Loaded) { loadable.Loaded += Layer_Loaded; loadable.LoadAsync(); return; } } var items = new ObservableCollection<LegendInfo>(); LoadRecursive(items, LayerContent, IncludeSublayers); _listView.Adapter = new LayerLegendAdapter(Context, items); _listView.SetHeightBasedOnChildren(); } private void Layer_Loaded(object sender, System.EventArgs e) { if (sender is ILoadable loadable) { loadable.Loaded -= Layer_Loaded; } _uithread.Post(Refresh); } /// <inheritdoc /> protected override void OnMeasure(int widthMeasureSpec, int heightMeasureSpec) { base.OnMeasure(widthMeasureSpec, heightMeasureSpec); // Initialize dimensions of root layout MeasureChild(_listView, widthMeasureSpec, MeasureSpec.MakeMeasureSpec(MeasureSpec.GetSize(heightMeasureSpec), MeasureSpecMode.AtMost)); // Calculate the ideal width and height for the view var desiredWidth = PaddingLeft + PaddingRight + _listView.MeasuredWidth; var desiredHeight = PaddingTop + PaddingBottom + _listView.MeasuredHeight; // Get the width and height of the view given any width and height constraints indicated by the width and height spec values var width = ResolveSize(desiredWidth, widthMeasureSpec); var height = ResolveSize(desiredHeight, heightMeasureSpec); SetMeasuredDimension(width, height); } /// <inheritdoc /> protected override void OnLayout(bool changed, int l, int t, int r, int b) { // Forward layout call to the root layout _listView.Layout(PaddingLeft, PaddingTop, _listView.MeasuredWidth + PaddingLeft, _listView.MeasuredHeight + PaddingBottom); } } }
Esri/arcgis-toolkit-dotnet
src/Toolkit/Toolkit.Android/UI/Controls/LayerLegend/LayerLegend.Android.cs
C#
apache-2.0
5,339
package com.google.api.ads.adwords.jaxws.v201509.cm; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; /** * * Represents a criterion belonging to a shared set. * * * <p>Java class for SharedCriterion complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="SharedCriterion"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="sharedSetId" type="{http://www.w3.org/2001/XMLSchema}long" minOccurs="0"/> * &lt;element name="criterion" type="{https://adwords.google.com/api/adwords/cm/v201509}Criterion" minOccurs="0"/> * &lt;element name="negative" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "SharedCriterion", propOrder = { "sharedSetId", "criterion", "negative" }) public class SharedCriterion { protected Long sharedSetId; protected Criterion criterion; protected Boolean negative; /** * Gets the value of the sharedSetId property. * * @return * possible object is * {@link Long } * */ public Long getSharedSetId() { return sharedSetId; } /** * Sets the value of the sharedSetId property. * * @param value * allowed object is * {@link Long } * */ public void setSharedSetId(Long value) { this.sharedSetId = value; } /** * Gets the value of the criterion property. * * @return * possible object is * {@link Criterion } * */ public Criterion getCriterion() { return criterion; } /** * Sets the value of the criterion property. * * @param value * allowed object is * {@link Criterion } * */ public void setCriterion(Criterion value) { this.criterion = value; } /** * Gets the value of the negative property. * * @return * possible object is * {@link Boolean } * */ public Boolean isNegative() { return negative; } /** * Sets the value of the negative property. * * @param value * allowed object is * {@link Boolean } * */ public void setNegative(Boolean value) { this.negative = value; } }
gawkermedia/googleads-java-lib
modules/adwords_appengine/src/main/java/com/google/api/ads/adwords/jaxws/v201509/cm/SharedCriterion.java
Java
apache-2.0
2,764
package de.choesel.blechwiki.model; import com.j256.ormlite.field.DatabaseField; import com.j256.ormlite.table.DatabaseTable; import java.util.UUID; /** * Created by christian on 05.05.16. */ @DatabaseTable(tableName = "komponist") public class Komponist { @DatabaseField(generatedId = true) private UUID id; @DatabaseField(canBeNull = true, uniqueCombo = true) private String name; @DatabaseField(canBeNull = true) private String kurzname; @DatabaseField(canBeNull = true, uniqueCombo = true) private Integer geboren; @DatabaseField(canBeNull = true) private Integer gestorben; public UUID getId() { return id; } public String getName() { return name; } public String getKurzname() { return kurzname; } public Integer getGeboren() { return geboren; } public Integer getGestorben() { return gestorben; } public void setId(UUID id) { this.id = id; } public void setName(String name) { this.name = name; } public void setKurzname(String kurzname) { this.kurzname = kurzname; } public void setGeboren(Integer geboren) { this.geboren = geboren; } public void setGestorben(Integer gestorben) { this.gestorben = gestorben; } }
ChristianHoesel/android-blechwiki
app/src/main/java/de/choesel/blechwiki/model/Komponist.java
Java
apache-2.0
1,341
package server import ( "fmt" "math/big" "net/http" "strconv" "time" "github.com/san-lab/banketh-quorum/banketh/bots" "github.com/san-lab/banketh-quorum/banketh/cryptobank" "github.com/san-lab/banketh-quorum/banketh/data" "github.com/san-lab/banketh-quorum/lib/bank/banktypes" "github.com/san-lab/banketh-quorum/lib/db" "github.com/san-lab/banketh-quorum/lib/ethapi" ) func HandleBackoffice(w http.ResponseWriter, req *http.Request) { if !logged(w, req) { reload(w, req, "/") return } req.ParseForm() whatToShowA, ok := req.Form["whattoshow"] if !ok || whatToShowA[0] == "Cashins" { HandleCashins(w, req) return } else if whatToShowA[0] == "Cashouts" { HandleCashouts(w, req) return } else if whatToShowA[0] == "PaymentTerminations" { HandlePaymentTerminations(w, req) return } showError(w, req, "Navigation error") } func HandleCashins(w http.ResponseWriter, req *http.Request) { cashins, err := db.ReadTable(data.DBNAME, data.DBTABLECASHINS, &data.CashinT{}, "", "Time desc") if err != nil { showErrorf(w, req, "Unable to read cashin transactions table [%v]", err) return } passdata := map[string]interface{}{ "Cashins": cashins, "Currency": cryptobank.CURRENCY, } placeHeader(w, req) templates.ExecuteTemplate(w, "cashins.html", passdata) } func HandleCashouts(w http.ResponseWriter, req *http.Request) { cashouts, err := db.ReadTable(data.DBNAME, data.DBTABLECASHOUTS, &data.CashoutT{}, "", "Time desc") if err != nil { showErrorf(w, req, "Unable to read cashout transactions table [%v]", err) return } passdata := map[string]interface{}{ "Cashouts": cashouts, "Currency": cryptobank.CURRENCY, } placeHeader(w, req) templates.ExecuteTemplate(w, "cashouts.html", passdata) } func HandlePaymentTerminations(w http.ResponseWriter, req *http.Request) { paymentTerminations, err := db.ReadTable(data.DBNAME, data.DBTABLEPAYMENTTERMINATIONS, &data.PaymentTerminationT{}, "", "Time desc") if err != nil { showErrorf(w, req, "Unable to read payment terminations table [%v]", err) return } passdata := map[string]interface{}{ "PaymentTerminations": paymentTerminations, "Currency": cryptobank.CURRENCY, } placeHeader(w, req) templates.ExecuteTemplate(w, "paymentterminations.html", passdata) } func HandleManualAddFunds(w http.ResponseWriter, req *http.Request) { if !logged(w, req) { reload(w, req, "/") return } req.ParseForm() bankaccountA, ok := req.Form["bankaccount"] if !ok { showError(w, req, "Form error") return } banktridA, ok := req.Form["banktrid"] if !ok { showError(w, req, "Form error") return } amountA, ok := req.Form["amount"] if !ok { showError(w, req, "Form error") return } amount, err := strconv.ParseFloat(amountA[0], 64) if err != nil { pushAlertf(w, req, ALERT_DANGER, "Wrong amount argument %v [%v]", amountA[0], err) reload(w, req, "/backoffice") return } messageA, ok := req.Form["message"] if !ok { showError(w, req, "Form error") return } bankethaccountA, ok := req.Form["bankethaccount"] if !ok { showError(w, req, "Form error") return } bankethaccount, err := strconv.ParseUint(bankethaccountA[0], 0, 64) if err != nil { pushAlertf(w, req, ALERT_DANGER, "Wrong banketh account %v [%v]", bankethaccountA[0], err) reload(w, req, "/backoffice") return } manyaccounts, err := cryptobank.Many_accounts(ethclient) if int64(bankethaccount) >= manyaccounts { pushAlertf(w, req, ALERT_DANGER, "Account %v does not exist in banketh", bankethaccountA[0]) reload(w, req, "/backoffice") return } account, err := cryptobank.Read_account(ethclient, bankethaccount) if err != nil { showErrorf(w, req, "Error reading account %v from ethereum node [%v]", bankethaccount, err) return } bankethamount, _ := big.NewFloat(0).Mul(big.NewFloat(amount), big.NewFloat(cryptobank.PRECISION)).Int(nil) txHash, err := cryptobank.Add_funds(ethclient, int64(bankethaccount), bankethamount) if err != nil { pushAlertf(w, req, ALERT_DANGER, "Add_funds method call failed! [%v]", err) reload(w, req, "/backoffice") return } newT := data.CashinT{ BankTrID: banktridA[0], Time: db.MyTime(time.Now()), BankAccount: bankaccountA[0], BankAmount: amount, Message: messageA[0], ToAddress: account.Owner, ToAccount: int64(bankethaccount), BankethAmount: big.NewInt(0).Set(bankethamount), AddFundsOrSubmitPaymentHash: txHash, ReturnTrID: "", ReturnMessage: "", Status: data.CASHIN_STATUS_MANUALLY_FINISHED, } err = db.WriteEntry(data.DBNAME, data.DBTABLECASHINS, newT) if err != nil { errMsg := fmt.Sprintf("Sent an addFunds call (hash %v) but could not write it to DB! [%v]", err) pushAlert(w, req, ALERT_DANGER, errMsg) db.RegisterEvent(data.DBNAME, data.DBTABLEEVENTS, db.EVENT_MANUAL_INTERVENTION_NEEDED, errMsg+fmt.Sprintf(" - Need manual intervention, we should record the transaction in the DB; projected transaction was %v", newT)) reload(w, req, "/backoffice") return } } func HandleManualAddTransfer(w http.ResponseWriter, req *http.Request) { if !logged(w, req) { reload(w, req, "/") return } req.ParseForm() banktridA, ok := req.Form["banktrid"] if !ok { showError(w, req, "Form error") return } bankaccountA, ok := req.Form["bankaccount"] if !ok { showError(w, req, "Form error") return } amountA, ok := req.Form["amount"] if !ok { showError(w, req, "Form error") return } amount, err := strconv.ParseFloat(amountA[0], 64) if err != nil { pushAlertf(w, req, ALERT_DANGER, "Wrong amount argument %v [%v]", amountA[0], err) reload(w, req, "/backoffice") return } typeA, ok := req.Form["type"] if !ok { showError(w, req, "Form error") return } messageA, ok := req.Form["message"] if !ok { showError(w, req, "Form error") return } newTransfer := banktypes.BankTransferT{ TransferID: banktridA[0], Time: db.MyTime(time.Now()), Account: bankaccountA[0], Amount: amount, Type: typeA[0], Message: messageA[0], } d, err := db.ConnectDB(data.DBNAME) if err != nil { pushAlertf(w, req, ALERT_DANGER, "Error connecting to the database [%v]", err) reload(w, req, "/backoffice") return } not_ok := bots.Process_inbound_transfer(d, &newTransfer) if not_ok { pushAlertf(w, req, ALERT_DANGER, "Error processing manual inbound transfer - pls check the console log") reload(w, req, "/backoffice") return } } func HandleManualRemoveFunds(w http.ResponseWriter, req *http.Request) { if !logged(w, req) { reload(w, req, "/") return } req.ParseForm() var redeemFundsHash ethapi.Hash var err error redeemFundsHashA, ok := req.Form["redeemfundshash"] if ok && redeemFundsHashA[0] != "" { redeemFundsHash, err = ethapi.String_to_hash(redeemFundsHashA[0]) if err != nil { pushAlertf(w, req, ALERT_DANGER, "Bad hash %v [%v]", redeemFundsHashA[0], err) reload(w, req, "/backoffice") return } } bankethaccountA, ok := req.Form["bankethaccount"] if !ok { showError(w, req, "Form error") return } bankethaccount, err := strconv.ParseUint(bankethaccountA[0], 0, 64) if err != nil { pushAlertf(w, req, ALERT_DANGER, "Wrong banketh account %v [%v]", bankethaccountA[0], err) reload(w, req, "/backoffice") return } manyaccounts, err := cryptobank.Many_accounts(ethclient) if int64(bankethaccount) >= manyaccounts { pushAlertf(w, req, ALERT_DANGER, "Account %v does not exist in banketh", bankethaccountA[0]) reload(w, req, "/backoffice") return } account, err := cryptobank.Read_account(ethclient, bankethaccount) if err != nil { showErrorf(w, req, "Error reading account %v from ethereum node [%v]", bankethaccount, err) return } amountA, ok := req.Form["amount"] if !ok { showError(w, req, "Form error") return } amount, err := strconv.ParseFloat(amountA[0], 64) if err != nil { pushAlertf(w, req, ALERT_DANGER, "Wrong amount argument %v [%v]", amountA[0], err) reload(w, req, "/backoffice") return } bankethamount, _ := big.NewFloat(0).Mul(big.NewFloat(amount), big.NewFloat(cryptobank.PRECISION)).Int(nil) redemptionModeA, ok := req.Form["redemptionmode"] if !ok { showError(w, req, "Form error") return } redemptionMode, err := strconv.ParseUint(redemptionModeA[0], 0, 64) if err != nil { pushAlertf(w, req, ALERT_DANGER, "Wrong redemption mode %v [%v]", redemptionModeA[0], err) reload(w, req, "/backoffice") return } routingInfoA, given := req.Form["routinginfo"] if given { if len(routingInfoA[0]) > 32 { pushAlertf(w, req, ALERT_DANGER, "Wrong routing info (%v)", routingInfoA[0]) reload(w, req, "/backoffice") return } } var errorCode int64 errorCodeA, given := req.Form["errorcode"] if given { errorCode, err = strconv.ParseInt(errorCodeA[0], 0, 64) if err != nil { pushAlertf(w, req, ALERT_DANGER, "Wrong redemption error code (%v)", errorCodeA[0]) reload(w, req, "/backoffice") return } } /* redemptionCodeSent := big.NewInt(0) redemptionCodeSentA, given := req.Form["redemptioncodesent"] if given { redemptionCodeSent, ok = redemptionCodeSent.SetString(redemptionCodeSentA[0], 0) if !ok { pushAlertf(w, req, ALERT_DANGER, "Wrong redemption code (%v)", redemptionCodeSentA[0]) reload(w, req, "/backoffice") return } } */ bankaccountA, _ := req.Form["bankaccount"] banktridA, _ := req.Form["banktrid"] messageA, _ := req.Form["message"] txHash, err := cryptobank.Remove_funds(ethclient, int64(bankethaccount), bankethamount, redeemFundsHash, errorCode) /* txHash, err := cryptobank.Remove_funds(ethclient, int64(bankethaccount), bankethamount, redemptionCodeSent) */ if err != nil { pushAlertf(w, req, ALERT_DANGER, "Remove_funds method call failed! [%v]", err) reload(w, req, "/backoffice") return } newT := data.CashoutT{ RedeemFundsHash: redeemFundsHash, Time: db.MyTime(time.Now()), FromAccount: int64(bankethaccount), FromAddress: account.Owner, BankethAmount: big.NewInt(0).Set(bankethamount), RedemptionMode: redemptionMode, RoutingInfo: routingInfoA[0], ErrorCode: errorCode, RemoveFundsHash: txHash, // MakeTransferHash: // Not neccessary, since this is a known cashout BankAccount: bankaccountA[0], BankAmount: amount, BankTrID: banktridA[0], Message: messageA[0], Status: data.CASHOUT_STATUS_MANUALLY_FINISHED, } err = db.WriteEntry(data.DBNAME, data.DBTABLECASHOUTS, newT) if err != nil { errMsg := fmt.Sprintf("Sent an remove_funds call (hash %v) but could not write it to DB! [%v]", err) pushAlert(w, req, ALERT_DANGER, errMsg) db.RegisterEvent(data.DBNAME, data.DBTABLEEVENTS, db.EVENT_MANUAL_INTERVENTION_NEEDED, errMsg+fmt.Sprintf(" - Need manual intervention, we should record the transaction in the DB; projected transaction was %v", newT)) reload(w, req, "/backoffice") return } }
hesusruiz/fabricaudit
requires/san-lab/banketh-quorum/banketh/server/handleBackoffice.go
GO
apache-2.0
11,104
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.6"/> <title>OpenNI 1.5.8: Member List</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectlogo"><img alt="Logo" src="OpenNILogo.bmp"/></td> <td style="padding-left: 0.5em;"> <div id="projectname">OpenNI 1.5.8 </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- 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> </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="inherits.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="namespacexn.html">xn</a></li><li class="navelem"><a class="el" href="classxn_1_1_image_generator.html">ImageGenerator</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">xn::ImageGenerator Member List</div> </div> </div><!--header--> <div class="contents"> <p>This is the complete list of members for <a class="el" href="classxn_1_1_image_generator.html">xn::ImageGenerator</a>, including all inherited members.</p> <table class="directory"> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_production_node.html#a8ee96495ace6ee2369c9255409cca2b9">AddNeededNode</a>(ProductionNode &amp;needed)</td><td class="entry"><a class="el" href="classxn_1_1_production_node.html">xn::ProductionNode</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_node_wrapper.html#ae40a63959249614fa7f9a107e5557d81">AddRef</a>()</td><td class="entry"><a class="el" href="classxn_1_1_node_wrapper.html">xn::NodeWrapper</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_image_generator.html#a6c925e2cc848841a566eebb27275ef6b">Create</a>(Context &amp;context, Query *pQuery=NULL, EnumerationErrors *pErrors=NULL)</td><td class="entry"><a class="el" href="classxn_1_1_image_generator.html">xn::ImageGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_generator.html#a23866c5ad6a10efc2070acbb00470874">Generator</a>(XnNodeHandle hNode=NULL)</td><td class="entry"><a class="el" href="classxn_1_1_generator.html">xn::Generator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_generator.html#a9f24a82e98e1421aab4eb71f244f7c37">Generator</a>(const NodeWrapper &amp;other)</td><td class="entry"><a class="el" href="classxn_1_1_generator.html">xn::Generator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_generator.html#aa026cae7475aa794aad3cdfaa7d5c726">GetAlternativeViewPointCap</a>() const </td><td class="entry"><a class="el" href="classxn_1_1_generator.html">xn::Generator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_generator.html#ae99917e5a3c47578eadadea85ed5e4de">GetAlternativeViewPointCap</a>()</td><td class="entry"><a class="el" href="classxn_1_1_generator.html">xn::Generator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_map_generator.html#a96b92b1c193e6d9ac08ea06438668bc3">GetAntiFlickerCap</a>()</td><td class="entry"><a class="el" href="classxn_1_1_map_generator.html">xn::MapGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_map_generator.html#a648c912c117e483ce5c36c50a3cf518c">GetAutoExposureCap</a>()</td><td class="entry"><a class="el" href="classxn_1_1_map_generator.html">xn::MapGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_map_generator.html#a7eae2b728ea6bf591f8987426af6b1b8">GetBacklightCompensationCap</a>()</td><td class="entry"><a class="el" href="classxn_1_1_map_generator.html">xn::MapGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_map_generator.html#ad74d20839b4ce0de02688e2333049f7a">GetBrightnessCap</a>()</td><td class="entry"><a class="el" href="classxn_1_1_map_generator.html">xn::MapGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_map_generator.html#a7af5b329c639fa6ec66610d3eb882e2e">GetBytesPerPixel</a>() const </td><td class="entry"><a class="el" href="classxn_1_1_map_generator.html">xn::MapGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_production_node.html#a84a8fe5b2f56cbc97087529f4c15af77">GetContext</a>(Context &amp;context) const </td><td class="entry"><a class="el" href="classxn_1_1_production_node.html">xn::ProductionNode</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_production_node.html#ab2ad46e24e4e40ab3ff89ecbac1c332a">GetContext</a>() const </td><td class="entry"><a class="el" href="classxn_1_1_production_node.html">xn::ProductionNode</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_map_generator.html#ad88c3b6d477530661c50e52322f68872">GetContrastCap</a>()</td><td class="entry"><a class="el" href="classxn_1_1_map_generator.html">xn::MapGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_map_generator.html#aa6d8779f6efb6d02fe0be6093e277f7c">GetCroppingCap</a>() const </td><td class="entry"><a class="el" href="classxn_1_1_map_generator.html">xn::MapGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_map_generator.html#a123e60e70cfd477f142e2d96eca649fc">GetCroppingCap</a>()</td><td class="entry"><a class="el" href="classxn_1_1_map_generator.html">xn::MapGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_generator.html#a1dd4f7f779f636b7c984cda1edddff02">GetData</a>()</td><td class="entry"><a class="el" href="classxn_1_1_generator.html">xn::Generator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_generator.html#a5b6c7e53de6b4d459f3e54ccfb81c31e">GetDataSize</a>() const </td><td class="entry"><a class="el" href="classxn_1_1_generator.html">xn::Generator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_production_node.html#a158c1c8a60ef1eac1fc24ad67024a327">GetErrorStateCap</a>() const </td><td class="entry"><a class="el" href="classxn_1_1_production_node.html">xn::ProductionNode</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_production_node.html#af6f5e265c05c32d0652a05dba99331b3">GetErrorStateCap</a>()</td><td class="entry"><a class="el" href="classxn_1_1_production_node.html">xn::ProductionNode</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_map_generator.html#a24e4f2800adca3684ab5ac0821924e5f">GetExposureCap</a>()</td><td class="entry"><a class="el" href="classxn_1_1_map_generator.html">xn::MapGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_map_generator.html#a5cffd52f9b19340afbdb92259d880720">GetFocusCap</a>()</td><td class="entry"><a class="el" href="classxn_1_1_map_generator.html">xn::MapGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_generator.html#a5e819081604760a7690a11a20c53856a">GetFrameID</a>() const </td><td class="entry"><a class="el" href="classxn_1_1_generator.html">xn::Generator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_generator.html#ac78aa3433bef155939b0dc43f37e9e0d">GetFrameSyncCap</a>() const </td><td class="entry"><a class="el" href="classxn_1_1_generator.html">xn::Generator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_generator.html#a2e4eee068a2a915288cb37788dd995a1">GetFrameSyncCap</a>()</td><td class="entry"><a class="el" href="classxn_1_1_generator.html">xn::Generator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_map_generator.html#acd6b97ff72c36c29b7e68ac23a0947c9">GetGainCap</a>()</td><td class="entry"><a class="el" href="classxn_1_1_map_generator.html">xn::MapGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_map_generator.html#ae73d9805b68b87150ee6b8f1a0ef6c5c">GetGammaCap</a>()</td><td class="entry"><a class="el" href="classxn_1_1_map_generator.html">xn::MapGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_production_node.html#a4a4ba15b066f3649e1ea67cd3c4ddd63">GetGeneralIntCap</a>(const XnChar *strCapability)</td><td class="entry"><a class="el" href="classxn_1_1_production_node.html">xn::ProductionNode</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_production_node.html#adfb77adf7676bc13cd234e57fd2a8af1">GetGeneralProperty</a>(const XnChar *strName, XnUInt32 nBufferSize, void *pBuffer) const </td><td class="entry"><a class="el" href="classxn_1_1_production_node.html">xn::ProductionNode</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_image_generator.html#afe501e7330839a3655e87ac781fd7499">GetGrayscale16ImageMap</a>() const </td><td class="entry"><a class="el" href="classxn_1_1_image_generator.html">xn::ImageGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_image_generator.html#a65fc9baf5295524f55d67dbdce1430b3">GetGrayscale8ImageMap</a>() const </td><td class="entry"><a class="el" href="classxn_1_1_image_generator.html">xn::ImageGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_node_wrapper.html#a7451f117eee7f28a1c9f4a3b094611ca">GetHandle</a>() const </td><td class="entry"><a class="el" href="classxn_1_1_node_wrapper.html">xn::NodeWrapper</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_map_generator.html#a8e603f389f9e393c0847f48d1fc77cf5">GetHueCap</a>()</td><td class="entry"><a class="el" href="classxn_1_1_map_generator.html">xn::MapGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_image_generator.html#a93eb06e873cb55bbd1c03d34b195608c">GetImageMap</a>() const </td><td class="entry"><a class="el" href="classxn_1_1_image_generator.html">xn::ImageGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_production_node.html#a7c68542292cb6c6054b7f62cdf695b0b">GetInfo</a>() const </td><td class="entry"><a class="el" href="classxn_1_1_production_node.html">xn::ProductionNode</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_production_node.html#abf6ef51084c94c8e45d7f3a22e015546">GetIntProperty</a>(const XnChar *strName, XnUInt64 &amp;nValue) const </td><td class="entry"><a class="el" href="classxn_1_1_production_node.html">xn::ProductionNode</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_map_generator.html#a2d2fde7c23c7549cf95c134ac8348621">GetIrisCap</a>()</td><td class="entry"><a class="el" href="classxn_1_1_map_generator.html">xn::MapGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_map_generator.html#a7c3f728018bea1549fd0739d800d6e68">GetLowLightCompensationCap</a>()</td><td class="entry"><a class="el" href="classxn_1_1_map_generator.html">xn::MapGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_map_generator.html#a1fd1a64c376d7a47b2951bd996939644">GetMapOutputMode</a>(XnMapOutputMode &amp;OutputMode) const </td><td class="entry"><a class="el" href="classxn_1_1_map_generator.html">xn::MapGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_image_generator.html#addc360efd421476ffde0ddfbf3ada135">GetMetaData</a>(ImageMetaData &amp;metaData) const </td><td class="entry"><a class="el" href="classxn_1_1_image_generator.html">xn::ImageGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_generator.html#a162ee01b3483dcf71075398e4a0bb948">GetMirrorCap</a>() const </td><td class="entry"><a class="el" href="classxn_1_1_generator.html">xn::Generator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_generator.html#a67018dd9cc900520937547f747094576">GetMirrorCap</a>()</td><td class="entry"><a class="el" href="classxn_1_1_generator.html">xn::Generator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_node_wrapper.html#ae9e08bd23c07bf858c7f1ec1b3b658c4">GetName</a>() const </td><td class="entry"><a class="el" href="classxn_1_1_node_wrapper.html">xn::NodeWrapper</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_map_generator.html#a5967318797a653e55fdc8481c402455e">GetPanCap</a>()</td><td class="entry"><a class="el" href="classxn_1_1_map_generator.html">xn::MapGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_image_generator.html#a30dc165c0c6fce19a1c871867cb6d764">GetPixelFormat</a>() const </td><td class="entry"><a class="el" href="classxn_1_1_image_generator.html">xn::ImageGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_production_node.html#ac8fb89389a77471200315aa3daa3952d">GetRealProperty</a>(const XnChar *strName, XnDouble &amp;dValue) const </td><td class="entry"><a class="el" href="classxn_1_1_production_node.html">xn::ProductionNode</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_image_generator.html#a34b7c4ba1758149c83403c19084f4e45">GetRGB24ImageMap</a>() const </td><td class="entry"><a class="el" href="classxn_1_1_image_generator.html">xn::ImageGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_map_generator.html#a89cb3e534c188aed7223e8a48372e4ed">GetRollCap</a>()</td><td class="entry"><a class="el" href="classxn_1_1_map_generator.html">xn::MapGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_map_generator.html#a7941a39b9033bbc1879510dcbd17a782">GetSaturationCap</a>()</td><td class="entry"><a class="el" href="classxn_1_1_map_generator.html">xn::MapGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_map_generator.html#ab9f8accc14097086dec3cde211ed0956">GetSharpnessCap</a>()</td><td class="entry"><a class="el" href="classxn_1_1_map_generator.html">xn::MapGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_production_node.html#a83cc813b9359238a2bc3a4d9595451c2">GetStringProperty</a>(const XnChar *strName, XnChar *csValue, XnUInt32 nBufSize) const </td><td class="entry"><a class="el" href="classxn_1_1_production_node.html">xn::ProductionNode</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_map_generator.html#a1141e5efac972a65f03a17525b314c13">GetSupportedMapOutputModes</a>(XnMapOutputMode *aModes, XnUInt32 &amp;nCount) const </td><td class="entry"><a class="el" href="classxn_1_1_map_generator.html">xn::MapGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_map_generator.html#a50a6f2732e27eb270966ff2aca7f82f1">GetSupportedMapOutputModesCount</a>() const </td><td class="entry"><a class="el" href="classxn_1_1_map_generator.html">xn::MapGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_map_generator.html#a319ba695c9a3b3b617af39a8e9f9d2c0">GetTiltCap</a>()</td><td class="entry"><a class="el" href="classxn_1_1_map_generator.html">xn::MapGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_generator.html#a25ac36419b9761a70768cc59330330a2">GetTimestamp</a>() const </td><td class="entry"><a class="el" href="classxn_1_1_generator.html">xn::Generator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_map_generator.html#ac4584569475826bd69306e93b5dbdd4f">GetWhiteBalanceCap</a>()</td><td class="entry"><a class="el" href="classxn_1_1_map_generator.html">xn::MapGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_image_generator.html#a0bb971192a8946e21981423c1deb0542">GetYUV422ImageMap</a>() const </td><td class="entry"><a class="el" href="classxn_1_1_image_generator.html">xn::ImageGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_map_generator.html#a53d574cbcca2026008127deec244650b">GetZoomCap</a>()</td><td class="entry"><a class="el" href="classxn_1_1_map_generator.html">xn::MapGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_image_generator.html#a36ef73a85b81c02b094b99342ff8979c">ImageGenerator</a>(XnNodeHandle hNode=NULL)</td><td class="entry"><a class="el" href="classxn_1_1_image_generator.html">xn::ImageGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_image_generator.html#a6ff334a06de0e56017cdcf2a114cea07">ImageGenerator</a>(const NodeWrapper &amp;other)</td><td class="entry"><a class="el" href="classxn_1_1_image_generator.html">xn::ImageGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_production_node.html#a26574447d96527d1a9d79994e550037f">IsCapabilitySupported</a>(const XnChar *strCapabilityName) const </td><td class="entry"><a class="el" href="classxn_1_1_production_node.html">xn::ProductionNode</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_generator.html#a46b2960e843339296201682c04c02b5d">IsDataNew</a>() const </td><td class="entry"><a class="el" href="classxn_1_1_generator.html">xn::Generator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_generator.html#a5b1f69de8cfac0767729a4584778d7cf">IsGenerating</a>() const </td><td class="entry"><a class="el" href="classxn_1_1_generator.html">xn::Generator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_generator.html#ab1d6e18ad5169afec58dde1f3cf4f8bf">IsNewDataAvailable</a>(XnUInt64 *pnTimestamp=NULL) const </td><td class="entry"><a class="el" href="classxn_1_1_generator.html">xn::Generator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_image_generator.html#a2be4be723adc6b851c89534550fe4466">IsPixelFormatSupported</a>(XnPixelFormat Format) const </td><td class="entry"><a class="el" href="classxn_1_1_image_generator.html">xn::ImageGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_node_wrapper.html#a3927cf50a70b01c6a57be2e3cf976269">IsValid</a>() const </td><td class="entry"><a class="el" href="classxn_1_1_node_wrapper.html">xn::NodeWrapper</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_production_node.html#a28a13885c815a05f93e2c661e5ac380d">LockedNodeEndChanges</a>(XnLockHandle hLock)</td><td class="entry"><a class="el" href="classxn_1_1_production_node.html">xn::ProductionNode</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_production_node.html#a13b8caa654da8dae4767648593c217d5">LockedNodeStartChanges</a>(XnLockHandle hLock)</td><td class="entry"><a class="el" href="classxn_1_1_production_node.html">xn::ProductionNode</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_production_node.html#ad4e631318f4190de2d12e57525283d8f">LockForChanges</a>(XnLockHandle *phLock)</td><td class="entry"><a class="el" href="classxn_1_1_production_node.html">xn::ProductionNode</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_map_generator.html#ab965e633e37529450548cc3d3951a451">MapGenerator</a>(XnNodeHandle hNode=NULL)</td><td class="entry"><a class="el" href="classxn_1_1_map_generator.html">xn::MapGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_map_generator.html#a9eae3f772388e3622b5dab6133c619ee">MapGenerator</a>(const NodeWrapper &amp;other)</td><td class="entry"><a class="el" href="classxn_1_1_map_generator.html">xn::MapGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_node_wrapper.html#a82e82d31752ea3ac4c12d303c2a1d613">NodeWrapper</a>(XnNodeHandle hNode)</td><td class="entry"><a class="el" href="classxn_1_1_node_wrapper.html">xn::NodeWrapper</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_node_wrapper.html#a734a00bdf029ea60e97d72c16605181a">NodeWrapper</a>(const NodeWrapper &amp;other)</td><td class="entry"><a class="el" href="classxn_1_1_node_wrapper.html">xn::NodeWrapper</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_node_wrapper.html#a30a130aa42cfca995d97cf59204ee5f9">operator XnNodeHandle</a>() const </td><td class="entry"><a class="el" href="classxn_1_1_node_wrapper.html">xn::NodeWrapper</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_node_wrapper.html#adfd9b28dd0f715da3ee73f39d2a40bac">operator!=</a>(const NodeWrapper &amp;other)</td><td class="entry"><a class="el" href="classxn_1_1_node_wrapper.html">xn::NodeWrapper</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_node_wrapper.html#a9532d1cbeb5f4d5f76d701a737f7512c">operator=</a>(const NodeWrapper &amp;other)</td><td class="entry"><a class="el" href="classxn_1_1_node_wrapper.html">xn::NodeWrapper</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_node_wrapper.html#aedd041d6c7100d869e678d94fd39e1cd">operator==</a>(const NodeWrapper &amp;other)</td><td class="entry"><a class="el" href="classxn_1_1_node_wrapper.html">xn::NodeWrapper</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_production_node.html#a12ed2ea37cdaf7dc48f6eb589215c178">ProductionNode</a>(XnNodeHandle hNode=NULL)</td><td class="entry"><a class="el" href="classxn_1_1_production_node.html">xn::ProductionNode</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_production_node.html#aa8d9e12dc9dd12040513442a399f72c5">ProductionNode</a>(const NodeWrapper &amp;other)</td><td class="entry"><a class="el" href="classxn_1_1_production_node.html">xn::ProductionNode</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_generator.html#a5fc2c00997d7e827ce1e86d7b89ec2f1">RegisterToGenerationRunningChange</a>(StateChangedHandler handler, void *pCookie, XnCallbackHandle &amp;hCallback)</td><td class="entry"><a class="el" href="classxn_1_1_generator.html">xn::Generator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_map_generator.html#a282df4d2ddb58e5dc1717c8ceaacd5c9">RegisterToMapOutputModeChange</a>(StateChangedHandler handler, void *pCookie, XnCallbackHandle &amp;hCallback)</td><td class="entry"><a class="el" href="classxn_1_1_map_generator.html">xn::MapGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_generator.html#a8fcad557eda5746a7f974e51c70bb324">RegisterToNewDataAvailable</a>(StateChangedHandler handler, void *pCookie, XnCallbackHandle &amp;hCallback)</td><td class="entry"><a class="el" href="classxn_1_1_generator.html">xn::Generator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_image_generator.html#a06f084d8db3ed54d1a61ba83d9b5c143">RegisterToPixelFormatChange</a>(StateChangedHandler handler, void *pCookie, XnCallbackHandle &amp;hCallback)</td><td class="entry"><a class="el" href="classxn_1_1_image_generator.html">xn::ImageGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_node_wrapper.html#ad94e45cb0bbd21223ed17e77c6893ca6">Release</a>()</td><td class="entry"><a class="el" href="classxn_1_1_node_wrapper.html">xn::NodeWrapper</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_production_node.html#a15178408fda6623a9f6b6e3cae74fea4">RemoveNeededNode</a>(ProductionNode &amp;needed)</td><td class="entry"><a class="el" href="classxn_1_1_production_node.html">xn::ProductionNode</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_production_node.html#a32b34f2102078fbbf6719ac473d988a1">SetGeneralProperty</a>(const XnChar *strName, XnUInt32 nBufferSize, const void *pBuffer)</td><td class="entry"><a class="el" href="classxn_1_1_production_node.html">xn::ProductionNode</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_node_wrapper.html#af4873f95c91d4c4381a3ca127b791b27">SetHandle</a>(XnNodeHandle hNode)</td><td class="entry"><a class="el" href="classxn_1_1_node_wrapper.html">xn::NodeWrapper</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_production_node.html#a6796677af3d968d786d9094d33c6d9f1">SetIntProperty</a>(const XnChar *strName, XnUInt64 nValue)</td><td class="entry"><a class="el" href="classxn_1_1_production_node.html">xn::ProductionNode</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_map_generator.html#aea291fb67aea2d2d21d7b0b159884f9d">SetMapOutputMode</a>(const XnMapOutputMode &amp;OutputMode)</td><td class="entry"><a class="el" href="classxn_1_1_map_generator.html">xn::MapGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_image_generator.html#a1297b84dcc77a2e81300d5fa17b3efec">SetPixelFormat</a>(XnPixelFormat Format)</td><td class="entry"><a class="el" href="classxn_1_1_image_generator.html">xn::ImageGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_production_node.html#a0b026a014056ab654859f14fe9a1408e">SetRealProperty</a>(const XnChar *strName, XnDouble dValue)</td><td class="entry"><a class="el" href="classxn_1_1_production_node.html">xn::ProductionNode</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_production_node.html#a21b665cca28349b53a3a2ff62355aab5">SetStringProperty</a>(const XnChar *strName, const XnChar *strValue)</td><td class="entry"><a class="el" href="classxn_1_1_production_node.html">xn::ProductionNode</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_generator.html#a4fa8a933a96765b30537b5203da3381e">StartGenerating</a>()</td><td class="entry"><a class="el" href="classxn_1_1_generator.html">xn::Generator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_generator.html#ae955127df36f3c71e76bdc5f2e383065">StopGenerating</a>()</td><td class="entry"><a class="el" href="classxn_1_1_generator.html">xn::Generator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_node_wrapper.html#ab8082cf957501ca1d7adcce6a5a4b737">TakeOwnership</a>(XnNodeHandle hNode)</td><td class="entry"><a class="el" href="classxn_1_1_node_wrapper.html">xn::NodeWrapper</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_production_node.html#a57bd03ecd194daab7aa4aada2bc95725">UnlockForChanges</a>(XnLockHandle hLock)</td><td class="entry"><a class="el" href="classxn_1_1_production_node.html">xn::ProductionNode</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_generator.html#a4ef03272d55e2146ae2b0f17db317d38">UnregisterFromGenerationRunningChange</a>(XnCallbackHandle hCallback)</td><td class="entry"><a class="el" href="classxn_1_1_generator.html">xn::Generator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_map_generator.html#a5767b2cddd43f0af982306e6693027ef">UnregisterFromMapOutputModeChange</a>(XnCallbackHandle hCallback)</td><td class="entry"><a class="el" href="classxn_1_1_map_generator.html">xn::MapGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_generator.html#a9f9789cecbcc0e43ecf63817e21ac6da">UnregisterFromNewDataAvailable</a>(XnCallbackHandle hCallback)</td><td class="entry"><a class="el" href="classxn_1_1_generator.html">xn::Generator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_image_generator.html#a01a8bb5d0285491222b9db40922f07f9">UnregisterFromPixelFormatChange</a>(XnCallbackHandle hCallback)</td><td class="entry"><a class="el" href="classxn_1_1_image_generator.html">xn::ImageGenerator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr><td class="entry"><a class="el" href="classxn_1_1_generator.html#aaf3162a87a79a05fa655f344c835fa2e">WaitAndUpdateData</a>()</td><td class="entry"><a class="el" href="classxn_1_1_generator.html">xn::Generator</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classxn_1_1_node_wrapper.html#a3d43e803c19305dbf8af15281cfa30ff">~NodeWrapper</a>()</td><td class="entry"><a class="el" href="classxn_1_1_node_wrapper.html">xn::NodeWrapper</a></td><td class="entry"><span class="mlabel">inline</span></td></tr> </table></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Thu Jun 11 2015 12:31:40 for OpenNI 1.5.8 by &#160;<a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.6 </small></address> </body> </html>
Wessi/OpenNI
Source/DoxyGen/html/classxn_1_1_image_generator-members.html
HTML
apache-2.0
35,670
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/first_run/first_run.h" #include "base/command_line.h" #include "base/file_util.h" #include "base/files/file_path.h" #include "base/path_service.h" #include "base/process_util.h" #include "base/string_util.h" #include "base/strings/string_piece.h" #include "base/utf_string_conversions.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/first_run/first_run_internal.h" #include "chrome/browser/importer/importer_host.h" #include "chrome/browser/process_singleton.h" #include "chrome/browser/shell_integration.h" #include "chrome/common/chrome_switches.h" #include "chrome/installer/util/google_update_settings.h" #include "chrome/installer/util/master_preferences.h" #include "content/public/common/result_codes.h" #include "googleurl/src/gurl.h" #include "ui/base/ui_base_switches.h" namespace first_run { namespace internal { bool IsOrganicFirstRun() { // We treat all installs as organic. return true; } // TODO(port): This is just a piece of the silent import functionality from // ImportSettings for Windows. It would be nice to get the rest of it ported. bool ImportBookmarks(const base::FilePath& import_bookmarks_path) { const CommandLine& cmdline = *CommandLine::ForCurrentProcess(); CommandLine import_cmd(cmdline.GetProgram()); // Propagate user data directory switch. if (cmdline.HasSwitch(switches::kUserDataDir)) { import_cmd.AppendSwitchPath(switches::kUserDataDir, cmdline.GetSwitchValuePath(switches::kUserDataDir)); } // Since ImportSettings is called before the local state is stored on disk // we pass the language as an argument. GetApplicationLocale checks the // current command line as fallback. import_cmd.AppendSwitchASCII(switches::kLang, g_browser_process->GetApplicationLocale()); import_cmd.CommandLine::AppendSwitchPath(switches::kImportFromFile, import_bookmarks_path); // The importer doesn't need to do any background networking tasks so disable // them. import_cmd.CommandLine::AppendSwitch(switches::kDisableBackgroundNetworking); // Time to launch the process that is going to do the import. We'll wait // for the process to return. base::LaunchOptions options; options.wait = true; return base::LaunchProcess(import_cmd, options, NULL); } base::FilePath MasterPrefsPath() { // The standard location of the master prefs is next to the chrome binary. base::FilePath master_prefs; if (!PathService::Get(base::DIR_EXE, &master_prefs)) return base::FilePath(); return master_prefs.AppendASCII(installer::kDefaultMasterPrefs); } } // namespace internal } // namespace first_run
plxaye/chromium
src/chrome/browser/first_run/first_run_linux.cc
C++
apache-2.0
2,876
package request import ( "bytes" "encoding/json" "io/ioutil" ) // A Handlers provides a collection of handlers for various stages of handling requests. type Handlers struct { RequestHandler func(*Request, *interface{}) error ResponseHandler func(*Request, *interface{}) error } // RequestHandler encodes a structure into a JSON string func RequestHandler(request *Request, input *interface{}) error { jsonstr, err := json.Marshal(&input) request.HTTPRequest.Body = ioutil.NopCloser(bytes.NewBuffer(jsonstr)) return err } // ResponseHandler decodes a JSON string into a structure. func ResponseHandler(request *Request, output *interface{}) error { return json.Unmarshal(request.Body, &output) } // ListResponseHandler extracts results from a JSON envelope and decodes them into a structure. // https://docs.atlas.mongodb.com/api/#lists func ListResponseHandler(request *Request, output *interface{}) error { var objmap map[string]*json.RawMessage err := json.Unmarshal(request.Body, &objmap) if err != nil { return err } return json.Unmarshal(*objmap["results"], &output) }
visit1985/atlasgo
common/request/handlers.go
GO
apache-2.0
1,144
package org.judal.examples.java.model.array; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.GregorianCalendar; import javax.jdo.JDOException; import org.judal.storage.DataSource; import org.judal.storage.EngineFactory; import org.judal.storage.java.ArrayRecord; import org.judal.storage.relational.RelationalDataSource; /** * Extend ArrayRecord in order to create model classes manageable by JUDAL. * Add your getters and setters for database fields. */ public class Student extends ArrayRecord { private static final long serialVersionUID = 1L; public static final String TABLE_NAME = "student"; public Student() throws JDOException { this(EngineFactory.getDefaultRelationalDataSource()); } public Student(RelationalDataSource dataSource) throws JDOException { super(dataSource, TABLE_NAME); } @Override public void store(DataSource dts) throws JDOException { // Generate the student Id. from a sequence if it is not provided if (isNull("id_student")) setId ((int) dts.getSequence("seq_student").nextValue()); super.store(dts); } public int getId() { return getInt("id_student"); } public void setId(final int id) { put("id_student", id); } public String getFirstName() { return getString("first_name"); } public void setFirstName(final String firstName) { put("first_name", firstName); } public String getLastName() { return getString("last_name"); } public void setLastName(final String lastName) { put("last_name", lastName); } public Calendar getDateOfBirth() { return getCalendar("date_of_birth"); } public void setDateOfBirth(final Calendar dob) { put("date_of_birth", dob); } public void setDateOfBirth(final String yyyyMMdd) throws ParseException { SimpleDateFormat dobFormat = new SimpleDateFormat("yyyy-MM-dd"); Calendar cal = new GregorianCalendar(); cal.setTime(dobFormat.parse(yyyyMMdd)); setDateOfBirth(cal); } public byte[] getPhoto() { return getBytes("photo"); } public void setPhoto(final byte[] photoData) { put("photo", photoData); } }
sergiomt/judal
aexample/src/main/java/org/judal/examples/java/model/array/Student.java
Java
apache-2.0
2,209
/* * Bean Java VM * Copyright (C) 2005-2015 Christian Lins <[email protected]> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <debug.h> #include <vm.h> void do_IINC_WIDE(Thread *thread, int index, int value) { /* Increment variable in local variable array */ } /* * Increments the variable specified by the first operand (index) * by the int value of the seconds operand. */ void do_IINC(Thread *thread) { dbgmsg("IINC"); int index, value; index = Get1ByteOperand(current_frame(thread)); /* Increments IP by one */ value = Get1ByteOperand(current_frame(thread)); /* Increments IP by one */ do_IINC_WIDE(thread, index, value); }
cli/bean
src/exec/inc.c
C
apache-2.0
1,204
/* * Copyright 2011-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ package com.amazonaws.http.apache.client.impl; import com.amazonaws.ClientConfiguration; import com.amazonaws.http.settings.HttpClientSettings; import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; import org.junit.Test; import static org.junit.Assert.assertEquals; public class ApacheConnectionManagerFactoryTest { private final ApacheConnectionManagerFactory factory = new ApacheConnectionManagerFactory(); @Test public void validateAfterInactivityMillis_RespectedInConnectionManager() { final int validateAfterInactivity = 1234; final HttpClientSettings httpClientSettings = HttpClientSettings.adapt(new ClientConfiguration() .withValidateAfterInactivityMillis(validateAfterInactivity)); final PoolingHttpClientConnectionManager connectionManager = (PoolingHttpClientConnectionManager) factory.create(httpClientSettings); assertEquals(validateAfterInactivity, connectionManager.getValidateAfterInactivity()); } }
dagnir/aws-sdk-java
aws-java-sdk-core/src/test/java/com/amazonaws/http/apache/client/impl/ApacheConnectionManagerFactoryTest.java
Java
apache-2.0
1,653
using IntelliTect.Coalesce.CodeGeneration.Generation; using IntelliTect.Coalesce.Tests.Util; using IntelliTect.Coalesce.Validation; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.Text; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using Xunit; namespace IntelliTect.Coalesce.CodeGeneration.Tests { public class CodeGenTestBase { protected GenerationExecutor BuildExecutor() { return new GenerationExecutor( new Configuration.CoalesceConfiguration { WebProject = new Configuration.ProjectConfiguration { RootNamespace = "MyProject" } }, Microsoft.Extensions.Logging.LogLevel.Information ); } protected async Task AssertSuiteOutputCompiles(IRootGenerator suite) { var project = new DirectoryInfo(Directory.GetCurrentDirectory()) .FindFileInAncestorDirectory("IntelliTect.Coalesce.CodeGeneration.Tests.csproj") .Directory; var suiteName = suite.GetType().Name; suite = suite .WithOutputPath(Path.Combine(project.FullName, "out", suiteName)); var validationResult = ValidateContext.Validate(suite.Model); Assert.Empty(validationResult.Where(r => r.IsError)); await suite.GenerateAsync(); var generators = suite .GetGeneratorsFlattened() .OfType<IFileGenerator>() .Where(g => g.EffectiveOutputPath.EndsWith(".cs")) .ToList(); var tasks = generators.Select(gen => (Generator: gen, Output: gen.GetOutputAsync())); await Task.WhenAll(tasks.Select(t => t.Output )); var dtoFiles = tasks .Select((task) => CSharpSyntaxTree.ParseText( SourceText.From(new StreamReader(task.Output.Result).ReadToEnd()), path: task.Generator.EffectiveOutputPath )) .ToArray(); var comp = ReflectionRepositoryFactory.GetCompilation(dtoFiles); AssertSuccess(comp); } protected void AssertSuccess(CSharpCompilation comp) { var errors = comp .GetDiagnostics() .Where(d => d.Severity >= Microsoft.CodeAnalysis.DiagnosticSeverity.Error); Assert.All(errors, error => { var loc = error.Location; Assert.False(true, "\"" + error.ToString() + $"\" near:```\n" + loc.SourceTree.ToString().Substring(loc.SourceSpan.Start, loc.SourceSpan.Length) + "\n```" ); }); } } }
IntelliTect/Coalesce
src/IntelliTect.Coalesce.CodeGeneration.Tests/CodeGenTestBase.cs
C#
apache-2.0
2,936
using System.ComponentModel; using AcceptFramework.Domain.Evaluation; namespace AcceptFramework.Repository.Evaluation { [DataObject] public class EvaluationParagraphScoringRepository : RepositoryBase<EvaluationParagraphScoring> { } }
accept-project/accept-api
AcceptFramework/Repository/Evaluation/EvaluationParagraphScoringRepository.cs
C#
apache-2.0
254
import sys sys.path.append("helper") import web from helper import session web.config.debug = False urls = ( "/", "controller.start.index", "/1", "controller.start.one", "/2", "controller.start.two", ) app = web.application(urls, globals()) sessions = session.Sessions() if __name__ == "__main__": app.run()
0x00/web.py-jinja2-pyjade-bootstrap
app.py
Python
apache-2.0
331
#!/bin/sh # # Copyright 2020 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" SRC_DIR=${SCRIPT_DIR} SPV_DIR=${SCRIPT_DIR}/../../../assets/shaders SELF_INC_DIR=${SCRIPT_DIR} SELF_INC_DIR=$(realpath --relative-to=${SCRIPT_DIR} ${SELF_INC_DIR}) VKEX_INC_DIR=$(realpath --relative-to=${SCRIPT_DIR} ${SRC_DIR}/..) CAS_INC_DIR=$(realpath --relative-to=${SCRIPT_DIR} ${SRC_DIR}/../../../third_party/FidelityFX/FFX_CAS/ffx-cas-headers) echo ${VKEX_INC_DIR} HLSL_FILES=(draw_cb.hlsl draw_standard.hlsl) for src_file in "${HLSL_FILES[@]}" do echo -e "\nCompiling ${src_file}" base_name=$(basename -s .hlsl ${src_file}) hlsl_file=${SRC_DIR}/${src_file} vs_spv=${SPV_DIR}/${base_name}.vs.spv ps_spv=${SPV_DIR}/${base_name}.ps.spv cmd="dxc -spirv -T vs_6_0 -E vsmain -fvk-use-dx-layout -Fo ${vs_spv} -I ${SELF_INC_DIR} -I ${VKEX_INC_DIR} ${hlsl_file}" echo ${cmd} eval ${cmd} cmd="dxc -spirv -T ps_6_0 -E psmain -fvk-use-dx-layout -Fo ${ps_spv} -I ${SELF_INC_DIR} -I ${VKEX_INC_DIR} ${hlsl_file}" echo ${cmd} eval ${cmd} done HLSL_COMPUTE_FILES=(cas.hlsl checkerboard_upscale.hlsl copy_texture.hlsl image_delta.hlsl) for src_file in "${HLSL_COMPUTE_FILES[@]}" do echo -e "\nCompiling ${src_file}" base_name=$(basename -s .hlsl ${src_file}) hlsl_file=${SRC_DIR}/${src_file} cs_spv=${SPV_DIR}/${base_name}.cs.spv cmd="dxc -spirv -T cs_6_0 -E csmain -fvk-use-dx-layout -Fo ${cs_spv} -I ${SELF_INC_DIR} -I ${VKEX_INC_DIR} -I ${CAS_INC_DIR} ${hlsl_file}" echo ${cmd} eval ${cmd} done read -p "Press enter to continue" nothing
googlestadia/PorQue4K
src/app/shaders/build_shaders.sh
Shell
apache-2.0
2,135
/* * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #include <aws/core/client/AWSError.h> #include <aws/redshift/RedshiftErrorMarshaller.h> #include <aws/redshift/RedshiftErrors.h> using namespace Aws::Client; using namespace Aws::Redshift; AWSError<CoreErrors> RedshiftErrorMarshaller::FindErrorByName(const char* errorName) const { AWSError<CoreErrors> error = RedshiftErrorMapper::GetErrorForName(errorName); if(error.GetErrorType() != CoreErrors::UNKNOWN) { return error; } return AWSErrorMarshaller::FindErrorByName(errorName); }
ambasta/aws-sdk-cpp
aws-cpp-sdk-redshift/source/RedshiftErrorMarshaller.cpp
C++
apache-2.0
1,074
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <link rel="SHORTCUT ICON" href="../../../../../img/clover.ico" /> <link rel="stylesheet" href="../../../../../aui/css/aui.min.css" media="all"/> <link rel="stylesheet" href="../../../../../aui/css/aui-experimental.min.css" media="all"/> <!--[if IE 9]><link rel="stylesheet" href="../../../../../aui/css/aui-ie9.min.css" media="all"/><![endif]--> <style type="text/css" media="all"> @import url('../../../../../style.css'); @import url('../../../../../tree.css'); </style> <script src="../../../../../jquery-1.8.3.min.js" type="text/javascript"></script> <script src="../../../../../aui/js/aui.min.js" type="text/javascript"></script> <script src="../../../../../aui/js/aui-experimental.min.js" type="text/javascript"></script> <script src="../../../../../aui/js/aui-soy.min.js" type="text/javascript"></script> <script src="../../../../../package-nodes-tree.js" type="text/javascript"></script> <script src="../../../../../clover-tree.js" type="text/javascript"></script> <script src="../../../../../clover.js" type="text/javascript"></script> <script src="../../../../../clover-descriptions.js" type="text/javascript"></script> <script src="../../../../../cloud.js" type="text/javascript"></script> <title>ABA Route Transit Number Validator 1.0.1-SNAPSHOT</title> </head> <body> <div id="page"> <header id="header" role="banner"> <nav class="aui-header aui-dropdown2-trigger-group" role="navigation"> <div class="aui-header-inner"> <div class="aui-header-primary"> <h1 id="logo" class="aui-header-logo aui-header-logo-clover"> <a href="http://openclover.org" title="Visit OpenClover home page"><span class="aui-header-logo-device">OpenClover</span></a> </h1> </div> <div class="aui-header-secondary"> <ul class="aui-nav"> <li id="system-help-menu"> <a class="aui-nav-link" title="Open online documentation" target="_blank" href="http://openclover.org/documentation"> <span class="aui-icon aui-icon-small aui-iconfont-help">&#160;Help</span> </a> </li> </ul> </div> </div> </nav> </header> <div class="aui-page-panel"> <div class="aui-page-panel-inner"> <div class="aui-page-panel-nav aui-page-panel-nav-clover"> <div class="aui-page-header-inner" style="margin-bottom: 20px;"> <div class="aui-page-header-image"> <a href="http://cardatechnologies.com" target="_top"> <div class="aui-avatar aui-avatar-large aui-avatar-project"> <div class="aui-avatar-inner"> <img src="../../../../../img/clover_logo_large.png" alt="Clover icon"/> </div> </div> </a> </div> <div class="aui-page-header-main" > <h1> <a href="http://cardatechnologies.com" target="_top"> ABA Route Transit Number Validator 1.0.1-SNAPSHOT </a> </h1> </div> </div> <nav class="aui-navgroup aui-navgroup-vertical"> <div class="aui-navgroup-inner"> <ul class="aui-nav"> <li class=""> <a href="../../../../../dashboard.html">Project overview</a> </li> </ul> <div class="aui-nav-heading packages-nav-heading"> <strong>Packages</strong> </div> <div class="aui-nav project-packages"> <form method="get" action="#" class="aui package-filter-container"> <input type="text" autocomplete="off" class="package-filter text" placeholder="Type to filter packages..." name="package-filter" id="package-filter" title="Start typing package name (or part of the name) to search through the tree. Use arrow keys and the Enter key to navigate."/> </form> <p class="package-filter-no-results-message hidden"> <small>No results found.</small> </p> <div class="packages-tree-wrapper" data-root-relative="../../../../../" data-package-name="com.cardatechnologies.utils.validators.abaroutevalidator"> <div class="packages-tree-container"></div> <div class="clover-packages-lozenges"></div> </div> </div> </div> </nav> </div> <section class="aui-page-panel-content"> <div class="aui-page-panel-content-clover"> <div class="aui-page-header-main"><ol class="aui-nav aui-nav-breadcrumbs"> <li><a href="../../../../../dashboard.html"> Project Clover database Sat Aug 7 2021 12:29:33 MDT</a></li> <li><a href="test-pkg-summary.html">Package com.cardatechnologies.utils.validators.abaroutevalidator</a></li> <li><a href="test-Test_AbaRouteValidator_10.html">Class Test_AbaRouteValidator_10</a></li> </ol></div> <h1 class="aui-h2-clover"> Test testAbaNumberCheck_20655_good </h1> <table class="aui"> <thead> <tr> <th>Test</th> <th><label title="The test result. Either a Pass, Fail or Error.">Status</label></th> <th><label title="When the test execution was started">Start time</label></th> <th><label title="The total time in seconds taken to run this test.">Time (seconds)</label></th> <th><label title="A failure or error message if the test is not successful.">Message</label></th> </tr> </thead> <tbody> <tr> <td> <a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/Test_AbaRouteValidator_10.html?line=15785#src-15785" >testAbaNumberCheck_20655_good</a> </td> <td> <span class="sortValue">1</span><span class="aui-lozenge aui-lozenge-success">PASS</span> </td> <td> 7 Aug 12:39:52 </td> <td> 0.0 </td> <td> <div></div> <div class="errorMessage"></div> </td> </tr> </tbody> </table> <div>&#160;</div> <table class="aui aui-table-sortable"> <thead> <tr> <th style="white-space:nowrap;"><label title="A class that was directly hit by this test.">Target Class</label></th> <th colspan="4"><label title="The percentage of coverage contributed by each single test.">Coverage contributed by</label> testAbaNumberCheck_20655_good</th> </tr> </thead> <tbody> <tr> <td> <span class="sortValue">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</span> &#160;&#160;<a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/AbaRouteValidator.html?id=5501#AbaRouteValidator" title="AbaRouteValidator" name="sl-47">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</a> </td> <td> <span class="sortValue">0.7352941</span>73.5% </td> <td class="align-middle" style="width: 100%" colspan="3"> <div> <div title="73.5% Covered" style="min-width:40px;" class="barNegative contribBarNegative contribBarNegative"><div class="barPositive contribBarPositive contribBarPositive" style="width:73.5%"></div></div></div> </td> </tr> </tbody> </table> </div> <!-- class="aui-page-panel-content-clover" --> <footer id="footer" role="contentinfo"> <section class="footer-body"> <ul> <li> Report generated by <a target="_new" href="http://openclover.org">OpenClover</a> v 4.4.1 on Sat Aug 7 2021 12:49:26 MDT using coverage data from Sat Aug 7 2021 12:47:23 MDT. </li> </ul> <ul> <li>OpenClover is free and open-source software. </li> </ul> </section> </footer> </section> <!-- class="aui-page-panel-content" --> </div> <!-- class="aui-page-panel-inner" --> </div> <!-- class="aui-page-panel" --> </div> <!-- id="page" --> </body> </html>
dcarda/aba.route.validator
target13/site/clover/com/cardatechnologies/utils/validators/abaroutevalidator/Test_AbaRouteValidator_10_testAbaNumberCheck_20655_good_48t.html
HTML
apache-2.0
9,180
package org.spincast.core.routing; import java.util.List; import org.spincast.core.exchange.RequestContext; /** * The result of the router, when asked to find matches for * a request. */ public interface RoutingResult<R extends RequestContext<?>> { /** * The handlers matching the route (a main handler + filters, if any), * in order they have to be called. */ public List<RouteHandlerMatch<R>> getRouteHandlerMatches(); /** * The main route handler and its information, from the routing result. */ public RouteHandlerMatch<R> getMainRouteHandlerMatch(); }
spincast/spincast-framework
spincast-core-parent/spincast-core/src/main/java/org/spincast/core/routing/RoutingResult.java
Java
apache-2.0
609
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package king.flow.common; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import java.io.File; import java.nio.charset.Charset; import java.util.List; import java.util.Map; import java.util.concurrent.TimeUnit; import king.flow.action.business.ShowClockAction; import king.flow.data.TLSResult; import king.flow.view.Action; import king.flow.view.Action.CleanAction; import king.flow.view.Action.EjectCardAction; import king.flow.view.Action.WithdrawCardAction; import king.flow.view.Action.EncryptKeyboardAction; import king.flow.view.Action.HideAction; import king.flow.view.Action.InsertICardAction; import king.flow.view.Action.LimitInputAction; import king.flow.view.Action.MoveCursorAction; import king.flow.view.Action.NumericPadAction; import king.flow.view.Action.OpenBrowserAction; import king.flow.view.Action.PlayMediaAction; import king.flow.view.Action.PlayVideoAction; import king.flow.view.Action.PrintPassbookAction; import king.flow.view.Action.RunCommandAction; import king.flow.view.Action.RwFingerPrintAction; import king.flow.view.Action.SetFontAction; import king.flow.view.Action.SetPrinterAction; import king.flow.view.Action.ShowComboBoxAction; import king.flow.view.Action.ShowGridAction; import king.flow.view.Action.ShowTableAction; import king.flow.view.Action.Swipe2In1CardAction; import king.flow.view.Action.SwipeCardAction; import king.flow.view.Action.UploadFileAction; import king.flow.view.Action.UseTipAction; import king.flow.view.Action.VirtualKeyboardAction; import king.flow.view.Action.WriteICardAction; import king.flow.view.ComponentEnum; import king.flow.view.DefinedAction; import king.flow.view.DeviceEnum; import king.flow.view.JumpAction; import king.flow.view.MsgSendAction; /** * * @author LiuJin */ public class CommonConstants { public static final String APP_STARTUP_ENTRY = "bank.exe"; public static final Charset UTF8 = Charset.forName("UTF-8"); static final File[] SYS_ROOTS = File.listRoots(); public static final int DRIVER_COUNT = SYS_ROOTS.length; public static final String XML_NODE_PREFIX = "N_"; public static final String REVERT = "re_"; public static final String BID = "bid"; public static final String UID_PREFIX = "<" + TLSResult.UID + ">"; public static final String UID_AFFIX = "</" + TLSResult.UID + ">"; public static final String DEFAULT_DATE_FORMATE = "yyyy-MM-dd"; public static final String VALID_BANK_CARD = "validBankCard"; public static final String BALANCED_PAY_MAC = "balancedPayMAC"; public static final String CANCEL_ENCRYPTION_KEYBOARD = "[CANCEL]"; public static final String QUIT_ENCRYPTION_KEYBOARD = "[QUIT]"; public static final String INVALID_ENCRYPTION_LENGTH = "encryption.keyboard.type.length.prompt"; public static final String TIMEOUT_ENCRYPTION_TYPE = "encryption.keyboard.type.timeout.prompt"; public static final String ERROR_ENCRYPTION_TYPE = "encryption.keyboard.type.fail.prompt"; public static final int CONTAINER_KEY = Integer.MAX_VALUE; public static final int NORMAL = 0; public static final int ABNORMAL = 1; public static final int BALANCE = 12345; public static final int RESTART_SIGNAL = 1; public static final int DOWNLOAD_KEY_SIGNAL = 1; public static final int UPDATE_SIGNAL = 1; public static final int WATCHDOG_CHECK_INTERVAL = 5; public static final String VERSION; public static final long DEBUG_MODE_PROGRESS_TIME = TimeUnit.SECONDS.toMillis(3); public static final long RUN_MODE_PROGRESS_TIME = TimeUnit.SECONDS.toMillis(1); // public static final String VERSION = Paths.get(".").toAbsolutePath().normalize().toString(); static { String workingPath = System.getProperty("user.dir"); final int lastIndexOf = workingPath.lastIndexOf('_'); if (lastIndexOf != -1 && lastIndexOf < workingPath.length() - 1) { VERSION = workingPath.substring(lastIndexOf + 1); } else { VERSION = "Unknown"; } } /* JMX configuration */ private static String getJmxRmiUrl(int port) { return "service:jmx:rmi:///jndi/rmi://localhost:" + port + "/jmxrmi"; } public static final int APP_JMX_RMI_PORT = 9998; public static final String APP_JMX_RMI_URL = getJmxRmiUrl(APP_JMX_RMI_PORT); public static final int WATCHDOG_JMX_RMI_PORT = 9999; public static final String WATCHDOG_JMX_RMI_URL = getJmxRmiUrl(WATCHDOG_JMX_RMI_PORT); /* system variable pattern */ public static final String SYSTEM_VAR_PATTERN = "\\$\\{(_?\\p{Alpha}+_\\p{Alpha}+)+\\}"; public static final String TEXT_MINGLED_SYSTEM_VAR_PATTERN = ".*" + SYSTEM_VAR_PATTERN + ".*"; public static final String TERMINAL_ID_SYS_VAR = "TERMINAL_ID"; /* swing default config */ public static final int DEFAULT_TABLE_ROW_COUNT = 15; public static final int TABLE_ROW_HEIGHT = 25; public static final int DEFAULT_VIDEO_REPLAY_INTERVAL_SECOND = 20; /* packet header ID */ public static final int GENERAL_MSG_CODE = 0; //common message public static final int REGISTRY_MSG_CODE = 1; //terminal registration message public static final int KEY_DOWNLOAD_MSG_CODE = 2; //download secret key message public static final int MANAGER_MSG_CODE = 100; //management message /*MAX_MESSAGES_PER_READ refers to DefaultChannelConfig, AdaptiveRecvByteBufAllocator, FixedRecvByteBufAllocator */ public static final int MAX_MESSAGES_PER_READ = 64; //how many read actions in one message conversation public static final int MIN_RECEIVED_BUFFER_SIZE = 1024; //1024 bytes public static final int RECEIVED_BUFFER_SIZE = 32 * 1024; //32k bytes public static final int MAX_RECEIVED_BUFFER_SIZE = 64 * 1024; //64k bytes /* keyboard cipher key */ public static final String WORK_SECRET_KEY = "workSecretKey"; public static final String MA_KEY = "maKey"; public static final String MASTER_KEY = "masterKey"; /* packet result flag */ public static final int SUCCESSFUL_MSG_CODE = 0; /* xml jaxb context */ public static final String NET_CONF_PACKAGE_CONTEXT = "king.flow.net"; public static final String TLS_PACKAGE_CONTEXT = "king.flow.data"; public static final String UI_CONF_PACKAGE_CONTEXT = "king.flow.view"; public static final String KING_FLOW_BACKGROUND = "king.flow.background"; public static final String KING_FLOW_PROGRESS = "king.flow.progress"; public static final String TEXT_TYPE_TOOL_CONFIG = "chinese.text.type.config"; public static final String COMBOBOX_ITEMS_PROPERTY_PATTERN = "([^,/]*/[^,/]*,)*+([^,/]*/[^,/]*){1}+"; public static final String ADVANCED_TABLE_TOTAL_PAGES = "total"; public static final String ADVANCED_TABLE_VALUE = "value"; public static final String ADVANCED_TABLE_CURRENT_PAGE = "current"; /* card-reading state */ public static final int INVALID_CARD_STATE = -1; public static final int MAGNET_CARD_STATE = 2; public static final int IC_CARD_STATE = 3; /* union-pay transaction type */ public static final String UNION_PAY_REGISTRATION = "1"; public static final String UNION_PAY_TRANSACTION = "3"; public static final String UNION_PAY_TRANSACTION_BALANCE = "4"; /* card affiliation type */ public static final String CARD_AFFILIATION_INTERNAL = "1"; public static final String CARD_AFFILIATION_EXTERNAL = "2"; /* supported driver types */ static final ImmutableSet<DeviceEnum> SUPPORTED_DEVICES = new ImmutableSet.Builder<DeviceEnum>() .add(DeviceEnum.IC_CARD) .add(DeviceEnum.CASH_SAVER) .add(DeviceEnum.GZ_CARD) .add(DeviceEnum.HIS_CARD) .add(DeviceEnum.KEYBOARD) .add(DeviceEnum.MAGNET_CARD) .add(DeviceEnum.MEDICARE_CARD) .add(DeviceEnum.PATIENT_CARD) .add(DeviceEnum.PID_CARD) .add(DeviceEnum.PKG_8583) .add(DeviceEnum.PRINTER) .add(DeviceEnum.SENSOR_CARD) .add(DeviceEnum.TWO_IN_ONE_CARD) .build(); /* action-component relationship map */ public static final String JUMP_ACTION = JumpAction.class.getSimpleName(); public static final String SET_FONT_ACTION = SetFontAction.class.getSimpleName(); public static final String CLEAN_ACTION = CleanAction.class.getSimpleName(); public static final String HIDE_ACTION = HideAction.class.getSimpleName(); public static final String USE_TIP_ACTION = UseTipAction.class.getSimpleName(); public static final String PLAY_MEDIA_ACTION = PlayMediaAction.class.getSimpleName(); public static final String SEND_MSG_ACTION = MsgSendAction.class.getSimpleName(); public static final String MOVE_CURSOR_ACTION = MoveCursorAction.class.getSimpleName(); public static final String LIMIT_INPUT_ACTION = LimitInputAction.class.getSimpleName(); public static final String SHOW_COMBOBOX_ACTION = ShowComboBoxAction.class.getSimpleName(); public static final String SHOW_TABLE_ACTION = ShowTableAction.class.getSimpleName(); public static final String SHOW_CLOCK_ACTION = ShowClockAction.class.getSimpleName(); public static final String OPEN_BROWSER_ACTION = OpenBrowserAction.class.getSimpleName(); public static final String RUN_COMMAND_ACTION = RunCommandAction.class.getSimpleName(); public static final String OPEN_VIRTUAL_KEYBOARD_ACTION = VirtualKeyboardAction.class.getSimpleName(); public static final String PRINT_RECEIPT_ACTION = SetPrinterAction.class.getSimpleName(); public static final String INSERT_IC_ACTION = InsertICardAction.class.getSimpleName(); public static final String WRITE_IC_ACTION = WriteICardAction.class.getSimpleName(); public static final String BALANCE_TRANS_ACTION = "BalanceTransAction"; public static final String PRINT_PASSBOOK_ACTION = PrintPassbookAction.class.getSimpleName(); public static final String UPLOAD_FILE_ACTION = UploadFileAction.class.getSimpleName(); public static final String SWIPE_CARD_ACTION = SwipeCardAction.class.getSimpleName(); public static final String SWIPE_TWO_IN_ONE_CARD_ACTION = Swipe2In1CardAction.class.getSimpleName(); public static final String EJECT_CARD_ACTION = EjectCardAction.class.getSimpleName(); public static final String WITHDRAW_CARD_ACTION = WithdrawCardAction.class.getSimpleName(); public static final String READ_WRITE_FINGERPRINT_ACTION = RwFingerPrintAction.class.getSimpleName(); public static final String PLAY_VIDEO_ACTION = PlayVideoAction.class.getSimpleName(); public static final String CUSTOMIZED_ACTION = DefinedAction.class.getSimpleName(); public static final String ENCRYPT_KEYBORAD_ACTION = EncryptKeyboardAction.class.getSimpleName(); public static final String SHOW_GRID_ACTION = ShowGridAction.class.getSimpleName(); public static final String TYPE_NUMERIC_PAD_ACTION = NumericPadAction.class.getSimpleName(); public static final String WEB_LOAD_ACTION = Action.WebLoadAction.class.getSimpleName(); static final Map<ComponentEnum, List<String>> ACTION_COMPONENT_MAP = new ImmutableMap.Builder<ComponentEnum, List<String>>() .put(ComponentEnum.BUTTON, new ImmutableList.Builder<String>() .add(CUSTOMIZED_ACTION) .add(JUMP_ACTION) .add(SET_FONT_ACTION) .add(CLEAN_ACTION) .add(HIDE_ACTION) .add(USE_TIP_ACTION) .add(PLAY_MEDIA_ACTION) .add(OPEN_BROWSER_ACTION) .add(RUN_COMMAND_ACTION) .add(OPEN_VIRTUAL_KEYBOARD_ACTION) .add(PRINT_RECEIPT_ACTION) .add(SEND_MSG_ACTION) .add(INSERT_IC_ACTION) .add(WRITE_IC_ACTION) .add(MOVE_CURSOR_ACTION) .add(PRINT_PASSBOOK_ACTION) .add(UPLOAD_FILE_ACTION) .add(BALANCE_TRANS_ACTION) .add(EJECT_CARD_ACTION) .add(WITHDRAW_CARD_ACTION) .add(WEB_LOAD_ACTION) .build()) .put(ComponentEnum.COMBO_BOX, new ImmutableList.Builder<String>() .add(CUSTOMIZED_ACTION) .add(SET_FONT_ACTION) .add(USE_TIP_ACTION) .add(SHOW_COMBOBOX_ACTION) .add(SWIPE_CARD_ACTION) .add(SWIPE_TWO_IN_ONE_CARD_ACTION) .add(PLAY_MEDIA_ACTION) .add(MOVE_CURSOR_ACTION) .build()) .put(ComponentEnum.LABEL, new ImmutableList.Builder<String>() .add(CUSTOMIZED_ACTION) .add(SET_FONT_ACTION) .add(USE_TIP_ACTION) .add(SHOW_CLOCK_ACTION) .build()) .put(ComponentEnum.TEXT_FIELD, new ImmutableList.Builder<String>() .add(CUSTOMIZED_ACTION) .add(SET_FONT_ACTION) .add(LIMIT_INPUT_ACTION) .add(USE_TIP_ACTION) .add(PLAY_MEDIA_ACTION) .add(READ_WRITE_FINGERPRINT_ACTION) .add(OPEN_VIRTUAL_KEYBOARD_ACTION) .add(MOVE_CURSOR_ACTION) .build()) .put(ComponentEnum.PASSWORD_FIELD, new ImmutableList.Builder<String>() .add(CUSTOMIZED_ACTION) .add(SET_FONT_ACTION) .add(LIMIT_INPUT_ACTION) .add(USE_TIP_ACTION) .add(PLAY_MEDIA_ACTION) .add(READ_WRITE_FINGERPRINT_ACTION) .add(MOVE_CURSOR_ACTION) .add(ENCRYPT_KEYBORAD_ACTION) .build()) .put(ComponentEnum.TABLE, new ImmutableList.Builder<String>() .add(CUSTOMIZED_ACTION) .add(SET_FONT_ACTION) .add(USE_TIP_ACTION) .add(SHOW_TABLE_ACTION) .build()) .put(ComponentEnum.ADVANCED_TABLE, new ImmutableList.Builder<String>() .add(CUSTOMIZED_ACTION) .add(SET_FONT_ACTION) .add(SHOW_TABLE_ACTION) .add(SEND_MSG_ACTION) .build()) .put(ComponentEnum.VIDEO_PLAYER, new ImmutableList.Builder<String>() .add(CUSTOMIZED_ACTION) .add(PLAY_VIDEO_ACTION) .build()) .put(ComponentEnum.GRID, new ImmutableList.Builder<String>() .add(SHOW_GRID_ACTION) .build()) .put(ComponentEnum.NUMERIC_PAD, new ImmutableList.Builder<String>() .add(TYPE_NUMERIC_PAD_ACTION) .build()) .build(); }
toyboxman/yummy-xml-UI
xml-UI/src/main/java/king/flow/common/CommonConstants.java
Java
apache-2.0
15,275
package ca.qc.bergeron.marcantoine.crammeur.android.repository.crud.sqlite; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import ca.qc.bergeron.marcantoine.crammeur.librairy.annotations.Entity; import ca.qc.bergeron.marcantoine.crammeur.librairy.exceptions.KeyException; import ca.qc.bergeron.marcantoine.crammeur.android.models.Client; import ca.qc.bergeron.marcantoine.crammeur.android.repository.crud.SQLiteTemplate; import ca.qc.bergeron.marcantoine.crammeur.librairy.repository.i.Repository; /** * Created by Marc-Antoine on 2017-01-11. */ public final class SQLiteClient extends SQLiteTemplate<Client,Integer> implements ca.qc.bergeron.marcantoine.crammeur.android.repository.crud.sqlite.i.SQLiteClient { public SQLiteClient(Repository pRepository, Context context) { super(Client.class,Integer.class,pRepository, context); } @Override protected Client convertCursorToEntity(@NonNull Cursor pCursor) { Client o = new Client(); o.Id = pCursor.getInt(pCursor.getColumnIndex(mId.getAnnotation(Entity.Id.class).name())); o.Name = pCursor.getString(pCursor.getColumnIndex(F_CLIENT_NAME)); o.EMail = pCursor.getString(pCursor.getColumnIndex(F_CLIENT_EMAIL)); return o; } @Override protected Integer convertCursorToId(@NonNull Cursor pCursor) { Integer result; result = pCursor.getInt(pCursor.getColumnIndex(mId.getAnnotation(Entity.Id.class).name())); return result; } @Override public void create() { mDB.execSQL(CREATE_TABLE_CLIENTS); } @NonNull @Override public Integer save(@NonNull Client pData) throws KeyException { ContentValues values = new ContentValues(); try { if (pData.Id == null) { pData.Id = this.getKey(pData); } values.put(mId.getAnnotation(Entity.Id.class).name(), mKey.cast(mId.get(pData))); values.put(F_CLIENT_NAME, pData.Name); values.put(F_CLIENT_EMAIL, pData.EMail); if (mId.get(pData) == null || !this.contains(mKey.cast(mId.get(pData)))) { mId.set(pData, (int) mDB.insert(T_CLIENTS, null, values)); } else { mDB.update(T_CLIENTS, values, mId.getAnnotation(Entity.Id.class).name() + "=?", new String[]{String.valueOf(pData.Id)}); } return pData.Id; } catch (IllegalAccessException e) { e.printStackTrace(); throw new RuntimeException(e); } } @Nullable @Override public Integer getKey(@NonNull Client pEntity) { Integer result = null; try { if (mId.get(pEntity) != null) return (Integer) mId.get(pEntity); String[] columns = new String[] {F_ID}; String where = "LOWER(" + F_CLIENT_NAME + ")=LOWER(?) AND LOWER(" + F_CLIENT_EMAIL + ")=LOWER(?)"; String[] whereArgs = new String[] {pEntity.Name,pEntity.EMail}; // limit 1 row = "1"; Cursor cursor = mDB.query(T_CLIENTS, columns, where, whereArgs, null, null, null, "1"); if (cursor.moveToFirst()) { result = cursor.getInt(cursor.getColumnIndex(F_ID)); } } catch (IllegalAccessException e) { e.printStackTrace(); throw new RuntimeException(e); } return result; } }
crammeur/MyInvoices
crammeurAndroid/src/main/java/ca/qc/bergeron/marcantoine/crammeur/android/repository/crud/sqlite/SQLiteClient.java
Java
apache-2.0
3,537
/** * @license AngularJS v1.3.0-build.2690+sha.be7c02c * (c) 2010-2014 Google, Inc. http://angularjs.org * License: MIT */ (function(window, angular, undefined) {'use strict'; /** * @ngdoc module * @name ngCookies * @description * * # ngCookies * * The `ngCookies` module provides a convenient wrapper for reading and writing browser cookies. * * * <div doc-module-components="ngCookies"></div> * * See {@link ngCookies.$cookies `$cookies`} and * {@link ngCookies.$cookieStore `$cookieStore`} for usage. */ angular.module('ngCookies', ['ng']). /** * @ngdoc service * @name $cookies * * @description * Provides read/write access to browser's cookies. * * Only a simple Object is exposed and by adding or removing properties to/from this object, new * cookies are created/deleted at the end of current $eval. * The object's properties can only be strings. * * Requires the {@link ngCookies `ngCookies`} module to be installed. * * @example * * ```js * function ExampleController($cookies) { * // Retrieving a cookie * var favoriteCookie = $cookies.myFavorite; * // Setting a cookie * $cookies.myFavorite = 'oatmeal'; * } * ``` */ factory('$cookies', ['$rootScope', '$browser', function ($rootScope, $browser) { var cookies = {}, lastCookies = {}, lastBrowserCookies, runEval = false, copy = angular.copy, isUndefined = angular.isUndefined; //creates a poller fn that copies all cookies from the $browser to service & inits the service $browser.addPollFn(function() { var currentCookies = $browser.cookies(); if (lastBrowserCookies != currentCookies) { //relies on browser.cookies() impl lastBrowserCookies = currentCookies; copy(currentCookies, lastCookies); copy(currentCookies, cookies); if (runEval) $rootScope.$apply(); } })(); runEval = true; //at the end of each eval, push cookies //TODO: this should happen before the "delayed" watches fire, because if some cookies are not // strings or browser refuses to store some cookies, we update the model in the push fn. $rootScope.$watch(push); return cookies; /** * Pushes all the cookies from the service to the browser and verifies if all cookies were * stored. */ function push() { var name, value, browserCookies, updated; //delete any cookies deleted in $cookies for (name in lastCookies) { if (isUndefined(cookies[name])) { $browser.cookies(name, undefined); } } //update all cookies updated in $cookies for(name in cookies) { value = cookies[name]; if (!angular.isString(value)) { value = '' + value; cookies[name] = value; } if (value !== lastCookies[name]) { $browser.cookies(name, value); updated = true; } } //verify what was actually stored if (updated){ updated = false; browserCookies = $browser.cookies(); for (name in cookies) { if (cookies[name] !== browserCookies[name]) { //delete or reset all cookies that the browser dropped from $cookies if (isUndefined(browserCookies[name])) { delete cookies[name]; } else { cookies[name] = browserCookies[name]; } updated = true; } } } } }]). /** * @ngdoc service * @name $cookieStore * @requires $cookies * * @description * Provides a key-value (string-object) storage, that is backed by session cookies. * Objects put or retrieved from this storage are automatically serialized or * deserialized by angular's toJson/fromJson. * * Requires the {@link ngCookies `ngCookies`} module to be installed. * * @example * * ```js * function ExampleController($cookieStore) { * // Put cookie * $cookieStore.put('myFavorite','oatmeal'); * // Get cookie * var favoriteCookie = $cookieStore.get('myFavorite'); * // Removing a cookie * $cookieStore.remove('myFavorite'); * } * ``` */ factory('$cookieStore', ['$cookies', function($cookies) { return { /** * @ngdoc method * @name $cookieStore#get * * @description * Returns the value of given cookie key * * @param {string} key Id to use for lookup. * @returns {Object} Deserialized cookie value. */ get: function(key) { var value = $cookies[key]; return value ? angular.fromJson(value) : value; }, /** * @ngdoc method * @name $cookieStore#put * * @description * Sets a value for given cookie key * * @param {string} key Id for the `value`. * @param {Object} value Value to be stored. */ put: function(key, value) { $cookies[key] = angular.toJson(value); }, /** * @ngdoc method * @name $cookieStore#remove * * @description * Remove given cookie * * @param {string} key Id of the key-value pair to delete. */ remove: function(key) { delete $cookies[key]; } }; }]); })(window, window.angular);
yawo/pepeto
code/client/js/node_modules/bower_components/angular-cookies/angular-cookies.js
JavaScript
apache-2.0
5,642
/* -------------------------------------------------------------------------- * * Simbody(tm): SimTKmath * * -------------------------------------------------------------------------- * * This is part of the SimTK biosimulation toolkit originating from * * Simbios, the NIH National Center for Physics-Based Simulation of * * Biological Structures at Stanford, funded under the NIH Roadmap for * * Medical Research, grant U54 GM072970. See https://simtk.org/home/simbody. * * * * Portions copyright (c) 2010-13 Stanford University and the Authors. * * Authors: Peter Eastman, Michael Sherman * * Contributors: * * * * Licensed under the Apache License, Version 2.0 (the "License"); you may * * not use this file except in compliance with the License. You may obtain a * * copy of the License at http://www.apache.org/licenses/LICENSE-2.0. * * * * Unless required by applicable law or agreed to in writing, software * * distributed under the License is distributed on an "AS IS" BASIS, * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * * See the License for the specific language governing permissions and * * limitations under the License. * * -------------------------------------------------------------------------- */ #include "SimTKmath.h" #include <algorithm> using std::pair; using std::make_pair; #include <iostream> using std::cout; using std::endl; #include <set> // Define this if you want to see voluminous output from MPR (XenoCollide) //#define MPR_DEBUG namespace SimTK { //============================================================================== // CONTACT TRACKER //============================================================================== //------------------------------------------------------------------------------ // ESTIMATE IMPLICIT PAIR CONTACT USING MPR //------------------------------------------------------------------------------ // Generate a rough guess at the contact points. Point P is returned in A's // frame and point Q is in B's frame, but all the work here is done in frame A. // See Snethen, G. "XenoCollide: Complex Collision Made Simple", Game // Programming Gems 7, pp.165-178. // // Note that we intend to use this on smooth convex objects. That means there // can be no guarantee about how many iterations this will take to converge; it // may take a very long time for objects that are just barely touching. On the // other hand we only need an approximate answer because we're going to polish // the solution to machine precision using a Newton iteration afterwards. namespace { // Given a direction in shape A's frame, calculate the support point of the // Minkowski difference shape A-B in that direction. To do that we find A's // support point P in that direction, and B's support point Q in the opposite // direction; i.e. what would be -B's support in the original direction. Then // return the vector v=(P-Q) expressed in A's frame. struct Support { Support(const ContactGeometry& shapeA, const ContactGeometry& shapeB, const Transform& X_AB, const UnitVec3& dirInA) : shapeA(shapeA), shapeB(shapeB), X_AB(X_AB) { computeSupport(dirInA); } // Calculate a new set of supports for the same shapes. void computeSupport(const UnitVec3& dirInA) { const UnitVec3 dirInB = ~X_AB.R() * dirInA; // 15 flops dir = dirInA; A = shapeA.calcSupportPoint( dirInA); // varies; 40 flops for ellipsoid B = shapeB.calcSupportPoint(-dirInB); // " v = A - X_AB*B; // 21 flops depth = dot(v,dir); // 5 flops } Support& operator=(const Support& src) { dir = src.dir; A = src.A; B = src.B; v = src.v; return *this; } void swap(Support& other) { std::swap(dir, other.dir); std::swap(A,other.A); std::swap(B,other.B); std::swap(v,other.v); } void getResult(Vec3& pointP_A, Vec3& pointQ_B, UnitVec3& normalInA) const { pointP_A = A; pointQ_B = B; normalInA = dir; } UnitVec3 dir; // A support direction, exp in A Vec3 A; // support point in direction dir on shapeA, expressed in A Vec3 B; // support point in direction -dir on shapeB, expressed in B Vec3 v; // support point A-B in Minkowski difference shape, exp. in A Real depth; // v . dir (positive when origin is below support plane) private: const ContactGeometry& shapeA; const ContactGeometry& shapeB; const Transform& X_AB; }; const Real MPRAccuracy = Real(.05); // 5% of the surface dimensions const Real SqrtMPRAccuracy = Real(.2236); // roughly sqrt(MPRAccuracy) } /*static*/ bool ContactTracker:: estimateConvexImplicitPairContactUsingMPR (const ContactGeometry& shapeA, const ContactGeometry& shapeB, const Transform& X_AB, Vec3& pointP, Vec3& pointQ, UnitVec3& dirInA, int& numIterations) { const Rotation& R_AB = X_AB.R(); numIterations = 0; // Get some cheap, rough scaling information. // TODO: ideally this would be done using local curvature information. // A reasonable alternative would be to use the smallest dimension of the // shape's oriented bounding box. // We're going to assume the smallest radius is 1/4 of the bounding // sphere radius. Vec3 cA, cB; Real rA, rB; shapeA.getBoundingSphere(cA,rA); shapeB.getBoundingSphere(cB,rB); const Real lengthScale = Real(0.25)*std::min(rA,rB); const Real areaScale = Real(1.5)*square(lengthScale); // ~area of octant // If we determine the depth to within a small fraction of the scale, // or localize the contact area to a small fraction of the surface area, // that is good enough and we can stop. const Real depthGoal = MPRAccuracy*lengthScale; const Real areaGoal = SqrtMPRAccuracy*areaScale; #ifdef MPR_DEBUG printf("\nMPR acc=%g: r=%g, depthGoal=%g areaGoal=%g\n", MPRAccuracy, std::min(rA,rB), depthGoal, areaGoal); #endif // Phase 1: Portal Discovery // ------------------------- // Compute an interior point v0 that is known to be inside the Minkowski // difference, and a ray dir1 directed from that point to the origin. const Vec3 v0 = ( Support(shapeA, shapeB, X_AB, UnitVec3( XAxis)).v + Support(shapeA, shapeB, X_AB, UnitVec3(-XAxis)).v)/2; if (v0 == 0) { // This is a pathological case: the two objects are directly on top of // each other with their centers at exactly the same place. Just // return *some* vaguely plausible contact. pointP = shapeA.calcSupportPoint( UnitVec3( XAxis)); pointQ = shapeB.calcSupportPoint(~R_AB*UnitVec3(-XAxis)); // in B dirInA = XAxis; return true; } // Support 1's direction is initially the "origin ray" that points from // interior point v0 to the origin. Support s1(shapeA, shapeB, X_AB, UnitVec3(-v0)); // Test for NaN once and get out to avoid getting stuck in loops below. if (isNaN(s1.depth)) { pointP = pointQ = NaN; dirInA = UnitVec3(); return false; } if (s1.depth <= 0) { // origin outside 1st support plane s1.getResult(pointP, pointQ, dirInA); return false; } if (s1.v % v0 == 0) { // v0 perpendicular to support plane; origin inside s1.getResult(pointP, pointQ, dirInA); return true; } // Find support point perpendicular to plane containing origin, interior // point v0, and first support v1. Support s2(shapeA, shapeB, X_AB, UnitVec3(s1.v % v0)); if (s2.depth <= 0) { // origin is outside 2nd support plane s2.getResult(pointP, pointQ, dirInA); return false; } // Find support perpendicular to plane containing interior point v0 and // first two support points v1 and v2. Make sure it is on the side that // is closer to the origin; fix point ordering if necessary. UnitVec3 d3 = UnitVec3((s1.v-v0)%(s2.v-v0)); if (~d3*v0 > 0) { // oops -- picked the wrong side s1.swap(s2); d3 = -d3; } Support s3(shapeA, shapeB, X_AB, d3); if (s3.depth <= 0) { // origin is outside 3rd support plane s3.getResult(pointP, pointQ, dirInA); return false; } // We now have a candidate portal (triangle v1,v2,v3). We have to refine it // until the origin ray -v0 intersects the candidate. Check against the // three planes of the tetrahedron that contain v0. By construction above // we know the origin is inside the v0,v1,v2 face already. // We should find a candidate portal very fast, probably in 1 or 2 // iterations. We'll allow an absurdly large number of // iterations and then abort just to make sure we don't get stuck in an // infinite loop. const Real MaxCandidateIters = 100; // should never get anywhere near this int candidateIters = 0; while (true) { ++candidateIters; SimTK_ERRCHK_ALWAYS(candidateIters <= MaxCandidateIters, "ContactTracker::estimateConvexImplicitPairContactUsingMPR()", "Unable to find a candidate portal; should never happen."); if (~v0*(s1.v % s3.v) < -SignificantReal) s2 = s3; // origin outside v0,v1,v3 face; replace v2 else if (~v0*(s3.v % s2.v) < -SignificantReal) s1 = s3; // origin outside v0,v2,v3 face; replace v1 else break; // Choose new candidate. The keepers are in v1 and v2; get a new v3. s3.computeSupport(UnitVec3((s1.v-v0) % (s2.v-v0))); } // Phase 2: Portal Refinement // -------------------------- // We have a portal (triangle v1,v2,v3) that the origin ray passes through. // Now we need to refine v1,v2,v3 until we have portal such that the origin // is inside the tetrahedron v0,v1,v2,v3. const int MinTriesToFindSeparatingPlane = 5; const int MaxTriesToImproveContact = 5; int triesToFindSeparatingPlane=0, triesToImproveContact=0; while (true) { ++numIterations; // Get the normal to the portal, oriented in the general direction of // the origin ray (i.e., the outward normal). const Vec3 portalVec = (s2.v-s1.v) % (s3.v-s1.v); const Real portalArea = portalVec.norm(), ooPortalArea = 1/portalArea; UnitVec3 portalDir(portalVec*ooPortalArea, true); if (~portalDir*v0 > 0) portalDir = -portalDir; // Any portal vertex is a vector from the origin to the portal plane. // Dot one of them with the portal outward normal to get the origin // depth (positive if inside). const Real depth = ~s1.v*portalDir; // Find new support in portal direction. Support s4(shapeA, shapeB, X_AB, portalDir); if (s4.depth <= 0) { // origin is outside new support plane s4.getResult(pointP, pointQ, dirInA); return false; } const Real depthChange = std::abs(s4.depth - depth); bool mustReturn=false, okToReturn=false; if (depth >= 0) { // We found a contact. mustReturn = (++triesToImproveContact >= MaxTriesToImproveContact); okToReturn = true; } else { // No contact yet. okToReturn = (++triesToFindSeparatingPlane >= MinTriesToFindSeparatingPlane); mustReturn = false; } bool accuracyAchieved = (depthChange <= depthGoal || portalArea <= areaGoal); #ifdef MPR_DEBUG printf(" depth=%g, change=%g area=%g changeFrac=%g areaFrac=%g\n", depth, depthChange, portalArea, depthChange/depthGoal, portalArea/areaGoal); printf(" accuracyAchieved=%d okToReturn=%d mustReturn=%d\n", accuracyAchieved, okToReturn, mustReturn); #endif if (mustReturn || (okToReturn && accuracyAchieved)) { // The origin is inside the portal, so we have an intersection. // Compute the barycentric coordinates of the origin ray's // intersection with the portal, and map back to the two surfaces. const Vec3 origin = v0+v0*(~portalDir*(s1.v-v0)/(~portalDir*v0)); const Real area1 = ~portalDir*((s2.v-origin)%(s3.v-origin)); const Real area2 = ~portalDir*((s3.v-origin)%(s1.v-origin)); const Real u = area1*ooPortalArea; const Real v = area2*ooPortalArea; const Real w = 1-u-v; // Compute the contact points in their own shape's frame. pointP = u*s1.A + v*s2.A + w*s3.A; pointQ = u*s1.B + v*s2.B + w*s3.B; dirInA = portalDir; return true; } // We know the origin ray entered the (v1,v2,v3,v4) tetrahedron via the // (v1,v2,v3) face (the portal). New portal is the face that it exits. const Vec3 v4v0 = s4.v % v0; if (~s1.v * v4v0 > 0) { if (~s2.v * v4v0 > 0) s1 = s4; // v4,v2,v3 (new portal) else s3 = s4; // v1,v2,v4 } else { if (~s3.v * v4v0 > 0) s2 = s4; // v1,v4,v3 else s1 = s4; // v4,v2,v3 again } } } //------------------------------------------------------------------------------ // REFINE IMPLICIT PAIR //------------------------------------------------------------------------------ // We have a rough estimate of the contact points. Use Newton iteration to // refine them. If the surfaces are separated, this will find the points of // closest approach. If contacting, this will find the points of maximium // penetration. // Returns true if the desired accuracy is achieved, regardless of whether the // surfaces are separated or in contact. /*static*/ bool ContactTracker:: refineImplicitPair (const ContactGeometry& shapeA, Vec3& pointP, // in/out (in A) const ContactGeometry& shapeB, Vec3& pointQ, // in/out (in B) const Transform& X_AB, Real accuracyRequested, Real& accuracyAchieved, int& numIterations) { // If the initial guess is very bad, or the ellipsoids pathological we // may have to crawl along for a while at the beginning. const int MaxSlowIterations = 8; const int MaxIterations = MaxSlowIterations + 8; const Real MinStepFrac = Real(1e-6); // if we can't take at least this // fraction of Newton step, give it up Vec6 err = findImplicitPairError(shapeA, pointP, shapeB, pointQ, X_AB); accuracyAchieved = err.norm(); Vector errVec(6, &err[0], true); // share space with err Mat66 J; // to hold the Jacobian Matrix JMat(6,6,6,&J(0,0)); // share space with J Vec6 delta; Vector deltaVec(6, &delta[0], true); // share space with delta numIterations = 0; while ( accuracyAchieved > accuracyRequested && numIterations < MaxIterations) { ++numIterations; J = calcImplicitPairJacobian(shapeA, pointP, shapeB, pointQ, X_AB, err); // Try to use LU factorization; fall back to QTZ if singular. FactorLU lu(JMat); if (!lu.isSingular()) lu.solve(errVec, deltaVec); // writes into delta also else { FactorQTZ qtz(JMat, SqrtEps); qtz.solve(errVec, deltaVec); // writes into delta also } // Line search for safety in case starting guess bad. Don't accept // any move that makes things worse. Real f = 2; // scale back factor Vec3 oldP = pointP, oldQ = pointQ; Real oldAccuracyAchieved = accuracyAchieved; do { f /= 2; pointP = oldP - f*delta.getSubVec<3>(0); pointQ = oldQ - f*delta.getSubVec<3>(3); err = findImplicitPairError(shapeA, pointP, shapeB, pointQ, X_AB); accuracyAchieved = err.norm(); } while (accuracyAchieved > oldAccuracyAchieved && f > MinStepFrac); const bool noProgressMade = (accuracyAchieved > oldAccuracyAchieved); if (noProgressMade) { // Restore best points and fall through. pointP = oldP; pointQ = oldQ; } if ( noProgressMade || (f < 1 && numIterations >= MaxSlowIterations)) // Too slow. { // We don't appear to be getting anywhere. Just project the // points onto the surfaces and then exit. bool inside; UnitVec3 normal; pointP = shapeA.findNearestPoint(pointP, inside, normal); pointQ = shapeB.findNearestPoint(pointQ, inside, normal); err = findImplicitPairError(shapeA, pointP, shapeB, pointQ, X_AB); accuracyAchieved = err.norm(); break; } } return accuracyAchieved <= accuracyRequested; } //------------------------------------------------------------------------------ // FIND IMPLICIT PAIR ERROR //------------------------------------------------------------------------------ // We're given two implicitly-defined shapes A and B and candidate surface // contact points P (for A) and Q (for B). There are six equations that real // contact points should satisfy. Here we return the errors in each of those // equations; if all six terms are zero these are contact points. // // Per profiling, this gets called a lot at runtime, so keep it tight! /*static*/ Vec6 ContactTracker:: findImplicitPairError (const ContactGeometry& shapeA, const Vec3& pointP, // in A const ContactGeometry& shapeB, const Vec3& pointQ, // in B const Transform& X_AB) { // Compute the function value and normal vector for each object. const Function& fA = shapeA.getImplicitFunction(); const Function& fB = shapeB.getImplicitFunction(); // Avoid some heap allocations by using stack arrays. Vec3 xData; Vector x(3, &xData[0], true); // shares space with xdata int compData; // just one integer ArrayView_<int> components(&compData, &compData+1); Vec3 gradA, gradB; xData = pointP; // writes into Vector x also for (int i = 0; i < 3; i++) { components[0] = i; gradA[i] = fA.calcDerivative(components, x); } Real errorA = fA.calcValue(x); xData = pointQ; // writes into Vector x also for (int i = 0; i < 3; i++) { components[0] = i; gradB[i] = fB.calcDerivative(components, x); } Real errorB = fB.calcValue(x); // Construct a coordinate frame for each object. // TODO: this needs some work to make sure it is as stable as possible // so the perpendicularity errors are stable as the solution advances // and especially as the Jacobian is calculated by perturbation. UnitVec3 nA(-gradA); UnitVec3 nB(X_AB.R()*(-gradB)); UnitVec3 uA(std::abs(nA[0])>Real(0.5)? nA%Vec3(0, 1, 0) : nA%Vec3(1, 0, 0)); UnitVec3 uB(std::abs(nB[0])>Real(0.5)? nB%Vec3(0, 1, 0) : nB%Vec3(1, 0, 0)); Vec3 vA = nA%uA; // Already a unit vector, so we don't need to normalize it. Vec3 vB = nB%uB; // Compute the error vector. The components indicate, in order, that nA // must be perpendicular to both tangents of object B, that the separation // vector should be zero or perpendicular to the tangents of object A, and // that both points should be on their respective surfaces. Vec3 delta = pointP-X_AB*pointQ; return Vec6(~nA*uB, ~nA*vB, ~delta*uA, ~delta*vA, errorA, errorB); } //------------------------------------------------------------------------------ // CALC IMPLICIT PAIR JACOBIAN //------------------------------------------------------------------------------ // Differentiate the findImplicitPairError() with respect to changes in the // locations of points P and Q in their own surface frames. /*static*/ Mat66 ContactTracker::calcImplicitPairJacobian (const ContactGeometry& shapeA, const Vec3& pointP, const ContactGeometry& shapeB, const Vec3& pointQ, const Transform& X_AB, const Vec6& err0) { Real dt = SqrtEps; Vec3 d1 = dt*Vec3(1, 0, 0); Vec3 d2 = dt*Vec3(0, 1, 0); Vec3 d3 = dt*Vec3(0, 0, 1); Vec6 err1 = findImplicitPairError(shapeA, pointP+d1, shapeB, pointQ, X_AB) - err0; Vec6 err2 = findImplicitPairError(shapeA, pointP+d2, shapeB, pointQ, X_AB) - err0; Vec6 err3 = findImplicitPairError(shapeA, pointP+d3, shapeB, pointQ, X_AB) - err0; Vec6 err4 = findImplicitPairError(shapeA, pointP, shapeB, pointQ+d1, X_AB) - err0; Vec6 err5 = findImplicitPairError(shapeA, pointP, shapeB, pointQ+d2, X_AB) - err0; Vec6 err6 = findImplicitPairError(shapeA, pointP, shapeB, pointQ+d3, X_AB) - err0; return Mat66(err1, err2, err3, err4, err5, err6) / dt; // This is a Central Difference derivative (you should use a somewhat // larger dt in this case). However, I haven't seen any evidence that this // helps, even for some very eccentric ellipsoids. (sherm 20130408) //Vec6 err1 = findImplicitPairError(shapeA, pointP+d1, shapeB, pointQ, X_AB) // - findImplicitPairError(shapeA, pointP-d1, shapeB, pointQ, X_AB); //Vec6 err2 = findImplicitPairError(shapeA, pointP+d2, shapeB, pointQ, X_AB) // - findImplicitPairError(shapeA, pointP-d2, shapeB, pointQ, X_AB); //Vec6 err3 = findImplicitPairError(shapeA, pointP+d3, shapeB, pointQ, X_AB) // - findImplicitPairError(shapeA, pointP-d3, shapeB, pointQ, X_AB); //Vec6 err4 = findImplicitPairError(shapeA, pointP, shapeB, pointQ+d1, X_AB) // - findImplicitPairError(shapeA, pointP, shapeB, pointQ-d1, X_AB); //Vec6 err5 = findImplicitPairError(shapeA, pointP, shapeB, pointQ+d2, X_AB) // - findImplicitPairError(shapeA, pointP, shapeB, pointQ-d2, X_AB); //Vec6 err6 = findImplicitPairError(shapeA, pointP, shapeB, pointQ+d3, X_AB) // - findImplicitPairError(shapeA, pointP, shapeB, pointQ-d3, X_AB); //return Mat66(err1, err2, err3, err4, err5, err6) / (2*dt); } //============================================================================== // HALFSPACE-SPHERE CONTACT TRACKER //============================================================================== // Cost is 21 flops if no contact, 67 with contact. bool ContactTracker::HalfSpaceSphere::trackContact (const Contact& priorStatus, const Transform& X_GH, const ContactGeometry& geoHalfSpace, const Transform& X_GS, const ContactGeometry& geoSphere, Real cutoff, Contact& currentStatus) const { SimTK_ASSERT ( geoHalfSpace.getTypeId()==ContactGeometry::HalfSpace::classTypeId() && geoSphere.getTypeId()==ContactGeometry::Sphere::classTypeId(), "ContactTracker::HalfSpaceSphere::trackContact()"); // No need for an expensive dynamic cast here; we know what we have. const ContactGeometry::Sphere& sphere = ContactGeometry::Sphere::getAs(geoSphere); const Rotation R_HG = ~X_GH.R(); // inverse rotation; no flops // p_HC is vector from H origin to S's center C const Vec3 p_HC = R_HG*(X_GS.p() - X_GH.p()); // 18 flops // Calculate depth of sphere center C given that the halfspace occupies // all of x>0 space. const Real r = sphere.getRadius(); const Real depth = p_HC[0] + r; // 1 flop if (depth <= -cutoff) { // 2 flops currentStatus.clear(); // not touching return true; // successful return } // Calculate the rest of the X_HS transform as required by Contact. const Transform X_HS(R_HG*X_GS.R(), p_HC); // 45 flops const UnitVec3 normal_H(Vec3(-1,0,0), true); // 0 flops const Vec3 origin_H = Vec3(depth/2, p_HC[1], p_HC[2]); // 1 flop // The surfaces are contacting (or close enough to be interesting). // The sphere's radius is also the effective radius. currentStatus = CircularPointContact(priorStatus.getSurface1(), Infinity, priorStatus.getSurface2(), r, X_HS, r, depth, origin_H, normal_H); return true; // success } bool ContactTracker::HalfSpaceSphere::predictContact (const Contact& priorStatus, const Transform& X_GS1, const SpatialVec& V_GS1, const SpatialVec& A_GS1, const ContactGeometry& surface1, const Transform& X_GS2, const SpatialVec& V_GS2, const SpatialVec& A_GS2, const ContactGeometry& surface2, Real cutoff, Real intervalOfInterest, Contact& predictedStatus) const { SimTK_ASSERT_ALWAYS(!"implemented", "ContactTracker::HalfSpaceSphere::predictContact() not implemented yet."); return false; } bool ContactTracker::HalfSpaceSphere::initializeContact (const Transform& X_GS1, const SpatialVec& V_GS1, const ContactGeometry& surface1, const Transform& X_GS2, const SpatialVec& V_GS2, const ContactGeometry& surface2, Real cutoff, Real intervalOfInterest, Contact& contactStatus) const { SimTK_ASSERT_ALWAYS(!"implemented", "ContactTracker::HalfSpaceSphere::initializeContact() not implemented yet."); return false; } //============================================================================== // HALFSPACE-ELLIPSOID CONTACT TRACKER //============================================================================== // Cost is ~135 flops if no contact, ~425 with contact. // The contact point on the ellipsoid must be the unique point that has its // outward-facing normal in the opposite direction of the half space normal. // We can find that point very fast and see how far it is from the half // space surface. If it is close enough, we'll evaluate the curvatures at // that point in preparation for generating forces with Hertz theory. bool ContactTracker::HalfSpaceEllipsoid::trackContact (const Contact& priorStatus, const Transform& X_GH, const ContactGeometry& geoHalfSpace, const Transform& X_GE, const ContactGeometry& geoEllipsoid, Real cutoff, Contact& currentStatus) const { SimTK_ASSERT ( geoHalfSpace.getTypeId()==ContactGeometry::HalfSpace::classTypeId() && geoEllipsoid.getTypeId()==ContactGeometry::Ellipsoid::classTypeId(), "ContactTracker::HalfSpaceEllipsoid::trackContact()"); // No need for an expensive dynamic cast here; we know what we have. const ContactGeometry::Ellipsoid& ellipsoid = ContactGeometry::Ellipsoid::getAs(geoEllipsoid); // Our half space occupies the +x half so the normal is -x. const Transform X_HE = ~X_GH*X_GE; // 63 flops // Halfspace normal is -x, so the ellipsoid normal we're looking for is // in the half space's +x direction. const UnitVec3& n_E = (~X_HE.R()).x(); // halfspace normal in E const Vec3 Q_E = ellipsoid.findPointWithThisUnitNormal(n_E); // 40 flops const Vec3 Q_H = X_HE*Q_E; // Q measured from half space origin (18 flops) const Real depth = Q_H[0]; // x > 0 is penetrated if (depth <= -cutoff) { // 2 flops currentStatus.clear(); // not touching return true; // successful return } // The surfaces are contacting (or close enough to be interesting). // The ellipsoid's principal curvatures k at the contact point are also // the curvatures of the contact paraboloid since the half space doesn't // add anything interesting. Transform X_EQ; Vec2 k; ellipsoid.findParaboloidAtPointWithNormal(Q_E, n_E, X_EQ, k); // 220 flops // We have the contact paraboloid expressed in frame Q but Qz=n_E has the // wrong sign since we have to express it using the half space normal. // We have to end up with a right handed frame, so one of x or y has // to be negated too. (6 flops) Rotation& R_EQ = X_EQ.updR(); R_EQ.setRotationColFromUnitVecTrustMe(ZAxis, -R_EQ.z()); // changing X_EQ R_EQ.setRotationColFromUnitVecTrustMe(XAxis, -R_EQ.x()); // Now the frame is pointing in the right direction. Measure and express in // half plane frame, then shift origin to half way between contact point // Q on the undeformed ellipsoid and the corresponding contact point P // on the undeformed half plane surface. It's easier to do this shift // in H since it is in the -Hx direction. Transform X_HC = X_HE*X_EQ; X_HC.updP()[0] -= depth/2; // 65 flops currentStatus = EllipticalPointContact(priorStatus.getSurface1(), priorStatus.getSurface2(), X_HE, X_HC, k, depth); return true; // success } bool ContactTracker::HalfSpaceEllipsoid::predictContact (const Contact& priorStatus, const Transform& X_GS1, const SpatialVec& V_GS1, const SpatialVec& A_GS1, const ContactGeometry& surface1, const Transform& X_GS2, const SpatialVec& V_GS2, const SpatialVec& A_GS2, const ContactGeometry& surface2, Real cutoff, Real intervalOfInterest, Contact& predictedStatus) const { SimTK_ASSERT_ALWAYS(!"implemented", "ContactTracker::HalfSpaceEllipsoid::predictContact() not implemented yet."); return false; } bool ContactTracker::HalfSpaceEllipsoid::initializeContact (const Transform& X_GS1, const SpatialVec& V_GS1, const ContactGeometry& surface1, const Transform& X_GS2, const SpatialVec& V_GS2, const ContactGeometry& surface2, Real cutoff, Real intervalOfInterest, Contact& contactStatus) const { SimTK_ASSERT_ALWAYS(!"implemented", "ContactTracker::HalfSpaceEllipsoid::initializeContact() not implemented yet."); return false; } //============================================================================== // SPHERE-SPHERE CONTACT TRACKER //============================================================================== // Cost is 12 flops if no contact, 139 if contact bool ContactTracker::SphereSphere::trackContact (const Contact& priorStatus, const Transform& X_GS1, const ContactGeometry& geoSphere1, const Transform& X_GS2, const ContactGeometry& geoSphere2, Real cutoff, // 0 for contact Contact& currentStatus) const { SimTK_ASSERT ( geoSphere1.getTypeId()==ContactGeometry::Sphere::classTypeId() && geoSphere2.getTypeId()==ContactGeometry::Sphere::classTypeId(), "ContactTracker::SphereSphere::trackContact()"); // No need for an expensive dynamic casts here; we know what we have. const ContactGeometry::Sphere& sphere1 = ContactGeometry::Sphere::getAs(geoSphere1); const ContactGeometry::Sphere& sphere2 = ContactGeometry::Sphere::getAs(geoSphere2); currentStatus.clear(); // Find the vector from sphere center C1 to C2, expressed in G. const Vec3 p_12_G = X_GS2.p() - X_GS1.p(); // 3 flops const Real d2 = p_12_G.normSqr(); // 5 flops const Real r1 = sphere1.getRadius(); const Real r2 = sphere2.getRadius(); const Real rr = r1 + r2; // 1 flop // Quick check. If separated we can return nothing, unless we were // in contact last time in which case we have to return one last // Contact indicating that contact has been broken and by how much. if (d2 > square(rr+cutoff)) { // 3 flops if (!priorStatus.getContactId().isValid()) return true; // successful return: still separated const Real separation = std::sqrt(d2) - rr; // > cutoff, ~25 flops const Transform X_S1S2(~X_GS1.R()*X_GS2.R(), ~X_GS1.R()*p_12_G); // 60 flops currentStatus = BrokenContact(priorStatus.getSurface1(), priorStatus.getSurface2(), X_S1S2, separation); return true; } const Real d = std::sqrt(d2); // ~20 flops if (d < SignificantReal) { // 1 flop // TODO: If the centers are coincident we should use past information // to determine the most likely normal. For now just fail. return false; } const Transform X_S1S2(~X_GS1.R()*X_GS2.R(), ~X_GS1.R()*p_12_G);// 60 flops const Vec3& p_12 = X_S1S2.p(); // center-to-center vector in S1 const Real depth = rr - d; // >0 for penetration (1 flop) const Real r = r1*r2/rr; // r=r1r2/(r1+r2)=1/(1/r1+1/r2) ~20 flops const UnitVec3 normal_S1(p_12/d, true); // 1/ + 3* = ~20 flops const Vec3 origin_S1 = (r1 - depth/2)*normal_S1; // 5 flops // The surfaces are contacting (or close enough to be interesting). currentStatus = CircularPointContact(priorStatus.getSurface1(), r1, priorStatus.getSurface2(), r2, X_S1S2, r, depth, origin_S1, normal_S1); return true; // success } bool ContactTracker::SphereSphere::predictContact (const Contact& priorStatus, const Transform& X_GS1, const SpatialVec& V_GS1, const SpatialVec& A_GS1, const ContactGeometry& surface1, const Transform& X_GS2, const SpatialVec& V_GS2, const SpatialVec& A_GS2, const ContactGeometry& surface2, Real cutoff, Real intervalOfInterest, Contact& predictedStatus) const { SimTK_ASSERT_ALWAYS(!"implemented", "ContactTracker::SphereSphere::predictContact() not implemented yet."); return false; } bool ContactTracker::SphereSphere::initializeContact (const Transform& X_GS1, const SpatialVec& V_GS1, const ContactGeometry& surface1, const Transform& X_GS2, const SpatialVec& V_GS2, const ContactGeometry& surface2, Real cutoff, Real intervalOfInterest, Contact& contactStatus) const { SimTK_ASSERT_ALWAYS(!"implemented", "ContactTracker::SphereSphere::initializeContact() not implemented yet."); return false; } //============================================================================== // HALFSPACE - TRIANGLE MESH CONTACT TRACKER //============================================================================== // Cost is TODO bool ContactTracker::HalfSpaceTriangleMesh::trackContact (const Contact& priorStatus, const Transform& X_GH, const ContactGeometry& geoHalfSpace, const Transform& X_GM, const ContactGeometry& geoMesh, Real cutoff, Contact& currentStatus) const { SimTK_ASSERT_ALWAYS ( ContactGeometry::HalfSpace::isInstance(geoHalfSpace) && ContactGeometry::TriangleMesh::isInstance(geoMesh), "ContactTracker::HalfSpaceTriangleMesh::trackContact()"); // We can't handle a "proximity" test, only penetration. SimTK_ASSERT_ALWAYS(cutoff==0, "ContactTracker::HalfSpaceTriangleMesh::trackContact()"); // No need for an expensive dynamic cast here; we know what we have. const ContactGeometry::TriangleMesh& mesh = ContactGeometry::TriangleMesh::getAs(geoMesh); // Transform giving mesh (S2) frame in the halfspace (S1) frame. const Transform X_HM = (~X_GH)*X_GM; // Normal is halfspace -x direction; xdir is first column of R_MH. // That's a unit vector and -unitvec is also a unit vector so this // doesn't require normalization. const UnitVec3 hsNormal_M = -(~X_HM.R()).x(); // Find the height of the halfspace face along the normal, measured // from the mesh origin. const Real hsFaceHeight_M = dot((~X_HM).p(), hsNormal_M); // Now collect all the faces that are all or partially below the // halfspace surface. std::set<int> insideFaces; processBox(mesh, mesh.getOBBTreeNode(), X_HM, hsNormal_M, hsFaceHeight_M, insideFaces); if (insideFaces.empty()) { currentStatus.clear(); // not touching return true; // successful return } currentStatus = TriangleMeshContact(priorStatus.getSurface1(), priorStatus.getSurface2(), X_HM, std::set<int>(), insideFaces); return true; // success } bool ContactTracker::HalfSpaceTriangleMesh::predictContact (const Contact& priorStatus, const Transform& X_GS1, const SpatialVec& V_GS1, const SpatialVec& A_GS1, const ContactGeometry& surface1, const Transform& X_GS2, const SpatialVec& V_GS2, const SpatialVec& A_GS2, const ContactGeometry& surface2, Real cutoff, Real intervalOfInterest, Contact& predictedStatus) const { SimTK_ASSERT_ALWAYS(!"implemented", "ContactTracker::HalfSpaceTriangleMesh::predictContact() not implemented yet."); return false; } bool ContactTracker::HalfSpaceTriangleMesh::initializeContact (const Transform& X_GS1, const SpatialVec& V_GS1, const ContactGeometry& surface1, const Transform& X_GS2, const SpatialVec& V_GS2, const ContactGeometry& surface2, Real cutoff, Real intervalOfInterest, Contact& contactStatus) const { SimTK_ASSERT_ALWAYS(!"implemented", "ContactTracker::HalfSpaceTriangleMesh::initializeContact() not implemented yet."); return false; } // Check a single OBB and its contents (recursively) against the halfspace, // appending any penetrating faces to the insideFaces list. void ContactTracker::HalfSpaceTriangleMesh::processBox (const ContactGeometry::TriangleMesh& mesh, const ContactGeometry::TriangleMesh::OBBTreeNode& node, const Transform& X_HM, const UnitVec3& hsNormal_M, Real hsFaceHeight_M, std::set<int>& insideFaces) const { // First check against the node's bounding box. const OrientedBoundingBox& bounds = node.getBounds(); const Transform& X_MB = bounds.getTransform(); // box frame in mesh const Vec3 p_BC = bounds.getSize()/2; // from box origin corner to center // Express the half space normal in the box frame, then reflect it into // the first (+,+,+) quadrant where it is the normal of a different // but symmetric and more convenient half space. const UnitVec3 octant1hsNormal_B = (~X_MB.R()*hsNormal_M).abs(); // Dot our octant1 radius p_BC with our octant1 normal to get // the extent of the box from its center in the direction of the octant1 // reflection of the halfspace. const Real extent = dot(p_BC, octant1hsNormal_B); // Compute the height of the box center over the mesh origin, // measured along the real halfspace normal. const Vec3 boxCenter_M = X_MB*p_BC; const Real boxCenterHeight_M = dot(boxCenter_M, hsNormal_M); // Subtract the halfspace surface position to get the height of the // box center over the halfspace. const Real boxCenterHeight = boxCenterHeight_M - hsFaceHeight_M; if (boxCenterHeight >= extent) return; // no penetration if (boxCenterHeight <= -extent) { addAllTriangles(node, insideFaces); // box is entirely in halfspace return; } // Box is partially penetrated into halfspace. If it is not a leaf node, // check its children. if (!node.isLeafNode()) { processBox(mesh, node.getFirstChildNode(), X_HM, hsNormal_M, hsFaceHeight_M, insideFaces); processBox(mesh, node.getSecondChildNode(), X_HM, hsNormal_M, hsFaceHeight_M, insideFaces); return; } // This is a leaf OBB node that is penetrating, so some of its triangles // may be penetrating. const Array_<int>& triangles = node.getTriangles(); for (int i = 0; i < (int) triangles.size(); i++) { for (int vx=0; vx < 3; ++vx) { const int vertex = mesh.getFaceVertex(triangles[i], vx); const Vec3& vertexPos = mesh.getVertexPosition(vertex); const Real vertexHeight_M = dot(vertexPos, hsNormal_M); if (vertexHeight_M < hsFaceHeight_M) { insideFaces.insert(triangles[i]); break; // done with this face } } } } void ContactTracker::HalfSpaceTriangleMesh::addAllTriangles (const ContactGeometry::TriangleMesh::OBBTreeNode& node, std::set<int>& insideFaces) const { if (node.isLeafNode()) { const Array_<int>& triangles = node.getTriangles(); for (int i = 0; i < (int) triangles.size(); i++) insideFaces.insert(triangles[i]); } else { addAllTriangles(node.getFirstChildNode(), insideFaces); addAllTriangles(node.getSecondChildNode(), insideFaces); } } //============================================================================== // SPHERE - TRIANGLE MESH CONTACT TRACKER //============================================================================== // Cost is TODO bool ContactTracker::SphereTriangleMesh::trackContact (const Contact& priorStatus, const Transform& X_GS, const ContactGeometry& geoSphere, const Transform& X_GM, const ContactGeometry& geoMesh, Real cutoff, Contact& currentStatus) const { SimTK_ASSERT_ALWAYS ( ContactGeometry::Sphere::isInstance(geoSphere) && ContactGeometry::TriangleMesh::isInstance(geoMesh), "ContactTracker::SphereTriangleMesh::trackContact()"); // We can't handle a "proximity" test, only penetration. SimTK_ASSERT_ALWAYS(cutoff==0, "ContactTracker::SphereTriangleMesh::trackContact()"); // No need for an expensive dynamic cast here; we know what we have. const ContactGeometry::Sphere& sphere = ContactGeometry::Sphere::getAs(geoSphere); const ContactGeometry::TriangleMesh& mesh = ContactGeometry::TriangleMesh::getAs(geoMesh); // Transform giving mesh (M) frame in the sphere (S) frame. const Transform X_SM = ~X_GS*X_GM; // Want the sphere center measured and expressed in the mesh frame. const Vec3 p_MC = (~X_SM).p(); std::set<int> insideFaces; processBox(mesh, mesh.getOBBTreeNode(), p_MC, square(sphere.getRadius()), insideFaces); if (insideFaces.empty()) { currentStatus.clear(); // not touching return true; // successful return } currentStatus = TriangleMeshContact(priorStatus.getSurface1(), priorStatus.getSurface2(), X_SM, std::set<int>(), insideFaces); return true; // success } // Check a single OBB and its contents (recursively) against the sphere // whose center location in M and radius squared is given, appending any // penetrating faces to the insideFaces list. void ContactTracker::SphereTriangleMesh::processBox (const ContactGeometry::TriangleMesh& mesh, const ContactGeometry::TriangleMesh::OBBTreeNode& node, const Vec3& center_M, Real radius2, std::set<int>& insideFaces) const { // First check against the node's bounding box. const Vec3 nearest_M = node.getBounds().findNearestPoint(center_M); if ((nearest_M-center_M).normSqr() >= radius2) return; // no intersection possible // Bounding box is penetrating. If it's not a leaf node, check its children. if (!node.isLeafNode()) { processBox(mesh, node.getFirstChildNode(), center_M, radius2, insideFaces); processBox(mesh, node.getSecondChildNode(), center_M, radius2, insideFaces); return; } // This is a leaf node that may be penetrating; check the triangles. const Array_<int>& triangles = node.getTriangles(); for (unsigned i = 0; i < triangles.size(); i++) { Vec2 uv; Vec3 nearest_M = mesh.findNearestPointToFace (center_M, triangles[i], uv); if ((nearest_M-center_M).normSqr() < radius2) insideFaces.insert(triangles[i]); } } bool ContactTracker::SphereTriangleMesh::predictContact (const Contact& priorStatus, const Transform& X_GS1, const SpatialVec& V_GS1, const SpatialVec& A_GS1, const ContactGeometry& surface1, const Transform& X_GS2, const SpatialVec& V_GS2, const SpatialVec& A_GS2, const ContactGeometry& surface2, Real cutoff, Real intervalOfInterest, Contact& predictedStatus) const { SimTK_ASSERT_ALWAYS(!"implemented", "ContactTracker::SphereTriangleMesh::predictContact() not implemented yet."); return false; } bool ContactTracker::SphereTriangleMesh::initializeContact (const Transform& X_GS1, const SpatialVec& V_GS1, const ContactGeometry& surface1, const Transform& X_GS2, const SpatialVec& V_GS2, const ContactGeometry& surface2, Real cutoff, Real intervalOfInterest, Contact& contactStatus) const { SimTK_ASSERT_ALWAYS(!"implemented", "ContactTracker::SphereTriangleMesh::initializeContact() not implemented yet."); return false; } //============================================================================== // TRIANGLE MESH - TRIANGLE MESH CONTACT TRACKER //============================================================================== // Cost is TODO bool ContactTracker::TriangleMeshTriangleMesh::trackContact (const Contact& priorStatus, const Transform& X_GM1, const ContactGeometry& geoMesh1, const Transform& X_GM2, const ContactGeometry& geoMesh2, Real cutoff, Contact& currentStatus) const { SimTK_ASSERT_ALWAYS ( ContactGeometry::TriangleMesh::isInstance(geoMesh1) && ContactGeometry::TriangleMesh::isInstance(geoMesh2), "ContactTracker::TriangleMeshTriangleMesh::trackContact()"); // We can't handle a "proximity" test, only penetration. SimTK_ASSERT_ALWAYS(cutoff==0, "ContactTracker::TriangleMeshTriangleMesh::trackContact()"); // No need for an expensive dynamic cast here; we know what we have. const ContactGeometry::TriangleMesh& mesh1 = ContactGeometry::TriangleMesh::getAs(geoMesh1); const ContactGeometry::TriangleMesh& mesh2 = ContactGeometry::TriangleMesh::getAs(geoMesh2); // Transform giving mesh2 (M2) frame in the mesh1 (M1) frame. const Transform X_M1M2 = ~X_GM1*X_GM2; std::set<int> insideFaces1, insideFaces2; // Get M2's bounding box in M1's frame. const OrientedBoundingBox mesh2Bounds_M1 = X_M1M2*mesh2.getOBBTreeNode().getBounds(); // Find the faces that are actually intersecting faces on the other // surface (this doesn't yet include faces that may be completely buried). findIntersectingFaces(mesh1, mesh2, mesh1.getOBBTreeNode(), mesh2.getOBBTreeNode(), mesh2Bounds_M1, X_M1M2, insideFaces1, insideFaces2); // It should never be the case that one set of faces is empty and the // other isn't, however it is conceivable that roundoff error could cause // this to happen so we'll check both lists. if (insideFaces1.empty() && insideFaces2.empty()) { currentStatus.clear(); // not touching return true; // successful return } // There was an intersection. We now need to identify every triangle and // vertex of each mesh that is inside the other mesh. We found the border // intersections above; now we have to fill in the buried faces. findBuriedFaces(mesh1, mesh2, ~X_M1M2, insideFaces1); findBuriedFaces(mesh2, mesh1, X_M1M2, insideFaces2); currentStatus = TriangleMeshContact(priorStatus.getSurface1(), priorStatus.getSurface2(), X_M1M2, insideFaces1, insideFaces2); return true; // success } void ContactTracker::TriangleMeshTriangleMesh:: findIntersectingFaces (const ContactGeometry::TriangleMesh& mesh1, const ContactGeometry::TriangleMesh& mesh2, const ContactGeometry::TriangleMesh::OBBTreeNode& node1, const ContactGeometry::TriangleMesh::OBBTreeNode& node2, const OrientedBoundingBox& node2Bounds_M1, const Transform& X_M1M2, std::set<int>& triangles1, std::set<int>& triangles2) const { // See if the bounding boxes intersect. if (!node1.getBounds().intersectsBox(node2Bounds_M1)) return; // If either node is not a leaf node, process the children recursively. if (!node1.isLeafNode()) { if (!node2.isLeafNode()) { const OrientedBoundingBox firstChildBounds = X_M1M2*node2.getFirstChildNode().getBounds(); const OrientedBoundingBox secondChildBounds = X_M1M2*node2.getSecondChildNode().getBounds(); findIntersectingFaces(mesh1, mesh2, node1.getFirstChildNode(), node2.getFirstChildNode(), firstChildBounds, X_M1M2, triangles1, triangles2); findIntersectingFaces(mesh1, mesh2, node1.getFirstChildNode(), node2.getSecondChildNode(), secondChildBounds, X_M1M2, triangles1, triangles2); findIntersectingFaces(mesh1, mesh2, node1.getSecondChildNode(), node2.getFirstChildNode(), firstChildBounds, X_M1M2, triangles1, triangles2); findIntersectingFaces(mesh1, mesh2, node1.getSecondChildNode(), node2.getSecondChildNode(), secondChildBounds, X_M1M2, triangles1, triangles2); } else { findIntersectingFaces(mesh1, mesh2, node1.getFirstChildNode(), node2, node2Bounds_M1, X_M1M2, triangles1, triangles2); findIntersectingFaces(mesh1, mesh2, node1.getSecondChildNode(), node2, node2Bounds_M1, X_M1M2, triangles1, triangles2); } return; } else if (!node2.isLeafNode()) { const OrientedBoundingBox firstChildBounds = X_M1M2*node2.getFirstChildNode().getBounds(); const OrientedBoundingBox secondChildBounds = X_M1M2*node2.getSecondChildNode().getBounds(); findIntersectingFaces(mesh1, mesh2, node1, node2.getFirstChildNode(), firstChildBounds, X_M1M2, triangles1, triangles2); findIntersectingFaces(mesh1, mesh2, node1, node2.getSecondChildNode(), secondChildBounds, X_M1M2, triangles1, triangles2); return; } // These are both leaf nodes, so check triangles for intersections. const Array_<int>& node1triangles = node1.getTriangles(); const Array_<int>& node2triangles = node2.getTriangles(); for (unsigned i = 0; i < node2triangles.size(); i++) { const int face2 = node2triangles[i]; Vec3 a1 = X_M1M2*mesh2.getVertexPosition(mesh2.getFaceVertex(face2, 0)); Vec3 a2 = X_M1M2*mesh2.getVertexPosition(mesh2.getFaceVertex(face2, 1)); Vec3 a3 = X_M1M2*mesh2.getVertexPosition(mesh2.getFaceVertex(face2, 2)); const Geo::Triangle A(a1,a2,a3); for (unsigned j = 0; j < node1triangles.size(); j++) { const int face1 = node1triangles[j]; const Vec3& b1 = mesh1.getVertexPosition(mesh1.getFaceVertex(face1, 0)); const Vec3& b2 = mesh1.getVertexPosition(mesh1.getFaceVertex(face1, 1)); const Vec3& b3 = mesh1.getVertexPosition(mesh1.getFaceVertex(face1, 2)); const Geo::Triangle B(b1,b2,b3); if (A.overlapsTriangle(B)) { // The triangles intersect. triangles1.insert(face1); triangles2.insert(face2); } } } } static const int Outside = -1; static const int Unknown = 0; static const int Boundary = 1; static const int Inside = 2; void ContactTracker::TriangleMeshTriangleMesh:: findBuriedFaces(const ContactGeometry::TriangleMesh& mesh, // M const ContactGeometry::TriangleMesh& otherMesh, // O const Transform& X_OM, std::set<int>& insideFaces) const { // Find which faces are inside. // We're passed in the list of Boundary faces, that is, those faces of // "mesh" that intersect faces of "otherMesh". Array_<int> faceType(mesh.getNumFaces(), Unknown); for (std::set<int>::iterator iter = insideFaces.begin(); iter != insideFaces.end(); ++iter) faceType[*iter] = Boundary; for (int i = 0; i < (int) faceType.size(); i++) { if (faceType[i] == Unknown) { // Trace a ray from its center to determine whether it is inside. const Vec3 origin_O = X_OM * mesh.findCentroid(i); const UnitVec3 direction_O = X_OM.R()* mesh.getFaceNormal(i); Real distance; int face; Vec2 uv; if ( otherMesh.intersectsRay(origin_O, direction_O, distance, face, uv) && ~direction_O*otherMesh.getFaceNormal(face) > 0) { faceType[i] = Inside; insideFaces.insert(i); } else faceType[i] = Outside; // Recursively mark adjacent inside or outside Faces. tagFaces(mesh, faceType, insideFaces, i, 0); } } } //TODO: the following method uses depth-first recursion to iterate through //unmarked faces. For a large mesh this was observed to produce a stack //overflow in OpenSim. Here we limit the recursion depth; after we get that //deep we'll pop back out and do another expensive intersectsRay() test in //the method above. static const int MaxRecursionDepth = 500; void ContactTracker::TriangleMeshTriangleMesh:: tagFaces(const ContactGeometry::TriangleMesh& mesh, Array_<int>& faceType, std::set<int>& triangles, int index, int depth) const { for (int i = 0; i < 3; i++) { const int edge = mesh.getFaceEdge(index, i); const int face = (mesh.getEdgeFace(edge, 0) == index ? mesh.getEdgeFace(edge, 1) : mesh.getEdgeFace(edge, 0)); if (faceType[face] == Unknown) { faceType[face] = faceType[index]; if (faceType[index] > 0) triangles.insert(face); if (depth < MaxRecursionDepth) tagFaces(mesh, faceType, triangles, face, depth+1); } } } bool ContactTracker::TriangleMeshTriangleMesh::predictContact (const Contact& priorStatus, const Transform& X_GS1, const SpatialVec& V_GS1, const SpatialVec& A_GS1, const ContactGeometry& surface1, const Transform& X_GS2, const SpatialVec& V_GS2, const SpatialVec& A_GS2, const ContactGeometry& surface2, Real cutoff, Real intervalOfInterest, Contact& predictedStatus) const { SimTK_ASSERT_ALWAYS(!"implemented", "ContactTracker::TriangleMeshTriangleMesh::predictContact() not implemented yet."); return false; } bool ContactTracker::TriangleMeshTriangleMesh::initializeContact (const Transform& X_GS1, const SpatialVec& V_GS1, const ContactGeometry& surface1, const Transform& X_GS2, const SpatialVec& V_GS2, const ContactGeometry& surface2, Real cutoff, Real intervalOfInterest, Contact& contactStatus) const { SimTK_ASSERT_ALWAYS(!"implemented", "ContactTracker::TriangleMeshTriangleMesh::initializeContact() not implemented yet."); return false; } //============================================================================== // CONVEX IMPLICIT SURFACE PAIR CONTACT TRACKER //============================================================================== // This will return an elliptical point contact. bool ContactTracker::ConvexImplicitPair::trackContact (const Contact& priorStatus, const Transform& X_GA, const ContactGeometry& shapeA, const Transform& X_GB, const ContactGeometry& shapeB, Real cutoff, Contact& currentStatus) const { SimTK_ASSERT_ALWAYS ( shapeA.isConvex() && shapeA.isSmooth() && shapeB.isConvex() && shapeB.isSmooth(), "ContactTracker::ConvexImplicitPair::trackContact()"); // We'll work in the shape A frame. const Transform X_AB = ~X_GA*X_GB; // 63 flops const Rotation& R_AB = X_AB.R(); // 1. Get a rough guess at the contact points P and Q and contact normal. Vec3 pointP_A, pointQ_B; // on A and B, resp. UnitVec3 norm_A; int numMPRIters; const bool mightBeContact = estimateConvexImplicitPairContactUsingMPR (shapeA, shapeB, X_AB, pointP_A, pointQ_B, norm_A, numMPRIters); #ifdef MPR_DEBUG std::cout << "MPR: " << (mightBeContact?"MAYBE":"NO") << std::endl; std::cout << " P=" << X_GA*pointP_A << " Q=" << X_GB*pointQ_B << std::endl; std::cout << " N=" << X_GA.R()*norm_A << std::endl; #endif if (!mightBeContact) { currentStatus.clear(); // definitely not touching return true; // successful return } // 2. Refine the contact points to near machine precision. const Real accuracyRequested = SignificantReal; Real accuracyAchieved; int numNewtonIters; bool converged = refineImplicitPair(shapeA, pointP_A, shapeB, pointQ_B, X_AB, accuracyRequested, accuracyAchieved, numNewtonIters); const Vec3 pointQ_A = X_AB*pointQ_B; // Q on B, measured & expressed in A // 3. Compute the curvatures and surface normals of the two surfaces at // P and Q. Once we have the first normal we can check whether there was // actually any contact and duck out early if not. Rotation R_AP; Vec2 curvatureP; shapeA.calcCurvature(pointP_A, curvatureP, R_AP); // If the surfaces are in contact then the vector from Q on surface B // (supposedly inside A) to P on surface A (supposedly inside B) should be // aligned with the outward normal on A. const Real depth = dot(pointP_A-pointQ_A, R_AP.z()); #ifdef MPR_DEBUG printf("MPR %2d iters, Newton %2d iters->accuracy=%g depth=%g\n", numMPRIters, numNewtonIters, accuracyAchieved, depth); #endif if (depth <= 0) { currentStatus.clear(); // not touching return true; // successful return } // The surfaces are in contact. Rotation R_BQ; Vec2 curvatureQ; shapeB.calcCurvature(pointQ_B, curvatureQ, R_BQ); const UnitVec3 maxDirB_A(R_AB*R_BQ.x()); // re-express in A // 4. Compute the effective contact frame C and corresponding relative // curvatures. Transform X_AC; Vec2 curvatureC; // Define the contact frame origin to be at the midpoint of P and Q. X_AC.updP() = (pointP_A+pointQ_A)/2; // Determine the contact frame orientations and composite curvatures. ContactGeometry::combineParaboloids(R_AP, curvatureP, maxDirB_A, curvatureQ, X_AC.updR(), curvatureC); // 5. Return the elliptical point contact for force generation. currentStatus = EllipticalPointContact(priorStatus.getSurface1(), priorStatus.getSurface2(), X_AB, X_AC, curvatureC, depth); return true; // success } bool ContactTracker::ConvexImplicitPair::predictContact (const Contact& priorStatus, const Transform& X_GS1, const SpatialVec& V_GS1, const SpatialVec& A_GS1, const ContactGeometry& surface1, const Transform& X_GS2, const SpatialVec& V_GS2, const SpatialVec& A_GS2, const ContactGeometry& surface2, Real cutoff, Real intervalOfInterest, Contact& predictedStatus) const { SimTK_ASSERT_ALWAYS(!"implemented", "ContactTracker::ConvexImplicitPair::predictContact() not implemented yet."); return false; } bool ContactTracker::ConvexImplicitPair::initializeContact (const Transform& X_GS1, const SpatialVec& V_GS1, const ContactGeometry& surface1, const Transform& X_GS2, const SpatialVec& V_GS2, const ContactGeometry& surface2, Real cutoff, Real intervalOfInterest, Contact& contactStatus) const { SimTK_ASSERT_ALWAYS(!"implemented", "ContactTracker::ConvexImplicitPair::initializeContact() not implemented yet."); return false; } //============================================================================== // GENERAL IMPLICIT SURFACE PAIR CONTACT TRACKER //============================================================================== // This will return an elliptical point contact. TODO: should return a set // of contacts. //TODO: not implemented yet -- this is just the Convex-convex code here. bool ContactTracker::GeneralImplicitPair::trackContact (const Contact& priorStatus, const Transform& X_GA, const ContactGeometry& shapeA, const Transform& X_GB, const ContactGeometry& shapeB, Real cutoff, Contact& currentStatus) const { SimTK_ASSERT_ALWAYS ( shapeA.isSmooth() && shapeB.isSmooth(), "ContactTracker::GeneralImplicitPair::trackContact()"); // TODO: this won't work unless the shapes are actually convex. return ConvexImplicitPair(shapeA.getTypeId(),shapeB.getTypeId()) .trackContact(priorStatus, X_GA, shapeA, X_GB, shapeB, cutoff, currentStatus); } bool ContactTracker::GeneralImplicitPair::predictContact (const Contact& priorStatus, const Transform& X_GS1, const SpatialVec& V_GS1, const SpatialVec& A_GS1, const ContactGeometry& surface1, const Transform& X_GS2, const SpatialVec& V_GS2, const SpatialVec& A_GS2, const ContactGeometry& surface2, Real cutoff, Real intervalOfInterest, Contact& predictedStatus) const { SimTK_ASSERT_ALWAYS(!"implemented", "ContactTracker::GeneralImplicitPair::predictContact() not implemented yet."); return false; } bool ContactTracker::GeneralImplicitPair::initializeContact (const Transform& X_GS1, const SpatialVec& V_GS1, const ContactGeometry& surface1, const Transform& X_GS2, const SpatialVec& V_GS2, const ContactGeometry& surface2, Real cutoff, Real intervalOfInterest, Contact& contactStatus) const { SimTK_ASSERT_ALWAYS(!"implemented", "ContactTracker::GeneralImplicitPair::initializeContact() not implemented yet."); return false; } } // namespace SimTK
elen4/simbody
SimTKmath/Geometry/src/ContactTracker.cpp
C++
apache-2.0
64,663
using System; namespace TheUnacademicPortfolio.Commons.Dtos { public class BaseDto { public Guid Id { get; set; } } }
pichardoJ/TheUnacademicPortfolio
src/TheUnacademicPortfolio.Commons/Dtos/BaseDto.cs
C#
apache-2.0
141
/* * Copyright 2015 - 2021 TU Dortmund * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package de.learnlib.alex.learning.services; import de.learnlib.alex.data.entities.ProjectEnvironment; import de.learnlib.alex.data.entities.ProjectUrl; import de.learnlib.alex.data.entities.actions.Credentials; import java.util.HashMap; import java.util.Map; /** * Class to mange a URL and get URL based on this. */ public class BaseUrlManager { private final Map<String, ProjectUrl> urlMap; /** Advanced constructor which sets the base url field. */ public BaseUrlManager(ProjectEnvironment environment) { this.urlMap = new HashMap<>(); environment.getUrls().forEach(u -> this.urlMap.put(u.getName(), u)); } /** * Get the absolute URL of a path, i.e. based on the base url (base url + '/' + path'), as String * and insert the credentials if possible. * * @param path * The path to append on the base url. * @param credentials * The credentials to insert into the URL. * @return An absolute URL as String */ public String getAbsoluteUrl(String urlName, String path, Credentials credentials) { final String url = combineUrls(urlMap.get(urlName).getUrl(), path); return BaseUrlManager.getUrlWithCredentials(url, credentials); } public String getAbsoluteUrl(String urlName, String path) { final String url = combineUrls(urlMap.get(urlName).getUrl(), path); return BaseUrlManager.getUrlWithCredentials(url, null); } /** * Append apiPath to basePath and make sure that only one '/' is between them. * * @param basePath * The prefix of the new URL. * @param apiPath * The suffix of the new URL. * @return The combined URL. */ private String combineUrls(String basePath, String apiPath) { if (basePath.endsWith("/") && apiPath.startsWith("/")) { // both have a '/' -> remove one return basePath + apiPath.substring(1); } else if (!basePath.endsWith("/") && !apiPath.startsWith("/")) { // no one has a '/' -> add one return basePath + "/" + apiPath; } else { // exact 1. '/' in between -> good to go return basePath + apiPath; } } private static String getUrlWithCredentials(String url, Credentials credentials) { if (credentials != null && credentials.areValid()) { return url.replaceFirst("^(http[s]?://)", "$1" + credentials.getName() + ":" + credentials.getPassword() + "@"); } else { return url; } } }
LearnLib/alex
backend/src/main/java/de/learnlib/alex/learning/services/BaseUrlManager.java
Java
apache-2.0
3,225
/* * Copyright 2015 Cognitive Medical Systems, Inc (http://www.cognitivemedciine.com). * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.socraticgrid.hl7.services.orders.model.types.orderitems; import java.util.ArrayList; import java.util.Date; import java.util.List; import org.socraticgrid.hl7.services.orders.model.OrderItem; import org.socraticgrid.hl7.services.orders.model.primatives.Code; import org.socraticgrid.hl7.services.orders.model.primatives.Identifier; import org.socraticgrid.hl7.services.orders.model.primatives.Period; import org.socraticgrid.hl7.services.orders.model.primatives.Quantity; import org.socraticgrid.hl7.services.orders.model.primatives.Ratio; public class MedicationOrderItem extends OrderItem { /** * */ private static final long serialVersionUID = 1L; private String additionalDosageIntructions; private String comment; private Quantity dispenseQuantity= new Quantity(); private String dosageInstructions; private Code dosageMethod; private Quantity dosageQuantity = new Quantity(); private Ratio dosageRate = new Ratio(); private Code dosageSite = new Code(); private Date dosageTiming; private Period dosageTimingPeriod = new Period(); private List<Identifier> drug = new ArrayList<Identifier>(0); private Date endDate; private Quantity expectedSupplyDuration = new Quantity(); private Ratio maxDosePerPeriod = new Ratio(); private List<Identifier> medication = new ArrayList<Identifier>(0); private int numberOfRepeatsAllowed=0; private Code prescriber; private Code route = new Code(); private String schedule; private Date startDate; /** * @return the additionalDosageIntructions */ public String getAdditionalDosageIntructions() { return additionalDosageIntructions; } /** * @return the comment */ public String getComment() { return comment; } /** * @return the dispenseQuantity */ public Quantity getDispenseQuantity() { return dispenseQuantity; } /** * @return the dosageInstructions */ public String getDosageInstructions() { return dosageInstructions; } /** * @return the dosageMethod */ public Code getDosageMethod() { return dosageMethod; } /** * @return the dosageQuantity */ public Quantity getDosageQuantity() { return dosageQuantity; } /** * @return the dosageRate */ public Ratio getDosageRate() { return dosageRate; } /** * @return the dosageSite */ public Code getDosageSite() { return dosageSite; } /** * @return the dosageTiming */ public Date getDosageTiming() { return dosageTiming; } /** * @return the dosageTimingPeriod */ public Period getDosageTimingPeriod() { return dosageTimingPeriod; } /** * @return the drug */ public List<Identifier> getDrug() { return drug; } /** * @return the endDate */ public Date getEndDate() { return endDate; } /** * @return the expectedSupplyDuration */ public Quantity getExpectedSupplyDuration() { return expectedSupplyDuration; } /** * @return the maxDosePerPeriod */ public Ratio getMaxDosePerPeriod() { return maxDosePerPeriod; } /** * @return the medication */ public List<Identifier> getMedication() { return medication; } /** * @return the numberOfRepeatsAllowed */ public int getNumberOfRepeatsAllowed() { return numberOfRepeatsAllowed; } /** * @return the prescriber */ public Code getPrescriber() { return prescriber; } /** * @return the route */ public Code getRoute() { return route; } /** * @return the schedule */ public String getSchedule() { return schedule; } /** * @return the startDate */ public Date getStartDate() { return startDate; } /** * @param additionalDosageIntructions the additionalDosageIntructions to set */ public void setAdditionalDosageIntructions(String additionalDosageIntructions) { this.additionalDosageIntructions = additionalDosageIntructions; } /** * @param comment the comment to set */ public void setComment(String comment) { this.comment = comment; } /** * @param dispenseQuantity the dispenseQuantity to set */ public void setDispenseQuantity(Quantity dispenseQuantity) { this.dispenseQuantity = dispenseQuantity; } /** * @param dosageInstructions the dosageInstructions to set */ public void setDosageInstructions(String dosageInstructions) { this.dosageInstructions = dosageInstructions; } /** * @param dosageMethod the dosageMethod to set */ public void setDosageMethod(Code dosageMethod) { this.dosageMethod = dosageMethod; } /** * @param dosageQuantity the dosageQuantity to set */ public void setDosageQuantity(Quantity dosageQuantity) { this.dosageQuantity = dosageQuantity; } /** * @param dosageRate the dosageRate to set */ public void setDosageRate(Ratio dosageRate) { this.dosageRate = dosageRate; } /** * @param dosageSite the dosageSite to set */ public void setDosageSite(Code dosageSite) { this.dosageSite = dosageSite; } /** * @param dosageTiming the dosageTiming to set */ public void setDosageTiming(Date dosageTiming) { this.dosageTiming = dosageTiming; } /** * @param dosageTimingPeriod the dosageTimingPeriod to set */ public void setDosageTimingPeriod(Period dosageTimingPeriod) { this.dosageTimingPeriod = dosageTimingPeriod; } /** * @param drug the drug to set */ public void setDrug(List<Identifier> drug) { this.drug = drug; } /** * @param endDate the endDate to set */ public void setEndDate(Date endDate) { this.endDate = endDate; } /** * @param expectedSupplyDuration the expectedSupplyDuration to set */ public void setExpectedSupplyDuration(Quantity expectedSupplyDuration) { this.expectedSupplyDuration = expectedSupplyDuration; } /** * @param maxDosePerPeriod the maxDosePerPeriod to set */ public void setMaxDosePerPeriod(Ratio maxDosePerPeriod) { this.maxDosePerPeriod = maxDosePerPeriod; } /** * @param medication the medication to set */ public void setMedication(List<Identifier> medication) { this.medication = medication; } /** * @param numberOfRepeatsAllowed the numberOfRepeatsAllowed to set */ public void setNumberOfRepeatsAllowed(int numberOfRepeatsAllowed) { this.numberOfRepeatsAllowed = numberOfRepeatsAllowed; } /** * @param prescriber the prescriber to set */ public void setPrescriber(Code prescriber) { this.prescriber = prescriber; } /** * @param route the route to set */ public void setRoute(Code route) { this.route = route; } /** * @param schedule the schedule to set */ public void setSchedule(String schedule) { this.schedule = schedule; } /** * @param startDate the startDate to set */ public void setStartDate(Date startDate) { this.startDate = startDate; } }
SocraticGrid/OMS-API
src/main/java/org/socraticgrid/hl7/services/orders/model/types/orderitems/MedicationOrderItem.java
Java
apache-2.0
7,408
/*jshint camelcase: false*/ module.exports = (grunt) => { 'use strict'; // load all grunt tasks require('time-grunt')(grunt); require('load-grunt-tasks')(grunt); // configurable paths const config = { app: 'app', dist: 'dist', distMac32: 'dist/MacOS32', distMac64: 'dist/MacOS64', distLinux32: 'dist/Linux32', distLinux64: 'dist/Linux64', distWin32: 'dist/Win32', distWin64: 'dist/Win64', distWin: 'dist/Win', tmp: 'buildTmp', resources: 'resources', appName: 'PlaylistPalace' }; grunt.initConfig({ config: config, clean: { dist: { files: [{ dot: true, src: [ `${ config.dist }/*`, `${ config.tmp }/*` ] }] }, distMac32: { files: [{ dot: true, src: [ `${ config.distMac32 }/*`, `${ config.tmp }/*` ] }] }, distMac64: { files: [{ dot: true, src: [ `${ config.distMac64 }/*`, `${ config.tmp }/*` ] }] }, distLinux64: { files: [{ dot: true, src: [ `${ config.distLinux64 }/*`, `${ config.tmp }/*` ] }] }, distLinux32: { files: [{ dot: true, src: [ `${ config.distLinux32 }/*`, `${ config.tmp }/*` ] }] }, distWin: { files: [{ dot: true, src: [ `${ config.distWin }/*`, `${ config.tmp }/*` ] }] }, distWin32: { files: [{ dot: true, src: [ `${ config.distWin32 }/*`, `${ config.tmp }/*` ] }] }, distWin64: { files: [{ dot: true, src: [ `${ config.distWin64 }/*`, `${ config.tmp }/*` ] }] } }, jshint: { options: { jshintrc: '.jshintrc' }, files: `${ config.app }/js/*.js` }, copy: { appLinux: { files: [{ expand: true, cwd: `${ config.app }`, dest: `${ config.distLinux64 }/app.nw`, src: '**' }] }, appLinux32: { files: [{ expand: true, cwd: `${ config.app }`, dest: `${ config.distLinux32 }/app.nw`, src: '**' }] }, appMacos32: { files: [{ expand: true, cwd: `${ config.app }`, dest: `${ config.distMac32 }/node-webkit.app/Contents/Resources/app.nw`, src: '**' }, { expand: true, cwd: `${ config.resources }/mac/`, dest: `${ config.distMac32 }/node-webkit.app/Contents/`, filter: 'isFile', src: '*.plist' }, { expand: true, cwd: `${ config.resources }/mac/`, dest: `${ config.distMac32 }/node-webkit.app/Contents/Resources/`, filter: 'isFile', src: '*.icns' }, { expand: true, cwd: `${ config.app }/../node_modules/`, dest: `${ config.distMac32 }/node-webkit.app/Contents/Resources/app.nw/node_modules/`, src: '**' }] }, appMacos64: { files: [{ expand: true, cwd: `${ config.app }`, dest: `${ config.distMac64 }/node-webkit.app/Contents/Resources/app.nw`, src: '**' }, { expand: true, cwd: `${ config.resources }/mac/`, dest: `${ config.distMac64 }/node-webkit.app/Contents/`, filter: 'isFile', src: '*.plist' }, { expand: true, cwd: `${ config.resources }/mac/`, dest: `${ config.distMac64 }/node-webkit.app/Contents/Resources/`, filter: 'isFile', src: '*.icns' }, { expand: true, cwd: `${ config.app }/../node_modules/`, dest: `${ config.distMac64 }/node-webkit.app/Contents/Resources/app.nw/node_modules/`, src: '**' }] }, webkit32: { files: [{ expand: true, cwd: `${ config.resources }/node-webkit/MacOS32`, dest: `${ config.distMac32 }/`, src: '**' }] }, webkit64: { files: [{ expand: true, cwd: `${ config.resources }/node-webkit/MacOS64`, dest: `${ config.distMac64 }/`, src: '**' }] }, copyWinToTmp: { files: [{ expand: true, cwd: `${ config.resources }/node-webkit/Windows/`, dest: `${ config.tmp }/`, src: '**' }] }, copyWin32ToTmp: { files: [{ expand: true, cwd: `${ config.resources }/node-webkit/Win32/`, dest: `${ config.tmp }/`, src: '**' }] }, copyWin64ToTmp: { files: [{ expand: true, cwd: `${ config.resources }/node-webkit/Win64/`, dest: `${ config.tmp }/`, src: '**' }] } }, compress: { appToTmp: { options: { archive: `${ config.tmp }/app.zip` }, files: [{ expand: true, cwd: `${ config.app }`, src: ['**'] }] }, finalWindowsApp: { options: { archive: `${ config.distWin }/${ config.appName }.zip` }, files: [{ expand: true, cwd: `${ config.tmp }`, src: ['**'] }] }, finalWindows32App: { options: { archive: `${ config.distWin32 }/${ config.appName }.zip` }, files: [{ expand: true, cwd: `${ config.tmp }`, src: ['**'] }] }, finalWindows64App: { options: { archive: `${ config.distWin64 }/${ config.appName }.zip` }, files: [{ expand: true, cwd: `${ config.tmp }`, src: ['**'] }] } }, rename: { macApp32: { files: [{ src: `${ config.distMac32 }/node-webkit.app`, dest: `${ config.distMac32 }/${ config.appName }.app` }] }, macApp64: { files: [{ src: `${ config.distMac64 }/node-webkit.app`, dest: `${ config.distMac64 }/${ config.appName }.app` }] }, zipToApp: { files: [{ src: `${ config.tmp }/app.zip`, dest: `${ config.tmp }/app.nw` }] } } }); grunt.registerTask('mkdir','Making directory if needed', () => { grunt.initConfig({ mkdir: { all: { options: { create: ['tmp_', 'test/ripper'] }, }, } }); }); grunt.registerTask('chmod32', 'Add lost Permissions.', () => { const fs = require('fs'), path = `./${config.distMac32}/${ config.appName}.app/Contents/`; console.log(path) fs.chmodSync(path + 'Frameworks/node-webkit Helper EH.app/Contents/MacOS/node-webkit Helper EH', '555') fs.chmodSync(path + 'Frameworks/node-webkit Helper NP.app/Contents/MacOS/node-webkit Helper NP', '555') fs.chmodSync(path + 'Frameworks/node-webkit Helper.app/Contents/MacOS/node-webkit Helper', '555') fs.chmodSync(path + 'MacOS/node-webkit', '555') }); grunt.registerTask('chmod64', 'Add lost Permissions.', () => { const fs = require('fs'), path = `${config.distMac64}/${ config.appName}.app/Contents/` fs.chmodSync(path + 'Frameworks/node-webkit Helper EH.app/Contents/MacOS/node-webkit Helper EH', '555') fs.chmodSync(path + 'Frameworks/node-webkit Helper NP.app/Contents/MacOS/node-webkit Helper NP', '555') fs.chmodSync(path + 'Frameworks/node-webkit Helper.app/Contents/MacOS/node-webkit Helper', '555') fs.chmodSync(path + 'MacOS/node-webkit', '555') }); grunt.registerTask('createLinuxApp', 'Create linux distribution.', (version) => { const done = this.async() const childProcess = require('child_process') const exec = childProcess.exec const path = './' + (version === 'Linux64' ? config.distLinux64 : config.distLinux32) exec(`mkdir -p ${path}; cp resources/node-webkit/${version}'/nw.pak ${path} && cp resources/node-webkit/${version}/nw ${path}/node-webkit`, (error, stdout, stderr) => { var result = true; if (stdout) { grunt.log.write(stdout); } if (stderr) { grunt.log.write(stderr); } if (error !== null) { grunt.log.error(error); result = false; } done(result); }); }); grunt.registerTask('createWindowsApp', 'Create windows distribution.', () => { const done = this.async(); const concat = require('concat-files'); concat([ 'buildTmp/nw.exe', 'buildTmp/app.nw' ], `buildTmp ${ config.appName }.exe`, function () { var fs = require('fs'); fs.unlink('buildTmp/app.nw', function (error, stdout, stderr) { if (stdout) { grunt.log.write(stdout); } if (stderr) { grunt.log.write(stderr); } if (error !== null) { grunt.log.error(error); done(false); } else { fs.unlink('buildTmp/nw.exe', (error, stdout, stderr) => { var result = true; if (stdout) { grunt.log.write(stdout); } if (stderr) { grunt.log.write(stderr); } if (error !== null) { grunt.log.error(error); result = false; } done(result); }); } }); }); }); grunt.registerTask('setVersion', 'Set version to all needed files', (version) => { const config = grunt.config.get(['config']) const appPath = config.app const resourcesPath = config.resources const mainPackageJSON = grunt.file.readJSON('package.json') const appPackageJSON = grunt.file.readJSON(`${appPath}/package.json`) const infoPlistTmp = grunt.file.read(`${resourcesPath}/mac/Info.plist.tmp`, { encoding: 'UTF8' }); const infoPlist = grunt.template.process(infoPlistTmp, { data: { version: version } }) mainPackageJSON.version = version appPackageJSON.version = version grunt.file.write('package.json', JSON.stringify(mainPackageJSON, null, 2), { encoding: 'UTF8' }) grunt.file.write(appPath + `${appPath}/package.json`, JSON.stringify(appPackageJSON, null, 2), { encoding: 'UTF8' }) grunt.file.write(resourcesPath + `${resourcesPath}/mac/Info.plist`, infoPlist, { encoding: 'UTF8' }) }) grunt.registerTask('dist-linux', [ 'clean:distLinux64', 'copy:appLinux', 'createLinuxApp:Linux64' ]) grunt.registerTask('dist-linux32', [ 'clean:distLinux32', 'copy:appLinux32', 'createLinuxApp:Linux32' ]) grunt.registerTask('dist-win', [ 'clean:distWin', 'copy:copyWinToTmp', 'compress:appToTmp', 'rename:zipToApp', 'createWindowsApp', 'compress:finalWindowsApp' ]) grunt.registerTask('dist-win32', [ 'clean:distWin32', 'copy:copyWin32ToTmp', 'compress:appToTmp', 'rename:zipToApp', 'createWindowsApp', 'compress:finalWindows32App' ]) grunt.registerTask('dist-win64', [ 'clean:distWin64', 'copy:copyWin64ToTmp', 'compress:appToTmp', 'rename:zipToApp', 'createWindowsApp', 'compress:finalWindows64App' ]) grunt.registerTask('dist-mac', [ 'clean:distMac64', 'copy:webkit64', 'copy:appMacos64', 'rename:macApp64', 'chmod64' ]) grunt.registerTask('dist-mac32', [ 'clean:distMac32', 'copy:webkit32', 'copy:appMacos32', 'rename:macApp32', 'chmod32' ]) grunt.registerTask('check', [ 'jshint' ]) grunt.registerTask('dmg', 'Create dmg from previously created app folder in dist.', () => { const p = new Promise( (resolve, reject) => { const createDmgCommand = `resources/mac/package.sh ${ config.appName }` require('child_process').exec(createDmgCommand, (error, stdout, stderr) => { if (stdout) { grunt.log.write(stdout) resolve(stdout) } if (stderr) { grunt.log.write(stderr) reject(stderr) } if (error !== null) { grunt.log.error(error) reject(error) } }) }) }) }
reduxdj/node-webkit-redux-custombuilder
Gruntfile.js
JavaScript
apache-2.0
12,611
package gui; //: gui/SubmitLabelManipulationTask.java import javax.swing.*; import java.util.concurrent.*; public class SubmitLabelManipulationTask { public static void main(String[] args) throws Exception { JFrame frame = new JFrame("Hello Swing"); final JLabel label = new JLabel("A Label"); frame.add(label); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(300, 100); frame.setVisible(true); TimeUnit.SECONDS.sleep(1); SwingUtilities.invokeLater(new Runnable() { public void run() { label.setText("Hey! This is Different!"); } }); } } ///:~
vowovrz/thinkinj
thinkinj/src/main/java/gui/SubmitLabelManipulationTask.java
Java
apache-2.0
646
/** * Copyright 2006-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.mybatis.generator.codegen.ibatis2.dao.elements; import java.util.Set; import java.util.TreeSet; import org.mybatis.generator.api.dom.java.FullyQualifiedJavaType; import org.mybatis.generator.api.dom.java.Interface; import org.mybatis.generator.api.dom.java.JavaVisibility; import org.mybatis.generator.api.dom.java.Method; import org.mybatis.generator.api.dom.java.Parameter; import org.mybatis.generator.api.dom.java.TopLevelClass; /** * * @author Jeff Butler * */ public class UpdateByExampleWithoutBLOBsMethodGenerator extends AbstractDAOElementGenerator { public UpdateByExampleWithoutBLOBsMethodGenerator() { super(); } @Override public void addImplementationElements(TopLevelClass topLevelClass) { Set<FullyQualifiedJavaType> importedTypes = new TreeSet<FullyQualifiedJavaType>(); Method method = getMethodShell(importedTypes); method .addBodyLine("UpdateByExampleParms parms = new UpdateByExampleParms(record, example);"); //$NON-NLS-1$ StringBuilder sb = new StringBuilder(); sb.append("int rows = "); //$NON-NLS-1$ sb.append(daoTemplate.getUpdateMethod(introspectedTable .getIbatis2SqlMapNamespace(), introspectedTable .getUpdateByExampleStatementId(), "parms")); //$NON-NLS-1$ method.addBodyLine(sb.toString()); method.addBodyLine("return rows;"); //$NON-NLS-1$ if (context.getPlugins() .clientUpdateByExampleWithoutBLOBsMethodGenerated(method, topLevelClass, introspectedTable)) { topLevelClass.addImportedTypes(importedTypes); topLevelClass.addMethod(method); } } @Override public void addInterfaceElements(Interface interfaze) { if (getExampleMethodVisibility() == JavaVisibility.PUBLIC) { Set<FullyQualifiedJavaType> importedTypes = new TreeSet<FullyQualifiedJavaType>(); Method method = getMethodShell(importedTypes); if (context.getPlugins() .clientUpdateByExampleWithoutBLOBsMethodGenerated(method, interfaze, introspectedTable)) { interfaze.addImportedTypes(importedTypes); interfaze.addMethod(method); } } } private Method getMethodShell(Set<FullyQualifiedJavaType> importedTypes) { FullyQualifiedJavaType parameterType; if (introspectedTable.getRules().generateBaseRecordClass()) { parameterType = new FullyQualifiedJavaType(introspectedTable .getBaseRecordType()); } else { parameterType = new FullyQualifiedJavaType(introspectedTable .getPrimaryKeyType()); } importedTypes.add(parameterType); Method method = new Method(); method.setVisibility(getExampleMethodVisibility()); method.setReturnType(FullyQualifiedJavaType.getIntInstance()); method.setName(getDAOMethodNameCalculator() .getUpdateByExampleWithoutBLOBsMethodName(introspectedTable)); method.addParameter(new Parameter(parameterType, "record")); //$NON-NLS-1$ method.addParameter(new Parameter(new FullyQualifiedJavaType( introspectedTable.getExampleType()), "example")); //$NON-NLS-1$ for (FullyQualifiedJavaType fqjt : daoTemplate.getCheckedExceptions()) { method.addException(fqjt); importedTypes.add(fqjt); } context.getCommentGenerator().addGeneralMethodComment(method, introspectedTable); return method; } }
li24361/mybatis-generator-core
src/main/java/org/mybatis/generator/codegen/ibatis2/dao/elements/UpdateByExampleWithoutBLOBsMethodGenerator.java
Java
apache-2.0
4,329
package jp.teraparser.transition; import java.util.Arrays; /** * Resizable-array implementation of Deque which works like java.util.ArrayDeque * * jp.teraparser.util * * @author Hiroki Teranishi */ public class Stack implements Cloneable { private static final int MIN_INITIAL_CAPACITY = 8; private int[] elements; private int head; private int tail; /** * Allocates empty array to hold the given number of elements. */ private void allocateElements(int numElements) { int initialCapacity = MIN_INITIAL_CAPACITY; // Find the best power of two to hold elements. // Tests "<=" because arrays aren't kept full. if (numElements >= initialCapacity) { initialCapacity = numElements; initialCapacity |= (initialCapacity >>> 1); initialCapacity |= (initialCapacity >>> 2); initialCapacity |= (initialCapacity >>> 4); initialCapacity |= (initialCapacity >>> 8); initialCapacity |= (initialCapacity >>> 16); initialCapacity++; if (initialCapacity < 0) { // Too many elements, must back off initialCapacity >>>= 1;// Good luck allocating 2 ^ 30 elements } } elements = new int[initialCapacity]; } /** * Doubles the capacity of this deque. Call only when full, i.e., * when head and tail have wrapped around to become equal. */ private void doubleCapacity() { assert head == tail; int p = head; int n = elements.length; int r = n - p; // number of elements to the right of p int newCapacity = n << 1; if (newCapacity < 0) { throw new IllegalStateException("Sorry, deque too big"); } int[] a = new int[newCapacity]; System.arraycopy(elements, p, a, 0, r); System.arraycopy(elements, 0, a, r, p); elements = a; head = 0; tail = n; } public Stack() { elements = new int[16]; } public Stack(int numElements) { allocateElements(numElements); } public void push(int e) { elements[head = (head - 1) & (elements.length - 1)] = e; if (head == tail) { doubleCapacity(); } } public int pop() { int h = head; int result = elements[h]; elements[h] = 0; head = (h + 1) & (elements.length - 1); return result; } public int top() { return elements[head]; } public int getFirst() { return top(); } public int get(int position, int defaultValue) { if (position < 0 || position >= size()) { return defaultValue; } int mask = elements.length - 1; int h = head; for (int i = 0; i < position; i++) { h = (h + 1) & mask; } return elements[h]; } public int size() { return (tail - head) & (elements.length - 1); } public boolean isEmpty() { return head == tail; } public Stack clone() { try { Stack result = (Stack) super.clone(); result.elements = Arrays.copyOf(elements, elements.length); return result; } catch (CloneNotSupportedException e) { throw new AssertionError(); } } }
chantera/teraparser
src/jp/teraparser/transition/Stack.java
Java
apache-2.0
3,381
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * PdxObject.cpp * * Created on: Sep 29, 2011 * Author: npatel */ #include "PdxType.hpp" using namespace apache::geode::client; using namespace PdxTests; template <typename T1, typename T2> bool PdxTests::PdxType::genericValCompare(T1 value1, T2 value2) const { if (value1 != value2) return false; LOGINFO("PdxObject::genericValCompare Line_19"); return true; } template <typename T1, typename T2> bool PdxTests::PdxType::genericCompare(T1* value1, T2* value2, int length) const { int i = 0; while (i < length) { if (value1[i] != value2[i]) { return false; } else { i++; } } LOGINFO("PdxObject::genericCompare Line_34"); return true; } template <typename T1, typename T2> bool PdxTests::PdxType::generic2DCompare(T1** value1, T2** value2, int length, int* arrLengths) const { LOGINFO("generic2DCompare length = %d ", length); LOGINFO("generic2DCompare value1 = %d \t value2", value1[0][0], value2[0][0]); LOGINFO("generic2DCompare value1 = %d \t value2", value1[1][0], value2[1][0]); LOGINFO("generic2DCompare value1 = %d \t value2", value1[1][1], value2[1][1]); for (int j = 0; j < length; j++) { LOGINFO("generic2DCompare arrlength0 = %d ", arrLengths[j]); for (int k = 0; k < arrLengths[j]; k++) { LOGINFO("generic2DCompare arrlength = %d ", arrLengths[j]); LOGINFO("generic2DCompare value1 = %d \t value2 = %d ", value1[j][k], value2[j][k]); if (value1[j][k] != value2[j][k]) return false; } } LOGINFO("PdxObject::genericCompare Line_34"); return true; } // PdxType::~PdxObject() { //} void PdxTests::PdxType::toData(PdxWriterPtr pw) /*const*/ { // TODO:delete it later int* lengthArr = new int[2]; lengthArr[0] = 1; lengthArr[1] = 2; pw->writeArrayOfByteArrays("m_byteByteArray", m_byteByteArray, 2, lengthArr); pw->writeWideChar("m_char", m_char); pw->markIdentityField("m_char"); pw->writeBoolean("m_bool", m_bool); // 1 pw->markIdentityField("m_bool"); pw->writeBooleanArray("m_boolArray", m_boolArray, 3); pw->markIdentityField("m_boolArray"); pw->writeByte("m_byte", m_byte); pw->markIdentityField("m_byte"); pw->writeByteArray("m_byteArray", m_byteArray, 2); pw->markIdentityField("m_byteArray"); pw->writeWideCharArray("m_charArray", m_charArray, 2); pw->markIdentityField("m_charArray"); pw->writeObject("m_arraylist", m_arraylist); pw->writeObject("m_linkedlist", m_linkedlist); pw->markIdentityField("m_arraylist"); pw->writeObject("m_map", m_map); pw->markIdentityField("m_map"); pw->writeObject("m_hashtable", m_hashtable); pw->markIdentityField("m_hashtable"); pw->writeObject("m_vector", m_vector); pw->markIdentityField("m_vector"); pw->writeObject("m_chs", m_chs); pw->markIdentityField("m_chs"); pw->writeObject("m_clhs", m_clhs); pw->markIdentityField("m_clhs"); pw->writeString("m_string", m_string); pw->markIdentityField("m_string"); pw->writeDate("m_dateTime", m_date); pw->markIdentityField("m_dateTime"); pw->writeDouble("m_double", m_double); pw->markIdentityField("m_double"); pw->writeDoubleArray("m_doubleArray", m_doubleArray, 2); pw->markIdentityField("m_doubleArray"); pw->writeFloat("m_float", m_float); pw->markIdentityField("m_float"); pw->writeFloatArray("m_floatArray", m_floatArray, 2); pw->markIdentityField("m_floatArray"); pw->writeShort("m_int16", m_int16); pw->markIdentityField("m_int16"); pw->writeInt("m_int32", m_int32); pw->markIdentityField("m_int32"); pw->writeLong("m_long", m_long); pw->markIdentityField("m_long"); pw->writeIntArray("m_int32Array", m_int32Array, 4); pw->markIdentityField("m_int32Array"); pw->writeLongArray("m_longArray", m_longArray, 2); pw->markIdentityField("m_longArray"); pw->writeShortArray("m_int16Array", m_int16Array, 2); pw->markIdentityField("m_int16Array"); pw->writeByte("m_sbyte", m_sbyte); pw->markIdentityField("m_sbyte"); pw->writeByteArray("m_sbyteArray", m_sbyteArray, 2); pw->markIdentityField("m_sbyteArray"); // int* strlengthArr = new int[2]; // strlengthArr[0] = 5; // strlengthArr[1] = 5; pw->writeStringArray("m_stringArray", m_stringArray, 2); pw->markIdentityField("m_stringArray"); pw->writeShort("m_uint16", m_uint16); pw->markIdentityField("m_uint16"); pw->writeInt("m_uint32", m_uint32); pw->markIdentityField("m_uint32"); pw->writeLong("m_ulong", m_ulong); pw->markIdentityField("m_ulong"); pw->writeIntArray("m_uint32Array", m_uint32Array, 4); pw->markIdentityField("m_uint32Array"); pw->writeLongArray("m_ulongArray", m_ulongArray, 2); pw->markIdentityField("m_ulongArray"); pw->writeShortArray("m_uint16Array", m_uint16Array, 2); pw->markIdentityField("m_uint16Array"); pw->writeByteArray("m_byte252", m_byte252, 252); pw->markIdentityField("m_byte252"); pw->writeByteArray("m_byte253", m_byte253, 253); pw->markIdentityField("m_byte253"); pw->writeByteArray("m_byte65535", m_byte65535, 65535); pw->markIdentityField("m_byte65535"); pw->writeByteArray("m_byte65536", m_byte65536, 65536); pw->markIdentityField("m_byte65536"); pw->writeObject("m_pdxEnum", m_pdxEnum); pw->markIdentityField("m_pdxEnum"); pw->writeObject("m_address", m_objectArray); pw->writeObjectArray("m_objectArray", m_objectArray); pw->writeObjectArray("", m_objectArrayEmptyPdxFieldName); LOGDEBUG("PdxObject::writeObject() for enum Done......"); LOGDEBUG("PdxObject::toData() Done......"); // TODO:delete it later } void PdxTests::PdxType::fromData(PdxReaderPtr pr) { // TODO:temp added, delete later int32_t* Lengtharr; GF_NEW(Lengtharr, int32_t[2]); int32_t arrLen = 0; m_byteByteArray = pr->readArrayOfByteArrays("m_byteByteArray", arrLen, &Lengtharr); // TODO::need to write compareByteByteArray() and check for m_byteByteArray // elements m_char = pr->readWideChar("m_char"); // GenericValCompare m_bool = pr->readBoolean("m_bool"); // GenericValCompare m_boolArray = pr->readBooleanArray("m_boolArray", boolArrayLen); m_byte = pr->readByte("m_byte"); m_byteArray = pr->readByteArray("m_byteArray", byteArrayLen); m_charArray = pr->readWideCharArray("m_charArray", charArrayLen); m_arraylist = pr->readObject("m_arraylist"); m_linkedlist = dynCast<CacheableLinkedListPtr>(pr->readObject("m_linkedlist")); m_map = dynCast<CacheableHashMapPtr>(pr->readObject("m_map")); // TODO:Check for the size m_hashtable = pr->readObject("m_hashtable"); // TODO:Check for the size m_vector = pr->readObject("m_vector"); // TODO::Check for size m_chs = pr->readObject("m_chs"); // TODO::Size check m_clhs = pr->readObject("m_clhs"); // TODO:Size check m_string = pr->readString("m_string"); // GenericValCompare m_date = pr->readDate("m_dateTime"); // compareData m_double = pr->readDouble("m_double"); m_doubleArray = pr->readDoubleArray("m_doubleArray", doubleArrayLen); m_float = pr->readFloat("m_float"); m_floatArray = pr->readFloatArray("m_floatArray", floatArrayLen); m_int16 = pr->readShort("m_int16"); m_int32 = pr->readInt("m_int32"); m_long = pr->readLong("m_long"); m_int32Array = pr->readIntArray("m_int32Array", intArrayLen); m_longArray = pr->readLongArray("m_longArray", longArrayLen); m_int16Array = pr->readShortArray("m_int16Array", shortArrayLen); m_sbyte = pr->readByte("m_sbyte"); m_sbyteArray = pr->readByteArray("m_sbyteArray", byteArrayLen); m_stringArray = pr->readStringArray("m_stringArray", strLenArray); m_uint16 = pr->readShort("m_uint16"); m_uint32 = pr->readInt("m_uint32"); m_ulong = pr->readLong("m_ulong"); m_uint32Array = pr->readIntArray("m_uint32Array", intArrayLen); m_ulongArray = pr->readLongArray("m_ulongArray", longArrayLen); m_uint16Array = pr->readShortArray("m_uint16Array", shortArrayLen); // LOGINFO("PdxType::readInt() start..."); m_byte252 = pr->readByteArray("m_byte252", m_byte252Len); m_byte253 = pr->readByteArray("m_byte253", m_byte253Len); m_byte65535 = pr->readByteArray("m_byte65535", m_byte65535Len); m_byte65536 = pr->readByteArray("m_byte65536", m_byte65536Len); // TODO:Check for size m_pdxEnum = pr->readObject("m_pdxEnum"); m_address = pr->readObject("m_address"); // size chaeck m_objectArray = pr->readObjectArray("m_objectArray"); m_objectArrayEmptyPdxFieldName = pr->readObjectArray(""); // Check for individual elements // TODO:temp added delete it later LOGINFO("PdxObject::readObject() for enum Done..."); } CacheableStringPtr PdxTests::PdxType::toString() const { char idbuf[1024]; // sprintf(idbuf,"PdxObject: [ m_bool=%d ] [m_byte=%d] [m_int16=%d] // [m_int32=%d] [m_float=%f] [m_double=%lf] [ m_string=%s ]",m_bool, m_byte, // m_int16, m_int32, m_float, m_double, m_string); sprintf(idbuf, "PdxObject:[m_int32=%d]", m_int32); return CacheableString::create(idbuf); } bool PdxTests::PdxType::equals(PdxTests::PdxType& other, bool isPdxReadSerialized) const { PdxType* ot = dynamic_cast<PdxType*>(&other); if (ot == NULL) { return false; } if (ot == this) { return true; } genericValCompare(ot->m_int32, m_int32); genericValCompare(ot->m_bool, m_bool); genericValCompare(ot->m_byte, m_byte); genericValCompare(ot->m_int16, m_int16); genericValCompare(ot->m_long, m_long); genericValCompare(ot->m_float, m_float); genericValCompare(ot->m_double, m_double); genericValCompare(ot->m_sbyte, m_sbyte); genericValCompare(ot->m_uint16, m_uint16); genericValCompare(ot->m_uint32, m_uint32); genericValCompare(ot->m_ulong, m_ulong); genericValCompare(ot->m_char, m_char); if (strcmp(ot->m_string, m_string) != 0) { return false; } genericCompare(ot->m_byteArray, m_byteArray, byteArrayLen); genericCompare(ot->m_int16Array, m_int16Array, shortArrayLen); genericCompare(ot->m_int32Array, m_int32Array, intArrayLen); genericCompare(ot->m_longArray, m_longArray, longArrayLen); genericCompare(ot->m_doubleArray, m_doubleArray, doubleArrayLen); genericCompare(ot->m_floatArray, m_floatArray, floatArrayLen); genericCompare(ot->m_uint32Array, m_uint32Array, intArrayLen); genericCompare(ot->m_ulongArray, m_ulongArray, longArrayLen); genericCompare(ot->m_uint16Array, m_uint16Array, shortArrayLen); genericCompare(ot->m_sbyteArray, m_sbyteArray, shortArrayLen); genericCompare(ot->m_charArray, m_charArray, charArrayLen); // generic2DCompare(ot->m_byteByteArray, m_byteByteArray, byteByteArrayLen, // lengthArr); if (!isPdxReadSerialized) { for (int i = 0; i < m_objectArray->size(); i++) { Address* otherAddr1 = dynamic_cast<Address*>(ot->m_objectArray->at(i).ptr()); Address* myAddr1 = dynamic_cast<Address*>(m_objectArray->at(i).ptr()); if (!otherAddr1->equals(*myAddr1)) return false; } LOGINFO("PdxObject::equals isPdxReadSerialized = %d", isPdxReadSerialized); } // m_objectArrayEmptyPdxFieldName if (!isPdxReadSerialized) { for (int i = 0; i < m_objectArrayEmptyPdxFieldName->size(); i++) { Address* otherAddr1 = dynamic_cast<Address*>(ot->m_objectArray->at(i).ptr()); Address* myAddr1 = dynamic_cast<Address*>(m_objectArray->at(i).ptr()); if (!otherAddr1->equals(*myAddr1)) return false; } LOGINFO("PdxObject::equals Empty Field Name isPdxReadSerialized = %d", isPdxReadSerialized); } CacheableEnumPtr myenum = dynCast<CacheableEnumPtr>(m_pdxEnum); CacheableEnumPtr otenum = dynCast<CacheableEnumPtr>(ot->m_pdxEnum); if (myenum->getEnumOrdinal() != otenum->getEnumOrdinal()) return false; if (strcmp(myenum->getEnumClassName(), otenum->getEnumClassName()) != 0) { return false; } if (strcmp(myenum->getEnumName(), otenum->getEnumName()) != 0) return false; genericValCompare(ot->m_arraylist->size(), m_arraylist->size()); for (int k = 0; k < m_arraylist->size(); k++) { genericValCompare(ot->m_arraylist->at(k), m_arraylist->at(k)); } LOGINFO("Equals Linked List Starts"); genericValCompare(ot->m_linkedlist->size(), m_linkedlist->size()); for (int k = 0; k < m_linkedlist->size(); k++) { genericValCompare(ot->m_linkedlist->at(k), m_linkedlist->at(k)); } LOGINFO("Equals Linked List Finished"); genericValCompare(ot->m_vector->size(), m_vector->size()); for (int j = 0; j < m_vector->size(); j++) { genericValCompare(ot->m_vector->at(j), m_vector->at(j)); } LOGINFO("PdxObject::equals DOne Line_201"); return true; }
PivotalSarge/geode-native
src/tests/cpp/testobject/PdxType.cpp
C++
apache-2.0
13,394
package ppp.menu; import java.awt.image.BufferedImage; public abstract interface Menu { public abstract void up(); public abstract void down(); public abstract void enter(); public abstract void escape(); public abstract BufferedImage getImage(); }
mzijlstra/java-games
ppp/menu/Menu.java
Java
apache-2.0
256
{% extends "horizon/common/_modal_form.html" %} {% load i18n %} {% block modal-body-right %} <div class="quota-dynamic"> <p>{% blocktrans %}Create a Consistency Group that will contain newly created volumes cloned from each of the snapshots in the source Consistency Group Snapshot.{% endblocktrans %}</p> {% include "admin/volumes/_volume_limits.html" with usages=usages %} </div> {% endblock %}
xuweiliang/Codelibrary
openstack_dashboard/dashboards/admin/volumes_back/templates/volumes/cg_snapshots/_create.html
HTML
apache-2.0
410
require File.join(File.dirname(__FILE__), '..', 'cloudstack_rest') Puppet::Type.type(:cloudstack_network_provider).provide :rest, :parent => Puppet::Provider::CloudstackRest do desc "REST provider for Cloudstack Network Service Provider" mk_resource_methods def flush if @property_flush[:ensure] == :absent deleteNetworkServiceProvider return end if @property_flush[:ensure] != :absent return if createNetworkServiceProvider end if @property_flush[:ensure] == :enabled enableNetworkServiceProvider return end if @property_flush[:ensure] == :shutdown shutdownNetworkServiceProvider return end if @property_flush[:ensure] == :disabled disableNetworkServiceProvider return end updateNetworkServiceProvider end def self.instances result = Array.new list = get_objects(:listNetworkServiceProviders, "networkserviceprovider") if list != nil list.each do |object| map = getNetworkServiceProvider(object) if map != nil #Puppet.debug "Network Service Provider: "+map.inspect result.push(new(map)) end end end result end def self.getNetworkServiceProvider(object) if object["name"] != nil physicalnetwork = genericLookup(:listPhysicalNetworks, "physicalnetwork", 'id', object["physicalnetworkid"], {}, 'name') { :id => object["id"], :name => physicalnetwork+'_'+object["name"], :service_provider => object["name"], :physicalnetworkid => object["physicalnetworkid"], :physicalnetwork => physicalnetwork, :state => object["state"].downcase, :ensure => :present } end end # TYPE SPECIFIC def setState(state) @property_flush[:ensure] = state end def getState @property_hash[:state] end private def createNetworkServiceProvider if @property_hash.empty? Puppet.debug "Create Network Service Provider "+resource[:name] physicalnetworkid = self.class.genericLookup(:listPhysicalNetworks, "physicalnetwork", 'name', resource[:physicalnetwork], {}, 'id') params = { :name => resource[:service_provider], :physicalnetworkid => physicalnetworkid, } Puppet.debug "addNetworkServiceProvider PARAMS = "+params.inspect response = self.class.http_get('addNetworkServiceProvider', params) self.class.wait_for_async_call(response["jobid"]) return true end false end def deleteNetworkServiceProvider Puppet.debug "Delete Network Service Provider "+resource[:name] id = lookupId params = { :id => id, } Puppet.debug "deleteNetworkServiceProvider PARAMS = "+params.inspect # response = self.class.http_get('deleteNetworkServiceProvider', params) # self.class.wait_for_async_call(response["jobid"]) end def updateNetwork Puppet.debug "Update Network Service Provider "+resource[:name] raise "Network Service Provider only allows update for servicelist, which is currently not supported by this Puppet Module" end def updateState(state) id = lookupId params = { :id => id, :state => state, } Puppet.debug "updateNetworkServiceProvider PARAMS = "+params.inspect response = self.class.http_get('updateNetworkServiceProvider', params) self.class.wait_for_async_call(response["jobid"]) end def enableNetworkServiceProvider Puppet.debug "Enable Network Service Provider "+resource[:name] updateState('Enabled') end def disableNetworkServiceProvider Puppet.debug "Disable Network Service Provider "+resource[:name] updateState('Disabled') end def shutdownNetworkServiceProvider Puppet.debug "Shutdown Network Service Provider "+resource[:name] updateState('Shutdown') end def lookupId physicalnetworkid = self.class.genericLookup(:listPhysicalNetworks, "physicalnetwork", 'name', resource[:physicalnetwork], {}, 'id') params = { :physicalnetworkid => physicalnetworkid } return self.class.genericLookup(:listNetworkServiceProviders, "networkserviceprovider", 'name', resource[:service_provider], {}, 'id') end end
Lavaburn/puppet-cloudstack
lib/puppet/provider/cloudstack_network_provider/rest.rb
Ruby
apache-2.0
4,563
package org.hablapps.meetup.common.logic object Domain{ case class User( uid: Option[Int] = None, name: String ) case class Group( id: Option[Int] = None, name: String, city: String, must_approve: Boolean ) case class Member( mid: Option[Int] = None, uid: Int, gid: Int ) case class JoinRequest( jid: Option[Int] = None, uid: Int, gid: Int ) type JoinResponse = Either[JoinRequest, Member] }
hablapps/meetapp
app/common/logic/Domain.scala
Scala
apache-2.0
466
/* * */ package org.utilities; import java.math.BigInteger; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.concurrent.Callable; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; // TODO: Auto-generated Javadoc /** * The Class CUtils. */ public class CUtils { /** * Work. * * @param task * the task * @return the object */ public static Object work(Callable<?> task) { Future<?> futureTask = es.submit(task); return futureTask; } /** * Gets the random string. * * @param rndSeed the rnd seed * @return the random string */ public static String getRandomString(double rndSeed) { MessageDigest m; try { m = MessageDigest.getInstance("MD5"); byte[] data = ("" + rndSeed).getBytes(); m.update(data, 0, data.length); BigInteger i = new BigInteger(1, m.digest()); return String.format("%1$032X", i); } catch (NoSuchAlgorithmException e) { } return "" + rndSeed; } /** * Gets the random number. * * @param s the s * @return the random number * @throws Exception the exception */ public static int getRandomNumber(String s) throws Exception { MessageDigest m; try { m = MessageDigest.getInstance("MD5"); byte[] data = s.getBytes(); m.update(data, 0, data.length); BigInteger i = new BigInteger(1, m.digest()); return i.intValue(); } catch (NoSuchAlgorithmException e) { } throw new Exception("Cannot generate random number"); } /** The Constant es. */ private final static ExecutorService es = Executors.newCachedThreadPool(); /** * Instantiates a new c utils. */ private CUtils() { } }
sarathrami/Chain-Replication
src/org/utilities/CUtils.java
Java
apache-2.0
1,735
/* Copyright 2020 Telstra Open Source * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.openkilda.floodlight.switchmanager; import static java.util.Collections.singletonList; import static org.projectfloodlight.openflow.protocol.OFVersion.OF_12; import static org.projectfloodlight.openflow.protocol.OFVersion.OF_13; import net.floodlightcontroller.core.IOFSwitch; import net.floodlightcontroller.util.FlowModUtils; import org.projectfloodlight.openflow.protocol.OFFactory; import org.projectfloodlight.openflow.protocol.OFFlowMod; import org.projectfloodlight.openflow.protocol.OFMeterFlags; import org.projectfloodlight.openflow.protocol.OFMeterMod; import org.projectfloodlight.openflow.protocol.OFMeterModCommand; import org.projectfloodlight.openflow.protocol.action.OFAction; import org.projectfloodlight.openflow.protocol.action.OFActions; import org.projectfloodlight.openflow.protocol.instruction.OFInstruction; import org.projectfloodlight.openflow.protocol.instruction.OFInstructionApplyActions; import org.projectfloodlight.openflow.protocol.meterband.OFMeterBandDrop; import org.projectfloodlight.openflow.protocol.oxm.OFOxms; import org.projectfloodlight.openflow.types.DatapathId; import org.projectfloodlight.openflow.types.EthType; import org.projectfloodlight.openflow.types.MacAddress; import org.projectfloodlight.openflow.types.OFBufferId; import org.projectfloodlight.openflow.types.OFPort; import org.projectfloodlight.openflow.types.OFVlanVidMatch; import org.projectfloodlight.openflow.types.TableId; import org.projectfloodlight.openflow.types.TransportPort; import org.projectfloodlight.openflow.types.U64; import java.util.Arrays; import java.util.List; import java.util.Set; /** * Utils for switch flow generation. */ public final class SwitchFlowUtils { /** * OVS software switch manufacturer constant value. */ public static final String OVS_MANUFACTURER = "Nicira, Inc."; /** * Indicates the maximum size in bytes for a packet which will be send from switch to the controller. */ private static final int MAX_PACKET_LEN = 0xFFFFFFFF; private SwitchFlowUtils() { } /** * Create a MAC address based on the DPID. * * @param dpId switch object * @return {@link MacAddress} */ public static MacAddress convertDpIdToMac(DatapathId dpId) { return MacAddress.of(Arrays.copyOfRange(dpId.getBytes(), 2, 8)); } /** * Create sent to controller OpenFlow action. * * @param ofFactory OpenFlow factory * @return OpenFlow Action */ public static OFAction actionSendToController(OFFactory ofFactory) { OFActions actions = ofFactory.actions(); return actions.buildOutput().setMaxLen(MAX_PACKET_LEN).setPort(OFPort.CONTROLLER) .build(); } /** * Create an OFAction which sets the output port. * * @param ofFactory OF factory for the switch * @param outputPort port to set in the action * @return {@link OFAction} */ public static OFAction actionSetOutputPort(final OFFactory ofFactory, final OFPort outputPort) { OFActions actions = ofFactory.actions(); return actions.buildOutput().setMaxLen(MAX_PACKET_LEN).setPort(outputPort).build(); } /** * Create go to table OFInstruction. * * @param ofFactory OF factory for the switch * @param tableId tableId to go * @return {@link OFAction} */ public static OFInstruction instructionGoToTable(final OFFactory ofFactory, final TableId tableId) { return ofFactory.instructions().gotoTable(tableId); } /** * Create an OFInstructionApplyActions which applies actions. * * @param ofFactory OF factory for the switch * @param actionList OFAction list to apply * @return {@link OFInstructionApplyActions} */ public static OFInstructionApplyActions buildInstructionApplyActions(OFFactory ofFactory, List<OFAction> actionList) { return ofFactory.instructions().applyActions(actionList).createBuilder().build(); } /** * Create set destination MAC address OpenFlow action. * * @param ofFactory OpenFlow factory * @param macAddress MAC address to set * @return OpenFlow Action */ public static OFAction actionSetDstMac(OFFactory ofFactory, final MacAddress macAddress) { OFOxms oxms = ofFactory.oxms(); OFActions actions = ofFactory.actions(); return actions.buildSetField() .setField(oxms.buildEthDst().setValue(macAddress).build()).build(); } /** * Create set source MAC address OpenFlow action. * * @param ofFactory OpenFlow factory * @param macAddress MAC address to set * @return OpenFlow Action */ public static OFAction actionSetSrcMac(OFFactory ofFactory, final MacAddress macAddress) { return ofFactory.actions().buildSetField() .setField(ofFactory.oxms().ethSrc(macAddress)).build(); } /** * Create set UDP source port OpenFlow action. * * @param ofFactory OpenFlow factory * @param srcPort UDP src port to set * @return OpenFlow Action */ public static OFAction actionSetUdpSrcAction(OFFactory ofFactory, TransportPort srcPort) { OFOxms oxms = ofFactory.oxms(); return ofFactory.actions().setField(oxms.udpSrc(srcPort)); } /** * Create set UDP destination port OpenFlow action. * * @param ofFactory OpenFlow factory * @param dstPort UDP dst port to set * @return OpenFlow Action */ public static OFAction actionSetUdpDstAction(OFFactory ofFactory, TransportPort dstPort) { OFOxms oxms = ofFactory.oxms(); return ofFactory.actions().setField(oxms.udpDst(dstPort)); } /** * Create OpenFlow flow modification command builder. * * @param ofFactory OpenFlow factory * @param cookie cookie * @param priority priority * @param tableId table id * @return OpenFlow command builder */ public static OFFlowMod.Builder prepareFlowModBuilder(OFFactory ofFactory, long cookie, int priority, int tableId) { OFFlowMod.Builder fmb = ofFactory.buildFlowAdd(); fmb.setIdleTimeout(FlowModUtils.INFINITE_TIMEOUT); fmb.setHardTimeout(FlowModUtils.INFINITE_TIMEOUT); fmb.setBufferId(OFBufferId.NO_BUFFER); fmb.setCookie(U64.of(cookie)); fmb.setPriority(priority); fmb.setTableId(TableId.of(tableId)); return fmb; } /** * Create OpenFlow meter modification command. * * @param ofFactory OpenFlow factory * @param bandwidth bandwidth * @param burstSize burst size * @param meterId meter id * @param flags flags * @param commandType ADD, MODIFY or DELETE * @return OpenFlow command */ public static OFMeterMod buildMeterMod(OFFactory ofFactory, long bandwidth, long burstSize, long meterId, Set<OFMeterFlags> flags, OFMeterModCommand commandType) { OFMeterBandDrop.Builder bandBuilder = ofFactory.meterBands() .buildDrop() .setRate(bandwidth) .setBurstSize(burstSize); OFMeterMod.Builder meterModBuilder = ofFactory.buildMeterMod() .setMeterId(meterId) .setCommand(commandType) .setFlags(flags); if (ofFactory.getVersion().compareTo(OF_13) > 0) { meterModBuilder.setBands(singletonList(bandBuilder.build())); } else { meterModBuilder.setMeters(singletonList(bandBuilder.build())); } return meterModBuilder.build(); } /** * Create an OFAction to add a VLAN header. * * @param ofFactory OF factory for the switch * @param etherType ethernet type of the new VLAN header * @return {@link OFAction} */ public static OFAction actionPushVlan(final OFFactory ofFactory, final int etherType) { OFActions actions = ofFactory.actions(); return actions.buildPushVlan().setEthertype(EthType.of(etherType)).build(); } /** * Create an OFAction to change the outer most vlan. * * @param factory OF factory for the switch * @param newVlan final VLAN to be set on the packet * @return {@link OFAction} */ public static OFAction actionReplaceVlan(final OFFactory factory, final int newVlan) { OFOxms oxms = factory.oxms(); OFActions actions = factory.actions(); if (OF_12.compareTo(factory.getVersion()) == 0) { return actions.buildSetField().setField(oxms.buildVlanVid() .setValue(OFVlanVidMatch.ofRawVid((short) newVlan)) .build()).build(); } else { return actions.buildSetField().setField(oxms.buildVlanVid() .setValue(OFVlanVidMatch.ofVlan(newVlan)) .build()).build(); } } /** * Check switch is OVS. * * @param sw switch * @return true if switch is OVS */ public static boolean isOvs(IOFSwitch sw) { return OVS_MANUFACTURER.equals(sw.getSwitchDescription().getManufacturerDescription()); } }
telstra/open-kilda
src-java/floodlight-service/floodlight-modules/src/main/java/org/openkilda/floodlight/switchmanager/SwitchFlowUtils.java
Java
apache-2.0
9,966
select fn_db_add_config_value('LiveSnapshotEnabled','false','2.2'); select fn_db_add_config_value('LiveSnapshotEnabled','false','3.0'); select fn_db_add_config_value('LiveSnapshotEnabled','true','3.1');
Dhandapani/gluster-ovirt
backend/manager/dbscripts/upgrade/03_01_0670_add_live_snapshot_enabled_config.sql
SQL
apache-2.0
203
package com.rasterfoundry.common.ast import cats.implicits._ import geotrellis.raster._ import geotrellis.raster.mapalgebra.focal._ import geotrellis.vector.MultiPolygon import java.util.UUID /** The ur-type for a recursive representation of MapAlgebra operations */ sealed trait MapAlgebraAST extends Product with Serializable { def id: UUID def args: List[MapAlgebraAST] def metadata: Option[NodeMetadata] def find(id: UUID): Option[MapAlgebraAST] def sources: Seq[MapAlgebraAST.MapAlgebraLeaf] def tileSources: Set[RFMLRaster] = { val tileList: List[RFMLRaster] = this match { case r: RFMLRaster => List(r) case _: MapAlgebraAST.MapAlgebraLeaf => List() case ast => ast.args.flatMap(_.tileSources) } tileList.toSet } def substitute(substitutions: Map[UUID, MapAlgebraAST]): Option[MapAlgebraAST] def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST def withMetadata(newMd: NodeMetadata): MapAlgebraAST def bufferedSources(buffered: Boolean = false): Set[UUID] = { val bufferList = this match { case f: MapAlgebraAST.FocalOperation => f.args.flatMap(_.bufferedSources(true)) case op: MapAlgebraAST.Operation => op.args.flatMap(_.bufferedSources(buffered)) // case MapAlgebraAST.Source(id, _) => if (buffered) List(id) else List() case _ => List() } bufferList.toSet } } object MapAlgebraAST { /** Map Algebra operations (nodes in this tree) */ sealed trait Operation extends MapAlgebraAST with Serializable { val symbol: String def find(id: UUID): Option[MapAlgebraAST] = if (this.id == id) Some(this) else { val matches = args.flatMap(_.find(id)) matches.headOption } def sources: Seq[MapAlgebraAST.MapAlgebraLeaf] = args.flatMap(_.sources).distinct def substitute( substitutions: Map[UUID, MapAlgebraAST]): Option[MapAlgebraAST] = { val updatedArgs: Option[List[MapAlgebraAST]] = this.args .map({ arg => arg.substitute(substitutions) }) .sequence updatedArgs.map({ newArgs => this.withArgs(newArgs) }) } } /** Operations which should only have one argument. */ final case class Addition(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends Operation { val symbol = "+" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Subtraction(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends Operation { val symbol = "-" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Multiplication(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends Operation { val symbol = "*" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Division(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends Operation { val symbol = "/" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Max(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends Operation { val symbol = "max" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Min(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends Operation { val symbol = "min" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Equality(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends Operation { val symbol = "==" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Inequality(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends Operation { val symbol = "!=" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Greater(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends Operation { val symbol = ">" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class GreaterOrEqual(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends Operation { val symbol = ">=" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Less(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends Operation { val symbol = "<" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class LessOrEqual(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends Operation { val symbol = "<=" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class And(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends Operation { val symbol = "and" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Or(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends Operation { val symbol = "or" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Xor(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends Operation { val symbol = "xor" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Pow(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends Operation { val symbol = "^" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Atan2(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends Operation { val symbol = "atan2" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } sealed trait UnaryOperation extends Operation with Serializable final case class Masking(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata], mask: MultiPolygon) extends UnaryOperation { val symbol = "mask" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Classification(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata], classMap: ClassMap) extends UnaryOperation { val symbol = "classify" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class IsDefined(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "isdefined" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class IsUndefined(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "isundefined" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class SquareRoot(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "sqrt" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Log(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "log" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Log10(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "log10" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Round(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "round" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Floor(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "floor" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Ceil(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "ceil" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class NumericNegation(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "neg" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class LogicalNegation(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "not" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Abs(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "abs" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Sin(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "sin" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Cos(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "cos" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Tan(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "tan" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Sinh(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "sinh" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Cosh(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "cosh" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Tanh(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "tanh" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Asin(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "asin" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Acos(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "acos" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class Atan(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata]) extends UnaryOperation { val symbol = "atan" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } sealed trait FocalOperation extends UnaryOperation { def neighborhood: Neighborhood } final case class FocalMax(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata], neighborhood: Neighborhood) extends FocalOperation { val symbol = "focalMax" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class FocalMin(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata], neighborhood: Neighborhood) extends FocalOperation { val symbol = "focalMin" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class FocalMean(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata], neighborhood: Neighborhood) extends FocalOperation { val symbol = "focalMean" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class FocalMedian(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata], neighborhood: Neighborhood) extends FocalOperation { val symbol = "focalMedian" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class FocalMode(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata], neighborhood: Neighborhood) extends FocalOperation { val symbol = "focalMode" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class FocalSum(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata], neighborhood: Neighborhood) extends FocalOperation { val symbol = "focalSum" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class FocalStdDev(args: List[MapAlgebraAST], id: UUID, metadata: Option[NodeMetadata], neighborhood: Neighborhood) extends FocalOperation { val symbol = "focalStdDev" def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = copy(args = newArgs) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } sealed trait MapAlgebraLeaf extends MapAlgebraAST { val `type`: String def args: List[MapAlgebraAST] = List.empty def find(id: UUID): Option[MapAlgebraAST] = if (this.id == id) Some(this) else None def withArgs(newArgs: List[MapAlgebraAST]): MapAlgebraAST = this } final case class Constant(id: UUID, constant: Double, metadata: Option[NodeMetadata]) extends MapAlgebraLeaf { val `type` = "const" def sources: Seq[MapAlgebraAST.MapAlgebraLeaf] = List() def substitute( substitutions: Map[UUID, MapAlgebraAST]): Option[MapAlgebraAST] = Some(this) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } /** Map Algebra sources */ final case class LiteralTile(id: UUID, lt: Tile, metadata: Option[NodeMetadata]) extends MapAlgebraLeaf { val `type` = "rasterLiteral" def sources: Seq[MapAlgebraAST.MapAlgebraLeaf] = List(this) def substitute( substitutions: Map[UUID, MapAlgebraAST]): Option[MapAlgebraAST] = Some(this) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class ProjectRaster(id: UUID, projId: UUID, band: Option[Int], celltype: Option[CellType], metadata: Option[NodeMetadata]) extends MapAlgebraLeaf with RFMLRaster { val `type` = "projectSrc" def sources: Seq[MapAlgebraAST.MapAlgebraLeaf] = List(this) def substitute( substitutions: Map[UUID, MapAlgebraAST]): Option[MapAlgebraAST] = Some(this) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class LayerRaster(id: UUID, layerId: UUID, band: Option[Int], celltype: Option[CellType], metadata: Option[NodeMetadata]) extends MapAlgebraLeaf with RFMLRaster { val `type` = "layerSrc" def sources: Seq[MapAlgebraAST.MapAlgebraLeaf] = List(this) def substitute( substitutions: Map[UUID, MapAlgebraAST]): Option[MapAlgebraAST] = Some(this) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = copy(metadata = Some(newMd)) } final case class ToolReference(id: UUID, toolId: UUID) extends MapAlgebraLeaf { val `type` = "ref" def metadata: Option[NodeMetadata] = None def sources: List[MapAlgebraAST.MapAlgebraLeaf] = Nil def substitute( substitutions: Map[UUID, MapAlgebraAST]): Option[MapAlgebraAST] = substitutions.get(toolId) def withMetadata(newMd: NodeMetadata): MapAlgebraAST = this } }
raster-foundry/raster-foundry
app-backend/common/src/main/scala/ast/MapAlgebraAST.scala
Scala
apache-2.0
24,012
/* Generated by camel build tools - do NOT edit this file! */ package org.apache.camel.component.nats; import java.util.Map; import org.apache.camel.CamelContext; import org.apache.camel.spi.GeneratedPropertyConfigurer; import org.apache.camel.spi.PropertyConfigurerGetter; import org.apache.camel.util.CaseInsensitiveMap; import org.apache.camel.support.component.PropertyConfigurerSupport; /** * Generated by camel build tools - do NOT edit this file! */ @SuppressWarnings("unchecked") public class NatsComponentConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter { private static final Map<String, Object> ALL_OPTIONS; static { Map<String, Object> map = new CaseInsensitiveMap(); map.put("servers", java.lang.String.class); map.put("verbose", boolean.class); map.put("bridgeErrorHandler", boolean.class); map.put("lazyStartProducer", boolean.class); map.put("basicPropertyBinding", boolean.class); map.put("useGlobalSslContextParameters", boolean.class); ALL_OPTIONS = map; } @Override public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) { NatsComponent target = (NatsComponent) obj; switch (ignoreCase ? name.toLowerCase() : name) { case "basicpropertybinding": case "basicPropertyBinding": target.setBasicPropertyBinding(property(camelContext, boolean.class, value)); return true; case "bridgeerrorhandler": case "bridgeErrorHandler": target.setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true; case "lazystartproducer": case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true; case "servers": target.setServers(property(camelContext, java.lang.String.class, value)); return true; case "useglobalsslcontextparameters": case "useGlobalSslContextParameters": target.setUseGlobalSslContextParameters(property(camelContext, boolean.class, value)); return true; case "verbose": target.setVerbose(property(camelContext, boolean.class, value)); return true; default: return false; } } @Override public Map<String, Object> getAllOptions(Object target) { return ALL_OPTIONS; } @Override public Object getOptionValue(Object obj, String name, boolean ignoreCase) { NatsComponent target = (NatsComponent) obj; switch (ignoreCase ? name.toLowerCase() : name) { case "basicpropertybinding": case "basicPropertyBinding": return target.isBasicPropertyBinding(); case "bridgeerrorhandler": case "bridgeErrorHandler": return target.isBridgeErrorHandler(); case "lazystartproducer": case "lazyStartProducer": return target.isLazyStartProducer(); case "servers": return target.getServers(); case "useglobalsslcontextparameters": case "useGlobalSslContextParameters": return target.isUseGlobalSslContextParameters(); case "verbose": return target.isVerbose(); default: return null; } } }
alvinkwekel/camel
components/camel-nats/src/generated/java/org/apache/camel/component/nats/NatsComponentConfigurer.java
Java
apache-2.0
3,229
from typing import List class Solution: def partitionLabels(self, S: str) -> List[int]: lastPos, seen, currMax = {}, set(), -1 res = [] for i in range(0, 26): c = chr(97+i) lastPos[c] = S.rfind(c) for i, c in enumerate(S): # Encounter new index higher than currMax if i > currMax: res.append(currMax+1) currMax = max(currMax, lastPos[c]) res.append(len(S)) ans = [res[i]-res[i-1] for i in range(1, len(res))] return ans
saisankargochhayat/algo_quest
leetcode/763. Partition Labels/soln.py
Python
apache-2.0
555
package Paws::CloudWatchEvents::RemoveTargets; use Moose; has Ids => (is => 'ro', isa => 'ArrayRef[Str|Undef]', required => 1); has Rule => (is => 'ro', isa => 'Str', required => 1); use MooseX::ClassAttribute; class_has _api_call => (isa => 'Str', is => 'ro', default => 'RemoveTargets'); class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::CloudWatchEvents::RemoveTargetsResponse'); class_has _result_key => (isa => 'Str', is => 'ro'); 1; ### main pod documentation begin ### =head1 NAME Paws::CloudWatchEvents::RemoveTargets - Arguments for method RemoveTargets on Paws::CloudWatchEvents =head1 DESCRIPTION This class represents the parameters used for calling the method RemoveTargets on the Amazon CloudWatch Events service. Use the attributes of this class as arguments to method RemoveTargets. You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to RemoveTargets. As an example: $service_obj->RemoveTargets(Att1 => $value1, Att2 => $value2, ...); Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object. =head1 ATTRIBUTES =head2 B<REQUIRED> Ids => ArrayRef[Str|Undef] The IDs of the targets to remove from the rule. =head2 B<REQUIRED> Rule => Str The name of the rule. =head1 SEE ALSO This class forms part of L<Paws>, documenting arguments for method RemoveTargets in L<Paws::CloudWatchEvents> =head1 BUGS and CONTRIBUTIONS The source code is located here: https://github.com/pplu/aws-sdk-perl Please report bugs to: https://github.com/pplu/aws-sdk-perl/issues =cut
ioanrogers/aws-sdk-perl
auto-lib/Paws/CloudWatchEvents/RemoveTargets.pm
Perl
apache-2.0
1,783
# Welcome to the yMatePlatform! # ![](https://github.com/suninformation/ymateplatform/wiki/images/ymp_logo.png) [![Build Status](https://travis-ci.org/suninformation/ymateplatform.png?branch=master)](https://travis-ci.org/suninformation/ymateplatform) YMP开发框架是一套轻量级的JAVA应用开发框架,具有统一的配置体系结构、系统与业务日志分离、插件化开发模式、简单轻量的MVC和持久化支持等特性; ## 文档目录 ## * [概述](https://github.com/suninformation/ymateplatform/wiki/Home) * [初始化配置文件详细说明](https://github.com/suninformation/ymateplatform/wiki/YMP框架初始化配置文件详细说明) * [配置体系模块使用详解](https://github.com/suninformation/ymateplatform/wiki/YMP框架配置体系模块使用详解) * [日志模块使用详解](https://github.com/suninformation/ymateplatform/wiki/YMP框架日志模块使用详解) * [插件模块使用详解](https://github.com/suninformation/ymateplatform/wiki/YMP框架插件模块使用详解) * [MVC模块使用详解](https://github.com/suninformation/ymateplatform/wiki/YMP框架MVC模块使用详解) * [持久化模块使用详解](https://github.com/suninformation/ymateplatform/wiki/YMP框架持久化模块使用详解) * [验证模块使用详解](https://github.com/suninformation/ymateplatform/wiki/YMP框架验证模块使用详解) * [模块管理器使用详解](https://github.com/suninformation/ymateplatform/wiki/YMP框架模块管理器使用详解) * [框架快速搭建手册](https://github.com/suninformation/ymateplatform/wiki/YMP框架快速搭建手册) * [持久化代码生成器使用详解](https://github.com/suninformation/ymateplatform/wiki/YMP框架持久化代码生成器使用详解)
aglne/ymateplatform
README.md
Markdown
apache-2.0
1,794
package ruboweb.pushetta.back.model; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Table; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.data.jpa.domain.AbstractPersistable; @Entity @Table(name = "user") public class User extends AbstractPersistable<Long> { private static final Logger logger = LoggerFactory.getLogger(User.class); private static final long serialVersionUID = 6088280461151862299L; @Column(nullable = false) private String name; @Column(nullable = false) private String token; public User() { } public User(String name) { this.name = name; this.token = this.generateToken(); } /** * @return the name */ public String getName() { return name; } /** * @param name * the name to set */ public void setName(String name) { this.name = name; } /** * @return the token */ public String getToken() { return token; } /** * @param token * the token to set */ public void setToken(String token) { this.token = token; } private String generateToken() { try { SecureRandom prng = SecureRandom.getInstance("SHA1PRNG"); String randomNum = new Integer(prng.nextInt()).toString(); MessageDigest sha = MessageDigest.getInstance("SHA-1"); byte[] bytes = sha.digest(randomNum.getBytes()); StringBuilder result = new StringBuilder(); char[] digits = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; byte b; for (int idx = 0; idx < bytes.length; ++idx) { b = bytes[idx]; result.append(digits[(b & 240) >> 4]); result.append(digits[b & 15]); } return result.toString(); } catch (NoSuchAlgorithmException ex) { logger.error("generateToken() -- " + ex.getMessage()); } return null; } }
ruboweb/pushetta
src/main/java/ruboweb/pushetta/back/model/User.java
Java
apache-2.0
2,054
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2016.10.09 at 10:10:23 AM CST // package com.elong.nb.model.elong; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import java.util.List; import com.alibaba.fastjson.annotation.JSONField; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for CommentResult complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="CommentResult"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="Count" type="{http://www.w3.org/2001/XMLSchema}int"/> * &lt;element name="Comments" type="{}ArrayOfCommentInfo" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "CommentResult", propOrder = { "count", "comments" }) public class CommentResult { @JSONField(name = "Count") protected int count; @JSONField(name = "Comments") protected List<CommentInfo> comments; /** * Gets the value of the count property. * */ public int getCount() { return count; } /** * Sets the value of the count property. * */ public void setCount(int value) { this.count = value; } /** * Gets the value of the comments property. * * @return * possible object is * {@link List<CommentInfo> } * */ public List<CommentInfo> getComments() { return comments; } /** * Sets the value of the comments property. * * @param value * allowed object is * {@link List<CommentInfo> } * */ public void setComments(List<CommentInfo> value) { this.comments = value; } }
Gaonaifeng/eLong-OpenAPI-H5-demo
nb_demo_h5/src/main/java/com/elong/nb/model/elong/CommentResult.java
Java
apache-2.0
2,314
<?php include_once 'functionCheckLogin.php'; $code_login = login_check($mysqli); if($code_login <0) { header('Location: /index.php'); } ?> <html> <head> <meta name='viewport' content='width=device-width'> <title>Impostazioni generali</title> <link rel='stylesheet' href='css/style_general_settings.css'> </head> <body> <div class='container'> <div id='settings-div'> <h3>Impostazioni generali</h3> <fieldset> <table align=center cellpadding=5> <tr><td><button onClick="location.assign('formChangePassword.php')">Cambia Password</button></td></tr> <tr><td><button onClick="location.assign('<?php if($code_login==1){echo "firstAdmin.php";} else{echo "firstUser.php";}?>')">Torna a Schede</button></td></tr> <?php if($code_login==1){echo "<tr><td><button onClick='location.assign(\"reboot.php\")'>Riavvia dispositivo</button></td></tr>";}?> <?php if($code_login==1){echo "<tr><td><button onClick='location.assign(\"shutdown.php\")'>Spegni dispositivo</button></td></tr>";}?> </table> </fieldset> </div> </div> </body> </html>
antonyflour/RaspuinoRCS
generalSettings.php
PHP
apache-2.0
1,084
// Copyright 2014 The Serviced Authors. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package org.zenoss.app.annotations; import org.springframework.stereotype.Component; /** * Mark an object as an API implementation. */ @Component public @interface API { }
zenoss/zenoss-zapp
java/zenoss-app/src/main/java/org/zenoss/app/annotations/API.java
Java
apache-2.0
773
/* * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.ads.googleads.v9.services; import com.google.ads.googleads.v9.resources.OperatingSystemVersionConstant; import com.google.ads.googleads.v9.services.stub.OperatingSystemVersionConstantServiceStubSettings; import com.google.api.core.ApiFunction; import com.google.api.core.BetaApi; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import java.io.IOException; import java.util.List; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link OperatingSystemVersionConstantServiceClient}. * * <p>The default instance has everything set to sensible defaults: * * <ul> * <li> The default service address (googleads.googleapis.com) and default port (443) are used. * <li> Credentials are acquired automatically through Application Default Credentials. * <li> Retries are configured for idempotent methods but not for non-idempotent methods. * </ul> * * <p>The builder of this class is recursive, so contained classes are themselves builders. When * build() is called, the tree of builders is called to create the complete settings object. * * <p>For example, to set the total timeout of getOperatingSystemVersionConstant to 30 seconds: * * <pre>{@code * OperatingSystemVersionConstantServiceSettings.Builder * operatingSystemVersionConstantServiceSettingsBuilder = * OperatingSystemVersionConstantServiceSettings.newBuilder(); * operatingSystemVersionConstantServiceSettingsBuilder * .getOperatingSystemVersionConstantSettings() * .setRetrySettings( * operatingSystemVersionConstantServiceSettingsBuilder * .getOperatingSystemVersionConstantSettings() * .getRetrySettings() * .toBuilder() * .setTotalTimeout(Duration.ofSeconds(30)) * .build()); * OperatingSystemVersionConstantServiceSettings operatingSystemVersionConstantServiceSettings = * operatingSystemVersionConstantServiceSettingsBuilder.build(); * }</pre> */ @Generated("by gapic-generator-java") public class OperatingSystemVersionConstantServiceSettings extends ClientSettings<OperatingSystemVersionConstantServiceSettings> { /** Returns the object with the settings used for calls to getOperatingSystemVersionConstant. */ public UnaryCallSettings<GetOperatingSystemVersionConstantRequest, OperatingSystemVersionConstant> getOperatingSystemVersionConstantSettings() { return ((OperatingSystemVersionConstantServiceStubSettings) getStubSettings()) .getOperatingSystemVersionConstantSettings(); } public static final OperatingSystemVersionConstantServiceSettings create( OperatingSystemVersionConstantServiceStubSettings stub) throws IOException { return new OperatingSystemVersionConstantServiceSettings.Builder(stub.toBuilder()).build(); } /** Returns a builder for the default ExecutorProvider for this service. */ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { return OperatingSystemVersionConstantServiceStubSettings.defaultExecutorProviderBuilder(); } /** Returns the default service endpoint. */ public static String getDefaultEndpoint() { return OperatingSystemVersionConstantServiceStubSettings.getDefaultEndpoint(); } /** Returns the default service scopes. */ public static List<String> getDefaultServiceScopes() { return OperatingSystemVersionConstantServiceStubSettings.getDefaultServiceScopes(); } /** Returns a builder for the default credentials for this service. */ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { return OperatingSystemVersionConstantServiceStubSettings.defaultCredentialsProviderBuilder(); } /** Returns a builder for the default ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { return OperatingSystemVersionConstantServiceStubSettings.defaultGrpcTransportProviderBuilder(); } public static TransportChannelProvider defaultTransportChannelProvider() { return OperatingSystemVersionConstantServiceStubSettings.defaultTransportChannelProvider(); } @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { return OperatingSystemVersionConstantServiceStubSettings .defaultApiClientHeaderProviderBuilder(); } /** Returns a new builder for this class. */ public static Builder newBuilder() { return Builder.createDefault(); } /** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); } /** Returns a builder containing all the values of this settings class. */ public Builder toBuilder() { return new Builder(this); } protected OperatingSystemVersionConstantServiceSettings(Builder settingsBuilder) throws IOException { super(settingsBuilder); } /** Builder for OperatingSystemVersionConstantServiceSettings. */ public static class Builder extends ClientSettings.Builder<OperatingSystemVersionConstantServiceSettings, Builder> { protected Builder() throws IOException { this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(OperatingSystemVersionConstantServiceStubSettings.newBuilder(clientContext)); } protected Builder(OperatingSystemVersionConstantServiceSettings settings) { super(settings.getStubSettings().toBuilder()); } protected Builder(OperatingSystemVersionConstantServiceStubSettings.Builder stubSettings) { super(stubSettings); } private static Builder createDefault() { return new Builder(OperatingSystemVersionConstantServiceStubSettings.newBuilder()); } public OperatingSystemVersionConstantServiceStubSettings.Builder getStubSettingsBuilder() { return ((OperatingSystemVersionConstantServiceStubSettings.Builder) getStubSettings()); } /** * Applies the given settings updater function to all of the unary API methods in this service. * * <p>Note: This method does not support applying settings to streaming methods. */ public Builder applyToAllUnaryMethods( ApiFunction<UnaryCallSettings.Builder<?, ?>, Void> settingsUpdater) { super.applyToAllUnaryMethods( getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); return this; } /** Returns the builder for the settings used for calls to getOperatingSystemVersionConstant. */ public UnaryCallSettings.Builder< GetOperatingSystemVersionConstantRequest, OperatingSystemVersionConstant> getOperatingSystemVersionConstantSettings() { return getStubSettingsBuilder().getOperatingSystemVersionConstantSettings(); } @Override public OperatingSystemVersionConstantServiceSettings build() throws IOException { return new OperatingSystemVersionConstantServiceSettings(this); } } }
googleads/google-ads-java
google-ads-stubs-v9/src/main/java/com/google/ads/googleads/v9/services/OperatingSystemVersionConstantServiceSettings.java
Java
apache-2.0
8,198
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.6.0_27) on Thu Oct 17 21:44:59 EDT 2013 --> <meta http-equiv="Content-Type" content="text/html" charset="utf-8"> <title>Uses of Class org.apache.solr.update.processor.IgnoreFieldUpdateProcessorFactory (Solr 4.5.1 API)</title> <meta name="date" content="2013-10-17"> <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.apache.solr.update.processor.IgnoreFieldUpdateProcessorFactory (Solr 4.5.1 API)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../org/apache/solr/update/processor/IgnoreFieldUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor">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="../../../../../../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/apache/solr/update/processor//class-useIgnoreFieldUpdateProcessorFactory.html" target="_top">FRAMES</a></li> <li><a href="IgnoreFieldUpdateProcessorFactory.html" target="_top">NO FRAMES</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class org.apache.solr.update.processor.IgnoreFieldUpdateProcessorFactory" class="title">Uses of Class<br>org.apache.solr.update.processor.IgnoreFieldUpdateProcessorFactory</h2> </div> <div class="classUseContainer">No usage of org.apache.solr.update.processor.IgnoreFieldUpdateProcessorFactory</div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../org/apache/solr/update/processor/IgnoreFieldUpdateProcessorFactory.html" title="class in org.apache.solr.update.processor">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="../../../../../../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/apache/solr/update/processor//class-useIgnoreFieldUpdateProcessorFactory.html" target="_top">FRAMES</a></li> <li><a href="IgnoreFieldUpdateProcessorFactory.html" target="_top">NO FRAMES</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small> <i>Copyright &copy; 2000-2013 Apache Software Foundation. All Rights Reserved.</i> <script src='../../../../../../prettify.js' type='text/javascript'></script> <script type='text/javascript'> (function(){ var oldonload = window.onload; if (typeof oldonload != 'function') { window.onload = prettyPrint; } else { window.onload = function() { oldonload(); prettyPrint(); } } })(); </script> </small></p> </body> </html>
kyosuke1008/summary-solr
docs/solr-core/org/apache/solr/update/processor/class-use/IgnoreFieldUpdateProcessorFactory.html
HTML
apache-2.0
5,250
// This file is part of MLDB. Copyright 2015 mldb.ai inc. All rights reserved. /** git.cc Jeremy Barnes, 14 November 2015 Copyright (c) mldb.ai inc. All rights reserved. */ #include "mldb/core/procedure.h" #include "mldb/core/dataset.h" #include "mldb/base/per_thread_accumulator.h" #include "mldb/types/url.h" #include "mldb/types/structure_description.h" #include "mldb/types/vector_description.h" #include "mldb/types/any_impl.h" #include "mldb/vfs/fs_utils.h" #include "mldb/base/scope.h" #include "mldb/utils/distribution.h" #include "mldb/base/parallel.h" #include <boost/algorithm/string.hpp> #include "mldb/types/annotated_exception.h" #include "mldb/utils/log.h" #include "mldb/ext/libgit2/include/git2.h" #include "mldb/ext/libgit2/include/git2/revwalk.h" #include "mldb/ext/libgit2/include/git2/commit.h" #include "mldb/ext/libgit2/include/git2/diff.h" struct GitFileOperation { GitFileOperation() : insertions(0), deletions(0) { } int insertions; int deletions; std::string op; }; struct GitFileStats { GitFileStats() : insertions(0), deletions(0) { } std::map<std::string, GitFileOperation> files; int insertions; int deletions; }; int stats_by_file_each_file_cb(const git_diff_delta *delta, float progress, void *payload) { GitFileStats & stats = *((GitFileStats *)payload); GitFileOperation op; switch (delta->status) { case GIT_DELTA_UNMODIFIED: /** no changes */ return 0; case GIT_DELTA_ADDED: /** entry does not exist in old version */ op.op = "added"; break; case GIT_DELTA_DELETED: /** entry does not exist in new version */ op.op = "deleted"; break; case GIT_DELTA_MODIFIED: /** entry content changed between old and new */ op.op = "modified"; break; case GIT_DELTA_RENAMED: /** entry was renamed between old and new */ op.op = "renamed"; break; case GIT_DELTA_COPIED: /** entry was copied from another old entry */ op.op = "copied"; break; case GIT_DELTA_IGNORED: /** entry is ignored item in workdir */ return 0; case GIT_DELTA_UNTRACKED: /** entry is untracked item in workdir */ return 0; case GIT_DELTA_TYPECHANGE: /** type of entry changed between old and new */ return 0; default: throw std::logic_error("git status"); } if (delta->old_file.path) stats.files[delta->old_file.path] = op; return 0; } int stats_by_file_each_hunk_cb(const git_diff_delta *delta, const git_diff_hunk * hunk, void *payload) { GitFileStats & stats = *((GitFileStats *)payload); if (delta->old_file.path) stats.files[delta->old_file.path].deletions += hunk->old_lines; if (delta->new_file.path) stats.files[delta->new_file.path].insertions += hunk->new_lines; stats.insertions += hunk->new_lines; stats.deletions += hunk->old_lines; return 0; } GitFileStats git_diff_by_file(git_diff *diff) { GitFileStats result; int error = git_diff_foreach(diff, stats_by_file_each_file_cb, nullptr, /* binary callback */ stats_by_file_each_hunk_cb, nullptr, /* line callback */ &result); if (error < 0) { throw MLDB::AnnotatedException(400, "Error traversing diff: " + std::string(giterr_last()->message)); } return result; } using namespace std; namespace MLDB { /*****************************************************************************/ /* GIT IMPORTER */ /*****************************************************************************/ struct GitImporterConfig : ProcedureConfig { static constexpr const char * name = "import.git"; GitImporterConfig() : revisions({"HEAD"}), importStats(false), importTree(false), ignoreUnknownEncodings(true) { outputDataset.withType("sparse.mutable"); } Url repository; PolyConfigT<Dataset> outputDataset; std::vector<std::string> revisions; bool importStats; bool importTree; bool ignoreUnknownEncodings; // TODO // when // where // limit // offset // select (instead of importStats, importTree) }; DECLARE_STRUCTURE_DESCRIPTION(GitImporterConfig); DEFINE_STRUCTURE_DESCRIPTION(GitImporterConfig); GitImporterConfigDescription:: GitImporterConfigDescription() { addField("repository", &GitImporterConfig::repository, "Git repository to load from. This is currently limited to " "file:// urls which point to an already cloned repository on " "local disk. Remote repositories will need to be checked out " "beforehand using the git command line tools."); addField("outputDataset", &GitImporterConfig::outputDataset, "Output dataset for result. One row will be produced per commit. " "See the documentation for the output format.", PolyConfigT<Dataset>().withType("sparse.mutable")); std::vector<std::string> defaultRevisions = { "HEAD" }; addField("revisions", &GitImporterConfig::revisions, "Revisions to load from Git (eg, HEAD, HEAD~20..HEAD, tags/*). " "See the gitrevisions (7) documentation. Default is all revisions " "reachable from HEAD", defaultRevisions); addField("importStats", &GitImporterConfig::importStats, "If true, then import the stats (number of files " "changed, lines added and lines deleted)", false); addField("importTree", &GitImporterConfig::importTree, "If true, then import the tree (names of files changed)", false); addField("ignoreUnknownEncodings", &GitImporterConfig::ignoreUnknownEncodings, "If true (default), ignore commit messages with unknown encodings " "(supported are ISO-8859-1 and UTF-8) and replace with a " "placeholder. If false, messages with unknown encodings will " "cause the commit to abort."); addParent<ProcedureConfig>(); } struct GitImporter: public Procedure { GitImporter(MldbEngine * owner, PolyConfig config_, const std::function<bool (const Json::Value &)> & onProgress) : Procedure(owner) { config = config_.params.convert<GitImporterConfig>(); } GitImporterConfig config; std::string encodeOid(const git_oid & oid) const { char shortsha[10] = {0}; git_oid_tostr(shortsha, 9, &oid); return string(shortsha); }; // Process an individual commit std::vector<std::tuple<ColumnPath, CellValue, Date> > processCommit(git_repository * repo, const git_oid & oid) const { string sha = encodeOid(oid); auto checkError = [&] (int error, const char * msg) { if (error < 0) throw AnnotatedException(500, string(msg) + ": " + giterr_last()->message, "repository", config.repository, "commit", string(sha)); }; git_commit *commit; int error = git_commit_lookup(&commit, repo, &oid); checkError(error, "Error getting commit"); Scope_Exit(git_commit_free(commit)); const char *encoding = git_commit_message_encoding(commit); const char *messageStr = git_commit_message(commit); git_time_t time = git_commit_time(commit); int offset_in_min = git_commit_time_offset(commit); const git_signature *committer = git_commit_committer(commit); const git_signature *author = git_commit_author(commit); //const git_oid *tree_id = git_commit_tree_id(commit); git_diff *diff = nullptr; Scope_Exit(git_diff_free(diff)); Utf8String message; if (!encoding || strcmp(encoding, "UTF-8") == 0) { message = Utf8String(messageStr); } else if (strcmp(encoding,"ISO-8859-1") == 0) { message = Utf8String::fromLatin1(messageStr); } else if (config.ignoreUnknownEncodings) { message = "<<<couldn't decode message in " + string(encoding) + " character set>>>"; } else { throw AnnotatedException(500, "Can't decode unknown commit message encoding", "repository", config.repository, "commit", string(sha), "encoding", encoding); } vector<string> parents; unsigned int parentCount = git_commit_parentcount(commit); for (unsigned i = 0; i < parentCount; ++i) { const git_oid *nth_parent_id = git_commit_parent_id(commit, i); git_commit *nth_parent = nullptr; int error = git_commit_parent(&nth_parent, commit, i); checkError(error, "Error getting commit parent"); Scope_Exit(git_commit_free(nth_parent)); parents.emplace_back(encodeOid(*nth_parent_id)); if (i == 0 && parentCount == 1 && (config.importStats || config.importTree)) { const git_oid * parent_tree_id = git_commit_tree_id(nth_parent); if (parent_tree_id) { git_tree * tree = nullptr; git_tree * parentTree = nullptr; error = git_commit_tree(&tree, commit); checkError(error, "Error getting commit tree"); Scope_Exit(git_tree_free(tree)); error = git_commit_tree(&parentTree, nth_parent); checkError(error, "Error getting parent tree"); Scope_Exit(git_tree_free(parentTree)); error = git_diff_tree_to_tree(&diff, repo, tree, parentTree, NULL); checkError(error, "Error diffing commits"); git_diff_find_options opts = GIT_DIFF_FIND_OPTIONS_INIT; opts.flags = GIT_DIFF_FIND_RENAMES | GIT_DIFF_FIND_COPIES | GIT_DIFF_FIND_FOR_UNTRACKED; error = git_diff_find_similar(diff, &opts); checkError(error, "Error detecting renames"); } } } Date timestamp = Date::fromSecondsSinceEpoch(time + 60 * offset_in_min); Utf8String committerName(committer->name); Utf8String committerEmail(committer->email); Utf8String authorName(author->name); Utf8String authorEmail(author->email); std::vector<std::tuple<ColumnPath, CellValue, Date> > row; row.emplace_back(ColumnPath("committer"), committerName, timestamp); row.emplace_back(ColumnPath("committerEmail"), committerEmail, timestamp); row.emplace_back(ColumnPath("author"), authorName, timestamp); row.emplace_back(ColumnPath("authorEmail"), authorEmail, timestamp); row.emplace_back(ColumnPath("message"), message, timestamp); row.emplace_back(ColumnPath("parentCount"), parentCount, timestamp); for (auto & p: parents) row.emplace_back(ColumnPath("parent"), p, timestamp); int filesChanged = 0; int insertions = 0; int deletions = 0; if (diff) { GitFileStats stats = git_diff_by_file(diff); filesChanged = stats.files.size(); insertions = stats.insertions; deletions = stats.deletions; row.emplace_back(ColumnPath("insertions"), insertions, timestamp); row.emplace_back(ColumnPath("deletions"), deletions, timestamp); row.emplace_back(ColumnPath("filesChanged"), filesChanged, timestamp); for (auto & f: stats.files) { if (!config.importTree) break; Utf8String filename(f.first); row.emplace_back(ColumnPath("file"), filename, timestamp); if (f.second.insertions > 0) row.emplace_back(ColumnPath("file." + filename + ".insertions"), f.second.insertions, timestamp); if (f.second.deletions > 0) row.emplace_back(ColumnPath("file." + filename + ".deletions"), f.second.deletions, timestamp); if (!f.second.op.empty()) row.emplace_back(ColumnPath("file." + filename + ".op"), f.second.op, timestamp); } } DEBUG_MSG(logger) << "id " << sha << " had " << filesChanged << " changes, " << insertions << " insertions and " << deletions << " deletions " << message << " parents " << parentCount; return row; } virtual RunOutput run(const ProcedureRunConfig & run, const std::function<bool (const Json::Value &)> & onProgress) const { auto runProcConf = applyRunConfOverProcConf(config, run); auto checkError = [&] (int error, const char * msg) { if (error < 0) throw AnnotatedException(500, string(msg) + ": " + giterr_last()->message, "repository", runProcConf.repository); }; git_libgit2_init(); Scope_Exit(git_libgit2_shutdown()); git_repository * repo; Utf8String repoName(runProcConf.repository.toString()); repoName.removePrefix("file://"); int error = git_repository_open(&repo, repoName.rawData()); checkError(error, "Error opening git repository"); Scope_Exit(git_repository_free(repo)); // Create the output dataset std::shared_ptr<Dataset> output; if (!runProcConf.outputDataset.type.empty() || !runProcConf.outputDataset.id.empty()) { output = createDataset(engine, runProcConf.outputDataset, nullptr, true /*overwrite*/); } git_revwalk *walker; error = git_revwalk_new(&walker, repo); checkError(error, "Error creating commit walker"); Scope_Exit(git_revwalk_free(walker)); for (auto & r: runProcConf.revisions) { if (r.find("*") != string::npos) error = git_revwalk_push_glob(walker, r.c_str()); else if (r.find("..") != string::npos) error = git_revwalk_push_range(walker, r.c_str()); else error = git_revwalk_push_ref(walker, r.c_str()); if (error < 0) throw AnnotatedException(500, "Error adding revision: " + string(giterr_last()->message), "repository", runProcConf.repository, "revision", r); } vector<git_oid> oids; git_oid oid; while (!git_revwalk_next(&oid, walker)) { oids.push_back(oid); } struct Accum { Accum(const Utf8String & filename) { rows.reserve(1000); int error = git_repository_open(&repo, filename.rawData()); if (error < 0) throw AnnotatedException(400, "Error opening Git repo: " + string(giterr_last()->message)); } ~Accum() { git_repository_free(repo); } std::vector<std::pair<RowPath, std::vector<std::tuple<ColumnPath, CellValue, Date> > > > rows; git_repository * repo; }; PerThreadAccumulator<Accum> accum([&] () { return new Accum(repoName); }); INFO_MSG(logger) << "processing " << oids.size() << " commits"; auto doProcessCommit = [&] (int i) { if (i && i % 100 == 0) INFO_MSG(logger) << "imported commit " << i << " of " << oids.size(); Accum & threadAccum = accum.get(); auto row = processCommit(repo, oids[i]); threadAccum.rows.emplace_back(RowPath(encodeOid(oids[i])), std::move(row)); if (threadAccum.rows.size() == 1000) { output->recordRows(threadAccum.rows); threadAccum.rows.clear(); } }; parallelMap(0, oids.size(), doProcessCommit); for (auto & t: accum.threads) { output->recordRows(t->rows); } output->commit(); RunOutput result; return result; } virtual Any getStatus() const { return Any(); } GitImporterConfig procConfig; }; RegisterProcedureType<GitImporter, GitImporterConfig> regGit(builtinPackage(), "Import a Git repository's metadata into MLDB", "procedures/GitImporter.md.html"); } // namespace MLDB
mldbai/mldb
plugins/git/git.cc
C++
apache-2.0
17,692
/* * Copyright 2016 Atanas Stoychev Kanchev * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.atanas.kanchev.testframework.appium.tests.android.browser_tests; import io.appium.java_client.remote.AndroidMobileCapabilityType; import io.appium.java_client.remote.MobileBrowserType; import io.appium.java_client.remote.MobileCapabilityType; import org.junit.Test; import org.openqa.selenium.By; import org.openqa.selenium.Platform; import org.openqa.selenium.ScreenOrientation; import static com.atanas.kanchev.testframework.appium.accessors.AppiumAccessors.$appium; import static com.atanas.kanchev.testframework.selenium.accessors.SeleniumAccessors.$selenium; public class ChromeTest { @Test public void androidChromeTest() throws Exception { $appium().init().buildDefaultService(); $appium().init().startServer(); $appium().init() .setCap(MobileCapabilityType.BROWSER_NAME, MobileBrowserType.CHROME) .setCap(MobileCapabilityType.PLATFORM, Platform.ANDROID) .setCap(MobileCapabilityType.DEVICE_NAME, "ZY22398GL7") .setCap(MobileCapabilityType.PLATFORM_VERSION, "6.0.1") .setCap(MobileCapabilityType.NEW_COMMAND_TIMEOUT, 60) .setCap(MobileCapabilityType.FULL_RESET, false) .setCap(AndroidMobileCapabilityType.ANDROID_DEVICE_READY_TIMEOUT, 60) .setCap(AndroidMobileCapabilityType.ENABLE_PERFORMANCE_LOGGING, true); $appium().init().getAndroidDriver(); $selenium().goTo("https://bbc.co.uk"); $selenium().find().elementBy(By.id("idcta-link")); $appium().android().orientation().rotate(ScreenOrientation.LANDSCAPE); } }
atanaskanchev/hybrid-test-framework
test-framework-appium/src/test/java/com/atanas/kanchev/testframework/appium/tests/android/browser_tests/ChromeTest.java
Java
apache-2.0
2,204
/* * Copyright 2006-2016 Edward Smith * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package root.json; import root.lang.StringExtractor; /** * * @author Edward Smith * @version 0.5 * @since 0.5 */ final class JSONBoolean extends JSONValue { // <><><><><><><><><><><><><>< Class Attributes ><><><><><><><><><><><><><> private final boolean value; // <><><><><><><><><><><><><><>< Constructors ><><><><><><><><><><><><><><> JSONBoolean(final boolean value) { this.value = value; } // <><><><><><><><><><><><><><> Public Methods <><><><><><><><><><><><><><> @Override public final void extract(final StringExtractor chars) { chars.append(this.value); } } // End JSONBoolean
macvelli/RootFramework
src/root/json/JSONBoolean.java
Java
apache-2.0
1,215
<html> <head> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body> <span class='rank7 7.131076592273528'>?0</span> <span class='rank0 0.0'>1</span> <span class='rank3 2.8337620491379862'>lem</span> </br> <span class='rank0 0.0'>^</span> <span class='rank0 0.0'>w</span> <span class='rank0 0.0'>w</span> <span class='rank10 9.615983242061528'>Pf</span> <span class='rank5 5.380675333968457'>The</span> <span class='rank6 5.910214491268059'>New</span> <span class='rank5 5.027215308896533'>York</span> <span class='rank4 4.050174224831018'>copyright</span> <span class='rank2 1.7822710117187128'>reserved</span> <span class='rank3 2.5421264334187086'>Botanical</span> <span class='rank3 3.451197890939337'>Garden</span> </br> <span class='rank-13 -13.080231701061997'>Stewardson</span> <span class='rank3 2.873252492389657'>Brown</span> <span class='rank8 7.536541700381693'>N.</span> <span class='rank6 5.703960236633383'>L.</span> <span class='rank-2 -1.981923936421886'>Britton</span> </br> <span class='rank9 9.328301169609748'>E,</span> <span class='rank7 6.5714608043381055'>J.</span> <span class='rank-1 -1.1691379729473965'>WORTLEY</span> </br> <span class='rank0 0.2299845632248747'>COLLECTORS</span> </br> <span class='rank1 0.9568358528021363'>SEPT.,</span> <span class='rank3 2.9384859171035345'>1913</span> </br> <span class='rank5 5.23758013687111'>NEW</span> <span class='rank5 5.092407184714711'>YORK</span> <span class='rank4 4.3452095742978045'>BOTANICAL</span> <span class='rank5 4.836230413135688'>GARDEN</span> <span class='rank-2 -2.1799152267468287'>ACADEMY</span> <span class='rank6 6.171300748459634'>OF</span> <span class='rank-4 -4.137144714540511'>NATURAL</span> <span class='rank-4 -4.02435559334085'>SCIENCES</span> <span class='rank6 6.171300748459634'>OF</span> <span class='rank-7 -7.111065859143594'>PHILADELPHIA</span> <span class='rank2 2.4609470333207497'>BERMUDA</span> <span class='rank-14 -14.452837080563157'>DEPARTMENT</span> <span class='rank6 6.171300748459634'>OF</span> <span class='rank-13 -13.257555169685276'>AGRICULTURE</span> <span class='rank0 -0.025107939329515716'>EXPLORATION</span> <span class='rank6 6.171300748459634'>OF</span> <span class='rank2 2.4609470333207497'>BERMUDA</span> </br> <span class='rank0 0.0'>/</span> <span class='rank0 0.0'>V'r/?</span> </br> <span class='rank7 7.113163754051207'>NO.</span> <span class='rank0 0.0'>Ô</span> </br> <span class='rank42 42.26324703259235'>01530253</span> </br> </br></br> <strong>Legend - </strong> Level of confidence that token is an accurately-transcribed word</br> <span class='rank-13'>&nbsp;&nbsp;&nbsp;</span> extremely low <span class='rank-7'>&nbsp;&nbsp;&nbsp;</span> very low <span class='rank-1'>&nbsp;&nbsp;&nbsp;</span> low <span class='rank0'>&nbsp;&nbsp;&nbsp;</span> undetermined <span class='rank1'>&nbsp;&nbsp;&nbsp;</span> medium <span class='rank6'>&nbsp;&nbsp;&nbsp;</span> high <span class='rank16'>&nbsp;&nbsp;&nbsp;</span> very high</br> </body> </html>
idigbio-citsci-hackathon/carrotFacetNgram
carrot2-webapp-3.8.1/herballsilvertrigram/01530253.txt.html
HTML
apache-2.0
3,008
// // SendMessageRequest.h // ProximitySenseSDK // // Created by Vladimir Petrov on 31/08/2015. // Copyright (c) 2015 Blue Sense Networks. All rights reserved. // #import <Foundation/Foundation.h> @interface SendMessageRequest : NSObject @property (nonatomic, strong) NSString *message; @end
BlueSenseNetworks/iOS
SDK/ProximitySenseSDK/ProximitySenseSDK/Api/Model/Extensions/AudienceMonitor/SendMessageRequest.h
C
apache-2.0
300
Payments can be reversed for many reasons and many weeks after being received. When you reverse a payment, a window pops up to ask why. <figure> <img src="i/help/PaymentReversed.png" alt="PaymentReversed" width="700px"> <figcaption>Payment Reversed.</figcaption> </figure> Choose one of the following from the drop-down box. <figure> <img src="i/help/PaymentReverseReasonsValues.png" alt="PaymentReverseReasonsValues" width="700px"> <figcaption>Payment Reverse Reasons Values.</figcaption> </figure> <ul> <li>Applied to Wrong Account</li> <li> Bank Account Closed</li> <li>Data Entry Error</li> <li>No Acct/Cannot Locate</li> <li> Non-Sufficient Funds</li> <li>Account Details Page</li> <li>Stop Payment</li> </ul> Clicking the "Reverse" button will open a Microsoft Word document which is a letter to the claimant explaining why his payment was reversed and to expect a new invoice with a higher balance. <h2>Cancel</h2> Adjustments can be canceled for many reasons and many weeks after being entered. When you cancel a payment, a window pops up to ask why. Its drop-down box offers the same reasons as the reversals. <figure> <img src="i/help/PaymentCancel.png" alt="PaymentCancel" width="700px"> <figcaption>Payment Cancel.</figcaption> </figure> <figure> <img src="i/help/PaymentCancelledReasonsValues.png" alt="PaymentCancelledReasonsValues" width="700px"> <figcaption>Payment Cancel Reasons Values.</figcaption> </figure>
NASA-Tournament-Lab/CoECI-OPM-Service-Credit-Redeposit-Deposit-Application
Code/SCRD_BRE/src/web/help/paymentReversalContent.html
HTML
apache-2.0
1,454
package uk.co.listpoint.context; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for Context6Type. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * &lt;simpleType name="Context6Type"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;enumeration value="Data Standard"/> * &lt;enumeration value="Application"/> * &lt;/restriction> * &lt;/simpleType> * </pre> * */ @XmlType(name = "Context6Type", namespace = "http://www.listpoint.co.uk/schemas/v6") @XmlEnum public enum Context6Type { @XmlEnumValue("Data Standard") DATA_STANDARD("Data Standard"), @XmlEnumValue("Application") APPLICATION("Application"); private final String value; Context6Type(String v) { value = v; } public String value() { return value; } public static Context6Type fromValue(String v) { for (Context6Type c: Context6Type.values()) { if (c.value.equals(v)) { return c; } } throw new IllegalArgumentException(v); } }
davidcarboni/listpoint-ws
src/main/java/uk/co/listpoint/context/Context6Type.java
Java
apache-2.0
1,238
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #ifndef TENSORFLOW_COMPILER_XLA_ARRAY3D_H_ #define TENSORFLOW_COMPILER_XLA_ARRAY3D_H_ #include <algorithm> #include <functional> #include <initializer_list> #include <iterator> #include <memory> #include <numeric> #include <random> #include "tensorflow/compiler/xla/array.h" #include "tensorflow/compiler/xla/types.h" #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/macros.h" #include "tensorflow/core/platform/types.h" namespace xla { // Simple 3D array structure. template <typename T> class Array3D : public Array<T> { public: Array3D() : Array<T>(std::vector<int64_t>{0, 0, 0}) {} // Creates an array of dimensions n1 x n2 x n3, uninitialized values. Array3D(const int64_t n1, const int64_t n2, const int64_t n3) : Array<T>(std::vector<int64_t>{n1, n2, n3}) {} // Creates an array of dimensions n1 x n2 x n3, initialized to value. Array3D(const int64_t n1, const int64_t n2, const int64_t n3, const T value) : Array<T>(std::vector<int64_t>{n1, n2, n3}, value) {} // Creates an array from the given nested initializer list. The outer // initializer list is the first dimension, and so on. // // For example {{{1, 2}, {3, 4}, {5, 6}, {7, 8}}, // {{9, 10}, {11, 12}, {13, 14}, {15, 16}}, // {{17, 18}, {19, 20}, {21, 22}, {23, 24}}} // results in an array with n1=3, n2=4, n3=2. Array3D(std::initializer_list<std::initializer_list<std::initializer_list<T>>> values) : Array<T>(values) {} // Creates an array of a floating-point type (half, bfloat16, float, // or double) from the given nested initializer list of float values. template <typename T2, typename = typename std::enable_if< (std::is_same<T, Eigen::half>::value || std::is_same<T, bfloat16>::value || std::is_same<T, float>::value || std::is_same<T, double>::value) && std::is_same<T2, float>::value>::type> Array3D( std::initializer_list<std::initializer_list<std::initializer_list<T2>>> values) : Array<T>(values) {} int64_t n1() const { return this->dim(0); } int64_t n2() const { return this->dim(1); } int64_t n3() const { return this->dim(2); } }; } // namespace xla #endif // TENSORFLOW_COMPILER_XLA_ARRAY3D_H_
frreiss/tensorflow-fred
tensorflow/compiler/xla/array3d.h
C
apache-2.0
3,065
package com.example.customviewdemo; import android.app.Activity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; public class DragViewActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_drag_view); } }
jianghang/CustomViewDemo
src/com/example/customviewdemo/DragViewActivity.java
Java
apache-2.0
354
package com.gentics.mesh.core.schema.field; import static com.gentics.mesh.assertj.MeshAssertions.assertThat; import static com.gentics.mesh.core.field.FieldSchemaCreator.CREATEBINARY; import static com.gentics.mesh.core.field.FieldSchemaCreator.CREATEBOOLEAN; import static com.gentics.mesh.core.field.FieldSchemaCreator.CREATEBOOLEANLIST; import static com.gentics.mesh.core.field.FieldSchemaCreator.CREATEDATE; import static com.gentics.mesh.core.field.FieldSchemaCreator.CREATEDATELIST; import static com.gentics.mesh.core.field.FieldSchemaCreator.CREATEHTML; import static com.gentics.mesh.core.field.FieldSchemaCreator.CREATEHTMLLIST; import static com.gentics.mesh.core.field.FieldSchemaCreator.CREATEMICRONODE; import static com.gentics.mesh.core.field.FieldSchemaCreator.CREATEMICRONODELIST; import static com.gentics.mesh.core.field.FieldSchemaCreator.CREATENODE; import static com.gentics.mesh.core.field.FieldSchemaCreator.CREATENODELIST; import static com.gentics.mesh.core.field.FieldSchemaCreator.CREATENUMBER; import static com.gentics.mesh.core.field.FieldSchemaCreator.CREATENUMBERLIST; import static com.gentics.mesh.core.field.FieldSchemaCreator.CREATESTRING; import static com.gentics.mesh.core.field.FieldSchemaCreator.CREATESTRINGLIST; import static com.gentics.mesh.core.field.FieldTestHelper.NOOP; import static com.gentics.mesh.test.ElasticsearchTestMode.TRACKING; import static com.gentics.mesh.test.TestSize.FULL; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertEquals; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeoutException; import org.junit.Test; import com.gentics.mesh.FieldUtil; import com.gentics.mesh.core.data.node.field.HibHtmlField; import com.gentics.mesh.core.field.html.HtmlFieldTestHelper; import com.gentics.mesh.test.MeshTestSetting; import com.gentics.mesh.util.IndexOptionHelper; @MeshTestSetting(elasticsearch = TRACKING, testSize = FULL, startServer = false) public class HtmlFieldMigrationTest extends AbstractFieldMigrationTest implements HtmlFieldTestHelper { @Test @Override public void testRemove() throws Exception { removeField(CREATEHTML, FILLTEXT, FETCH); } @Test @Override public void testChangeToBinary() throws Exception { changeType(CREATEHTML, FILLTEXT, FETCH, CREATEBINARY, (container, name) -> { assertThat(container.getBinary(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testEmptyChangeToBinary() throws Exception { changeType(CREATEHTML, NOOP, FETCH, CREATEBINARY, (container, name) -> { assertThat(container.getBinary(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testChangeToBoolean() throws Exception { changeType(CREATEHTML, FILLTRUE, FETCH, CREATEBOOLEAN, (container, name) -> { assertThat(container.getBoolean(name)).as(NEWFIELD).isNotNull(); assertThat(container.getBoolean(name).getBoolean()).as(NEWFIELDVALUE).isEqualTo(true); }); changeType(CREATEHTML, FILLFALSE, FETCH, CREATEBOOLEAN, (container, name) -> { assertThat(container.getBoolean(name)).as(NEWFIELD).isNotNull(); assertThat(container.getBoolean(name).getBoolean()).as(NEWFIELDVALUE).isEqualTo(false); }); changeType(CREATEHTML, FILL1, FETCH, CREATEBOOLEAN, (container, name) -> { assertThat(container.getBoolean(name)).as(NEWFIELD).isNotNull(); assertThat(container.getBoolean(name).getBoolean()).as(NEWFIELDVALUE).isEqualTo(true); }); changeType(CREATEHTML, FILL0, FETCH, CREATEBOOLEAN, (container, name) -> { assertThat(container.getBoolean(name)).as(NEWFIELD).isNotNull(); assertThat(container.getBoolean(name).getBoolean()).as(NEWFIELDVALUE).isEqualTo(false); }); changeType(CREATEHTML, FILLTEXT, FETCH, CREATEBOOLEAN, (container, name) -> { assertThat(container.getBoolean(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testEmptyChangeToBoolean() throws Exception { changeType(CREATEHTML, NOOP, FETCH, CREATEBOOLEAN, (container, name) -> { assertThat(container.getBoolean(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testChangeToBooleanList() throws Exception { changeType(CREATEHTML, FILLTRUE, FETCH, CREATEBOOLEANLIST, (container, name) -> { assertThat(container.getBooleanList(name)).as(NEWFIELD).isNotNull(); assertThat(container.getBooleanList(name).getValues()).as(NEWFIELDVALUE).containsExactly(true); }); changeType(CREATEHTML, FILLFALSE, FETCH, CREATEBOOLEANLIST, (container, name) -> { assertThat(container.getBooleanList(name)).as(NEWFIELD).isNotNull(); assertThat(container.getBooleanList(name).getValues()).as(NEWFIELDVALUE).containsExactly(false); }); changeType(CREATEHTML, FILL1, FETCH, CREATEBOOLEANLIST, (container, name) -> { assertThat(container.getBooleanList(name)).as(NEWFIELD).isNotNull(); assertThat(container.getBooleanList(name).getValues()).as(NEWFIELDVALUE).containsExactly(true); }); changeType(CREATEHTML, FILL0, FETCH, CREATEBOOLEANLIST, (container, name) -> { assertThat(container.getBooleanList(name)).as(NEWFIELD).isNotNull(); assertThat(container.getBooleanList(name).getValues()).as(NEWFIELDVALUE).containsExactly(false); }); changeType(CREATEHTML, FILLTEXT, FETCH, CREATEBOOLEANLIST, (container, name) -> { assertThat(container.getBooleanList(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testEmptyChangeToBooleanList() throws Exception { changeType(CREATEHTML, NOOP, FETCH, CREATEBOOLEANLIST, (container, name) -> { assertThat(container.getBooleanList(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testChangeToDate() throws Exception { changeType(CREATEHTML, FILL0, FETCH, CREATEDATE, (container, name) -> { assertThat(container.getDate(name)).as(NEWFIELD).isNotNull(); assertThat(container.getDate(name).getDate()).as(NEWFIELDVALUE).isEqualTo(0L); }); changeType(CREATEHTML, FILL1, FETCH, CREATEDATE, (container, name) -> { assertThat(container.getDate(name)).as(NEWFIELD).isNotNull(); // Internally timestamps are stored in miliseconds assertThat(container.getDate(name).getDate()).as(NEWFIELDVALUE).isEqualTo(1000L); }); changeType(CREATEHTML, FILLTEXT, FETCH, CREATEDATE, (container, name) -> { assertThat(container.getDate(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testEmptyChangeToDate() throws Exception { changeType(CREATEHTML, NOOP, FETCH, CREATEDATE, (container, name) -> { assertThat(container.getDate(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testChangeToDateList() throws Exception { changeType(CREATEHTML, FILL0, FETCH, CREATEDATELIST, (container, name) -> { assertThat(container.getDateList(name)).as(NEWFIELD).isNotNull(); assertThat(container.getDateList(name).getValues()).as(NEWFIELDVALUE).containsExactly(0L); }); changeType(CREATEHTML, FILL1, FETCH, CREATEDATELIST, (container, name) -> { assertThat(container.getDateList(name)).as(NEWFIELD).isNotNull(); // Internally timestamps are stored in miliseconds assertThat(container.getDateList(name).getValues()).as(NEWFIELDVALUE).containsExactly(1000L); }); changeType(CREATEHTML, FILLTEXT, FETCH, CREATEDATELIST, (container, name) -> { assertThat(container.getDateList(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testEmptyChangeToDateList() throws Exception { changeType(CREATEHTML, NOOP, FETCH, CREATEDATELIST, (container, name) -> { assertThat(container.getDateList(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testChangeToHtml() throws Exception { changeType(CREATEHTML, FILLTEXT, FETCH, CREATEHTML, (container, name) -> { assertThat(container.getHtml(name)).as(NEWFIELD).isNotNull(); assertThat(container.getHtml(name).getHTML()).as(NEWFIELDVALUE).isEqualTo("<b>HTML</b> content"); }); } @Test @Override public void testEmptyChangeToHtml() throws Exception { changeType(CREATEHTML, NOOP, FETCH, CREATEHTML, (container, name) -> { assertThat(container.getHtml(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testChangeToHtmlList() throws Exception { changeType(CREATEHTML, FILLTEXT, FETCH, CREATEHTMLLIST, (container, name) -> { assertThat(container.getHTMLList(name)).as(NEWFIELD).isNotNull(); assertThat(container.getHTMLList(name).getValues()).as(NEWFIELDVALUE).containsExactly("<b>HTML</b> content"); }); } @Test @Override public void testEmptyChangeToHtmlList() throws Exception { changeType(CREATEHTML, NOOP, FETCH, CREATEHTMLLIST, (container, name) -> { assertThat(container.getHTMLList(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testChangeToMicronode() throws Exception { changeType(CREATEHTML, FILLTEXT, FETCH, CREATEMICRONODE, (container, name) -> { assertThat(container.getMicronode(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testEmptyChangeToMicronode() throws Exception { changeType(CREATEHTML, NOOP, FETCH, CREATEMICRONODE, (container, name) -> { assertThat(container.getMicronode(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testChangeToMicronodeList() throws Exception { changeType(CREATEHTML, FILLTEXT, FETCH, CREATEMICRONODELIST, (container, name) -> { assertThat(container.getMicronodeList(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testEmptyChangeToMicronodeList() throws Exception { changeType(CREATEHTML, NOOP, FETCH, CREATEMICRONODELIST, (container, name) -> { assertThat(container.getMicronodeList(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testChangeToNode() throws Exception { changeType(CREATEHTML, FILLTEXT, FETCH, CREATENODE, (container, name) -> { assertThat(container.getNode(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testEmptyChangeToNode() throws Exception { changeType(CREATEHTML, NOOP, FETCH, CREATENODE, (container, name) -> { assertThat(container.getNode(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testChangeToNodeList() throws Exception { changeType(CREATEHTML, FILLTEXT, FETCH, CREATENODELIST, (container, name) -> { assertThat(container.getNodeList(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testEmptyChangeToNodeList() throws Exception { changeType(CREATEHTML, NOOP, FETCH, CREATENODELIST, (container, name) -> { assertThat(container.getNodeList(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testChangeToNumber() throws Exception { changeType(CREATEHTML, FILL0, FETCH, CREATENUMBER, (container, name) -> { assertThat(container.getNumber(name)).as(NEWFIELD).isNotNull(); assertThat(container.getNumber(name).getNumber().longValue()).as(NEWFIELDVALUE).isEqualTo(0L); }); changeType(CREATEHTML, FILL1, FETCH, CREATENUMBER, (container, name) -> { assertThat(container.getNumber(name)).as(NEWFIELD).isNotNull(); assertThat(container.getNumber(name).getNumber().longValue()).as(NEWFIELDVALUE).isEqualTo(1L); }); changeType(CREATEHTML, FILLTEXT, FETCH, CREATENUMBER, (container, name) -> { assertThat(container.getNumber(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testEmptyChangeToNumber() throws Exception { changeType(CREATEHTML, NOOP, FETCH, CREATENUMBER, (container, name) -> { assertThat(container.getNumber(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testChangeToNumberList() throws Exception { changeType(CREATEHTML, FILL0, FETCH, CREATENUMBERLIST, (container, name) -> { assertThat(container.getNumberList(name)).as(NEWFIELD).isNotNull(); assertThat(container.getNumberList(name).getValues()).as(NEWFIELDVALUE).containsExactly(0L); }); changeType(CREATEHTML, FILL1, FETCH, CREATENUMBERLIST, (container, name) -> { assertThat(container.getNumberList(name)).as(NEWFIELD).isNotNull(); assertThat(container.getNumberList(name).getValues()).as(NEWFIELDVALUE).containsExactly(1L); }); changeType(CREATEHTML, FILLTEXT, FETCH, CREATENUMBERLIST, (container, name) -> { assertThat(container.getNumberList(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testEmptyChangeToNumberList() throws Exception { changeType(CREATEHTML, NOOP, FETCH, CREATENUMBERLIST, (container, name) -> { assertThat(container.getNumberList(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testChangeToString() throws Exception { changeType(CREATEHTML, FILLTEXT, FETCH, CREATESTRING, (container, name) -> { assertThat(container.getString(name)).as(NEWFIELD).isNotNull(); assertThat(container.getString(name).getString()).as(NEWFIELDVALUE).isEqualTo("<b>HTML</b> content"); }); } @Test @Override public void testEmptyChangeToString() throws Exception { changeType(CREATEHTML, NOOP, FETCH, CREATESTRING, (container, name) -> { assertThat(container.getString(name)).as(NEWFIELD).isNull(); }); } @Test @Override public void testChangeToStringList() throws Exception { changeType(CREATEHTML, FILLTEXT, FETCH, CREATESTRINGLIST, (container, name) -> { assertThat(container.getStringList(name)).as(NEWFIELD).isNotNull(); assertThat(container.getStringList(name).getValues()).as(NEWFIELDVALUE).containsExactly("<b>HTML</b> content"); }); } @Test @Override public void testEmptyChangeToStringList() throws Exception { changeType(CREATEHTML, NOOP, FETCH, CREATESTRINGLIST, (container, name) -> { assertThat(container.getStringList(name)).as(NEWFIELD).isNull(); }); } @Test public void testIndexOptionAddRaw() throws InterruptedException, ExecutionException, TimeoutException { changeType(CREATEHTML, FILLLONGTEXT, FETCH, name -> FieldUtil.createHtmlFieldSchema(name).setElasticsearch(IndexOptionHelper.getRawFieldOption()), (container, name) -> { HibHtmlField htmlField = container.getHtml(name); assertEquals("The html field should not be truncated.", 40_000, htmlField.getHTML().length()); waitForSearchIdleEvent(); assertThat(trackingSearchProvider()).recordedStoreEvents(1); }); } }
gentics/mesh
tests/tests-core/src/main/java/com/gentics/mesh/core/schema/field/HtmlFieldMigrationTest.java
Java
apache-2.0
14,181
// Copyright 2015,2016,2017,2018,2019,2020 Commonwealth Bank of Australia // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package commbank.grimlock.test import commbank.grimlock.framework._ import commbank.grimlock.framework.content._ import commbank.grimlock.framework.encoding._ import commbank.grimlock.framework.environment.implicits._ import commbank.grimlock.framework.environment.tuner._ import commbank.grimlock.framework.metadata._ import commbank.grimlock.framework.position._ import shapeless.nat.{ _0, _1, _2 } trait TestMatrixGather extends TestMatrix { val result1 = data1.map { case c => c.position -> c.content }.toMap val result2 = Map( Position("foo") -> Map( Position(1) -> Content(OrdinalSchema[String](), "3.14"), Position(2) -> Content(ContinuousSchema[Double](), 6.28), Position(3) -> Content(NominalSchema[String](), "9.42"), Position(4) -> Content( DateSchema[java.util.Date](), DateValue((new java.text.SimpleDateFormat("yyyy-MM-dd hh:mm:ss")).parse("2000-01-01 12:56:00")) ) ), Position("bar") -> Map( Position(1) -> Content(OrdinalSchema[String](), "6.28"), Position(2) -> Content(ContinuousSchema[Double](), 12.56), Position(3) -> Content(OrdinalSchema[Long](), 19L) ), Position("baz") -> Map( Position(1) -> Content(OrdinalSchema[String](), "9.42"), Position(2) -> Content(DiscreteSchema[Long](), 19L) ), Position("qux") -> Map(Position(1) -> Content(OrdinalSchema[String](), "12.56")) ) val result3 = Map( Position(1) -> Map( Position("foo") -> Content(OrdinalSchema[String](), "3.14"), Position("bar") -> Content(OrdinalSchema[String](), "6.28"), Position("baz") -> Content(OrdinalSchema[String](), "9.42"), Position("qux") -> Content(OrdinalSchema[String](), "12.56") ), Position(2) -> Map( Position("foo") -> Content(ContinuousSchema[Double](), 6.28), Position("bar") -> Content(ContinuousSchema[Double](), 12.56), Position("baz") -> Content(DiscreteSchema[Long](), 19L) ), Position(3) -> Map( Position("foo") -> Content(NominalSchema[String](), "9.42"), Position("bar") -> Content(OrdinalSchema[Long](), 19L) ), Position(4) -> Map( Position("foo") -> Content( DateSchema[java.util.Date](), DateValue((new java.text.SimpleDateFormat("yyyy-MM-dd hh:mm:ss")).parse("2000-01-01 12:56:00")) ) ) ) val result4 = Map( Position(1) -> Map( Position("foo") -> Content(OrdinalSchema[String](), "3.14"), Position("bar") -> Content(OrdinalSchema[String](), "6.28"), Position("baz") -> Content(OrdinalSchema[String](), "9.42"), Position("qux") -> Content(OrdinalSchema[String](), "12.56") ), Position(2) -> Map( Position("foo") -> Content(ContinuousSchema[Double](), 6.28), Position("bar") -> Content(ContinuousSchema[Double](), 12.56), Position("baz") -> Content(DiscreteSchema[Long](), 19L) ), Position(3) -> Map( Position("foo") -> Content(NominalSchema[String](), "9.42"), Position("bar") -> Content(OrdinalSchema[Long](), 19L) ), Position(4) -> Map( Position("foo") -> Content( DateSchema[java.util.Date](), DateValue((new java.text.SimpleDateFormat("yyyy-MM-dd hh:mm:ss")).parse("2000-01-01 12:56:00")) ) ) ) val result5 = Map( Position("foo") -> Map( Position(1) -> Content(OrdinalSchema[String](), "3.14"), Position(2) -> Content(ContinuousSchema[Double](), 6.28), Position(3) -> Content(NominalSchema[String](), "9.42"), Position(4) -> Content( DateSchema[java.util.Date](), DateValue((new java.text.SimpleDateFormat("yyyy-MM-dd hh:mm:ss")).parse("2000-01-01 12:56:00")) ) ), Position("bar") -> Map( Position(1) -> Content(OrdinalSchema[String](), "6.28"), Position(2) -> Content(ContinuousSchema[Double](), 12.56), Position(3) -> Content(OrdinalSchema[Long](), 19L) ), Position("baz") -> Map( Position(1) -> Content(OrdinalSchema[String](), "9.42"), Position(2) -> Content(DiscreteSchema[Long](), 19L) ), Position("qux") -> Map(Position(1) -> Content(OrdinalSchema[String](), "12.56")) ) val result6 = Map( Position("foo") -> Map( Position(1, "xyz") -> Content(OrdinalSchema[String](), "3.14"), Position(2, "xyz") -> Content(ContinuousSchema[Double](), 6.28), Position(3, "xyz") -> Content(NominalSchema[String](), "9.42"), Position(4, "xyz") -> Content( DateSchema[java.util.Date](), DateValue((new java.text.SimpleDateFormat("yyyy-MM-dd hh:mm:ss")).parse("2000-01-01 12:56:00")) ) ), Position("bar") -> Map( Position(1, "xyz") -> Content(OrdinalSchema[String](), "6.28"), Position(2, "xyz") -> Content(ContinuousSchema[Double](), 12.56), Position(3, "xyz") -> Content(OrdinalSchema[Long](), 19L) ), Position("baz") -> Map( Position(1, "xyz") -> Content(OrdinalSchema[String](), "9.42"), Position(2, "xyz") -> Content(DiscreteSchema[Long](), 19L) ), Position("qux") -> Map(Position(1, "xyz") -> Content(OrdinalSchema[String](), "12.56")) ) val result7 = Map( Position(1, "xyz") -> Map( Position("foo") -> Content(OrdinalSchema[String](), "3.14"), Position("bar") -> Content(OrdinalSchema[String](), "6.28"), Position("baz") -> Content(OrdinalSchema[String](), "9.42"), Position("qux") -> Content(OrdinalSchema[String](), "12.56") ), Position(2, "xyz") -> Map( Position("foo") -> Content(ContinuousSchema[Double](), 6.28), Position("bar") -> Content(ContinuousSchema[Double](), 12.56), Position("baz") -> Content(DiscreteSchema[Long](), 19L) ), Position(3, "xyz") -> Map( Position("foo") -> Content(NominalSchema[String](), "9.42"), Position("bar") -> Content(OrdinalSchema[Long](), 19L) ), Position(4, "xyz") -> Map( Position("foo") -> Content( DateSchema[java.util.Date](), DateValue((new java.text.SimpleDateFormat("yyyy-MM-dd hh:mm:ss")).parse("2000-01-01 12:56:00")) ) ) ) val result8 = Map( Position(1) -> Map( Position("foo", "xyz") -> Content(OrdinalSchema[String](), "3.14"), Position("bar", "xyz") -> Content(OrdinalSchema[String](), "6.28"), Position("baz", "xyz") -> Content(OrdinalSchema[String](), "9.42"), Position("qux", "xyz") -> Content(OrdinalSchema[String](), "12.56") ), Position(2) -> Map( Position("foo", "xyz") -> Content(ContinuousSchema[Double](), 6.28), Position("bar", "xyz") -> Content(ContinuousSchema[Double](), 12.56), Position("baz", "xyz") -> Content(DiscreteSchema[Long](), 19L) ), Position(3) -> Map( Position("foo", "xyz") -> Content(NominalSchema[String](), "9.42"), Position("bar", "xyz") -> Content(OrdinalSchema[Long](), 19L) ), Position(4) -> Map( Position("foo", "xyz") -> Content( DateSchema[java.util.Date](), DateValue((new java.text.SimpleDateFormat("yyyy-MM-dd hh:mm:ss")).parse("2000-01-01 12:56:00")) ) ) ) val result9 = Map( Position("foo", "xyz") -> Map( Position(1) -> Content(OrdinalSchema[String](), "3.14"), Position(2) -> Content(ContinuousSchema[Double](), 6.28), Position(3) -> Content(NominalSchema[String](), "9.42"), Position(4) -> Content( DateSchema[java.util.Date](), DateValue((new java.text.SimpleDateFormat("yyyy-MM-dd hh:mm:ss")).parse("2000-01-01 12:56:00")) ) ), Position("bar", "xyz") -> Map( Position(1) -> Content(OrdinalSchema[String](), "6.28"), Position(2) -> Content(ContinuousSchema[Double](), 12.56), Position(3) -> Content(OrdinalSchema[Long](), 19L) ), Position("baz", "xyz") -> Map( Position(1) -> Content(OrdinalSchema[String](), "9.42"), Position(2) -> Content(DiscreteSchema[Long](), 19L) ), Position("qux", "xyz") -> Map(Position(1) -> Content(OrdinalSchema[String](), "12.56")) ) val result10 = Map( Position("xyz") -> Map( Position("foo", 1) -> Content(OrdinalSchema[String](), "3.14"), Position("bar", 1) -> Content(OrdinalSchema[String](), "6.28"), Position("baz", 1) -> Content(OrdinalSchema[String](), "9.42"), Position("qux", 1) -> Content(OrdinalSchema[String](), "12.56"), Position("foo", 2) -> Content(ContinuousSchema[Double](), 6.28), Position("bar", 2) -> Content(ContinuousSchema[Double](), 12.56), Position("baz", 2) -> Content(DiscreteSchema[Long](), 19L), Position("foo", 3) -> Content(NominalSchema[String](), "9.42"), Position("bar", 3) -> Content(OrdinalSchema[Long](), 19L), Position("foo", 4) -> Content( DateSchema[java.util.Date](), DateValue((new java.text.SimpleDateFormat("yyyy-MM-dd hh:mm:ss")).parse("2000-01-01 12:56:00")) ) ) ) val result11 = Map( Position("foo", 1) -> Map(Position("xyz") -> Content(OrdinalSchema[String](), "3.14")), Position("foo", 2) -> Map(Position("xyz") -> Content(ContinuousSchema[Double](), 6.28)), Position("foo", 3) -> Map(Position("xyz") -> Content(NominalSchema[String](), "9.42")), Position("foo", 4) -> Map( Position("xyz") -> Content( DateSchema[java.util.Date](), DateValue((new java.text.SimpleDateFormat("yyyy-MM-dd hh:mm:ss")).parse("2000-01-01 12:56:00")) ) ), Position("bar", 1) -> Map(Position("xyz") -> Content(OrdinalSchema[String](), "6.28")), Position("bar", 2) -> Map(Position("xyz") -> Content(ContinuousSchema[Double](), 12.56)), Position("bar", 3) -> Map(Position("xyz") -> Content(OrdinalSchema[Long](), 19L)), Position("baz", 1) -> Map(Position("xyz") -> Content(OrdinalSchema[String](), "9.42")), Position("baz", 2) -> Map(Position("xyz") -> Content(DiscreteSchema[Long](), 19L)), Position("qux", 1) -> Map(Position("xyz") -> Content(OrdinalSchema[String](), "12.56")) ) } class TestScalaMatrixGather extends TestMatrixGather with TestScala { import commbank.grimlock.scala.environment.implicits._ "A Matrix.gather" should "return its first over map in 1D" in { toU(data1) .gatherByPosition(Over(_0), Default()) shouldBe result1 } it should "return its first over map in 2D" in { toU(data2) .gatherByPosition(Over(_0), Default()) shouldBe result2 } it should "return its first along map in 2D" in { toU(data2) .gatherByPosition(Along(_0), Default()) shouldBe result3 } it should "return its second over map in 2D" in { toU(data2) .gatherByPosition(Over(_1), Default()) shouldBe result4 } it should "return its second along map in 2D" in { toU(data2) .gatherByPosition(Along(_1), Default()) shouldBe result5 } it should "return its first over map in 3D" in { toU(data3) .gatherByPosition(Over(_0), Default()) shouldBe result6 } it should "return its first along map in 3D" in { toU(data3) .gatherByPosition(Along(_0), Default()) shouldBe result7 } it should "return its second over map in 3D" in { toU(data3) .gatherByPosition(Over(_1), Default()) shouldBe result8 } it should "return its second along map in 3D" in { toU(data3) .gatherByPosition(Along(_1), Default()) shouldBe result9 } it should "return its third over map in 3D" in { toU(data3) .gatherByPosition(Over(_2), Default()) shouldBe result10 } it should "return its third along map in 3D" in { toU(data3) .gatherByPosition(Along(_2), Default()) shouldBe result11 } it should "return its empty map" in { toU(List[Cell[P3]]()) .gatherByPosition(Along(_2), Default()) shouldBe Map() } it should "return its compacted 1D" in { toU(data1) .gather() shouldBe result1 } it should "return its empty compacted" in { toU(List[Cell[P2]]()) .gather() shouldBe Map() } } class TestScaldingMatrixGather extends TestMatrixGather with TestScalding { import commbank.grimlock.scalding.environment.implicits._ "A Matrix.gather" should "return its first over map in 1D" in { toU(data1) .gatherByPosition(Over(_0), Default()).toTypedPipe .toList shouldBe List(result1) } it should "return its first over map in 2D" in { toU(data2) .gatherByPosition(Over(_0), Default(12)).toTypedPipe .toList shouldBe List(result2) } it should "return its first along map in 2D" in { toU(data2) .gatherByPosition(Along(_0), Default()).toTypedPipe .toList shouldBe List(result3) } it should "return its second over map in 2D" in { toU(data2) .gatherByPosition(Over(_1), Default(12)).toTypedPipe .toList shouldBe List(result4) } it should "return its second along map in 2D" in { toU(data2) .gatherByPosition(Along(_1), Default()).toTypedPipe .toList shouldBe List(result5) } it should "return its first over map in 3D" in { toU(data3) .gatherByPosition(Over(_0), Default(12)).toTypedPipe .toList shouldBe List(result6) } it should "return its first along map in 3D" in { toU(data3) .gatherByPosition(Along(_0), Default()).toTypedPipe .toList shouldBe List(result7) } it should "return its second over map in 3D" in { toU(data3) .gatherByPosition(Over(_1), Default(12)).toTypedPipe .toList shouldBe List(result8) } it should "return its second along map in 3D" in { toU(data3) .gatherByPosition(Along(_1), Default()).toTypedPipe .toList shouldBe List(result9) } it should "return its third over map in 3D" in { toU(data3) .gatherByPosition(Over(_2), Default(12)).toTypedPipe .toList shouldBe List(result10) } it should "return its third along map in 3D" in { toU(data3) .gatherByPosition(Along(_2), Default()).toTypedPipe .toList shouldBe List(result11) } it should "return its empty map" in { toU(List[Cell[P3]]()) .gatherByPosition(Along(_2), Default()).toTypedPipe .toList shouldBe List(Map()) } it should "return its compacted 1D" in { toU(data1) .gather().toTypedPipe .toList shouldBe List(result1) } it should "return its empty compacted" in { toU(List[Cell[P2]]()) .gather().toTypedPipe .toList shouldBe List(Map()) } } class TestSparkMatrixGather extends TestMatrixGather with TestSpark { import commbank.grimlock.spark.environment.implicits._ "A Matrix.gather" should "return its first over map in 1D" in { toU(data1) .gatherByPosition(Over(_0), Default()) shouldBe result1 } it should "return its first over map in 2D" in { toU(data2) .gatherByPosition(Over(_0), Default(12)) shouldBe result2 } it should "return its first along map in 2D" in { toU(data2) .gatherByPosition(Along(_0), Default()) shouldBe result3 } it should "return its second over map in 2D" in { toU(data2) .gatherByPosition(Over(_1), Default(12)) shouldBe result4 } it should "return its second along map in 2D" in { toU(data2) .gatherByPosition(Along(_1), Default()) shouldBe result5 } it should "return its first over map in 3D" in { toU(data3) .gatherByPosition(Over(_0), Default(12)) shouldBe result6 } it should "return its first along map in 3D" in { toU(data3) .gatherByPosition(Along(_0), Default()) shouldBe result7 } it should "return its second over map in 3D" in { toU(data3) .gatherByPosition(Over(_1), Default(12)) shouldBe result8 } it should "return its second along map in 3D" in { toU(data3) .gatherByPosition(Along(_1), Default()) shouldBe result9 } it should "return its third over map in 3D" in { toU(data3) .gatherByPosition(Over(_2), Default(12)) shouldBe result10 } it should "return its third along map in 3D" in { toU(data3) .gatherByPosition(Along(_2), Default()) shouldBe result11 } it should "return its empty map" in { toU(List[Cell[P3]]()) .gatherByPosition(Along(_2), Default()) shouldBe Map() } it should "return its compacted 1D" in { toU(data1) .gather() shouldBe result1 } it should "return its empty compacted" in { toU(List[Cell[P2]]()) .gather() shouldBe Map() } }
CommBank/grimlock
grimlock-core/src/test/scala/commbank/grimlock/matrix/TestMatrixGather.scala
Scala
apache-2.0
16,927
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package redis.common.container; import org.apache.commons.pool2.impl.GenericObjectPoolConfig; import redis.common.config.FlinkJedisClusterConfig; import redis.common.config.FlinkJedisConfigBase; import redis.common.config.FlinkJedisPoolConfig; import redis.common.config.FlinkJedisSentinelConfig; import redis.clients.jedis.JedisCluster; import redis.clients.jedis.JedisPool; import redis.clients.jedis.JedisSentinelPool; import redis.common.container.*; import redis.common.container.RedisCommandsContainer; import redis.common.container.RedisContainer; import java.util.Objects; /** * The builder for {@link redis.common.container.RedisCommandsContainer}. */ public class RedisCommandsContainerBuilder { /** * Initialize the {@link redis.common.container.RedisCommandsContainer} based on the instance type. * @param flinkJedisConfigBase configuration base * @return @throws IllegalArgumentException if jedisPoolConfig, jedisClusterConfig and jedisSentinelConfig are all null */ public static redis.common.container.RedisCommandsContainer build(FlinkJedisConfigBase flinkJedisConfigBase){ if(flinkJedisConfigBase instanceof FlinkJedisPoolConfig){ FlinkJedisPoolConfig flinkJedisPoolConfig = (FlinkJedisPoolConfig) flinkJedisConfigBase; return RedisCommandsContainerBuilder.build(flinkJedisPoolConfig); } else if (flinkJedisConfigBase instanceof FlinkJedisClusterConfig) { FlinkJedisClusterConfig flinkJedisClusterConfig = (FlinkJedisClusterConfig) flinkJedisConfigBase; return RedisCommandsContainerBuilder.build(flinkJedisClusterConfig); } else if (flinkJedisConfigBase instanceof FlinkJedisSentinelConfig) { FlinkJedisSentinelConfig flinkJedisSentinelConfig = (FlinkJedisSentinelConfig) flinkJedisConfigBase; return RedisCommandsContainerBuilder.build(flinkJedisSentinelConfig); } else { throw new IllegalArgumentException("Jedis configuration not found"); } } /** * Builds container for single Redis environment. * * @param jedisPoolConfig configuration for JedisPool * @return container for single Redis environment * @throws NullPointerException if jedisPoolConfig is null */ public static redis.common.container.RedisCommandsContainer build(FlinkJedisPoolConfig jedisPoolConfig) { Objects.requireNonNull(jedisPoolConfig, "Redis pool config should not be Null"); GenericObjectPoolConfig genericObjectPoolConfig = new GenericObjectPoolConfig(); genericObjectPoolConfig.setMaxIdle(jedisPoolConfig.getMaxIdle()); genericObjectPoolConfig.setMaxTotal(jedisPoolConfig.getMaxTotal()); genericObjectPoolConfig.setMinIdle(jedisPoolConfig.getMinIdle()); JedisPool jedisPool = new JedisPool(genericObjectPoolConfig, jedisPoolConfig.getHost(), jedisPoolConfig.getPort(), jedisPoolConfig.getConnectionTimeout(), jedisPoolConfig.getPassword(), jedisPoolConfig.getDatabase()); return new redis.common.container.RedisContainer(jedisPool); } /** * Builds container for Redis Cluster environment. * * @param jedisClusterConfig configuration for JedisCluster * @return container for Redis Cluster environment * @throws NullPointerException if jedisClusterConfig is null */ public static redis.common.container.RedisCommandsContainer build(FlinkJedisClusterConfig jedisClusterConfig) { Objects.requireNonNull(jedisClusterConfig, "Redis cluster config should not be Null"); GenericObjectPoolConfig genericObjectPoolConfig = new GenericObjectPoolConfig(); genericObjectPoolConfig.setMaxIdle(jedisClusterConfig.getMaxIdle()); genericObjectPoolConfig.setMaxTotal(jedisClusterConfig.getMaxTotal()); genericObjectPoolConfig.setMinIdle(jedisClusterConfig.getMinIdle()); JedisCluster jedisCluster = new JedisCluster(jedisClusterConfig.getNodes(), jedisClusterConfig.getConnectionTimeout(), jedisClusterConfig.getMaxRedirections(), genericObjectPoolConfig); return new redis.common.container.RedisClusterContainer(jedisCluster); } /** * Builds container for Redis Sentinel environment. * * @param jedisSentinelConfig configuration for JedisSentinel * @return container for Redis sentinel environment * @throws NullPointerException if jedisSentinelConfig is null */ public static RedisCommandsContainer build(FlinkJedisSentinelConfig jedisSentinelConfig) { Objects.requireNonNull(jedisSentinelConfig, "Redis sentinel config should not be Null"); GenericObjectPoolConfig genericObjectPoolConfig = new GenericObjectPoolConfig(); genericObjectPoolConfig.setMaxIdle(jedisSentinelConfig.getMaxIdle()); genericObjectPoolConfig.setMaxTotal(jedisSentinelConfig.getMaxTotal()); genericObjectPoolConfig.setMinIdle(jedisSentinelConfig.getMinIdle()); JedisSentinelPool jedisSentinelPool = new JedisSentinelPool(jedisSentinelConfig.getMasterName(), jedisSentinelConfig.getSentinels(), genericObjectPoolConfig, jedisSentinelConfig.getConnectionTimeout(), jedisSentinelConfig.getSoTimeout(), jedisSentinelConfig.getPassword(), jedisSentinelConfig.getDatabase()); return new RedisContainer(jedisSentinelPool); } }
eltitopera/TFM
manager/src/src/main/java/redis/common/container/RedisCommandsContainerBuilder.java
Java
apache-2.0
6,212
package fundamental.games.metropolis.connection.bluetooth; import android.bluetooth.BluetoothSocket; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; import java.util.UUID; import fundamental.games.metropolis.connection.global.MessagesQueue; import fundamental.games.metropolis.connection.serializable.PlayerInitData; import fundamental.games.metropolis.global.WidgetsData; /** * Created by regair on 27.05.15. */ public class BluetoothServerConnection extends BluetoothConnection { private ObjectOutputStream writer; private ObjectInputStream reader; //******************************** public BluetoothServerConnection(BluetoothSocket socket, MessagesQueue<Serializable> queue, UUID uuid) { super(socket, queue, uuid); this.queue = new MessagesQueue<>(); deviceName = "SERVER"; } //******************************** @Override public void run() { working = true; } //******************************** @Override public void stopConnection() { super.stopConnection(); BluetoothServer.getInstance().removeConnection(this); } public MessagesQueue<Serializable> getQueue() { return queue; } //********************************** public void sendMessage(Serializable message) { if(message instanceof PlayerInitData) { setID(((PlayerInitData)message).ID); //ID = ((PlayerInitData)message).ID; BluetoothServer.getInstance().getIncomingQueue().addMessage(new PlayerInitData(WidgetsData.playerName, ID)); return; } queue.addMessage(message); } @Override public void setID(int id) { super.setID(id); BluetoothConnection.humanID = id; } }
Ragnarokma/metropolis
src/main/java/fundamental/games/metropolis/connection/bluetooth/BluetoothServerConnection.java
Java
apache-2.0
1,850
/* * Copyright 2016 The Closure Compiler Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @fileoverview Tests for user-defined Symbols. */ goog.require('goog.testing.jsunit'); const s1 = Symbol('example'); const s2 = Symbol('example'); /** @unrestricted */ const SymbolProps = class { [s1]() { return 's1'; } [s2]() { return 's2'; } } function testSymbols() { const sp = new SymbolProps(); assertEquals('s1', sp[s1]()); assertEquals('s2', sp[s2]()); } function testArrayIterator() { // Note: this test cannot pass in IE8 since we can't polyfill // Array.prototype methods and maintain correct for-in behavior. if (typeof Object.defineProperties !== 'function') return; const iter = [2, 4, 6][Symbol.iterator](); assertObjectEquals({value: 2, done: false}, iter.next()); assertObjectEquals({value: 4, done: false}, iter.next()); assertObjectEquals({value: 6, done: false}, iter.next()); assertTrue(iter.next().done); }
Medium/closure-compiler
test/com/google/javascript/jscomp/runtime_tests/symbol_test.js
JavaScript
apache-2.0
1,481
// Reset $('.touch .client-wrap').click(function(event){ var target = $( event.target ); if ( target.hasClass( "client-close" ) ) { $('.client-wrap div.client').addClass('reset'); } else{ $('.client-wrap div.client').removeClass('reset'); } }); // David Walsh simple lazy loading [].forEach.call(document.querySelectorAll('img[data-src]'), function(img) { img.setAttribute('src', img.getAttribute('data-src')); img.onload = function() { img.removeAttribute('data-src'); }; });
urban-knight/dmcc-website
public/js/clients.js
JavaScript
apache-2.0
512
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_51) on Sun Apr 20 22:40:20 SAST 2014 --> <title>Uses of Interface za.co.neilson.sqlite.orm.DatabaseDriverInterface</title> <meta name="date" content="2014-04-20"> <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 Interface za.co.neilson.sqlite.orm.DatabaseDriverInterface"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../za/co/neilson/sqlite/orm/DatabaseDriverInterface.html" title="interface in za.co.neilson.sqlite.orm">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-files/index-1.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?za/co/neilson/sqlite/orm/class-use/DatabaseDriverInterface.html" target="_top">Frames</a></li> <li><a href="DatabaseDriverInterface.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Interface za.co.neilson.sqlite.orm.DatabaseDriverInterface" class="title">Uses of Interface<br>za.co.neilson.sqlite.orm.DatabaseDriverInterface</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../../za/co/neilson/sqlite/orm/DatabaseDriverInterface.html" title="interface in za.co.neilson.sqlite.orm">DatabaseDriverInterface</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#za.co.neilson.sqlite.orm">za.co.neilson.sqlite.orm</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="za.co.neilson.sqlite.orm"> <!-- --> </a> <h3>Uses of <a href="../../../../../../za/co/neilson/sqlite/orm/DatabaseDriverInterface.html" title="interface in za.co.neilson.sqlite.orm">DatabaseDriverInterface</a> in <a href="../../../../../../za/co/neilson/sqlite/orm/package-summary.html">za.co.neilson.sqlite.orm</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing fields, and an explanation"> <caption><span>Fields in <a href="../../../../../../za/co/neilson/sqlite/orm/package-summary.html">za.co.neilson.sqlite.orm</a> declared as <a href="../../../../../../za/co/neilson/sqlite/orm/DatabaseDriverInterface.html" title="interface in za.co.neilson.sqlite.orm">DatabaseDriverInterface</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Field and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>private <a href="../../../../../../za/co/neilson/sqlite/orm/DatabaseDriverInterface.html" title="interface in za.co.neilson.sqlite.orm">DatabaseDriverInterface</a>&lt;<a href="../../../../../../za/co/neilson/sqlite/orm/DatabaseModel.html" title="type parameter in DatabaseModel">R</a>,<a href="../../../../../../za/co/neilson/sqlite/orm/DatabaseModel.html" title="type parameter in DatabaseModel">C</a>&gt;</code></td> <td class="colLast"><span class="strong">DatabaseModel.</span><code><strong><a href="../../../../../../za/co/neilson/sqlite/orm/DatabaseModel.html#databaseDriverInterface">databaseDriverInterface</a></strong></code>&nbsp;</td> </tr> </tbody> </table> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../za/co/neilson/sqlite/orm/package-summary.html">za.co.neilson.sqlite.orm</a> that return <a href="../../../../../../za/co/neilson/sqlite/orm/DatabaseDriverInterface.html" title="interface in za.co.neilson.sqlite.orm">DatabaseDriverInterface</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../za/co/neilson/sqlite/orm/DatabaseDriverInterface.html" title="interface in za.co.neilson.sqlite.orm">DatabaseDriverInterface</a>&lt;<a href="../../../../../../za/co/neilson/sqlite/orm/DatabaseModel.html" title="type parameter in DatabaseModel">R</a>,<a href="../../../../../../za/co/neilson/sqlite/orm/DatabaseModel.html" title="type parameter in DatabaseModel">C</a>&gt;</code></td> <td class="colLast"><span class="strong">DatabaseModel.</span><code><strong><a href="../../../../../../za/co/neilson/sqlite/orm/DatabaseModel.html#getDatabaseDriverInterface()">getDatabaseDriverInterface</a></strong>()</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>protected abstract <a href="../../../../../../za/co/neilson/sqlite/orm/DatabaseDriverInterface.html" title="interface in za.co.neilson.sqlite.orm">DatabaseDriverInterface</a>&lt;<a href="../../../../../../za/co/neilson/sqlite/orm/DatabaseModel.html" title="type parameter in DatabaseModel">R</a>,<a href="../../../../../../za/co/neilson/sqlite/orm/DatabaseModel.html" title="type parameter in DatabaseModel">C</a>&gt;</code></td> <td class="colLast"><span class="strong">DatabaseModel.</span><code><strong><a href="../../../../../../za/co/neilson/sqlite/orm/DatabaseModel.html#onInitializeDatabaseDriverInterface(java.lang.Object...)">onInitializeDatabaseDriverInterface</a></strong>(java.lang.Object...&nbsp;args)</code>&nbsp;</td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../za/co/neilson/sqlite/orm/DatabaseDriverInterface.html" title="interface in za.co.neilson.sqlite.orm">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-files/index-1.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?za/co/neilson/sqlite/orm/class-use/DatabaseDriverInterface.html" target="_top">Frames</a></li> <li><a href="DatabaseDriverInterface.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
SheldonNeilson/SQLite-Database-Model
SQLite Database Model Core/doc/za/co/neilson/sqlite/orm/class-use/DatabaseDriverInterface.html
HTML
apache-2.0
8,798
CardGames ========= Include some small card games.
yzzw006/CardGames
README.md
Markdown
apache-2.0
52
<html><head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>Variables and Types</title></head> <body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000"> <font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="5">Variables and Types</font></b></p> <p><b>Variables declaration</b></p><blockquote> To declare a variable in PureBasic, simply type its name. You can also specify the type you want this variable to be. Variables do not need to be explicitly declared, as they can be used as "variables on-the-fly". The <a href="define.html">Define</a> keyword can be used to declare multiple variables in one statement. If you don't assign an initial value to the variable, their value will be 0. <p><b>示例</b></p><blockquote> <pre><font face="Courier New, Courier, mono"size="2"> a.b <font color="#3A3966">; Declare a variable called 'a' from byte (.b) type.</font> c.l = a*d.w <font color="#3A3966">; 'd' is declared here within the expression !</font> </font></pre> <u>Notes:</u> <blockquote> Variable names must not start with a number (0,1,...), contain operators (+,-,...) or special characters (????...). <br> <br> The variables in PureBasic are not case sensitive, so "pure" and "PURE" are the same variable. <br> <br> If you don't need to change the content of a variable during the program flow (e.g. you're using fixed values for ID's etc.), you can also take a look at <a href="general_rules.html">constants</a> as an alternative. <br> <br> To avoid typing errors etc. it's possible to force the PureBasic compiler to always want a declaration of variables, before they are first used. Just use <a href="compilerdirectives.html">EnableExplicit</a> keyword in your source code to enable this feature. </blockquote> </blockquote> <p><b>Basic types</b></p><blockquote> PureBasic allows many type variables which can be standard integers, float, double, quad and char numbers or even string characters. Here is the list of the native supported types and a brief description : <br> <br> <table width="75%" border="1" bordercolorlight="#FFFFFF" bordercolordark="#999900"> <tr> <td> <div align="center"><b><font face="Arial" size="2">Name</font></b></div> </td> <td> <div align="center"><b><font face="Arial" size="2">Extension</font></b></div> </td> <td> <div align="center"><b><font face="Arial" size="2">Memory consumption</font></b></div> </td> <td> <div align="center"><b><font face="Arial" size="2">Range</font></b></div> </td> </tr> <tr> <td><font face="Arial" size="2">Byte</font></td> <td><font face="Arial" size="2">.b</font></td> <td><font face="Arial" size="2">1 byte</font></td> <td><font face="Arial" size="2">-128 to +127</font></td> </tr> <tr> <td><font face="Arial" size="2">Ascii</font></td> <td><font face="Arial" size="2">.a</font></td> <td><font face="Arial" size="2">1 byte</font></td> <td><font face="Arial" size="2">0 to +255</font></td> </tr> <tr> <td><font face="Arial" size="2">Character</font></td> <td><font face="Arial" size="2">.c</font></td> <td><font face="Arial" size="2">1 byte (in ascii mode)</font></td> <td><font face="Arial" size="2">0 to +255</font></td> </tr> <tr> <td><font face="Arial" size="2">Character</font></td> <td><font face="Arial" size="2">.c</font></td> <td><font face="Arial" size="2">2 bytes (in unicode mode)</font></td> <td><font face="Arial" size="2">0 to +65535</font></td> </tr> <tr> <td><font face="Arial" size="2">Word</font></td> <td><font face="Arial" size="2">.w</font></td> <td><font face="Arial" size="2">2 bytes</font></td> <td><font face="Arial" size="2">-32768 to +32767</font></td> </tr> <tr> <td><font face="Arial" size="2">Unicode</font></td> <td><font face="Arial" size="2">.u</font></td> <td><font face="Arial" size="2">2 bytes</font></td> <td><font face="Arial" size="2">0 to +65535</font></td> </tr> <tr> <td><font face="Arial" size="2">Long</font></td> <td><font face="Arial" size="2">.l</font></td> <td><font face="Arial" size="2">4 bytes</font></td> <td><font face="Arial" size="2">-2147483648 to +2147483647</font></td> </tr> <tr> <td><font face="Arial" size="2">Integer</font></td> <td><font face="Arial" size="2">.i</font></td> <td><font face="Arial" size="2">4 bytes (using 32-bit compiler)</font></td> <td><font face="Arial" size="2">-2147483648 to +2147483647</font></td> </tr> <tr> <td><font face="Arial" size="2">Integer</font></td> <td><font face="Arial" size="2">.i</font></td> <td><font face="Arial" size="2">8 bytes (using 64-bit compiler)</font></td> <td><font face="Arial" size="2">-9223372036854775808 to +9223372036854775807</font></td> </tr> <tr> <td><font face="Arial" size="2">Float</font></td> <td><font face="Arial" size="2">.f</font></td> <td><font face="Arial" size="2">4 bytes</font></td> <td><font face="Arial" size="2">unlimited (see below)</font></td> </tr> <tr> <td><font face="Arial" size="2">Quad</font></td> <td><font face="Arial" size="2">.q</font></td> <td><font face="Arial" size="2">8 bytes</font></td> <td><font face="Arial" size="2">-9223372036854775808 to +9223372036854775807</font></td> </tr> <tr> <td><font face="Arial" size="2">Double</font></td> <td><font face="Arial" size="2">.d</font></td> <td><font face="Arial" size="2">8 bytes</font></td> <td><font face="Arial" size="2">unlimited (see below)</font></td> </tr> <tr> <td height="24"><font face="Arial" size="2">String</font></td> <td height="24"><font face="Arial" size="2">.s</font></td> <td height="24"><font face="Arial" size="2">string length + 1</font></td> <td height="24"><font face="Arial" size="2">unlimited</font></td> </tr> <tr> <td height="24"><font face="Arial" size="2">Fixed String</font></td> <td height="24"><font face="Arial" size="2">.s{Length}</font></td> <td height="24"><font face="Arial" size="2">string length</font></td> <td height="24"><font face="Arial" size="2">unlimited</font></td> </tr> </table> <br> <b>Unsigned variables</b>: Purebasic offers native support for unsigned variables with byte and word types via the ascii (.a) and unicode (.u) types. The character (.c) type is an unsigned byte in ascii and unsigned word in <a href="unicode.html">unicode</a> that may be used as an unsigned type. <br> <br> <b>Notation of string variables</b>: it is possible to use the '$' as last char of a variable name to mark it as string. This way you can use 'a$' and 'a.s' as different string variables. Please note, that the '$' belongs to the variable name and must be always attached, unlike the '.s' which is only needed when the string variable is declared the first time. <pre><font face="Courier New, Courier, mono"size="2"> a.s = "One string" a$ = "Another string" <b><font color="#3A3966">Debug</font></b> a <font color="#3A3966">; will give "One string"</font> <b><font color="#3A3966">Debug</font></b> a$ <font color="#3A3966">; will give "Another string"</font> </font></pre> <br> <b>Note</b>: The floating numbers (floats + doubles) can also be written like this: 123.5e-20 <pre><font face="Courier New, Courier, mono"size="2"> value.d = 123.5e-20 <b><font color="#3A3966">Debug</font></b> value <font color="#3A3966">; will give 0.000000000000000001235</font> </font></pre> </blockquote> <p><b>Operators</b></p><blockquote> Operators are the functions you can use in expressions to combine the variables, constants, and whatever else. The table below shows the operators you can use in PureBasic, in no particular order (LHS = Left Hand Side, RHS = Right Hand Side). <br> <br> <table border="1" bordercolorlight="#FFFFFF" bordercolordark="#999900"> <tr> <td><div align="center"><b>Operator</b></div></td> <td><div align="center"><b>Description / Example</b></div></td> </tr> <tr> <td><div align="center">=</div></td> <td><font face="Arial" size="2">Equals. This can be used in two ways. The first is to assign the value of the expression on the RHS to the variable on the LHS. The second way is when the result of the operator is used in an expression and is to test whether the values of the expressions on the LHS and RHS are the same (if they are the same this operator will return a true result, otherwise it will be false).<br> <br><i><b>Example:</b></i><br> <font face="Courier New, Courier, mono">a=b+c <font color="#006666">; Assign the value of the expression "b+c" to the variable "a"</font><br> <b><font color="#006666">If</font></b> abc=def <font color="#006666">; Test if the values of abc and def are the same, and use this result in the If command</font> </font> <br><br> When using with strings the '=' is used as assigning operator as well as operator for comparing. Note: the comparing of two strings is "Case-sensitive".<br> <br><i><b>Example:</b></i><br> <font face="Courier New, Courier, mono">a$ = b$ <font color="#006666">; Assign the content of the string "b$" to the string "a$" zu</font><br> <b><font color="#006666">If</font></b> a$ = b$ <font color="#006666">; Test, if the content of the strings a$ and b$ is equal, and use this result in the If command.</font> </font> </font></td> </tr> <tr> <td><div align="center">+</div></td> <td><font face="Arial" size="2">Plus. Gives a result of the value of the expression on the RHS added to the value of the expression on the LHS. If the result of this operator is not used and there is a variable on the LHS, then the value of the expression on the RHS will be added directly to the variable on the LHS.<br> <br><i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> number=something+2 <font color="#006666">; Adds the value 2 to "something" and uses the result with the equals operator</font><br> variable+expression <font color="#006666">; The value of "expression" will be added directly to the variable "variable"</font> </font> <br><br> With strings the '+' is also valid for combining the contents of two strings, where the result will be assigned to the string on the LHS with the '=' operator or will be directly stored into the string on the LHS. Numeric values are also accepted for combination with a string. It will behave like using Str(), Str() or StrD() with their defaults for the optional parameters.<br> <br><i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> a$ = b$ + " more" <font color="#006666">; Combines the content of the string "b$" with the string " more" and save this into the string "a$"</font><br> a$ + b$ <font color="#006666">; Attach the content of the string b$ directly to the string a$.</font> a$ = b$ + 123 </font> </font></td> </tr> <tr> <td><div align="center">-</div></td> <td><font face="Arial" size="2">Minus. Subtracts the value of the expression on the RHS from the value of the expression on the LHS. When there is no expression on the LHS this operator gives the negative value of the value of the expression on the RHS. If the result of this operator is not used and there is a variable on the LHS, then the value of the expression on the RHS will be subtracted directly from the variable on the LHS. This operator cannot be used with string type variables.<br> <br><i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> var=#MyConstant-foo <font color="#006666">; Subtracts the value of "foo" from "#MyConstant" and uses the result with the equals operator</font><br> another=another+ -var <font color="#006666">; Calculates the negative value of "var" and uses the result in the plus operator</font><br> variable-expression <font color="#006666">; The value of "expression" will be subtracted directly from the variable "variable"</font> </font></font></td> </tr> <tr> <td><div align="center">*</div></td> <td><font face="Arial" size="2">Multiplication. Multiplies the value of the expression on the LHS by the value of the expression on the RHS. If the result of this operator is not used and there is a variable on the LHS, then the value of the variable is directly multiplied by the value of the expression on the RHS. This operator cannot be used with string type variables.<br> <br><i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> total=price*count <font color="#006666">; Multiplies the value of "price" by the value of "count" and uses the result with the equals operator</font><br> variable*expression <font color="#006666">; "variable" will be multiplied directly by the value of "expression"</font> </font></font></td> </tr> <tr> <td><div align="center">/</div></td> <td><font face="Arial" size="2">Division. Divides the value of the expression on the LHS by the value of the expression on the RHS. If the result of this operator is not used and there is a variable on the LHS, then the value of the variable is directly divided by the value of the expression on the RHS. This operator cannot be used with string type variables.<br> <br><i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> count=total/price <font color="#006666">; Divides the value of "total" by the value of "price" and uses the result with the equals operator</font><br> variable/expression <font color="#006666">; "variable" will be divided directly by the value of "expression"</font> </font></font></td> </tr> <tr> <td><div align="center">&amp;</div></td> <td><font face="Arial" size="2">Bitwise AND. You should be familiar with binary numbers when using this operator. The result of this operator will be the value of the expression on the LHS anded with the value of the expression on the RHS, bit for bit. The value of each bit is set according to the table below. Additionally, if the result of the operator is not used and there is a variable on the LHS, then the result will be stored directly in that variable. This operator cannot be used with strings.<br> <font size="3"><pre>LHS | RHS | Result ------------------ 0 | 0 | 0 0 | 1 | 0 1 | 0 | 0 1 | 1 | 1</pre></font> <i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> <font color="#006666">; Shown using binary numbers as it will be easier to see the result</font><br> a.w = %1000 &amp; %0101 <font color="#006666">; Result will be 0</font><br> b.w = %1100 &amp; %1010 <font color="#006666">; Result will be %1000</font><br> bits = a &amp; b <font color="#006666">; AND each bit of a and b and use result in equals operator</font><br> a &amp; b <font color="#006666">; AND each bit of a and b and store result directly in variable "a"</font> </font></font></td> </tr> <tr> <td><div align="center">|</div></td> <td><font face="Arial" size="2">Bitwise OR. You should be familiar with binary numbers when using this operator. The result of this operator will be the value of the expression on the LHS or'ed with the value of the expression on the RHS, bit for bit. The value of each bit is set according to the table below. Additionally, if the result of the operator is not used and there is a variable on the LHS, then the result will be stored directly in that variable. This operator cannot be used with strings.<br> <font size="3"><pre>LHS | RHS | Result ------------------ 0 | 0 | 0 0 | 1 | 1 1 | 0 | 1 1 | 1 | 1</pre></font> <i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> <font color="#006666">; Shown using binary numbers as it will be easier to see the result</font><br> a.w = %1000 | %0101 <font color="#006666">; Result will be %1101</font><br> b.w = %1100 | %1010 <font color="#006666">; Result will be %1110</font><br> bits = a | b <font color="#006666">; OR each bit of a and b and use result in equals operator</font><br> a | b <font color="#006666">; OR each bit of a and b and store result directly in variable "a"</font> </font></font></td> </tr> <tr> <td><div align="center">!</div></td> <td><font face="Arial" size="2">Bitwise XOR. You should be familiar with binary numbers when using this operator. The result of this operator will be the value of the expression on the LHS xor'ed with the value of the expression on the RHS, bit for bit. The value of each bit is set according to the table below. Additionally, if the result of the operator is not used and there is a variable on the LHS, then the result will be stored directly in that variable. This operator cannot be used with strings.<br> <font size="3"><pre>LHS | RHS | Result ------------------ 0 | 0 | 0 0 | 1 | 1 1 | 0 | 1 1 | 1 | 0</pre></font> <i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> <font color="#006666">; Shown using binary numbers as it will be easier to see the result</font><br> a.w = %1000 ! %0101 <font color="#006666">; Result will be %1101</font><br> b.w = %1100 ! %1010 <font color="#006666">; Result will be %0110</font><br> bits = a ! b <font color="#006666">; XOR each bit of a and b and use result in equals operator</font><br> a ! b <font color="#006666">; XOR each bit of a and b and store result directly in variable "a"</font> </font></font></td> </tr> <tr> <td><div align="center">~</div></td> <td><font face="Arial" size="2">Bitwise NOT. You should be familiar with binary numbers when using this operator. The result of this operator will be the not'ed value of the expression on the RHS, bit for bit. The value of each bit is set according to the table below. This operator cannot be used with strings.<br> <font size="3"><pre>RHS | Result ---------- 0 | 1 1 | 0 </pre></font> <i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> <font color="#006666">; Shown using binary numbers as it will be easier to see the result</font><br> a.b = ~%1000 <font color="#006666">; In theory the result will be %0111 but in fact is %11110111 (= -9 because a byte is signed).</font><br> b.b = ~%1010 <font color="#006666">; In theory the result will be %0101 but in fact is %11110101 (= -11 because a byte is signed)</font><br> </font></font></td> </tr> <tr> <td><div align="center">()</div></td> <td><font face="Arial" size="2">Brackets. You can use sets of brackets to force part of an expression to be evaluated first, or in a certain order.<br> <br><i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> a = (5 + 6) * 3 <font color="#006666">; Result will be 33 since the 5+6 is evaluated first</font><br> b = 4 * (2 - (3 - 4)) <font color="#006666">; Result will be 12 since the 3-4 is evaluated first, then the 2-result, then the multiplication</font><br> </font></font></td> </tr> <tr> <td><div align="center">&lt;</div></td> <td><font face="Arial" size="2">Less than. This is used to compare the values of the expressions on the LHS and RHS. If the value of the expression on the LHS is less than the value of the expression on the RHS this operator will give a result of true, otherwise the result is false.<br> <br><i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> <b><font color="#006666">If</font></b> a &lt; b <font color="#006666">; Tests, if the value a is smaller than b, and uses this result in the If command</font> </font> <br> <br>Note: The comparing of strings will always be "case-sensitive". </font></td> </tr> <tr> <td><div align="center">&gt;</div></td> <td><font face="Arial" size="2">More than. This is used to compare the values of the expressions on the LHS and RHS. If the value of the expression on the LHS is more than the value of the expression on the RHS this operator will give a result of true, otherwise the result is false.<br> <br><i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> <b><font color="#006666">If</font></b> a &gt; b <font color="#006666">; Tests, if the value a is greater than b, and uses this result in the If command</font> </font> <br> <br>Note: The comparing of strings will always be "case-sensitive". </font></td> </tr> <tr> <td><div align="center">&lt;=</div></td> <td><font face="Arial" size="2">Less than or equal to. This is used to compare the values of the expressions on the LHS and RHS. If the value of the expression on the LHS is less than or equal to the value of the expression on the RHS this operator will give a result of true, otherwise the result is false.<br> <!-- <i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> </font>--> </font></td> </tr> <tr> <td><div align="center">&gt;=</div></td> <td><font face="Arial" size="2">More than or equal to. This is used to compare the values of the expressions on the LHS and RHS. If the value of the expression on the LHS is more than or equal to the value of the expression on the RHS this operator will give a result of true, otherwise the result is false.<br> <!-- <i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> </font>--> </font></td> </tr> <tr> <td><div align="center">&lt;&gt;</div></td> <td><font face="Arial" size="2">Not equal to. This is used to compare the values of the expressions on the LHS and RHS. If the value of the expression on the LHS is equal to the value of the expression on the RHS this operator will give a result of false, otherwise the result is true.<br> <!-- <i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> </font>--> </font></td> </tr> <tr> <td><div align="center">And</div></td> <td><font face="Arial" size="2">Logical AND. Can be used to combine the logical true and false results of the comparison operators to give a result shown in the following table.<br> <font size="3"><pre> LHS | RHS | Result ----------------------- false | false | false false | true | false true | false | false true | true | true</pre><!-- <i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> </font>--></font> </font></td> </tr> <tr> <td><div align="center">Or</div></td> <td><font face="Arial" size="2">Logical OR. Can be used to combine the logical true and false results of the comparison operators to give a result shown in the following table.<br> <font size="3"><pre> LHS | RHS | Result ----------------------- false | false | false false | true | true true | false | true true | true | true</pre><!-- <i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> </font>--></font> </font></td> </tr> <tr> <td><div align="center">XOr</div></td> <td><font face="Arial" size="2">Logical XOR. Can be used to combine the logical true ot false results of the comparison operators to give a result shown in the following table. This operator cannot be used with strings.<br> <font size="3"><pre> LHS | RHS | Result ----------------------- false | false | false false | true | true true | false | true true | true | false</pre><!-- <i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> </font>--></font> </font></td> </tr> <tr> <td><div align="center">Not</div></td> <td><font face="Arial" size="2">The result of this operator will be the not'ed value of the logical on the RHS. The value is set according to the table below. This operator cannot be used with strings.<br> <font size="3"><pre> RHS | Result --------------- false | true true | false </pre><!-- <i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> </font>--></font> </font></td> </tr> <tr> <td><div align="center">&lt;&lt;</div></td> <td><font face="Arial" size="2">Arithmetic shift left. Shifts each bit in the value of the expression on the LHS left by the number of places given by the value of the expression on the RHS. Additionally, when the result of this operator is not used and the LHS contains a variable, that variable will have its value shifted. It probably helps if you understand binary numbers when you use this operator, although you can use it as if each position you shift by is multiplying by an extra factor of 2.<br> <br><i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> a=%1011 &lt;&lt; 1 <font color="#006666">; The value of a will be %10110. %1011=11, %10110=22</font><br> b=%111 &lt;&lt; 4 <font color="#006666">; The value of b will be %1110000. %111=7, %1110000=112</font><br> c.l=$80000000 &lt;&lt; 1 <font color="#006666">; The value of c will be 0. Bits that are shifted off the left edge of the result are lost.</font><br> </font></font></td> </tr> <tr> <td><div align="center">&gt;&gt;</div></td> <td><font face="Arial" size="2">Arithmetic shift right. Shifts each bit in the value of the expression on the LHS right by the number of places given by the value of the expression on the RHS. Additionally, when the result of this operator is not used and the LHS contains a variable, that variable will have its value shifted. It probably helps if you understand binary numbers when you use this operator, although you can use it as if each position you shift by is dividing by an extra factor of 2.<br> <br><i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> d=16 &gt;&gt; 1 <font color="#006666">; The value of d will be 8. 16=%10000, 8=%1000</font><br> e.w=%10101010 &gt;&gt; 4 <font color="#006666">; The value of e will be %1010. %10101010=170, %1010=10. Bits shifted out of the right edge of the result are lost (which is why you do not see an equal division by 16)</font><br> f.b=-128 &gt;&gt; 1 <font color="#006666">; The value of f will be -64. -128=%10000000, -64=%11000000. When shifting to the right, the most significant bit is kept as it is.</font><br> </font></font></td> </tr> <tr> <td><div align="center">%</div></td> <td><font face="Arial" size="2">Modulo. Returns the remainder of the RHS by LHS integer division.<br> <br><i><b>Example:</b></i><br> <font face="Courier New, Courier, mono"> a=16 % 2 <font color="#006666">; The value of a will be 0 as 16/2 = 8 (no remainder)</font><br> b=17 % 2 <font color="#006666">; The value of a will be 1 as 17/2 = 8*2+1 (1 is remaining)</font><br> </font></font></td> </tr> </table> </blockquote> <p><b>Operators shorthands</b></p><blockquote> Every math operators can be used in a shorthand form. </blockquote><p><b>示例</b></p><blockquote> <pre><font face="Courier New, Courier, mono"size="2"> Value + 1 <font color="#3A3966">; The same as: Value = Value + 1</font> Value * 2 <font color="#3A3966">; The same as: Value = Value * 2</font> Value &lt;&lt; 1 <font color="#3A3966">; The same as: Value = Value &lt;&lt; 1</font> </font></pre> Note: this can lead to 'unexpected' results is some rare cases, if the assignment is modified before the affection. </blockquote><p><b>示例</b></p><blockquote> <pre><font face="Courier New, Courier, mono"size="2"> <b><font color="#3A3966">Dim</font></b> <font color="#3A3966">MyArray</font>(10) <font color="#3A3966"> MyArray</font>(<font color="#3A3966">Random</font>(10)) + 1 <font color="#3A3966">; The same as: MyArray(Random(10)) = MyArray(Random(10)) + 1, but here Random() won't return the same value for each call.</font> </font></pre> </blockquote> <p><b>Operators priorities</b></p><blockquote> <pre><font face="Courier New, Courier, mono"size="2"> Priority Level | Operators ---------------+--------------------- 8 (high) | ~, - 7 | &lt;&lt;, &gt;&gt;, %, ! 6 | |, &amp; 5 | *, / 4 | +, - 3 | &gt;, &gt;=, &lt;, &lt;=, =, &lt;&gt; 2 | Not 1 (low) | And, Or, XOr </font></pre> </blockquote> <p><b>Structured types</b></p><blockquote> Build structured types, via the <b><font color="#3A3966">Structure</font></b> keyword. More information can be found in the <a href="structures.html">structures chapter</a>. </blockquote> <p><b>Pointer types</b></p><blockquote> Pointers are declared with a '*' in front of the variable name. More information can be found in the <a href="memory.html">pointers chapter</a>. </blockquote> <p><b>Special information about Floats and Doubles</b></p><blockquote> A floating-point number is stored in a way that makes the binary point "float" around the number, so that it is possible to store very large numbers or very small numbers. However, you cannot store very large numbers with very high accuracy (big and small numbers at the same time, so to speak). <br> <br> Another limitation of floating-point numbers is that they still work in binary, so they can only store numbers exactly which can be made up of multiples and divisions of 2. This is especially important to realize when you try to print a floating-point number in a human readable form (or when performing operations on that float) - storing numbers like 0.5 or 0.125 is easy because they are divisions of 2. Storing numbers such as 0.11 are more difficult and may be stored as a number such as 0.10999999. You can try to display to only a limited range of digits, but do not be surprised if the number displays different from what you would expect! <br> <br> This applies to floating-point numbers in general, not just those in PureBasic. <br> <br> Like the name says the doubles have double-precision (64-bit) compared to the single-precision of the floats (32-bit). So if you need more accurate results with floating-point numbers use doubles instead of floats. <br> <br> The exact range of values, which can be used with floats and doubles to get correct results from arithmetic operations, looks as follows: <blockquote> Float: +- 1.175494e-38 till +- 3.402823e+38 <br> Double: +- 2.2250738585072013e-308 till +- 1.7976931348623157e+308 </blockquote> More information about the 'IEEE 754' standard you can get on <a href="http://en.wikipedia.org/wiki/IEEE_754">Wikipedia</a>. </body></html>
PureBasicCN/PureBasicPreference
target_dir/documentation/reference/variables.html
HTML
apache-2.0
30,862
package bookshop2.client.paymentService; import java.util.List; import org.aries.message.Message; import org.aries.message.MessageInterceptor; import org.aries.util.ExceptionUtil; import bookshop2.Payment; @SuppressWarnings("serial") public class PaymentServiceInterceptor extends MessageInterceptor<PaymentService> implements PaymentService { @Override public List<Payment> getAllPaymentRecords() { try { log.info("#### [admin]: getAllPaymentRecords() sending..."); Message request = createMessage("getAllPaymentRecords"); Message response = getProxy().invoke(request); List<Payment> result = response.getPart("result"); return result; } catch (Exception e) { throw ExceptionUtil.rewrap(e); } } @Override public Payment getPaymentRecordById(Long id) { try { log.info("#### [admin]: getPaymentRecordById() sending..."); Message request = createMessage("getPaymentRecordById"); request.addPart("id", id); Message response = getProxy().invoke(request); Payment result = response.getPart("result"); return result; } catch (Exception e) { throw ExceptionUtil.rewrap(e); } } @Override public List<Payment> getPaymentRecordsByPage(int pageIndex, int pageSize) { try { log.info("#### [admin]: getPaymentRecordsByPage() sending..."); Message request = createMessage("getPaymentRecordsByPage"); request.addPart("pageIndex", pageIndex); request.addPart("pageSize", pageSize); Message response = getProxy().invoke(request); List<Payment> result = response.getPart("result"); return result; } catch (Exception e) { throw ExceptionUtil.rewrap(e); } } @Override public Long addPaymentRecord(Payment payment) { try { log.info("#### [admin]: addPaymentRecord() sending..."); Message request = createMessage("addPaymentRecord"); request.addPart("payment", payment); Message response = getProxy().invoke(request); Long result = response.getPart("result"); return result; } catch (Exception e) { throw ExceptionUtil.rewrap(e); } } @Override public void savePaymentRecord(Payment payment) { try { log.info("#### [admin]: savePaymentRecord() sending..."); Message request = createMessage("savePaymentRecord"); request.addPart("payment", payment); getProxy().invoke(request); } catch (Exception e) { throw ExceptionUtil.rewrap(e); } } @Override public void removeAllPaymentRecords() { try { log.info("#### [admin]: removeAllPaymentRecords() sending..."); Message request = createMessage("removeAllPaymentRecords"); getProxy().invoke(request); } catch (Exception e) { throw ExceptionUtil.rewrap(e); } } @Override public void removePaymentRecord(Payment payment) { try { log.info("#### [admin]: removePaymentRecord() sending..."); Message request = createMessage("removePaymentRecord"); request.addPart("payment", payment); getProxy().invoke(request); } catch (Exception e) { throw ExceptionUtil.rewrap(e); } } @Override public void importPaymentRecords() { try { log.info("#### [admin]: importPaymentRecords() sending..."); Message request = createMessage("importPaymentRecords"); getProxy().invoke(request); } catch (Exception e) { throw ExceptionUtil.rewrap(e); } } }
tfisher1226/ARIES
bookshop2/bookshop2-client/src/main/java/bookshop2/client/paymentService/PaymentServiceInterceptor.java
Java
apache-2.0
3,276
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en-GB" xml:lang="en-GB" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>Statistics of iobj in UD_Chinese-GSD</title> <link rel="root" href=""/> <!-- for JS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"> <link rel="stylesheet" type="text/css" href="../../css/jquery-ui-redmond.css"/> <link rel="stylesheet" type="text/css" href="../../css/style.css"/> <link rel="stylesheet" type="text/css" href="../../css/style-vis.css"/> <link rel="stylesheet" type="text/css" href="../../css/hint.css"/> <script type="text/javascript" src="../../lib/ext/head.load.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/3.2.2/anchor.min.js"></script> <script>document.addEventListener("DOMContentLoaded", function(event) {anchors.add();});</script> <!-- Set up this custom Google search at https://cse.google.com/cse/business/settings?cx=001145188882102106025:dl1mehhcgbo --> <!-- DZ 2021-01-22: I am temporarily hiding the search field to find out whether it slows down loading of the title page. <script> (function() { var cx = '001145188882102106025:dl1mehhcgbo'; var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true; gcse.src = 'https://cse.google.com/cse.js?cx=' + cx; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s); })(); </script> --> <!-- <link rel="shortcut icon" href="favicon.ico"/> --> </head> <body> <div id="main" class="center"> <div id="hp-header"> <table width="100%"><tr><td width="50%"> <span class="header-text"><a href="http://universaldependencies.org/#language-">home</a></span> <span class="header-text"><a href="https://github.com/universaldependencies/docs/edit/pages-source/treebanks/zh_gsd/zh_gsd-dep-iobj.md" target="#">edit page</a></span> <span class="header-text"><a href="https://github.com/universaldependencies/docs/issues">issue tracker</a></span> </td><td> <gcse:search></gcse:search> </td></tr></table> </div> <hr/> <div class="v2complete"> This page pertains to UD version 2. </div> <div id="content"> <noscript> <div id="noscript"> It appears that you have Javascript disabled. Please consider enabling Javascript for this page to see the visualizations. </div> </noscript> <!-- The content may include scripts and styles, hence we must load the shared libraries before the content. --> <script type="text/javascript"> console.time('loading libraries'); var root = '../../'; // filled in by jekyll head.js( // External libraries // DZ: Copied from embedding.html. I don't know which one is needed for what, so I'm currently keeping them all. root + 'lib/ext/jquery.min.js', root + 'lib/ext/jquery.svg.min.js', root + 'lib/ext/jquery.svgdom.min.js', root + 'lib/ext/jquery.timeago.js', root + 'lib/ext/jquery-ui.min.js', root + 'lib/ext/waypoints.min.js', root + 'lib/ext/jquery.address.min.js' ); </script> <h2 id="treebank-statistics-ud_chinese-gsd-relations-iobj">Treebank Statistics: UD_Chinese-GSD: Relations: <code class="language-plaintext highlighter-rouge">iobj</code></h2> <p>This relation is universal.</p> <p>78 nodes (0%) are attached to their parents as <code class="language-plaintext highlighter-rouge">iobj</code>.</p> <p>78 instances of <code class="language-plaintext highlighter-rouge">iobj</code> (100%) are left-to-right (parent precedes child). Average distance between parent and child is 2.12820512820513.</p> <p>The following 4 pairs of parts of speech are connected with <code class="language-plaintext highlighter-rouge">iobj</code>: <tt><a href="zh_gsd-pos-VERB.html">VERB</a></tt>-<tt><a href="zh_gsd-pos-NOUN.html">NOUN</a></tt> (49; 63% instances), <tt><a href="zh_gsd-pos-VERB.html">VERB</a></tt>-<tt><a href="zh_gsd-pos-PROPN.html">PROPN</a></tt> (11; 14% instances), <tt><a href="zh_gsd-pos-VERB.html">VERB</a></tt>-<tt><a href="zh_gsd-pos-PART.html">PART</a></tt> (10; 13% instances), <tt><a href="zh_gsd-pos-VERB.html">VERB</a></tt>-<tt><a href="zh_gsd-pos-PRON.html">PRON</a></tt> (8; 10% instances).</p> <pre><code class="language-conllu"># visual-style 22 bgColor:blue # visual-style 22 fgColor:white # visual-style 20 bgColor:blue # visual-style 20 fgColor:white # visual-style 20 22 iobj color:blue 1 2009 2009 NUM CD NumType=Card 2 nummod _ SpaceAfter=No 2 年 年 NOUN NNB _ 4 clf _ SpaceAfter=No 3 5 5 NUM CD NumType=Card 4 nummod _ SpaceAfter=No 4 月 月 NOUN NNB _ 9 nmod:tmod _ SpaceAfter=No 5 , , PUNCT , _ 9 punct _ SpaceAfter=No 6 國務 國務 NOUN NN _ 7 compound _ SpaceAfter=No 7 院 院 PART SFN _ 9 nsubj _ SpaceAfter=No 8 批複 批複 VERB VV _ 9 advcl _ SpaceAfter=No 9 同意 同意 VERB VV _ 0 root _ SpaceAfter=No 10 , , PUNCT , _ 9 punct _ SpaceAfter=No 11 撤銷 撤銷 VERB VV _ 20 advcl _ SpaceAfter=No 12 南匯 南匯 PROPN NNP _ 13 compound _ SpaceAfter=No 13 區 區 PART SFN _ 11 obj _ SpaceAfter=No 14 , , PUNCT , _ 20 punct _ SpaceAfter=No 15 將 將 ADP BB _ 18 case _ SpaceAfter=No 16 其 其 PRON PRP Person=3 18 nmod _ SpaceAfter=No 17 行政 行政 NOUN NN _ 18 nmod _ SpaceAfter=No 18 區域 區域 NOUN NN _ 20 obl:patient _ SpaceAfter=No 19 整體 整體 NOUN NN _ 20 advmod _ SpaceAfter=No 20 併入 併入 VERB VV _ 9 xcomp _ SpaceAfter=No 21 浦東 浦東 PROPN NNP _ 22 nmod _ SpaceAfter=No 22 新區 新區 NOUN NN _ 20 iobj _ SpaceAfter=No 23 。 。 PUNCT . _ 20 punct _ SpaceAfter=No </code></pre> <pre><code class="language-conllu"># visual-style 10 bgColor:blue # visual-style 10 fgColor:white # visual-style 9 bgColor:blue # visual-style 9 fgColor:white # visual-style 9 10 iobj color:blue 1 麥格林 麥格林 PROPN NNP _ 2 nmod _ SpaceAfter=No 2 神父 神父 NOUN NN _ 9 nsubj _ SpaceAfter=No 3 花 花 VERB VV _ 9 advcl _ SpaceAfter=No 4 了 了 AUX AS Aspect=Perf 3 aux _ SpaceAfter=No 5 相當 相當 ADV RB _ 6 advmod _ SpaceAfter=No 6 長 長 ADJ JJ _ 8 amod _ SpaceAfter=No 7 的 的 PART DEC _ 6 mark:rel _ SpaceAfter=No 8 時間 時間 NOUN NN _ 3 obj _ SpaceAfter=No 9 詢問 詢問 VERB VV _ 0 root _ SpaceAfter=No 10 路濟亞 路濟亞 PROPN NNP _ 9 iobj _ SpaceAfter=No 11 關於 關於 ADP IN _ 15 det _ SpaceAfter=No 12 聖母 聖母 PROPN NNP _ 13 nsubj _ SpaceAfter=No 13 顯靈 顯靈 VERB VV _ 11 ccomp _ SpaceAfter=No 14 的 的 PART DEC Case=Gen 11 case _ SpaceAfter=No 15 細節 細節 NOUN NN _ 9 obj _ SpaceAfter=No 16 。 。 PUNCT . _ 9 punct _ SpaceAfter=No </code></pre> <pre><code class="language-conllu"># visual-style 14 bgColor:blue # visual-style 14 fgColor:white # visual-style 12 bgColor:blue # visual-style 12 fgColor:white # visual-style 12 14 iobj color:blue 1 在 在 ADP IN _ 3 case _ SpaceAfter=No 2 1555 1555 NUM CD NumType=Card 3 nummod _ SpaceAfter=No 3 年 年 NOUN NNB _ 12 obl _ SpaceAfter=No 4 , , PUNCT , _ 12 punct _ SpaceAfter=No 5 哈布斯堡 哈布斯堡 PROPN NNP _ 6 nmod _ SpaceAfter=No 6 君主 君主 NOUN NN _ 12 nsubj _ SpaceAfter=No 7 簽署 簽署 VERB VV _ 12 advcl _ SpaceAfter=No 8 奧格斯堡 奧格斯堡 PROPN NNP _ 10 nmod _ SpaceAfter=No 9 宗教 宗教 NOUN NN _ 10 nmod _ SpaceAfter=No 10 和約 和約 NOUN NN _ 7 obj _ SpaceAfter=No 11 , , PUNCT , _ 12 punct _ SpaceAfter=No 12 授與 授與 VERB VV _ 0 root _ SpaceAfter=No 13 波希米亞 波希米亞 PROPN NNP _ 14 nsubj _ SpaceAfter=No 14 人 人 PART SFN _ 12 iobj _ SpaceAfter=No 15 宗教 宗教 NOUN NN _ 16 nmod _ SpaceAfter=No 16 自由 自由 NOUN NN _ 12 obj _ SpaceAfter=No 17 。 。 PUNCT . _ 12 punct _ SpaceAfter=No </code></pre> </div> <!-- support for embedded visualizations --> <script type="text/javascript"> var root = '../../'; // filled in by jekyll head.js( // We assume that external libraries such as jquery.min.js have already been loaded outside! // (See _layouts/base.html.) // brat helper modules root + 'lib/brat/configuration.js', root + 'lib/brat/util.js', root + 'lib/brat/annotation_log.js', root + 'lib/ext/webfont.js', // brat modules root + 'lib/brat/dispatcher.js', root + 'lib/brat/url_monitor.js', root + 'lib/brat/visualizer.js', // embedding configuration root + 'lib/local/config.js', // project-specific collection data root + 'lib/local/collections.js', // Annodoc root + 'lib/annodoc/annodoc.js', // NOTE: non-local libraries 'https://spyysalo.github.io/conllu.js/conllu.js' ); var webFontURLs = [ // root + 'static/fonts/Astloch-Bold.ttf', root + 'static/fonts/PT_Sans-Caption-Web-Regular.ttf', root + 'static/fonts/Liberation_Sans-Regular.ttf' ]; var setupTimeago = function() { jQuery("time.timeago").timeago(); }; head.ready(function() { setupTimeago(); // mark current collection (filled in by Jekyll) Collections.listing['_current'] = ''; // perform all embedding and support functions Annodoc.activate(Config.bratCollData, Collections.listing); }); </script> <!-- google analytics --> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-55233688-1', 'auto'); ga('send', 'pageview'); </script> <div id="footer"> <p class="footer-text">&copy; 2014–2021 <a href="http://universaldependencies.org/introduction.html#contributors" style="color:gray">Universal Dependencies contributors</a>. Site powered by <a href="http://spyysalo.github.io/annodoc" style="color:gray">Annodoc</a> and <a href="http://brat.nlplab.org/" style="color:gray">brat</a></p>. </div> </div> </body> </html>
UniversalDependencies/universaldependencies.github.io
treebanks/zh_gsd/zh_gsd-dep-iobj.html
HTML
apache-2.0
10,667
/* * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.redshift.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteAuthenticationProfile" * target="_top">AWS API Documentation</a> */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class DeleteAuthenticationProfileRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** * <p> * The name of the authentication profile to delete. * </p> */ private String authenticationProfileName; /** * <p> * The name of the authentication profile to delete. * </p> * * @param authenticationProfileName * The name of the authentication profile to delete. */ public void setAuthenticationProfileName(String authenticationProfileName) { this.authenticationProfileName = authenticationProfileName; } /** * <p> * The name of the authentication profile to delete. * </p> * * @return The name of the authentication profile to delete. */ public String getAuthenticationProfileName() { return this.authenticationProfileName; } /** * <p> * The name of the authentication profile to delete. * </p> * * @param authenticationProfileName * The name of the authentication profile to delete. * @return Returns a reference to this object so that method calls can be chained together. */ public DeleteAuthenticationProfileRequest withAuthenticationProfileName(String authenticationProfileName) { setAuthenticationProfileName(authenticationProfileName); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getAuthenticationProfileName() != null) sb.append("AuthenticationProfileName: ").append(getAuthenticationProfileName()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DeleteAuthenticationProfileRequest == false) return false; DeleteAuthenticationProfileRequest other = (DeleteAuthenticationProfileRequest) obj; if (other.getAuthenticationProfileName() == null ^ this.getAuthenticationProfileName() == null) return false; if (other.getAuthenticationProfileName() != null && other.getAuthenticationProfileName().equals(this.getAuthenticationProfileName()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAuthenticationProfileName() == null) ? 0 : getAuthenticationProfileName().hashCode()); return hashCode; } @Override public DeleteAuthenticationProfileRequest clone() { return (DeleteAuthenticationProfileRequest) super.clone(); } }
aws/aws-sdk-java
aws-java-sdk-redshift/src/main/java/com/amazonaws/services/redshift/model/DeleteAuthenticationProfileRequest.java
Java
apache-2.0
4,104
using Microsoft.AspNetCore.Antiforgery; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Newtonsoft.Json.Linq; using System; using System.Linq; using System.Net.Http; using System.Threading.Tasks; using tracktor.app.Models; namespace tracktor.app { [Produces("application/json")] [Route("api/account")] public class AccountController : Controller { private readonly UserManager<ApplicationUser> _userManager; private readonly SignInManager<ApplicationUser> _signInManager; private readonly ILogger _logger; private readonly IConfiguration _config; private readonly IAntiforgery _antiForgery; private readonly IEmailSender _emailSender; private readonly ITracktorService _client; public AccountController( UserManager<ApplicationUser> userManager, SignInManager<ApplicationUser> signInManager, ILoggerFactory loggerFactory, IAntiforgery antiForgery, IConfiguration config, IEmailSender emailSender, ITracktorService client) { _userManager = userManager; _signInManager = signInManager; _logger = loggerFactory.CreateLogger<AccountController>(); _antiForgery = antiForgery; _config = config; _emailSender = emailSender; _client = client; } private async Task<LoginDTO> CreateResponse(ApplicationUser user) { HttpContext.User = user != null ? await _signInManager.CreateUserPrincipalAsync(user) : null; var roles = user != null ? await _userManager.GetRolesAsync(user) : null; var afTokenSet = _antiForgery.GetAndStoreTokens(Request.HttpContext); return new LoginDTO { id = user?.Id, afToken = afTokenSet.RequestToken, afHeader = afTokenSet.HeaderName, email = user?.Email, roles = roles, timeZone = user?.TimeZone }; } private static bool IsPopulated(string v) { return !string.IsNullOrWhiteSpace(v); } /// <summary> /// Registers a new user /// </summary> /// <param name="dto">Required fields: email, password</param> /// <returns>LoginDTO</returns> [HttpPost("register")] [AllowAnonymous] public async Task<IActionResult> Register([FromBody]AccountDTO dto) { if(!IsPopulated(dto?.email) || !IsPopulated(dto?.password)) { return BadRequest(); } if(!EmailHelpers.Validate(dto.Username)) { return BadRequest(); } if(!Boolean.Parse(_config["Tracktor:RegistrationEnabled"])) { return BadRequest("@RegistrationDisabled"); } if (_config["Tracktor:RegistrationCode"] != dto.code) { return BadRequest("@BadCode"); } var user = new ApplicationUser { UserName = dto.Username, Email = dto.Username }; var result = await _userManager.CreateAsync(user, dto.password); if (result.Succeeded) { user = await _userManager.FindByEmailAsync(dto.Username); await _userManager.AddToRoleAsync(user, "User"); await _signInManager.SignInAsync(user, isPersistent: true); _logger.LogInformation(3, $"User {dto.Username} created a new account with a password"); // create user in tracktor user.TUserID = await _client.CreateUserAsync(user.Id); user.TimeZone = dto.timezone; await _userManager.UpdateAsync(user); return Ok(await CreateResponse(user)); } else if(result.Errors != null && result.Errors.Any(e => e.Code == "DuplicateUserName")) { return BadRequest("@UsernameTaken"); } else { _logger.LogWarning($"Unable to register user {dto.Username}: {string.Join(", ", result.Errors.Select(e => e.Description))}"); } return BadRequest("@UnableToRegister"); } /// <summary> /// Creates or logs in a user using external provider /// </summary> /// <param name="dto">Required fields: provider, code</param> /// <returns>LoginDTO</returns> [HttpPost("external")] [AllowAnonymous] public async Task<IActionResult> ExternalLogin([FromBody]AccountDTO dto) { if (!IsPopulated(dto?.code) || !IsPopulated(dto?.provider)) { return BadRequest(); } var appVerified = false; var emailVerified = false; switch (dto.provider) { case "Facebook": { try { var hc = new HttpClient(); var verifyUrl = _config["Facebook:VerifyUrl"]; var appId = _config["Facebook:AppId"]; var userUrl = _config["Facebook:UserUrl"]; if (string.IsNullOrWhiteSpace(verifyUrl) || string.IsNullOrWhiteSpace(userUrl)) { return BadRequest("@ProviderNotEnabled"); } var appString = await hc.GetStringAsync(verifyUrl + dto.code); var userString = await hc.GetStringAsync(userUrl + dto.code); if (!string.IsNullOrWhiteSpace(appString) && !string.IsNullOrWhiteSpace(userString)) { var appResult = Newtonsoft.Json.JsonConvert.DeserializeObject(appString) as JObject; var userResult = Newtonsoft.Json.JsonConvert.DeserializeObject(userString) as JObject; if (userResult["email"] != null) { dto.email = userResult["email"].ToString(); emailVerified = true; } if (appResult["id"] != null && appResult["id"].ToString() == appId) { appVerified = true; } } } catch(Exception ex) { _logger.LogError($"Unable to log via {dto.provider}: {ex.Message}"); return BadRequest("@UnableToLogin" + dto.provider); } } break; default: return BadRequest("@UnknownLoginProvider"); } if(string.IsNullOrWhiteSpace(dto.Username) || !emailVerified || !appVerified) { return BadRequest("@UnableToLogin" + dto.provider); } if (!EmailHelpers.Validate(dto.Username)) { return BadRequest(); } // create user if necessary var user = await _userManager.FindByEmailAsync(dto.Username); if (user == null) { if (!Boolean.Parse(_config["Tracktor:RegistrationEnabled"])) { return BadRequest("@RegistrationDisabled"); } user = new ApplicationUser { Email = dto.Username, UserName = dto.Username }; await _userManager.CreateAsync(user); await _userManager.AddToRoleAsync(user, "User"); } if (await _signInManager.CanSignInAsync(user)) { await _signInManager.SignInAsync(user, true); _logger.LogInformation(1, $"User {dto.Username} logged in from {Request.HttpContext.Connection.RemoteIpAddress} via Facebook"); return Ok(await CreateResponse(user)); } else { _logger.LogWarning(2, $"Invalid login attempt for user {dto.Username} from {Request.HttpContext.Connection.RemoteIpAddress}."); return BadRequest("@UnableToLogin" + dto.provider); } } /// <summary> /// Logs in a user using password /// </summary> /// <param name="dto">Required fields: email, password</param> /// <returns>LoginDTO</returns> [HttpPost("login")] [AllowAnonymous] public async Task<IActionResult> Login([FromBody]AccountDTO dto) { if (!IsPopulated(dto?.email) || !IsPopulated(dto?.password)) { return BadRequest(); } var result = await _signInManager.PasswordSignInAsync(dto.Username, dto.password, dto.remember, lockoutOnFailure: true); if (result.Succeeded) { var user = await _userManager.FindByEmailAsync(dto.Username); _logger.LogInformation(1, $"User {dto.Username} logged in from {Request.HttpContext.Connection.RemoteIpAddress}"); return Ok(await CreateResponse(user)); } if (result.IsLockedOut || result.IsNotAllowed) { _logger.LogWarning(2, $"User {dto.Username} is locked out."); return BadRequest("@LockedOut"); } else { _logger.LogWarning(2, $"Invalid login attempt for user {dto.Username} from {Request.HttpContext.Connection.RemoteIpAddress}."); return BadRequest("@InvalidAttempt"); } } /// <summary> /// Logs out current user /// </summary> /// <returns>LoginDTO</returns> [HttpPost("logout")] [IgnoreAntiforgeryToken] [Authorize] public async Task<IActionResult> Logout() { var userName = User.Identity.Name; await _signInManager.SignOutAsync(); _logger.LogInformation(4, $"User {userName} logged out"); return Ok(await CreateResponse(null)); } /// <summary> /// Requests a password reset email /// </summary> /// <param name="dto">Required fields: email</param> [HttpPost("forgot")] [AllowAnonymous] public async Task<IActionResult> Forgot([FromBody]AccountDTO dto) { if (!IsPopulated(dto?.email)) { return BadRequest(); } var user = await _userManager.FindByEmailAsync(dto.Username); if (user == null) { return BadRequest("@UnknownUser"); } var code = await _userManager.GeneratePasswordResetTokenAsync(user); var callbackUrl = UrlHelperExtensions.Action(Url, "Index", "Home", new { reset = dto.Username, code = code }, HttpContext.Request.Scheme); _logger.LogInformation(5, $"User {dto.Username} requested a password reset link."); var subject = dto.messages != null && dto.messages.Length > 0 && !string.IsNullOrWhiteSpace(dto.messages[0]) ? dto.messages[0] : "Tracktor - password reset"; var body = dto.messages != null && dto.messages.Length > 1 && !string.IsNullOrWhiteSpace(dto.messages[1]) ? dto.messages[1] : "Please click the link below to reset your password."; await _emailSender.SendEmailAsync(dto.Username, subject, body, callbackUrl); return Ok(); } /// <summary> /// Changes current user's password /// </summary> /// <param name="dto">Required fields: password, newPassword</param> /// <returns>LoginDTO</returns> [HttpPost("change")] [Authorize] public async Task<IActionResult> Change([FromBody]AccountDTO dto) { if (!IsPopulated(dto?.password) || !IsPopulated(dto?.newPassword)) { return BadRequest(); } var user = await _userManager.GetUserAsync(User); if (user == null) { // don't reveal anything return BadRequest("@UnknownUser"); } var result = await _userManager.ChangePasswordAsync(user, dto.password, dto.newPassword); if (result.Succeeded) { await _signInManager.SignInAsync(user, true); _logger.LogInformation(6, $"User {user.Email} has successfully changed password."); return Ok(await CreateResponse(user)); } return BadRequest("@InvalidChangeAttempt"); } /// <summary> /// Resets current user's password using a reset code /// </summary> /// <param name="dto">Required fields: email, password, code</param> /// <returns>LoginDTO</returns> [HttpPost("reset")] [AllowAnonymous] public async Task<IActionResult> Reset([FromBody]AccountDTO dto) { if (!IsPopulated(dto?.email) || !IsPopulated(dto?.password) || !IsPopulated(dto?.code)) { return BadRequest(); } var user = await _userManager.FindByEmailAsync(dto.Username); if (user == null) { // don't reveal anything return Ok(); } if (_signInManager.IsSignedIn(User)) { await _signInManager.SignOutAsync(); } var result = await _userManager.ResetPasswordAsync(user, dto.code, dto.password); _logger.LogInformation(6, $"User {dto.Username} has successfully reset password."); await _signInManager.SignInAsync(user, true); return Ok(await CreateResponse(user)); } /// <summary> /// Deletes current user and all their data /// </summary> /// <returns>LoginDTO</returns> [HttpPost("delete")] [Authorize] public async Task<IActionResult> Delete() { var user = await _userManager.GetUserAsync(User); await _signInManager.SignOutAsync(); var result = await _userManager.DeleteAsync(user); if (result.Succeeded) { _logger.LogInformation(6, $"User {user.Email} has been removed."); } return Ok(await CreateResponse(null)); } /// <summary> /// Initiate a new session /// </summary> /// <returns>LoginDTO</returns> [HttpGet("handshake")] [AllowAnonymous] public async Task<IActionResult> Handshake() { if (User.Identity?.IsAuthenticated ?? false) { var user = await _userManager.GetUserAsync(User); return Ok(await CreateResponse(user)); } return Ok(await CreateResponse(null)); } } }
rohatsu/tracktor
tracktor.app/Controllers/AccountController.cs
C#
apache-2.0
15,547
// Copyright 2020 The Tink-Rust Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // //////////////////////////////////////////////////////////////////////////////// use tink_streaming_aead::subtle; #[test] fn test_aes_ctr_hmac_encrypt_decrypt() { struct TestCase { name: &'static str, key_size_in_bytes: usize, tag_size_in_bytes: usize, segment_size: usize, first_segment_offset: usize, plaintext_size: usize, chunk_size: usize, } let test_cases = vec![ TestCase { name: "small-1", key_size_in_bytes: 16, tag_size_in_bytes: 12, segment_size: 256, first_segment_offset: 0, plaintext_size: 20, chunk_size: 64, }, TestCase { name: "small-2", key_size_in_bytes: 16, tag_size_in_bytes: 12, segment_size: 512, first_segment_offset: 0, plaintext_size: 400, chunk_size: 64, }, TestCase { name: "small-offset-1", key_size_in_bytes: 16, tag_size_in_bytes: 12, segment_size: 256, first_segment_offset: 8, plaintext_size: 20, chunk_size: 64, }, TestCase { name: "small-offset-2", key_size_in_bytes: 16, tag_size_in_bytes: 12, segment_size: 512, first_segment_offset: 8, plaintext_size: 400, chunk_size: 64, }, TestCase { name: "empty-1", key_size_in_bytes: 16, tag_size_in_bytes: 12, segment_size: 256, first_segment_offset: 0, plaintext_size: 0, chunk_size: 128, }, TestCase { name: "empty-2", key_size_in_bytes: 16, tag_size_in_bytes: 12, segment_size: 256, first_segment_offset: 8, plaintext_size: 0, chunk_size: 128, }, TestCase { name: "medium-1", key_size_in_bytes: 16, tag_size_in_bytes: 12, segment_size: 256, first_segment_offset: 0, plaintext_size: 1024, chunk_size: 128, }, TestCase { name: "medium-2", key_size_in_bytes: 16, tag_size_in_bytes: 12, segment_size: 512, first_segment_offset: 0, plaintext_size: 3086, chunk_size: 128, }, TestCase { name: "medium-3", key_size_in_bytes: 32, tag_size_in_bytes: 12, segment_size: 1024, first_segment_offset: 0, plaintext_size: 12345, chunk_size: 128, }, TestCase { name: "large-chunks-1", key_size_in_bytes: 16, tag_size_in_bytes: 12, segment_size: 256, first_segment_offset: 0, plaintext_size: 1024, chunk_size: 4096, }, TestCase { name: "large-chunks-2", key_size_in_bytes: 16, tag_size_in_bytes: 12, segment_size: 512, first_segment_offset: 0, plaintext_size: 5086, chunk_size: 4096, }, TestCase { name: "large-chunks-3", key_size_in_bytes: 32, tag_size_in_bytes: 12, segment_size: 1024, first_segment_offset: 0, plaintext_size: 12345, chunk_size: 5000, }, TestCase { name: "medium-offset-1", key_size_in_bytes: 16, tag_size_in_bytes: 12, segment_size: 256, first_segment_offset: 8, plaintext_size: 1024, chunk_size: 64, }, TestCase { name: "medium-offset-2", key_size_in_bytes: 16, tag_size_in_bytes: 12, segment_size: 512, first_segment_offset: 20, plaintext_size: 3086, chunk_size: 256, }, TestCase { name: "medium-offset-3", key_size_in_bytes: 32, tag_size_in_bytes: 12, segment_size: 1024, first_segment_offset: 10, plaintext_size: 12345, chunk_size: 5000, }, TestCase { name: "last-segment-full-1", key_size_in_bytes: 16, tag_size_in_bytes: 12, segment_size: 256, first_segment_offset: 0, plaintext_size: 216, chunk_size: 64, }, TestCase { name: "last-segment-full-2", key_size_in_bytes: 16, tag_size_in_bytes: 12, segment_size: 256, first_segment_offset: 16, plaintext_size: 200, chunk_size: 256, }, TestCase { name: "last-segment-full-3", key_size_in_bytes: 16, tag_size_in_bytes: 12, segment_size: 256, first_segment_offset: 16, plaintext_size: 440, chunk_size: 1024, }, TestCase { name: "single-byte-1", key_size_in_bytes: 16, tag_size_in_bytes: 12, segment_size: 256, first_segment_offset: 0, plaintext_size: 1024, chunk_size: 1, }, TestCase { name: "single-byte-2", key_size_in_bytes: 32, tag_size_in_bytes: 12, segment_size: 512, first_segment_offset: 0, plaintext_size: 5086, chunk_size: 1, }, ]; for tc in test_cases { let cipher = subtle::AesCtrHmac::new( super::IKM, tink_proto::HashType::Sha256, tc.key_size_in_bytes, tink_proto::HashType::Sha256, tc.tag_size_in_bytes, tc.segment_size, tc.first_segment_offset, ) .unwrap_or_else(|e| panic!("{}: cannot create cipher: {:?}", tc.name, e)); let (pt, ct) = super::encrypt(&cipher, super::AAD, tc.plaintext_size) .unwrap_or_else(|e| panic!("{}: failure during encryption: {:?}", tc.name, e)); assert!( super::decrypt(&cipher, super::AAD, &pt, &ct, tc.chunk_size).is_ok(), "{}: failure during decryption", tc.name ); } } #[test] fn test_aes_ctr_hmac_modified_ciphertext() { let ikm = hex::decode("000102030405060708090a0b0c0d0e0f00112233445566778899aabbccddeeff").unwrap(); let aad = hex::decode("aabbccddeeff").unwrap(); let key_size_in_bytes = 16; let tag_size_in_bytes = 12; let segment_size = 256; let first_segment_offset = 8; let plaintext_size = 1024; let chunk_size = 128; let cipher = subtle::AesCtrHmac::new( &ikm, tink_proto::HashType::Sha256, key_size_in_bytes, tink_proto::HashType::Sha256, tag_size_in_bytes, segment_size, first_segment_offset, ) .expect("Cannot create a cipher"); let (pt, ct) = super::encrypt(&cipher, &aad, plaintext_size).unwrap(); // truncate ciphertext for i in (0..ct.len()).step_by(8) { assert!( super::decrypt(&cipher, &aad, &pt, &ct[..i], chunk_size).is_err(), "expected error" ); } // append to ciphertext let sizes = vec![1, segment_size - ct.len() % segment_size, segment_size]; for size in sizes { let mut ct2 = ct.clone(); ct2.extend_from_slice(&vec![0; size]); assert!( super::decrypt(&cipher, &aad, &pt, &ct2, chunk_size).is_err(), "expected error" ); } // flip bits for i in 0..ct.len() { let mut ct2 = ct.clone(); ct2[i] ^= 0x01; assert!( super::decrypt(&cipher, &aad, &pt, &ct2, chunk_size).is_err(), "expected error" ); } // delete segments for i in 0..ct.len() / segment_size + 1 { let (start, mut end) = super::segment_pos( segment_size, first_segment_offset, cipher.header_length(), i, ); if start > ct.len() { break; } if end > ct.len() { end = ct.len() } let mut ct2 = ct[..start].to_vec(); ct2.extend_from_slice(&ct[end..]); assert!( super::decrypt(&cipher, &aad, &pt, &ct2, chunk_size).is_err(), "expected error" ); } // duplicate segments for i in 0..ct.len() / segment_size + 1 { let (start, mut end) = super::segment_pos( segment_size, first_segment_offset, cipher.header_length(), i, ); if start > ct.len() { break; } if end > ct.len() { end = ct.len() } let mut ct2 = (&ct[..end]).to_vec(); ct2.extend_from_slice(&ct[start..]); assert!( super::decrypt(&cipher, &aad, &pt, &ct2, chunk_size).is_err(), "expected error" ); } // modify aad for i in 0..aad.len() { let mut aad2 = aad.clone(); aad2[i] ^= 0x01; assert!( super::decrypt(&cipher, &aad2, &pt, &ct, chunk_size).is_err(), "expected error" ); } }
project-oak/tink-rust
tests/tests/streaming/subtle/aes_ctr_hmac_test.rs
Rust
apache-2.0
10,108
using System; using System.Runtime.CompilerServices; namespace De.Osthus.Ambeth.Mapping { public class CompositIdentityClassKey { private readonly Object entity; private readonly Type type; private int hash; public CompositIdentityClassKey(Object entity, Type type) { this.entity = entity; this.type = type; hash = RuntimeHelpers.GetHashCode(entity) * 13; if (type != null) { hash += type.GetHashCode() * 23; } } public override bool Equals(Object obj) { if (!(obj is CompositIdentityClassKey)) { return false; } CompositIdentityClassKey otherKey = (CompositIdentityClassKey)obj; bool ee = entity == otherKey.entity; bool te = type == otherKey.type; return ee && te; } public override int GetHashCode() { return hash; } } }
Dennis-Koch/ambeth
ambeth/Ambeth.Mapping/ambeth/mapping/CompositIdentityClassKey.cs
C#
apache-2.0
1,038
// Copyright 2017 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package codeu.chat.client.core; import java.util.Arrays; import java.util.ArrayList; import java.util.Collection; import codeu.chat.common.BasicView; import codeu.chat.common.User; import codeu.chat.util.Uuid; import codeu.chat.util.connections.ConnectionSource; public final class Context { private final BasicView view; private final Controller controller; public Context(ConnectionSource source) { this.view = new View(source); this.controller = new Controller(source); } public UserContext create(String name) { final User user = controller.newUser(name); return user == null ? null : new UserContext(user, view, controller); } public Iterable<UserContext> allUsers() { final Collection<UserContext> users = new ArrayList<>(); for (final User user : view.getUsers()) { users.add(new UserContext(user, view, controller)); } return users; } }
crepric/codeu_mirrored_test_1
src/codeu/chat/client/core/Context.java
Java
apache-2.0
1,510
/* * Copyright 2015-2017 EMBL - European Bioinformatics Institute * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package uk.ac.ebi.eva.runner; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.batch.core.Job; import org.springframework.batch.core.JobExecution; import org.springframework.batch.core.JobParameters; import org.springframework.batch.core.launch.JobOperator; import org.springframework.batch.test.JobLauncherTestUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringRunner; import uk.ac.ebi.eva.pipeline.runner.ManageJobsUtils; import uk.ac.ebi.eva.test.configuration.AsynchronousBatchTestConfiguration; import uk.ac.ebi.eva.test.utils.AbstractJobRestartUtils; /** * Test to check if the ManageJobUtils.markLastJobAsFailed let us restart a job redoing all the steps. */ @RunWith(SpringRunner.class) @ContextConfiguration(classes = {AsynchronousBatchTestConfiguration.class}) @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD) public class JobRestartForceTest extends AbstractJobRestartUtils { // Wait until the job has been launched properly. The launch operation is not transactional, and other // instances of the same job with the same parameter can throw exceptions in this interval. public static final int INITIALIZE_JOB_SLEEP = 100; public static final int STEP_TIME_DURATION = 1000; public static final int WAIT_FOR_JOB_TO_END = 2000; @Autowired private JobOperator jobOperator; @Test public void forceJobFailureEnsuresCleanRunEvenIfStepsNotRestartables() throws Exception { Job job = getTestJob(getQuickStep(false), getWaitingStep(false, STEP_TIME_DURATION)); JobLauncherTestUtils jobLauncherTestUtils = getJobLauncherTestUtils(job); JobExecution jobExecution = launchJob(jobLauncherTestUtils); Thread.sleep(INITIALIZE_JOB_SLEEP); jobOperator.stop(jobExecution.getJobId()); Thread.sleep(WAIT_FOR_JOB_TO_END); ManageJobsUtils.markLastJobAsFailed(getJobRepository(), job.getName(), new JobParameters()); jobExecution = launchJob(jobLauncherTestUtils); Thread.sleep(WAIT_FOR_JOB_TO_END); Assert.assertFalse(jobExecution.getStepExecutions().isEmpty()); } }
cyenyxe/eva-pipeline
src/test/java/uk/ac/ebi/eva/runner/JobRestartForceTest.java
Java
apache-2.0
2,993
<!DOCTYPE html> <html devsite=""> <head> <meta name="project_path" value="/dotnet/_project.yaml"> <meta name="book_path" value="/dotnet/_book.yaml"> </head> <body> {% verbatim %} <div> <article data-uid="Google.Cloud.Asset.V1.BigQueryDestination"> <h1 class="page-title">Class BigQueryDestination </h1> <div class="codewrapper"> <pre class="prettyprint"><code>public sealed class BigQueryDestination : IMessage&lt;BigQueryDestination&gt;, IEquatable&lt;BigQueryDestination&gt;, IDeepCloneable&lt;BigQueryDestination&gt;, IBufferMessage, IMessage</code></pre> </div> <div class="markdown level0 summary"><p>A BigQuery destination for exporting assets to.</p> </div> <div class="inheritance"> <h2>Inheritance</h2> <span><span class="xref">System.Object</span></span> <span> &gt; </span> <span class="xref">BigQueryDestination</span> </div> <div classs="implements"> <h2>Implements</h2> <span><span class="xref">Google.Protobuf.IMessage</span>&lt;<a class="xref" href="Google.Cloud.Asset.V1.BigQueryDestination.html">BigQueryDestination</a>&gt;,</span> <span><span class="xref">System.IEquatable</span>&lt;<a class="xref" href="Google.Cloud.Asset.V1.BigQueryDestination.html">BigQueryDestination</a>&gt;,</span> <span><span class="xref">Google.Protobuf.IDeepCloneable</span>&lt;<a class="xref" href="Google.Cloud.Asset.V1.BigQueryDestination.html">BigQueryDestination</a>&gt;,</span> <span><span class="xref">Google.Protobuf.IBufferMessage</span>,</span> <span><span class="xref">Google.Protobuf.IMessage</span></span> </div> <div class="inheritedMembers expandable"> <h2 class="showalways">Inherited Members</h2> <div> <span class="xref">System.Object.GetHashCode()</span> </div> <div> <span class="xref">System.Object.GetType()</span> </div> <div> <span class="xref">System.Object.MemberwiseClone()</span> </div> <div> <span class="xref">System.Object.ToString()</span> </div> </div> <h2>Namespace</h2> <a class="xref" href="Google.Cloud.Asset.V1.html">Google.Cloud.Asset.V1</a> <h2>Assembly</h2> <p>Google.Cloud.Asset.V1.dll</p> <h2 id="constructors">Constructors </h2> <a id="Google_Cloud_Asset_V1_BigQueryDestination__ctor_" data-uid="Google.Cloud.Asset.V1.BigQueryDestination.#ctor*"></a> <h3 id="Google_Cloud_Asset_V1_BigQueryDestination__ctor" data-uid="Google.Cloud.Asset.V1.BigQueryDestination.#ctor" class="notranslate">BigQueryDestination()</h3> <div class="codewrapper"> <pre class="prettyprint"><code>public BigQueryDestination()</code></pre> </div> <a id="Google_Cloud_Asset_V1_BigQueryDestination__ctor_" data-uid="Google.Cloud.Asset.V1.BigQueryDestination.#ctor*"></a> <h3 id="Google_Cloud_Asset_V1_BigQueryDestination__ctor_Google_Cloud_Asset_V1_BigQueryDestination_" data-uid="Google.Cloud.Asset.V1.BigQueryDestination.#ctor(Google.Cloud.Asset.V1.BigQueryDestination)" class="notranslate">BigQueryDestination(BigQueryDestination)</h3> <div class="codewrapper"> <pre class="prettyprint"><code>public BigQueryDestination(BigQueryDestination other)</code></pre> </div> <strong>Parameter</strong> <table class="responsive"> <tbody> <tr> <td><strong>Name</strong></td> <td><strong>Description</strong></td> </tr> <tr> <td><span class="parametername">other</span></td> <td><code><a class="xref" href="Google.Cloud.Asset.V1.BigQueryDestination.html">BigQueryDestination</a></code><br></td> </tr> </tbody> </table> <h2 id="properties">Properties </h2> <a id="Google_Cloud_Asset_V1_BigQueryDestination_Dataset_" data-uid="Google.Cloud.Asset.V1.BigQueryDestination.Dataset*"></a> <h3 id="Google_Cloud_Asset_V1_BigQueryDestination_Dataset" data-uid="Google.Cloud.Asset.V1.BigQueryDestination.Dataset" class="notranslate">Dataset</h3> <div class="codewrapper"> <pre class="prettyprint"><code>public string Dataset { get; set; }</code></pre> </div> <div class="markdown level1 summary"><p>Required. The BigQuery dataset in format &quot;projects/projectId/datasets/datasetId&quot;, to which the snapshot result should be exported. If this dataset does not exist, the export call returns an INVALID_ARGUMENT error.</p> </div> <strong>Property Value</strong> <table class="responsive"> <tbody> <tr> <td><strong>Type</strong></td> <td><strong>Description</strong></td> </tr> <tr> <td><span class="xref">System.String</span></td> <td></td> </tr> </tbody> </table> <a id="Google_Cloud_Asset_V1_BigQueryDestination_Force_" data-uid="Google.Cloud.Asset.V1.BigQueryDestination.Force*"></a> <h3 id="Google_Cloud_Asset_V1_BigQueryDestination_Force" data-uid="Google.Cloud.Asset.V1.BigQueryDestination.Force" class="notranslate">Force</h3> <div class="codewrapper"> <pre class="prettyprint"><code>public bool Force { get; set; }</code></pre> </div> <div class="markdown level1 summary"><p>If the destination table already exists and this flag is <code>TRUE</code>, the table will be overwritten by the contents of assets snapshot. If the flag is <code>FALSE</code> or unset and the destination table already exists, the export call returns an INVALID_ARGUMEMT error.</p> </div> <strong>Property Value</strong> <table class="responsive"> <tbody> <tr> <td><strong>Type</strong></td> <td><strong>Description</strong></td> </tr> <tr> <td><span class="xref">System.Boolean</span></td> <td></td> </tr> </tbody> </table> <a id="Google_Cloud_Asset_V1_BigQueryDestination_PartitionSpec_" data-uid="Google.Cloud.Asset.V1.BigQueryDestination.PartitionSpec*"></a> <h3 id="Google_Cloud_Asset_V1_BigQueryDestination_PartitionSpec" data-uid="Google.Cloud.Asset.V1.BigQueryDestination.PartitionSpec" class="notranslate">PartitionSpec</h3> <div class="codewrapper"> <pre class="prettyprint"><code>public PartitionSpec PartitionSpec { get; set; }</code></pre> </div> <div class="markdown level1 summary"><p>[partition_spec] determines whether to export to partitioned table(s) and how to partition the data.</p> <p>If [partition_spec] is unset or [partition_spec.partition_key] is unset or <code>PARTITION_KEY_UNSPECIFIED</code>, the snapshot results will be exported to non-partitioned table(s). [force] will decide whether to overwrite existing table(s).</p> <p>If [partition_spec] is specified. First, the snapshot results will be written to partitioned table(s) with two additional timestamp columns, readTime and requestTime, one of which will be the partition key. Secondly, in the case when any destination table already exists, it will first try to update existing table&apos;s schema as necessary by appending additional columns. Then, if [force] is <code>TRUE</code>, the corresponding partition will be overwritten by the snapshot results (data in different partitions will remain intact); if [force] is unset or <code>FALSE</code>, it will append the data. An error will be returned if the schema update or data appension fails.</p> </div> <strong>Property Value</strong> <table class="responsive"> <tbody> <tr> <td><strong>Type</strong></td> <td><strong>Description</strong></td> </tr> <tr> <td><a class="xref" href="Google.Cloud.Asset.V1.PartitionSpec.html">PartitionSpec</a></td> <td></td> </tr> </tbody> </table> <a id="Google_Cloud_Asset_V1_BigQueryDestination_SeparateTablesPerAssetType_" data-uid="Google.Cloud.Asset.V1.BigQueryDestination.SeparateTablesPerAssetType*"></a> <h3 id="Google_Cloud_Asset_V1_BigQueryDestination_SeparateTablesPerAssetType" data-uid="Google.Cloud.Asset.V1.BigQueryDestination.SeparateTablesPerAssetType" class="notranslate">SeparateTablesPerAssetType</h3> <div class="codewrapper"> <pre class="prettyprint"><code>public bool SeparateTablesPerAssetType { get; set; }</code></pre> </div> <div class="markdown level1 summary"><p>If this flag is <code>TRUE</code>, the snapshot results will be written to one or multiple tables, each of which contains results of one asset type. The [force] and [partition_spec] fields will apply to each of them.</p> <p>Field [table] will be concatenated with &quot;<em>&quot; and the asset type names (see <a href="https://cloud.google.com/asset-inventory/docs/supported-asset-types">https://cloud.google.com/asset-inventory/docs/supported-asset-types</a> for supported asset types) to construct per-asset-type table names, in which all non-alphanumeric characters like &quot;.&quot; and &quot;/&quot; will be substituted by &quot;</em>&quot;. Example: if field [table] is &quot;mytable&quot; and snapshot results contain &quot;storage.googleapis.com/Bucket&quot; assets, the corresponding table name will be &quot;mytable_storage_googleapis_com_Bucket&quot;. If any of these tables does not exist, a new table with the concatenated name will be created.</p> <p>When [content_type] in the ExportAssetsRequest is <code>RESOURCE</code>, the schema of each table will include RECORD-type columns mapped to the nested fields in the Asset.resource.data field of that asset type (up to the 15 nested level BigQuery supports (<a href="https://cloud.google.com/bigquery/docs/nested-repeated#limitations">https://cloud.google.com/bigquery/docs/nested-repeated#limitations</a>)). The fields in &gt;15 nested levels will be stored in JSON format string as a child column of its parent RECORD column.</p> <p>If error occurs when exporting to any table, the whole export call will return an error but the export results that already succeed will persist. Example: if exporting to table_type_A succeeds when exporting to table_type_B fails during one export call, the results in table_type_A will persist and there will not be partial results persisting in a table.</p> </div> <strong>Property Value</strong> <table class="responsive"> <tbody> <tr> <td><strong>Type</strong></td> <td><strong>Description</strong></td> </tr> <tr> <td><span class="xref">System.Boolean</span></td> <td></td> </tr> </tbody> </table> <a id="Google_Cloud_Asset_V1_BigQueryDestination_Table_" data-uid="Google.Cloud.Asset.V1.BigQueryDestination.Table*"></a> <h3 id="Google_Cloud_Asset_V1_BigQueryDestination_Table" data-uid="Google.Cloud.Asset.V1.BigQueryDestination.Table" class="notranslate">Table</h3> <div class="codewrapper"> <pre class="prettyprint"><code>public string Table { get; set; }</code></pre> </div> <div class="markdown level1 summary"><p>Required. The BigQuery table to which the snapshot result should be written. If this table does not exist, a new table with the given name will be created.</p> </div> <strong>Property Value</strong> <table class="responsive"> <tbody> <tr> <td><strong>Type</strong></td> <td><strong>Description</strong></td> </tr> <tr> <td><span class="xref">System.String</span></td> <td></td> </tr> </tbody> </table> </article> </div> {% endverbatim %} </body> </html>
googleapis/doc-templates
testdata/goldens/dotnet/Google.Cloud.Asset.V1.BigQueryDestination.html
HTML
apache-2.0
11,396
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. Imports System.Runtime.InteropServices Imports Microsoft.CodeAnalysis.CodeGen Imports Microsoft.CodeAnalysis.VisualBasic.Symbols Namespace Microsoft.CodeAnalysis.VisualBasic Friend NotInheritable Class Rewriter Public Shared Function LowerBodyOrInitializer( method As MethodSymbol, methodOrdinal As Integer, body As BoundBlock, previousSubmissionFields As SynthesizedSubmissionFields, compilationState As TypeCompilationState, diagnostics As DiagnosticBag, ByRef lazyVariableSlotAllocator As VariableSlotAllocator, lambdaDebugInfoBuilder As ArrayBuilder(Of LambdaDebugInfo), closureDebugInfoBuilder As ArrayBuilder(Of ClosureDebugInfo), ByRef delegateRelaxationIdDispenser As Integer, <Out> ByRef stateMachineTypeOpt As StateMachineTypeSymbol, allowOmissionOfConditionalCalls As Boolean, isBodySynthesized As Boolean) As BoundBlock Debug.Assert(Not body.HasErrors) Debug.Assert(compilationState.ModuleBuilderOpt IsNot Nothing) ' performs node-specific lowering. Dim sawLambdas As Boolean Dim symbolsCapturedWithoutCopyCtor As ISet(Of Symbol) = Nothing Dim rewrittenNodes As HashSet(Of BoundNode) = Nothing Dim flags = If(allowOmissionOfConditionalCalls, LocalRewriter.RewritingFlags.AllowOmissionOfConditionalCalls, LocalRewriter.RewritingFlags.Default) Dim loweredBody = LocalRewriter.Rewrite(body, method, compilationState, previousSubmissionFields, diagnostics, rewrittenNodes, sawLambdas, symbolsCapturedWithoutCopyCtor, flags, currentMethod:=Nothing) If loweredBody.HasErrors Then Return loweredBody End If #If DEBUG Then For Each node In rewrittenNodes.ToArray If node.Kind = BoundKind.Literal Then rewrittenNodes.Remove(node) End If Next #End If If lazyVariableSlotAllocator Is Nothing Then ' synthesized lambda methods are handled in LambdaRewriter.RewriteLambdaAsMethod Debug.Assert(TypeOf method IsNot SynthesizedLambdaMethod) lazyVariableSlotAllocator = compilationState.ModuleBuilderOpt.TryCreateVariableSlotAllocator(method, method) End If ' Lowers lambda expressions into expressions that construct delegates. Dim bodyWithoutLambdas = loweredBody If sawLambdas Then bodyWithoutLambdas = LambdaRewriter.Rewrite(loweredBody, method, methodOrdinal, lambdaDebugInfoBuilder, closureDebugInfoBuilder, delegateRelaxationIdDispenser, lazyVariableSlotAllocator, compilationState, If(symbolsCapturedWithoutCopyCtor, SpecializedCollections.EmptySet(Of Symbol)), diagnostics, rewrittenNodes) End If If bodyWithoutLambdas.HasErrors Then Return bodyWithoutLambdas End If Return RewriteIteratorAndAsync(bodyWithoutLambdas, method, methodOrdinal, compilationState, diagnostics, lazyVariableSlotAllocator, stateMachineTypeOpt) End Function Friend Shared Function RewriteIteratorAndAsync(bodyWithoutLambdas As BoundBlock, method As MethodSymbol, methodOrdinal As Integer, compilationState As TypeCompilationState, diagnostics As DiagnosticBag, slotAllocatorOpt As VariableSlotAllocator, <Out> ByRef stateMachineTypeOpt As StateMachineTypeSymbol) As BoundBlock Debug.Assert(compilationState.ModuleBuilderOpt IsNot Nothing) Dim iteratorStateMachine As IteratorStateMachine = Nothing Dim bodyWithoutIterators = IteratorRewriter.Rewrite(bodyWithoutLambdas, method, methodOrdinal, slotAllocatorOpt, compilationState, diagnostics, iteratorStateMachine) If bodyWithoutIterators.HasErrors Then Return bodyWithoutIterators End If Dim asyncStateMachine As AsyncStateMachine = Nothing Dim bodyWithoutAsync = AsyncRewriter.Rewrite(bodyWithoutIterators, method, methodOrdinal, slotAllocatorOpt, compilationState, diagnostics, asyncStateMachine) Debug.Assert(iteratorStateMachine Is Nothing OrElse asyncStateMachine Is Nothing) stateMachineTypeOpt = If(iteratorStateMachine, DirectCast(asyncStateMachine, StateMachineTypeSymbol)) Return bodyWithoutAsync End Function End Class End Namespace
paladique/roslyn
src/Compilers/VisualBasic/Portable/Lowering/Rewriter.vb
Visual Basic
apache-2.0
6,817
// // Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.2 generiert // Siehe <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a> // Änderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren. // Generiert: 2020.03.13 um 12:48:52 PM CET // package net.opengis.ows._1; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.bind.annotation.XmlType; /** * Complete reference to a remote or local resource, allowing including metadata about that resource. * * <p>Java-Klasse für ReferenceType complex type. * * <p>Das folgende Schemafragment gibt den erwarteten Content an, der in dieser Klasse enthalten ist. * * <pre> * &lt;complexType name="ReferenceType"&gt; * &lt;complexContent&gt; * &lt;extension base="{http://www.opengis.net/ows/1.1}AbstractReferenceBaseType"&gt; * &lt;sequence&gt; * &lt;element ref="{http://www.opengis.net/ows/1.1}Identifier" minOccurs="0"/&gt; * &lt;element ref="{http://www.opengis.net/ows/1.1}Abstract" maxOccurs="unbounded" minOccurs="0"/&gt; * &lt;element name="Format" type="{http://www.opengis.net/ows/1.1}MimeType" minOccurs="0"/&gt; * &lt;element ref="{http://www.opengis.net/ows/1.1}Metadata" maxOccurs="unbounded" minOccurs="0"/&gt; * &lt;/sequence&gt; * &lt;/extension&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ReferenceType", propOrder = { "identifier", "_abstract", "format", "metadata" }) @XmlSeeAlso({ ServiceReferenceType.class }) public class ReferenceType extends AbstractReferenceBaseType { @XmlElement(name = "Identifier") protected CodeType identifier; @XmlElement(name = "Abstract") protected List<LanguageStringType> _abstract; @XmlElement(name = "Format") protected String format; @XmlElement(name = "Metadata") protected List<MetadataType> metadata; /** * Optional unique identifier of the referenced resource. * * @return * possible object is * {@link CodeType } * */ public CodeType getIdentifier() { return identifier; } /** * Legt den Wert der identifier-Eigenschaft fest. * * @param value * allowed object is * {@link CodeType } * */ public void setIdentifier(CodeType value) { this.identifier = value; } public boolean isSetIdentifier() { return (this.identifier!= null); } /** * Gets the value of the abstract property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the abstract property. * * <p> * For example, to add a new item, do as follows: * <pre> * getAbstract().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link LanguageStringType } * * */ public List<LanguageStringType> getAbstract() { if (_abstract == null) { _abstract = new ArrayList<LanguageStringType>(); } return this._abstract; } public boolean isSetAbstract() { return ((this._abstract!= null)&&(!this._abstract.isEmpty())); } public void unsetAbstract() { this._abstract = null; } /** * Ruft den Wert der format-Eigenschaft ab. * * @return * possible object is * {@link String } * */ public String getFormat() { return format; } /** * Legt den Wert der format-Eigenschaft fest. * * @param value * allowed object is * {@link String } * */ public void setFormat(String value) { this.format = value; } public boolean isSetFormat() { return (this.format!= null); } /** * Optional unordered list of additional metadata about this resource. A list of optional metadata elements for this ReferenceType could be specified in the Implementation Specification for each use of this type in a specific OWS. Gets the value of the metadata property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the metadata property. * * <p> * For example, to add a new item, do as follows: * <pre> * getMetadata().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link MetadataType } * * */ public List<MetadataType> getMetadata() { if (metadata == null) { metadata = new ArrayList<MetadataType>(); } return this.metadata; } public boolean isSetMetadata() { return ((this.metadata!= null)&&(!this.metadata.isEmpty())); } public void unsetMetadata() { this.metadata = null; } public void setAbstract(List<LanguageStringType> value) { this._abstract = value; } public void setMetadata(List<MetadataType> value) { this.metadata = value; } }
3dcitydb/web-feature-service
src-gen/main/java/net/opengis/ows/_1/ReferenceType.java
Java
apache-2.0
5,813
package functionalProgramming.ad_hoc import functionalProgramming.ad_hoc import org.scalatest.{FunSuite, WordSpecLike} /** * Created by yujieshui on 2017/1/7. */ class GameOfKylesTest extends WordSpecLike { import GameOfKyles._ implicit val f: (Seq[Pin]) => Set[ad_hoc.GameOfKyles.Pin] = seq2set _ "enum" must { "1" in { assert(playGame(Seq(1))) } "2" in { assert(playGame(Seq(2))) } "3" in { assert(playGame(Seq(3))) } "10" in { 1 to 10 foreach (i => assert(playGame(Seq(i)), i)) } "1,2" in { assert(playGame(Seq(1, 2))) } "1,1,1" in { val seq = Seq(1, 1, 1) assert(playGame(seq)) } "1,2,1" in { val seq = Seq(1, 2, 1) assert(playGame(seq)) } "1,3,1" in { val seq = Seq(1, 3, 1) assert(playGame(seq)) } "1,2,2" in { val seq = Seq(1, 2, 2) assert(playGame(seq)) } "n,n" in { 1 to 6 foreach (i => assert(!playGame(Seq(i, i)), i)) } "1,2,3" in { assert(!playGame(Seq(1, 2, 3))) } "2,3,4" in { assert(!playGame(Seq(2, 3, 4))) } "1,2,3,4" in { assert(playGame(Seq(1, 2, 3, 4))) } "1,2,3,4,5" in { assert(playGame(Seq(1, 2, 3, 4, 5))) } "4,4,10" in { val seq = Seq(4, 4, 10) assert(playGame(seq)) } "12,34,56" in { // val seq = Seq(12, 34, 56) // assert(playGame(seq)) } "finish" in { println(result.mkString("\n")) } } "prode" must { "10 10" in { val x = for { a <- 1 to 20 b <- 1 to 20 } yield ((a, b), playGame(Seq(a, b)),Integer toBinaryString a | b , Integer.toBinaryString(a ^ b) ) // println(x.filter(_._2 == false).map(_._1).map(_._1)) // println(x.filter(_._2 == false).map(_._1).map(_._2)) println(x.mkString("\n")) } } "test case " must { "1" in { assert(playGame(line2Seq("IIXXIIIIII"))) assert(playGame(line2Seq("IXIXI"))) assert(!playGame(line2Seq("XXIXXI"))) assert(!playGame(line2Seq("IIXII"))) assert(playGame(line2Seq("XIXIIXII"))) assert(playGame(line2Seq("IIXIII"))) assert(playGame(line2Seq("IXXXX"))) assert(playGame(line2Seq("IXIXIII"))) assert(playGame(line2Seq("XIIIXIXXIX"))) } "xx" in { assert(playGame(Seq(7, 8, 9, 10))) assert(playGame(Seq(3, 5, 5, 10))) } "3" in { val x = for { a <- 1 to 20 b <- (a + 1) to 20 if 1 to 10 forall (i => playGame(Seq(a, b, i)) == playGame(Seq(b - a, i)) ) } yield { a -> b } println(x.map { case (a, b) => s"case $a :: $b :: other => enumAll(($b-$a)+:other) " }.mkString("\n")) } "case 3" in { println((line2Seq("IIXIIIIIIIXIIIIXIXIIIXIIXIIIIXIIIXIIXXIXXIIIXIIIIXIIIXIIIIIIIXIIXIIIIIIIIIXIIXXIIIIIIIIIIIIIXIXIIIXIIXIXIXIXIIIIXIIIIIXIIXIXIIXIIIIIIIIIXIIIIIIIXIXIIIIXIXIIIIIXXXIIIIIIIIIXIIIIIIIXIIIIXIIIIXIIXI"))) // println((line2Seq("IXXIIXXIXIIIIIIIXXIIIIIIIIXIIXIIIIIIIIIIIIIIIIIIIIIIIIIIIIIXXIIXIIIIIIXXIIIXIXIXIIIXIIXIIIIXIXIIIXIXIIIIIXXXIIIIIIIIIIIIIIIIIXIXIXIIIIIIIXIIIXIXIIIIIIXIIIIIXXIIIXIIIXIIIIIIXXIXXXXIIIIIIIIIIIXIIXIXII"))) // enumAll(Seq(1, 2, 1, 7, 8, 2, 29, 2, 6, 3, 1, 1, 3, 2, 4, 1, 3, 1, 5, 17, 1, 1, 7, 3, 1, 6, 5, 3, 3, 6, 1, 11, 2, 1, 2)) playGame(Seq(1, 4, 6, 8, 11, 17, 29)) } "10 to 20" in { val l = for { a <- 10 to 20 b <- (a + 1) to 20 } yield ((a, b), playGame(Seq(a, b))) l.filter(_._2 == false).foreach(println) } } }
1178615156/hackerrank
src/test/scala/functionalProgramming/ad_hoc/GameOfKylesTest.scala
Scala
apache-2.0
3,662
package io.github.varvelworld.var.ioc.core.annotation.meta.factory; import io.github.varvelworld.var.ioc.core.annotation.Resource; import io.github.varvelworld.var.ioc.core.meta.ParamResourceMeta; import io.github.varvelworld.var.ioc.core.meta.factory.ParamResourceMetaFactory; import java.lang.reflect.Parameter; /** * Created by luzhonghao on 2016/12/4. */ public class AnnotationParamResourceMetaFactoryImpl implements ParamResourceMetaFactory { private final ParamResourceMeta paramResourceMeta; public AnnotationParamResourceMetaFactoryImpl(Parameter parameter) { this(parameter, parameter.getAnnotation(Resource.class)); } public AnnotationParamResourceMetaFactoryImpl(Parameter parameter, Resource annotation) { String id = annotation.value(); if(id.isEmpty()) { if(parameter.isNamePresent()){ id = parameter.getName(); } else { throw new RuntimeException("id is empty"); } } this.paramResourceMeta = new ParamResourceMeta(id); } @Override public ParamResourceMeta paramResourceMeta() { return paramResourceMeta; } }
varvelworld/var-ioc
src/main/java/io/github/varvelworld/var/ioc/core/annotation/meta/factory/AnnotationParamResourceMetaFactoryImpl.java
Java
apache-2.0
1,193