answer
stringlengths
15
1.25M
import Queue import handlers import inspect import threading import pkgutil import os import sys import imp from gatherer import Gatherer import signal import platform import ConfigParser class GatherAgent(object): """ A simple layer between inputs (gatherers) and output (handler) using a simple implementation of reactor pattern. """ KEY_SEPARATOR = '.' def start(self, config_file='gather_agent.ini'): """ Initialization method of the GatherAgent. Sets up required queues, arses the configuration, loads gatherers and handler and starts the dispatcher. """ self.q = Queue.Queue() self.gatherers = [] # Load configuration properties config = ConfigParser.ConfigParser() config.read(config_file) config.set('Gatherers', 'prefix', platform.node()) self.config = config # Start gatherers and handlers.. self.handler = self.start_handler(config.get('General', 'handler')) self.start_gatherers(self.load_gatherers(), self.handler) signal.signal(signal.SIGINT, self._stop) self.active = True self.loop() def start_handler(self, handler_cls): <API key> = self.load_partial_config('Handlers') <API key> = self.load_partial_config('Handlers', handler_cls) <API key>.update(<API key>) for o, _ in self.load_classes_list('handlers'): if o.__name__ == handler_cls: obj = o(<API key>) return obj def start_gatherers(self, instances, handler): """ Creates new threads for each gatherer running the gatherer's run() method """ for instance in instances: t = threading.Thread(target=instance.run) t.daemon = True t.start() self.gatherers.append(instance) def loop(self): """ Main dispatcher loop which waits for available objects in the queue. Once an event is received, it calls event's handler and waits for results before processing the next event. """ while self.active: event = self.q.get() event.handle() def load_partial_config(self, section, keyprefix=None): """ Parses a partial configuration from the ini-file, filtering any key that isn't defined by the keyprefix. If no keyprefix is given, filters all the properties that are namespaced with dot (.) """ section_config = self.config.items(section) partial_config = {} for k, v in section_config: d = None if keyprefix is not None: keyprefix = keyprefix.lower() i = k.rfind(keyprefix + self.KEY_SEPARATOR) if i > -1: d = { k: v } else: i = k.rfind(self.KEY_SEPARATOR) if i < 0: d = { k: v } if d is not None: partial_config.update(d) return partial_config def <API key>(self, class_name): handlers_config = self.load_partial_config('Handlers', class_name) return handlers_config def <API key>(self, class_name): <API key> = self.load_partial_config('Gatherers') <API key> = self.load_partial_config('Gatherers', class_name) <API key>.update(<API key>) return <API key> def load_classes_list(self, package): """ Loads all classes from the given package. Returns a generator with two parameters, class_name and the module """ path = os.path.join(os.path.dirname(__file__), package) modules = pkgutil.iter_modules(path=[path]) for _, module_name, _ in modules: fp, pathname, description = imp.find_module(module_name, [path]) module = imp.load_module(module_name, fp, pathname, description) for name in dir(module): o = getattr(module, name) if inspect.isclass(o): yield o, name def load_gatherers(self): """ Creates and returns a generator with one instance of each gatherers object. """ for o, name in self.load_classes_list('gatherers'): if issubclass(o, Gatherer) and o is not Gatherer: partial_config = self.<API key>(name) obj = o(self.handler, partial_config, self.q) yield obj def _stop(self, signum, frame): """ If a signal is received from the OS, this method is used to clean up and stop all the gatherers and handlers. """ print 'Received signal ' + str(signum) + ', closing gatherers and handlers' self.active = False for i in self.gatherers: i.close() self.handler.close() if __name__ == "__main__": g = GatherAgent() if len(sys.argv) > 1: g.start(sys.argv[1]) else: g.start()
using NuGet.Configuration; using NuGet.Versioning; using NuKeeper.Abstractions.Inspections.Files; using NuKeeper.Abstractions.NuGet; using NuKeeper.Abstractions.<API key>; using NuKeeper.Inspection.Files; using NuKeeper.Update.Process; using NuKeeper.Update.ProcessRunner; using NUnit.Framework; using System; using System.IO; using System.Threading.Tasks; namespace NuKeeper.Integration.Tests.NuGet.Process { [TestFixture] public class <API key> : <API key> { private readonly string <API key> = @"<Project ToolsVersion=""15.0"" xmlns=""http://schemas.microsoft.com/developer/msbuild/2003""> <Import Project=""$(<API key>)\$(MSBuildToolsVersion)\Microsoft.Common.props"" Condition=""Exists('$(<API key>)\$(MSBuildToolsVersion)\Microsoft.Common.props')"" /> <PropertyGroup> <<API key>>v4.7</<API key>> </PropertyGroup> <Import Project=""$(MSBuildToolsPath)\Microsoft.CSharp.targets"" /> </Project>"; private readonly string _testPackagesConfig = @"<packages><package id=""Microsoft.AspNet.WebApi.Client"" version=""{packageVersion}"" targetFramework=""net47"" /></packages>"; private readonly string _nugetConfig = @"<configuration><config><add key=""repositoryPath"" value="".\packages"" /></config></configuration>"; private IFolder <API key> = null; [SetUp] public void Setup() { <API key> = <API key>(); } [TearDown] public void TearDown() { <API key>.TryDelete(); } [Test] public async Task <API key>() { const string oldPackageVersion = "5.2.3"; const string newPackageVersion = "5.2.4"; const string <API key> = "<package id=\"Microsoft.AspNet.WebApi.Client\" version=\"{packageVersion}\" targetFramework=\"net47\" />"; const string testFolder = nameof(<API key>); var testProject = $"{testFolder}.csproj"; var workDirectory = Path.Combine(<API key>.FullPath, testFolder); Directory.CreateDirectory(workDirectory); var packagesFolder = Path.Combine(workDirectory, "packages"); Directory.CreateDirectory(packagesFolder); var projectContents = <API key>.Replace("{packageVersion}", oldPackageVersion, StringComparison.OrdinalIgnoreCase); var projectPath = Path.Combine(workDirectory, testProject); await File.WriteAllTextAsync(projectPath, projectContents); var <API key> = _testPackagesConfig.Replace("{packageVersion}", oldPackageVersion, StringComparison.OrdinalIgnoreCase); var packagesConfigPath = Path.Combine(workDirectory, "packages.config"); await File.WriteAllTextAsync(packagesConfigPath, <API key>); await File.WriteAllTextAsync(Path.Combine(workDirectory, "nuget.config"), _nugetConfig); var logger = NukeeperLogger; var externalProcess = new ExternalProcess(logger); var monoExecutor = new MonoExecutor(logger, externalProcess); var nuGetPath = new NuGetPath(logger); var nuGetVersion = new NuGetVersion(newPackageVersion); var packageSource = new PackageSource(NuGetConstants.V3FeedUrl); var restoreCommand = new <API key>(logger, nuGetPath, monoExecutor, externalProcess); var updateCommand = new <API key>(logger, nuGetPath, monoExecutor, externalProcess); var packageToUpdate = new PackageInProject("Microsoft.AspNet.WebApi.Client", oldPackageVersion, new PackagePath(workDirectory, testProject, <API key>.PackagesConfig)); await restoreCommand.Invoke(packageToUpdate, nuGetVersion, packageSource, NuGetSources.GlobalFeed); await updateCommand.Invoke(packageToUpdate, nuGetVersion, packageSource, NuGetSources.GlobalFeed); var contents = await File.ReadAllTextAsync(packagesConfigPath); Assert.That(contents, Does.Contain(<API key>.Replace("{packageVersion}", newPackageVersion, StringComparison.OrdinalIgnoreCase))); Assert.That(contents, Does.Not.Contain(<API key>.Replace("{packageVersion}", oldPackageVersion, StringComparison.OrdinalIgnoreCase))); } private IFolder <API key>() { var factory = new FolderFactory(NukeeperLogger); return factory.<API key>(); } } }
package com.jiazi.openthedoor.Util; import java.util.LinkedList; import java.util.List; public class CustomBuffer { private List<CustomBufferData> DataBuffer = new LinkedList<CustomBufferData>(); public boolean addData(CustomBufferData data){ synchronized (this) { DataBuffer.add(data); return true; } } public CustomBufferData RemoveData(){ synchronized (this) { if (DataBuffer.isEmpty()) { return null; } return DataBuffer.remove(0); } } public void ClearAll(){ synchronized (this) { DataBuffer.clear(); } } }
package com.jetbrains.env; import com.google.common.collect.Sets; import com.intellij.execution.testframework.sm.runner.SMTestProxy; import com.intellij.execution.testframework.sm.runner.ui.MockPrinter; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.util.Pair; import com.intellij.openapi.util.text.StringUtil; import com.jetbrains.python.testing.tox.PyToxConfiguration; import com.jetbrains.python.testing.tox.<API key>; import com.jetbrains.python.testing.tox.PyToxTestTools; import com.jetbrains.python.tools.sdkTools.SdkCreationType; import org.assertj.core.api.Condition; import org.hamcrest.Matchers; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.junit.Assert; import org.junit.Test; import java.io.File; import java.io.IOException; import java.util.*; import java.util.function.Supplier; import java.util.stream.Collectors; import static org.assertj.core.api.Assertions.assertThat; /** * Ensure tox runner works * * @author Ilya.Kazakevich */ public final class PyToxTest extends PyEnvTestCase { public PyToxTest() { super("tox"); } /** * Simply ensure tox runner works */ @Test public void testToxSimpleRun() { runPythonTest(new <API key>("/toxtest/toxSimpleRun/", 2, () -> new MyTestProcessRunner(), Collections.singletonList( Pair.create("py27", new <API key>("", true)) ), Integer.MAX_VALUE)); } /** * Check tox nose runner */ @Test public void testToxNose() { runPythonTest(new <API key>("/toxtest/toxNose/", 1, () -> new MyTestProcessRunner(), Arrays.asList( Pair.create("py27", new <API key>("", true)), // Does not support 3.4 Pair.create("py34", new <API key>("SyntaxError", false)) ), Integer.MAX_VALUE) ); } /** * Check tox pytest runner */ @Test public void testToxPyTest() { runPythonTest(new <API key>("/toxtest/toxPyTest/", 1, () -> new MyTestProcessRunner(), Arrays.asList( Pair.create("py27", new <API key>("", true)), // Does not support 3.4 Pair.create("py34", new <API key>("SyntaxError", false)) ), Integer.MAX_VALUE) ); } /** * Check tox unit runner */ @Test public void testToxUnitTest() { runPythonTest(new <API key>("/toxtest/toxUnitTest/", 1, () -> new MyTestProcessRunner(), Arrays.asList( Pair.create("py27", new <API key>("", true)), // Does not support 3.4 Pair.create("py34", new <API key>("SyntaxError", false)) ), Integer.MAX_VALUE) ); } /** * Checks empty envs for all but 2.7 */ @Test public void <API key>() { runPythonTest(new <API key>("/toxtest/toxOneInterpreter/", 0, () -> new MyTestProcessRunner(), Arrays.asList( Pair.create("py27", new <API key>("ython 2.7", true)), Pair.create("py34", new <API key>("", false)) ), Integer.MAX_VALUE) ); } /** * Ensures test is not launched 2 times because folder added 2 times */ @Test public void testDoubleRun() { runPythonTest(new <API key>("/toxtest/toxDoubleRun/", 1, () -> new MyTestProcessRunner(), Collections.singletonList( Pair.create("py27", new <API key>("", true)) ), 1) ); } /** * Big test which should run on any interpreter and check its output */ @Test public void testToxSuccessTest() { runPythonTest(new <API key>("/toxtest/toxSuccess/", 1, () -> new MyTestProcessRunner(), Arrays.asList( Pair.create("py27", new <API key>("I am 2.7", true)), // Should have output Pair.create("py34", new <API key>("I am 3.4", true)) ), Integer.MAX_VALUE) ); } /** * Ensures rerun works for tox */ @Test public void testEnvRerun() { runPythonTest(new <API key>("/toxtest/toxConcreteEnv/", 0, () -> new MyTestProcessRunner(1), Arrays.asList( //26 and 27 only used for first time, they aren't used after rerun Pair.create("py27", new <API key>("", true, 1)), Pair.create("py34", new <API key>("", false)) ), Integer.MAX_VALUE) ); } /** * Ensures {posargs} are passed correctly */ @Test public void testToxPosArgs() { runPythonTest( new <API key><<API key><PyToxConfiguration>>("/toxtest/toxPosArgs/", SdkCreationType.EMPTY_SDK) { @NotNull @Override protected <API key><PyToxConfiguration> createProcessRunner() { return new MyTestProcessRunner() { @Override protected void <API key>(@NotNull final PyToxConfiguration configuration) throws IOException { super.<API key>(configuration); PyToxTestTools.setArguments(configuration, "arg1"); } }; } @Override protected void checkTestResults(@NotNull final <API key><PyToxConfiguration> runner, @NotNull final String stdout, @NotNull final String stderr, @NotNull final String all, int exitCode) { Assert.assertThat("Wrong sys.argv", stdout, Matchers.containsString("['spam.py', 'arg1']")); } @NotNull @Override public Set<String> getTags() { return Sets.newHashSet("tox"); } }); } /** * Provide certain env and check it is launched */ @Test public void testConcreteEnv() { final String[] envsToRun = {"py27", "py34"}; runPythonTest( new <API key><<API key><PyToxConfiguration>>("/toxtest/toxSuccess/", SdkCreationType.EMPTY_SDK) { @NotNull @Override protected <API key><PyToxConfiguration> createProcessRunner() { return new <API key><PyToxConfiguration>(<API key>.INSTANCE, PyToxConfiguration.class, 0) { @Override protected void <API key>(@NotNull final PyToxConfiguration configuration) throws IOException { super.<API key>(configuration); PyToxTestTools.setArguments(configuration, "-v"); PyToxTestTools.setRunOnlyEnvs(configuration, envsToRun); } }; } @Override protected void checkTestResults(@NotNull final <API key><PyToxConfiguration> runner, @NotNull final String stdout, @NotNull final String stderr, @NotNull final String all, int exitCode) { final Set<String> environments = runner.getTestProxy().getChildren().stream().map(t -> t.getName()).collect(Collectors.toSet()); assertThat(environments) .describedAs("Wrong environments launched") .containsExactly(envsToRun); assertThat(all).contains("-v"); } @NotNull @Override public Set<String> getTags() { return Sets.newHashSet("tox"); } }); } private static final class <API key> extends <API key><MyTestProcessRunner> { private static final Logger LOGGER = Logger.getInstance(<API key>.class); @NotNull private final Map<String, <API key>> myInterpreters = new HashMap<>(); private final int <API key>; private final int <API key>; @NotNull private final Supplier<MyTestProcessRunner> myRunnerSupplier; /** * @param <API key> how many success tests should be * @param <API key> interpreter_name -] expected result * @param runnerSupplier Lambda to create runner (can't reuse one runner several times, * see {@link <API key>#createProcessRunner()} * @param maximumTestCount max number of success tests */ private <API key>(@Nullable final String <API key>, final int <API key>, @NotNull final Supplier<MyTestProcessRunner> runnerSupplier, @NotNull final Iterable<Pair<String, <API key>>> <API key>, final int maximumTestCount) { super(<API key>, SdkCreationType.EMPTY_SDK); <API key> = <API key>; <API key> = maximumTestCount; myRunnerSupplier = runnerSupplier; for (final Pair<String, <API key>> <API key> : <API key>) { myInterpreters.put(<API key>.first, <API key>.second); } } @Override protected void checkTestResults(@NotNull final MyTestProcessRunner runner, @NotNull final String stdout, @NotNull final String stderr, @NotNull final String all, int exitCode) { final Set<String> <API key> = myInterpreters.entrySet().stream() .filter(intAndExp -> intAndExp.getValue() != null) .filter(o -> o.getValue().myUntilStep > runner.getCurrentRerunStep()) // Remove interp. which shouldn't be launched on this step .map(intAndExp -> intAndExp.getKey()) .collect(Collectors.toSet()); // Interpreters are used in tox.ini, so there should be such text for (final String interpreterName : <API key>) { assertThat(all) .describedAs(String.format("No %s used from tox.ini", interpreterName)) .contains(interpreterName); } if (!stderr.isEmpty()) { Logger.getInstance(PyToxTest.class).warn(PyEnvTestCase.escapeTestMessage(stderr)); } final Set<String> checkedInterpreters = new HashSet<>(); final Collection<String> <API key> = new HashSet<>(); // Interpreter should either run tests or mentioned as NotFound for (final SMTestProxy interpreterSuite : runner.getTestProxy().getChildren()) { final String interpreterName = interpreterSuite.getName(); assert interpreterName.startsWith("py") : String .format("Bad interpreter name: %s. Tree is %s \n", interpreterName, getTestTree(interpreterSuite, 0)); checkedInterpreters.add(interpreterName); final <API key> expectations = myInterpreters.get(interpreterName); if (expectations == null) { LOGGER.warn(String.format("Launched %s, but no expectation provided, skipping", interpreterName)); continue; } if (interpreterSuite.getChildren().size() == 1 && interpreterSuite.getChildren().get(0).getName().endsWith("ERROR")) { // Interpreter failed to run final String testOutput = getTestOutput(interpreterSuite.getChildren().get(0)); if (testOutput.contains("InterpreterNotFound")) { // Skipped with out of "<API key> = True" Logger.getInstance(PyToxTest.class).warn(String.format("Interpreter %s does not exit", interpreterName)); <API key>.add(interpreterName); // Interpreter does not exit continue; } // Some other error? Assert .assertFalse(String.format("Interpreter %s should not fail, but failed: %s", interpreterName, getTestOutput(interpreterSuite)), expectations.myExpectedSuccess); continue; } if (interpreterSuite.getChildren().size() == 1 && interpreterSuite.getChildren().get(0).getName().endsWith("SKIP")) { // The only reason it may be skipped is it does not exist and <API key> = True final String output = getTestOutput(interpreterSuite); assertThat(output) .describedAs("Test marked skipped but not because interpreter not found") .contains("InterpreterNotFound"); } // Interpretr run success, //At least one interpreter tests should passed final int numberOfTests = new SMRootTestsCounter(interpreterSuite.getRoot()).getPassedTestsCount(); assertThat(numberOfTests) .describedAs(String.format("Not enough test passed, should %s at least", <API key>)) .<API key>(<API key>); assertThat(numberOfTests) .describedAs(String.format("Too many tests passed, should %s maximum", <API key>)) .isLessThanOrEqualTo(<API key>); // Check expected output final String message = String.format("Interpreter %s does not have expected string in output. \n ", interpreterName) + String.format("All: %s \n", all) + String.format("Test tree: %s \n", getTestTree(interpreterSuite, 0)) + String.format("Error: %s \n", stderr); assertThat(message) .describedAs(getTestOutput(interpreterSuite)) .contains(expectations.myExpectedOutput); } // Skipped interpreters should not be checked since we do not know which interpreters used on environemnt // But if all interpreters are skipped, we can't say we tested something. assert !<API key>.equals(checkedInterpreters) : "All interpreters skipped (they do not exist on platform), " + "we test nothing"; <API key>.removeAll(<API key>); checkedInterpreters.removeAll(<API key>); assertThat(checkedInterpreters) .describedAs(String.format("No all interpreters from tox.ini used (test tree \n%s\n )", getTestTree(runner.getTestProxy(), 0))) .are(new Condition<String>() { @Override public boolean matches(String value) { return <API key>.contains(value); } }); } @NotNull private static String getTestTree(@NotNull final SMTestProxy root, final int level) { final StringBuilder result = new StringBuilder(); result.append(StringUtil.repeat(".", level)).append(root.getPresentableName()).append('\n'); final Optional<String> children = root.getChildren().stream().map(o -> getTestTree(o, level + 1)).reduce((s, s2) -> s + s2); children.ifPresent(result::append); return result.toString(); } @NotNull private static String getTestOutput(@NotNull final SMTestProxy test) { final MockPrinter p = new MockPrinter(); test.printOn(p); return p.getAllOut(); } @NotNull @Override public Set<String> getTags() { return Sets.newHashSet("tox"); } @NotNull @Override protected MyTestProcessRunner createProcessRunner() { return myRunnerSupplier.get(); } } private static class MyTestProcessRunner extends <API key><PyToxConfiguration> { private MyTestProcessRunner() { this(0); } private MyTestProcessRunner(final int <API key>) { super(<API key>.INSTANCE, PyToxConfiguration.class, <API key>); } @Override protected void <API key>(@NotNull PyToxConfiguration configuration) throws IOException { super.<API key>(configuration); // To help tox with all interpreters, we add all our environments to path // Envs should have binaries like "python2.7" (with version included), // and tox will find em: see <API key> @ interpreters.py //On linux we also need shared libs from Anaconda, so we add it to LD_LIBRARY_PATH final List<String> roots = new ArrayList<>(); final List<String> libs = new ArrayList<>(); for (final String root : getPythonRoots()) { File bin = new File(root, "/bin/"); roots.add(bin.exists() ? bin.getAbsolutePath() : root); File lib = new File(root, "/lib/"); if (lib.exists()) { libs.add(lib.getAbsolutePath()); } } configuration.getEnvs().put("PATH", StringUtil.join(roots, File.pathSeparator)); configuration.getEnvs().put("LD_LIBRARY_PATH", StringUtil.join(libs, File.pathSeparator)); } } private static final class <API key> { @NotNull private final String myExpectedOutput; private final boolean myExpectedSuccess; private final int myUntilStep; /** * @param expectedOutput expected test output * @param expectedSuccess if test should be success * @param untilStep in case of rerun, expectation works only until this step and not checked after it */ private <API key>(@NotNull final String expectedOutput, final boolean expectedSuccess, final int untilStep) { myExpectedOutput = expectedOutput; myExpectedSuccess = expectedSuccess; myUntilStep = untilStep; } /** * @see #<API key>(String, boolean, int) */ private <API key>(@NotNull final String expectedOutput, final boolean expectedSuccess) { this(expectedOutput, expectedSuccess, Integer.MAX_VALUE); } } }
# WickedPDF Global Configuration # Use this to set up shared configuration options for your entire application. # Any of the configuration options shown here can also be applied to single # models by passing arguments to the `render :pdf` call. # To learn more, check out the README: # Need to merge for Heroku gem to work WickedPdf.config ||= {} WickedPdf.config.merge!( layout: "download", template: "shared/download", orientation: "Landscape", page_size: "Letter", margin: { top: 12.7, bottom: 12.7, left: 12.7, right: 12.7, } )
package top.phrack.ctf.controller; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import org.apache.shiro.SecurityUtils; import org.apache.shiro.subject.Subject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.servlet.ModelAndView; import top.phrack.ctf.models.services.BannedIpServices; import top.phrack.ctf.models.services.CategoryServices; import top.phrack.ctf.models.services.ChallengeServices; import top.phrack.ctf.models.services.CountryServices; import top.phrack.ctf.models.services.SubmissionServices; import top.phrack.ctf.models.services.UserServices; import top.phrack.ctf.pojo.CateProcess; import top.phrack.ctf.pojo.Categories; import top.phrack.ctf.pojo.Challenges; import top.phrack.ctf.pojo.Countries; import top.phrack.ctf.pojo.SolveTable; import top.phrack.ctf.pojo.Submissions; import top.phrack.ctf.pojo.Users; import top.phrack.ctf.utils.CommonUtils; /** * * * @author Jarvis * @date 2016414 */ @Controller public class ProfileController { private Logger log = LoggerFactory.getLogger(ProfileController.class); @Autowired private HttpServletRequest request; @Resource private UserServices userServices; @Resource private BannedIpServices bannedIpServices; @Resource private SubmissionServices submissionServices; @Resource private CountryServices countryServices; @Resource private ChallengeServices challengeServices; @Resource private CategoryServices categoryServices; @RequestMapping(value = "/profile/{id}",method = {RequestMethod.GET}) public ModelAndView Profile(@PathVariable long id) throws Exception { ModelAndView mv = new ModelAndView("profile"); Subject currentUser = SecurityUtils.getSubject(); CommonUtils.setControllerName(request, mv); CommonUtils.setUserInfo(currentUser, userServices, submissionServices,mv); if (CommonUtils.CheckIpBanned(request, bannedIpServices)) { currentUser.logout(); } Users userobj = userServices.getUserById(id); if (userobj==null || userobj.getRole().equals("admin")) { return new ModelAndView("redirect:/showinfo?err=404"); } Countries usercountry = countryServices.getCountryById(userobj.getCountryid()); mv.addObject("username",userobj.getUsername()); mv.addObject("countrycode",usercountry.getCountrycode()); mv.addObject("userdec",userobj.getDescription()); mv.addObject("country",usercountry.getCountryname()); mv.addObject("userscore",userobj.getScore()); mv.addObject("userrank",CommonUtils.getUserrank(userobj,userServices,submissionServices)); mv.addObject("organize",userobj.getOrganization()); List<Challenges> allchall = challengeServices.<API key>(); long sum = 0; for (Challenges ch:allchall) { sum += ch.getScore(); } mv.addObject("totalscore",sum); long allper = 0; if (sum!=0) { allper = Math.round(((double)userobj.getScore())/((double)sum)*100); } mv.addObject("totalpercent",allper); ArrayList<CateProcess> process = new ArrayList<CateProcess>(); List<Submissions> passedtasks = submissionServices.<API key>(userobj.getId()); Map<Categories,Long> statcate = new HashMap<Categories,Long>(); ArrayList<SolveTable> tab = new ArrayList<SolveTable>(); for (Submissions sub:passedtasks) { Challenges challobj = challengeServices.getChallengeById(sub.getChallengeId()); Categories subcate = categoryServices.selectById(challobj.getCategoryid()); SolveTable tabitem = new SolveTable(); tabitem.setid(challobj.getId()); tabitem.settitle(challobj.getTitle()); tabitem.setscore(challobj.getScore()); tabitem.setcatename(subcate.getName()); tabitem.setcatemark(subcate.getMark()); tabitem.setpasstime(submissionServices.<API key>(userobj.getId(), challobj.getId()).getSubmitTime()); if (statcate.containsKey(subcate)) { Long cs = statcate.get(subcate); cs += challobj.getScore(); statcate.put(subcate, cs); } else { statcate.put(subcate, challobj.getScore()); } tab.add(tabitem); } mv.addObject("passtask",tab); for (Challenges ch:allchall) { Categories challcate = categoryServices.selectById(ch.getCategoryid()); if (statcate.containsKey(challcate)) { continue; } else { statcate.put(challcate, Long.valueOf(0)); } } for (Map.Entry<Categories,Long> stc:statcate.entrySet()) { CateProcess cp = new CateProcess(); Categories cate = stc.getKey(); long catescore = stc.getValue(); long catetotal = challengeServices.<API key>(cate.getId()); cp.setname(cate.getName()); cp.setproc(catescore); cp.settotal(catetotal); cp.setstyle(cate.getMark()); if (catetotal!=0) { cp.setpercent(((double)catescore)/((double)catetotal)*100); } else { cp.setpercent(0); } if (sum!=0) { cp.setpercentall(((double)catescore)/((double)sum)*100); } else { cp.setpercentall(0); } process.add(cp); } mv.addObject("userstat",process); mv.setViewName("profile"); return mv; } }
package org.enemies; import static java.lang.Math.abs; import static java.lang.Math.random; import java.awt.image.BufferedImage; import org.items.Health; import org.players.Player; import org.resources.Collisions; import org.resources.Element; import org.resources.ImagePack; import org.rooms.Room; import org.walls.Wall; public class Lavaspot extends Enemy { private static final BufferedImage[][] ani = new BufferedImage[][]{ {ImagePack.getImage("Lavaspot.png"), ImagePack.getImage("Lavaspot2.png"), ImagePack.getImage("Lavaspot4.png"), ImagePack.getImage("Lavaspot3.png")}, {ImagePack.getImage("LavaspotRight.png"), ImagePack.getImage("Lavaspot2right.png"), ImagePack.getImage("Lavaspot4Right.png"), ImagePack.getImage("Lavaspot3Right.png")}}; // private double vx=0,vy=2; // private boolean left=true; private int counter = (int) (300 * Math.random()); private int jumpd = 0; private boolean left = true; public Lavaspot(int X, int Y) { element = Element.FIRE; w = 33; h = 17; x = X; y = Y; image = ani[0][0]; life = lifeCapacity = 10; vx = (random() < .5 ? -1 : 1) * (float) random() * 5 + 5; vy = (float) random() * 10 - 5; } public void run() { boolean onSurface = (y == Room.HEIGHT - h); boolean onWall = (x == Room.WIDTH - w || x == 0); left = vx > 0 ? false : true; for (Wall wal : Room.walls) { onSurface = onSurface || Collisions.onTop(this, wal); onWall = onWall || Collisions.touchingSides(this, wal); } // if(onSurface&&counter%20<9){ // image=ani[left?0:1][0]; // else if(onSurface&&counter%20>9){ // mage=ani[left?0:1][1]; if (onSurface && jumpd <= 0) { jumpd = 30; vy = -5.5f; } else if (onSurface) { jumpd } // image=ani[left?0:1][0]; counter++; // image=ani[counter%30<15?0:1][0]; if (life <= 0) { Health.add(this, 6); dead = true; return; } Player p = Player.player; if (Collisions.collides(p, this)) { Player.damage(1); } // if (false) vy += .1; if (vMultiplier == 0) vMultiplier = 10 * Float.MIN_VALUE; vx *= vMultiplier; vy *= vMultiplier; for (Wall wal : Room.walls) { if (Collisions.willCollide(this, wal, vx, 0)) { if (vx > 0) { x = wal.x - w; } else { x = wal.x + wal.w; } vx = 0 - (vx + .2f); } if (Collisions.willCollide(this, wal, vx, vy)) { if (vy > 0) { y = wal.y - h; } else { y = wal.y + wal.h; } vy = 0; } } if (!onSurface) { x += vx; } y += vy; image = ani[left ? 0 : 1][(counter / 20) % 4]; vx /= vMultiplier; vy /= vMultiplier; vMultiplier += .03 * (1 - vMultiplier > 0 ? 1 : (abs(vMultiplier) <= .03 ? 0 : -1)); // if(dx<0)curFrame=1; // else if(dx>0) curFrame=0; // image=ani[0][counter%30<15?0:1]; } public boolean preventsNextRoom() { return false; } }
# Using named cluster configurations Oshinko uses a ConfigMap to store named cluster configurations. This document describes how to add or edit named configurations and how to use them with oshinko-rest. ## The <API key> ConfigMap The `tools/server-ui-template.yaml` creates a ConfigMap named `<API key>` which is read by oshinko-rest. Any named cluster configuration defined in the ConfigMap can be used to create or scale a cluster. The default ConfigMap contains a single configuration named `small`. The `small` configuration specifies a cluster that has three worker nodes. To see what configurations are defined, use `oc export` in your project after launching oshinko: $ oc export configmap <API key> apiVersion: v1 data: small.workercount: "3" kind: ConfigMap metadata: creationTimestamp: null labels: app: oshinko name: <API key> Named configurations are defined in the data section of the ConfigMap. Currently `workercount` is the only parameter which may be set for a configuration (`mastercount` may actually be set but is constrained to a value of "1"). A parameter is set using the name of the configuration followed by a dot and the name of the parameter. To add a configuration called `large` with a `workercount` of ten, the ConfigMap would be modified to look like this: apiVersion: v1 data: small.workercount: "3" large.workercount: "10" kind: ConfigMap metadata: creationTimestamp: null labels: app: oshinko name: <API key> ## Editing <API key> The simplest way to edit <API key> for a particular project is to use the CLI: $ oc edit configmap <API key> From the OpenShift console <API key> may be edited by going to "Resources -> other resources" and selecting ConfigMap as the resource type. There may be a short delay before configuration changes are visible to the oshinko-rest pod. ## The default configuration There is a default configuration named `default` which specifies a cluster with one spark master and one spark worker. All cluster configurations start with the values from `default` and then optionally update values. So the `small` configuration shown above inherits values from `default` and then modifies its own `workercount` to be three. Note, the `default` configuration itself can be modified in a project by editing `<API key>` and adding a definition for `default`. ## Where configuration names may be used The name of a configuration may be passed as the <API key> environment variable when a spark application is launched from the oshinko templates. If no name is given, the `default` configuration will be used. The name of a configuration may also be passed in the json object used to create or update a cluster through the oshinko-rest endpoint, for example: $ curl -H "Content-Type: application/json" -X POST -d '{"name": "sam", "config": {"name": "small"}}' http://oshinko-rest-host:8081/clusters
package main import ( "errors" "log" "strconv" "strings" "time" "github.com/hortonworks/gohadoop/hadoop_yarn" "github.com/hortonworks/gohadoop/hadoop_yarn/conf" "github.com/hortonworks/gohadoop/hadoop_yarn/yarn_client" ) func parseAppAttemptId(appAttemptIdString string) (*hadoop_yarn.<API key>, error) { log.Println("<API key>: ", appAttemptIdString) <API key> := strings.Split(appAttemptIdString, "_") if len(<API key>) < 4 { return nil, errors.New("Invalid application attempt id: " + appAttemptIdString) } clusterTimeStamp, err := strconv.ParseInt(<API key>[1], 10, 64) if err != nil { return nil, err } i, err := strconv.Atoi(<API key>[2]) if err != nil { return nil, err } var applicationId int32 = int32(i) i, err = strconv.Atoi(<API key>[3]) if err != nil { return nil, err } var attemptId int32 = int32(i) return &hadoop_yarn.<API key>{ApplicationId: &hadoop_yarn.ApplicationIdProto{ClusterTimestamp: &clusterTimeStamp, Id: &applicationId}, AttemptId: &attemptId}, nil } func main() { var err error // Create YarnConfiguration conf, _ := conf.<API key>() // Create AMRMClient rmClient, _ := yarn_client.CreateAMRMClient(conf) log.Println("Created RM client: ", rmClient) // Register with ResourceManager log.Println("About to register application master.") err = rmClient.<API key>("", -1, "") if err != nil { log.Fatal("rmClient.<API key> ", err) } log.Println("Successfully registered application master.") // Add resource requests const numContainers = int32(1) memory := int32(128) resource := hadoop_yarn.ResourceProto{Memory: &memory} rmClient.AddRequest(1, "*", &resource, numContainers) // Now call ResourceManager.allocate allocateResponse, err := rmClient.Allocate() if err == nil { log.Println("allocateResponse: ", *allocateResponse) } log.Println("#containers allocated: ", len(allocateResponse.AllocatedContainers)) <API key> := int32(0) allocatedContainers := make([]*hadoop_yarn.ContainerProto, numContainers, numContainers) for <API key> < numContainers { // Sleep for a while log.Println("Sleeping...") time.Sleep(3 * time.Second) log.Println("Sleeping... done!") // Try to get containers now... allocateResponse, err = rmClient.Allocate() if err == nil { log.Println("allocateResponse: ", *allocateResponse) } for _, container := range allocateResponse.AllocatedContainers { allocatedContainers[<API key>] = container <API key>++ } log.Println("#containers allocated: ", len(allocateResponse.AllocatedContainers)) log.Println("Total #containers allocated so far: ", <API key>) } log.Println("Final #containers allocated: ", <API key>) // Now launch containers <API key> := hadoop_yarn.<API key>{Command: []string{"/bin/date"}} log.Println("<API key>: ", <API key>) for _, container := range allocatedContainers { log.Println("Launching container: ", *container, " ", container.NodeId.Host, ":", container.NodeId.Port) nmClient, err := yarn_client.CreateAMNMClient(*container.NodeId.Host, int(*container.NodeId.Port)) if err != nil { log.Fatal("hadoop_yarn.<API key>: ", err) } log.Println("Successfully created nmClient: ", nmClient) err = nmClient.StartContainer(container, &<API key>) if err != nil { log.Fatal("nmClient.StartContainer: ", err) } } // Wait for Containers to complete <API key> := int32(0) for <API key> < numContainers { // Sleep for a while log.Println("Sleeping...") time.Sleep(3 * time.Second) log.Println("Sleeping... done!") allocateResponse, err = rmClient.Allocate() if err == nil { log.Println("allocateResponse: ", *allocateResponse) } for _, containerStatus := range allocateResponse.<API key> { log.Println("Completed container: ", *containerStatus, " exit-code: ", *containerStatus.ExitStatus) <API key>++ } } log.Println("Containers complete: ", <API key>) // Unregister with ResourceManager log.Println("About to unregister application master.") finalStatus := hadoop_yarn.<API key> err = rmClient.<API key>(&finalStatus, "done", "") if err != nil { log.Fatal("rmClient.<API key> ", err) } log.Println("Successfully unregistered application master.") }
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>FST - Lani Moorhouse</title> <meta name="description" content="Keep track of the statistics from Lani Moorhouse. Average heat score, heat wins, heat wins percentage, epic heats road to the final"> <meta name="author" content=""> <link rel="apple-touch-icon" sizes="57x57" href="/favicon/apple-icon-57x57.png"> <link rel="apple-touch-icon" sizes="60x60" href="/favicon/apple-icon-60x60.png"> <link rel="apple-touch-icon" sizes="72x72" href="/favicon/apple-icon-72x72.png"> <link rel="apple-touch-icon" sizes="76x76" href="/favicon/apple-icon-76x76.png"> <link rel="apple-touch-icon" sizes="114x114" href="/favicon/apple-icon-114x114.png"> <link rel="apple-touch-icon" sizes="120x120" href="/favicon/apple-icon-120x120.png"> <link rel="apple-touch-icon" sizes="144x144" href="/favicon/apple-icon-144x144.png"> <link rel="apple-touch-icon" sizes="152x152" href="/favicon/apple-icon-152x152.png"> <link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-icon-180x180.png"> <link rel="icon" type="image/png" sizes="192x192" href="/favicon/<API key>.png"> <link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="96x96" href="/favicon/favicon-96x96.png"> <link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png"> <link rel="manifest" href="/manifest.json"> <meta name="<API key>" content="#ffffff"> <meta name="<API key>" content="/ms-icon-144x144.png"> <meta name="theme-color" content="#ffffff"> <meta property="og:title" content="Fantasy Surfing tips"/> <meta property="og:image" content="https://fantasysurfingtips.com/img/just_waves.png"/> <meta property="og:description" content="See how great Lani Moorhouse is surfing this year"/> <link href="https://fantasysurfingtips.com/css/bootstrap.css" rel="stylesheet"> <!-- Custom CSS --> <link href="https://fantasysurfingtips.com/css/freelancer.css" rel="stylesheet"> <link href="https://cdn.datatables.net/plug-ins/1.10.7/integration/bootstrap/3/dataTables.bootstrap.css" rel="stylesheet" /> <!-- Custom Fonts --> <link href="https://fantasysurfingtips.com/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"> <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css"> <link href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" rel="stylesheet" type="text/css"> <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.css"> <script src="https://code.jquery.com/jquery-2.x-git.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-ujs/1.2.1/rails.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.min.js"></script> <script src="https: <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <script> (adsbygoogle = window.adsbygoogle || []).push({ google_ad_client: "<API key>", <API key>: true }); </script> </head> <body> <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.<API key>(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.6"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <!-- Navigation --> <div w3-include-html="https://fantasysurfingtips.com/layout/header.html"></div> <!-- Header --> <div w3-include-html="https://fantasysurfingtips.com/layout/sponsor.html"></div> <section > <div class="container"> <div class="row"> <div class="col-sm-3 "> <div class="col-sm-2 "> </div> <div class="col-sm-8 "> <h3 style="text-align:center;">Lani Moorhouse</h3> <a href="https://twitter.com/share" class="" data-via="fansurfingtips"><i class="fa fa-twitter"></i> Share on Twitter</i></a> <br/> <a class="<API key>" target="_blank" href="https: </div> <div class="col-sm-2 "> </div> </div> <div class="col-sm-3 portfolio-item"> </div> <div class="col-sm-3 portfolio-item"> <h6 style="text-align:center;">Avg Heat Score (FST DATA)</h6> <h1 style="text-align:center;">0.0</h1> </div> </div> <hr/> <h4 style="text-align:center;" >Competitions</h4> <hr/> <h4 style="text-align:center;" >Heat Stats (FST data)</h4> <div class="row"> <div class="col-sm-4 portfolio-item"> <h6 style="text-align:center;">Heats</h6> <h2 style="text-align:center;">1</h2> </div> <div class="col-sm-4 portfolio-item"> <h6 style="text-align:center;">Heat wins</h6> <h2 style="text-align:center;">0</h2> </div> <div class="col-sm-4 portfolio-item"> <h6 style="text-align:center;">HEAT WINS PERCENTAGE</h6> <h2 style="text-align:center;">0.0%</h2> </div> </div> <hr/> <h4 style="text-align:center;">Avg Heat Score progression</h4> <div id="avg_chart" style="height: 250px;"></div> <hr/> <h4 style="text-align:center;">Heat stats progression</h4> <div id="heat_chart" style="height: 250px;"></div> <hr/> <style type="text/css"> .heats-all{ z-index: 3; margin-left: 5px; cursor: pointer; } </style> <div class="container"> <div id="disqus_thread"></div> <script> var disqus_config = function () { this.page.url = "http://fantasysurfingtips.com/surfers/lmoo"; // Replace PAGE_URL with your page's canonical URL variable this.page.identifier = '4875'; // Replace PAGE_IDENTIFIER with your page's unique identifier variable }; (function() { // DON'T EDIT BELOW THIS LINE var d = document, s = d.createElement('script'); s.src = '//fantasysurfingtips.disqus.com/embed.js'; s.setAttribute('data-timestamp', +new Date()); (d.head || d.body).appendChild(s); })(); </script> <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> </div> </section> <script type="text/javascript"> $('.heats-all').click(function(){ $('.heats-all-stat').css('display', 'none') $('#'+$(this).attr('id')+'-stat').css('display', 'block') }); $('.heats-2016').click(function(){ $('.heats-2016-stat').css('display', 'none') $('#'+$(this).attr('id')+'-stat').css('display', 'block') }); $('document').ready(function(){ new Morris.Line({ // ID of the element in which to draw the chart. element: 'avg_chart', // Chart data records -- each entry in this array corresponds to a point on // the chart. data: [{"year":"2017","avg":0.0,"avg_all":0.0}], // The name of the data record attribute that contains x-values. xkey: 'year', // A list of names of data record attributes that contain y-values. ykeys: ['avg', 'avg_all'], // Labels for the ykeys -- will be displayed when you hover over the // chart. labels: ['Avg score in year', 'Avg score FST DATA'] }); new Morris.Bar({ // ID of the element in which to draw the chart. element: 'heat_chart', // Chart data records -- each entry in this array corresponds to a point on // the chart. data: [{"year":"2017","heats":1,"wins":0,"percs":"0.0%"}], // The name of the data record attribute that contains x-values. xkey: 'year', // A list of names of data record attributes that contain y-values. ykeys: ['heats', 'wins', 'percs'], // Labels for the ykeys -- will be displayed when you hover over the // chart. labels: ['Heats surfed', 'Heats won', 'Winning percentage'] }); }); </script> <script>!function(d,s,id){var js,fjs=d.<API key>(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script> <!-- Footer --> <div w3-include-html="https://fantasysurfingtips.com/layout/footer.html"></div> <script type="text/javascript"> (function(i,s,o,g,r,a,m){i['<API key>']=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.<API key>(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script',' ga('create', 'UA-74337819-1', 'auto'); // Replace with your property ID. ga('send', 'pageview'); </script> <script> w3IncludeHTML(); </script> <!-- jQuery --> <script src="https://fantasysurfingtips.com/js/jquery.js"></script> <script src="https://cdn.datatables.net/1.10.7/js/jquery.dataTables.min.js"></script> <!-- Bootstrap Core JavaScript --> <script src="https://fantasysurfingtips.com/js/bootstrap.min.js"></script> <!-- Plugin JavaScript --> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script> <script src="https://fantasysurfingtips.com/js/classie.js"></script> <script src="https://fantasysurfingtips.com/js/cbpAnimatedHeader.js"></script> <!-- Contact Form JavaScript --> <script src="https://fantasysurfingtips.com/js/<API key>.js"></script> <script src="https://fantasysurfingtips.com/js/contact_me.js"></script> <!-- Custom Theme JavaScript --> <script src="https://fantasysurfingtips.com/js/freelancer.js"></script> <script type="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script> <script type="https://cdn.datatables.net/1.10.12/js/dataTables.bootstrap.min.js"></script> </body> </html>
// Handles logging to a file in the Crate data directory // Log line format is as follows (for regular expression parsing) // %(level)s [%(jsontime)s]: %(message)s package crate import ( "fmt" "log" "os" "strings" "time" "github.com/bbengfort/crate/crate/config" ) var eventLogger *Logger // global var for the logger object // LogLevel types type LogLevel int const ( LevelDebug LogLevel = 1 + iota LevelInfo LevelWarn LevelError LevelFatal ) var levels = [...]string{ "DEBUG", "INFO", "WARNING", "ERROR", "FATAL", } func (level LogLevel) String() string { return levels[level-1] } func LevelFromString(level string) LogLevel { level = strings.ToUpper(level) level = strings.Trim(level, " ") switch level { case "DEBUG": return LevelDebug case "INFO": return LevelInfo case "WARNING": return LevelWarn case "ERROR": return LevelError case "FATAL": return LevelFatal default: return LevelInfo } } // Wraps the log.Logger to provide custom log handling type Logger struct { Level LogLevel // The minimum log level to log at writer *log.Logger // The logger object that handles logging logfile *os.File // Handle to the open log file } // Initialize the Logger objects for logging to config location func InitializeLoggers(level LogLevel) error { // Create a new logger eventLogger = new(Logger) eventLogger.Level = level // Open a handle to the log file path, err := config.CrateLoggingPath() if err != nil { return err } // Set the output path (opening the file and configuring the writer) return eventLogger.SetOutputPath(path) } // Close the loggers (and the open file handle) useful for defering close func CloseLoggers() error { err := eventLogger.Close() eventLogger = nil return err } // Write a log message to the eventLogger at a certain log level func Log(msg string, level LogLevel, args ...interface{}) { eventLogger.Log(msg, level, args...) } // Close the open handle to the log file and stop logging func (logger *Logger) Close() error { return logger.logfile.Close() } // Set a new log output location on the Logger func (logger *Logger) SetOutputPath(path string) error { file, err := os.OpenFile(path, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0644) if err != nil { return err } eventLogger.logfile = file eventLogger.writer = log.New(eventLogger.logfile, "", 0) return nil } // Write a log message to the logger with a certain log level func (logger *Logger) Log(layout string, level LogLevel, args ...interface{}) { // Log line format is "%(level)s [%(jsontime)s]: %(message)s" if level >= logger.Level { msg := fmt.Sprintf(layout, args...) logger.writer.Printf("%-7s [%s]: %s\n", level, time.Now().Format(JSONLayout), msg) } } // Helper function to log at debug level func (logger *Logger) Debug(msg string, args ...interface{}) { logger.Log(msg, LevelDebug, args...) } // Helper function to log at info level func (logger *Logger) Info(msg string, args ...interface{}) { logger.Log(msg, LevelInfo, args...) } // Helper function to log at debug level func (logger *Logger) Warn(msg string, args ...interface{}) { logger.Log(msg, LevelWarn, args...) } // Helper function to log at debug level func (logger *Logger) Error(msg string, args ...interface{}) { logger.Log(msg, LevelError, args...) } // Helper function to log at debug level func (logger *Logger) Fatal(msg string, args ...interface{}) { logger.Log(msg, LevelFatal, args...) }
import sys import time import uuid import pandaserver.userinterface.Client as Client from pandaserver.taskbuffer.JobSpec import JobSpec from pandaserver.taskbuffer.FileSpec import FileSpec aSrvID = None prodUserNameDefault = 'unknown-user' prodUserName = None prodUserNameDP = None <API key> = None site = 'ANALY_BNL-LSST' PIPELINE_TASK = None <API key> = None <API key> = None PIPELINE_STREAM = None lsstJobParams = "" for idx,argv in enumerate(sys.argv): if argv == '--site': try: site = sys.argv[idx + 1] except Exception: site = 'ANALY_BNL-LSST' if argv == '-DP_USER': try: prodUserNameDP = sys.argv[idx + 1] if len(lsstJobParams): lsstJobParams += "|" lsstJobParams += "%(key)s=%(value)s" % \ {'key': 'DP_USER', \ 'value': str(prodUserNameDP)} except Exception: prodUserNameDP = None if argv == '-PIPELINE_USER': try: <API key> = sys.argv[idx + 1] if len(lsstJobParams): lsstJobParams += "|" lsstJobParams += "%(key)s=%(value)s" % \ {'key': 'PIPELINE_USER', \ 'value': str(<API key>)} except Exception: <API key> = None if argv == '-PIPELINE_TASK': try: PIPELINE_TASK = sys.argv[idx + 1] if len(lsstJobParams): lsstJobParams += "|" lsstJobParams += "%(key)s=%(value)s" % \ {'key': 'PIPELINE_TASK', \ 'value': str(PIPELINE_TASK)} except Exception: PIPELINE_TASK = None if argv == '-<API key>': try: <API key> = int(sys.argv[idx + 1]) if len(lsstJobParams): lsstJobParams += "|" lsstJobParams += "%(key)s=%(value)s" % \ {'key': '<API key>', \ 'value': str(<API key>)} except Exception: <API key> = None if argv == '-<API key>': try: <API key> = int(sys.argv[idx + 1]) if len(lsstJobParams): lsstJobParams += "|" lsstJobParams += "%(key)s=%(value)s" % \ {'key': '<API key>', \ 'value': str(<API key>)} except Exception: <API key> = None if argv == '-PIPELINE_STREAM': try: PIPELINE_STREAM = int(sys.argv[idx + 1]) if len(lsstJobParams): lsstJobParams += "|" lsstJobParams += "%(key)s=%(value)s" % \ {'key': 'PIPELINE_STREAM', \ 'value': str(PIPELINE_STREAM)} except Exception: PIPELINE_STREAM = None if argv == '-s': aSrvID = sys.argv[idx+1] sys.argv = sys.argv[:idx] break DP_USER and PIPELINE_USER preference if prodUserNameDP is not None: prodUserName = prodUserNameDP elif <API key> is not None: prodUserName = <API key> #site = sys.argv[1] #site = 'ANALY_BNL-LSST' #orig #site = 'BNL-LSST' #site = 'SWT2_CPB-LSST' #site = 'UTA_SWT2-LSST' #site = 'ANALY_SWT2_CPB-LSST' destName = None if prodUserName is not None \ and PIPELINE_TASK is not None \ and <API key> is not None: datasetName = 'panda.lsst.user.%(<API key>)s.%(PIPELINE_TASK)s.%(prodUserName)s' % \ {'prodUserName': str(prodUserName), \ 'PIPELINE_TASK': str(PIPELINE_TASK), \ '<API key>': str(<API key>) \ } else: datasetName = 'panda.lsst.user.jschovan.%s' % str(uuid.uuid4()) if prodUserName is not None \ and PIPELINE_TASK is not None \ and <API key> is not None \ and PIPELINE_STREAM is not None: jobName = 'job.%(<API key>)s.%(PIPELINE_TASK)s.%(<API key>)s.%(prodUserName)s.%(PIPELINE_STREAM)s' % \ {'prodUserName': str(prodUserName), \ 'PIPELINE_TASK': str(PIPELINE_TASK), \ '<API key>': str(<API key>), \ 'PIPELINE_STREAM': str(PIPELINE_STREAM), \ '<API key>': str(<API key>) \ } else: jobName = "%s" % str(uuid.uuid4()) if PIPELINE_STREAM is not None: jobDefinitionID = PIPELINE_STREAM else: jobDefinitionID = int(time.time()) % 10000 job = JobSpec() job.jobDefinitionID = jobDefinitionID job.jobName = jobName job.transformation = 'http://pandawms.org/pandawms-jobcache/lsst-trf.sh' job.destinationDBlock = datasetName job.destinationSE = 'local' job.currentPriority = 1000 job.prodSourceLabel = 'panda' job.jobParameters = ' --lsstJobParams="%s" ' % lsstJobParams if prodUserName is not None: job.prodUserName = prodUserName else: job.prodUserName = prodUserNameDefault if <API key> is not None: job.taskID = <API key> if <API key> is not None: job.attemptNr = <API key> if PIPELINE_TASK is not None: job.processingType = PIPELINE_TASK job.computingSite = site job.VO = "lsst" fileOL = FileSpec() fileOL.lfn = "%s.job.log.tgz" % job.jobName fileOL.destinationDBlock = job.destinationDBlock fileOL.destinationSE = job.destinationSE fileOL.dataset = job.destinationDBlock fileOL.type = 'log' job.addFile(fileOL) s,o = Client.submitJobs([job],srvID=aSrvID) print(s) for x in o: print("PandaID=%s" % x[0])
<?php $lang['<API key>'] = 'No se encontraron migraciones.'; $lang['migration_not_found'] = 'Esta migración no pudo ser encontrada.'; $lang['<API key>'] = 'Hay varias migraciones con el mismo número de versión: %d.'; $lang['<API key>'] = 'La clase de migración "%s" no se pudo encontrar.'; $lang['<API key>'] = 'La clase de migración "%s" no tiene el método "up".'; $lang['<API key>'] = 'La clase de migración "%s" no tiene el método "down".'; $lang['<API key>'] = 'La migración "%s" tiene un nombre de archivo inválido.'; /* End of file migration_lang.php */ /* Location: ./system/language/spanish/migration_lang.php */
#include <logd/exceptions.h> #include <logd/metrics.h> #include <logd/rpc_forwarder.h> #include <vespa/vespalib/gtest/gtest.h> #include <vespa/vespalib/metrics/<API key>.h> #include <vespa/fnet/frt/supervisor.h> #include <vespa/fnet/frt/rpcrequest.h> using namespace logdemon; using vespalib::metrics::DummyMetricsManager; void encode_log_response(const ProtoConverter::ProtoLogResponse& src, FRT_Values& dst) { auto buf = src.SerializeAsString(); dst.AddInt8(0); dst.AddInt32(buf.size()); dst.AddData(buf.data(), buf.size()); } bool decode_log_request(FRT_Values& src, ProtoConverter::ProtoLogRequest& dst) { uint8_t encoding = src[0]._intval8; assert(encoding == 0); uint32_t uncompressed_size = src[1]._intval32; assert(uncompressed_size == src[2]._data._len); return dst.ParseFromArray(src[2]._data._buf, src[2]._data._len); } std::string garbage("garbage"); struct RpcServer : public FRT_Invokable { fnet::frt::StandaloneFRT server; int request_count; std::vector<std::string> messages; bool reply_with_error; bool <API key>; public: RpcServer() : server(), request_count(0), messages(), reply_with_error(false), <API key>(true) { <API key> builder(&server.supervisor()); builder.DefineMethod("vespa.logserver.archiveLogMessages", "bix", "bix", FRT_METHOD(RpcServer::<API key>), this); server.supervisor().Listen(0); } ~RpcServer() = default; int get_listen_port() { return server.supervisor().GetListenPort(); } void <API key>(FRT_RPCRequest* request) { ProtoConverter::ProtoLogRequest proto_request; ASSERT_TRUE(decode_log_request(*request->GetParams(), proto_request)); ++request_count; for (const auto& message : proto_request.log_messages()) { messages.push_back(message.payload()); } if (reply_with_error) { request->SetError(123, "This is a server error"); return; } if (<API key>) { ProtoConverter::ProtoLogResponse proto_response; encode_log_response(proto_response, *request->GetReturn()); } else { auto& dst = *request->GetReturn(); dst.AddInt8(0); dst.AddInt32(garbage.size()); dst.AddData(garbage.data(), garbage.size()); } } }; std::string make_log_line(const std::string& level, const std::string& payload) { return "1234.5678\tmy_host\t10/20\tmy_service\tmy_component\t" + level + "\t" + payload; } struct MockMetricsManager : public DummyMetricsManager { int add_count; MockMetricsManager() noexcept : DummyMetricsManager(), add_count(0) {} void add(Counter::Increment) override { ++add_count; } }; class ClientSupervisor { private: fnet::frt::StandaloneFRT _client; public: ClientSupervisor() : _client() { } ~ClientSupervisor() = default; FRT_Supervisor& get() { return _client.supervisor(); } }; ForwardMap make_forward_filter() { ForwardMap result; result[ns_log::Logger::error] = true; result[ns_log::Logger::warning] = false; result[ns_log::Logger::info] = true; // all other log levels are implicit false return result; } struct RpcForwarderTest : public ::testing::Test { RpcServer server; std::shared_ptr<MockMetricsManager> metrics_mgr; Metrics metrics; ClientSupervisor supervisor; RpcForwarder forwarder; RpcForwarderTest() : server(), metrics_mgr(std::make_shared<MockMetricsManager>()), metrics(metrics_mgr), forwarder(metrics, make_forward_filter(), supervisor.get(), "localhost", server.get_listen_port(), 60.0, 3) { } void forward_line(const std::string& payload) { forwarder.forwardLine(make_log_line("info", payload)); } void forward_line(const std::string& level, const std::string& payload) { forwarder.forwardLine(make_log_line(level, payload)); } void forward_bad_line() { forwarder.forwardLine("badline"); } void flush() { forwarder.flush(); } void expect_messages() { expect_messages(0, {}); } void expect_messages(int exp_request_count, const std::vector<std::string>& exp_messages) { EXPECT_EQ(exp_request_count, server.request_count); EXPECT_EQ(exp_messages, server.messages); } }; TEST_F(RpcForwarderTest, <API key>) { expect_messages(); flush(); expect_messages(); } TEST_F(RpcForwarderTest, <API key>) { forward_line("a"); expect_messages(); flush(); expect_messages(1, {"a"}); } TEST_F(RpcForwarderTest, <API key>) { forward_line("a"); forward_line("b"); expect_messages(); flush(); expect_messages(1, {"a", "b"}); } TEST_F(RpcForwarderTest, <API key>) { forward_line("a"); forward_line("b"); expect_messages(); forward_line("c"); expect_messages(1, {"a", "b", "c"}); forward_line("d"); expect_messages(1, {"a", "b", "c"}); forward_line("e"); expect_messages(1, {"a", "b", "c"}); forward_line("f"); expect_messages(2, {"a", "b", "c", "d", "e", "f"}); } TEST_F(RpcForwarderTest, <API key>) { forward_line("a"); forward_bad_line(); EXPECT_EQ(1, forwarder.badLines()); flush(); expect_messages(1, {"a"}); } TEST_F(RpcForwarderTest, <API key>) { forward_bad_line(); EXPECT_EQ(1, forwarder.badLines()); forwarder.resetBadLines(); EXPECT_EQ(0, forwarder.badLines()); } TEST_F(RpcForwarderTest, <API key>) { forward_line("a"); EXPECT_EQ(1, metrics_mgr->add_count); forward_line("b"); EXPECT_EQ(2, metrics_mgr->add_count); } TEST_F(RpcForwarderTest, <API key>) { forward_line("fatal", "a"); forward_line("error", "b"); forward_line("warning", "c"); forward_line("config", "d"); forward_line("info", "e"); forward_line("event", "f"); forward_line("debug", "g"); forward_line("spam", "h"); forward_line("null", "i"); flush(); expect_messages(1, {"b", "e"}); EXPECT_EQ(9, metrics_mgr->add_count); } TEST_F(RpcForwarderTest, <API key>) { server.reply_with_error = true; forward_line("a"); EXPECT_THROW(flush(), logdemon::ConnectionException); } TEST_F(RpcForwarderTest, <API key>) { server.<API key> = false; forward_line("a"); EXPECT_THROW(flush(), logdemon::DecodeException); } <API key>()
title: Voyager Init menu: docs_{{ .version }}: identifier: voyager-init name: Voyager Init parent: reference-operator product_name: voyager menu_name: docs_{{ .version }} section_menu_id: reference ## voyager init Initialize HAProxy config voyager init [command] [flags] Options --burst int The maximum burst for throttle (default 1000000) --cert-dir string Path where tls certificates are stored for HAProxy (default "/etc/ssl/private/haproxy") -c, --cloud-provider string Name of cloud provider --config-dir string Path where HAProxy config is stored (default "/shared/etc/haproxy") -h, --help help for init --ingress-api-version string API version of ingress resource --ingress-name string Name of ingress resource --kubeconfig string Path to kubeconfig file with authorization information (the master location is set by the master flag). --master string The address of the Kubernetes API server (overrides any value in kubeconfig) --qps float32 The maximum QPS to the master from this client (default 1e+06) --resync-period duration If non-zero, will re-list this often. Otherwise, re-list will be delayed as long as possible (until the upstream source closes the watch or times out. (default 10m0s) Options inherited from parent commands --<API key> if true, bypasses validating webhook xray checks --enable-analytics Send analytical events to Google Analytics (default true) --<API key> if true, uses kube-apiserver FQDN for AKS cluster to workaround https://github.com/Azure/AKS/issues/522 (default true) SEE ALSO * [voyager](/docs/reference/operator/voyager.md) - Voyager by AppsCode - Secure L7/L4 Ingress Controller for Kubernetes
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8"> <title>tilesetName</title> <link href="../../../../images/logo-icon.svg" rel="icon" type="image/svg"> <script>var pathToRoot = "../../../../";</script> <script type="text/javascript" src="../../../../scripts/<API key>.js" async="async"></script> <link href="../../../../styles/style.css" rel="Stylesheet"> <link href="../../../../styles/logo-styles.css" rel="Stylesheet"> <link href="../../../../styles/jetbrains-mono.css" rel="Stylesheet"> <link href="../../../../styles/main.css" rel="Stylesheet"> <script type="text/javascript" src="../../../../scripts/clipboard.js" async="async"></script> <script type="text/javascript" src="../../../../scripts/navigation-loader.js" async="async"></script> <script type="text/javascript" src="../../../../scripts/<API key>.js" async="async"></script> <script type="text/javascript" src="../../../../scripts/main.js" async="async"></script> </head> <body> <div id="container"> <div id="leftColumn"> <div id="logo"></div> <div id="paneSearch"></div> <div id="sideMenu"></div> </div> <div id="main"> <div id="leftToggler"><span class="icon-toggler"></span></div> <script type="text/javascript" src="../../../../scripts/pages.js"></script> <script type="text/javascript" src="../../../../scripts/main.js"></script> <div class="main-content" id="content" pageIds="org.hexworks.zircon.internal.resource/<API key>.BISASAM_20X20/tilesetName/#/<API key>//-755115832"> <div class="navigation-wrapper" id="navigation-wrapper"> <div class="breadcrumbs"><a href="../../../index.html">zircon.core</a>/<a href="../../index.html">org.hexworks.zircon.internal.resource</a>/<a href="../index.html"><API key></a>/<a href="index.html">BISASAM_20X20</a>/<a href="tileset-name.html">tilesetName</a></div> <div class="pull-right d-flex"> <div class="filter-section" id="filter-section"><button class="platform-tag platform-selector common-like" data-active="" data-filter=":zircon.core:dokkaHtml/commonMain">common</button></div> <div id="searchBar"></div> </div> </div> <div class="cover "> <h1 class="cover"><span>tileset</span><wbr></wbr><span>Name</span></h1> </div> <div class="divergent-group" <API key>=":zircon.core:dokkaHtml/commonMain" data-filterable-set=":zircon.core:dokkaHtml/commonMain"><div class="with-platform-tags"><span class="pull-right"></span></div> <div> <div class="platform-hinted " <API key>="<API key>"><div class="content <API key>" data-active="" data-togglable=":zircon.core:dokkaHtml/commonMain"><div class="symbol monospace">val <a href="tileset-name.html">tilesetName</a>: <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div> </div> </div> </div> <div class="footer"><span class="go-to-top-icon"><a href=" </div> </div> </body> </html>
#!/bin/bash set -o nounset set -o errexit set -o pipefail function finish { echo "sleep 1 second to collect logs" sleep 0.5 # kill child process fstream pkill -P $$ sleep 0.5 } trap finish EXIT if [ ! -z ${LOG_COLLECTOR_URL} ]; then touch /tmp/log.txt /usr/bin/cyclone-toolbox/fstream -f /tmp/log.txt -s ${LOG_COLLECTOR_URL} & stdbuf -o0 -e0 /entrypoint.sh "$@" 2>&1 | stdbuf -o0 -e0 -i0 tee /tmp/log.txt else /entrypoint.sh "$@" fi
# Trichoramalina crinita (Tuck.) Rundel & Bowler SPECIES # Status ACCEPTED # According to The Catalogue of Life, 3rd January 2011 # Published in Bryologist 77(2): 191 (1974) # Original name Ramalina crinita Tuck. Remarks null
<?php $sovenco_hero_id = get_theme_mod( 'sovenco_hero_id', esc_html__('hero', 'sovenco') ); $<API key> = get_theme_mod( '<API key>' ) == 1 ? true : false ; $<API key> = get_theme_mod( '<API key>' ); $sovenco_hero_pdtop = get_theme_mod( 'sovenco_hero_pdtop', '10' ); $<API key> = get_theme_mod( '<API key>', '10' ); if ( <API key>() ) { $<API key> = false; } $hero_content_style = ''; if ( $<API key> != '1' ) { $hero_content_style = ' style="padding-top: '. $sovenco_hero_pdtop .'%; padding-bottom: '. $<API key> .'%;"'; } $_images = get_theme_mod('sovenco_hero_images'); if (is_string($_images)) { $_images = json_decode($_images, true); } if ( empty( $_images ) || !is_array( $_images ) ) { $_images = array(); } $images = array(); foreach ( $_images as $m ) { $m = wp_parse_args( $m, array('image' => '' ) ); $_u = <API key>( $m['image'] ); if ( $_u ) { $images[] = $_u; } } if ( empty( $images ) ){ $images = array( <API key>().'/assets/images/hero5.jpg' ); } $is_parallax = get_theme_mod( '<API key>' ) == 1 && ! empty( $images ) ; if ( $is_parallax ) { echo '<div id="parallax-hero" class="parallax-hero parallax-window" >'; echo '<div class="parallax-bg" style="background-image: url('.esc_url( $images[0]).');" data-stellar-ratio="0.1" <API key>="true"></div>'; } ?> <?php if ( ! $<API key> && ! empty ( $images ) ) : ?> <section id="<?php if ( $sovenco_hero_id != '' ){ echo esc_attr( $sovenco_hero_id ); } ?>" <?php if ( ! empty ( $images) && ! $is_parallax ) { ?> data-images="<?php echo esc_attr( json_encode( $images ) ); ?>"<?php } ?> class="<API key> <?php echo ( $<API key> == 1 ) ? '<API key>' : '<API key>'; ?>"> <div class="slider-spinner"> <div class="double-bounce1"></div> <div class="double-bounce2"></div> </div> <?php $layout = get_theme_mod( 'sovenco_hero_layout', 1 ); switch( $layout ) { case 2: $hcl2_content = get_theme_mod( '<API key>', wp_kses_post( '<h1>Business Website'."\n".'Made Simple.</h1>'."\n".'We provide creative solutions to clients around the world,'."\n".'creating things that get attention and meaningful.'."\n\n".'<a class="btn <API key> btn-lg" href="#">Get Started</a>' ) ); $hcl2_image = get_theme_mod( 'sovenco_hcl2_image', <API key>().'/assets/images/sovenco_responsive.png' ); ?> <div class="container"<?php echo $hero_content_style; ?>> <div class="hero__content hero-content-style<?php echo esc_attr( $layout ); ?>"> <div class="col-md-12 col-lg-6"> <?php if ( $hcl2_content ) { echo '<div class="hcl2-content">'.apply_filters( 'the_content', do_shortcode( wp_kses_post( $hcl2_content ) ) ).'</div>' ; }; ?> </div> <div class="col-md-12 col-lg-6"> <?php if ( $hcl2_image ) { echo '<img class="hcl2-image" src="'.esc_url( $hcl2_image ).'" alt="">' ; }; ?> </div> </div> </div> <?php break; default: $hcl1_largetext = get_theme_mod( '<API key>', wp_kses_post('We are <span class="js-rotating">sovenco | One Page | Responsive | Perfection</span>', 'sovenco' )); $hcl1_smalltext = get_theme_mod( '<API key>', wp_kses_post('Morbi tempus porta nunc <strong>pharetra quisque</strong> ligula imperdiet posuere<br> vitae felis proin sagittis leo ac tellus blandit sollicitudin quisque vitae placerat.', 'sovenco') ); $hcl1_btn1_text = get_theme_mod( '<API key>', esc_html__('Our Services', 'sovenco') ); $hcl1_btn1_link = get_theme_mod( '<API key>', esc_url( home_url( '/' )).esc_html__('#services', 'sovenco') ); $hcl1_btn2_text = get_theme_mod( '<API key>', esc_html__('Get Started', 'sovenco') ); $hcl1_btn2_link = get_theme_mod( '<API key>', esc_url( home_url( '/' )).esc_html__('#contact', 'sovenco') ); $btn_1_style = get_theme_mod( '<API key>', 'btn-theme-primary' ); $btn_2_style = get_theme_mod( '<API key>', '<API key>' ); ?> <div class="container"<?php echo $hero_content_style; ?>> <div class="hero__content hero-content-style<?php echo esc_attr( $layout ); ?>"> <?php if ($hcl1_largetext != '') echo '<h2 class="hero-large-text">' . wp_kses_post($hcl1_largetext) . '</h2>'; ?> <?php if ($hcl1_smalltext != '') echo '<p class="hero-small-text"> ' . do_shortcode( wp_kses_post( $hcl1_smalltext ) ) . '</p>' ?> <?php if ($hcl1_btn1_text != '' && $hcl1_btn1_link != '') echo '<a href="' . esc_url($hcl1_btn1_link) . '" class="btn '.esc_attr( $btn_1_style ).' btn-lg">' . wp_kses_post($hcl1_btn1_text) . '</a>'; ?> <?php if ($hcl1_btn2_text != '' && $hcl1_btn2_link != '') echo '<a href="' . esc_url($hcl1_btn2_link) . '" class="btn '.esc_attr( $btn_2_style ).' btn-lg">' . wp_kses_post($hcl1_btn2_text) . '</a>'; ?> </div> </div> <?php } ?> </section> <?php endif; if ( $is_parallax ) { echo '</div>'; // end parallax }
package com.netflix.spinnaker.front50.model.pipeline; import com.netflix.spinnaker.front50.model.ItemDAO; import java.util.Collection; public interface PipelineDAO extends ItemDAO<Pipeline> { String getPipelineId(String application, String pipelineName); Collection<Pipeline> <API key>(String application); Collection<Pipeline> <API key>(String application, boolean refresh); }
#ifdef <API key> #import <UIKit/UIKit.h> #import "<API key>.h" @interface MGSplitView : UIView { <API key>* controller; BOOL layingOut; BOOL singleLayout; } @property(nonatomic,readwrite,assign) BOOL layingOut; - (id)initWithFrame:(CGRect)frame controller:(<API key>*)controller_; -(void)setSingleLayout; @end #endif
<div class="right_col" role="main"> <!-- top tiles --> <div class="row tile_count"> <div class="animated flipInY col-md-2 col-sm-4 col-xs-4 tile_stats_count"> <div class="left"></div> <div class="right"> <span class="count_top"><i class="fa fa-coffee"></i> daily spendings rate</span> <div class="count">{{vm.<API key>}} <small>DH</small></div> <span class="count_bottom"><i class="green"><i class="fa fa-sort-asc"></i>{{vm.<API key>}} DH </i> From last Day</span> </div> </div> <div class="animated flipInY col-md-2 col-sm-4 col-xs-4 tile_stats_count"> <div class="left"></div> <div class="right"> <span class="count_top"><i class="fa fa-clock-o"></i> weekly spendings rate</span> <div class="count">{{ vm.<API key> }} <small>DH</small></div> <span class="count_bottom"><i class="green"><i class="fa fa-sort-asc"></i>{{ vm.<API key> }} DH </i> From last Week</span> </div> </div> <div class="animated flipInY col-md-2 col-sm-4 col-xs-4 tile_stats_count"> <div class="left"></div> <div class="right"> <span class="count_top"><i class="fa fa-long-arrow-up"></i> mounthly spendings rate</span> <div class="count green"> {{ vm.<API key> }} <small>DH</small></div> <span class="count_bottom"><i class="green"><i class="fa fa-sort-asc"></i> {{ vm.<API key> }} DH </i> From last Month</span> </div> </div> <div class="animated flipInY col-md-2 col-sm-4 col-xs-4 tile_stats_count"> <div class="left"></div> <div class="right"> <span class="count_top"><i class="fa fa-long-arrow-down"></i> mounthly incomes rate</span> <div class="count"> {{ vm.<API key> }} <small>DH</small></div> <span class="count_bottom"><i class="red"><i class="fa fa-sort-desc"></i>{{ vm.<API key> }} DH </i> From last Month</span> </div> </div> <div class="animated flipInY col-md-2 col-sm-4 col-xs-4 tile_stats_count"> <div class="left"></div> <div class="right"> <span class="count_top"><i class="fa fa-magnet"></i> </span> <div class="count"> {{ vm.<API key> }} <small>DH</small></div> <span class="count_bottom"><i class="green"><i class="fa fa-sort-asc"></i>{{ vm.<API key> }} DH </i> From last Month</span> </div> </div> <div class="animated flipInY col-md-2 col-sm-4 col-xs-4 tile_stats_count"> <div class="left"></div> <div class="right"> <span class="count_top"><i class="fa fa-money"></i> balance</span> <div class="count">{{ vm.balance }} <small>DH</small></div> <span class="count_bottom"><i class="green"><i class="fa fa-sort-asc"></i>{{ vm.balance_change }} DH </i> From last Week</span> </div> </div> </div> <!-- /top tiles --> <div class="row"> <div class="col-md-12 col-sm-12 col-xs-12"> <div class="x_panel"> <div class="x_title"> <h2>Cash flow of <small> YEAR {{ vm.cash_flow_data.year }} </small></h2> <ul class="nav navbar-right panel_toolbox"> <li class="square graph-key-color" style="background-color: {{ vm.<API key> }}; border: 1px solid {{ vm.<API key> }}; " > </li> <li class="square graph-key-name"> : Incomes </li> <li class="square graph-key-color" style="background-color: {{ vm.<API key> }}; border: 1px solid {{ vm.<API key> }}; " > </li> <li class="square graph-key-name"> : Outcomes </li> <li><a class="collapse-link" collapse-link ><i class="fa fa-chevron-up"></i></a> </li> </ul> <div class="clearfix"></div> </div> <div class="x_content"> <!-- {{vm | json }} --> <canvas id="lineChart" chart="{{vm.cash_flow_linechart}}" ng-if="!vm.loading" height="70" ></canvas> </div> <div class="clearfix"></div> </div> </div> </div> <br /> <div class="row"> <div class="col-md-12 col-sm-12col-xs-12"> <div class="x_panel"> <div class="x_title"> <h2>Cash flow of <small> YEAR {{ vm.cash_flow_data.year }} </small></h2> <ul class="nav navbar-right panel_toolbox"> <li class="square graph-key-color" style="background-color: {{ vm.<API key> }} " > </li> <li class="square graph-key-name"> : Incomes </li> <li class="square graph-key-color" style="background-color: {{ vm.<API key> }}; " > </li> <li class="square graph-key-name"> : Outcomes </li> <li><a class="collapse-link" collapse-link ><i class="fa fa-chevron-up"></i></a> </li> </ul> <div class="clearfix"></div> </div> <div class="x_content"> <canvas id="mybarChart" chart="{{vm.cash_flow_barchart}}" ng-if="!vm.loading" height="70"></canvas> </div> </div> </div> </div> <!-- footer content --> <page-footer></page-footer> <!-- /footer content --> </div>
package gw.lang.function; public abstract class Procedure8 extends AbstractBlock implements IProcedure8 { public Object invokeWithArgs(Object[] args) { if(args.length != 8) { throw new <API key>("You must pass 8 args to this block, but you passed" + args.length); } else { //noinspection unchecked invoke(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]); return null; } } }
package common import ( "fmt" "log" "sync" "net/http" "bytes" "encoding/json" "io" "os" ) //Declare some structure that will eb common for both Anonymous and Gossiper modulesv type DC struct { OutOfResource bool Name string City string Country string Endpoint string CPU float64 MEM float64 DISK float64 Ucpu float64 //Remaining CPU Umem float64 //Remaining Memory Udisk float64 //Remaining Disk LastUpdate int64 //Time stamp of current DC status LastOOR int64 //Time stamp of when was the last OOR Happpend IsActiveDC bool } type alldcs struct { Lck sync.Mutex List map[string]*DC } type rttbwGossipers struct { Lck sync.Mutex List map[string]int64 } type toanon struct { Ch chan bool M map[string]bool Lck sync.Mutex } type Triggerrequest struct{ Policy string } type GetThreshhold struct{ Threshhold string } //Declare somecommon types that will be used accorss the goroutines var ( ToAnon toanon //Structure Sending messages to FedComms module via TCP client ALLDCs alldcs //The data structure that stores all the Datacenter information ThisDCName string //This DataCenter's Name ThisEP string //Thsi Datacenter's Endpoint ThisCity string //This Datacenters City ThisCountry string //This Datacentes Country ResourceThresold int //Threshold value of any resource (CPU, MEM or Disk) after which we need to broadcast OOR RttOfPeerGossipers rttbwGossipers PolicyEP string ) func init() { ToAnon.M = make(map[string]bool) ToAnon.Ch = make(chan bool) ALLDCs.List = make(map[string]*DC) ResourceThresold = 100 RttOfPeerGossipers.List = make(map[string]int64) fmt.Printf("Initalizeing Common") } func SupressFrameWorks() { log.Println("SupressFrameWorks: called") ToAnon.Lck.Lock() for k := range ToAnon.M { ToAnon.M[k] = true } ToAnon.Lck.Unlock() ToAnon.Ch <- true // we set the IsActiveDC flag to TRUE _, available := ALLDCs.List[ThisDCName] if !available { log.Printf("SupressFrameWorks: DC information not available") return } ALLDCs.List[ThisDCName].IsActiveDC = false log.Println("SupressFrameWorks: returning") } func UnSupressFrameWorks() { log.Println("UnSupressFrameWorks: called") ToAnon.Lck.Lock() for k := range ToAnon.M { ToAnon.M[k] = false } ToAnon.Lck.Unlock() ToAnon.Ch <- true // we set the IsActiveDC flag to TRUE _, available := ALLDCs.List[ThisDCName] if !available { log.Printf("UnSupressFrameWorks: DC information not available") return } ALLDCs.List[ThisDCName].IsActiveDC = true log.Println("UnSupressFrameWorks: returning") } func TriggerPolicyCh(dat string){ var resp Triggerrequest resp.Policy = dat b := new(bytes.Buffer) json.NewEncoder(b).Encode(resp) fmt.Println("TriggerPolicyCh called in gossiper:\n") url := "http://" + PolicyEP + "/v1/TRIGGERPOLICY" res, _ := http.Post(url, "application/json; charset=utf-8",b) io.Copy(os.Stdout, res.Body) }
<!DOCTYPE html> <html> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Bookstore</title> <!-- Bootstrapping UI5 --> <script id="sap-ui-bootstrap" src="resources/sap-ui-core.js" data-sap-ui-libs="sap.m" data-sap-ui-theme="sap_bluecrystal" <API key>="edge" <API key>='{"de.linuxdozent.gittest.publicui": "."}' <API key>="trusted"> </script> <script> sap.ui.getCore().attachInit(function () { sap.ui.require([ "sap/m/Shell", "sap/ui/core/ComponentContainer" ], function (Shell, ComponentContainer) { // initialize the UI component new Shell({ app: new ComponentContainer({ height : "100%", name : "de.linuxdozent.gittest.publicui" }) }).placeAt("content"); }); }); </script> <script src='https://<API key>.dispatcher.hanatrial.ondemand.com/plugins/pluginrepository/hybrid/cordovafacade/floatingButton.js'></script> <style>.facadebtn{display:inline-block;width:60px;height:60px;background-color:#009de0;border-radius:50px;text-align:center;box-shadow: 2px 2px 3px #999;opacity:.3;} .facadebtn .sapUiIcon{color:#FFF;font-size:1.5rem;cursor:pointer;line-height:60px;width:60px;} .facadebtn:hover{opacity:1;}</style> <script src='https://<API key>.dispatcher.hanatrial.ondemand.com/plugins/pluginrepository/hybrid/cordovafacade/cordova.js' data-original-url='index.html'></script> <style>#interactive.viewport video{width:320px;height:240px;} #interactive.viewport .drawingBuffer{width:320px;height:240px;position:absolute;}</style> <script src="https: <!-- UI Content --> <body class="sapUiBody" id="content"> </body> </html>
module FrequentModel FREQUENCIES = [:day, :week, :month, :quarter, :year] def frequency_type index = read_attribute(:frequency_type) || self.class.columns_hash['frequency_type'].default FREQUENCIES[index] end def frequency_type=(value) write_attribute(:frequency_type, FREQUENCIES.index(value)) end end
<div class="body-wrap"> <div class="top-tools"> <a class="inner-link" href="#Ext.tree.<API key>"><img src="../resources/images/default/s.gif" class="item-icon icon-prop">Properties</a> <a class="inner-link" href="#Ext.tree.<API key>"><img src="../resources/images/default/s.gif" class="item-icon icon-method">Methods</a> <a class="inner-link" href="#Ext.tree.<API key>"><img src="../resources/images/default/s.gif" class="item-icon icon-event">Events</a> <a class="bookmark" href="../docs/?class=Ext.tree.RootTreeNodeUI"><img src="../resources/images/default/s.gif" class="item-icon icon-fav">Direct Link</a> </div> <h1>Class Ext.tree.RootTreeNodeUI</h1> <table cellspacing="0"> <tr><td class="label">Package:</td><td class="hd-info">Ext.tree</td></tr> <tr><td class="label">Defined In:</td><td class="hd-info"><a href="../source/widgets/tree/TreeNodeUI.js" target="_blank">TreeNodeUI.js</a></td></tr> <tr><td class="label">Class:</td><td class="hd-info">RootTreeNodeUI</td></tr> <tr><td class="label">Extends:</td><td class="hd-info">Object</td></tr> </table> <div class="description"> This class provides the default UI implementation for <b>root</b> Ext TreeNodes. The RootTreeNode UI implementation allows customizing the appearance of the root tree node.<br> <p> If you are customizing the Tree's user interface, you may need to extend this class, but you should never need to instantiate this class.<br> </div> <div class="hr"></div> <a id="Ext.tree.<API key>"></a> <h2>Public Properties</h2> <div class="no-members">This class has no public properties.</div> <a id="Ext.tree.<API key>"></a> <h2>Public Methods</h2> <div class="no-members">This class has no public methods.</div> <a id="Ext.tree.<API key>"></a> <h2>Public Events</h2> <div class="no-members">This class has no public events.</div> </div>
package com.adoregeek.rxdemo; import javax.inject.Scope; @Scope public @interface PerActivity { }
package org.nd4j.common.primitives.serde; import org.nd4j.common.primitives.AtomicDouble; import org.nd4j.shade.jackson.core.JsonParser; import org.nd4j.shade.jackson.core.<API key>; import org.nd4j.shade.jackson.databind.<API key>; import org.nd4j.shade.jackson.databind.JsonDeserializer; import org.nd4j.shade.jackson.databind.JsonNode; import java.io.IOException; public class <API key> extends JsonDeserializer<AtomicDouble> { @Override public AtomicDouble deserialize(JsonParser jsonParser, <API key> <API key>) throws IOException, <API key> { JsonNode node = jsonParser.getCodec().readTree(jsonParser); double value = node.asDouble(); return new AtomicDouble(value); } }
package org.pikater.web.vaadin.gui.shared.kineticcomponent.graphitems; import java.io.Serializable; import org.pikater.web.experiment.IBoxInfoCommon; /** * A special class for boxes of client kinetic canvas, made especially * for communication between server and client, carrying only the most * essential information. * * @author SkyCrawl */ public class BoxGraphItemShared implements Serializable, IBoxInfoCommon<Integer> { private static final long serialVersionUID = -<API key>; public Integer boxID; public int positionX; public int positionY; /** * @deprecated Default public constructor keeps Vaadin happy. */ @Deprecated public BoxGraphItemShared() { this(0, 0, 0); } public BoxGraphItemShared(Integer boxID, int positionX, int positionY) { this.boxID = boxID; this.positionX = positionX; this.positionY = positionY; } @Override public Integer getID() { return boxID; } @Override public void setID(Integer id) { boxID = id; } @Override public int getPosX() { return positionX; } @Override public void setPosX(int posX) { this.positionX = posX; } @Override public int getPosY() { return positionY; } @Override public void setPosY(int posY) { this.positionY = posY; } }
package sias.model.dao; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.Statement; import java.util.ArrayList; import java.util.List; import java.util.Map; import sias.model.base.BaseDAO; import sias.model.pojo.Uf; public class UfDAO implements BaseDAO<Uf> { public static final String <API key> = "1"; @Override public void create(Uf e, Connection conn) throws Exception { String sql = "INSERT INTO uf (nome, sigla) VALUES (?, ?) RETURNING id;"; PreparedStatement ps = conn.prepareStatement(sql); int i = 0; ps.setString(++i, e.getNome()); ps.setString(++i, e.getSigla()); ResultSet rs = ps.executeQuery(); if (rs.next()) { e.setId(rs.getLong("id")); } rs.close(); ps.close(); } @Override public Uf readById(Long id, Connection conn) throws Exception { Uf e = null; String sql = "SELECT * FROM uf WHERE id=?;"; PreparedStatement ps = conn.prepareStatement(sql); ps.setLong(1, id); ResultSet rs = ps.executeQuery(); if (rs.next()) { e = new Uf(); e.setId(rs.getLong("id")); e.setNome(rs.getString("nome")); e.setSigla(rs.getString("sigla")); } rs.close(); ps.close(); return e; } @Override public List<Uf> readByCriteria(Map<String, Object> criteria, Connection conn) throws Exception { List<Uf> lista = new ArrayList<Uf>(); String sql = "SELECT * FROM uf WHERE 1=1"; String criterionNomeILike = (String) criteria.get(<API key>); if (criterionNomeILike != null && !criterionNomeILike.trim().isEmpty()) { sql += " AND nome ILIKE '%" + criterionNomeILike + "%'"; } Statement s = conn.createStatement(); ResultSet rs = s.executeQuery(sql); while (rs.next()) { Uf e = new Uf(); e.setId(rs.getLong("id")); e.setNome(rs.getString("nome")); e.setSigla(rs.getString("sigla")); lista.add(e); } rs.close(); s.close(); return lista; } @Override public void update(Uf e, Connection conn) throws Exception { String sql = "UPDATE uf SET nome=?, sigla=? WHERE id=?;"; PreparedStatement ps = conn.prepareStatement(sql); int i = 0; ps.setString(++i, e.getNome()); ps.setString(++i, e.getSigla()); ps.setLong(++i, e.getId()); ps.execute(); ps.close(); } @Override public void delete(Long id, Connection conn) throws Exception { Statement st = conn.createStatement(); st.execute("DELETE FROM uf WHERE id =" + id); st.close(); } }
# cf-sdk-python Python examples using [requests](http: ## API slate documentation https://cognitivefashion.github.io/slate/ ## Getting started Make changes to `props.py` with your url and API key. You can also change the catalog name. props = {} # Replace this with the custom url generated for you. props['api_gateway_url'] = 'http://localhost:9080' # Replace 'your_api_key' with your API key. props['X-Api-Key'] = 'your_api_key' # You need to give a name to your catalog. # The sample scripts read the json files from this folder. props['catalog_name'] = 'sample_catalog' Run `fashion_quote.py` to ensure that your custom api url and the API key is working. ## Catalog ingestion and management 1. Add products to a catalog (`catalog_add_product.py`). 1. Update product in a catalog (`<API key>.py`). 1. Get product from a catalog (`catalog_get_product.py`). 1. Delete product from a catalog. (`<API key>.py`). 1. Get info about a product catalog (`catalog_info.py`). 1. Delete a product catalog (`catalog_delete.py`). 1. Get all catalog names (`catalog_names.py`). ## Visual Browse and Visual Search 1. Build the visual search index (`<API key>.py`). 1. Building the index takes some time. Check the status (`<API key>.py`). 1. Get other visually similar products in the catalog (`visual_browse.py`). 1. Get visually similar products in the catalog for an uploaded image (`visual_search.py`). 1. Delete the visual search index (`<API key>.py`). ## Natural Language Search 1. Natural Language Search (`<API key>.py`). 2. elasticsearch queries (`<API key>`). 3. Parse fashion query/text (`fashion_query_parse`). 4. Get search terms (`<API key>`). 5. Spelling correction (`<API key>`). ## Colors 1. Get color terms (`colors_terms.py`). 2. Get similar colors (`colors_similar.py`). 3. Dominant color palette (`colors_dominant`). ## Visual Attributes 1. Get visual attributes for an image (`visual_attributes.py`).
module.exports = { plugins: [ require('autoprefixer'), require('cssnano')({ preset: 'default' }) ] };
package com.anddevbg.lawa.recyclerview; import android.support.v7.widget.RecyclerView; public interface OnStartDragListener { void onStartDrag(RecyclerView.ViewHolder viewHolder); }
# Cookbook Name: nslcd # Attributes: default case node['platform_family'] when 'rhel', 'fedora' default['nslcd']['package'] = 'nss-pam-ldapd' else default['nslcd']['package'] = 'nslcd' end # runtime options default['nslcd']['threads'] = 5 default['nslcd']['uid'] = 'nslcd' default['nslcd']['gid'] = 'ldap' default['nslcd']['log'] = '' # general connection options default['nslcd']['uri'] = 'ldap://example.com' default['nslcd']['ldap_version'] = '' default['nslcd']['binddn'] = 'DC=something,DC=here,DC=com' default['nslcd']['bindpw'] = 'bindpasswd' default['nslcd']['rootpwmoddn'] = '' default['nslcd']['rootpwmodpw'] = '' # SASL authentication options default['nslcd']['sasl']['enable'] = false default['nslcd']['sasl']['mech'] = '' default['nslcd']['sasl']['realm'] = '' default['nslcd']['sasl']['authcid'] = '' default['nslcd']['sasl']['authzid'] = '' default['nslcd']['sasl']['secprops'] = '' default['nslcd']['sasl']['canonicalize'] = '' # Kerberos authentication options default['nslcd']['krb5_ccname'] = '' # search options default['nslcd']['base'] = 'DC=something,DC=here,DC=com' default['nslcd']['scope'] = 'sub' default['nslcd']['deref'] = 'never' default['nslcd']['referrals'] = 'yes' # Timing/reconnect options default['nslcd']['bind_timelimit'] = 10 default['nslcd']['timelimit'] = 0 default['nslcd']['idle_timelimit'] = default['nslcd']['reconnect_sleeptime'] = 1 default['nslcd']['reconnect_retrytime'] = 10 # SSL/TLS Options default['nslcd']['ssl'] = 'off' default['nslcd']['tls_reqcert'] = 'never' default['nslcd']['tls_cacertdir'] = '/etc/openldap/cacerts' default['nslcd']['tls_cacertfile'] = '' default['nslcd']['tls_randfile'] = '' default['nslcd']['tls_ciphers'] = '' default['nslcd']['tls_cert'] = '' default['nslcd']['tls_key'] = '' # Other Options default['nslcd']['pagesize'] = 0 default['nslcd']['<API key>'] = 'root' default['nslcd']['nss_min_uid'] = '' default['nslcd']['nss_nested_groups'] = '' default['nslcd']['validnames'] = '' default['nslcd']['ignorecase'] = '' default['nslcd']['pam_authz_search'] = '' default['nslcd']['pam_<API key>] = '' default['nslcd']['<API key>'] = '' default['nslcd']['cache'] = '' # Filters/Maps default['nslcd']['filters'] = []
// You may distribute under the terms of either the GNU General Public #include <standard.h> static int ph1[8] = {0, 2, 0, 2, 1, 3, 1, 3}, ph2[8] = {0, 0, 2, 2, 1, 1, 3, 3}, ph3[8] = {0, 2, 0, 2, 1, 3, 1, 3}; void pulsesequence() { double gzlvl0 = getval("gzlvl0"), gzlvl1 = getval("gzlvl1"), gzlvl2 = getval("gzlvl2"), gt0 = getval("gt0"), gt1 = getval("gt1"), gstab = getval("gstab"), compH = getval("compH"); char sspul[MAXSTR], pshape[MAXSTR]; int iphase; shape hdx; getstr("sspul",sspul); iphase = (int)(getval("phase")+0.5); /* Make HADAMARD encoding waveforms */ getstr("pshape", pshape); hdx = pboxHT_F1e(pshape, pw*compH, tpwr); /* Setup Phase Cycling */ settable(t1,8,ph1); settable(t2,8,ph2); settable(t3,8,ph3); getelem(t1,ct,v1); getelem(t2,ct,v2); getelem(t3,ct,oph); initval(2.0*(double)(((int)(d2*getval("sw1")+0.5)%2)),v10); add(v1,v10,v1); add(oph,v10,oph); status(A); delay(5.0e-5); zgradpulse(gzlvl0,gt0); if (sspul[0] == 'y') { rgpulse(pw,zero,rof1,rof1); zgradpulse(gzlvl0,gt0); } pre_sat(); if (getflag("wet")) wet4(zero,one); obspower(tpwr); status(B); pbox_pulse(&hdx, v1, rof1, 2.0e-6); obspower(tpwr); rgpulse(pw, v2, 2.0e-6, rof1); delay(gt1 + gstab + 2*GRADIENT_DELAY); rgpulse(2*pw, v2, rof1, rof1); zgradpulse(-gzlvl1,gt1); delay(gstab); rgpulse(pw, v2, rof1, rof2); zgradpulse(gzlvl2,gt1); delay(gstab - 2*GRADIENT_DELAY); status(C); }
using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace DI_Castle.Models { public class UserService : IUserService { public string GetUserName(string name) { return string.Format("Hello {0}", name); } } }
// Code generated by go-swagger; DO NOT EDIT. package cluster // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "fmt" "io" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" "github.com/netapp/trident/storage_drivers/ontap/api/rest/models" ) // <API key> is a Reader for the ClusterPeerModify structure. type <API key> struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. func (o *<API key>) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := <API key>() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil default: result := <API key>(response.Code()) if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } if response.Code()/100 == 2 { return result, nil } return nil, result } } // <API key> creates a ClusterPeerModifyOK with default headers values func <API key>() *ClusterPeerModifyOK { return &ClusterPeerModifyOK{} } /* ClusterPeerModifyOK describes a response with status code 200, with default header values. OK */ type ClusterPeerModifyOK struct { Payload *models.<API key> } func (o *ClusterPeerModifyOK) Error() string { return fmt.Sprintf("[PATCH /cluster/peers/{uuid}][%d] clusterPeerModifyOK %+v", 200, o.Payload) } func (o *ClusterPeerModifyOK) GetPayload() *models.<API key> { return o.Payload } func (o *ClusterPeerModifyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(models.<API key>) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil } // <API key> creates a <API key> with default headers values func <API key>(code int) *<API key> { return &<API key>{ _statusCode: code, } } type <API key> struct { _statusCode int Payload *models.ErrorResponse } // Code gets the status code for the cluster peer modify default response func (o *<API key>) Code() int { return o._statusCode } func (o *<API key>) Error() string { return fmt.Sprintf("[PATCH /cluster/peers/{uuid}][%d] cluster_peer_modify default %+v", o._statusCode, o.Payload) } func (o *<API key>) GetPayload() *models.ErrorResponse { return o.Payload } func (o *<API key>) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(models.ErrorResponse) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil }
package org.set4j.impl.mbean; import org.set4j.Set4JException; import org.set4j.impl.ClassHandler; import org.set4j.impl.Log; import javax.management.<API key>; import javax.management.<API key>; import javax.management.<API key>; import javax.management.MBeanServer; import javax.management.<API key>; import javax.management.<API key>; import javax.management.ObjectName; import java.lang.management.ManagementFactory; import java.util.ArrayList; import java.util.HashMap; import java.util.List; /** * @author Tomas Mikenda * */ public class BeanExploder { private static final String ROOTNODE = "#root#"; public void createBeans(ClassHandler handler) throws <API key>, <API key>, <API key>, <API key> { MBeanServer mbs = ManagementFactory.<API key>(); Log.info("Registering mBeans - START"); // prepare list of modules and its values HashMap<String, List<String>> modules = new HashMap<String, List<String>>(); for (String name : handler.getRegistry().keySet()) { String node = packageName(name); List<String> list = modules.get(node); if (list == null) { list = new ArrayList<String>(); modules.put(node, list); } list.add(name); } String rootName = stripName(handler.getSourceClass().getName()); for (String moduleName : modules.keySet()) { StringBuffer objName = new StringBuffer().append("set4j:"); if (moduleName == ROOTNODE) objName.append("type=").append(rootName).append(",name=").append(rootName); else objName.append("type=").append(rootName).append(",name=").append(moduleName); Log.debug("Register mbean - " + objName.toString()); ObjectName name = new ObjectName(objName.toString()); if (mbs.isRegistered(name)) { Log.debug("mbean registred, removing"); try { mbs.unregisterMBean(name); } catch (Exception e) { Log.info("Unregistering fails: " + e); } } mbs.registerMBean(new Set4JMBean(handler, moduleName, modules.get(moduleName)), name); } /* //handler.getMBeanInfo() HashMap<String, ClassHandler> modules = handler.getModules(); if (parent == null || parent.length() == 0) parent="type="; else parent += '.'; for (String modName : modules.keySet()) { createBeans(modules.get(modName), parent + modName); } */ Log.info("Registering mBeans - END"); } private String packageName(String name) { if (name.contains(".")) { return name.substring(0, name.lastIndexOf('.')); } else return ROOTNODE; } private String stripName(String name) { if (name.contains(".")) { return name.substring(name.lastIndexOf('.')+1); } else return ROOTNODE; } }
<!DOCTYPE html> <!--[if IE]><![endif]--> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>Class <API key> </title> <meta name="viewport" content="width=device-width"> <meta name="title" content="Class <API key> "> <meta name="generator" content="docfx 2.10.2.0"> <link rel="shortcut icon" href="../favicon.ico"> <link rel="stylesheet" href="../styles/docfx.vendor.css"> <link rel="stylesheet" href="../styles/docfx.css"> <link rel="stylesheet" href="../styles/main.css"> <meta property="docfx:navrel" content="../toc.html"> <meta property="docfx:tocrel" content="toc.html"> </head> <body data-spy="scroll" data-target="#affix"> <div id="wrapper"> <header> <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="../index.html"> <img id="logo" class="svg" src="../logo.svg" alt=""> </a> </div> <div class="collapse navbar-collapse" id="navbar"> <form class="navbar-form navbar-right" role="search" id="search"> <div class="form-group"> <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off"> </div> </form> </div> </div> </nav> <div class="subnav navbar navbar-default"> <div class="container hide-when-search" id="breadcrumb"> <ul class="breadcrumb"> <li></li> </ul> </div> </div> </header> <div role="main" class="container body-content hide-when-search"> <div class="sidenav hide-when-search"> <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a> <div class="sidetoggle collapse" id="sidetoggle"> <div id="sidetoc"></div> </div> </div> <div class="article row grid-right"> <div class="col-md-10"> <article class="content wrap" id="_content"> <h1 id="<API key>" data-uid="TinCan.Standard.Documents.<API key>">Class <API key> </h1> <div class="markdown level0 summary"><p>Class <API key>.</p> </div> <div class="markdown level0 conceptual"></div> <div class="inheritance"> <h5>Inheritance</h5> <div class="level0"><span class="xref">System.Object</span></div> <div class="level1"><a class="xref" href="TinCan.Standard.Documents.Document.html">Document</a></div> <div class="level2"><span class="xref"><API key></span></div> </div> <div class="inheritedMembers"> <h5>Inherited Members</h5> <div> <a class="xref" href="TinCan.Standard.Documents.Document.html#<API key>">Document.ID</a> </div> <div> <a class="xref" href="TinCan.Standard.Documents.Document.html#<API key>">Document.Etag</a> </div> <div> <a class="xref" href="TinCan.Standard.Documents.Document.html#<API key>">Document.Timestamp</a> </div> <div> <a class="xref" href="TinCan.Standard.Documents.Document.html#<API key>">Document.ContentType</a> </div> <div> <a class="xref" href="TinCan.Standard.Documents.Document.html#<API key>">Document.Content</a> </div> <div> <span class="xref">System.Object.ToString()</span> </div> <div> <span class="xref">System.Object.Equals(System.Object)</span> </div> <div> <span class="xref">System.Object.Equals(System.Object, System.Object)</span> </div> <div> <span class="xref">System.Object.ReferenceEquals(System.Object, System.Object)</span> </div> <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> <h6><strong>Namespace</strong>:TinCan.Standard.Documents</h6> <h6><strong>Assembly</strong>:TincCan.xAPIWrapper.Docs.dll</h6> <h5 id="<API key>">Syntax</h5> <div class="codewrapper"> <pre><code class="lang-csharp hljs">public class <API key> : Document</code></pre> </div> <h3 id="properties">Properties </h3> <span class="small pull-right mobile-hide"> <span class="divider">|</span> <a href="https: </span> <span class="small pull-right mobile-hide"> <a href="https://github.com/iWorkTech/xAPIWrapper-xamarin/blob/master/component/src/TincCan.xAPIWrapper.Docs/src/Documents/<API key>.cs/#L36">View Source</a> </span> <a id="<API key>" data-uid="TinCan.Standard.Documents.<API key>.Activity*"></a> <h4 id="<API key>" data-uid="TinCan.Standard.Documents.<API key>.Activity">Activity</h4> <div class="markdown level1 summary"><p>Gets or sets the activity.</p> </div> <div class="markdown level1 conceptual"></div> <h5 class="decalaration">Declaration</h5> <div class="codewrapper"> <pre><code class="lang-csharp hljs">public Activity Activity { get; set; }</code></pre> </div> <h5 class="propertyValue">Property Value</h5> <table class="table table-bordered table-striped table-condensed"> <thead> <tr> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><a class="xref" href="TinCan.Standard.Activity.html">Activity</a></td> <td><p>The activity.</p> </td> </tr> </tbody> </table> <h3 id="seealso">See Also</h3> <div class="seealso"> <div><a class="xref" href="TinCan.Standard.Documents.Document.html">Document</a></div> </div> </article> </div> <div class="hidden-sm col-md-2" role="complementary"> <div class="sideaffix"> <div class="contribution"> <ul class="nav"> <li> <a href="https: </li> <li> <a href="https://github.com/iWorkTech/xAPIWrapper-xamarin/blob/master/component/src/TincCan.xAPIWrapper.Docs/src/Documents/<API key>.cs/#L30" class="contribution-link">View Source</a> </li> </ul> </div> <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix"> <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> --> </nav> </div> </div> </div> </div> <footer> <div class="grad-bottom"></div> <div class="footer"> <div class="container"> <span class="pull-right"> <a href="#top">Back to top</a> </span> <span>Copyright © 2015-2016 Microsoft<br>Generated by <strong>DocFX</strong></span> </div> </div> </footer> </div> <script type="text/javascript" src="../styles/docfx.vendor.js"></script> <script type="text/javascript" src="../styles/docfx.js"></script> <script type="text/javascript" src="../styles/main.js"></script> </body> </html>
# tinMongo golangmongodb(web) trello:https://trello.com/b/JqLqW4E4/tinmongo-mongodb Apache v2 [LICENSE](https:
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_112) on Mon Nov 06 11:57:27 MST 2017 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Uses of Interface org.wildfly.swarm.config.undertow.server.HostSupplier (BOM: * : All 2017.11.0 API)</title> <meta name="date" content="2017-11-06"> <link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../../../script.js"></script> </head> <body> <script type="text/javascript"><! try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Interface org.wildfly.swarm.config.undertow.server.HostSupplier (BOM: * : All 2017.11.0 API)"; } } catch(err) { } </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <div class="topNav"><a name="navbar.top"> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../org/wildfly/swarm/config/undertow/server/HostSupplier.html" title="interface in org.wildfly.swarm.config.undertow.server">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">WildFly Swarm API, 2017.11.0</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?org/wildfly/swarm/config/undertow/server/class-use/HostSupplier.html" target="_top">Frames</a></li> <li><a href="HostSupplier.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip.navbar.top"> </a></div> <div class="header"> <h2 title="Uses of Interface org.wildfly.swarm.config.undertow.server.HostSupplier" class="title">Uses of Interface<br>org.wildfly.swarm.config.undertow.server.HostSupplier</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../../../org/wildfly/swarm/config/undertow/server/HostSupplier.html" title="interface in org.wildfly.swarm.config.undertow.server">HostSupplier</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="#org.wildfly.swarm.config.undertow">org.wildfly.swarm.config.undertow</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.wildfly.swarm.config.undertow"> </a> <h3>Uses of <a href="../../../../../../../org/wildfly/swarm/config/undertow/server/HostSupplier.html" title="interface in org.wildfly.swarm.config.undertow.server">HostSupplier</a> in <a href="../../../../../../../org/wildfly/swarm/config/undertow/package-summary.html">org.wildfly.swarm.config.undertow</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../org/wildfly/swarm/config/undertow/package-summary.html">org.wildfly.swarm.config.undertow</a> with parameters of type <a href="../../../../../../../org/wildfly/swarm/config/undertow/server/HostSupplier.html" title="interface in org.wildfly.swarm.config.undertow.server">HostSupplier</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="../../../../../../../org/wildfly/swarm/config/undertow/Server.html" title="type parameter in Server">T</a></code></td> <td class="colLast"><span class="typeNameLabel">Server.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/undertow/Server.html#host-org.wildfly.swarm.config.undertow.server.HostSupplier-">host</a></span>(<a href="../../../../../../../org/wildfly/swarm/config/undertow/server/HostSupplier.html" title="interface in org.wildfly.swarm.config.undertow.server">HostSupplier</a>&nbsp;supplier)</code> <div class="block">Install a supplied Host object to the list of subresources</div> </td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <div class="bottomNav"><a name="navbar.bottom"> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../org/wildfly/swarm/config/undertow/server/HostSupplier.html" title="interface in org.wildfly.swarm.config.undertow.server">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">WildFly Swarm API, 2017.11.0</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?org/wildfly/swarm/config/undertow/server/class-use/HostSupplier.html" target="_top">Frames</a></li> <li><a href="HostSupplier.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip.navbar.bottom"> </a></div> <p class="legalCopy"><small>Copyright & </body> </html>
using System; using Microsoft.VisualStudio.TestTools.UnitTesting; using SharpChan.Extensions.Common; using System.Text; using System.Collections.Generic; namespace CSharpHelpersTests.Extensions.Common { [TestClass] public class <API key> { [TestMethod] public void <API key>() { object nullObject1 = null; StringBuilder nullObject2 = null; object nonNullObject1 = new object(); StringBuilder nonNullObject2 = new StringBuilder(); Assert.IsTrue(nullObject1.IsNull()); Assert.IsTrue(nullObject2.IsNull()); Assert.IsFalse(nonNullObject1.IsNull()); Assert.IsFalse(nonNullObject2.IsNull()); } [TestMethod] public void <API key>() { List<int> nullObject1 = null; IList<int> nullObject2 = null; string nonNullObject1 = "foo bar nyu"; object nonNullObject2 = (object)1; Assert.IsTrue(nonNullObject1.IsNotNull()); Assert.IsTrue(nonNullObject2.IsNotNull()); Assert.IsFalse(nullObject1.IsNotNull()); Assert.IsFalse(nullObject2.IsNotNull()); } [TestMethod] public void IsAnyOfIntTests() { Assert.IsTrue(1.IsAnyOf(1, 2)); Assert.IsTrue(1.IsAnyOf(2, 1)); Assert.IsTrue(1.IsAnyOf(2, 2, 1)); Assert.IsFalse(1.IsAnyOf(0, 2)); Assert.IsFalse(1.IsAnyOf(32, 0, 45, 7)); } [TestMethod] public void IsAnyOfStringTests() { Assert.IsTrue("foo".IsAnyOf("foo", "bar")); Assert.IsTrue("foo".IsAnyOf("bar", "foo")); Assert.IsTrue("foo".IsAnyOf("bar", "nyu", "foo")); Assert.IsFalse("blah".IsAnyOf("foo", "bar", "nyu")); // test null values Assert.IsTrue("blah".IsAnyOf(null, "foo", "blah")); Assert.IsTrue(((string)null).IsAnyOf("foo", "bar", null)); Assert.IsFalse(((string)null).IsAnyOf("foo", "bar", "nyu")); } [TestMethod] public void <API key>() { try { string nullArg = null; nullArg.ThrowIfNull("nullArg"); Assert.Fail("Should throw"); } catch (<API key> e) { Assert.AreEqual(e.ParamName, "nullArg"); } } [TestMethod] public void <API key>() { string arg = "foo"; arg.ThrowIfNull("arg"); } } }
package com.athena.utils; import com.athena.utils.enums.Mode; import com.athena.hashfamily.Hash; public class Output { public static void printInit(String version) { System.out.println("Starting AthenaHRT version " + version + "\n"); } public static void printStatus(String status, String hashfile_filename, int hashType, int mode, int recoveredAmt) { System.out.println( "\nSession...: " + "Athena" + "\nStatus....: " + status + "\nInput.....: " + hashfile_filename + " (" + FileUtils.getBytes(hashfile_filename) + " bytes)" + "\nHashes....: " + FileUtils.getLineCount(hashfile_filename) + " total, " + FileUtils.getUniques(hashfile_filename) + " unique" + "\nHash Type.: " + Hash.getHash(hashType).getName() + "\nMode......: " + Mode.getMode(mode).getModeName() + "\nRecovered.: " + recoveredAmt + "/" + FileUtils.getLineCount(hashfile_filename) + " (" + (recoveredAmt / FileUtils.getLineCount(hashfile_filename)) * 100 + "%)\n"); } public static void printCracked(String hash, String plaintext) { System.out.println(hash + ":" + plaintext); } public static void printRemoved(int amount) { System.out.println(amount + " hashes removed from file"); } }
package de.androidbytes.recipr.presentation.single.add.view.activity; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.os.Build; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.design.widget.TextInputLayout; import android.support.v7.app.ActionBar; import android.support.v7.app.AlertDialog; import android.support.v7.widget.Toolbar; import android.text.Editable; import android.text.TextWatcher; import android.view.*; import android.widget.<API key>; import android.widget.EditText; import android.widget.ImageView; import android.widget.TextView; import butterknife.BindView; import butterknife.OnClick; import com.fuck_boilerplate.rx_paparazzo.RxPaparazzo; import com.fuck_boilerplate.rx_paparazzo.entities.Response; import com.google.android.gms.analytics.HitBuilders; import com.google.android.gms.analytics.Tracker; import com.linearlistview.LinearListView; import com.yalantis.ucrop.UCrop; import com.yalantis.ucrop.UCropActivity; import de.androidbytes.recipr.domain.model.User; import de.androidbytes.recipr.presentation.R; import de.androidbytes.recipr.presentation.ReciprApplication; import de.androidbytes.recipr.presentation.core.util.GlideUtility; import de.androidbytes.recipr.presentation.core.view.activity.PresenterActivity; import de.androidbytes.recipr.presentation.single.add.di.AddRecipeComponent; import de.androidbytes.recipr.presentation.single.add.di.AddRecipeModule; import de.androidbytes.recipr.presentation.single.add.di.<API key>; import de.androidbytes.recipr.presentation.single.add.presenter.AddRecipePresenter; import de.androidbytes.recipr.presentation.single.add.view.AddRecipeView; import de.androidbytes.recipr.presentation.single.add.view.adapter.<API key>; import de.androidbytes.recipr.presentation.single.core.model.IngredientViewModel; import de.androidbytes.recipr.presentation.single.core.model.StepViewModel; import de.androidbytes.recipr.presentation.single.core.view.adapter.<API key>; import de.androidbytes.recipr.presentation.single.core.view.adapter.StepListAdapter; import rx.functions.Action1; import javax.inject.Inject; import java.util.List; public class AddRecipeActivity extends PresenterActivity<AddRecipeComponent, AddRecipePresenter> implements AddRecipeView { @BindView(R.id.toolbar) Toolbar toolbar; @BindView(R.id.et_name) EditText etRecipeName; @BindView(R.id.et_category) <API key> etRecipeCategory; @BindView(R.id.et_name_wrapper) TextInputLayout etRecipeNameWrapper; @BindView(R.id.et_category_wrapper) TextInputLayout <API key>; @BindView(R.id.<API key>) TextView ingredientsTitle; @BindView(R.id.<API key>) TextView stepsTitle; @BindView(R.id.ingredients_list) LinearListView ingredientsListView; @BindView(R.id.steps_list) LinearListView stepListView; @BindView(R.id.iv_recipe_image) ImageView recipeImage; @Inject AddRecipePresenter presenter; @Inject Tracker tracker; @Inject <API key> autoCompleteAdapter; @Inject <API key> ingredientAdapter; @Inject StepListAdapter stepAdapter; private String imageUrl = ""; @Override protected int getLayoutResourceId() { return R.layout.activity_add_recipe; } public static Intent getLaunchIntent(Context context) { return new Intent(context, AddRecipeActivity.class); } @Override protected AddRecipeComponent <API key>() { return <API key>.builder() .<API key>(((ReciprApplication) <API key>()).<API key>()) .addRecipeModule(new AddRecipeModule(getLoggedInUserId())) .build(); } @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.add_recipe_menu, menu); return super.onCreateOptionsMenu(menu); } @Override public boolean <API key>(MenuItem item) { final boolean handled; switch (item.getItemId()) { case R.id.menu_save_recipe: User loggedInUser = getLoggedInUser(); presenter.saveRecipeAction(loggedInUser); handled = true; break; case android.R.id.home: handled = !presenter.shouldClose() || super.<API key>(item); break; default: handled = super.<API key>(item); } return handled; } private void <API key>() { CharSequence colors[] = new CharSequence[]{getString(R.string.<API key>), getString(R.string.<API key>)}; final UCrop.Options options = new UCrop.Options(); options.setAllowedGestures(UCropActivity.SCALE, UCropActivity.NONE, UCropActivity.NONE); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { options.<API key>(getResources().getColor(R.color.colorPrimary, getTheme())); options.setStatusBarColor(getResources().getColor(R.color.colorPrimaryDark, getTheme())); options.setToolbarColor(getResources().getColor(R.color.colorPrimary, getTheme())); } else { //noinspection deprecation options.<API key>(getResources().getColor(R.color.colorPrimary)); //noinspection deprecation options.setStatusBarColor(getResources().getColor(R.color.colorPrimaryDark)); //noinspection deprecation options.setToolbarColor(getResources().getColor(R.color.colorPrimary)); } options.setToolbarTitle(getResources().getString(R.string.<API key>)); AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle("Pick a color"); builder.setItems(colors, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { switch (which) { case 0: RxPaparazzo .takeImage(AddRecipeActivity.this) .crop(options) .usingCamera() .subscribe(new Action1<Response<AddRecipeActivity, String>>() { @Override public void call(Response<AddRecipeActivity, String> response) { if (response.resultCode() != RESULT_OK) { response.targetUI().showUserCanceled(); return; } response.targetUI().loadImage(response.data()); } }); break; case 1: RxPaparazzo .takeImage(AddRecipeActivity.this) .crop(options) .usingGallery() .subscribe(new Action1<Response<AddRecipeActivity, String>>() { @Override public void call(Response<AddRecipeActivity, String> response) { if (response.resultCode() != RESULT_OK) { response.targetUI().showUserCanceled(); return; } response.targetUI().loadImage(response.data()); } }); break; default: break; } } }); builder.show(); } private void loadImage(String imageUrl) { this.imageUrl = imageUrl; GlideUtility.loadRecipeImage(this, imageUrl, recipeImage); } private void showUserCanceled() { } @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setUpInjection(); setUpToolbar(); setUpLayout(savedInstanceState); } @Override public void onResume() { super.onResume(); tracker.setScreenName(AddRecipeActivity.class.getSimpleName()); tracker.send(new HitBuilders.ScreenViewBuilder().build()); } private void setUpInjection() { getComponent().inject(this); } private void setUpToolbar() { ActionBar actionBar = <API key>(toolbar); actionBar.<API key>(true); actionBar.<API key>(true); } private void setUpLayout(Bundle savedInstanceState) { <API key>(); etRecipeCategory.setAdapter(autoCompleteAdapter); etRecipeCategory.setThreshold(3); ingredientsListView.setAdapter(ingredientAdapter); stepListView.setAdapter(stepAdapter); if (savedInstanceState == null) { initializeData(); } } private void <API key>() { etRecipeName.<API key>(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { showRecipeNameError(false); } @Override public void afterTextChanged(Editable s) { } }); etRecipeCategory.<API key>(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { showCategoryError(false); } @Override public void afterTextChanged(Editable s) { } }); } private void initializeData() { presenter.loadData(); } @Override public void <API key>(List<String> <API key>) { autoCompleteAdapter.swapData(<API key>); } @Override public String getRecipeName() { return etRecipeName.getText().toString(); } @Override public String getCategoryName() { return etRecipeCategory.getText().toString(); } @Override public List<IngredientViewModel> getIngredients() { return ingredientAdapter.getData(); } @Override public List<StepViewModel> getSteps() { return stepAdapter.getData(); } @Override public void destroy() { finish(); } @Override public String getImageUrl() { return imageUrl; } @Override public void showStepsError(boolean show) { if (show) stepsTitle.setError(getString(R.string.error_steps)); else stepsTitle.setError(null); } @Override public void <API key>(boolean show) { if (show) ingredientsTitle.setError(getString(R.string.error_ingredients)); else ingredientsTitle.setError(null); } @Override public void showCategoryError(boolean show) { <API key>.setError(getString(R.string.error_category_name)); <API key>.setErrorEnabled(show); } @Override public void showRecipeNameError(boolean show) { etRecipeNameWrapper.setError(getString(R.string.error_recipe_name)); etRecipeNameWrapper.setErrorEnabled(show); } @Override public void onBackPressed() { if (presenter.shouldClose()) super.onBackPressed(); } @Override public void <API key>() { new AlertDialog.Builder(this) .setTitle(getString(R.string.<API key>)) .setMessage(getString(R.string.<API key>)) .setPositiveButton(getString(R.string.<API key>), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { finish(); } }) .setNegativeButton(getString(R.string.<API key>), null) .show(); } @OnClick(R.id.fab) public void <API key>() { <API key>(); } @OnClick(R.id.<API key>) public void <API key>() { showStepsError(false); <API key>(new StepViewModel(-1, stepAdapter.getCount() + 1, "")); } private void <API key>(final StepViewModel step) { LayoutInflater inflater = LayoutInflater.from(this); View addStepAlert = inflater.inflate(R.layout.alert_add_step, null); AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(getString(R.string.<API key>)); builder.setView(addStepAlert); final EditText instructionEditText = (EditText) addStepAlert.findViewById(R.id.et_instruction); final String initialInstruction = step.getInstruction(); if (initialInstruction != null) { instructionEditText.setText(initialInstruction); } builder .setCancelable(false) .setPositiveButton( getString(R.string.<API key>), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { final String instruction = instructionEditText.getText().toString(); if (!instruction.isEmpty()) { step.setInstruction(instruction); stepAdapter.addStep(step); stepAdapter.<API key>(); dialog.dismiss(); } } }) .setNegativeButton( getString(R.string.<API key>), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } } ); builder.create().show(); } @OnClick(R.id.addIngredientButton) public void <API key>() { <API key>(false); <API key>(new IngredientViewModel(-1, "", "", "")); } private void <API key>(final IngredientViewModel ingredient) { LayoutInflater inflater = LayoutInflater.from(this); View addIngredientAlert = inflater.inflate(R.layout.<API key>, null); AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(getString(R.string.<API key>)); builder.setView(addIngredientAlert); final EditText quantityEditText = (EditText) addIngredientAlert.findViewById(R.id.tv_quantity); final EditText unitEditText = (EditText) addIngredientAlert.findViewById(R.id.tv_unit); final EditText ingredientEditText = (EditText) addIngredientAlert.findViewById(R.id.tv_ingredient); final String initialQuantity = ingredient.getQuantity(); if (initialQuantity != null) { quantityEditText.setText(initialQuantity); } final String initialUnit = ingredient.getUnit(); if (initialUnit != null) { unitEditText.setText(initialUnit); } final String initialName = ingredient.getName(); if (initialName != null) { ingredientEditText.setText(initialName); } builder .setCancelable(false) .setPositiveButton( getString(R.string.<API key>), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { final String quantity = quantityEditText.getText().toString(); if (!quantity.isEmpty()) { ingredient.setQuantity(quantity); } final String unit = unitEditText.getText().toString(); if (!unit.isEmpty()) { ingredient.setUnit(unit); } final String ingredientName = ingredientEditText.getText().toString(); if (!ingredientName.isEmpty()) { ingredient.setName(ingredientName); ingredientAdapter.addIngredient(ingredient); ingredientAdapter.<API key>(); dialog.dismiss(); } } }) .setNegativeButton( getString(R.string.<API key>), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } } ); builder.create().show(); } }
'use strict'; describe('Services.Waterline', function () { var waterline, sandbox = sinon.sandbox.create(); helper.before(function(context) { context.Core = { start: sandbox.stub().resolves(), stop: sandbox.stub().resolves() }; return helper.di.simpleWrapper(context.Core, 'Services.Core' ); }); before(function() { waterline = helper.injector.get('Services.Waterline'); }); helper.after(); after(function() { sandbox.restore(); }); describe('start', function () { it('should start service and resolve', function() { var createIndexesStub = this.sandbox.stub().resolves(); waterline.service.initialize = this.sandbox.spy(function(cfg,callback) { var ontology = { collections:{ 'testModel': { identity: 'test', createIndexes: createIndexesStub } } }; callback(undefined, ontology); }); return waterline.start().then(function() { expect(createIndexesStub).to.have.been.calledOnce; }); }); it('should resolve itself if already initialized', function() { this.sandbox.stub(waterline, 'isInitialized').returns(true); return waterline.start().should.be.resolved; }); it('should reject if an error occurs when it is not initialized', function() { this.sandbox.stub(waterline, 'isInitialized').returns(false); waterline.service.initialize = this.sandbox.spy(function(cfg,callback) { callback(Error); }); return waterline.start().should.be.rejected; }); }); describe('stop', function () { it('should teardown and resolve when initialized', function() { waterline.service.teardown = this.sandbox.spy(function(callback) { callback(); }); this.sandbox.stub(waterline, 'isInitialized').returns(true); return waterline.stop(); }); it('should resolve when not initialized', function() { this.sandbox.stub(waterline, 'isInitialized').returns(false); return waterline.stop(); }); }); });
#include "RouteActualizer.h" #include "Algorithms/Actualization/<API key>.h" #include "Run.h" #include "Schedule.h" #include "Stop.h" namespace Scheduler { RouteActualizer::RouteActualizer(Stop& stop) : stop(stop), is_dirty(true) { } void RouteActualizer::actualize( ) const { if(is_dirty) { getAlgorithm( ).actualize(stop); is_dirty = false; } } void RouteActualizer::setDirty(bool dirty) { is_dirty = dirty; } const <API key>& RouteActualizer::getAlgorithm( ) const { return stop.getRun( ).getSchedule( ).<API key>( ).<API key>( ); } }
/*ADMIN CSS*/ #<API key> label{ display: block; } #<API key> label.inline{ display: inline-block; } #<API key> select, #<API key> input[type='text']{ width: 225px; } #<API key> .toggleOptions{ margin-top: 15px; } #fsFormBox .updated p{ font-weight: bold; } #<API key> input[type='text'], #<API key> select{ width: 300px; } .fsFormBox{ margin-bottom: 15px; font-size: 13px; } .fsTopformBox{ margin-top: 15px; } .fsFormBox label{ width: 220px; display: inline-block; } .fsFormBox p{ margin: 20px 0; } .fsFormBox .fsHint{ display: block; margin-left: 226px; font-style: italic; margin-top: 2px; } .fsFormBox li{ list-style-type: square; line-height: 1.7em; } .fsFormBox ul{ margin-left: 15px; font-size: 13px; } .fsFormBox .fsCancel{ color: #f00; text-decoration: underline; margin-left: 15px; padding: 2px 3px; font-size: 12px; border-radius: 3px; -moz-border-radius: 3px; -<API key>: 3px; } .fsFormBox .fsCancel:hover{ background-color: #f00; color: #fff; } .fsBlock{ display: block; } .fsPostBox{ font-family: Georgia,'Times New Roman','Bitstream Charter',Times,serif; font-size: 15px; font-weight: normal; padding: 7px 10px; margin: 0; line-height: 1em; cursor: default!important; } .fsLinkButton{ border: 0; font-size: 12px; background-color: transparent; padding: 0; margin: 5px 0; color: #21759b; display: block; line-height: 1.6em; } .fsLinkButton:hover{ color: #d54e21; cursor: pointer; } .fsTable{ line-height: 1.6em; } #icon-flickr-stream{ background-image: url('flickrstream_icon.png'); } #fsMastHead{ margin-bottom: 10px; } #<API key> a img:hover, .flickrstream-embed img:hover{ background-color: #397fdf; } .flickrstream-embed img{ margin: 5px; border-radius: 3px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); border: 1px solid #ccc; padding: 5px; } .flickrstream-embed img.medtbm{ height: 150px; width: 150px; } .flickrstream-embed img.smltbm{ height: 75px; width: 75px; } .fsSetTitle{ text-align: left; margin-left: 15px; margin-bottom: 10px; } .fs-errorbar{ background-color: #a80000 ; color: #fff; padding: 5px; margin: 15px 0; font-size: 14px; border-radius: 5px; border: 2px solid #680000; text-transform: uppercase; }
var a00680 = [ [ "TESS_CHAR", "a00612.html", "a00612" ], [ "CubeAPITest", "a00680.html#<API key>", null ], [ "HOcrEscape", "a00680.html#<API key>", null ], [ "make_tesseract_blob", "a00680.html#<API key>", null ], [ "<API key>", "a00680.html#<API key>", null ], [ "kBytesPerBlob", "a00680.html#<API key>", null ], [ "<API key>", "a00680.html#<API key>", null ], [ "kBytesPerNumber", "a00680.html#<API key>", null ], [ "kInputFile", "a00680.html#<API key>", null ], [ "kLatinChs", "a00680.html#<API key>", null ], [ "kMaxBytesPerLine", "a00680.html#<API key>", null ], [ "<API key>", "a00680.html#<API key>", null ], [ "kMaxIntSize", "a00680.html#<API key>", null ], [ "<API key>", "a00680.html#<API key>", null ], [ "kMinRectSize", "a00680.html#<API key>", null ], [ "kNumbersPerBlob", "a00680.html#<API key>", null ], [ "kOldVarsFile", "a00680.html#<API key>", null ], [ "kTesseractReject", "a00680.html#<API key>", null ], [ "kUniChs", "a00680.html#<API key>", null ], [ "kUNLVReject", "a00680.html#<API key>", null ], [ "kUNLVSuspect", "a00680.html#<API key>", null ], [ "stream_filelist", "a00680.html#<API key>", null ] ];
$(document).ready(function(){ function pergiKe(s){ $("#loading").css({"visibility" : "visible"}); var uagent = navigator.userAgent.toLowerCase(); if(/safari/.test(uagent) && !/chrome/.test(uagent)) window.location.href = s; else document.location.href = s; } $(".like-button").click(function(){ if($(this).attr("liked") == "false") { $(this).attr("liked", "true"); $(this).children("img").attr("src", "../ViewTimeline/images/lips_full.png"); } else { $(this).attr("liked", "false"); $(this).children("img").attr("src", "../ViewTimeline/images/lips_outline.png"); } }); $("#menu-expand").click(function(){ if($(".bottom-menu").attr("expanded") == "false") { $(".bottom-menu").attr("expanded", "true"); $(this).attr("src", "../ViewTimeline/images/bubble_close.png"); $(".menu-post").slideDown(100); $(".menu-delivery").delay(75).slideDown(100); $(".menu-shoppink").delay(150).slideDown(100); $(".menu-forum").delay(225).slideDown(100); } else { $(".bottom-menu").attr("expanded", "false"); $(this).attr("src", "../ViewTimeline/images/bubble_bag.png"); $(".menu-post").slideUp(100); $(".menu-delivery").delay(90).slideUp(100); $(".menu-shoppink").delay(180).slideUp(100); $(".menu-forum").delay(270).slideUp(100); } }); $(".go-profile").click(function(){ pergiKe("../ViewTimeline/profile.html") }); $(".go-back").click(function(){ var from = $(this).attr("from"); pergiKe("../ViewTimeline/"+from); }); $(".identity .name").click(function(){ var to = $(this).attr("to"); pergiKe("../ViewTimeline/profile-batur.html"); }) $(".notif-row .content .profile").click(function(){ var to = $(this).attr("to"); pergiKe("../ViewTimeline/profile-batur.html"); }) $(".button-home").click(function() { pergiKe("../ViewTimeline/home.html") }); $(".button-notification").click(function() { pergiKe("../ViewTimeline/notification.html") }); $(".button-chat").click(function() { pergiKe("../ViewChat/home.html") }); $(".menu-shoppink").click(function() { pergiKe("../ViewShoppink/home.html") }); // show/hide menu on scroll var lastScrollTop = 0; $(window).scroll(function() { if ($(this).scrollTop()>lastScrollTop) { $('.bottom-menu').fadeOut(); } else { $('.bottom-menu').fadeIn(); } lastScrollTop = $(this).scrollTop(); }); // end show/hide menu on scroll $("#menu-thumbnail").click(function(){ pergiKe("../ViewTimeline/photos-thumbnail.html"); }); $("#menu-timeline").click(function(){ pergiKe("../ViewTimeline/photos-timeline.html"); }); $("#photos").click(function(){ pergiKe("../ViewTimeline/photos-thumbnail.html"); }); $("#friends-other").click(function(){ pergiKe("../ViewChat/friend-other.html") }); $("#friends").click(function(){ pergiKe("../ViewChat/home.html") }); $("#settings").click(function(){ pergiKe("../ViewTimeline/profile-settings.html"); }); $("#menu-post").click(function(){ pergiKe("../ViewTimeline/new-post.html") }); $(".close").click(function() { $(this).parent().hide(); $(".post").show(); $("#emoticon-list").hide(); }); $(".post").click(function() { pergiKe("../ViewTimeline/home.html") }); $("#menu-image").click(function(){ $(".input.attach").hide(); $(".input.image").show(); $(".post").show(); $("#emoticon-list").hide(); }); $("#menu-location").click(function(){ $(".input.attach").hide(); $(".input.location").show(); $(".post").show(); $("#emoticon-list").hide(); }); $("#menu-emoticon").click(function(){ $(".post").hide(); $("#emoticon-list").show(); }); $("#emoticon-list img").click(function(){ var imgpath = $(this).attr("src"); $(".input.emoticon img").attr("src",imgpath); $(".input.attach").hide(); $(".input.emoticon").show(); $(".post").show(); $("#emoticon-list").hide(); }) $("#save-settings").click(function() { pergiKe("../ViewTimeline/profile.html"); }); $("#menu-forum").click(function() { pergiKe("../ViewForum/home.html"); }); $("#activity").click(function() { pergiKe("../ViewWizard/activity.html"); }); $(".add-comment").click(function() { pergiKe("../ViewTimeline/add-comment.html"); }); $(".search").click(function() { pergiKe("../ViewTimeline/search.html") }); });
package examples.events.envelope; import net.beadsproject.beads.core.Bead; import net.beadsproject.beads.data.Buffer; import net.beadsproject.beads.ugens.Envelope; import net.beadsproject.beads.ugens.Gain; import net.beadsproject.beads.ugens.WavePlayer; import net.happybrackets.core.HBAction; import net.happybrackets.device.HB; import java.lang.invoke.MethodHandles; /** * This sketch layers three sounds on top of one another, triggered by an event at the completion of an envelope segment * A single envelope is used, however, we add segments to the envelope. When the first segment is completed, the next segment starts */ public class EnvelopeTrigger implements HBAction { @Override public void action(HB hb) { // remove this code if you do not want other compositions to run at the same time as this one hb.reset(); hb.setStatus(this.getClass().getSimpleName() + " Loaded"); final float FREQUENCY = 1000; // this is the fundamental frequency of the waveform we will make final float VOLUME = 0.1f; // define how loud we want the sound // create a wave player to generate a waveform based on frequency and waveform type WavePlayer waveformGenerator = new WavePlayer(FREQUENCY, Buffer.SINE); // The Envelope will function as both the volume and the event trigger Envelope eventTrigger = new Envelope(VOLUME); // set up a gain amplifier to control the volume Gain gainAmplifier = new Gain(HB.getNumOutChannels(), eventTrigger); // connect our WavePlayer object into the Gain object gainAmplifier.addInput(waveformGenerator); // Now plug the gain object into the audio output HB.getAudioOutput().addInput(gainAmplifier); // now add some events final float SEGMENT_DURATION = 4000; // THis is how long we will make our segments // we will not change the volume // Create a segment that will generate a beadMessage at the completion of the segment // At the completion of the segment duration, the bead messageReceived will be called and add another WavePlayer // Just type beadMessage and the code will be automatically generated for you eventTrigger.addSegment(VOLUME, SEGMENT_DURATION, new Bead() { @Override protected void messageReceived(Bead bead) { /*** Write your code below this line ***/ // Create a WavePlayer that generates a waveform 2 times the frequency WavePlayer wp = new WavePlayer(FREQUENCY * 2, Buffer.SINE); gainAmplifier.addInput(wp); /*** Write your code above this line ***/ } }); // Create another segment that will generate a beadMessage at the completion of the segment // At the completion of the segment duration, the bead messageReceived will be called and add another WavePlayer // Just type beadMessage and the code will be automatically generated for you eventTrigger.addSegment(VOLUME, SEGMENT_DURATION, new Bead() { @Override protected void messageReceived(Bead bead) { /*** Write your code below this line ***/ // Create a WavePlayer that generates a waveform 4 times the frequency WavePlayer wp = new WavePlayer(FREQUENCY * 4, Buffer.SINE); gainAmplifier.addInput(wp); /*** Write your code above this line ***/ } }); } //<editor-fold defaultstate="collapsed" desc="Debug Start"> /** * This function is used when running sketch in IntelliJ IDE for debugging or testing * * @param args standard args required */ public static void main(String[] args) { try { HB.runDebug(MethodHandles.lookup().lookupClass()); } catch (Exception e) { e.printStackTrace(); } } //</editor-fold> }
define("<API key>/js/render", ["<API key>/js/utils/util"], function(util) { /* * This function is a drawing function; you should put all your drawing logic in it. * it's called in moduleFunc.prototype.render * @param {Object} data - proceessed dataset, check dataMapping.js * @param {Object} container - the target d3.selection element of plot area * @example * container size: this.width() or this.height() * chart properties: this.properties() * dimensions info: data.meta.dimensions() * measures info: data.meta.measures() */ var render = function(data, container) { var color_option = 'process-oriented'; var isaggregated = 0; var window_width = this.width(); var window_height = this.height(); var module = this; container.selectAll('svg').remove(); //var svg = container.append('svg'); //svg.attr("width", width).attr("height", height); var svg = container.append('svg').attr('width', window_width).attr('height', window_height).attr("class", "<API key>"); //def gradient var defs = svg.append("defs"); var gradient = defs.append("linearGradient") .attr("id", "gradient") .attr("x1", "0%") .attr("y1", "0%") .attr("x2", "100%") .attr("y2", "0%") .attr("spreadMethod", "pad"); gradient.append("stop") .attr("offset", "0%") .attr("stop-color", "rgb(255,0,0)") .attr("stop-opacity", 1); gradient.append("stop") .attr("offset", "100%") .attr("stop-color", "#c00") .attr("stop-opacity", 0); gradient = defs.append("linearGradient") .attr("id", "gradient2") .attr("x1", "0%") .attr("y1", "0%") .attr("x2", "100%") .attr("y2", "0%") .attr("spreadMethod", "pad"); gradient.append("stop") .attr("offset", "0%") .attr("stop-color", "rgb(0,255,0)") .attr("stop-opacity", 1); gradient.append("stop") .attr("offset", "100%") .attr("stop-color", "rgb(0,255,0") .attr("stop-opacity", 0); var vis = svg.append('g').attr('class', 'vis').attr('width', window_width).attr('height', window_height); $(".<API key>.node rect").css({ cursor: 'move', 'fill-opacity': .9, 'shape-rendering': 'crispEdges' }); $(".<API key>.node text").css({ 'pointer-events': 'none', 'text-shadow': '0 1px 0 #fff' }); $(".<API key>.link").css({ fill: 'none', stroke: '#000', 'stroke-opacity': .2 }); $(".<API key>.link:hover").css({ 'stroke-opacity': .5 }); var d3_sankey = function() { var sankey = {}, nodeWidth = 24, nodePadding = 24, size = [1, 1], nodes = [], links = []; sankey.nodeWidth = function(_) { if (!arguments.length) { return nodeWidth; } nodeWidth = +_; return sankey; }; sankey.nodePadding = function(_) { if (!arguments.length) { return nodePadding; } nodePadding = +_; return sankey; }; sankey.nodes = function(_) { if (!arguments.length) { return nodes; } nodes = _; return sankey; }; sankey.links = function(_) { if (!arguments.length) { return links; } links = _; return sankey; }; sankey.size = function(_) { if (!arguments.length) { return size; } size = _; return sankey; }; sankey.layout = function(iterations) { computeNodeLinks(); computeNodeValues(); computeNodeBreadths(); computeNodeDepths(iterations); computeLinkDepths(); return sankey; }; sankey.relayout = function() { computeLinkDepths(); return sankey; }; function center(node) { return node.y + node.dy / 2; } function value(link) { return link.value; } sankey.link = function() { var curvature = .5; function link(d) { var x0 = d.source.x + d.source.dx, x1 = d.target.x, xi = d3.interpolateNumber(x0, x1), x2 = xi(curvature), x3 = xi(1 - curvature), y0 = d.source.y + d.sy + d.dy / 2, y1 = d.target.y + d.ty + d.dy / 2; if (d.target.name === "NULLSPACE" || d.target.name === "CUTSPACE") { y1 = y0 + 0.1; x1 = x0 + 20; xi = d3.interpolateNumber(x0, x1); x2 = xi(curvature); x3 = xi(1 - curvature); } return "M" + x0 + "," + y0 + "C" + x2 + "," + y0 + " " + x3 + "," + y1 + " " + x1 + "," + y1; } link.curvature = function(_) { if (!arguments.length) { return curvature; } curvature = +_; return link; }; return link; }; // Populate the sourceLinks and targetLinks for each node. // Also, if the source and target are not objects, assume they are indices. function computeNodeLinks() { nodes.forEach(function(node) { node.sourceLinks = []; node.targetLinks = []; }); links.forEach(function(link) { var source = link.source, target = link.target; if (typeof source === "number") { source = link.source = nodes[link.source]; } if (typeof target === "number") { target = link.target = nodes[link.target]; } source.sourceLinks.push(link); target.targetLinks.push(link); }); } // Compute the value (size) of each node by summing the associated links. function computeNodeValues() { nodes.forEach(function(node) { node.value = Math.max( d3.sum(node.sourceLinks, value), d3.sum(node.targetLinks, value) ); }); } // Iteratively assign the breadth (x-position) for each node. // Nodes are assigned the maximum breadth of incoming neighbors plus one; // nodes with no incoming links are assigned breadth zero, while // nodes with no outgoing links are assigned the maximum breadth. function computeNodeBreadths() { nodes.forEach(function(d) { d.x = parseInt(d.name.substring(0, d.name.indexOf("-"))); d.dx = nodeWidth; }); var x = d3.max(nodes, function(d) { return d.x; }); nodes.filter(function(l) { return l.name === "NULLSPACE" || l.name === "CUTSPACE"; }).forEach(function(d) { d.x = d3.max(nodes, function(f) { return f.x; }) + 1; }); scaleNodeBreadths((width - nodeWidth - 20) / (x)); } function moveSourcesRight() { nodes.forEach(function(node) { if (!node.targetLinks.length) { node.x = d3.min(node.sourceLinks, function(d) { return d.target.x; }) - 1; } }); } function moveSinksRight(x) { nodes.forEach(function(node) { if (!node.sourceLinks.length) { node.x = x - 1; } }); } function scaleNodeBreadths(kx) { nodes.forEach(function(node) { node.x *= kx; }); } function computeNodeDepths(iterations) { var nodesByBreadth = d3.nest() .key(function(d) { return d.x; }) .sortKeys(d3.ascending) .entries(nodes) .map(function(d) { return d.values; }); function initializeNodeDepth() { var ky = d3.min(nodesByBreadth, function(nodes) { return (size[1] - (nodes.length - 1) * nodePadding) / d3.sum(nodes, value); }); nodesByBreadth.forEach(function(nodes) { nodes.forEach(function(node, i) { node.y = i; node.dy = node.value * ky; }); }); links.forEach(function(link) { link.dy = link.value * ky; }); } function relaxLeftToRight(alpha) { nodesByBreadth.forEach(function(nodes, breadth) { nodes.forEach(function(node) { if (node.targetLinks.length) { var y = d3.sum(node.targetLinks, weightedSource) / d3.sum(node.targetLinks, value); node.y += (y - center(node)) * alpha; } }); }); function weightedSource(link) { return center(link.source) * link.value; } } function relaxRightToLeft(alpha) { function weightedTarget(link) { return center(link.target) * link.value; } nodesByBreadth.slice().reverse().forEach(function(nodes) { nodes.forEach(function(node) { if (node.sourceLinks.length) { var y = d3.sum(node.sourceLinks, weightedTarget) / d3.sum(node.sourceLinks, value); node.y += (y - center(node)) * alpha; } }); }); } function resolveCollisions() { nodesByBreadth.forEach(function(nodes) { var node, dy, y0 = 0, n = nodes.length, i; // Push any overlapping nodes down. nodes.sort(ascendingDepth); for (i = 0; i < n; ++i) { node = nodes[i]; dy = y0 - node.y; if (dy > 0) { node.y += dy; } y0 = node.y + node.dy + nodePadding; } // If the bottommost node goes outside the bounds, push it back up. dy = y0 - nodePadding - size[1]; if (dy > 0) { y0 = node.y -= dy; // Push any overlapping nodes back up. for (i = n - 2; i >= 0; --i) { node = nodes[i]; dy = node.y + node.dy + nodePadding - y0; if (dy > 0) { node.y -= dy; } y0 = node.y; } } }); } function ascendingDepth(a, b) { return a.y - b.y; } initializeNodeDepth(); resolveCollisions(); for (var alpha = 1; iterations > 0; --iterations) { relaxRightToLeft(alpha *= .99); resolveCollisions(); relaxLeftToRight(alpha); resolveCollisions(); } } function computeLinkDepths() { function <API key>(a, b) { if (a.source.y === b.source.y) { if(b.processlength - a.processlength !== 0) return b.processlength - a.processlength; else return b.value - a.value; } return a.source.y - b.source.y; } function <API key>(a, b) { if (a.target.y === b.target.y) { if(b.processlength - a.processlength !== 0) return b.processlength - a.processlength; else return b.value - a.value; } if (a.target.name === "NULLSPACE") { return 1; } if (b.target.name === "NULLSPACE") { return -1; } return a.target.y - b.target.y; } nodes.forEach(function(node) { node.sourceLinks.sort(<API key>); node.targetLinks.sort(<API key>); }); nodes.forEach(function(node) { var sy = 0, ty = 0; node.sourceLinks.forEach(function(link) { link.sy = sy; sy += link.dy; }); node.targetLinks.forEach(function(link) { link.ty = ty; ty += link.dy; }); }); } return sankey; }; function displayerror(text) { vis.append('text').text(text) .attr('x', window_width / 2) .attr('y', window_height / 2) .attr('text-anchor', 'middle') .attr('fill', 'black') .style('opacity', 0.3) .attr('font-size', '28px'); } //Sankey plugin ends var meta = data.meta; var _ds = meta.dimensions('Nodes'); var _ms = meta.measures('Flow'); if (_ds[0] === "Dimension") { displayerror("dimension is not defined"); return; } var ds = _ds[0]; if (_ms[0] === "Measure") { displayerror("measure is not defined"); return; } var ms = _ms[0]; var margin = { top: 30, right: 1, bottom: 1, left: 1 }, width = window_width - margin.left - margin.right, height = window_height - margin.top - margin.bottom; var formatNumber = d3.format(".0f"), format = function(d) { return formatNumber(d); }, color = d3.scale.category10(); var vis_g = vis.attr("width", width + margin.left + margin.right) .attr("height", height + margin.top + margin.bottom) .append("g") .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); var sankey = d3_sankey() .nodeWidth(15) .nodePadding(30) .size([width, height]); var path = sankey.link(); var graph = { "nodes": [], "links": [] }; graph.nodes.push({ "name": "NULLSPACE" }); data.filter(function(d) { return d[ds] !== null; }).forEach(function(d) { var temp_nodes = d[ds].split(">"); if (temp_nodes.length === 1) { graph.nodes.push({ "name": "0-" + temp_nodes[0] }); } for (var i = 0; i < temp_nodes.length; i++) { if (i + 1 < temp_nodes.length) { //alert(temp_nodes[i] + " > " + temp_nodes[i+1]); var temp_source_node = i.toString() + "-" + temp_nodes[i]; var temp_target_node = (i + 1).toString() + "-" + temp_nodes[i + 1]; if (i === 9) { temp_target_node = "CUTSPACE"; i = temp_nodes.length; } graph.nodes.push({ "name": temp_source_node }); graph.nodes.push({ "name": temp_target_node }); graph.links.push({ "source": temp_source_node, "target": temp_target_node, "value": +d[ms], "processlength": temp_nodes.length, "process": d[ds] //.replace(">", "").replace(" ", "") }); } else { graph.links.push({ "source": i.toString() + "-" + temp_nodes[i], "target": "NULLSPACE", "value": +d[ms], "processlength": temp_nodes.length, "process": d[ds] //.replace(">", "").replace(" ", "")////"NULLSPACE" }); } } }); //window.glinks = graph.links; // return only the distinct / unique nodes graph.nodes = d3.keys(d3.nest() .key(function(d) { return d.name; }) .map(graph.nodes)); if (data.length > 150) { var nested_data = d3.nest() .key(function(d) { return [d.source, d.target]; }) .rollup(function(d) { return d3.sum(d, function(g) { return g.value; }); }) .entries(graph.links); graph.links = []; nested_data.forEach(function(d) { graph.links.push({ "source": d.key.split(",")[0], "target": d.key.split(",")[1], "value": +d.values, "processlength": 1, "process": d.key.split(",")[0] + ">" + d.key.split(",")[1] }); }); nested_data = null; isaggregated = 1; color_option = 'node-oriented'; } // loop through each link replacing the text with its index from node graph.links.forEach(function(d, i) { graph.links[i].source = graph.nodes.indexOf(graph.links[i].source); graph.links[i].target = graph.nodes.indexOf(graph.links[i].target); }); //now loop through each nodes to make nodes an array of objects // rather than an array of strings graph.nodes.forEach(function(d, i) { graph.nodes[i] = { "name": d }; }); try { sankey .nodes(graph.nodes) .links(graph.links) .layout(1); } catch (err) { displayerror(err.message); return; } function redraw(coloring_option) { vis_g.selectAll('g').remove(); function linktooltip(d) { //return; //var step = parseInt(d.name.substring(0,d.name.indexOf("-"))); //var node = d.name.substring(d.name.indexOf("-") + 1); var selectedContextArr = []; for(var i = 0; i < data.length; ++i) { if(data[i][ds] == d.process) { selectedContextArr.push(data[i].context(ms)); } } var mouse = d3.mouse(this); var pos = { x: (d.source.x + d.target.x)/2,//d3.event.x, y: (d.source.y + d.target.y)/2//d3.event.y }; module.setSelectedObjects(selectedContextArr); // show data filter and notify host application module.dispatch().showDataFilter({ dataCtx: util.composeSelection(ms, 1, this, selectedContextArr), options: { position: pos } }); $("#datafilter").prepend('<table class="<API key>" style="border-collapse: collapse; margin-bottom:10px;"><tr><td style="font-family:Arial;font-size:12px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;padding-bottom:8px;color:#666666" class="<API key>">Node:</td><td style="font-family:Arial;font-size:13px;font-weight:bold;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;padding-left:7px;padding-bottom:8px;color:#666666" class="<API key>">'+d.process+'</td></tr><tr><td style="font-family:Arial;font-size:12px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;padding-bottom:0px;color:#666666" class="<API key>">'+ms+':</td><td style="font-family:Arial;font-size:13px;font-weight:bold;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;padding-left:7px;padding-bottom:0px;color:#000000" class="<API key>">'+d.value+'</td></tr></table>'); } var link = vis_g.append("g").selectAll(".link") .data(graph.links) .enter().append("path") .attr("class", "<API key> link") .attr("d", path) .style("stroke-width", function(d) { return Math.max(1, d.dy); }) .style("stroke", function(d) { //return d.color = color(d.source.name.substring(d.source.name.indexOf("-")+1));//d.name.replace(/ .*/, "")); if (d.target.name === "NULLSPACE") { return "url(#gradient)"; } if (d.target.name === "CUTSPACE") { return "url(#gradient2)"; } switch (coloring_option) { case 'process-oriented': return color(d.process); case 'input-output': return 'rgb(31, 119, 180)'; case 'node-oriented': return color(d.source.name.substring(d.source.name.indexOf("-") + 1)); } return color(d.process); }) //.on("click",linktooltip) .on("mouseover", function(d) { module.dispatch().hideDataFilter(); vis_g.selectAll(".link").filter(function(l) { return l.process === d.process; }).transition().style('stroke-opacity', 0.7); }) .on("mouseout", function(d) { vis_g.selectAll(".link").filter(function(l) { return l.process === d.process; }).transition().style('stroke-opacity', 0.2); }) .sort(function(a, b) { return b.dy - a.dy; }); link.append("title") .text(function(d) { return d.process.replace(new RegExp(">", 'g'), " → ") + "\n" + (isaggregated === 0 ? '' : '(aggregated)' + "\n") + format(d.value); }); function dragmove(d) { d3.select(this).attr("transform", "translate(" + d.x + "," + (d.y = Math.max(0, Math.min(height - d.dy, d3.event.y))) + ")"); sankey.relayout(); link.attr("d", path); } var selected_nodes = {}; function nodetooltip(d, node, actionmode) { var step = parseInt(d.name.substring(0,d.name.indexOf("-"))); var name = d.name.substring(d.name.indexOf("-") + 1); var pos = { x: Math.max(d.x - 50, 0), y: Math.max(d.y, 0) }; if(actionmode && $.inArray(d.name, Object.keys(selected_nodes)) > -1) { delete selected_nodes[d.name]; vis_g.selectAll(".node").filter(function(l) {return l.name === d.name;}).selectAll("rect").style("stroke","black").style("stroke-width", "1px"); actionmode=false; } else if(actionmode) { var selectedContextArr = []; for(var i = 0; i < data.length; ++i) { var temp_node = data[i][ds].split(">"); if(temp_node.length > step && temp_node[step] == name) { selectedContextArr.push(data[i].context(ms)); } } selected_nodes[d.name] = selectedContextArr; var selectedContext = []; for(var i = 0; i < Object.keys(selected_nodes).length; ++i) { selectedContext = selectedContext.concat(selected_nodes[Object.keys(selected_nodes)[i]]); } module.setSelectedObjects(selectedContext); vis_g.selectAll(".node").filter(function(l) {return l.name === d.name;}).selectAll("rect").style("stroke","yellow").style("stroke-width", "3px"); } else if (!actionmode && $.inArray(d.name, Object.keys(selected_nodes)) > -1) { actionmode = true; var selectedContext = []; for(var i = 0; i < Object.keys(selected_nodes).length; ++i) { selectedContext = selectedContext.concat(selected_nodes[Object.keys(selected_nodes)[i]]); } module.setSelectedObjects(selectedContext); } else { module.setSelectedObjects([]); } // show data filter and notify host application module.dispatch().showDataFilter({ dataCtx: util.composeSelection(ms, 1, this, selectedContextArr), options: { position: pos } }); $("#datafilter").addClass("<API key>"); $("#datafilter")[0].style.setProperty('position', 'absolute', 'important'); $("#datafilter")[0].style.setProperty('width', '180px', 'important'); $("#datafilter").prepend('<table class="<API key>">'+ '<tr><td class="<API key>">Node:</td><td class="<API key>">'+name+'</td></tr>'+ '<tr><td class="<API key>">'+ms+':</td><td style="" class="<API key>">'+d.value+'</td></tr>'+ '</table>'+ (Object.keys(selected_nodes).length > 1 ? '<div class="v-separationline"></div><div class="v-footer-label tooltipfooterlabel">'+Object.keys(selected_nodes).length+' nodes selected</div>' : '')); var action_height = !actionmode ? 144-57 : 50+14-57; var offset = $("#datafilter").offset(); $( "#datafilter" ).offset({ top: offset.top - $("#datafilter").outerHeight() + action_height //d.y + mouse[1]//offset.top - height - 5 }); if(!actionmode) { $("#datafilter>div:last").remove(); } } function nodeclick(d) { nodetooltip(d, this, true); } function nodehover(d, node) { nodetooltip(d, node, false); } //window.svgg = vis_g; var node = vis_g.append("g").selectAll(".node") .data( graph.nodes.filter(function(l) {return l.name != "NULLSPACE" && l.name != "CUTSPACE";}) ) .enter().append("g") .attr("class", "<API key> node") .attr("transform", function(d) { return "translate(" + d.x + "," + d.y + ")"; }) .call(d3.behavior.drag() .origin(function(d) { return d; }) .on("dragstart", function() { this.parentNode.appendChild(this); }) .on("drag", dragmove)); node.append("rect") .attr("height", function(d) { return d.dy; }) .attr("width", sankey.nodeWidth()) .style("fill", function(d) { return color(d.name.substring(d.name.indexOf("-") + 1)); //d.name.replace(/ .*/, "")); }) .style("stroke", function(d) { return d3.rgb(d.color).darker(2); }) .on("click",nodeclick) .on("mouseover", function(d) { nodehover(d, this); vis_g.selectAll(".link").filter(function(l) { return l.source === d || l.target === d; }).transition().style('stroke-opacity', 0.7); }) .on("mouseout", function(d) { //module.dispatch().hideDataFilter(); vis_g.selectAll(".link").filter(function(l) { return l.source === d || l.target === d; }).transition().style('stroke-opacity', 0.2); }); //.append("title") //.text(function(d) { // return d.name.substring(d.name.indexOf("-") + 1) + "\n" + format(d.value); node.append("text") .attr("x", +15) .attr("y", -6) .attr("dy", ".35em") .attr("text-anchor", "end") .attr("transform", null) .text(function(d) { return d.name.substring(d.name.indexOf("-") + 1); }) .filter(function(d) { return d.x < width / 2; }) .attr("x", 0) .attr("text-anchor", "start"); } redraw(color_option); var menu = svg.append('g'); menu.append('rect') .style('fill', 'rgb(217,217,217)') .attr('x', window_width - 334) .attr('width', 334) .attr('y', 0) .attr('height', 20); menu.append('text').text('PROCESS-ORIENTED') .style('cursor', isaggregated === 0 ? 'pointer' : 'default') .attr('x', window_width - 12) .attr('y', 13) .attr('text-anchor', 'end') .attr('fill', 'black') .style('text-decoration', isaggregated === 0 ? 'none' : 'line-through') .on("click", function() { if (isaggregated === 0) { color_option = 'process-oriented'; redraw(color_option); } }); menu.append('text').text('INPUT-OUTPUT') .style('cursor', 'pointer') .attr('x', window_width - 177) .attr('y', 13) .attr('text-anchor', 'middle') .attr('fill', 'black') .on("click", function() { color_option = 'input-output'; redraw(color_option); }); menu.append('text').text('NODE-ORIENTED') .style('cursor', 'pointer') .attr('x', window_width - 322) .attr('y', 13) .attr('text-anchor', 'start') .attr('fill', 'black') .on("click", function() { color_option = 'node-oriented'; redraw(color_option); }); }; return render; });
<template name="signin"> <!-- Wrapper --> <div id="wrapper" style="z-index:2"> <!-- Main --> <section id="main"> <header> <span class="avatar"><img src="{{avator}}" alt="" /></span> <h1>{{userName}}</h1> </header> <section> <form> <ul> <li class="signup-extends"> <input type="text" name="name" placeholder="UserName/Telphone"/> </li> <li class="signup-extends"> <input type="password" name="password" placeholder="Input the password"/> </li> <li class="signup-extends"> <input type="submit" class="eventually-button" value="login"/> </li> </ul> </form> </section> <footer> <h3></h3> <ul class="identity-icons"> <li><a class="<API key>">Google</a></li> <li><a class="fa-weixin">Weixin</a></li> <li><a class="fa-weibo">Weibo</a></li> </ul> </footer> </section> </div> </template>
<HTML> <HEAD> <meta charset="UTF-8"> <title>BigDecimalIterator.nextBigDecimal - RichUtils</title> <link rel="stylesheet" href="../../../style.css"> </HEAD> <BODY> <a href="../../index.html">RichUtils</a>&nbsp;/&nbsp;<a href="../index.html">pyxis.uzuki.live.richutilskt.utils.progression</a>&nbsp;/&nbsp;<a href="index.html">BigDecimalIterator</a>&nbsp;/&nbsp;<a href=".">nextBigDecimal</a><br/> <br/> <h1>nextBigDecimal</h1> <a name="pyxis.uzuki.live.richutilskt.utils.progression.BigDecimalIterator$nextBigDecimal()"></a> <code><span class="keyword">abstract</span> <span class="keyword">fun </span><span class="identifier">nextBigDecimal</span><span class="symbol">(</span><span class="symbol">)</span><span class="symbol">: </span><a href="https://developer.android.com/reference/java/math/BigDecimal.html"><span class="identifier">BigDecimal</span></a></code> </BODY> </HTML>
package org.omg.CosNaming.<API key>; /** * org/omg/CosNaming/<API key>/<API key>.java . * Generated by the IDL-to-Java compiler (portable), version "3.2" * from ../../../../src/share/classes/org/omg/CosNaming/nameservice.idl * Friday, March 1, 2013 3:32:44 AM PST */ /** * Indicates the reason for not able to resolve. */ abstract public class <API key> { private static String _id = "IDL:omg.org/CosNaming/NamingContext/NotFoundReason:1.0"; public static void insert (org.omg.CORBA.Any a, org.omg.CosNaming.<API key>.NotFoundReason that) { org.omg.CORBA.portable.OutputStream out = a.<API key> (); a.type (type ()); write (out, that); a.read_value (out.create_input_stream (), type ()); } public static org.omg.CosNaming.<API key>.NotFoundReason extract (org.omg.CORBA.Any a) { return read (a.create_input_stream ()); } private static org.omg.CORBA.TypeCode __typeCode = null; synchronized public static org.omg.CORBA.TypeCode type () { if (__typeCode == null) { __typeCode = org.omg.CORBA.ORB.init ().create_enum_tc (org.omg.CosNaming.<API key>.<API key>.id (), "NotFoundReason", new String[] { "missing_node", "not_context", "not_object"} ); } return __typeCode; } public static String id () { return _id; } public static org.omg.CosNaming.<API key>.NotFoundReason read (org.omg.CORBA.portable.InputStream istream) { return org.omg.CosNaming.<API key>.NotFoundReason.from_int (istream.read_long ()); } public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CosNaming.<API key>.NotFoundReason value) { ostream.write_long (value.value ()); } }
#!/bin/bash set -e cd "$(dirname "$0")" if [[ ! -d venv ]]; then echo "venv not initialized!" >& 2 exit 1 fi CONFIG_PATH="$1" source venv/bin/activate ./godaddy-dyndns.py --config "$CONFIG_PATH"
<!DOCTYPE html> <html> <head> <title>p9-1</title> <meta http-equiv="X-UA-Compatible" content="IE=edge"/> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <meta name="<API key>" content="yes"/> <link href="resources/css/jquery-ui-themes.css" type="text/css" rel="stylesheet"/> <link href="resources/css/axure_rp_page.css" type="text/css" rel="stylesheet"/> <link href="data/styles.css" type="text/css" rel="stylesheet"/> <link href="files/p9-1__/styles.css" type="text/css" rel="stylesheet"/> <script src="resources/scripts/jquery-1.7.1.min.js"></script> <script src="resources/scripts/jquery-ui-1.8.10.custom.min.js"></script> <script src="resources/scripts/axure/axQuery.js"></script> <script src="resources/scripts/axure/globals.js"></script> <script src="resources/scripts/axutils.js"></script> <script src="resources/scripts/axure/annotation.js"></script> <script src="resources/scripts/axure/axQuery.std.js"></script> <script src="resources/scripts/axure/doc.js"></script> <script src="data/document.js"></script> <script src="resources/scripts/messagecenter.js"></script> <script src="resources/scripts/axure/events.js"></script> <script src="resources/scripts/axure/recording.js"></script> <script src="resources/scripts/axure/action.js"></script> <script src="resources/scripts/axure/expr.js"></script> <script src="resources/scripts/axure/geometry.js"></script> <script src="resources/scripts/axure/flyout.js"></script> <script src="resources/scripts/axure/ie.js"></script> <script src="resources/scripts/axure/model.js"></script> <script src="resources/scripts/axure/repeater.js"></script> <script src="resources/scripts/axure/sto.js"></script> <script src="resources/scripts/axure/utils.temp.js"></script> <script src="resources/scripts/axure/variables.js"></script> <script src="resources/scripts/axure/drag.js"></script> <script src="resources/scripts/axure/move.js"></script> <script src="resources/scripts/axure/visibility.js"></script> <script src="resources/scripts/axure/style.js"></script> <script src="resources/scripts/axure/adaptive.js"></script> <script src="resources/scripts/axure/tree.js"></script> <script src="resources/scripts/axure/init.temp.js"></script> <script src="files/p9-1__/data.js"></script> <script src="resources/scripts/axure/legacy.js"></script> <script src="resources/scripts/axure/viewer.js"></script> <script src="resources/scripts/axure/math.js"></script> <script type="text/javascript"> $axure.utils.<API key> = function() { return 'resources/images/transparent.gif'; }; $axure.utils.getOtherPath = function() { return 'resources/Other.html'; }; $axure.utils.getReloadPath = function() { return 'resources/reload.html'; }; </script> </head> <body> <div id="base" class=""> <!-- (Group) --> <div id="u4636" class="ax_default" data-label=""> <!-- Unnamed (Rectangle) --> <div id="u4637" class="ax_default box_1"> <div id="u4637_div" class=""></div> <!-- Unnamed () --> <div id="u4638" class="text" style="visibility: visible;"> <p><span style="font-family:'Arial Normal', 'Arial';font-weight:400;font-style:normal;font-size:13px;text-decoration:none;color:#333333;">&nbsp;</span></p> </div> </div> <!-- Unnamed (Rectangle) --> <div id="u4639" class="ax_default label"> <div id="u4639_div" class=""></div> <!-- Unnamed () --> <div id="u4640" class="text" style="visibility: visible;"> <p><span style="font-family:'Arial Negreta', 'Arial';font-weight:700;font-style:normal;font-size:14px;text-decoration:none;color:#333333;"></span></p> </div> </div> <!-- Unnamed (Rectangle) --> <div id="u4641" class="ax_default label"> <div id="u4641_div" class=""></div> <!-- Unnamed () --> <div id="u4642" class="text" style="visibility: visible;"> <p><span style="font-family:'Arial Negreta', 'Arial';font-weight:700;font-style:normal;font-size:14px;text-decoration:none;color:#333333;"></span></p> </div> </div> <!-- Unnamed (Rectangle) --> <div id="u4643" class="ax_default label"> <div id="u4643_div" class=""></div> <!-- Unnamed () --> <div id="u4644" class="text" style="visibility: visible;"> <p><span style="font-family:'Arial Negreta', 'Arial';font-weight:700;font-style:normal;font-size:14px;text-decoration:none;color:#333333;"></span></p> </div> </div> <!-- Unnamed (Rectangle) --> <div id="u4645" class="ax_default box_1"> <div id="u4645_div" class=""></div> <!-- Unnamed () --> <div id="u4646" class="text" style="display: none; visibility: hidden"> <p><span style="font-family:'Arial Normal', 'Arial';font-weight:400;font-style:normal;font-size:13px;text-decoration:none;color:#333333;"></span></p> </div> </div> <!-- Unnamed (Text Field) --> <div id="u4647" class="ax_default text_field"> <img id="u4647_image_sketch" class="img " src="images/p5-1/u1465_image_sketch.png" alt="u4647_image_sketch"/> <input id="u4647_input" type="text" value="" class="form_sketch text_sketch"/> </div> <!-- Unnamed (Rectangle) --> <div id="u4648" class="ax_default box_1"> <div id="u4648_div" class=""></div> <!-- Unnamed () --> <div id="u4649" class="text" style="display: none; visibility: hidden"> <p><span style="font-family:'Arial Normal', 'Arial';font-weight:400;font-style:normal;font-size:13px;text-decoration:none;color:#333333;"></span></p> </div> </div> <!-- Unnamed (Text Field) --> <div id="u4650" class="ax_default text_field"> <img id="u4650_image_sketch" class="img " src="images/p5-1/u1468_image_sketch.png" alt="u4650_image_sketch"/> <input id="u4650_input" type="text" value="" class="form_sketch text_sketch"/> </div> <!-- Unnamed (Rectangle) --> <div id="u4651" class="ax_default box_1"> <div id="u4651_div" class=""></div> <!-- Unnamed () --> <div id="u4652" class="text" style="display: none; visibility: hidden"> <p><span style="font-family:'Arial Normal', 'Arial';font-weight:400;font-style:normal;font-size:13px;text-decoration:none;color:#333333;"></span></p> </div> </div> <!-- Unnamed (Text Field) --> <div id="u4653" class="ax_default text_field"> <img id="u4653_image_sketch" class="img " src="images/p5-1/u1465_image_sketch.png" alt="u4653_image_sketch"/> <input id="u4653_input" type="text" value="" class="form_sketch text_sketch"/> </div> <!-- Unnamed (Rectangle) --> <div id="u4654" class="ax_default box_1"> <div id="u4654_div" class=""></div> <!-- Unnamed () --> <div id="u4655" class="text" style="visibility: visible;"> <p><span style="font-family:'Arial Normal', 'Arial';font-weight:400;font-style:normal;font-size:14px;text-decoration:none;color:#666666;"></span></p> </div> </div> <!-- Unnamed (Image) --> <div id="u4656" class="ax_default"> <img id="u4656_img" class="img " src="images/p4-1__/u989.png"/> <!-- Unnamed () --> <div id="u4657" class="text" style="display: none; visibility: hidden"> <p><span style="font-family:'IOS8-Icons Regular', 'IOS8-Icons';font-weight:400;font-style:normal;font-size:13px;text-decoration:none;color:#333333;"></span></p> </div> </div> <!-- Unnamed (Horizontal Line) --> <div id="u4658" class="ax_default line" WidgetHeight="1" WidgetWidth="638" WidgetCenterX="339" WidgetCenterY="64.5"> <div id="u4658p000" class="ax_vector_shape" WidgetTopLeftX="-0.498439937597504" WidgetTopLeftY="-0.166666666666667" WidgetTopRightX="0.496879875195008" WidgetTopRightY="-0.166666666666667" WidgetBottomLeftX="-0.498439937597504" WidgetBottomLeftY="0.166666666666667" WidgetBottomRightX="0.496879875195008" WidgetBottomRightY="0.166666666666667"> <img id="u4658p000_img" class="img " src="images/p4-1__/u991p000.png"/> </div> <!-- Unnamed () --> <div id="u4659" class="text" style="display: none; visibility: hidden"> <p><span style="font-family:'Arial Normal', 'Arial';font-weight:400;font-style:normal;font-size:13px;text-decoration:none;color:#333333;"></span></p> </div> </div> <!-- Unnamed (Rectangle) --> <div id="u4660" class="ax_default label"> <div id="u4660_div" class=""></div> <!-- Unnamed () --> <div id="u4661" class="text" style="visibility: visible;"> <p><span style="font-family:'Arial Negreta', 'Arial';font-weight:700;font-style:normal;font-size:18px;text-decoration:none;color:#333333;"></span></p> </div> </div> <!-- Unnamed (Rectangle) --> <div id="u4662" class="ax_default label"> <div id="u4662_div" class=""></div> <!-- Unnamed () --> <div id="u4663" class="text" style="visibility: visible;"> <p><span style="font-family:'Arial Negreta', 'Arial';font-weight:700;font-style:normal;font-size:14px;text-decoration:none;color:#333333;"></span></p> </div> </div> <!-- Unnamed (Rectangle) --> <div id="u4664" class="ax_default box_1"> <div id="u4664_div" class=""></div> <!-- Unnamed () --> <div id="u4665" class="text" style="display: none; visibility: hidden"> <p><span style="font-family:'Arial Normal', 'Arial';font-weight:400;font-style:normal;font-size:13px;text-decoration:none;color:#333333;"></span></p> </div> </div> <!-- Unnamed (Text Field) --> <div id="u4666" class="ax_default text_field"> <img id="u4666_image_sketch" class="img " src="images/p9-1__/u4666_image_sketch.png" alt="u4666_image_sketch"/> <input id="u4666_input" type="text" value="" class="form_sketch text_sketch"/> </div> <!-- Unnamed (Rectangle) --> <div id="u4667" class="ax_default label"> <div id="u4667_div" class=""></div> <!-- Unnamed () --> <div id="u4668" class="text" style="visibility: visible;"> <p><span style="font-family:'Arial Negreta', 'Arial';font-weight:700;font-style:normal;font-size:14px;text-decoration:none;color:#333333;"></span></p> </div> </div> <!-- Unnamed (Rectangle) --> <div id="u4669" class="ax_default box_1"> <div id="u4669_div" class=""></div> <!-- Unnamed () --> <div id="u4670" class="text" style="display: none; visibility: hidden"> <p><span style="font-family:'Arial Normal', 'Arial';font-weight:400;font-style:normal;font-size:13px;text-decoration:none;color:#333333;"></span></p> </div> </div> <!-- Unnamed (Text Field) --> <div id="u4671" class="ax_default text_field"> <img id="u4671_image_sketch" class="img " src="images/p9-1__/u4666_image_sketch.png" alt="u4671_image_sketch"/> <input id="u4671_input" type="text" value="" class="form_sketch text_sketch"/> </div> </div> </div> </body> </html>
/* * DO NOT EDIT. THIS FILE IS GENERATED FROM ../../../dist/idl\<API key>.idl */ #ifndef <API key> #define <API key> #ifndef <API key> #include "nsISupports.h" #endif /* For IDL files that don't want to include root IDL files. */ #ifndef NS_NO_VTABLE #define NS_NO_VTABLE #endif class nsIDocShell; /* forward declaration */ class nsIDOMWindow; /* forward declaration */ /* starting interface: <API key> */ #define <API key> "<API key>" #define <API key> \ {0xe439d3eb, 0xb1ed, 0x449c, \ { 0xaa, 0xf7, 0xc6, 0x93, 0xe3, 0x99, 0xb1, 0x6f }} class NS_NO_VTABLE <API key> : public nsISupports { public: <API key>(<API key>) /* void showStatusString (in wstring status); */ NS_IMETHOD ShowStatusString(const char16_t * status) = 0; /* void startMeteors (); */ NS_IMETHOD StartMeteors(void) = 0; /* void stopMeteors (); */ NS_IMETHOD StopMeteors(void) = 0; /* void showProgress (in long percent); */ NS_IMETHOD ShowProgress(int32_t percent) = 0; /* [noscript] void setDocShell (in nsIDocShell shell, in nsIDOMWindow window); */ NS_IMETHOD SetDocShell(nsIDocShell *shell, nsIDOMWindow *window) = 0; /* void closeWindow (); */ NS_IMETHOD CloseWindow(void) = 0; }; <API key>(<API key>, <API key>) /* Use this macro when declaring classes that implement this interface. */ #define <API key> \ NS_IMETHOD ShowStatusString(const char16_t * status) override; \ NS_IMETHOD StartMeteors(void) override; \ NS_IMETHOD StopMeteors(void) override; \ NS_IMETHOD ShowProgress(int32_t percent) override; \ NS_IMETHOD SetDocShell(nsIDocShell *shell, nsIDOMWindow *window) override; \ NS_IMETHOD CloseWindow(void) override; /* Use this macro to declare functions that forward the behavior of this interface to another object. */ #define <API key>(_to) \ NS_IMETHOD ShowStatusString(const char16_t * status) override { return _to ShowStatusString(status); } \ NS_IMETHOD StartMeteors(void) override { return _to StartMeteors(); } \ NS_IMETHOD StopMeteors(void) override { return _to StopMeteors(); } \ NS_IMETHOD ShowProgress(int32_t percent) override { return _to ShowProgress(percent); } \ NS_IMETHOD SetDocShell(nsIDocShell *shell, nsIDOMWindow *window) override { return _to SetDocShell(shell, window); } \ NS_IMETHOD CloseWindow(void) override { return _to CloseWindow(); } /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ #define <API key>(_to) \ NS_IMETHOD ShowStatusString(const char16_t * status) override { return !_to ? <API key> : _to->ShowStatusString(status); } \ NS_IMETHOD StartMeteors(void) override { return !_to ? <API key> : _to->StartMeteors(); } \ NS_IMETHOD StopMeteors(void) override { return !_to ? <API key> : _to->StopMeteors(); } \ NS_IMETHOD ShowProgress(int32_t percent) override { return !_to ? <API key> : _to->ShowProgress(percent); } \ NS_IMETHOD SetDocShell(nsIDocShell *shell, nsIDOMWindow *window) override { return !_to ? <API key> : _to->SetDocShell(shell, window); } \ NS_IMETHOD CloseWindow(void) override { return !_to ? <API key> : _to->CloseWindow(); } #if 0 /* Use the code below as a template for the implementation class for this interface. */ /* Header file */ class <API key> : public <API key> { public: NS_DECL_ISUPPORTS <API key> <API key>(); private: ~<API key>(); protected: /* additional members */ }; /* Implementation file */ NS_IMPL_ISUPPORTS(<API key>, <API key>) <API key>::<API key>() { /* member initializers and constructor code */ } <API key>::~<API key>() { /* destructor code */ } /* void showStatusString (in wstring status); */ NS_IMETHODIMP <API key>::ShowStatusString(const char16_t * status) { return <API key>; } /* void startMeteors (); */ NS_IMETHODIMP <API key>::StartMeteors() { return <API key>; } /* void stopMeteors (); */ NS_IMETHODIMP <API key>::StopMeteors() { return <API key>; } /* void showProgress (in long percent); */ NS_IMETHODIMP <API key>::ShowProgress(int32_t percent) { return <API key>; } /* [noscript] void setDocShell (in nsIDocShell shell, in nsIDOMWindow window); */ NS_IMETHODIMP <API key>::SetDocShell(nsIDocShell *shell, nsIDOMWindow *window) { return <API key>; } /* void closeWindow (); */ NS_IMETHODIMP <API key>::CloseWindow() { return <API key>; } /* End of implementation class template. */ #endif #endif /* <API key> */
#!/usr/bin/python -W all """ combineCsv.py: adapt values in a csv file based on values in a second file usage: combineCsv.py [-c] -k column -v column -F file2 -K column -V column < file1 notes: changes values in column v of file1 to value in column V of file2 when values in key columns k and K match option -c will invoke printing only changed rows (default: print all) 20170608 erikt(at)xs4all.nl """ import csv import getopt import re import sys # definition constants COMMAND = sys.argv.pop(0) NONE = -1 USAGE = COMMAND+": -k column -v column -F file2 -K column -V column < file1" # definition variables file1keyColumn = NONE file1valueColumn = NONE file2name = "" file2keyColumn = NONE file2valueColumn = NONE changedSelect = False def readCsv(fileName,keyColumn,valueColumn): data = {} with open(fileName,"rb") as csvfile: csvreader = csv.reader(csvfile,delimiter=',',quotechar='"') for row in csvreader: if len(row) < keyColumn or len(row) < valueColumn: sys.exit(COMMAND+": unexpected line in file "+fileName+": "+(",".join(row))+"\n") # store key-value pair; do nothing special for heading data[row[keyColumn-1]] = row[valueColumn-1] csvfile.close() return(data) def main(argv): global changedSelect,file1keyColumn,file1valueColumn,file2name,file2keyColumn,file2valueColumn # process command line arguments try: options = getopt.getopt(argv,"ck:v:F:K:V:",[]) except: sys.exit(USAGE) for option in options[0]: if option[0] == "-k": file1keyColumn = int(option[1]) elif option[0] == "-v": file1valueColumn = int(option[1]) elif option[0] == "-F": file2name = option[1] elif option[0] == "-K": file2keyColumn= int(option[1]) elif option[0] == "-V": file2valueColumn = int(option[1]) elif option[0] == "-c": changedSelect = True if file1keyColumn == NONE or file1valueColumn == NONE or \ file2name == "" or file2keyColumn == NONE or file2valueColumn == NONE: sys.exit(USAGE) # read csv data from file 2, return as dictionary: file2[key] = value file2 = readCsv(file2name,file2keyColumn,file2valueColumn); # process csv data from stdin (file1) csvreader = csv.reader(sys.stdin,delimiter=',',quotechar='"') csvwriter = csv.writer(sys.stdout,delimiter=',',quotechar='"') for row in csvreader: # check if expected columns are present if len(row) < file1keyColumn or len(row) < file1valueColumn: sys.exit(COMMAND+": unexpected line in stdin: "+(','.join(row))+"\n") if row[file1keyColumn-1] in file2: row[file1valueColumn-1] = file2[row[file1keyColumn-1]] # print this changed row if changedSelect flag is set if changedSelect: csvwriter.writerow(row) # print every row if changedSelect flag is not set if not changedSelect: csvwriter.writerow(row) if __name__ == "__main__": sys.exit(main(sys.argv))
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import oauth2client.django_orm class Migration(migrations.Migration): dependencies = [ ('sites', '0001_initial'), ] operations = [ migrations.CreateModel( name='Profile', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('web_property_id', models.CharField(help_text='The property tracking ID is available when viewing the "Tracking Code" details in the Google Analytics admin.', max_length=25, verbose_name='property tracking ID')), ('profile_id', models.CharField(default='', max_length=25, verbose_name='view (profile) ID', blank=True)), ('display_features', models.BooleanField(default=False, help_text='Used for remarketing, demographics and interest reporting.', verbose_name='Use Display advertising features?')), ('is_enabled', models.BooleanField(default=False, help_text='Is Google Analytics tracking enabled on the website?', verbose_name='enabled')), ], options={ 'ordering': ['site'], 'verbose_name': 'view (profile)', 'verbose_name_plural': 'views (profiles)', }, ), migrations.CreateModel( name='<API key>', fields=[ ('id', models.OneToOneField(related_name='_oauth2_credentials', primary_key=True, serialize=False, to='googleanalytics.Profile')), ('credentials', oauth2client.django_orm.CredentialsField(null=True)), ], ), migrations.AddField( model_name='profile', name='site', field=models.OneToOneField(related_name='+', to='sites.Site'), ), ]
define(function() { mocha.setup('bdd'); /** @test {InternalOpenGateAPI#bundlesBuilder()} */ describe('Check funcionality bundles module:', function() { var bundle; before(function() { bundle = ogapi.bundlesBuilder(); }); /** @test {InternalOpenGateAPI#bundlesBuilder} */ /* it('Delete a bundle', function() { assert.doesNotThrow(function() { bundle.delete(); }); });*/ }); /* describe('Check Deployment Element:', function() { it('Check constructor Deployment Element', function() { assert.throws(function() { ogapi.bundlesBuilder().<API key>(); }, "Parameters name, version must be defined"); }); it('Deploy element', function() { assert.doesNotThrow(function() { ogapi.bundlesBuilder().withName('bundle_testing').withVersion('V1').<API key>(); }); }); describe('Check Deployment Element basic elements:', function() { var deploymentElement; before(function() { deploymentElement = ogapi.bundlesBuilder().withName('bundle_testing').withVersion('V1').<API key>(); }); it('Check parameter name', function() { assert.throws(function() { deploymentElement.withName(111); }, "Parameter name must be a string and has a maximum length of 50"); }); it('Check parameter version', function() { assert.throws(function() { deploymentElement.withVersion(111); }, "Parameter version must be a string and has a maximum length of 50"); }); it('Check parameter Type', function() { assert.throws(function() { deploymentElement.withType(111); }, "Parameter type must be typeof string"); }); it('Check parameter Type', function() { assert.throws(function() { deploymentElement.withType("Type"); }, 'Parameter type is not allowed. Parameter value <\'"Type"\'>, type allowed <\'["SOFTWARE","FIRMWARE","CONFIGURATION","PARAMETERS"]\'>'); }); it('Check parameter Path', function() { assert.throws(function() { deploymentElement.withPath(111); }, "Parameter path must be a string"); }); it('Check parameter Order', function() { assert.doesNotThrow(function() { deploymentElement.withOrder(111); }); }); it('Check parameter Operation', function() { assert.throws(function() { deploymentElement.withOperation(111); }, "Parameter operation must be typeof string"); }); it('Check parameter Operation', function() { assert.throws(function() { deploymentElement.withOperation("OPERATION"); }, 'Parameter operation is not allowed. Parameter value <\'"OPERATION"\'>, operation allowed <\'["INSTALL","UNINSTALL","UPGRADE"]\'>'); }); it('Check parameter Option', function() { assert.throws(function() { deploymentElement.withOption(111); }, "Parameter option must be typeof string"); }); it('Check parameter Option', function() { assert.throws(function() { deploymentElement.withOption("option"); }, 'Parameter option is not allowed. Parameter value <\'"option"\'>, option allowed <\'["MANDATORY","OPTIONAL"]\'>'); }); it('Check parameter Validator is an Array', function() { assert.throws(function() { deploymentElement.withValidators(""); }, 'Parameter validators must be typeof Array'); }); it('Check parameter Validator have at least one element', function() { assert.doesNotThrow(function() { deploymentElement.withValidators([]); }); }); it('Check parameter type in validator is a string', function() { var validators = [{ type: 1, value: "", mode: "" }]; assert.throws(function() { deploymentElement.withValidators(validators); }, 'Parameter type must be typeof string'); }); it('Check parameter type in validator have a correct value', function() { var validators = [{ type: "SHA-1" }]; assert.doesNotThrow(function() { deploymentElement.withValidators(validators); }); }); it('Check parameter type in validator is typeof string', function() { var validators = [{ type: "SHA-1", value: 1 }]; assert.throws(function() { deploymentElement.withValidators(validators); }, 'Parameter value must be a string'); }); it('Check parameter mode in validator is typeof string', function() { var validators = [{ type: "SHA-1", value: "", mode: 1 }]; assert.throws(function() { deploymentElement.withValidators(validators); }, 'Parameter mode must be a string'); }); it('Check parameter mode in validator is typeof string', function() { var validators = [{ type: "SHA-1", value: "", mode: "" }, { type: "MD5", value: "", mode: 1 }]; assert.throws(function() { deploymentElement.withValidators(validators); }, 'Parameter mode must be a string'); }); it('Check parameter DownloadUrl', function() { assert.throws(function() { deploymentElement.withDownloadUrl(111); }, "Parameter downloadUrl must be a string"); }); it('Check parameter FileName', function() { assert.throws(function() { deploymentElement.withFileName(111); }, "Parameter fileName must be a string"); }); }); describe('Check DeploymentElement basic elements:', function() { var deploymentElement; before(function() { bundle = ogapi.bundlesBuilder(); bundle.withName('bundle_testing_2').withVersion('V1').withWorkgroup('baseWorkGroup').withHardware("OWA21"); try { bundle.delete(); } catch (error) { }; bundle.create(); deploymentElement = bundle.<API key>(); }); it('Define a deployment element', function() { assert.throws(function() { deploymentElement.withName(1); }, "Parameter name must be a string"); }); it('Create a deployment element', function() { assert.throws(function() { deploymentElement.withVersion("<API key>").create(); }, "Method not allowed - You must define the basic element [name, version, type, path, order and operation]"); }); it('Check urls:', function() { assert.strictEqual(deploymentElement._url, 'provision/bundles/bundle_testing_2/versions/V1/deploymentElements'); }); it('Create a deployment element', function() { var file = new Blob(["bundle ejemplo"], { type: 'text/plain' }); assert.doesNotThrow(function() { deploymentElement.withName("file_1").withVersion("1").withType("SOFTWARE") .withPath("/").withOrder("1").withOperation("INSTALL").withDownloadUrl("/") .withValidators([{ "type": "SHA-1", "value": "123" }]).withOption("OPTIONAL").create(file); }); bundle.activate(); }); }); }); });*/ });
<!DOCTYPE html> <html lang="en"> <! Date: 26-Apr-17 Time: 8:27 AM <head> <meta charset="utf-8" /> <title>PWP for Jeffrey Cooper - Milestone 1</title> <!-- Custom CSS --> <link rel="stylesheet" href="<API key>.css" type="text/css" /> </head> <body> <header> <h1>PWP for Jeffrey Cooper</h1> <h2>Milestone 1</h2> </header> <main> <h3>Purpose</h3> <!--Write at least one sentence to address each of the following using valid HTML markup. <p>I need a website that is flexible enough to use for all of the following scenarios:</p> <ol> <li>Resume: Send prospective employers to this site so they can learn about my coding experience with sample websites, my education, my previous experience in other industries and my life interests.</li> <li>Clients: Send prospective clients to this site to discover my capabilities, previous clients and referrals, as well as my personal interests.</li> <li>Network: Send new contacts with which I hope to build a networking relationship so they can learn about my history, my interests, my current work related activities and my contact information.</li> </ol> <!--2. Audience: Who will be using or viewing your site? Who is this site designed for, and who is your audience comprised of? Could it be for your professional peers and other developers, potential employers, customers, or clients, etc.? <h3>Audience</h3> <p>My audience will be prospective clients, potential employers, peers in web development, peers in previous industries.</p> <!--3. Goal: This is should be a quantifiable goal if possible. For example, a goal for your PWP could be: -To acquire full or part-time employment or an internship. -To increase sales and/or conversion rates for an existing business. -To attract freelance clients. -To serve as a gallery to showcase and promote your work. -To increase the reach of a new or established social media presence (as measured via analytics tools). <h3>Goals</h3> <ol> <li>To acquire employment.</li> <li>To attract freelance clients.</li> <li>To promote myself for potential part-time jobs in the music industry.</li> <li>To serve as a repository for past projects, performances and classes/workshops I've presented.</li> <li>To advertise current business that I am involved in.</li> </ol> <h3>PERSONA</h3> <!--Define one persona that represents the primary target audience for your Personal Website. More information on how to create a persona for your project here: http: Your persona should feature the following at minimum: Name - A detailed description that includes demographic information such as: age, job or role, relevant technology being used, behaviors and attitudes, and the situation or scenario in which they will use your site. - Goal(s) regarding the use of your site. Additional information regarding your persona may also include: - Frustrations your persona may be facing. - Additional information your persona may need in order to achieve their goal. <h3>Jerry Foster</h3> <ol> <li>Age: 59</li> <li>Job: Director of Music Ministries</li> <li>Technologies: Windows 10, iPhone</li> <li>Attitude: Luddite with technology.</li> <li>Behavior: Desire to integrate her groups with the internet</li> <li>Goals: Learn about my skills as a web developer. See some sample sites. Consider hiring me to build a new website for her choirs.</li> <li>Potential: Well connected in the Albuquerque Choral Music scene. Potential for referrals is high. She can easy send other potential clients to this site.</li> </ol> <h3>USE CASE</h3> <p>Jerry knows about me already and likes my services. She is speaking with a potential referral client at a city wide workshop for community choirs. She wants to introduce my services, so she pulls out her iPhone and attempts to show my site to the potential client, including sample web pages, musical background and contact information.</p> </main> </body> </html>
package com.crawljax.plugins.testilizer.casestudies.eshop.originaltests; import java.util.regex.Pattern; import java.util.concurrent.TimeUnit; import org.junit.*; import static org.junit.Assert.*; import static org.hamcrest.CoreMatchers.*; import org.openqa.selenium.*; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.support.ui.Select; public class <API key> { private WebDriver driver; private String baseUrl; private boolean acceptNextAlert = true; private StringBuffer verificationErrors = new StringBuffer(); @Before public void setUp() throws Exception { driver = new FirefoxDriver(); baseUrl = "https://localhost:9443/"; driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); } @Test public void <API key>() throws Exception { driver.get(baseUrl + "/store/assets/gadget"); driver.findElement(By.xpath("//a[contains(text(),\"userAddedAsset\")]")).click(); try { assertEquals("by tenantUser", driver.findElement(By.xpath("//div[@id='container-assets']//small[2]")).getText()); } catch (Error e) { verificationErrors.append(e.toString()); } } @After public void tearDown() throws Exception { driver.quit(); String <API key> = verificationErrors.toString(); if (!"".equals(<API key>)) { fail(<API key>); } } private boolean isElementPresent(By by) { try { driver.findElement(by); return true; } catch (<API key> e) { return false; } } private boolean isAlertPresent() { try { driver.switchTo().alert(); return true; } catch (<API key> e) { return false; } } private String <API key>() { try { Alert alert = driver.switchTo().alert(); String alertText = alert.getText(); if (acceptNextAlert) { alert.accept(); } else { alert.dismiss(); } return alertText; } finally { acceptNextAlert = true; } } }
/** * <API key>.java * @author Vagisha Sharma * Sep 5, 2008 * @version 1.0 */ package org.yeastrc.ms.domain.search; public interface <API key> extends <API key> { public abstract int getModifiedPosition(); }
package com.alibaba.otter.canal.client.adapter.es7x; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Properties; import javax.sql.DataSource; import org.elasticsearch.action.search.SearchResponse; import com.alibaba.otter.canal.client.adapter.es.core.ESAdapter; import com.alibaba.otter.canal.client.adapter.es.core.config.ESSyncConfig; import com.alibaba.otter.canal.client.adapter.es7x.etl.ESEtlService; import com.alibaba.otter.canal.client.adapter.es7x.support.ES7xTemplate; import com.alibaba.otter.canal.client.adapter.es7x.support.ESConnection; import com.alibaba.otter.canal.client.adapter.support.DatasourceConfig; import com.alibaba.otter.canal.client.adapter.support.EtlResult; import com.alibaba.otter.canal.client.adapter.support.OuterAdapterConfig; import com.alibaba.otter.canal.client.adapter.support.SPI; /** * ES 7.x * * @author rewerma 2019-09-23 * @version 1.0.0 */ @SPI("es7") public class ES7xAdapter extends ESAdapter { private ESConnection esConnection; public ESConnection getEsConnection() { return esConnection; } @Override public void init(OuterAdapterConfig configuration, Properties envProperties) { try { Map<String, String> properties = configuration.getProperties(); String[] hostArray = configuration.getHosts().split(","); String mode = properties.get("mode"); if ("rest".equalsIgnoreCase(mode) || "http".equalsIgnoreCase(mode)) { esConnection = new ESConnection(hostArray, properties, ESConnection.ESClientMode.REST); } else { esConnection = new ESConnection(hostArray, properties, ESConnection.ESClientMode.TRANSPORT); } this.esTemplate = new ES7xTemplate(esConnection); envProperties.put("es.version", "es7"); super.init(configuration, envProperties); } catch (Throwable e) { throw new RuntimeException(e); } } @Override public Map<String, Object> count(String task) { ESSyncConfig config = esSyncConfig.get(task); ESSyncConfig.ESMapping mapping = config.getEsMapping(); SearchResponse response = this.esConnection.new ESSearchRequest(mapping.get_index()).size(0).getResponse(); long rowCount = response.getHits().getTotalHits().value; Map<String, Object> res = new LinkedHashMap<>(); res.put("esIndex", mapping.get_index()); res.put("count", rowCount); return res; } @Override public EtlResult etl(String task, List<String> params) { EtlResult etlResult = new EtlResult(); ESSyncConfig config = esSyncConfig.get(task); if (config != null) { DataSource dataSource = DatasourceConfig.DATA_SOURCES.get(config.getDataSourceKey()); ESEtlService esEtlService = new ESEtlService(esConnection, config); if (dataSource != null) { return esEtlService.importData(params); } else { etlResult.setSucceeded(false); etlResult.setErrorMessage("DataSource not found"); return etlResult; } } else { StringBuilder resultMsg = new StringBuilder(); boolean resSuccess = true; for (ESSyncConfig configTmp : esSyncConfig.values()) { // destinationtask if (configTmp.getDestination().equals(task)) { ESEtlService esEtlService = new ESEtlService(esConnection, configTmp); EtlResult etlRes = esEtlService.importData(params); if (!etlRes.getSucceeded()) { resSuccess = false; resultMsg.append(etlRes.getErrorMessage()).append("\n"); } else { resultMsg.append(etlRes.getResultMessage()).append("\n"); } } } if (resultMsg.length() > 0) { etlResult.setSucceeded(resSuccess); if (resSuccess) { etlResult.setResultMessage(resultMsg.toString()); } else { etlResult.setErrorMessage(resultMsg.toString()); } return etlResult; } } etlResult.setSucceeded(false); etlResult.setErrorMessage("Task not found"); return etlResult; } @Override public void destroy() { super.destroy(); if (esConnection != null) { esConnection.close(); } } }
<!DOCTYPE HTML PUBLIC "- <!--NewPage <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_43) on Tue Apr 09 16:55:12 ICT 2013 --> <TITLE> Uses of Class org.apache.hadoop.fs.BlockLocation (Hadoop 1.0.4-SNAPSHOT API) </TITLE> <META NAME="date" CONTENT="2013-04-09"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.apache.hadoop.fs.BlockLocation (Hadoop 1.0.4-SNAPSHOT API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <A NAME="navbar_top"></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../org/apache/hadoop/fs/BlockLocation.html" title="class in org.apache.hadoop.fs"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/apache/hadoop/fs//<API key>.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="BlockLocation.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <! if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <HR> <CENTER> <H2> <B>Uses of Class<br>org.apache.hadoop.fs.BlockLocation</B></H2> </CENTER> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Packages that use <A HREF="../../../../../org/apache/hadoop/fs/BlockLocation.html" title="class in org.apache.hadoop.fs">BlockLocation</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.apache.hadoop.fs"><B>org.apache.hadoop.fs</B></A></TD> <TD>An abstract file system API.&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.apache.hadoop.fs.kfs"><B>org.apache.hadoop.fs.kfs</B></A></TD> <TD>A client for the Kosmos filesystem (KFS)&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.apache.hadoop.mapred"><B>org.apache.hadoop.mapred</B></A></TD> <TD>A software framework for easily writing applications which process vast amounts of data (multi-terabyte data-sets) parallelly on large clusters (thousands of nodes) built of commodity hardware in a reliable, fault-tolerant manner.&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.apache.hadoop.mapreduce.lib.input"><B>org.apache.hadoop.mapreduce.lib.input</B></A></TD> <TD>&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.apache.hadoop.fs"></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../org/apache/hadoop/fs/BlockLocation.html" title="class in org.apache.hadoop.fs">BlockLocation</A> in <A HREF="../../../../../org/apache/hadoop/fs/package-summary.html">org.apache.hadoop.fs</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="<API key>"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../org/apache/hadoop/fs/package-summary.html">org.apache.hadoop.fs</A> that return <A HREF="../../../../../org/apache/hadoop/fs/BlockLocation.html" title="class in org.apache.hadoop.fs">BlockLocation</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../org/apache/hadoop/fs/BlockLocation.html" title="class in org.apache.hadoop.fs">BlockLocation</A>[]</CODE></FONT></TD> <TD><CODE><B>HarFileSystem.</B><B><A HREF="../../../../../org/apache/hadoop/fs/HarFileSystem.html#<API key>(org.apache.hadoop.fs.FileStatus, long, long)"><API key></A></B>(<A HREF="../../../../../org/apache/hadoop/fs/FileStatus.html" title="class in org.apache.hadoop.fs">FileStatus</A>&nbsp;file, long&nbsp;start, long&nbsp;len)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get block locations from the underlying fs and fix their offsets and lengths.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../org/apache/hadoop/fs/BlockLocation.html" title="class in org.apache.hadoop.fs">BlockLocation</A>[]</CODE></FONT></TD> <TD><CODE><B>FilterFileSystem.</B><B><A HREF="../../../../../org/apache/hadoop/fs/FilterFileSystem.html#<API key>(org.apache.hadoop.fs.FileStatus, long, long)"><API key></A></B>(<A HREF="../../../../../org/apache/hadoop/fs/FileStatus.html" title="class in org.apache.hadoop.fs">FileStatus</A>&nbsp;file, long&nbsp;start, long&nbsp;len)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../org/apache/hadoop/fs/BlockLocation.html" title="class in org.apache.hadoop.fs">BlockLocation</A>[]</CODE></FONT></TD> <TD><CODE><B>FileSystem.</B><B><A HREF="../../../../../org/apache/hadoop/fs/FileSystem.html#<API key>(org.apache.hadoop.fs.FileStatus, long, long)"><API key></A></B>(<A HREF="../../../../../org/apache/hadoop/fs/FileStatus.html" title="class in org.apache.hadoop.fs">FileStatus</A>&nbsp;file, long&nbsp;start, long&nbsp;len)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return an array containing hostnames, offset and size of portions of the given file.</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.apache.hadoop.fs.kfs"></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../org/apache/hadoop/fs/BlockLocation.html" title="class in org.apache.hadoop.fs">BlockLocation</A> in <A HREF="../../../../../org/apache/hadoop/fs/kfs/package-summary.html">org.apache.hadoop.fs.kfs</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="<API key>"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../org/apache/hadoop/fs/kfs/package-summary.html">org.apache.hadoop.fs.kfs</A> that return <A HREF="../../../../../org/apache/hadoop/fs/BlockLocation.html" title="class in org.apache.hadoop.fs">BlockLocation</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../../org/apache/hadoop/fs/BlockLocation.html" title="class in org.apache.hadoop.fs">BlockLocation</A>[]</CODE></FONT></TD> <TD><CODE><B>KosmosFileSystem.</B><B><A HREF="../../../../../org/apache/hadoop/fs/kfs/KosmosFileSystem.html#<API key>(org.apache.hadoop.fs.FileStatus, long, long)"><API key></A></B>(<A HREF="../../../../../org/apache/hadoop/fs/FileStatus.html" title="class in org.apache.hadoop.fs">FileStatus</A>&nbsp;file, long&nbsp;start, long&nbsp;len)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return null if the file doesn't exist; otherwise, get the locations of the various chunks of the file file from KFS.</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.apache.hadoop.mapred"></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../org/apache/hadoop/fs/BlockLocation.html" title="class in org.apache.hadoop.fs">BlockLocation</A> in <A HREF="../../../../../org/apache/hadoop/mapred/package-summary.html">org.apache.hadoop.mapred</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="<API key>"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../org/apache/hadoop/mapred/package-summary.html">org.apache.hadoop.mapred</A> with parameters of type <A HREF="../../../../../org/apache/hadoop/fs/BlockLocation.html" title="class in org.apache.hadoop.fs">BlockLocation</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected &nbsp;int</CODE></FONT></TD> <TD><CODE><B>FileInputFormat.</B><B><A HREF="../../../../../org/apache/hadoop/mapred/FileInputFormat.html#getBlockIndex(org.apache.hadoop.fs.BlockLocation[], long)">getBlockIndex</A></B>(<A HREF="../../../../../org/apache/hadoop/fs/BlockLocation.html" title="class in org.apache.hadoop.fs">BlockLocation</A>[]&nbsp;blkLocations, long&nbsp;offset)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected &nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>[]</CODE></FONT></TD> <TD><CODE><B>FileInputFormat.</B><B><A HREF="../../../../../org/apache/hadoop/mapred/FileInputFormat.html#getSplitHosts(org.apache.hadoop.fs.BlockLocation[], long, long, org.apache.hadoop.net.NetworkTopology)">getSplitHosts</A></B>(<A HREF="../../../../../org/apache/hadoop/fs/BlockLocation.html" title="class in org.apache.hadoop.fs">BlockLocation</A>[]&nbsp;blkLocations, long&nbsp;offset, long&nbsp;splitSize, <A HREF="../../../../../org/apache/hadoop/net/NetworkTopology.html" title="class in org.apache.hadoop.net">NetworkTopology</A>&nbsp;clusterMap)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This function identifies and returns the hosts that contribute most for a given split.</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.apache.hadoop.mapreduce.lib.input"></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../org/apache/hadoop/fs/BlockLocation.html" title="class in org.apache.hadoop.fs">BlockLocation</A> in <A HREF="../../../../../org/apache/hadoop/mapreduce/lib/input/package-summary.html">org.apache.hadoop.mapreduce.lib.input</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="<API key>"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../org/apache/hadoop/mapreduce/lib/input/package-summary.html">org.apache.hadoop.mapreduce.lib.input</A> that return <A HREF="../../../../../org/apache/hadoop/fs/BlockLocation.html" title="class in org.apache.hadoop.fs">BlockLocation</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected &nbsp;<A HREF="../../../../../org/apache/hadoop/fs/BlockLocation.html" title="class in org.apache.hadoop.fs">BlockLocation</A>[]</CODE></FONT></TD> <TD><CODE><B><API key>.</B><B><A HREF="../../../../../org/apache/hadoop/mapreduce/lib/input/<API key>.html#<API key>(org.apache.hadoop.fs.FileSystem, org.apache.hadoop.fs.FileStatus)"><API key></A></B>(<A HREF="../../../../../org/apache/hadoop/fs/FileSystem.html" title="class in org.apache.hadoop.fs">FileSystem</A>&nbsp;fs, <A HREF="../../../../../org/apache/hadoop/fs/FileStatus.html" title="class in org.apache.hadoop.fs">FileStatus</A>&nbsp;stat)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="<API key>"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../org/apache/hadoop/mapreduce/lib/input/package-summary.html">org.apache.hadoop.mapreduce.lib.input</A> with parameters of type <A HREF="../../../../../org/apache/hadoop/fs/BlockLocation.html" title="class in org.apache.hadoop.fs">BlockLocation</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected &nbsp;int</CODE></FONT></TD> <TD><CODE><B>FileInputFormat.</B><B><A HREF="../../../../../org/apache/hadoop/mapreduce/lib/input/FileInputFormat.html#getBlockIndex(org.apache.hadoop.fs.BlockLocation[], long)">getBlockIndex</A></B>(<A HREF="../../../../../org/apache/hadoop/fs/BlockLocation.html" title="class in org.apache.hadoop.fs">BlockLocation</A>[]&nbsp;blkLocations, long&nbsp;offset)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <HR> <A NAME="navbar_bottom"></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="<API key>"></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../org/apache/hadoop/fs/BlockLocation.html" title="class in org.apache.hadoop.fs"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/apache/hadoop/fs//<API key>.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="BlockLocation.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <! if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <HR> Copyright &copy; 2009 The Apache Software Foundation </BODY> </HTML>
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/ads/googleads/v10/enums/<API key>.proto package com.google.ads.googleads.v10.enums; public interface <API key> extends // @@<API key>(interface_extends:google.ads.googleads.v10.enums.<API key>) com.google.protobuf.MessageOrBuilder { }
/** * Helios Development Group LLC, 2010 */ package com.heliosapm.utils.instrumentation.measure; /** * <p>Title: AbstractMeasurer</p> * <p>Description: Base class for concrete measurers</p> * <p>Company: Helios Development Group LLC</p> * @author Whitehead * <p><code>com.heliosapm.utils.instrumentation.measure.AbstractMeasurer</code></p> */ public abstract class AbstractMeasurer implements Measurer { /** Valid int powers of 2 */ protected static final int[] POWS_OF_TWO = new int[]{2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,131072,262144,524288,1048576,2097152,4194304,8388608,16777216,33554432,67108864,134217728,268435456,536870912,1073741824}; /** The metric ordinal this measurer reads and writes */ protected final int metricOrdinal; /** The bit mask that represents this measurer */ protected final int bitMask; /** * Creates a new AbstractMeasurer * @param metricOrdinal The metric ordinal this measurer reads and writes */ public AbstractMeasurer(final int metricOrdinal) { this.metricOrdinal = metricOrdinal; this.bitMask = metricOrdinal<0 ? -1 : POWS_OF_TWO[metricOrdinal]; } /** * {@inheritDoc} * @see com.heliosapm.shorthand.collectors.measurers.Measurer#getOrdinal() */ @Override public int getOrdinal() { return metricOrdinal; } }
using System; using Google.GData.Client; using Google.GData.Extensions.Apps; namespace Google.GData.Apps.Migration { <summary> Feed API customization class for defining the Google Apps Domain Migration API's mail item feed. </summary> public class MailItemFeed : AbstractFeed { <summary> Constructor </summary> <param name="uriBase">The uri for the migration feed.</param> <param name="iService">The migration service.</param> public MailItemFeed(Uri uriBase, IService iService) : base(uriBase, iService) { GAppsExtensions.<API key>(this); } <summary> Overridden. Creates a new <code>MailItemEntry</code>. </summary> <returns>the new <code>MailItemEntry</code>.</returns> public override AtomEntry CreateFeedEntry() { return new MailItemEntry(); } <summary> Gets called after we handled the custom entry, to handle other potential parsing tasks </summary> <param name="e"></param> <param name="parser"></param> protected override void <API key>(<API key> e, AtomFeedParser parser) { base.<API key>(e, parser); } } }
package ca.qc.bergeron.marcantoine.crammeur.librairy.repository.crud; import com.google.gson.Gson; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.<API key>; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import ca.qc.bergeron.marcantoine.crammeur.librairy.gson.GsonBuilder; import ca.qc.bergeron.marcantoine.crammeur.librairy.models.Data; import ca.qc.bergeron.marcantoine.crammeur.librairy.repository.i.Repository; public final class GSONFileTemplate<T extends Data<Integer>> extends FileTemplate<T> { protected final Gson mGson; public GSONFileTemplate(Class<T> pClass, Repository pRepository, File pBase, boolean pDeleteCascade, boolean pUpdateCascade, boolean pForeignKey) { super(pClass, pRepository, pBase, pDeleteCascade, pUpdateCascade, pForeignKey); mGson = new GsonBuilder<T, Integer>(pClass, pRepository).getGson(); } @Override protected final void loadFile() { try { if (mFile.exists()) { FileReader fr = new FileReader(mFile); BufferedReader br = new BufferedReader(fr); //mTableKeyData.put(mTableName, (TreeMap<Integer, Data<Integer>>) mGson.fromJson(br.readLine(), new TypeToken<TreeMap<Integer,T>>(){}.getType())); mTableKeyData.get(mTableName).clear(); String line; while ((line = br.readLine()) != null) { final T data = mGson.fromJson(line, mClazz); mTableKeyData.get(mTableName).put(data.getId(), data); } br.close(); fr.close(); } } catch (<API key> e) { e.printStackTrace(); throw new RuntimeException(e); } catch (IOException e) { e.printStackTrace(); throw new RuntimeException(e); } } @Override protected final void updateFile() { try { if (mFile.exists() || mFile.createNewFile()) { FileWriter fw = new FileWriter(mFile); BufferedWriter bw = new BufferedWriter(fw); //bw.write(mGson.toJson(mTableKeyData.get(mTableName))); for (Integer key : mTableKeyData.get(mTableName).keySet()) { bw.write(mGson.toJson(mTableKeyData.get(mTableName).get(key)) + "\n"); } bw.close(); fw.close(); } } catch (IOException e) { e.printStackTrace(); throw new RuntimeException(e); } } }
#include <iostream> #include <cstring> #include <string> using namespace std; //#include <mpich2/mpi.h> #include <boost/mpi.hpp> #include <boost/serialization/string.hpp> namespace mpi = boost::mpi; int main(int argc, char *argv[]) { mpi::environment env(argc, argv); mpi::communicator world; if( world.rank() == 0 ) { for( int i = 1; i < world.size(); i++ ) { world.isend(i, 0, string("hello")); } for( int i = 1; i < world.size(); i++ ) { string receivemessage; world.recv(i, 0, receivemessage ); cout << receivemessage << endl; } } else { string receivemessage; world.recv(0, 0, receivemessage ); cout << receivemessage << endl; world.isend(0,0,string("reply from child")); } return 0; }
// <API key>: Apache-2.0 package api import ( "context" "github.com/go-kit/kit/endpoint" "github.com/mainflux/mainflux/users" ) func <API key>(svc users.Service) endpoint.Endpoint { return func(ctx context.Context, request interface{}) (interface{}, error) { req := request.(userReq) if err := req.validate(); err != nil { return nil, err } if err := svc.Register(ctx, req.user); err != nil { return tokenRes{}, err } return tokenRes{}, nil } } // Password reset request endpoint. // When successful password reset link is generated. // Link is generated using <API key> env. // and value from Referer header for host. // {Referer}+{<API key>}+{token=TOKEN} // Email with a link is being sent to the user. // When user clicks on a link it should get the ui with form to // enter new password, when form is submitted token and new password // must be sent as PUT request to 'password/reset' <API key> func <API key>(svc users.Service) endpoint.Endpoint { return func(ctx context.Context, request interface{}) (interface{}, error) { req := request.(passwResetReq) if err := req.validate(); err != nil { return nil, err } res := passwChangeRes{} email := req.Email if err := svc.GenerateResetToken(ctx, email, req.Host); err != nil { return nil, err } res.Msg = MailSent return res, nil } } // This is endpoint that actually sets new password in password reset flow. // When user clicks on a link in email finally ends on this endpoint as explained in // the comment above. func <API key>(svc users.Service) endpoint.Endpoint { return func(ctx context.Context, request interface{}) (interface{}, error) { req := request.(resetTokenReq) if err := req.validate(); err != nil { return nil, err } res := passwChangeRes{} if err := svc.ResetPassword(ctx, req.Token, req.Password); err != nil { return nil, err } res.Msg = "" return res, nil } } func userInfoEndpoint(svc users.Service) endpoint.Endpoint { return func(ctx context.Context, request interface{}) (interface{}, error) { req := request.(viewUserInfoReq) if err := req.validate(); err != nil { return nil, err } u, err := svc.UserInfo(ctx, req.token) if err != nil { return nil, err } return identityRes{u.Email, u.Metadata}, nil } } func updateUserEndpoint(svc users.Service) endpoint.Endpoint { return func(ctx context.Context, request interface{}) (interface{}, error) { req := request.(updateUserReq) if err := req.validate(); err != nil { return nil, err } user := users.User{ Metadata: req.Metadata, } err := svc.UpdateUser(ctx, req.token, user) if err != nil { return nil, err } return updateUserRes{}, nil } } func <API key>(svc users.Service) endpoint.Endpoint { return func(ctx context.Context, request interface{}) (interface{}, error) { req := request.(passwChangeReq) if err := req.validate(); err != nil { return nil, err } res := passwChangeRes{} if err := svc.ChangePassword(ctx, req.Token, req.Password, req.OldPassword); err != nil { return nil, err } return res, nil } } func loginEndpoint(svc users.Service) endpoint.Endpoint { return func(ctx context.Context, request interface{}) (interface{}, error) { req := request.(userReq) if err := req.validate(); err != nil { return nil, err } token, err := svc.Login(ctx, req.user) if err != nil { return nil, err } return tokenRes{token}, nil } }
package com.nms.vnm.eip.web.controller; import com.nms.vnm.eip.entity.Video; import com.nms.vnm.eip.entity.VideoCategory; import com.nms.vnm.eip.service.entity.ProductService; import com.nms.vnm.eip.service.entity.VideoService; import javax.ejb.EJB; import javax.faces.view.ViewScoped; import javax.inject.Named; @Named @ViewScoped public class VideoController extends <API key><Video, VideoCategory> { private static final long serialVersionUID = <API key>; @EJB private VideoService videoService; @Override protected ProductService<Video, VideoCategory> getProductService() { return videoService; } }
import unittest from igraph import Graph class TestIgraph(unittest.TestCase): def test_graph(self): # Create a graph with 10 vertices & 2 children each. g2 = Graph.Tree(n=10, children=2) self.assertEqual(9, len(g2.get_edgelist()))
using System; using System.Collections.Concurrent; using System.Reflection; using Google.Protobuf; using Orleans.Runtime; using Orleans.Serialization; namespace Example { public class ProtobufSerializer : IExternalSerializer { static readonly <API key><RuntimeTypeHandle, MessageParser> Parsers = new <API key><RuntimeTypeHandle, MessageParser>(); public void Initialize(Logger logger) {} public bool IsSupportedType(Type itemType) { if (!typeof(IMessage).IsAssignableFrom(itemType)) return false; if (Parsers.ContainsKey(itemType.TypeHandle)) return true; var prop = itemType.GetProperty("Parser", BindingFlags.Public | BindingFlags.Static); if (prop == null) return false; var parser = prop.GetValue(null, null); Parsers.TryAdd(itemType.TypeHandle, parser as MessageParser); return true; } public object DeepCopy(object source, ICopyContext context) { if (source == null) return null; dynamic dynamicSource = source; return dynamicSource.Clone(); } public void Serialize(object item, <API key> context, Type expectedType) { var writer = context.StreamWriter; if (item == null) { // Special handling for null value. // Since in this ProtobufSerializer we are usually writing the data lengh as 4 bytes // we also have to write the Null object as 4 bytes lengh of zero. writer.Write(0); return; } var iMessage = item as IMessage; if (iMessage == null) throw new ArgumentException("The provided item for serialization in not an instance of " + typeof(IMessage), nameof(item)); var outBytes = iMessage.ToByteArray(); writer.Write(outBytes.Length); writer.Write(outBytes); } public object Deserialize(Type expectedType, <API key> context) { var typeHandle = expectedType.TypeHandle; MessageParser parser; if (!Parsers.TryGetValue(typeHandle, out parser)) throw new ArgumentException("No parser found for the expected type " + expectedType, nameof(expectedType)); var reader = context.StreamReader; var length = reader.ReadInt(); var data = reader.ReadBytes(length); return parser.ParseFrom(data); } } }
package s1; import java.util.ArrayList; /** * User * HAS-AArrayList * ArrayList * * @author nagise */ public class Users { ArrayList<User> userList = new ArrayList<>(); /** * * @param user */ public void add(User user) { this.userList.add(user); } /** * * @param index * @return */ public User get(int index) { return this.userList.get(index); } }
<!DOCTYPE HTML PUBLIC "- <!--NewPage <HTML> <HEAD> <!-- Generated by javadoc (build 1.5.0_16) on Thu Oct 02 15:35:31 BST 2008 --> <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <TITLE> Uses of Interface org.springframework.security.userdetails.UserDetailsManager (Spring Security 2.0.4 API) </TITLE> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { parent.document.title="Uses of Interface org.springframework.security.userdetails.UserDetailsManager (Spring Security 2.0.4 API)"; } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <A NAME="navbar_top"></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../org/springframework/security/userdetails/UserDetailsManager.html" title="interface in org.springframework.security.userdetails"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> Spring Security Framework</EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/springframework/security/userdetails/class-use/UserDetailsManager.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="UserDetailsManager.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <! if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <HR> <CENTER> <H2> <B>Uses of Interface<br>org.springframework.security.userdetails.UserDetailsManager</B></H2> </CENTER> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Packages that use <A HREF="../../../../../org/springframework/security/userdetails/UserDetailsManager.html" title="interface in org.springframework.security.userdetails">UserDetailsManager</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.springframework.security.userdetails.jdbc"><B>org.springframework.security.userdetails.jdbc</B></A></TD> <TD>Exposes a JDBC-based authentication repository.&nbsp;</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.springframework.security.userdetails.ldap"><B>org.springframework.security.userdetails.ldap</B></A></TD> <TD>&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.springframework.security.userdetails.jdbc"></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../org/springframework/security/userdetails/UserDetailsManager.html" title="interface in org.springframework.security.userdetails">UserDetailsManager</A> in <A HREF="../../../../../org/springframework/security/userdetails/jdbc/package-summary.html">org.springframework.security.userdetails.jdbc</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="<API key>"> <TH ALIGN="left" COLSPAN="2">Classes in <A HREF="../../../../../org/springframework/security/userdetails/jdbc/package-summary.html">org.springframework.security.userdetails.jdbc</A> that implement <A HREF="../../../../../org/springframework/security/userdetails/UserDetailsManager.html" title="interface in org.springframework.security.userdetails">UserDetailsManager</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;class</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/springframework/security/userdetails/jdbc/<API key>.html" title="class in org.springframework.security.userdetails.jdbc"><API key></A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Jdbc user management service.</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.springframework.security.userdetails.ldap"></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../org/springframework/security/userdetails/UserDetailsManager.html" title="interface in org.springframework.security.userdetails">UserDetailsManager</A> in <A HREF="../../../../../org/springframework/security/userdetails/ldap/package-summary.html">org.springframework.security.userdetails.ldap</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="<API key>"> <TH ALIGN="left" COLSPAN="2">Classes in <A HREF="../../../../../org/springframework/security/userdetails/ldap/package-summary.html">org.springframework.security.userdetails.ldap</A> that implement <A HREF="../../../../../org/springframework/security/userdetails/UserDetailsManager.html" title="interface in org.springframework.security.userdetails">UserDetailsManager</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;class</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/springframework/security/userdetails/ldap/<API key>.html" title="class in org.springframework.security.userdetails.ldap"><API key></A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;An Ldap implementation of UserDetailsManager.</TD> </TR> </TABLE> &nbsp; <P> <HR> <A NAME="navbar_bottom"></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="<API key>"></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../org/springframework/security/userdetails/UserDetailsManager.html" title="interface in org.springframework.security.userdetails"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> Spring Security Framework</EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/springframework/security/userdetails/class-use/UserDetailsManager.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="UserDetailsManager.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <! if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <HR> Copyright & </BODY> </HTML>
.cell {} .well { /* padding: 0; align-content: stretch; */ } .row-well { background-color: rgba(255, 0, 0, .05); } .col-well { /* padding-right: 0; padding-left: 0; max-width: 100%; width: 100%; */ } .show-grid { background-color: rgba(200, 200, 200, .05); border: 3px solid #c8c8c8; } .cell-active { border: 3px solid #f00; border-radius: 5px; } .cell-selected { border: 3px dashed #00f; border-radius: 5px; } .cell-dragged { opacity: .2; } .drag-inactive { opacity: .6; } .drag-active { opacity: .9; } /* .cell-col-1 { max-width: 8.3%; width: 8.3%; } .cell-col-2 { max-width: 16.6%; width: 16.6%; } .cell-col-3 { max-width: 25%; width: 25%; } .cell-col-4 { max-width: 33%; width: 33%; } .cell-col-6 { max-width: 41.6%; width: 41.6%; } .cell-col-7 { max-width: 58.3%; width: 58.3%; } .cell-col-8 { width: 66%; } .cell-col-9 { max-width: 75%; } .cell-col-10 { max-width: 75%; } .cell-col-11 { max-width: 91.6%; } .cell-col-12 { max-width: 100%; } */ .cell-level-0 {} .cell-level-1 {} .cell-level-2 {} .cell-level-3 {} .cell-level-4 {} .cell-level-5 {} .cell-level-6 {} .cell-level-7 {} .cell-level-8 {} .cell-level-9 {} .cell-level-10 {} .cell-level-11 {} .cell-level-12 {} .cell-level-13 {} .cell-level-14 {} .cell-level-15 {} .cell-level-16 {} .cell-level-17 {} .cell-level-18 {}
package org.openxava.test.model; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.NoResultException; import javax.persistence.Query; import org.hibernate.annotations.GenericGenerator; import org.openxava.annotations.*; import org.openxava.jpa.XPersistence; /** * * @author Javier Paniza */ @Entity @View(name="Sections", members="section1{ name; section2 { partOf, favouriteFormula } }") public class Ingredient { @Id @Hidden @GeneratedValue(generator="system-uuid") @GenericGenerator(name="system-uuid", strategy = "uuid") @Column(name="ID") private String oid; @Column(length=40) @Required private String name; @ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name="PARTOF") @DescriptionsList private Ingredient partOf; @ManyToOne(fetch=FetchType.LAZY) @DescriptionsList private Formula favouriteFormula; // For testing cyclic references public static Ingredient findByName(String name) throws NoResultException { Query query = XPersistence.getManager().createQuery("from Ingredient where name = :name"); query.setParameter("name", name); return (Ingredient) query.getSingleResult(); } public Formula getFavouriteFormula() { return favouriteFormula; } public void setFavouriteFormula(Formula favouriteFormula) { this.favouriteFormula = favouriteFormula; } public String getOid() { return oid; } public void setOid(String oid) { this.oid = oid; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Ingredient getPartOf() { return partOf; } public void setPartOf(Ingredient partOf) { this.partOf = partOf; } }
package es.tid.bgp.bgp4.messages; public class BGP4Keepalive extends BGP4Message{ /** * Create new Keepalive */ public BGP4Keepalive() { this.setMessageType(BGP4MessageTypes.MESSAGE_KEEPALIVE); } public BGP4Keepalive(byte[] bytes){ super(bytes); } public void encode(){ this.setMessageLength(BGPHeaderLength); this.messageBytes=new byte[this.getLength()]; encodeHeader(); } }
package com.dailyhotel.watchman.testsupport; import com.dailyhotel.watchman.CacheClient; import com.dailyhotel.watchman.MethodCall; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Component; import javax.inject.Inject; import java.util.concurrent.TimeUnit; @Component public class DefaultCacheClient implements CacheClient { private RedisTemplate<String, MethodCall> redisTemplate; @Inject public DefaultCacheClient(RedisTemplate<String, MethodCall> redisTemplate) { this.redisTemplate = redisTemplate; } @Override public MethodCall get(String key) { return redisTemplate.opsForValue().get(key); } @Override public void set(String key, MethodCall value, long timeout, TimeUnit unit) { redisTemplate.opsForValue().set(key, value, timeout, unit); } }
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_60) on Sun May 15 19:31:54 CAT 2016 --> <title>T-Index</title> <meta name="date" content="2016-05-15"> <link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style"> <script type="text/javascript" src="../script.js"></script> </head> <body> <script type="text/javascript"><! try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="T-Index"; } } catch(err) { } </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <div class="topNav"><a name="navbar.top"> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../overview-summary.html">Overview</a></li> <li>Package</li> <li>Class</li> <li>Use</li> <li><a href="../overview-tree.html">Tree</a></li> <li><a href="../deprecated-list.html">Deprecated</a></li> <li class="navBarCell1Rev">Index</li> <li><a href="../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="index-17.html">Prev Letter</a></li> <li><a href="index-19.html">Next Letter</a></li> </ul> <ul class="navList"> <li><a href="../index.html?index-files/index-18.html" target="_top">Frames</a></li> <li><a href="index-18.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip.navbar.top"> </a></div> <div class="contentContainer"><a href="index-1.html">A</a>&nbsp;<a href="index-2.html">B</a>&nbsp;<a href="index-3.html">C</a>&nbsp;<a href="index-4.html">D</a>&nbsp;<a href="index-5.html">E</a>&nbsp;<a href="index-6.html">F</a>&nbsp;<a href="index-7.html">G</a>&nbsp;<a href="index-8.html">H</a>&nbsp;<a href="index-9.html">I</a>&nbsp;<a href="index-10.html">J</a>&nbsp;<a href="index-11.html">K</a>&nbsp;<a href="index-12.html">L</a>&nbsp;<a href="index-13.html">M</a>&nbsp;<a href="index-14.html">N</a>&nbsp;<a href="index-15.html">P</a>&nbsp;<a href="index-16.html">R</a>&nbsp;<a href="index-17.html">S</a>&nbsp;<a href="index-18.html">T</a>&nbsp;<a href="index-19.html">U</a>&nbsp;<a href="index-20.html">V</a>&nbsp;<a name="I:T"> </a> <h2 class="title">T</h2> <dl> <dt><span class="memberNameLink"><a href="../com/rpfsoftwares/systembuilderlib/window/JPatterns.html#title">title</a></span> - Static variable in class com.rpfsoftwares.systembuilderlib.window.<a href="../com/rpfsoftwares/systembuilderlib/window/JPatterns.html" title="class in com.rpfsoftwares.systembuilderlib.window">JPatterns</a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../com/rpfsoftwares/systembuilderlib/database/ContentValues.html#toString--">toString()</a></span> - Method in class com.rpfsoftwares.systembuilderlib.database.<a href="../com/rpfsoftwares/systembuilderlib/database/ContentValues.html" title="class in com.rpfsoftwares.systembuilderlib.database">ContentValues</a></dt> <dd> <div class="block">Returns a string containing a concise, human-readable description of this object.</div> </dd> <dt><span class="memberNameLink"><a href="../com/rpfsoftwares/systembuilderlib/database/ForeignKey.html#toString--">toString()</a></span> - Method in class com.rpfsoftwares.systembuilderlib.database.<a href="../com/rpfsoftwares/systembuilderlib/database/ForeignKey.html" title="class in com.rpfsoftwares.systembuilderlib.database">ForeignKey</a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../com/rpfsoftwares/systembuilderlib/database/JContentValues.html#toString--">toString()</a></span> - Method in class com.rpfsoftwares.systembuilderlib.database.<a href="../com/rpfsoftwares/systembuilderlib/database/JContentValues.html" title="class in com.rpfsoftwares.systembuilderlib.database">JContentValues</a></dt> <dd> <div class="block">returns a <code>String</code> containing a human-readable description of this object</div> </dd> </dl> <a href="index-1.html">A</a>&nbsp;<a href="index-2.html">B</a>&nbsp;<a href="index-3.html">C</a>&nbsp;<a href="index-4.html">D</a>&nbsp;<a href="index-5.html">E</a>&nbsp;<a href="index-6.html">F</a>&nbsp;<a href="index-7.html">G</a>&nbsp;<a href="index-8.html">H</a>&nbsp;<a href="index-9.html">I</a>&nbsp;<a href="index-10.html">J</a>&nbsp;<a href="index-11.html">K</a>&nbsp;<a href="index-12.html">L</a>&nbsp;<a href="index-13.html">M</a>&nbsp;<a href="index-14.html">N</a>&nbsp;<a href="index-15.html">P</a>&nbsp;<a href="index-16.html">R</a>&nbsp;<a href="index-17.html">S</a>&nbsp;<a href="index-18.html">T</a>&nbsp;<a href="index-19.html">U</a>&nbsp;<a href="index-20.html">V</a>&nbsp;</div> <div class="bottomNav"><a name="navbar.bottom"> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../overview-summary.html">Overview</a></li> <li>Package</li> <li>Class</li> <li>Use</li> <li><a href="../overview-tree.html">Tree</a></li> <li><a href="../deprecated-list.html">Deprecated</a></li> <li class="navBarCell1Rev">Index</li> <li><a href="../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="index-17.html">Prev Letter</a></li> <li><a href="index-19.html">Next Letter</a></li> </ul> <ul class="navList"> <li><a href="../index.html?index-files/index-18.html" target="_top">Frames</a></li> <li><a href="index-18.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip.navbar.bottom"> </a></div> </body> </html>
#set( $symbol_pound = '#' ) #set( $symbol_dollar = '$' ) #set( $symbol_escape = '\' ) package ${package}.test.support; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.<API key>; import org.springframework.test.context.junit4.<API key>; import ${package}.services.kie.<API key>; @ActiveProfiles( profiles = { "test" } ) @<API key>( locations = { "classpath:kie-context.xml" } ) public abstract class <API key> extends <API key> { @Autowired protected <API key> kie; }
package array; /** * There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The * overall run time complexity should be O(log (m+n)). * * */ public class MedianSortedArrays { public static double <API key>(int A[], int B[]) { int m = A.length; int n = B.length; if ((m + n) % 2 != 0) // odd return (double) findKth(A, B, (m + n) / 2, 0, m - 1, 0, n - 1); else { // even return (findKth(A, B, (m + n) / 2, 0, m - 1, 0, n - 1) + findKth(A, B, (m + n) / 2 - 1, 0, m - 1, 0, n - 1)) * 0.5; } } public static int findKth(int A[], int B[], int k, int aStart, int aEnd, int bStart, int bEnd) { int aLen = aEnd - aStart + 1; int bLen = bEnd - bStart + 1; // Handle special cases if (aLen == 0) return B[bStart + k]; if (bLen == 0) return A[aStart + k]; if (k == 0) return A[aStart] < B[bStart] ? A[aStart] : B[bStart]; int aMid = aLen * k / (aLen + bLen); // a's middle count int bMid = k - aMid - 1; // b's middle count // make aMid and bMid to be array index aMid = aMid + aStart; bMid = bMid + bStart; if (A[aMid] > B[bMid]) { k = k - (bMid - bStart + 1); aEnd = aMid; bStart = bMid + 1; } else { k = k - (aMid - aStart + 1); bEnd = bMid; aStart = aMid + 1; } return findKth(A, B, k, aStart, aEnd, bStart, bEnd); } public static void main(String[] args) { int[] a = { 2, 5, 8, 9}; int[] b = { 4, 7, 10, 15, 19}; System.out.println(<API key>(a, b)); } }
/** * Automatically generated file. DO NOT MODIFY */ package com.iflytek.skintest; public final class BuildConfig { public static final boolean DEBUG = Boolean.parseBoolean("true"); public static final String APPLICATION_ID = "com.iflytek.skintest"; public static final String BUILD_TYPE = "debug"; public static final String FLAVOR = ""; public static final int VERSION_CODE = 1; public static final String VERSION_NAME = "1.0"; }
// Includes #include "XnDeviceFileReader.h" #include <XnLog.h> #include "XnDeviceFile.h" #include <XnDDK/<API key>.h> #include <XnDDK/<API key>.h> // Types typedef struct XnLastStreamData { XnUInt64 nPosition; XnUInt32 nFrameID; XnUInt64 nTimestamp; } XnLastStreamData; <API key>(XnLastStreamData, <API key>); // Code XnDeviceFileReader::XnDeviceFileReader() : <API key>(XN_DEVICE_NAME, <API key>), m_FrameDelay(<API key>, FALSE), m_pBCData(NULL), m_nFileVersion(0), m_nReferenceTime(0), <API key>(0), m_bFileHasData(FALSE), <API key>(FALSE), m_InstancePointer(<API key>) { m_FrameDelay.<API key>(); m_InstancePointer.UpdateGetCallback(GetInstanceCallback, this); } XnDeviceFileReader::~XnDeviceFileReader() { } XnStatus XnDeviceFileReader::InitImpl(const XnDeviceConfig* pDeviceConfig) { XnStatus nRetVal = XN_STATUS_OK; nRetVal = <API key>::InitImpl(pDeviceConfig); XN_IS_STATUS_OK(nRetVal); // register to events nRetVal = <API key>().Register(<API key>, this); XN_IS_STATUS_OK(nRetVal); // TODO: remove this <API key>().UnsafeUpdateValue(XN_DEVICE_MODE_READ); return (XN_STATUS_OK); } XnStatus XnDeviceFileReader::CreateDeviceModule(<API key>** ppModuleHolder) { XnStatus nRetVal = XN_STATUS_OK; nRetVal = <API key>::CreateDeviceModule(ppModuleHolder); XN_IS_STATUS_OK(nRetVal); XnDeviceModule* pModule = (*ppModuleHolder)->GetModule(); // add sensor properties XnProperty* pProps[] = { &m_FrameDelay, &m_InstancePointer }; nRetVal = pModule->AddProperties(pProps, sizeof(pProps)/sizeof(XnProperty*)); if (nRetVal != XN_STATUS_OK) { DestroyModule(*ppModuleHolder); *ppModuleHolder = NULL; return (nRetVal); } return (XN_STATUS_OK); } XnStatus XnDeviceFileReader::CreateIOStreamImpl(const XnChar* strConnectionString, XnIOStream*& pStream) { XnStatus nRetVal = XN_STATUS_OK; // open file <API key>(pStream, XnIOFileStream, strConnectionString, XN_OS_FILE_READ); // read version nRetVal = ReadFileVersion(); if (nRetVal != XN_STATUS_OK) { XN_DELETE(pStream); pStream = NULL; return (nRetVal); } return (XN_STATUS_OK); } void XnDeviceFileReader::DestroyIOStreamImpl(XnIOStream* pStream) { XN_DELETE(pStream); } XnStatus XnDeviceFileReader::ReadFileVersion() { XnStatus nRetVal = XN_STATUS_OK; // read magic from file XnChar csFileMagic[<API key>]; nRetVal = GetIOStream()->ReadData((XnUChar*)csFileMagic, <API key>); XN_IS_STATUS_OK(nRetVal); if (strncmp(csFileMagic, <API key>, <API key>) == 0) { m_nFileVersion = 4; } else if (strncmp(csFileMagic, <API key>, <API key>) == 0) { m_nFileVersion = 3; } else if (strncmp(csFileMagic, <API key>, <API key>) == 0) { m_nFileVersion = 2; } else if (strncmp(csFileMagic, <API key>, <API key>) == 0) { m_nFileVersion = 1; } else { XN_LOG_ERROR_RETURN(<API key>, XN_MASK_FILE, "Invalid file magic!"); } return (XN_STATUS_OK); } XnStatus XnDeviceFileReader::ReadInitialState(XnPropertySet *pSet) { XnStatus nRetVal = XN_STATUS_OK; if (m_nFileVersion < 4) { if (m_pBCData == NULL) { nRetVal = BCInit(); XN_IS_STATUS_OK(nRetVal); } return BCReadInitialState(pSet); } // first read first object - modules properties - using base nRetVal = <API key>::ReadInitialState(pSet); XN_IS_STATUS_OK(nRetVal); // now continue reading until we get to first data XnPackedDataType nType; XnBool bStateEnd = FALSE; XnUInt64 nPositionBefore; while (!bStateEnd) { nRetVal = GetIOStream()->Tell(&nPositionBefore); XN_IS_STATUS_OK(nRetVal); nRetVal = GetDataPacker()->ReadNextObject(&nType); XN_IS_STATUS_OK(nRetVal); switch (nType) { case <API key>: { XnChar strType[<API key>]; XnChar strName[<API key>]; <API key>(props); nRetVal = GetDataPacker()->ReadNewStream(strType, strName, &props); XN_IS_STATUS_OK(nRetVal); <API key>* pStreamProps; nRetVal = <API key>(props.pData, strName, &pStreamProps); XN_IS_STATUS_OK(nRetVal); nRetVal = <API key>(pSet->pData, strName, pStreamProps); XN_IS_STATUS_OK(nRetVal); break; } case <API key>: { XnChar strModule[<API key>]; XnChar strProp[<API key>]; XnUInt64 nValue; nRetVal = GetDataPacker()->ReadProperty(strModule, strProp, &nValue); XN_IS_STATUS_OK(nRetVal); <API key>* pModule; nRetVal = pSet->pData->Get(strModule, pModule); XN_IS_STATUS_OK(nRetVal); XnProperty* pProp; nRetVal = pModule->Get(strProp, pProp); XN_IS_STATUS_OK(nRetVal); XnActualIntProperty* pIntProp = (XnActualIntProperty*)pProp; nRetVal = pIntProp->UnsafeUpdateValue(nValue); XN_IS_STATUS_OK(nRetVal); break; } case <API key>: { XnChar strModule[<API key>]; XnChar strProp[<API key>]; XnDouble dValue; nRetVal = GetDataPacker()->ReadProperty(strModule, strProp, &dValue); XN_IS_STATUS_OK(nRetVal); <API key>* pModule; nRetVal = pSet->pData->Get(strModule, pModule); XN_IS_STATUS_OK(nRetVal); XnProperty* pProp; nRetVal = pModule->Get(strProp, pProp); XN_IS_STATUS_OK(nRetVal); <API key>* pRealProp = (<API key>*)pProp; nRetVal = pRealProp->UnsafeUpdateValue(dValue); XN_IS_STATUS_OK(nRetVal); break; } case <API key>: { XnChar strModule[<API key>]; XnChar strProp[<API key>]; XnChar strValue[<API key>]; nRetVal = GetDataPacker()->ReadProperty(strModule, strProp, strValue); XN_IS_STATUS_OK(nRetVal); <API key>* pModule; nRetVal = pSet->pData->Get(strModule, pModule); XN_IS_STATUS_OK(nRetVal); XnProperty* pProp; nRetVal = pModule->Get(strProp, pProp); XN_IS_STATUS_OK(nRetVal); <API key>* pStringProp = (<API key>*)pProp; nRetVal = pStringProp->UnsafeUpdateValue(strValue); XN_IS_STATUS_OK(nRetVal); break; } case <API key>: { XnChar strModule[<API key>]; XnChar strProp[<API key>]; XnGeneralBuffer gbValue; nRetVal = GetDataPacker()->ReadProperty(strModule, strProp, &gbValue); XN_IS_STATUS_OK(nRetVal); <API key>* pModule; nRetVal = pSet->pData->Get(strModule, pModule); XN_IS_STATUS_OK(nRetVal); XnProperty* pProp; nRetVal = pModule->Get(strProp, pProp); XN_IS_STATUS_OK(nRetVal); <API key>* pIntProp = (<API key>*)pProp; nRetVal = pIntProp->UnsafeUpdateValue(gbValue); XN_IS_STATUS_OK(nRetVal); break; } default: // reached end of initial state. go back to beginning of this object nRetVal = GetIOStream()->Seek(nPositionBefore); XN_IS_STATUS_OK(nRetVal); // stop reading bStateEnd = TRUE; } } // objects loop return (XN_STATUS_OK); } XnStatus XnDeviceFileReader::HandleStreamRemoved(const XnChar* strName) { XnStatus nRetVal = XN_STATUS_OK; // check for specific case: all streams are removed and then end-of-file is reached. // in this case, we don't really want to destroy streams, just wrap around. XnStringsHash StreamsToRemove; nRetVal = StreamsToRemove.Set(strName, NULL); XN_IS_STATUS_OK(nRetVal); XnPackedDataType nType = <API key>; XnUInt64 nPositionBefore; for (;;) { nRetVal = GetIOStream()->Tell(&nPositionBefore); XN_IS_STATUS_OK(nRetVal); nRetVal = GetDataPacker()->ReadNextObject(&nType); XN_IS_STATUS_OK(nRetVal); if (nType == <API key>) { XnChar strTempName[<API key>]; nRetVal = GetDataPacker()->ReadStreamRemoved(strTempName); XN_IS_STATUS_OK(nRetVal); nRetVal = StreamsToRemove.Set(strTempName, NULL); XN_IS_STATUS_OK(nRetVal); } else { break; } } if (nType != XN_PACKED_END) { // Not the case we were looking for. Remove those streams. for (XnStringsHash::Iterator it = StreamsToRemove.begin(); it != StreamsToRemove.end(); ++it) { nRetVal = <API key>::HandleStreamRemoved(it.Key()); XN_IS_STATUS_OK(nRetVal); } } // in any case, the last object we read wasn't handled yet (end-of-stream or another event), so // seek back, so it will be handled. nRetVal = GetIOStream()->Seek(nPositionBefore); XN_IS_STATUS_OK(nRetVal); return (XN_STATUS_OK); } XnStatus XnDeviceFileReader::HandleIntProperty(const XnChar* strModule, const XnChar* strName, XnUInt64 nValue) { XnStatus nRetVal = XN_STATUS_OK; // ignore some properties if ((strcmp(strModule, <API key>) == 0 && strcmp(strName, <API key>) == 0) || (strcmp(strModule, <API key>) == 0 && strcmp(strName, <API key>) == 0) || (strcmp(strModule, <API key>) == 0 && strcmp(strName, <API key>) == 0) || (strcmp(strModule, <API key>) == 0 && strcmp(strName, <API key>) == 0)) { return (XN_STATUS_OK); } else { nRetVal = <API key>::HandleIntProperty(strModule, strName, nValue); XN_IS_STATUS_OK(nRetVal); } return (XN_STATUS_OK); } XnStatus XnDeviceFileReader::HandleStreamData(XnStreamData* pDataProps, <API key> nCompression, XnUInt32 nCompressedSize) { XnStatus nRetVal = XN_STATUS_OK; XnUInt64 nPosition; nRetVal = GetIOStream()->Tell(&nPosition); XN_IS_STATUS_OK(nRetVal); XnUIntHash::Iterator it = m_PositionsToIgnore.end(); if (XN_STATUS_OK == m_PositionsToIgnore.Find(nPosition, it)) { // ignore this one. Just update the frame ID <API key>* pHolder; nRetVal = FindStream(pDataProps->StreamName, &pHolder); XN_IS_STATUS_OK(nRetVal); <API key>* pStream = (<API key>*)pHolder->GetStream(); pStream->NewDataAvailable(pDataProps->nTimestamp, pDataProps->nFrameID); // and remove it from list nRetVal = m_PositionsToIgnore.Remove(it); XN_IS_STATUS_OK(nRetVal); } else { // normal case. handle it nRetVal = <API key>::HandleStreamData(pDataProps, nCompression, nCompressedSize); XN_IS_STATUS_OK(nRetVal); } return (XN_STATUS_OK); } XnStatus XnDeviceFileReader::Rewind() { XnStatus nRetVal = XN_STATUS_OK; // go back to start of stream nRetVal = GetIOStream()->Seek(<API key>); XN_IS_STATUS_OK(nRetVal); // read initial state <API key>(state); nRetVal = ReadInitialState(&state); XN_IS_STATUS_OK(nRetVal); // first handle current streams. remove or reset them <API key> streams; nRetVal = GetStreamsList(streams); XN_IS_STATUS_OK(nRetVal); for (<API key>::Iterator it = streams.begin(); it != streams.end(); ++it) { <API key>* pHolder = *it; if (<API key>) { // we need to destroy all streams, and recreate them later nRetVal = DestroyStream(pHolder->GetModule()->GetName()); XN_IS_STATUS_OK(nRetVal); } else { // just reset frame ID <API key>* pStream = (<API key>*)pHolder->GetModule(); pStream->Reset(); } } // if we need, recreate streams if (<API key>) { nRetVal = CreateStreams(&state); XN_IS_STATUS_OK(nRetVal); } // now set state. for (XnPropertySetData::Iterator it = state.pData->begin(); it != state.pData->end(); ++it) { const XnChar* strName = it.Key(); <API key>* pHash = it.Value(); // fix it first if (strcmp(strName, <API key>) == 0) { pHash->Remove(<API key>); pHash->Remove(<API key>); } XnDeviceModule* pModule; nRetVal = FindModule(strName, &pModule); XN_IS_STATUS_OK(nRetVal); nRetVal = pModule->UnsafeBatchConfig(*pHash); XN_IS_STATUS_OK(nRetVal); } <API key>(); <API key> = 0; m_nReferenceTime = 0; <API key> = FALSE; return (XN_STATUS_OK); } XnStatus XnDeviceFileReader::HandleEndOfStream() { XnStatus nRetVal = XN_STATUS_OK; if (!m_bFileHasData) { XN_LOG_ERROR_RETURN(<API key>, XN_MASK_FILE, "File does not contain any data..."); } nRetVal = Rewind(); XN_IS_STATUS_OK(nRetVal); return (XN_STATUS_OK); } void XnDeviceFileReader::FrameDelay(XnUInt64 nTimestamp) { if (m_FrameDelay.GetValue() != TRUE) return; if (!IsHighResTimestamps()) nTimestamp *= 1000; // first time if (m_nReferenceTime == 0) { xnOSQueryTimer(m_FrameDelayTimer, &m_nReferenceTime); <API key> = nTimestamp; return; } // delay XnUInt64 nNow; xnOSQueryTimer(m_FrameDelayTimer, &nNow); // check how much time has passed in the stream XnUInt64 nStreamDiff; if (nTimestamp < <API key>) { nStreamDiff = 0; } else { nStreamDiff = nTimestamp - <API key>; } // check how much time passed (for user) XnUInt64 nClockDiff = nNow - m_nReferenceTime; // update reference (so that frame delay will work with Pause / Resume) m_nReferenceTime = nNow; <API key> = nTimestamp; // check if we need to wait if (nClockDiff < nStreamDiff) { xnOSSleep(XnUInt32((nStreamDiff - nClockDiff) / 1000)); // take this time as a reference xnOSQueryTimer(m_FrameDelayTimer, &m_nReferenceTime); } } XnStatus XnDeviceFileReader::<API key>(XN_EVENT_HANDLE /*hNewDataEvent*/, XnStreamDataSet* pSet) { XnStatus nRetVal = XN_STATUS_OK; // read until primary stream advanced while (!<API key>(pSet)) { XnBool bWrap; nRetVal = ReadTillNextData(&bWrap); XN_IS_STATUS_OK(nRetVal); } FrameDelay(GetLastTimestamp()); return (XN_STATUS_OK); } XnStatus XnDeviceFileReader::WaitForStream(XN_EVENT_HANDLE /*hNewDataEvent*/, XnDeviceStream* pStream) { XnStatus nRetVal = XN_STATUS_OK; // play forward until we have new data in this stream while (!pStream->IsNewDataAvailable()) { XnBool bWrap; nRetVal = ReadTillNextData(&bWrap); XN_IS_STATUS_OK(nRetVal); } FrameDelay(pStream->GetLastTimestamp()); return (XN_STATUS_OK); } XnStatus XnDeviceFileReader::ReadTillNextData(XnBool* pbWrapOccurred) { XnStatus nRetVal = XN_STATUS_OK; *pbWrapOccurred = FALSE; if (m_nFileVersion < 4) { nRetVal = BCReadFrame(pbWrapOccurred); XN_IS_STATUS_OK(nRetVal); } else { XnPackedDataType nType = XN_PACKED_END; while (nType != <API key>) { nRetVal = <API key>(&nType); XN_IS_STATUS_OK(nRetVal); if (nType == XN_PACKED_END) { *pbWrapOccurred = TRUE; } } m_bFileHasData = TRUE; } return (XN_STATUS_OK); } XnStatus XnDeviceFileReader::SeekTo(XnUInt64 nMinTimestamp, XnUInt32 nMinFrameID) { XnStatus nRetVal = XN_STATUS_OK; // first check if we need to seek forward or backwards (even if we're in the correct location, // we need to rewind, so that next read will return this frame again). if ((nMinTimestamp != 0 && nMinTimestamp <= GetLastTimestamp()) || (nMinFrameID != 0 && nMinFrameID <= GetLastFrameID())) { nRetVal = Rewind(); XN_IS_STATUS_OK(nRetVal); } XnBool bFoundNewData = FALSE; // Keep current position. XnUInt64 nStartingPosition; nRetVal = GetIOStream()->Tell(&nStartingPosition); XN_IS_STATUS_OK(nRetVal); // Take primary stream (it determines frame ID and timestamp) XnPackedDataType nType = (XnPackedDataType)-1; const XnChar* strPrimaryStream = GetPrimaryStream(); if (strcmp(strPrimaryStream, <API key>) == 0 || strcmp(strPrimaryStream, <API key>) == 0) { strPrimaryStream = NULL; } // start seeking forward until point is reached. XnUInt64 nFoundPosition; <API key> StreamsHash; for (;;) { XnUInt64 nPositionBefore; nRetVal = GetIOStream()->Tell(&nPositionBefore); XN_IS_STATUS_OK(nRetVal); nRetVal = GetDataPacker()->ReadNextObject(&nType); XN_IS_STATUS_OK(nRetVal); XnUInt64 nPositionAfter; nRetVal = GetIOStream()->Tell(&nPositionAfter); XN_IS_STATUS_OK(nRetVal); if (nType == <API key>) { bFoundNewData = TRUE; XnStreamData props; <API key> nCompression; XnUInt32 nCompressedSize; nRetVal = GetDataPacker()->ReadStreamDataProps(&props, &nCompression, &nCompressedSize); XN_IS_STATUS_OK(nRetVal); XnLastStreamData data; if (XN_STATUS_OK != StreamsHash.Get(props.StreamName, data)) { <API key>* pHolder; nRetVal = FindStream(props.StreamName, &pHolder); XN_IS_STATUS_OK(nRetVal); data.nFrameID = pHolder->GetStream()->GetLastFrameID() + 1; } else { // if we had previous data from this stream, ignore it m_PositionsToIgnore.Set(data.nPosition, 0); ++data.nFrameID; } data.nPosition = nPositionAfter; data.nTimestamp = props.nTimestamp; nRetVal = StreamsHash.Set(props.StreamName, data); XN_IS_STATUS_OK(nRetVal); // now check if condition is met if (strPrimaryStream == NULL || strcmp(strPrimaryStream, props.StreamName) == 0) { if (data.nFrameID >= nMinFrameID && data.nTimestamp >= nMinTimestamp) { // we have everything we need // keep this position (we'll read up till here). nFoundPosition = nPositionAfter; break; } } } else if (nType == XN_PACKED_END) { // we'll read up to the last data of each stream nFoundPosition = nPositionBefore; break; } } // now seek back nRetVal = GetIOStream()->Seek(nStartingPosition); XN_IS_STATUS_OK(nRetVal); if (bFoundNewData) { // read everything up to position XnUInt64 nPositionAfter = nStartingPosition; while (nPositionAfter < nFoundPosition) { nRetVal = <API key>(&nType); XN_IS_STATUS_OK(nRetVal); nRetVal = GetIOStream()->Tell(&nPositionAfter); XN_IS_STATUS_OK(nRetVal); } } else { // just remark the data as new (this is last frame, return it again to user) <API key> streams; nRetVal = GetStreamsList(streams); XN_IS_STATUS_OK(nRetVal); for (<API key>::Iterator it = streams.begin(); it != streams.end(); ++it) { <API key>* pStream = (<API key>*)(*it)->GetModule(); pStream->ReMarkDataAsNew(); } } return (XN_STATUS_OK); } XnStatus XnDeviceFileReader::Seek(XnUInt64 nTimestamp) { XnStatus nRetVal = XN_STATUS_OK; xnLogInfo(XN_MASK_FILE, "Seeking file to timestamp %llu...", nTimestamp); if (m_nFileVersion < 4) { return BCSeek(nTimestamp); } nRetVal = SeekTo(nTimestamp, 0); XN_IS_STATUS_OK(nRetVal); return (XN_STATUS_OK); } XnStatus XnDeviceFileReader::SeekFrame(XnUInt32 nFrameID) { XnStatus nRetVal = XN_STATUS_OK; // don't allow seeking to frame 0 nFrameID = XN_MAX(nFrameID, 1); xnLogInfo(XN_MASK_FILE, "Seeking file to frame %u...", nFrameID); if (m_nFileVersion < 4) { return BCSeekFrame(nFrameID); } nRetVal = SeekTo(0, nFrameID); XN_IS_STATUS_OK(nRetVal); return (XN_STATUS_OK); } XnStatus XnDeviceFileReader::<API key>(const XnChar* /*StreamName*/, <API key> /*EventType*/) { <API key> = TRUE; return XN_STATUS_OK; } void XnDeviceFileReader::<API key>(XnDeviceHandle /*DeviceHandle*/, const XnChar* StreamName, <API key> EventType, void* pCookie) { XnDeviceFileReader* pThis = (XnDeviceFileReader*)pCookie; pThis-><API key>(StreamName, EventType); } XnStatus XnDeviceFileReader::ReadNextData() { XnBool bDummy; return ReadTillNextData(&bDummy); } XnStatus XN_CALLBACK_TYPE XnDeviceFileReader::GetInstanceCallback(const XnGeneralProperty* /*pSender*/, const XnGeneralBuffer& gbValue, void* pCookie) { if (gbValue.nDataSize != sizeof(void*)) { return <API key>; } *(void**)gbValue.pData = pCookie; return XN_STATUS_OK; }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>PDF Extractor Results</title> </head> <body> <?php // Get submitted form data $apiKey = $_POST["apiKey"]; $sourceUrl = $_POST["sourceUrl"]; // Prepare URL for `Web Page to PDF` API call $url = "https://api.pdf.co/v1/pdf/convert/from/url"; // Prepare requests params $parameters = array(); $parameters["name"] = "result.pdf"; $parameters["url"] = $sourceUrl; // Create Json payload $data = json_encode($parameters); // Create request $curl = curl_init(); curl_setopt($curl, CURLOPT_HTTPHEADER, array("x-api-key: " . $apiKey, "Content-type: application/json")); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, <API key>, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $data); // Execute request $result = curl_exec($curl); if (curl_errno($curl) == 0) { $status_code = curl_getinfo($curl, CURLINFO_HTTP_CODE); if ($status_code == 200) { $json = json_decode($result, true); if ($json["error"] == false) { // Get URL of generated PDF file $resultFileUrl = $json["url"]; // Display link to the file with conversion results echo "<div><h2>Conversion Result:</h2><a href='" . $resultFileUrl . "' target='_blank'>" . $resultFileUrl . "</a></div>"; } else { // Display service reported error echo "<p>Error: " . $json["message"] . "</p>"; } } else { // Display request error echo "<p>Status code: " . $status_code . "</p>"; echo "<p>" . $result . "</p>"; } } else { // Display CURL error echo "Error: " . curl_error($curl); } // Cleanup curl_close($curl); ?> </body> </html>
package das.dao.props; public interface IBean<B,V> extends IHasDataProperty<B,V>{ public Class<?> getBeanClass(); }
package main import ( "fmt" _ "github.com/lib/pq" ) func checkReferralID(referral_id string) bool { fmt.Println("Checking for valid referral_id:", referral_id) var count int8 if referral_id == ""{ return true } db.QueryRow("SELECT COUNT(*) FROM referral WHERE referral_id=$1",referral_id).Scan(&count) if count == 0 { return false }else{ return true } } func updateReferralTable(referral_id string) string{ var count int8 db.QueryRow("SELECT referral_count FROM referral WHERE referral_id=$1",referral_id).Scan(&count) count++ db.QueryRow("UPDATE referral SET referral_count=$1 where referral_id=$2", count, referral_id) var wallet_id string db.QueryRow("SELECT wallet_id FROM referral WHERE referral_id=$1",referral_id).Scan(&wallet_id) return wallet_id } func createReferralID(referral_id, wallet_id string) bool{ fmt.Println("Creating ReferralID",referral_id, wallet_id) db.QueryRow("INSERT INTO referral(referral_id, referral_count, wallet_id) VALUES($1,$2,$3);",referral_id, 0, wallet_id) return true }
package com.woniukeji.jianmerchant.entity; public class T_job { private TJobEntity t_job; public TJobEntity getT_job() { return t_job; } public void setT_job(TJobEntity t_job) { this.t_job = t_job; } public static class TJobEntity { private int id; private int city_id; private int area_id; private int type_id; private int merchant_id; private String name; private String name_image; private String start_date; private String stop_date; private String address; private int mode; private double money; private int term; private int limit_sex; private int count; private int sum; private int day; private String regedit_time; private int status; private int hot; private String alike; private String reg_date; private int look; private int is_model; private String model_name; private String city_id_name; private String area_id_name; private String type_id_name; private String merchant_id_name; private String info_start_time; private String info_stop_time; private String info_set_place; private String info_set_time; private String info_limit_sex; private String info_term; private String info_other; private String info_work_content; private String info_work_require; private String info_tel; private String nv_job_id; private String nv_sum; private String nv_count; public int getId() { return id; } public void setId(int id) { this.id = id; } public int getCity_id() { return city_id; } public void setCity_id(int city_id) { this.city_id = city_id; } public int getArea_id() { return area_id; } public void setArea_id(int area_id) { this.area_id = area_id; } public int getType_id() { return type_id; } public void setType_id(int type_id) { this.type_id = type_id; } public int getMerchant_id() { return merchant_id; } public void setMerchant_id(int merchant_id) { this.merchant_id = merchant_id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getName_image() { return name_image; } public void setName_image(String name_image) { this.name_image = name_image; } public String getStart_date() { return start_date; } public void setStart_date(String start_date) { this.start_date = start_date; } public String getStop_date() { return stop_date; } public void setStop_date(String stop_date) { this.stop_date = stop_date; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public int getMode() { return mode; } public void setMode(int mode) { this.mode = mode; } public double getMoney() { return money; } public void setMoney(double money) { this.money = money; } public int getTerm() { return term; } public void setTerm(int term) { this.term = term; } public int getLimit_sex() { return limit_sex; } public void setLimit_sex(int limit_sex) { this.limit_sex = limit_sex; } public int getCount() { return count; } public void setCount(int count) { this.count = count; } public int getSum() { return sum; } public void setSum(int sum) { this.sum = sum; } public int getDay() { return day; } public void setDay(int day) { this.day = day; } public String getRegedit_time() { return regedit_time; } public void setRegedit_time(String regedit_time) { this.regedit_time = regedit_time; } public int getStatus() { return status; } public void setStatus(int status) { this.status = status; } public int getHot() { return hot; } public void setHot(int hot) { this.hot = hot; } public String getAlike() { return alike; } public void setAlike(String alike) { this.alike = alike; } public String getReg_date() { return reg_date; } public void setReg_date(String reg_date) { this.reg_date = reg_date; } public int getLook() { return look; } public void setLook(int look) { this.look = look; } public int getIs_model() { return is_model; } public void setIs_model(int is_model) { this.is_model = is_model; } public String getModel_name() { return model_name; } public void setModel_name(String model_name) { this.model_name = model_name; } public String getCity_id_name() { return city_id_name; } public void setCity_id_name(String city_id_name) { this.city_id_name = city_id_name; } public String getArea_id_name() { return area_id_name; } public void setArea_id_name(String area_id_name) { this.area_id_name = area_id_name; } public String getType_id_name() { return type_id_name; } public void setType_id_name(String type_id_name) { this.type_id_name = type_id_name; } public String getMerchant_id_name() { return merchant_id_name; } public void setMerchant_id_name(String merchant_id_name) { this.merchant_id_name = merchant_id_name; } public String getInfo_start_time() { return info_start_time; } public void setInfo_start_time(String info_start_time) { this.info_start_time = info_start_time; } public String getInfo_stop_time() { return info_stop_time; } public void setInfo_stop_time(String info_stop_time) { this.info_stop_time = info_stop_time; } public String getInfo_set_place() { return info_set_place; } public void setInfo_set_place(String info_set_place) { this.info_set_place = info_set_place; } public String getInfo_set_time() { return info_set_time; } public void setInfo_set_time(String info_set_time) { this.info_set_time = info_set_time; } public String getInfo_limit_sex() { return info_limit_sex; } public void setInfo_limit_sex(String info_limit_sex) { this.info_limit_sex = info_limit_sex; } public String getInfo_term() { return info_term; } public void setInfo_term(String info_term) { this.info_term = info_term; } public String getInfo_other() { return info_other; } public void setInfo_other(String info_other) { this.info_other = info_other; } public String <API key>() { return info_work_content; } public void <API key>(String info_work_content) { this.info_work_content = info_work_content; } public String <API key>() { return info_work_require; } public void <API key>(String info_work_require) { this.info_work_require = info_work_require; } public String getInfo_tel() { return info_tel; } public void setInfo_tel(String info_tel) { this.info_tel = info_tel; } public String getNv_job_id() { return nv_job_id; } public void setNv_job_id(String nv_job_id) { this.nv_job_id = nv_job_id; } public String getNv_sum() { return nv_sum; } public void setNv_sum(String nv_sum) { this.nv_sum = nv_sum; } public String getNv_count() { return nv_count; } public void setNv_count(String nv_count) { this.nv_count = nv_count; } } }
package edu.columbia.cloud.plnr.entities; import javax.jdo.annotations.IdGeneratorStrategy; import javax.jdo.annotations.PersistenceCapable; import javax.jdo.annotations.Persistent; import javax.jdo.annotations.PrimaryKey; import com.google.appengine.api.datastore.Key; @PersistenceCapable public class Subject { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key key; @Persistent private String name; public Subject(Key key, String name) { super(); this.key = key; this.name = name; } public Key getKey() { return key; } public void setKey(Key key) { this.key = key; } public String getName() { return name; } public void setName(String name) { this.name = name; } }
# -*- coding: utf-8 -*- # Scrapy settings for crawlAll project # For simplicity, this file contains only settings considered important or # commonly used. You can find more settings consulting the documentation: BOT_NAME = 'crawlAll' SPIDER_MODULES = ['crawlAll.spiders'] NEWSPIDER_MODULE = 'crawlAll.spiders' # Crawl responsibly by identifying yourself (and your website) on the user-agent # Obey robots.txt rules ROBOTSTXT_OBEY = False # Configure maximum concurrent requests performed by Scrapy (default: 16) CONCURRENT_REQUESTS = 32 # Configure a delay for requests for the same website (default: 0) # See also autothrottle settings and docs DOWNLOAD_DELAY = 3 <API key> = True # The download delay setting will honor only one of: <API key> = 32 #<API key> = 16 # Disable cookies (enabled by default) COOKIES_ENABLED = False # Disable Telnet Console (enabled by default) #<API key> = False # Override the default request headers: <API key> = { # 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', # 'Accept-Language': 'en', 'X-Crawlera-Cookies':'disable' } # Enable or disable spider middlewares #SPIDER_MIDDLEWARES = { # 'crawlAll.middlewares.<API key>': 543, # Enable or disable downloader middlewares <API key> = { # 'crawlAll.useragent.<API key>':400, # 'crawlAll.middlewares.<API key>': None 'scrapy_crawlera.CrawleraMiddleware': 300 } CRAWLERA_ENABLED = True CRAWLERA_<API key> # Enable or disable extensions #EXTENSIONS = { # 'scrapy.extensions.telnet.TelnetConsole': None, # Configure item pipelines #ITEM_PIPELINES = { # 'crawlAll.pipelines.SomePipeline': 300, # Enable and configure the AutoThrottle extension (disabled by default) <API key> = False # The initial download delay #<API key> = 5 # The maximum download delay to be set in case of high latencies #<API key> = 60 # The average number of requests Scrapy should be sending in parallel to # each remote server #<API key> = 1.0 # Enable showing throttling stats for every response received: #AUTOTHROTTLE_DEBUG = False # Enable and configure HTTP caching (disabled by default) #HTTPCACHE_ENABLED = True #<API key> = 0 #HTTPCACHE_DIR = 'httpcache' #<API key> = [] #HTTPCACHE_STORAGE = 'scrapy.extensions.httpcache.<API key>'
package org.inaetics.demonstrator.producer.burst; import java.util.concurrent.Callable; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicLong; import org.inaetics.demonstrator.api.data.Sample; import org.inaetics.demonstrator.api.queue.SampleQueue; import org.inaetics.demonstrator.producer.<API key>; /** * Generates a burst of samples once every 500 ms. */ public class BurstSampleProducer extends <API key> { private static final int BURST_LENGTH = 10; // samples private final AtomicLong m_produced; private ExecutorService m_executor; // Injected by Felix DM... private volatile SampleQueue m_queue; public BurstSampleProducer() { super("Burst Sample Producer", 500000 /* msec */, 1000 /* msec */); m_produced = new AtomicLong(0L); } @Override protected long getProductionCount() { return m_produced.getAndSet(0); } @Override protected void produceSampleData() throws <API key> { Future<Void> result = null; try { result = m_executor.submit(new Callable<Void>() { @Override public Void call() throws Exception { for (int i = 0; !Thread.currentThread().isInterrupted() && i < BURST_LENGTH; i++) { double val1 = randomSampleValue(); double val2 = randomSampleValue(); Sample sample = new Sample(System.currentTimeMillis(), val1, val2); m_queue.put(sample); m_produced.addAndGet(1l); } TimeUnit.MILLISECONDS.sleep(150); // simulate dead-time... return null; } }); result.get(500, TimeUnit.MILLISECONDS); } catch (TimeoutException e) { // do not wait any longer if (result != null && !result.isDone()) { result.cancel(true); } } catch (Exception e) { // nothing we can do } } @Override protected void start() throws Exception { m_executor = Executors.<API key>(); super.start(); } @Override protected void stop() throws Exception { super.stop(); if (m_executor != null && !m_executor.isShutdown()) { m_executor.shutdownNow(); } } }
from __future__ import unicode_literals from collections import defaultdict import datetime import json from moto.compat import OrderedDict from moto.core import BaseBackend from .comparisons import get_comparison_func from .utils import unix_time class DynamoJsonEncoder(json.JSONEncoder): def default(self, obj): if hasattr(obj, 'to_json'): return obj.to_json() def dynamo_json_dump(dynamo_object): return json.dumps(dynamo_object, cls=DynamoJsonEncoder) class DynamoType(object): def __init__(self, type_as_dict): self.type = list(type_as_dict)[0] self.value = list(type_as_dict.values())[0] def __hash__(self): return hash((self.type, self.value)) def __eq__(self, other): return ( self.type == other.type and self.value == other.value ) def __lt__(self, other): return self.value < other.value def __le__(self, other): return self.value <= other.value def __gt__(self, other): return self.value > other.value def __ge__(self, other): return self.value >= other.value def __repr__(self): return "DynamoType: {0}".format(self.to_json()) def to_json(self): return {self.type: self.value} def compare(self, range_comparison, range_objs): """ Compares this type against comparison filters """ range_values = [obj.value for obj in range_objs] comparison_func = get_comparison_func(range_comparison) return comparison_func(self.value, *range_values) class Item(object): def __init__(self, hash_key, hash_key_type, range_key, range_key_type, attrs): self.hash_key = hash_key self.hash_key_type = hash_key_type self.range_key = range_key self.range_key_type = range_key_type self.attrs = {} for key, value in attrs.items(): self.attrs[key] = DynamoType(value) def __repr__(self): return "Item: {0}".format(self.to_json()) def to_json(self): attributes = {} for attribute_key, attribute in self.attrs.items(): attributes[attribute_key] = { attribute.type : attribute.value } return { "Attributes": attributes } def describe_attrs(self, attributes): if attributes: included = {} for key, value in self.attrs.items(): if key in attributes: included[key] = value else: included = self.attrs return { "Item": included } def update(self, update_expression): ACTION_VALUES = ['SET', 'REMOVE'] action = None for value in update_expression.split(): if value in ACTION_VALUES: # An action action = value continue else: # A Real value value = value.lstrip(":").rstrip(",") if action == "REMOVE": self.attrs.pop(value, None) elif action == 'SET': key, value = value.split("=:") # TODO deal with other types self.attrs[key] = DynamoType({"S": value}) def <API key>(self, attribute_updates): for attribute_name, update_action in attribute_updates.items(): action = update_action['Action'] new_value = list(update_action['Value'].values())[0] if action == 'PUT': # TODO deal with other types if isinstance(new_value, list) or isinstance(new_value, set): self.attrs[attribute_name] = DynamoType({"SS": new_value}) else: self.attrs[attribute_name] = DynamoType({"S": new_value}) class Table(object): def __init__(self, table_name, schema=None, attr=None, throughput=None, indexes=None, global_indexes=None): self.name = table_name self.attr = attr self.schema = schema self.range_key_attr = None self.hash_key_attr = None self.range_key_type = None self.hash_key_type = None for elem in schema: if elem["KeyType"] == "HASH": self.hash_key_attr = elem["AttributeName"] self.hash_key_type = elem["KeyType"] else: self.range_key_attr = elem["AttributeName"] self.range_key_type = elem["KeyType"] if throughput is None: self.throughput = {'WriteCapacityUnits': 10, 'ReadCapacityUnits': 10} else: self.throughput = throughput self.throughput["<API key>"] = 0 self.indexes = indexes self.global_indexes = global_indexes if global_indexes else [] self.created_at = datetime.datetime.now() self.items = defaultdict(dict) @property def describe(self): results = { 'Table': { '<API key>': self.attr, '<API key>': self.throughput, 'TableSizeBytes': 0, 'TableName': self.name, 'TableStatus': 'ACTIVE', 'KeySchema': self.schema, 'ItemCount': len(self), 'CreationDateTime': unix_time(self.created_at), '<API key>': [index for index in self.global_indexes], } } return results def __len__(self): count = 0 for key, value in self.items.items(): if self.has_range_key: count += len(value) else: count += 1 return count @property def hash_key_names(self): keys = [self.hash_key_attr] for index in self.global_indexes: for key in index['KeySchema']: if key['KeyType'] == 'HASH': keys.append(key['AttributeName']) return keys @property def range_key_names(self): keys = [self.range_key_attr] for index in self.global_indexes: for key in index['KeySchema']: if key['KeyType'] == 'RANGE': keys.append(key['AttributeName']) return keys def put_item(self, item_attrs, expected = None, overwrite = False): hash_value = DynamoType(item_attrs.get(self.hash_key_attr)) if self.has_range_key: range_value = DynamoType(item_attrs.get(self.range_key_attr)) else: range_value = None item = Item(hash_value, self.hash_key_type, range_value, self.range_key_type, item_attrs) if not overwrite: if expected is None: expected = {} lookup_range_value = range_value else: <API key> = expected.get(self.range_key_attr, {}).get("Value") if(<API key> is None): lookup_range_value = range_value else: lookup_range_value = DynamoType(<API key>) current = self.get_item(hash_value, lookup_range_value) if current is None: current_attr = {} elif hasattr(current,'attrs'): current_attr = current.attrs else: current_attr = current for key, val in expected.items(): if 'Exists' in val and val['Exists'] == False: if key in current_attr: raise ValueError("The conditional request failed") elif key not in current_attr: raise ValueError("The conditional request failed") elif DynamoType(val['Value']).value != current_attr[key].value: raise ValueError("The conditional request failed") if range_value: self.items[hash_value][range_value] = item else: self.items[hash_value] = item return item def __nonzero__(self): return True def __bool__(self): return self.__nonzero__() @property def has_range_key(self): return self.range_key_attr is not None def get_item(self, hash_key, range_key=None): if self.has_range_key and not range_key: raise ValueError("Table has a range key, but no range key was passed into get_item") try: if range_key: return self.items[hash_key][range_key] else: return self.items[hash_key] except KeyError: return None def delete_item(self, hash_key, range_key): try: if range_key: return self.items[hash_key].pop(range_key) else: return self.items.pop(hash_key) except KeyError: return None def query(self, hash_key, range_comparison, range_objs): results = [] last_page = True # Once pagination is implemented, change this possible_results = [item for item in list(self.all_items()) if isinstance(item, Item) and item.hash_key == hash_key] if range_comparison: for result in possible_results: if result.range_key.compare(range_comparison, range_objs): results.append(result) else: # If we're not filtering on range key, return all values results = possible_results results.sort(key=lambda item: item.range_key) return results, last_page def all_items(self): for hash_set in self.items.values(): if self.range_key_attr: for item in hash_set.values(): yield item else: yield hash_set def scan(self, filters): results = [] scanned_count = 0 last_page = True # Once pagination is implemented, change this for result in self.all_items(): scanned_count += 1 <API key> = True for attribute_name, (comparison_operator, comparison_objs) in filters.items(): attribute = result.attrs.get(attribute_name) if attribute: # Attribute found if not attribute.compare(comparison_operator, comparison_objs): <API key> = False break elif comparison_operator == 'NULL': # Comparison is NULL and we don't have the attribute continue else: # No attribute found and comparison is no NULL. This item fails <API key> = False break if <API key>: results.append(result) return results, scanned_count, last_page def lookup(self, *args, **kwargs): if not self.schema: self.describe() for x, arg in enumerate(args): kwargs[self.schema[x].name] = arg ret = self.get_item(**kwargs) if not ret.keys(): return None return ret class DynamoDBBackend(BaseBackend): def __init__(self): self.tables = OrderedDict() def create_table(self, name, **params): if name in self.tables: return None table = Table(name, **params) self.tables[name] = table return table def delete_table(self, name): return self.tables.pop(name, None) def <API key>(self, name, throughput): table = self.tables[name] table.throughput = throughput return table def put_item(self, table_name, item_attrs, expected = None, overwrite = False): table = self.tables.get(table_name) if not table: return None return table.put_item(item_attrs, expected, overwrite) def get_table_keys_name(self, table_name, keys): """ Given a set of keys, extracts the key and range key """ table = self.tables.get(table_name) if not table: return None, None else: hash_key = range_key = None for key in keys: if key in table.hash_key_names: hash_key = key elif key in table.range_key_names: range_key = key return hash_key, range_key def get_keys_value(self, table, keys): if table.hash_key_attr not in keys or (table.has_range_key and table.range_key_attr not in keys): raise ValueError("Table has a range key, but no range key was passed into get_item") hash_key = DynamoType(keys[table.hash_key_attr]) range_key = DynamoType(keys[table.range_key_attr]) if table.has_range_key else None return hash_key, range_key def get_table(self, table_name): return self.tables.get(table_name) def get_item(self, table_name, keys): table = self.get_table(table_name) if not table: raise ValueError("No table found") hash_key, range_key = self.get_keys_value(table, keys) return table.get_item(hash_key, range_key) def query(self, table_name, hash_key_dict, range_comparison, range_value_dicts): table = self.tables.get(table_name) if not table: return None, None hash_key = DynamoType(hash_key_dict) range_values = [DynamoType(range_value) for range_value in range_value_dicts] return table.query(hash_key, range_comparison, range_values) def scan(self, table_name, filters): table = self.tables.get(table_name) if not table: return None, None, None scan_filters = {} for key, (comparison_operator, comparison_values) in filters.items(): dynamo_types = [DynamoType(value) for value in comparison_values] scan_filters[key] = (comparison_operator, dynamo_types) return table.scan(scan_filters) def update_item(self, table_name, key, update_expression, attribute_updates): table = self.get_table(table_name) if table.hash_key_attr in key: # Sometimes the key is wrapped in a dict with the key name key = key[table.hash_key_attr] hash_value = DynamoType(key) item = table.get_item(hash_value) if update_expression: item.update(update_expression) else: item.<API key>(attribute_updates) return item def delete_item(self, table_name, keys): table = self.tables.get(table_name) if not table: return None hash_key, range_key = self.get_keys_value(table, keys) return table.delete_item(hash_key, range_key) dynamodb_backend2 = DynamoDBBackend()
# AUTOGENERATED FILE FROM balenalib/kitra710-ubuntu:cosmic-build ENV GO_VERSION 1.14.14 RUN mkdir -p /usr/local/go \ && curl -SLO "https://storage.googleapis.com/golang/go$GO_VERSION.linux-arm64.tar.gz" \ && echo "<SHA256-like> go$GO_VERSION.linux-arm64.tar.gz" | sha256sum -c - \ && tar -xzf "go$GO_VERSION.linux-arm64.tar.gz" -C /usr/local/go --strip-components=1 \ && rm -f go$GO_VERSION.linux-arm64.tar.gz ENV GOROOT /usr/local/go ENV GOPATH /go ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" WORKDIR $GOPATH CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"] RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/<SHA1-like>/scripts/assets/tests/test-stack@golang.sh" \ && echo "Running test-stack@golang" \ && chmod +x test-stack@golang.sh \ && bash test-stack@golang.sh \ && rm -rf test-stack@golang.sh RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https: RUN echo '#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \ && chmod +x /bin/sh-shim \ && cp /bin/sh /bin/sh.real \ && mv /bin/sh-shim /bin/sh
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="zh"> <head> <!-- Generated by javadoc (1.8.0_111) on Mon Oct 22 12:02:43 CST 2018 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title> (netty 1.0.1 API)</title> <meta name="date" content="2018-10-22"> <link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> <script type="text/javascript" src="script.js"></script> </head> <body> <script type="text/javascript"><! try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="\u5E38\u91CF\u5B57\u6BB5\u503C (netty 1.0.1 API)"; } } catch(err) { } </script> <noscript> <div> JavaScript</div> </noscript> <div class="topNav"><a name="navbar.top"> </a> <div class="skipNav"><a href="#skip.navbar.top" title=""></a></div> <a name="navbar.top.firstrow"> </a> <ul class="navList" title=""> <li><a href="overview-summary.html"></a></li> <li></li> <li></li> <li></li> <li><a href="overview-tree.html"></a></li> <li><a href="deprecated-list.html"></a></li> <li><a href="index-all.html"></a></li> <li><a href="help-doc.html"></a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li></li> <li></li> </ul> <ul class="navList"> <li><a href="index.html?constant-values.html" target="_top"></a></li> <li><a href="constant-values.html" target="_top"></a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="allclasses-noframe.html"></a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip.navbar.top"> </a></div> <div class="header"> <h1 title="" class="title"></h1> <h2 title=""></h2> </div> <div class="bottomNav"><a name="navbar.bottom"> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title=""></a></div> <a name="navbar.bottom.firstrow"> </a> <ul class="navList" title=""> <li><a href="overview-summary.html"></a></li> <li></li> <li></li> <li></li> <li><a href="overview-tree.html"></a></li> <li><a href="deprecated-list.html"></a></li> <li><a href="index-all.html"></a></li> <li><a href="help-doc.html"></a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li></li> <li></li> </ul> <ul class="navList"> <li><a href="index.html?constant-values.html" target="_top"></a></li> <li><a href="constant-values.html" target="_top"></a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="allclasses-noframe.html"></a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip.navbar.bottom"> </a></div> <p class="legalCopy"><small>Copyright & </body> </html>
package example.model; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; @Entity public class Customer1175 { @Id @GeneratedValue(strategy = GenerationType.AUTO) private long id; private String firstName; private String lastName; protected Customer1175() {} public Customer1175(String firstName, String lastName) { this.firstName = firstName; this.lastName = lastName; } @Override public String toString() { return String.format("Customer1175[id=%d, firstName='%s', lastName='%s']", id, firstName, lastName); } }
#include <stdio.h> #include <math.h> int main(void) { double n; while(EOF != scanf("%lf", &n) && n) { /* if(sqrt(n) - (int)sqrt(n) < 0.000000001) printf("yes\n"); else printf("no\n"); */ double a = pow(n, 1.0/2); if(a - (int)a < 0.0000000001) printf("yes\n"); else printf("no\n"); } return 0; }
package cn.vip.ldcr; import android.view.InputDevice; import android.view.InputDevice.MotionRange; import android.view.MotionEvent; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; /* compiled from: SDLActivity */ class <API key> extends SDLJoystickHandler { private ArrayList<SDLJoystick> mJoysticks = new ArrayList<>(); /* compiled from: SDLActivity */ static class RangeComparator implements Comparator<MotionRange> { RangeComparator() { } public int compare(MotionRange arg0, MotionRange arg1) { return arg0.getAxis() - arg1.getAxis(); } } /* compiled from: SDLActivity */ static class SDLJoystick { public ArrayList<MotionRange> axes; public int device_id; public ArrayList<MotionRange> hats; public String name; SDLJoystick() { } } public void pollInputDevices() { int[] deviceIds = InputDevice.getDeviceIds(); for (int i = deviceIds.length - 1; i > -1; i if (getJoystick(deviceIds[i]) == null) { SDLJoystick joystick = new SDLJoystick(); InputDevice joystickDevice = InputDevice.getDevice(deviceIds[i]); if ((joystickDevice.getSources() & 16) != 0) { joystick.device_id = deviceIds[i]; joystick.name = joystickDevice.getName(); joystick.axes = new ArrayList<>(); joystick.hats = new ArrayList<>(); List<MotionRange> ranges = joystickDevice.getMotionRanges(); Collections.sort(ranges, new RangeComparator()); for (MotionRange range : ranges) { if ((range.getSource() & 16) != 0) { if (range.getAxis() == 15 || range.getAxis() == 16) { joystick.hats.add(range); } else { joystick.axes.add(range); } } } this.mJoysticks.add(joystick); SDLActivity.nativeAddJoystick(joystick.device_id, joystick.name, 0, -1, joystick.axes.size(), joystick.hats.size() / 2, 0); } } } ArrayList<Integer> removedDevices = new ArrayList<>(); for (int i2 = 0; i2 < this.mJoysticks.size(); i2++) { int device_id = ((SDLJoystick) this.mJoysticks.get(i2)).device_id; int j = 0; while (j < deviceIds.length && device_id != deviceIds[j]) { j++; } if (j == deviceIds.length) { removedDevices.add(Integer.valueOf(device_id)); } } for (int i3 = 0; i3 < removedDevices.size(); i3++) { int device_id2 = ((Integer) removedDevices.get(i3)).intValue(); SDLActivity.<API key>(device_id2); int j2 = 0; while (true) { if (j2 >= this.mJoysticks.size()) { break; } else if (((SDLJoystick) this.mJoysticks.get(j2)).device_id == device_id2) { this.mJoysticks.remove(j2); break; } else { j2++; } } } } /* access modifiers changed from: protected */ public SDLJoystick getJoystick(int device_id) { for (int i = 0; i < this.mJoysticks.size(); i++) { if (((SDLJoystick) this.mJoysticks.get(i)).device_id == device_id) { return (SDLJoystick) this.mJoysticks.get(i); } } return null; } public boolean handleMotionEvent(MotionEvent event) { if ((event.getSource() & 16777232) != 0) { int actionPointerIndex = event.getActionIndex(); switch (event.getActionMasked()) { case 2: SDLJoystick joystick = getJoystick(event.getDeviceId()); if (joystick != null) { for (int i = 0; i < joystick.axes.size(); i++) { MotionRange range = (MotionRange) joystick.axes.get(i); SDLActivity.onNativeJoy(joystick.device_id, i, (((event.getAxisValue(range.getAxis(), actionPointerIndex) - range.getMin()) / range.getRange()) * 2.0f) - 1.0f); } for (int i2 = 0; i2 < joystick.hats.size(); i2 += 2) { SDLActivity.onNativeHat(joystick.device_id, i2 / 2, Math.round(event.getAxisValue(((MotionRange) joystick.hats.get(i2)).getAxis(), actionPointerIndex)), Math.round(event.getAxisValue(((MotionRange) joystick.hats.get(i2 + 1)).getAxis(), actionPointerIndex))); } break; } break; } } return true; } }
package lee; import org.springframework.context.*; import org.springframework.context.support.*; import org.crazyit.app.service.*; public class SpringTest { public static void main(String[] args) { ApplicationContext ctx = new <API key>("bean.xml"); Person p1 = ctx.getBean("chinese" , Person.class); System.out.println(p1.sayHello("Mary")); System.out.println(p1.sayGoodBye("Mary")); Person p2 = ctx.getBean("american" , Person.class); System.out.println(p2.sayHello("Jack")); System.out.println(p2.sayGoodBye("Jack")); } }