answer
stringlengths
15
1.25M
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_92) on Wed Jul 27 21:19:21 CEST 2016 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>net.sourceforge.pmd.lang.java.typeresolution Class Hierarchy (PMD 5.5.1 API)</title> <meta name="date" content="2016-07-27"> <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="net.sourceforge.pmd.lang.java.typeresolution Class Hierarchy (PMD 5.5.1 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>Class</li> <li>Use</li> <li class="navBarCell1Rev">Tree</li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../../net/sourceforge/pmd/lang/java/symboltable/package-tree.html">Prev</a></li> <li><a href="../../../../../../net/sourceforge/pmd/lang/java/typeresolution/rules/package-tree.html">Next</a></li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?net/sourceforge/pmd/lang/java/typeresolution/package-tree.html" target="_top">Frames</a></li> <li><a href="package-tree.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"> <h1 class="title">Hierarchy For Package net.sourceforge.pmd.lang.java.typeresolution</h1> <span class="<API key>">Package Hierarchies:</span> <ul class="horizontal"> <li><a href="../../../../../../overview-tree.html">All Packages</a></li> </ul> </div> <div class="contentContainer"> <h2 title="Class Hierarchy">Class Hierarchy</h2> <ul> <li type="circle">java.lang.<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang"><span class="typeNameLink">Object</span></a> <ul> <li type="circle">java.lang.<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html?is-external=true" title="class or interface in java.lang"><span class="typeNameLink">ClassLoader</span></a> <ul> <li type="circle">net.sourceforge.pmd.lang.java.typeresolution.<a href="../../../../../../net/sourceforge/pmd/lang/java/typeresolution/PMDASMClassLoader.html" title="class in net.sourceforge.pmd.lang.java.typeresolution"><span class="typeNameLink">PMDASMClassLoader</span></a></li> </ul> </li> <li type="circle">net.sourceforge.pmd.lang.java.ast.<a href="../../../../../../net/sourceforge/pmd/lang/java/ast/<API key>.html" title="class in net.sourceforge.pmd.lang.java.ast"><span class="typeNameLink"><API key></span></a> (implements net.sourceforge.pmd.lang.java.ast.<a href="../../../../../../net/sourceforge/pmd/lang/java/ast/JavaParserVisitor.html" title="interface in net.sourceforge.pmd.lang.java.ast">JavaParserVisitor</a>) <ul> <li type="circle">net.sourceforge.pmd.lang.java.typeresolution.<a href="../../../../../../net/sourceforge/pmd/lang/java/typeresolution/ClassTypeResolver.html" title="class in net.sourceforge.pmd.lang.java.typeresolution"><span class="typeNameLink">ClassTypeResolver</span></a></li> <li type="circle">net.sourceforge.pmd.lang.java.typeresolution.<a href="../../../../../../net/sourceforge/pmd/lang/java/typeresolution/<API key>.html" title="class in net.sourceforge.pmd.lang.java.typeresolution"><span class="typeNameLink"><API key></span></a></li> </ul> </li> <li type="circle">net.sourceforge.pmd.lang.java.typeresolution.<a href="../../../../../../net/sourceforge/pmd/lang/java/typeresolution/TypeHelper.html" title="class in net.sourceforge.pmd.lang.java.typeresolution"><span class="typeNameLink">TypeHelper</span></a></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>Class</li> <li>Use</li> <li class="navBarCell1Rev">Tree</li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../../net/sourceforge/pmd/lang/java/symboltable/package-tree.html">Prev</a></li> <li><a href="../../../../../../net/sourceforge/pmd/lang/java/typeresolution/rules/package-tree.html">Next</a></li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?net/sourceforge/pmd/lang/java/typeresolution/package-tree.html" target="_top">Frames</a></li> <li><a href="package-tree.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>
drop table if exists onlineddl_test; create table onlineddl_test ( id int auto_increment, c1 int not null default 0, c2 int not null default 0, primary key (id) ) auto_increment=1; insert into onlineddl_test values (97, 7, 23); drop event if exists onlineddl_test; delimiter ;; create event onlineddl_test on schedule every 1 second starts current_timestamp ends current_timestamp + interval 60 second on completion not preserve enable do begin insert ignore into onlineddl_test values (1, 11, 23); insert ignore into onlineddl_test values (2, 13, 23); insert into onlineddl_test values (null, 17, 23); set @last_insert_id := last_insert_id(); update onlineddl_test set c1=c1+@last_insert_id, c2=c2+@last_insert_id where id=@last_insert_id order by id desc limit 1; delete from onlineddl_test where id=1; delete from onlineddl_test where c1=13; -- id=2 end ;;
package com.airhacks.hello.business.order.boundary; import javax.ejb.Stateless; import javax.inject.Inject; import javax.json.JsonObject; import javax.ws.rs.POST; import javax.ws.rs.Path; /** * * @author airhacks.com */ @Stateless @Path("orders") public class OrdersResource { @Inject OrderProcessor processor; @POST public void order(JsonObject order) { String trackingNumber = order.getString("tracking-number"); processor.order(trackingNumber); } }
Foosball::Application.routes.draw do resources :bagels resources :players root :to => "bagels#home" get "sign_in" => "sign_in#index" post "sign_in" => "sign_in#create" get "home" => "bagels#home" end
// Push notifications var deviceToken = null; // Initialize PushNotification for Android // and Obtaining a device token function <API key>(){ // Require the module var CloudPush = require('ti.cloudpush'); CloudPush.debug = true; CloudPush.enabled = true; CloudPush.<API key> = true; CloudPush.<API key> = true; CloudPush.focusAppOnPush = false; // Initialize the module CloudPush.retrieveDeviceToken({ success: deviceTokenSuccess, error: deviceTokenError }); // Process incoming push notifications CloudPush.addEventListener('callback', function (evt) { alert("Notification received: " + evt.payload); }); CloudPush.addEventListener('<API key>', function(evt) { Ti.API.info('Tray Click Launched App (app was not running)'); }); // Triggered when the push notifications is in the tray when the app is running CloudPush.addEventListener('trayClickFocusedApp', function(evt) { Ti.API.info('Tray Click Focused App (app was already running)'); }); } // Initialize PushNotification for iOS // and Obtaining a device token function initializePushIOS(){ if (Ti.Platform.name == "iPhone OS" && parseInt(Ti.Platform.version.split(".")[0]) >= 8) { // Wait for user settings to be registered before registering for push notifications Ti.App.iOS.addEventListener('<API key>', function registerForPush() { // Remove event listener once registered for push notifications Ti.App.iOS.removeEventListener('<API key>', registerForPush); Ti.Network.<API key>({ success: deviceTokenSuccess, error: deviceTokenError, callback: receivePushIOS }); }); // Register notification types to use Ti.App.iOS.<API key>({ types: [ Ti.App.iOS.<API key>, Ti.App.iOS.<API key>, Ti.App.iOS.<API key> ] }); } // For iOS 7 and earlier else { Ti.Network.<API key>({ // Specifies which notifications to receive types: [ Ti.Network.<API key>, Ti.Network.<API key>, Ti.Network.<API key> ], success: deviceTokenSuccess, error: deviceTokenError, callback: receivePushIOS }); } // Process incoming push notifications function receivePushIOS(e) { alert('Received push: ' + JSON.stringify(e)); } } // Enable push notifications for this device // Save the device token for subsequent API calls function deviceTokenSuccess(e) { deviceToken = e.deviceToken; console.info("Device Token received: " + deviceToken); subscribeToChannel(); } function deviceTokenError(e) { alert('Failed to register for push notifications! ' + e.error); } // Subscribe with token // Require the Cloud module var Cloud = require("ti.cloud"); function subscribeToChannel () { console.info("Subscribing to channel by using a Token ..."); // Subscribes the device to the 'news_alerts' channel // Specify the push type as either 'android' for Android or 'ios' for iOS Cloud.PushNotifications.subscribeToken({ device_token: deviceToken, channel: 'news_alerts', type: Ti.Platform.name == 'android' ? 'android' : 'ios' }, function (e) { if (e.success) { //alert('Subscribed'); } else { alert('Error:\n' + ((e.error && e.message) || JSON.stringify(e))); } }); } function <API key> () { // Unsubscribes the device from the 'test' channel Cloud.PushNotifications.unsubscribeToken({ device_token: deviceToken, channel: 'news_alerts', }, function (e) { if (e.success) { alert('Unsubscribed'); } else { alert('Error:\n' + ((e.error && e.message) || JSON.stringify(e))); } }); } function gotoMapWin() { Alloy.createController("mappage").getView(); } function gotoPlaceWin() { Alloy.createController("place").getView(); } function gotoShowWin() { Alloy.createController("show").getView(); } var osname = Ti.Platform.osname; var win = Ti.UI.createWindow({ backgroundColor: 'white', layout:'vertical', exitOnClose: true }); var subscribe = Ti.UI.createButton({title:'Subscribe'}); subscribe.addEventListener('click', subscribeToChannel); win.add(subscribe); var unsubscribe = Ti.UI.createButton({title:'Unsubscribe'}); unsubscribe.addEventListener('click', <API key>); win.add(unsubscribe); var placebut=Ti.UI.createButton({title:'Place Page'}); placebut.addEventListener('click',gotoPlaceWin); win.add(placebut); var sbut=Ti.UI.createButton({title:'Show Page'}); sbut.addEventListener('click',gotoShowWin); win.add(sbut); var mapbut=Ti.UI.createButton({title:'Map Page'}); mapbut.addEventListener('click',gotoMapWin); win.add(mapbut); // This is a single context application with multiple windows in a stack if (osname === 'android') { <API key>(); } else { initializePushIOS(); } win.open();
<h1>Issue Dashboard</h1> <hr/> <div class="row"> <div class="col-md-4 chart-container"> <it-bar-chart data="dataPoints.values"></it-bar-chart> </div> <div class="col-md-4 chart-container"> <it-bar-chart data="[5, 8, 53, 16, 23, 42]"></it-bar-chart> </div> <div class="col-md-4 chart-container"> <it-bar-chart data="[10, 8, 15, 203, 23, 42]"></it-bar-chart> </div> </div> <hr/> <h2>Current Open Issues</h2> <table class="table table-striped centered-header"> <thead> <tr> <th>Issue name</th> <th>Opened By</th> <th>Assignee</th> <th>Date Opened</th> </tr> </thead> <tbody> <tr ng-repeat="thing in awesomeThings | filter:isOpen"> <td><a href="#/issues/{{thing.id}}">{{thing.name}}</a></td> <td>{{thing.openedBy}}</td> <td>{{thing.assignee}}</td> <td>{{thing.opened | date}}</td> </tr> <tr ng-if="(awesomeThings | filter:isOpen).length == 0"> <td style="text-align: center; font-weight: bold;" colspan="4">No issues, yay!</td> </tr> </tbody> </table>
package com.etapps.trovenla.models.libraries; import javax.annotation.Generated; import com.google.gson.annotations.Expose; @Generated("org.jsonschema2pojo") public class Libraries { @Expose private Response response; /** * * @return * The response */ public Response getResponse() { return response; } /** * * @param response * The response */ public void setResponse(Response response) { this.response = response; } }
var searchData= [ ['handleinput',['HandleInput',['../<API key>.html#<API key>',1,'ScreenManager.MenuScren.BaseMenuScreen.HandleInput()'],['../<API key>.html#<API key>',1,'ScreenManager.PantallasBases.PopupScreen.HandleInput()'],['../<API key>.html#<API key>',1,'ScreenManager.StateControl.GameScreen.HandleInput()']]] ];
<!DOCTYPE html> <html lang="en"> <head> <title>JSHint Report</title> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> </head> <body> <div class="container-fluid"> <table class="table table-hover"> <tr> <th class="text-center">Code</th> <th class="text-center">Line</th> <th class="text-center">Column</th> <th>Evidence</th> <th>Reason</th> </tr> <tr><td colspan="5"><b>C:\source-GitHub\mashupjs.<API key>\src\Mashup.UI.App1\wwwroot\app.js</b></td></tr><tr class="warning"> <td class="text-center">W101</td> <td class="text-center">1</td> <td class="text-center">253</td> <td><code>// ALL GOOD IF NO ERRORS BELOW THIS LINE - I&#039;m leaving this in the code to force the <API key> pligin to update the html file. If there are no errors then no report is written so you never know if your last JSHint error is fixed or not.</code></td> <td>Line is too long.</td> </tr> </table> <div class="well"> Found <span class="label label-default">1</span> failures - <span class="label label-danger">0 errors</span> &amp; <span class="label label-warning">1 warnings</span> </div> </div> </body> </html>
-- Quick pex importer for Corona local M = {} local function getFile( filename, base ) if not base then base = system.ResourceDirectory; end local path = system.pathForFile( filename, base ) local contents local file = io.open( path, "r" ) if file then contents = file:read( "*a" ) io.close( file ) -- close the file after using it else assert(filename .. " not found") end return contents end local function firstToUpper(str) return (str:gsub("^%l", string.upper)) end local function strip(s) local t = {} local ni,c,label,xarg, empty local i, j = 1, 1 while true do ni,j,c,label,xarg, empty = string.find(s, "<(%/?)([%w:]+)(.-)(%/?)>", i) if not ni then break end if c ~= "/" then if label ~= "<API key>" and label ~= "texture" then --print("Found:", label) local args = {} local k = 1 for w in string.gmatch(xarg, "[%w%.%-]+") do args[k] = w; k = k + 1; end for k = 1, #args, 2 do sk, sv = args[k], args[k+1] --print(sk,"=",sv) if sk == "value" then t[label] = tonumber(sv) elseif sk == "x" or sk == "y" then t[label..sk] = tonumber(sv) elseif sk == "data" then --skip else t[label..firstToUpper(sk)] = tonumber(sv) end end elseif label == "texture" then local args = {} local k = 1 for w in string.gmatch(xarg, "[%w%.%-]+") do args[k] = w; k = k + 1; end for k = 1, #args, 2 do sk, sv = args[k], args[k+1] if sk == "name" then t["textureName"] = sv end end end end i = j+1 end return t end function M.load(pexFile, textureFileName) local pexData = {} local pexXML = getFile( pexFile ) pexData = strip(pexXML) -- lifespan fix if pexData.particleLifeSpan == 0 then pexData.particleLifeSpan = 1 end pexData.particleLifespan = pexData.particleLifeSpan -- get filename or override pexData.textureFileName = textureFileName or pexData.textureName return pexData end return M
package galaxyspace.systems.SolarSystem.planets.overworld.items; import galaxyspace.core.prefab.items.GSItemBlockDesc; import galaxyspace.systems.SolarSystem.planets.overworld.blocks.BlockOres; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; public class ItemBlocksOres extends GSItemBlockDesc { public ItemBlocksOres(Block block) { super(block); setMaxDamage(0); setHasSubtypes(true); } @Override public int getMetadata(int meta) { return meta; } @Override public String getUnlocalizedName(ItemStack is) { return "tile." + BlockOres.EnumBlockOres.byMetadata(is.getItemDamage()).getName(); } }
layout: post title: "10ChromeFireFox" date: 2009-12-01 02:06 author: Eyon comments: true tags: [Chrome, chrome autocopy, Chrome IE tab, Chrome, Chrome] Google[](http: **** <a href="http: **IE-Tab**ChromeIEChromeChrome[ChromePlus](http: **TwitterBar**Twitter <a href="http: **ScribeFire**WordpressWindows Live SpaceDrupal<!--more **StumbleUpon** <a href="http: **FaviconizeTab**favicon **Autocopy**Chrome**[](http://bbs.chromi.org/thread-6604-1-1.html)** **LeechBlock**Chrome <a href="http: **Taboo**TabooChrome **Stylish**FireFoxStylishChrome <a href="http: [IT News Wire](http:
/* 7zCrc.c -- CRC32 init 2015-03-10 : Igor Pavlov : Public domain */ #include <LZMA/Precomp.h> #include <LZMA/7zCrc.h> #include <LZMA/CpuArch.h> #define kCrcPoly 0xEDB88320 #ifdef MY_CPU_LE #define CRC_NUM_TABLES 8 #else #define CRC_NUM_TABLES 9 #define CRC_UINT32_SWAP(v) ((v >> 24) | ((v >> 8) & 0xFF00) | ((v << 8) & 0xFF0000) | (v << 24)) UInt32 MY_FAST_CALL CrcUpdateT1_BeT4(UInt32 v, const void *data, size_t size, const UInt32 *table); UInt32 MY_FAST_CALL CrcUpdateT1_BeT8(UInt32 v, const void *data, size_t size, const UInt32 *table); #endif #ifndef MY_CPU_BE UInt32 MY_FAST_CALL CrcUpdateT4(UInt32 v, const void *data, size_t size, const UInt32 *table); UInt32 MY_FAST_CALL CrcUpdateT8(UInt32 v, const void *data, size_t size, const UInt32 *table); #endif typedef UInt32 (MY_FAST_CALL *CRC_FUNC)(UInt32 v, const void *data, size_t size, const UInt32 *table); CRC_FUNC g_CrcUpdateT4; CRC_FUNC g_CrcUpdateT8; CRC_FUNC g_CrcUpdate; UInt32 g_CrcTable[256 * CRC_NUM_TABLES]; UInt32 MY_FAST_CALL CrcUpdate(UInt32 v, const void *data, size_t size) { return g_CrcUpdate(v, data, size, g_CrcTable); } UInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size) { return g_CrcUpdate(CRC_INIT_VAL, data, size, g_CrcTable) ^ CRC_INIT_VAL; } #define CRC_UPDATE_BYTE_2(crc, b) (table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8)) UInt32 MY_FAST_CALL CrcUpdateT1(UInt32 v, const void *data, size_t size, const UInt32 *table) { const Byte *p = (const Byte *)data; const Byte *pEnd = p + size; for (; p != pEnd; p++) v = CRC_UPDATE_BYTE_2(v, *p); return v; } void MY_FAST_CALL CrcGenerateTable() { UInt32 i; for (i = 0; i < 256; i++) { UInt32 r = i; unsigned j; for (j = 0; j < 8; j++) r = (r >> 1) ^ (kCrcPoly & ~((r & 1) - 1)); g_CrcTable[i] = r; } for (; i < 256 * CRC_NUM_TABLES; i++) { UInt32 r = g_CrcTable[i - 256]; g_CrcTable[i] = g_CrcTable[r & 0xFF] ^ (r >> 8); } #if CRC_NUM_TABLES < 4 g_CrcUpdate = CrcUpdateT1; #else #ifdef MY_CPU_LE g_CrcUpdateT4 = CrcUpdateT4; g_CrcUpdate = CrcUpdateT4; #if CRC_NUM_TABLES >= 8 g_CrcUpdateT8 = CrcUpdateT8; #ifdef MY_CPU_X86_OR_AMD64 if (!CPU_Is_InOrder()) g_CrcUpdate = CrcUpdateT8; #endif #endif #else { #ifndef MY_CPU_BE UInt32 k = 0x01020304; const Byte *p = (const Byte *)&k; if (p[0] == 4 && p[1] == 3) { g_CrcUpdateT4 = CrcUpdateT4; g_CrcUpdate = CrcUpdateT4; #if CRC_NUM_TABLES >= 8 g_CrcUpdateT8 = CrcUpdateT8; // g_CrcUpdate = CrcUpdateT8; #endif } else if (p[0] != 1 || p[1] != 2) g_CrcUpdate = CrcUpdateT1; else #endif { for (i = 256 * CRC_NUM_TABLES - 1; i >= 256; i { UInt32 x = g_CrcTable[i - 256]; g_CrcTable[i] = CRC_UINT32_SWAP(x); } g_CrcUpdateT4 = CrcUpdateT1_BeT4; g_CrcUpdate = CrcUpdateT1_BeT4; #if CRC_NUM_TABLES >= 8 g_CrcUpdateT8 = CrcUpdateT1_BeT8; // g_CrcUpdate = CrcUpdateT1_BeT8; #endif } } #endif #endif }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ModelCantina { public class Funcionario { public int IdFuncionario { get; set; } public string Nome { get; set; } public string Matricula { get; set; } public override string ToString() { return Nome; } } }
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/privacy/dlp/v2/dlp.proto package com.google.privacy.dlp.v2; public interface <API key> extends // @@<API key>(interface_extends:google.privacy.dlp.v2.KmsWrappedCryptoKey) com.google.protobuf.MessageOrBuilder { /** * * * <pre> * The wrapped data crypto key. [required] * </pre> * * <code>bytes wrapped_key = 1;</code> */ com.google.protobuf.ByteString getWrappedKey(); /** * * * <pre> * The resource name of the KMS CryptoKey to use for unwrapping. [required] * </pre> * * <code>string crypto_key_name = 2;</code> */ java.lang.String getCryptoKeyName(); /** * * * <pre> * The resource name of the KMS CryptoKey to use for unwrapping. [required] * </pre> * * <code>string crypto_key_name = 2;</code> */ com.google.protobuf.ByteString <API key>(); }
package cs.si.stavor.web; import org.xwalk.core.XWalkResourceClient; import org.xwalk.core.XWalkView; /** * XWalk client class * @author Xavier Gibert * */ public class MyResourceClient extends XWalkResourceClient { public MyResourceClient(XWalkView view) { super(view); } /*@Override public void onProgressChanged(XWalkView view, int progress) { // Activities and WebViews measure progress with different scales. // The progress meter will automatically disappear when we reach 100% try{ if(progress==100) simulator.setBrowserLoaded(true); setProgress(progress * 100); }catch(<API key> nulle){ } }*/ }
package kr.lul.kobalttown.account.domain; import kr.lul.common.util.ValidationException; import org.junit.Test; import org.slf4j.Logger; import java.time.Instant; import static java.util.concurrent.ThreadLocalRandom.current; import static kr.lul.kobalttown.account.domain.Credential.*; import static org.apache.commons.lang3.RandomStringUtils.random; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.slf4j.LoggerFactory.getLogger; /** * @author justburrow * @since 2019/11/19 */ public class CredentialTest { private static final Logger log = getLogger(CredentialTest.class); @Test public void <API key>() throws Exception { assertThatThrownBy(() -> ACCOUNT_VALIDATOR.validate(null)) .isInstanceOf(ValidationException.class) .hasMessage("account is null.") .extracting("targetName", "target") .containsSequence(ATTR_ACCOUNT, null); } @Test public void <API key>() throws Exception { // GIVEN final Account account = new Account() { @Override public Instant getUpdatedAt() { return null; } @Override public Instant getCreatedAt() { return null; } @Override public long getId() { return 0L; } @Override public String getNickname() { return "nickname"; } @Override public boolean isEnabled() { return false; } @Override public void enable(final Instant enableAt) { } }; log.info("GIVEN - account.id={}", account.getId()); // WHEN & THEN assertThatThrownBy(() -> ACCOUNT_VALIDATOR.validate(account)) .isInstanceOf(ValidationException.class) .extracting("targetName", "target") .containsSequence(ATTR_ACCOUNT, account); } @Test public void <API key>() throws Exception { // GIVEN final Account account = new Account() { @Override public Instant getUpdatedAt() { return null; } @Override public Instant getCreatedAt() { return null; } @Override public long getId() { return 1L + current().nextLong(1, Long.MAX_VALUE); } @Override public String getNickname() { return "nickname"; } @Override public boolean isEnabled() { return false; } @Override public void enable(final Instant enableAt) { } }; log.info("GIVEN - account.id={}", account.getId()); // WHEN ACCOUNT_VALIDATOR.validate(account); } @Test public void <API key>() throws Exception { // WHEN & THEN assertThatThrownBy(() -> <API key>.validate(null)) .isInstanceOf(ValidationException.class) .extracting("targetName", "target") .containsSequence(ATTR_PUBLIC_KEY, null); } @Test public void <API key>() throws Exception { // WHEN & THEN assertThatThrownBy(() -> <API key>.validate("")) .isInstanceOf(ValidationException.class) .extracting("targetName", "target") .containsSequence(ATTR_PUBLIC_KEY, ""); } @Test public void <API key>() throws Exception { // GIVEN final String publicKey = random(current().nextInt(1, 1 + <API key>)).trim(); log.info("GIVEN - publicKey={}", publicKey); // WHEN <API key>.validate(publicKey); } @Test public void <API key>() throws Exception { // GIVEN String publicKey; do { publicKey = random(1 + <API key>).trim(); } while (<API key> >= publicKey.length()); log.info("GIVEN - publicKey={}", publicKey); // WHEN & THEN final String temp = publicKey; assertThatThrownBy(() -> <API key>.validate(temp)) .isInstanceOf(ValidationException.class) .extracting("targetName", "target") .containsSequence(ATTR_PUBLIC_KEY, publicKey); } @Test public void test_<API key>() throws Exception { assertThatThrownBy(() -> SECRET_VALIDATOR.validate(null)) .isInstanceOf(ValidationException.class) .hasMessage("secret is null.") .hasNoCause(); } @Test public void test_<API key>() throws Exception { assertThatThrownBy(() -> SECRET_VALIDATOR.validate("")) .isInstanceOf(ValidationException.class) .hasMessage("secret is empty.") .hasNoCause(); } @Test public void test_<API key>() throws Exception { // GIVEN final String secret = random(SECRET_MIN_LENGTH - 1); log.info("GIVEN - secret={}", secret); // WHEN & THEN assertThatThrownBy(() -> SECRET_VALIDATOR.validate(secret)) .isInstanceOf(ValidationException.class) .<API key>("too short secret") .<API key>(secret) .hasNoCause(); } @Test public void test_<API key>() throws Exception { // GIVEN final String secret = random(SECRET_MAX_LENGTH + 1); log.info("GIVEN - secret={}", secret); // WHEN & THEN assertThatThrownBy(() -> SECRET_VALIDATOR.validate(secret)) .isInstanceOf(ValidationException.class) .<API key>("too long secret") .<API key>(secret) .hasNoCause(); } @Test public void test_<API key>() throws Exception { // GIVEN final String secret = random(SECRET_MIN_LENGTH); log.info("GIVEN - secret={}", secret); // WHEN SECRET_VALIDATOR.validate(secret); log.info("WHEN - no exception"); } @Test public void test_<API key>() throws Exception { // GIVEN final String secret = random(SECRET_MAX_LENGTH); log.info("GIVEN - secret={}", secret); // WHEN SECRET_VALIDATOR.validate(secret); log.info("WHEN - no exception"); } @Test public void test_<API key>() throws Exception { // GIVEN final String secret = random(current().nextInt(SECRET_MIN_LENGTH, SECRET_MAX_LENGTH + 1)); log.info("GIVEN - secret={}", secret); // WHEN SECRET_VALIDATOR.validate(secret); log.info("WHEN - no exception."); } }
package org.myrobotlab.opencv; import static com.googlecode.javacv.cpp.opencv_imgproc.cvDilate; import org.myrobotlab.logging.LoggerFactory; import org.slf4j.Logger; import com.googlecode.javacv.cpp.opencv_core.IplImage; public class OpenCVFilterDilate extends OpenCVFilter { private static final long serialVersionUID = 1L; public final static Logger log = LoggerFactory.getLogger(OpenCVFilterDilate.class.getCanonicalName()); public int numberOfIterations = 1; public OpenCVFilterDilate() { super(); } public OpenCVFilterDilate(String name) { super(name); } @Override public IplImage process(IplImage image, OpenCVData data) { cvDilate(image, image, null, numberOfIterations); return image; } @Override public void imageChanged(IplImage image) { } }
#pragma once #include <aws/kafka/Kafka_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <utility> namespace Aws { template<typename RESULT_TYPE> class <API key>; namespace Utils { namespace Json { class JsonValue; } // namespace Json } // namespace Utils namespace Kafka { namespace Model { class AWS_KAFKA_API <API key> { public: <API key>(); <API key>(const Aws::<API key><Aws::Utils::Json::JsonValue>& result); <API key>& operator=(const Aws::<API key><Aws::Utils::Json::JsonValue>& result); /** * <p>A string containing one or more hostname:port pairs.</p> * */ inline const Aws::String& <API key>() const{ return <API key>; } /** * <p>A string containing one or more hostname:port pairs.</p> * */ inline void <API key>(const Aws::String& value) { <API key> = value; } /** * <p>A string containing one or more hostname:port pairs.</p> * */ inline void <API key>(Aws::String&& value) { <API key> = std::move(value); } /** * <p>A string containing one or more hostname:port pairs.</p> * */ inline void <API key>(const char* value) { <API key>.assign(value); } /** * <p>A string containing one or more hostname:port pairs.</p> * */ inline <API key>& <API key>(const Aws::String& value) { <API key>(value); return *this;} /** * <p>A string containing one or more hostname:port pairs.</p> * */ inline <API key>& <API key>(Aws::String&& value) { <API key>(std::move(value)); return *this;} /** * <p>A string containing one or more hostname:port pairs.</p> * */ inline <API key>& <API key>(const char* value) { <API key>(value); return *this;} /** * <p>A string containing one or more DNS names (or IP) and TLS port * pairs.</p> */ inline const Aws::String& <API key>() const{ return <API key>; } /** * <p>A string containing one or more DNS names (or IP) and TLS port * pairs.</p> */ inline void <API key>(const Aws::String& value) { <API key> = value; } /** * <p>A string containing one or more DNS names (or IP) and TLS port * pairs.</p> */ inline void <API key>(Aws::String&& value) { <API key> = std::move(value); } /** * <p>A string containing one or more DNS names (or IP) and TLS port * pairs.</p> */ inline void <API key>(const char* value) { <API key>.assign(value); } /** * <p>A string containing one or more DNS names (or IP) and TLS port * pairs.</p> */ inline <API key>& <API key>(const Aws::String& value) { <API key>(value); return *this;} /** * <p>A string containing one or more DNS names (or IP) and TLS port * pairs.</p> */ inline <API key>& <API key>(Aws::String&& value) { <API key>(std::move(value)); return *this;} /** * <p>A string containing one or more DNS names (or IP) and TLS port * pairs.</p> */ inline <API key>& <API key>(const char* value) { <API key>(value); return *this;} /** * <p>A string containing one or more DNS names (or IP) and Sasl Scram * port pairs.</p> */ inline const Aws::String& <API key>() const{ return <API key>; } /** * <p>A string containing one or more DNS names (or IP) and Sasl Scram * port pairs.</p> */ inline void <API key>(const Aws::String& value) { <API key> = value; } /** * <p>A string containing one or more DNS names (or IP) and Sasl Scram * port pairs.</p> */ inline void <API key>(Aws::String&& value) { <API key> = std::move(value); } /** * <p>A string containing one or more DNS names (or IP) and Sasl Scram * port pairs.</p> */ inline void <API key>(const char* value) { <API key>.assign(value); } /** * <p>A string containing one or more DNS names (or IP) and Sasl Scram * port pairs.</p> */ inline <API key>& <API key>(const Aws::String& value) { <API key>(value); return *this;} /** * <p>A string containing one or more DNS names (or IP) and Sasl Scram * port pairs.</p> */ inline <API key>& <API key>(Aws::String&& value) { <API key>(std::move(value)); return *this;} /** * <p>A string containing one or more DNS names (or IP) and Sasl Scram * port pairs.</p> */ inline <API key>& <API key>(const char* value) { <API key>(value); return *this;} /** * <p>A string that contains one or more DNS names (or IP addresses) * and SASL IAM port pairs.</p> */ inline const Aws::String& <API key>() const{ return <API key>; } /** * <p>A string that contains one or more DNS names (or IP addresses) * and SASL IAM port pairs.</p> */ inline void <API key>(const Aws::String& value) { <API key> = value; } /** * <p>A string that contains one or more DNS names (or IP addresses) * and SASL IAM port pairs.</p> */ inline void <API key>(Aws::String&& value) { <API key> = std::move(value); } /** * <p>A string that contains one or more DNS names (or IP addresses) * and SASL IAM port pairs.</p> */ inline void <API key>(const char* value) { <API key>.assign(value); } /** * <p>A string that contains one or more DNS names (or IP addresses) * and SASL IAM port pairs.</p> */ inline <API key>& <API key>(const Aws::String& value) { <API key>(value); return *this;} /** * <p>A string that contains one or more DNS names (or IP addresses) * and SASL IAM port pairs.</p> */ inline <API key>& <API key>(Aws::String&& value) { <API key>(std::move(value)); return *this;} /** * <p>A string that contains one or more DNS names (or IP addresses) * and SASL IAM port pairs.</p> */ inline <API key>& <API key>(const char* value) { <API key>(value); return *this;} private: Aws::String <API key>; Aws::String <API key>; Aws::String <API key>; Aws::String <API key>; }; } // namespace Model } // namespace Kafka } // namespace Aws
package consulo.fantom.module.extension; import consulo.module.extension.<API key>; /** * @author VISTALL * @since 03.02.14 */ public interface FanModuleExtension<T extends FanModuleExtension<T>> extends <API key><T> { }
<?php require_once 'sdkazure\vendor\microsoft\windowsazure\WindowsAzure\WindowsAzure.php'; require_once 'sdkazure\vendor\autoload.php'; use WindowsAzure\Common\ServicesBuilder; use WindowsAzure\Common\ServiceException; use windowsAzure\blob\models\<API key>; use windowsAzure\blob\models\PublicAccessType; class Absent extends Contact{ private $date_at; private $detail; private $status; private $detail_delete; private $status_read; private $id_subject; private $id_doc; private $name_file; private $content_file; private $created_at; const ROWPERPAGE = 10; public function __construct() { $this->date_at=NULL; $this->detail=NULL; $this->status=NULL; $this->detail_delete=NULL; $this->status_read=NULL; $this->id_subject=NULL; $this->id_doc=NULL; $this->name_file=NULL; $this->content_file=NULL; $this->created_at=NULL; } public function copy(Absent $absentletter){ if($absentletter!=NULL){ $this->date_at=$absentletter->getDate_at(); $this->detail=$absentletter->getDetail(); $this->status=$absentletter->getStatus(); $this->detail_delete=$absentletter->getDetail_delete(); $this->status_read=$absentletter->getStatus_read(); $this->id_subject=$absentletter->getId_subject(); $this->id_doc=$absentletter->getId_doc(); $this->name_file=$absentletter->getName_file(); $this->content_file=$absentletter->getContent_file(); $this->created_at=$absentletter->getCreated_at(); } } //copy constructor public static function cloneFromContact(Contact $contact){ $obj = new Absent; $obj->cloneContact($contact); return $obj; } //get maximum column 'id' public static function getMaxId(){ $maxid= <API key>::orderBy('ID', 'DESC')->first(); if(!isset($maxid)){ return "0"; } else{ $maxid= <API key>::orderBy('ID', 'DESC')->first(); return $maxid->ID; } } public static function getMaxFileID(){ $maxid= FileRepository::orderBy('ID', 'DESC')->first(); if(!isset($maxid)){ return "0"; } else{ $maxid= FileRepository::orderBy('ID', 'DESC')->first(); return $maxid->ID; } } public static function getLastpage($condition,$id_user,$id_subj){ if($condition['approve'] =='1'){ if($condition['Pending'] == '1' && $condition['unapprove'] == '1'){ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where('absentletter.id_subject','=',$id_subj) ->where('contact.receiver','=',$id_user)->count(); } else if($condition['Pending'] == '1' && $condition['unapprove'] == '0'){ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where(function($query) { $query->where('absentletter.status','=','0') ->orWhere('absentletter.status','=','1'); }) ->where('absentletter.id_subject','=',$id_subj) ->where('contact.receiver','=',$id_user)->count(); } else if($condition['Pending'] == '0' && $condition['unapprove'] == '1'){ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where(function($query) { $query->where('absentletter.status','=','0') ->orWhere('absentletter.status','=','2'); }) ->where('absentletter.id_subject','=',$id_subj) ->where('contact.receiver','=',$id_user)->count(); } else{ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where('absentletter.status','=','0') ->where('absentletter.id_subject','=',$id_subj) ->where('contact.receiver','=',$id_user)->count(); } } else if($condition['Pending'] =='1'){ if($condition['unapprove'] == '1'){ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where(function($query) { $query->where('absentletter.status','=','1') ->orWhere('absentletter.status','=','2'); }) ->where('absentletter.id_subject','=',$id_subj) ->where('contact.receiver','=',$id_user)->count(); } if($condition['unapprove'] == '0'){ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where('absentletter.status','=','1') ->where('absentletter.id_subject','=',$id_subj) ->where('contact.receiver','=',$id_user)->count(); } } else{ if($condition['unapprove'] == '1'){ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where('absentletter.status','=','2') ->where('absentletter.id_subject','=',$id_subj) ->where('contact.receiver','=',$id_user)->count(); } else{ $table = 0; } } return max(ceil($table/Absent::ROWPERPAGE),1); } public static function getCount($condition,$id_user,$id_subj){ if($condition['approve'] =='1'){ if($condition['Pending'] == '1' && $condition['unapprove'] == '1'){ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where('absentletter.id_subject','=',$id_subj) ->where('contact.receiver','=',$id_user)->count(); } else if($condition['Pending'] == '1' && $condition['unapprove'] == '0'){ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where(function($query) { $query->where('absentletter.status','=','0') ->orWhere('absentletter.status','=','1'); }) ->where('absentletter.id_subject','=',$id_subj) ->where('contact.receiver','=',$id_user)->count(); } else if($condition['Pending'] == '0' && $condition['unapprove'] == '1'){ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where(function($query) { $query->where('absentletter.status','=','0') ->orWhere('absentletter.status','=','2'); }) ->where('absentletter.id_subject','=',$id_subj) ->where('contact.receiver','=',$id_user)->count(); } else{ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where('absentletter.status','=','0') ->where('absentletter.id_subject','=',$id_subj) ->where('contact.receiver','=',$id_user)->count(); } } else if($condition['Pending'] =='1'){ if($condition['unapprove'] == '1'){ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where(function($query) { $query->where('absentletter.status','=','1') ->orWhere('absentletter.status','=','2'); }) ->where('absentletter.id_subject','=',$id_subj) ->where('contact.receiver','=',$id_user)->count(); } if($condition['unapprove'] == '0'){ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->orWhere('absentletter.status','=','1') ->where('absentletter.id_subject','=',$id_subj) ->where('contact.receiver','=',$id_user)->count(); } } else{ if($condition['unapprove'] == '1'){ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where('absentletter.status','=','2') ->where('absentletter.id_subject','=',$id_subj) ->where('contact.receiver','=',$id_user)->count(); } else{ $table = 0; } } return $table; } public static function search($condition,$currentPage,$id_user,$id_subj){ if($condition['approve'] =='1'){ if($condition['Pending'] == '1' && $condition['unapprove'] == '1'){ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where('absentletter.id_subject','=',$id_subj) ->where('contact.receiver','=',$id_user)->get(array('absentletter.status','absentletter.detail' ,'contact.ID','absentletter.created_at','absentletter.date_at')); } else if($condition['Pending'] == '1' && $condition['unapprove'] == '0'){ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where(function($query) { $query->where('absentletter.status','=','0') ->orWhere('absentletter.status','=','1'); }) ->where('absentletter.id_subject','=',$id_subj) ->where('contact.receiver','=',$id_user)->get(array('absentletter.status','absentletter.detail' ,'contact.ID','absentletter.created_at','absentletter.date_at')); } else if($condition['Pending'] == '0' && $condition['unapprove'] == '1'){ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where(function($query) { $query->where('absentletter.status','=','0') ->orWhere('absentletter.status','=','2'); }) ->where('absentletter.id_subject','=',$id_subj) ->where('contact.receiver','=',$id_user)->get(array('absentletter.status','absentletter.detail' ,'contact.ID','absentletter.created_at','absentletter.date_at')); } else{ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where('absentletter.status','=','0') ->where('absentletter.id_subject','=',$id_subj) ->where('contact.receiver','=',$id_user)->get(array('absentletter.status','absentletter.detail' ,'contact.ID','absentletter.created_at','absentletter.date_at')); } } else if($condition['Pending'] =='1'){ if($condition['unapprove'] == '1'){ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where(function($query) { $query->where('absentletter.status','=','1') ->orWhere('absentletter.status','=','2'); }) ->where('absentletter.id_subject','=',$id_subj) ->where('contact.receiver','=',$id_user)->get(array('absentletter.status','absentletter.detail' ,'contact.ID','absentletter.created_at','absentletter.date_at')); } if($condition['unapprove'] == '0'){ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where('absentletter.status','=','1') ->where('absentletter.id_subject','=',$id_subj) ->where('contact.receiver','=',$id_user)->get(array('absentletter.status','absentletter.detail' ,'contact.ID','absentletter.created_at','absentletter.date_at')); } } else{ if($condition['unapprove'] == '1'){ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where('absentletter.status','=','2') ->where('absentletter.id_subject','=',$id_subj) ->where('contact.receiver','=',$id_user)->get(array('absentletter.status','absentletter.detail' ,'contact.ID','absentletter.created_at','absentletter.date_at')); } else{ $table = 0; } } $i = ($currentPage-1)* Assignment::ROWPERPAGE; $j = $i+min(Assignment::ROWPERPAGE,count($table)-$i); $output=array(); for($k=0;$i<$j;$i++,$k++){ $output[$k]=$table[$i]; } return $output; } public static function getFromId($id){ $conTmp = Contact::getFromId($id); if($conTmp!=NULL){ $dataTmp = <API key>::find($conTmp->getIdsubtable()); $fileTmp = FileRepository::find($dataTmp->id_doc); $obj = new Absent; if($dataTmp!=NULL){ $obj = Absent::cloneFromContact($conTmp); $obj->setDate_at($dataTmp->date_at); $obj->setDetail($dataTmp->detail); $obj->setStatus($dataTmp->status); $obj->setDetail_delete($dataTmp->detail_delete); $obj->setStatus_read($dataTmp->status_read); $obj->setId_subject($dataTmp->id_subject); $obj->setId_doc($dataTmp->id_doc); $obj->setName_file($fileTmp->name); if($dataTmp->id_doc!='0'){ //connection to Storage azure reference http://www.thaicreate.com/windows-azure.html#<API key> $connectionString = "<API key>=http;AccountName=rpslmssr;AccountKey=<API key>/lAACSrGL/1AElzeIuwbc6lJNTA=="; $blobRestProxy = ServicesBuilder::getInstance()->createBlobService($connectionString); $blob_list = $blobRestProxy->listBlobs("docs"); $blobs = $blob_list->getBlobs(); $urlTmp = NULL; foreach($blobs as $blob) { if($blob->getName()==$fileTmp->name){ $urlTmp = $blob->getUrl(); } } $urlTmp=str_replace(" ","%20",$urlTmp); //echo $urlTmp; $file = fopen($urlTmp,"r"); $obj->setContent_file($file); } else{ $obj->setContent_file(NULL); } $obj->setCreated_at($dataTmp->created_at); return $obj; } } return NULL; } //download file public function downloadFile(){ $file = $this->getContent_file(); $contents = stream_get_contents($file); header("Content-type: text/plain"); header("Content-Disposition: attachment; filename=".$this->getName_file()); echo $contents; } public function update(){ $dataTmp = <API key>::find($this->getIdsubtable()); if($dataTmp!=NULL){ DB::table('absentletter')->where('ID', '=',$this->getIdsubtable())->update(array('status' => $this->status,'status_read' => $this->status_read)); return true; } else{ return false; } } public static function getLastpage_s($condition,$id_user,$id_subj){ if($condition['approve'] =='1'){ if($condition['Pending'] == '1' && $condition['unapprove'] == '1'){ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where('absentletter.id_subject','=',$id_subj) ->where('contact.sender','=',$id_user)->count(); } else if($condition['Pending'] == '1' && $condition['unapprove'] == '0'){ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where(function($query) { $query->where('absentletter.status','=','0') ->orWhere('absentletter.status','=','1'); }) ->where('absentletter.id_subject','=',$id_subj) ->where('contact.sender','=',$id_user)->count(); } else if($condition['Pending'] == '0' && $condition['unapprove'] == '1'){ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where(function($query) { $query->where('absentletter.status','=','0') ->orWhere('absentletter.status','=','2'); }) ->where('absentletter.id_subject','=',$id_subj) ->where('contact.sender','=',$id_user)->count(); } else{ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where('absentletter.status','=','0') ->where('absentletter.id_subject','=',$id_subj) ->where('contact.sender','=',$id_user)->count(); } } else if($condition['Pending'] =='1'){ if($condition['unapprove'] == '1'){ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where(function($query) { $query->where('absentletter.status','=','1') ->orWhere('absentletter.status','=','2'); }) ->where('absentletter.id_subject','=',$id_subj) ->where('contact.sender','=',$id_user)->count(); } if($condition['unapprove'] == '0'){ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where('absentletter.status','=','1') ->where('absentletter.id_subject','=',$id_subj) ->where('contact.sender','=',$id_user)->count(); } } else{ if($condition['unapprove'] == '1'){ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where('absentletter.status','=','2') ->where('absentletter.id_subject','=',$id_subj) ->where('contact.sender','=',$id_user)->count(); } else{ $table = 0; } } return max(ceil($table/Absent::ROWPERPAGE),1); } public static function getCount_s($condition,$id_user,$id_subj){ if($condition['approve'] =='1'){ if($condition['Pending'] == '1' && $condition['unapprove'] == '1'){ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where('absentletter.id_subject','=',$id_subj) ->where('contact.sender','=',$id_user)->count(); } else if($condition['Pending'] == '1' && $condition['unapprove'] == '0'){ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where(function($query) { $query->where('absentletter.status','=','0') ->orWhere('absentletter.status','=','1'); }) ->where('absentletter.id_subject','=',$id_subj) ->where('contact.sender','=',$id_user)->count(); } else if($condition['Pending'] == '0' && $condition['unapprove'] == '1'){ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where(function($query) { $query->where('absentletter.status','=','0') ->orWhere('absentletter.status','=','2'); }) ->where('absentletter.id_subject','=',$id_subj) ->where('contact.sender','=',$id_user)->count(); } else{ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where('absentletter.status','=','0') ->where('absentletter.id_subject','=',$id_subj) ->where('contact.sender','=',$id_user)->count(); } } else if($condition['Pending'] =='1'){ if($condition['unapprove'] == '1'){ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where(function($query) { $query->where('absentletter.status','=','1') ->orWhere('absentletter.status','=','2'); }) ->where('absentletter.id_subject','=',$id_subj) ->where('contact.sender','=',$id_user)->count(); } if($condition['unapprove'] == '0'){ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->orWhere('absentletter.status','=','1') ->where('absentletter.id_subject','=',$id_subj) ->where('contact.sender','=',$id_user)->count(); } } else{ if($condition['unapprove'] == '1'){ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where('absentletter.status','=','2') ->where('absentletter.id_subject','=',$id_subj) ->where('contact.sender','=',$id_user)->count(); } else{ $table = 0; } } return $table; } public static function search_s($condition,$currentPage,$id_user,$id_subj){ if($condition['approve'] =='1'){ if($condition['Pending'] == '1' && $condition['unapprove'] == '1'){ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where('absentletter.id_subject','=',$id_subj) ->where('contact.sender','=',$id_user)->get(); } else if($condition['Pending'] == '1' && $condition['unapprove'] == '0'){ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where(function($query) { $query->where('absentletter.status','=','0') ->orWhere('absentletter.status','=','1'); }) ->where('absentletter.id_subject','=',$id_subj) ->where('contact.sender','=',$id_user)->get(); } else if($condition['Pending'] == '0' && $condition['unapprove'] == '1'){ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where(function($query) { $query->where('absentletter.status','=','0') ->orWhere('absentletter.status','=','2'); }) ->where('absentletter.id_subject','=',$id_subj) ->where('contact.sender','=',$id_user)->get(); } else{ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where('absentletter.status','=','0') ->where('absentletter.id_subject','=',$id_subj) ->where('contact.sender','=',$id_user)->get(); } } else if($condition['Pending'] =='1'){ if($condition['unapprove'] == '1'){ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where(function($query) { $query->where('absentletter.status','=','1') ->orWhere('absentletter.status','=','2'); }) ->where('absentletter.id_subject','=',$id_subj) ->where('contact.sender','=',$id_user)->get(); } if($condition['unapprove'] == '0'){ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where('absentletter.status','=','1') ->where('absentletter.id_subject','=',$id_subj) ->where('contact.sender','=',$id_user)->get(); } } else{ if($condition['unapprove'] == '1'){ $table = DB::table('contact') ->join('absentletter', 'contact.idsubtable', '=', 'absentletter.ID')->where('contact.group_id','=','absentletter') ->where('absentletter.status','=','2') ->where('absentletter.id_subject','=',$id_subj) ->where('contact.sender','=',$id_user)->get(); } else{ $table = 0; } } $i = ($currentPage-1)* Assignment::ROWPERPAGE; $j = $i+min(Assignment::ROWPERPAGE,count($table)-$i); $output=array(); for($k=0;$i<$j;$i++,$k++){ $output[$k]=$table[$i]; } return $output; } public function getId_student(){ $tmp = Student::getFromID($this->getSender()); return $tmp->getId_student(); } public function getName_student(){ $tmp = Student::getFromID($this->getSender()); return $tmp->getName(); } public function getSurname_student(){ $tmp = Student::getFromID($this->getSender()); return $tmp->getSurname(); } public function setDate_at($data){ $this->date_at=$data; } public function getDate_at(){ return $this->date_at; } public function setDetail($data){ $this->detail=$data; } public function getDetail(){ return $this->detail; } public function setStatus($data){ $this->status=$data; } public function getStatus(){ return $this->status; } public function setDetail_delete($data){ $this->detail_delete=$data; } public function getDetail_delete(){ return $this->detail_delete; } public function setStatus_read($data){ $this->status_read=$data; } public function getStatus_read(){ return $this->status_read; } public function setId_subject($data){ $this->id_subject=$data; } public function getId_subject(){ return $this->id_subject; } public function setId_doc($data){ $this->id_doc=$data; } public function getId_doc(){ return $this->id_doc; } public function setContent_file($data){ $this->content_file=$data; } public function getContent_file(){ return $this->content_file; } public function setName_file($data){ $this->name_file=$data; } public function getName_file(){ return $this->name_file; } public function setCreated_at($data){ $this->created_at=$data; } public function getCreated_at(){ return $this->created_at; } public function toString(){ return parent::toString(). 'id = '.$this->id.'<br>'. 'date_at = '.$this->date_at.'<br>'. 'detail = '.$this->detail.'<br>'. 'status = '.$this->status.'<br>'. 'detail_delete = '.$this->detail_delete.'<br>'. 'status_read = '.$this->status_read.'<br>'. 'id_subject = '.$this->id_subject.'<br>'. 'id_doc = '.$this->id_doc.'<br>'. 'created_at = '.$this->created_at.'<br>'; } }
package org.http4s package server package blaze import cats.effect.{CancelToken, ConcurrentEffect, IO, Sync, Timer} import cats.implicits._ import java.nio.ByteBuffer import java.util.concurrent.TimeoutException import org.http4s.blaze.http.parser.BaseExceptions.{BadMessage, ParserException} import org.http4s.blaze.pipeline.Command.EOF import org.http4s.blaze.pipeline.{TailStage, Command => Cmd} import org.http4s.blaze.util.{BufferTools, TickWheelExecutor} import org.http4s.blaze.util.BufferTools.emptyBuffer import org.http4s.blaze.util.Execution._ import org.http4s.blazecore.{Http1Stage, IdleTimeoutStage} import org.http4s.blazecore.util.{BodylessWriter, Http1Writer} import org.http4s.headers.{Connection, `Content-Length`, `Transfer-Encoding`} import org.http4s.internal.unsafeRunAsync import org.http4s.syntax.string._ import org.http4s.util.StringWriter import scala.concurrent.{ExecutionContext, Future} import scala.concurrent.duration.{Duration, FiniteDuration} import scala.util.{Either, Failure, Left, Right, Success, Try} import io.chrisdavenport.vault._ private[blaze] object Http1ServerStage { def apply[F[_]]( routes: HttpApp[F], attributes: () => Vault, executionContext: ExecutionContext, enableWebSockets: Boolean, maxRequestLineLen: Int, maxHeadersLen: Int, chunkBufferMaxSize: Int, serviceErrorHandler: ServiceErrorHandler[F], <API key>: Duration, idleTimeout: Duration, scheduler: TickWheelExecutor)( implicit F: ConcurrentEffect[F], timer: Timer[F]): Http1ServerStage[F] = if (enableWebSockets) new Http1ServerStage( routes, attributes, executionContext, maxRequestLineLen, maxHeadersLen, chunkBufferMaxSize, serviceErrorHandler, <API key>, idleTimeout, scheduler) with WebSocketSupport[F] else new Http1ServerStage( routes, attributes, executionContext, maxRequestLineLen, maxHeadersLen, chunkBufferMaxSize, serviceErrorHandler, <API key>, idleTimeout, scheduler) } private[blaze] class Http1ServerStage[F[_]]( httpApp: HttpApp[F], requestAttrs: () => Vault, implicit protected val executionContext: ExecutionContext, maxRequestLineLen: Int, maxHeadersLen: Int, override val chunkBufferMaxSize: Int, serviceErrorHandler: ServiceErrorHandler[F], <API key>: Duration, idleTimeout: Duration, scheduler: TickWheelExecutor)(implicit protected val F: ConcurrentEffect[F], timer: Timer[F]) extends Http1Stage[F] with TailStage[ByteBuffer] { // micro-optimization: unwrap the routes and call its .run directly private[this] val runApp = httpApp.run // protected by synchronization on `parser` private[this] val parser = new Http1ServerParser[F](logger, maxRequestLineLen, maxHeadersLen) private[this] var isClosed = false private[this] var cancelToken: Option[CancelToken[F]] = None val name = "Http4sServerStage" logger.trace(s"Http4sStage starting up") final override protected def doParseContent(buffer: ByteBuffer): Option[ByteBuffer] = parser.synchronized { parser.doParseContent(buffer) } final override protected def contentComplete(): Boolean = parser.synchronized { parser.contentComplete() } // Will act as our loop override def stageStartup(): Unit = { logger.debug("Starting HTTP pipeline") initIdleTimeout() requestLoop() } private def initIdleTimeout() = idleTimeout match { case f: FiniteDuration => val cb: Callback[TimeoutException] = { case Left(t) => fatalError(t, "Error in idle timeout callback") case Right(_) => logger.debug("Shutting down due to idle timeout") closePipeline(None) } val stage = new IdleTimeoutStage[ByteBuffer](f, scheduler, executionContext) spliceBefore(stage) stage.init(cb) case _ => } private val handleReqRead: Try[ByteBuffer] => Unit = { case Success(buff) => reqLoopCallback(buff) case Failure(Cmd.EOF) => closeConnection() case Failure(t) => fatalError(t, "Error in requestLoop()") } private def requestLoop(): Unit = channelRead().onComplete(handleReqRead)(trampoline) private def reqLoopCallback(buff: ByteBuffer): Unit = { logRequest(buff) parser.synchronized { if (!isClosed) { try { if (!parser.requestLineComplete() && !parser.doParseRequestLine(buff)) { requestLoop() } else if (!parser.headersComplete() && !parser.doParseHeaders(buff)) { requestLoop() } else { // we have enough to start the request runRequest(buff) } } catch { case t: BadMessage => badMessage("Error parsing status or headers in requestLoop()", t, Request[F]()) case t: Throwable => internalServerError( "error in requestLoop()", t, Request[F](), () => Future.successful(emptyBuffer)) } } } } private def logRequest(buffer: ByteBuffer): Unit = logger.trace { val msg = BufferTools .bufferToString(buffer.duplicate()) .replace("\r", "\\r") .replace("\n", "\\n\n") s"Received Request:\n$msg" } // Only called while holding the monitor of `parser` private def runRequest(buffer: ByteBuffer): Unit = { val (body, cleanup) = <API key>( buffer, () => Either.left(<API key>("Received premature EOF."))) parser.collectMessage(body, requestAttrs()) match { case Right(req) => executionContext.execute(new Runnable { def run(): Unit = { val action = Sync[F] .suspend(raceTimeout(req)) .recoverWith(serviceErrorHandler(req)) .flatMap(resp => F.delay(renderResponse(req, resp, cleanup))) parser.synchronized { cancelToken = Some( F.runCancelable(action) { case Right(()) => IO.unit case Left(t) => IO(logger.error(t)(s"Error running request: $req")).attempt *> IO( closeConnection()) } .unsafeRunSync()) } } }) case Left((e, protocol)) => badMessage(e.details, new BadMessage(e.sanitized), Request[F]().withHttpVersion(protocol)) } } protected def renderResponse( req: Request[F], resp: Response[F], bodyCleanup: () => Future[ByteBuffer]): Unit = { val rr = new StringWriter(512) rr << req.httpVersion << ' ' << resp.status.code << ' ' << resp.status.reason << "\r\n" Http1Stage.encodeHeaders(resp.headers.toList, rr, isServer = true) val respTransferCoding = `Transfer-Encoding`.from(resp.headers) val lengthHeader = `Content-Length`.from(resp.headers) val respConn = Connection.from(resp.headers) // Need to decide which encoder and if to close on finish val closeOnFinish = respConn .map(_.hasClose) .orElse { Connection.from(req.headers).map(<API key>(_, rr)) } .getOrElse(parser.minorVersion == 0) // Finally, if nobody specifies, http 1.0 defaults to close // choose a body encoder. Will add a Transfer-Encoding header if necessary val bodyEncoder: Http1Writer[F] = { if (req.method == Method.HEAD || !resp.status.isEntityAllowed) { // We don't have a body (or don't want to send it) so we just get the headers if (!resp.status.isEntityAllowed && (lengthHeader.isDefined || respTransferCoding.isDefined)) { logger.warn( s"Body detected for response code ${resp.status.code} which doesn't permit an entity. Dropping.") } if (req.method == Method.HEAD) { // write message body header for HEAD response (parser.minorVersion, respTransferCoding, lengthHeader) match { case (minor, Some(enc), _) if minor > 0 && enc.hasChunked => rr << "Transfer-Encoding: chunked\r\n" case (_, _, Some(len)) => rr << len << "\r\n" case _ => // nop } } // add KeepAlive to Http 1.0 responses if the header isn't already present rr << (if (!closeOnFinish && parser.minorVersion == 0 && respConn.isEmpty) "Connection: keep-alive\r\n\r\n" else "\r\n") new BodylessWriter[F](this, closeOnFinish) } else getEncoder( respConn, respTransferCoding, lengthHeader, resp.trailerHeaders, rr, parser.minorVersion, closeOnFinish) } unsafeRunAsync(bodyEncoder.write(rr, resp.body)) { case Right(requireClose) => if (closeOnFinish || requireClose) { logger.trace("Request/route requested closing connection.") IO(closeConnection()) } else IO { bodyCleanup().onComplete { case s @ Success(_) => // Serve another request parser.reset() handleReqRead(s) case Failure(EOF) => closeConnection() case Failure(t) => fatalError(t, "Failure in body cleanup") }(trampoline) } case Left(EOF) => IO(closeConnection()) case Left(t) => logger.error(t)("Error writing body") IO(closeConnection()) } } private def closeConnection(): Unit = { logger.debug("closeConnection()") stageShutdown() closePipeline(None) } override protected def stageShutdown(): Unit = { logger.debug("Shutting down HttpPipeline") parser.synchronized { cancel() isClosed = true parser.shutdownParser() } super.stageShutdown() } private def cancel(): Unit = cancelToken.foreach { token => F.runAsync(token) { case Right(_) => IO(logger.debug("Canceled request")) case Left(t) => IO(logger.error(t)("Error canceling request")) } .unsafeRunSync() } final protected def badMessage( debugMessage: String, t: ParserException, req: Request[F]): Unit = { logger.debug(t)(s"Bad Request: $debugMessage") val resp = Response[F](Status.BadRequest) .withHeaders(Connection("close".ci), `Content-Length`.zero) renderResponse(req, resp, () => Future.successful(emptyBuffer)) } // The error handler of last resort final protected def internalServerError( errorMsg: String, t: Throwable, req: Request[F], bodyCleanup: () => Future[ByteBuffer]): Unit = { logger.error(t)(errorMsg) val resp = Response[F](Status.InternalServerError) .withHeaders(Connection("close".ci), `Content-Length`.zero) renderResponse(req, resp, bodyCleanup) // will terminate the connection due to connection: close header } private[this] val raceTimeout: Request[F] => F[Response[F]] = <API key> match { case finite: FiniteDuration => val timeoutResponse = timer.sleep(finite).as(Response.timeout[F]) req => F.race(runApp(req), timeoutResponse).map(_.merge) case _ => runApp } }
package vandy.mooc.provider; import android.content.ContentProvider; import android.content.ContentValues; import android.database.Cursor; import android.net.Uri; /** * Content Provider interface used to manage Hobbit characters. This * class plays the role of the "Abstraction" in the Bridge pattern. * It and the hierarchy it abstracts play the role of the "Model" in * the <API key> pattern. */ public class HobbitProvider extends ContentProvider { /** * Debugging tag used by the Android logger. */ protected final static String TAG = HobbitProvider.class.getSimpleName(); /** * Different concrete implementations supported by the Hobbit * ContentProvider. */ public enum ContentProviderType { HASH_MAP, SQLITE } /** * Stores the concrete implementation used by the Hobbit * ContentProvider. */ private ContentProviderType <API key> = ContentProviderType.SQLITE; // ContentProviderType.HASH_MAP; /** * Implementation of the HobbitProvider, which is either * <API key> or HobbiProviderSQLite. */ private HobbitProviderImpl mImpl; /** * Method called to handle type requests from client applications. * It returns the MIME type of the data associated with each * URI. */ @Override public String getType(Uri uri) { return mImpl.getType(uri); } /** * Method called to handle insert requests from client * applications. */ @Override public Uri insert(Uri uri, ContentValues cvs) { return mImpl.insert(uri, cvs); } /** * Method that handles bulk insert requests. */ @Override public int bulkInsert(Uri uri, ContentValues[] cvsArray) { return mImpl.bulkInsert(uri, cvsArray); } /** * Method called to handle query requests from client * applications. */ @Override public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) { return mImpl.query(uri, projection, selection, selectionArgs, sortOrder); } /** * Method called to handle update requests from client * applications. */ @Override public int update(Uri uri, ContentValues cvs, String selection, String[] selectionArgs) { return mImpl.update(uri, cvs, selection, selectionArgs); } /** * Method called to handle delete requests from client * applications. */ @Override public int delete(Uri uri, String selection, String[] selectionArgs) { return mImpl.delete(uri, selection, selectionArgs); } /** * Return true if successfully started. */ @Override public boolean onCreate() { return <API key>(); } private boolean <API key>() { // Select the concrete implementor. switch(<API key>) { case HASH_MAP: mImpl = new <API key>(getContext()); break; case SQLITE: mImpl = new <API key>(getContext()); break; } return mImpl.onCreate();//proterly startup the provider by carring out inhouse innitialization } public void <API key>(ContentProviderType type){ this.<API key>=type; <API key>(); } }
#!/bin/bash # must have rename (sudo apt-get install rename) # expedia languages declare -a expedia_languages=("en_US" "ar_SA" "da_DK" "de_DE" "el_GR" "fi_FI" "fr_FR" "hu_HU" "in_ID" "it_IT" "ja_JP" "ko_KR" "ms_MY" "nl_NL" "no_NO" "pl_PL" "pt_BR" "ru_RU" "es_ES" "sv_SE" "th_TH" "tr_TR" "zh_TW" "zh_CN") # download the entire files. echo "Starting to download files (this will take a while)" declare url="http: declare -a fileNames=("ActivePropertyList" "PropertyTypeList" "<API key>" "<API key>" "AttributeList" "<API key>") for i in "${fileNames[@]}" do echo "Downloading $i" declare f="" for language in ${expedia_languages[@]} do if [ "$language" != "en_US" ] then language="_$language" f="$i$language.zip" else echo "English!" f="$i.zip" fi if [ -a "./$f" ] then echo $f" already exists" continue fi wget "$url$f" done done echo "Downloading images file" if [ -a "./HotelImageList.zip" ] then echo "HotelImagesList.zip already exists" else wget "http: fi echo "Downloading themes file" if [ -a "./HotelImageList.zip" ] then echo "<API key>.zip already exists" else wget "http: fi echo "Downloaded expedia files" echo "Starting to unzip files"
package com.shunwang.api; import com.shunwang.api.request.pay.<API key>; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; /** * @author min.da * @since 2015-12-30 */ public class SWMain { public static void main(String[] args) { <API key>(); } public static void <API key>() { <API key> request = new <API key>("123456"); request.setPartner(10000); request.setTime(getTime()); request.setOrderNo("Alphabet" + System.currentTimeMillis()); request.setSign(request.buildSignature()); DefaultSWClient client = new DefaultSWClient(request.getUrl()); String response = client.execute(request); System.out.println(response); } public static String getTime() { return new SimpleDateFormat(SWConstants.DATE_TIME_FORMAT).format(new Date()); } /** * @param amount * @return */ public static String getOutTime(int amount) { Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.DAY_OF_MONTH, amount); return new SimpleDateFormat(SWConstants.DATE_TIME_FORMAT).format(calendar.getTime()); } }
from django.db import models class Store(models.Model): name = models.CharField(max_length=200, unique=True) desc = models.TextField('description') link = models.URLField() slug = models.SlugField(max_length=200, unique=True) status = models.BooleanField(default=True) ishot = models.BooleanField(default=False) logo = models.ImageField(upload_to='logos') pub_date = models.DateTimeField('date published', auto_now_add=True) mod_date = models.DateTimeField('date modification', auto_now=True) def __str__(self): return self.name class Offer(models.Model): store = models.ForeignKey(Store, on_delete=models.CASCADE) type = models.CharField(max_length=10) name = models.CharField(max_length=200) desc = models.TextField('description') link = models.URLField() code = models.CharField(max_length=50, blank=True) status = models.BooleanField(default=True) ishot = models.BooleanField(default=False) pub_date = models.DateTimeField('date published', auto_now_add=True) mod_date = models.DateTimeField('date modification', auto_now=True) def __str__(self): return self.name
package com.linkedin.thirdeye.anomalydetection.model.transform; import com.linkedin.thirdeye.anomalydetection.context.<API key>; import com.linkedin.thirdeye.anomalydetection.context.TimeSeries; import com.linkedin.thirdeye.api.DimensionMap; import org.joda.time.Interval; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class <API key> extends <API key> { private static final Logger LOGGER = LoggerFactory.getLogger(<API key>.class); public static final String <API key> = "<API key>"; /** * Smooths the given time series using moving average. * * If the input time series is shorter than the moving average window size, then this method * does not apply smoothing on the time series, i.e., it returns the original time series. * * The transformed time series is shorten by the size of the moving average window in * comparison to the original time series. For instance, if there are 10 consecutive data points * the a time series and the window size for moving average is 2, then the transformed time series * contains only 9 consecutive data points; The first data points has no other data point to * average and thus it is discarded. * * @param timeSeries the time series that provides the data points to be transformed. * @param <API key> the anomaly detection context that could provide additional * information for the transformation. * @return a time series that is smoothed using moving average. */ @Override public TimeSeries transform(TimeSeries timeSeries, <API key> <API key>) { Interval timeSeriesInterval = timeSeries.<API key>(); long startTime = timeSeriesInterval.getStartMillis(); long endTime = timeSeriesInterval.getEndMillis(); long bucketSizeInMillis = <API key>.getBucketSizeInMS(); int <API key> = Integer.valueOf(getProperties().getProperty(<API key>)); // Check if the moving average window size is larger than the time series itself long <API key> = startTime + bucketSizeInMillis * (<API key> - 1); if (<API key> > endTime) { String metricName = <API key>.<API key>().getSpec().getTopicMetric(); DimensionMap dimensionMap = <API key>.getTimeSeriesKey().getDimensionMap(); LOGGER.warn( "Input time series (Metric:{}, Dimension:{}) is shorter than the moving average " + "smoothing window; therefore, smoothing is not applied on this time series.", metricName, dimensionMap); return timeSeries; } TimeSeries <API key> = new TimeSeries(); Interval transformedInterval = new Interval(<API key>, endTime); <API key>.<API key>(transformedInterval); for (long timeKeyToTransform : timeSeries.timestampSet()) { if (!transformedInterval.contains(timeKeyToTransform)) { continue; } double sum = 0d; int count = 0; for (int i = 0; i < <API key>; ++i) { long timeKey = timeKeyToTransform - bucketSizeInMillis * i; if (timeSeries.hasTimestamp(timeKey)) { sum += timeSeries.get(timeKey); ++count; } } double average = sum / count; // count is at least one due to the existence of timeKeyToTransform <API key>.set(timeKeyToTransform, average); } return <API key>; } }
<div id="<API key>" class="modal fade modal-wide"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <h4 class="modal-title">Detailed informations on user <%= username %> into the project <%= projectName %></h4> </div> <div class="modal-body"> <p></p> <div class="col-md-9 col-md-offset-1"> <div id="BasicUserInfo"> <h4 class="header_h"> Basic Informations</h4> <div class="row"> <div class="col-md-6"> <label class="control-label">User name: </label> <%= username %> </div> </div> <div class="row"> <div class="col-md-6"> <label class="control-label">First name: </label> <%= firstname %> </div> <div class="col-md-6"> <label class="control-label">Last name: </label> <%= lastname %> </div> </div> <div class="row"> <div class="col-md-6"> <label class="control-label">E-mail: </label> <%= email %> </div> <div class="col-md-6"> <label class="control-label">Created: </label> <span class="creationDate"><%= window.app.<API key>(created) %></span> </div> </div> </div> <br/> <div id="UserActivitiesInfo-<%= id %>"> <h4 class="header_h"> User activities resume</h4> <div class="<API key>" class="alert alert-info"><i class="glyphicon glyphicon-refresh"/> Loading...</div> <div class="<API key>"> <label class="control-label">Number of connections to this project : </label> <span id ="<API key>-<%= id %>"></span> <br/> <!--<label class="control-label">Number of consulted images: </label> <span id ="<API key>-<%= id %>"></span> <br/>--> <label class="control-label">Number of annotations : </label> <span id ="<API key>-<%= id %>"></span> <br/> <label class="control-label">Last connections on the project : </label> <span id ="<API key>-<%= id %>"></span> <br/> </div> </div> <br/> <div id="<API key>-<%= id %>"> <h4 class="header_h"> User activities history</h4> <div class="<API key>" class="alert alert-info"><i class="glyphicon glyphicon-refresh"/> Loading...</div> <div id="treehistory" class="<API key>"> </div> </div> </div> </div> <div class="modal-footer"> <a href="#" class="btn btn-default btn-primary" data-dismiss="modal">Close</a> </div> </div> </div> </div>
package org.swtk.common.dict.iso639.generated; import java.util.Collection; import java.util.HashMap; import java.util.Map; import org.swtk.common.dict.dto.iso639.Language; import org.swtk.common.dict.dto.iso639.adapter.LanguageAdapter; import org.swtk.common.dict.iso639.utils.Iso639Utils; public final class Iso639_T1 { private static Map<Integer, Language> map = new HashMap<Integer, Language>(); static { add("taa I L Lower Tanana "); add("tab I L Tabassaran "); add("tac I L Lowland Tarahumara "); add("tad I L Tause "); add("tae I L Tariana "); add("taf I L Tapirapé "); add("tag I L Tagoi "); add("tah tah tah ty I L Tahitian "); add("taj I L Eastern Tamang "); add("tak I L Tala "); add("tal I L Tal "); add("tam tam tam ta I L Tamil "); add("tan I L Tangale "); add("tao I L Yami "); add("tap I L Taabwa "); add("taq I L Tamasheq "); add("tar I L Central Tarahumara "); add("tas I E Tay Boi "); add("tat tat tat tt I L Tatar "); add("tau I L Upper Tanana "); add("tav I L Tatuyo "); add("taw I L Tai "); add("tax I L Tamki "); add("tay I L Atayal "); add("taz I L Tocho "); add("tba I L Aikanã "); add("tbb I E Tapeba "); add("tbc I L Takia "); add("tbd I L Kaki Ae "); add("tbe I L Tanimbili "); add("tbf I L Mandara "); add("tbg I L North Tairora "); add("tbh I E Thurawal "); add("tbi I L Gaam "); add("tbj I L Tiang "); add("tbk I L Calamian Tagbanwa "); add("tbl I L Tboli "); add("tbm I L Tagbu "); add("tbn I L Barro Negro Tunebo "); add("tbo I L Tawala "); add("tbp I L Taworta "); add("tbr I L Tumtum "); add("tbs I L Tanguat "); add("tbt I L Tembo (Kitembo) "); add("tbu I E Tubar "); add("tbv I L Tobo "); add("tbw I L Tagbanwa "); add("tbx I L Kapin "); add("tby I L Tabaru "); add("tbz I L Ditammari "); add("tca I L Ticuna "); add("tcb I L Tanacross "); add("tcc I L Datooga "); add("tcd I L Tafi "); add("tce I L Southern Tutchone "); add("tcf I L Malinaltepec Me'phaa "); add("tcg I L Tamagario "); add("tch I L Turks And Caicos Creole English "); add("tci I L Wára "); add("tck I L Tchitchege "); add("tcl I E Taman (Myanmar) "); add("tcm I L Tanahmerah "); add("tcn I L Tichurong "); add("tco I L Taungyo "); add("tcp I L Tawr Chin "); add("tcq I L Kaiy "); add("tcs I L Torres Strait Creole "); add("tct I L T'en "); add("tcu I L Southeastern Tarahumara "); add("tcw I L Tecpatlán Totonac "); add("tcx I L Toda "); add("tcy I L Tulu "); add("tcz I L Thado Chin "); add("tda I L Tagdal "); add("tdb I L Panchpargania "); add("tdc I L Emberá-Tadó "); add("tdd I L Tai Nüa "); add("tde I L Tiranige Diga Dogon "); add("tdf I L Talieng "); add("tdg I L Western Tamang "); add("tdh I L Thulung "); add("tdi I L Tomadino "); add("tdj I L Tajio "); add("tdk I L Tambas "); add("tdl I L Sur "); add("tdn I L Tondano "); add("tdo I L Teme "); add("tdq I L Tita "); add("tdr I L Todrah "); add("tds I L Doutai "); add("tdt I L Tetun Dili "); add("tdu I L Tempasuk Dusun "); add("tdv I L Toro "); add("tdx I L Tandroy-Mahafaly Malagasy "); add("tdy I L Tadyawan "); add("tea I L Temiar "); add("teb I E Tetete "); add("tec I L Terik "); add("ted I L Tepo Krumen "); add("tee I L Huehuetla Tepehua "); add("tef I L Teressa "); add("teg I L Teke-Tege "); add("teh I L Tehuelche "); add("tei I L Torricelli "); add("tek I L Ibali Teke "); add("tel tel tel te I L Telugu "); add("tem tem tem I L Timne "); add("ten I E Tama (Colombia) "); add("teo I L Teso "); add("tep I E Tepecano "); add("teq I L Temein "); add("ter ter ter I L Tereno "); add("tes I L Tengger "); add("tet tet tet I L Tetum "); add("teu I L Soo "); add("tev I L Teor "); add("tew I L Tewa (USA) "); add("tex I L Tennet "); add("tey I L Tulishi "); add("tfi I L Tofin Gbe "); add("tfn I L Tanaina "); add("tfo I L Tefaro "); add("tfr I L Teribe "); add("tft I L Ternate "); add("tga I L Sagalla "); add("tgb I L Tobilung "); add("tgc I L Tigak "); add("tgd I L Ciwogai "); add("tge I L Eastern Gorkha Tamang "); add("tgf I L Chalikha "); add("tgh I L Tobagonian Creole English "); add("tgi I L Lawunuia "); add("tgj I L Tagin "); add("tgk tgk tgk tg I L Tajik "); add("tgl tgl tgl tl I L Tagalog "); add("tgn I L Tandaganon "); add("tgo I L Sudest "); add("tgp I L Tangoa "); add("tgq I L Tring "); add("tgr I L Tareng "); add("tgs I L Nume "); add("tgt I L Central Tagbanwa "); add("tgu I L Tanggu "); add("tgv I E Tingui-Boto "); add("tgw I L Tagwana Senoufo "); add("tgx I L Tagish "); add("tgy I E Togoyo "); add("tgz I E Tagalaka "); add("tha tha tha th I L Thai "); add("thc I L Tai Hang Tong "); add("thd I L Thayore "); add("the I L Chitwania Tharu "); add("thf I L Thangmi "); add("thh I L Northern Tarahumara "); add("thi I L Tai Long "); add("thk I L Tharaka "); add("thl I L Dangaura Tharu "); add("thm I L Aheu "); add("thn I L Thachanadan "); add("thp I L Thompson "); add("thq I L Kochila Tharu "); add("thr I L Rana Tharu "); add("ths I L Thakali "); add("tht I L Tahltan "); add("thu I L Thuri "); add("thv I L Tahaggart Tamahaq "); add("thw I L Thudam "); add("thy I L Tha "); add("thz I L Tayart Tamajeq "); add("tia I L Tidikelt Tamazight "); add("tic I L Tira "); add("tid I L Tidong "); add("tif I L Tifal "); add("tig tig tig I L Tigre "); add("tih I L Timugon Murut "); add("tii I L Tiene "); add("tij I L Tilung "); add("tik I L Tikar "); add("til I E Tillamook "); add("tim I L Timbe "); add("tin I L Tindi "); add("tio I L Teop "); add("tip I L Trimuris "); add("tiq I L Tiéfo "); add("tir tir tir ti I L Tigrinya "); add("tis I L Masadiit Itneg "); add("tit I L Tinigua "); add("tiu I L Adasen "); add("tiv tiv tiv I L Tiv "); add("tiw I L Tiwi "); add("tix I L Southern Tiwa "); add("tiy I L Tiruray "); add("tiz I L Tai Hongjin "); add("tja I L Tajuasohn "); add("tjg I L Tunjung "); add("tji I L Northern Tujia "); add("tjl I L Tai Laing "); add("tjm I E Timucua "); add("tjn I E Tonjon "); add("tjo I L Temacine Tamazight "); add("tjs I L Southern Tujia "); add("tju I E Tjurruru "); add("tjw I L Djabwurrung "); add("tka I E Truká "); add("tkb I L Buksa "); add("tkd I L Tukudede "); add("tke I L Takwane "); add("tkf I E Tukumanféd "); add("tkg I L Tesaka Malagasy "); add("tkl tkl tkl I L Tokelau "); add("tkm I E Takelma "); add("tkn I L Toku-No-Shima "); add("tkp I L Tikopia "); add("tkq I L Tee "); add("tkr I L Tsakhur "); add("tks I L Takestani "); add("tkt I L Kathoriya Tharu "); add("tku I L Upper Necaxa Totonac "); add("tkv I L Mur Pano "); add("tkw I L Teanu "); add("tkx I L Tangko "); add("tkz I L Takua "); add("tla I L Southwestern Tepehuan "); add("tlb I L Tobelo "); add("tlc I L Yecuatla Totonac "); add("tld I L Talaud "); add("tlf I L Telefol "); add("tlg I L Tofanma "); add("tlh tlh tlh I C Klingon "); add("tli tli tli I L Tlingit "); add("tlj I L Talinga-Bwisi "); add("tlk I L Taloki "); add("tll I L Tetela "); add("tlm I L Tolomako "); add("tln I L Talondo' "); add("tlo I L Talodi "); add("tlp I L Filomena Mata-Coahuitlán Totonac "); add("tlq I L Tai Loi "); add("tlr I L Talise "); add("tls I L Tambotalo "); add("tlt I L Teluti "); add("tlu I L Tulehu "); add("tlv I L Taliabu "); add("tlx I L Khehek "); add("tly I L Talysh "); add("tma I L Tama (Chad) "); add("tmb I L Katbol "); add("tmc I L Tumak "); add("tmd I L Haruai "); add("tme I E Tremembé "); add("tmf I L Toba-Maskoy "); add("tmg I E Ternateño "); add("tmh tmh tmh M L Tamashek "); add("tmi I L Tutuba "); add("tmj I L Samarokena "); add("tmk I L Northwestern Tamang "); add("tml I L Tamnim Citak "); add("tmm I L Tai Thanh "); add("tmn I L Taman (Indonesia) "); add("tmo I L Temoq "); add("tmp I L Tai Mène "); add("tmq I L Tumleo "); add("tmr I E Jewish Babylonian Aramaic (ca. 200-1200 CE) "); add("tms I L Tima "); add("tmt I L Tasmate "); add("tmu I L Iau "); add("tmv I L Tembo (Motembo) "); add("tmw I L Temuan "); add("tmy I L Tami "); add("tmz I E Tamanaku "); add("tna I L Tacana "); add("tnb I L Western Tunebo "); add("tnc I L Tanimuca-Retuarã "); add("tnd I L Angosturas Tunebo "); add("tne I L Tinoc Kallahan "); add("tng I L Tobanga "); add("tnh I L Maiani "); add("tni I L Tandia "); add("tnk I L Kwamera "); add("tnl I L Lenakel "); add("tnm I L Tabla "); add("tnn I L North Tanna "); add("tno I L Toromono "); add("tnp I L Whitesands "); add("tnq I E Taino "); add("tnr I L Ménik "); add("tns I L Tenis "); add("tnt I L Tontemboan "); add("tnu I L Tay Khang "); add("tnv I L Tangchangya "); add("tnw I L Tonsawang "); add("tnx I L Tanema "); add("tny I L Tongwe "); add("tnz I L Tonga (Thailand) "); add("tob I L Toba "); add("toc I L Coyutla Totonac "); add("tod I L Toma "); add("toe I E Tomedes "); add("tof I L Gizrra "); add("tog tog tog I L Tonga (Nyasa) "); add("toh I L Gitonga "); add("toi I L Tonga (Zambia) "); add("toj I L Tojolabal "); add("tol I L Tolowa "); add("tom I L Tombulu "); add("ton ton ton to I L Tonga (Tonga Islands) "); add("too I L Xicotepec De Juárez Totonac "); add("top I L Papantla Totonac "); add("toq I L Toposa "); add("tor I L Togbo-Vara Banda "); add("tos I L Highland Totonac "); add("tou I L Tho "); add("tov I L Upper Taromi "); add("tow I L Jemez "); add("tox I L Tobian "); add("toy I L Topoiyo "); add("tpa I L Taupota "); add("tpc I L Azoyú Me'phaa "); add("tpe I L Tippera "); add("tpf I L Tarpia "); add("tpg I L Kula "); add("tpi tpi tpi I L Tok Pisin "); add("tpj I L Tapieté "); add("tpk I E Tupinikin "); add("tpl I L Tlacoapa Me'phaa "); add("tpm I L Tampulma "); add("tpn I E Tupinambá "); add("tpo I L Tai Pao "); add("tpp I L Pisaflores Tepehua "); add("tpq I L Tukpa "); add("tpr I L Tuparí "); add("tpt I L Tlachichilco Tepehua "); add("tpu I L Tampuan "); add("tpv I L Tanapag "); add("tpw I E Tupí "); add("tpx I L Acatepec Me'phaa "); add("tpy I L Trumai "); add("tpz I L Tinputz "); add("tqb I L Tembé "); add("tql I L Lehali "); add("tqm I L Turumsa "); add("tqn I L Tenino "); add("tqo I L Toaripi "); add("tqp I L Tomoip "); add("tqq I L Tunni "); add("tqr I E Torona "); add("tqt I L Western Totonac "); add("tqu I L Touo "); add("tqw I E Tonkawa "); add("tra I L Tirahi "); add("trb I L Terebu "); add("trc I L Copala Triqui "); add("trd I L Turi "); add("tre I L East Tarangan "); add("trf I L Trinidadian Creole English "); add("trg I L Lishán Didán "); add("trh I L Turaka "); add("tri I L Trió "); add("trj I L Toram "); add("trl I L Traveller Scottish "); add("trm I L Tregami "); add("trn I L Trinitario "); add("tro I L Tarao Naga "); add("trp I L Kok Borok "); add("trq I L San Martín Itunyoso Triqui "); add("trr I L Taushiro "); add("trs I L Chicahuaxtla Triqui "); add("trt I L Tunggare "); add("tru I L Turoyo "); add("trv I L Taroko "); add("trw I L Torwali "); add("trx I L Tringgus-Sembaan Bidayuh "); add("try I E Turung "); add("trz I E Torá "); add("tsa I L Tsaangi "); add("tsb I L Tsamai "); add("tsc I L Tswa "); add("tsd I L Tsakonian "); add("tse I L Tunisian Sign Language "); add("tsg I L Tausug "); add("tsh I L Tsuvan "); add("tsi tsi tsi I L Tsimshian "); add("tsj I L Tshangla "); add("tsk I L Tseku "); add("tsl I L Ts'ün-Lao "); add("tsm I L Turkish Sign Language "); add("tsn tsn tsn tn I L Tswana "); add("tso tso tso ts I L Tsonga "); add("tsp I L Northern Toussian "); add("tsq I L Thai Sign Language "); add("tsr I L Akei "); add("tss I L Taiwan Sign Language "); add("tst I L Tondi Songway Kiini "); add("tsu I L Tsou "); add("tsv I L Tsogo "); add("tsw I L Tsishingini "); add("tsx I L Mubami "); add("tsy I L Tebul Sign Language "); add("tsz I L Purepecha "); add("tta I E Tutelo "); add("ttb I L Gaa "); add("ttc I L Tektiteko "); add("ttd I L Tauade "); add("tte I L Bwanabwana "); add("ttf I L Tuotomb "); add("ttg I L Tutong "); add("tth I L Upper Ta'oih "); add("tti I L Tobati "); add("ttj I L Tooro "); add("ttk I L Totoro "); add("ttl I L Totela "); add("ttm I L Northern Tutchone "); add("ttn I L Towei "); add("tto I L Lower Ta'oih "); add("ttp I L Tombelala "); add("ttq I L Tawallammat Tamajaq "); add("ttr I L Tera "); add("tts I L Northeastern Thai "); add("ttt I L Muslim Tat "); add("ttu I L Torau "); add("ttv I L Titan "); add("ttw I L Long Wat "); add("tty I L Sikaritai "); add("ttz I L Tsum "); add("tua I L Wiarumus "); add("tub I L Tübatulabal "); add("tuc I L Mutu "); add("tud I E Tuxá "); add("tue I L Tuyuca "); add("tuf I L Central Tunebo "); add("tug I L Tunia "); add("tuh I L Taulil "); add("tui I L Tupuri "); add("tuj I L Tugutil "); add("tuk tuk tuk tk I L Turkmen "); add("tul I L Tula "); add("tum tum tum I L Tumbuka "); add("tun I E Tunica "); add("tuo I L Tucano "); add("tuq I L Tedaga "); add("tur tur tur tr I L Turkish "); add("tus I L Tuscarora "); add("tuu I L Tututni "); add("tuv I L Turkana "); add("tux I E Tuxináwa "); add("tuy I L Tugen "); add("tuz I L Turka "); add("tva I L Vaghua "); add("tvd I L Tsuvadi "); add("tve I L Te'un "); add("tvk I L Southeast Ambrym "); add("tvl tvl tvl I L Tuvalu "); add("tvm I L Tela-Masbuar "); add("tvn I L Tavoyan "); add("tvo I L Tidore "); add("tvs I L Taveta "); add("tvt I L Tutsa Naga "); add("tvu I L Tunen "); add("tvw I L Sedoa "); add("tvy I E Timor Pidgin "); add("twa I E Twana "); add("twb I L Western Tawbuid "); add("twc I E Teshenawa "); add("twd I L Twents "); add("twe I L Tewa (Indonesia) "); add("twf I L Northern Tiwa "); add("twg I L Tereweng "); add("twh I L Tai Dón "); add("twi twi twi tw I L Twi "); add("twl I L Tawara "); add("twm I L Tawang Monpa "); add("twn I L Twendi "); add("two I L Tswapong "); add("twp I L Ere "); add("twq I L Tasawaq "); add("twr I L Southwestern Tarahumara "); add("twt I E Turiwára "); add("twu I L Termanu "); add("tww I L Tuwari "); add("twx I L Tewe "); add("twy I L Tawoyan "); add("txa I L Tombonuo "); add("txb I A Tokharian B "); add("txc I E Tsetsaut "); add("txe I L Totoli "); add("txg I A Tangut "); add("txh I A Thracian "); add("txi I L Ikpeng "); add("txj I L Tarjumo "); add("txm I L Tomini "); add("txn I L West Tarangan "); add("txo I L Toto "); add("txq I L Tii "); add("txr I A Tartessian "); add("txs I L Tonsea "); add("txt I L Citak "); add("txu I L Kayapó "); add("txx I L Tatana "); add("txy I L Tanosy Malagasy "); add("tya I L Tauya "); add("tye I L Kyanga "); add("tyh I L O'du "); add("tyi I L Teke-Tsaayi "); add("tyj I L Tai Do "); add("tyl I L Thu Lao "); add("tyn I L Kombai "); add("typ I E Thaypan "); add("tyr I L Tai Daeng "); add("tys I L Tày Sa Pa "); add("tyt I L Tày Tac "); add("tyu I L Kua "); add("tyv tyv tyv I L Tuvinian "); add("tyx I L Teke-Tyee "); add("tyz I L Tày "); add("tza I L Tanzanian Sign Language "); add("tzh I L Tzeltal "); add("tzj I L Tz'utujil "); add("tzl I C Talossan "); add("tzm I L Central Atlas Tamazight "); add("tzn I L Tugun "); add("tzo I L Tzotzil "); add("tzx I L Tabriak "); } private static void add(String line) { try { Language entity = LanguageAdapter.transform(line); map.put(entity.hashCode(), entity); } catch (Exception e) { e.printStackTrace(); } } public static Language findById(String id) { return Iso639Utils.findById(id, map); } public static Language findByName(String name) { return Iso639Utils.findByName(name, map); } public static Map<String, Collection<String>> <API key>() { return Iso639Utils.<API key>(map); } public static Collection<String> <API key>() { return Iso639Utils.<API key>(map); } public static boolean hasById(String id) { return null != findById(id); } public static boolean hasByName(String name) { return null != findByName(name); } }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="generator" content="HelpNDoc Professional Edition 6.8.0.521"> <meta name="viewport" content="width=device-width, initial-scale=1" /> <link rel="icon" href="favicon.ico"/> <title>Language</title> <meta name="description" content="" /> <meta name="keywords" content=""> <!-- Twitter Card data --> <meta name="twitter:card" content="summary"> <meta name="twitter:title" content="Language"> <meta name="<TwitterConsumerkey>" content=""> <!-- Open Graph data --> <meta property="og:title" content="Language" /> <meta property="og:type" content="article" /> <meta property="og:description" content="" /> <meta property="og:site_name" content="Trifolia Workbench" /> <!-- Bootstrap core CSS --> <link href="vendors/bootstrap-3.4.1/css/bootstrap.min.css" rel="stylesheet"/> <!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> <link href="vendors/bootstrap-3.4.1/css/<API key>.css" rel="stylesheet"/> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="vendors/html5shiv-3.7.3/html5shiv.min.js"></script> <script src="vendors/respond-1.4.2/respond.min.js"></script> <![endif] <!-- JsTree styles --> <link href="vendors/jstree-3.3.7/themes/default/style.min.css" rel="stylesheet"/> <!-- Hnd styles --> <link href="css/layout.min.css" rel="stylesheet" /> <link href="css/effects.min.css" rel="stylesheet" /> <link href="css/theme-light-blue.min.css" rel="stylesheet" /> <link href="css/print.min.css" rel="stylesheet" media="print" /> <style type="text/css">nav { width: 350px} @media screen and (min-width:769px) { body.md-nav-expanded div#main { margin-left: 350px} body.md-nav-expanded header { padding-left: 364px} }</style> <!-- Content style --> <link href="css/hnd.content.css" rel="stylesheet" /> </head> <body class="md-nav-expanded"> <div id="skip-link"> <a href="#main-content" class="element-invisible">Skip to main content</a> </div> <header class="headroom"> <button class="hnd-toggle btn btn-default"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span> </button> <h1>Trifolia Workbench</h1> </header> <nav class="md-nav-expanded"> <!-- Nav tabs --> <ul class="tab-tabs nav nav-tabs" role="tablist"> <li id="nav-close"> <button class="hnd-toggle btn btn-default"> <span class="glyphicon glyphicon-remove" aria-hidden="true"></span> </button> </li> <li role="presentation" class="tab active"> <a href="#contents" id="tab-contents" aria-controls="contents" role="tab" data-toggle="tab"> <i class="glyphicon glyphicon-list"></i> Contents </a> </li> <li role="presentation" class="tab"> <a href="#index" id="tab-index" aria-controls="index" role="tab" data-toggle="tab"> <i class="glyphicon glyphicon-asterisk"></i> Index </a> </li> <li role="presentation" class="tab"> <a href="#search" id="tab-search" aria-controls="search" role="tab" data-toggle="tab"> <i class="glyphicon glyphicon-search"></i> Search </a> </li> </ul> <!-- /Nav tabs --> <!-- Tab panes --> <div class="tab-content"> <div role="tabpanel" class="tab-pane active" id="contents"> <div id="toc" class="tree-container unselectable" data-url="_toc.json" data-openlvl="1" > </div> </div> <!-- /contents--> <div role="tabpanel" class="tab-pane" id="index"> <div id="keywords" class="tree-container unselectable" data-url="_keywords.json" data-openlvl="1" > </div> </div> <!-- /index--> <div role="tabpanel" class="tab-pane" id="search"> <div class="search-content"> <div class="search-input"> <form id="search-form"> <div class="form-group"> <div class="input-group"> <input type="text" class="form-control" id="input-search" name="input-search" placeholder="Search..." /> <span class="input-group-btn"> <button class="btn btn-default" type="submit"> <span class="glyphicon glyphicon-search" aria-hidden="true"></span> </button> </span> </div> </div> </form> </div> <!-- /search-input --> <div class="search-result"> <div id="search-info"></div> <div class="tree-container unselectable" id="search-tree"></div> </div> <!-- /search-result --> </div> <!-- /search-content --> </div> <!-- /search--> </div> <!-- /Tab panes --> </nav> <div id="main"> <article> <div id="topic-content" class="container-fluid" data-hnd-id="Language" data-hnd-context="63" data-hnd-title="Language" > <div class="navigation"> <ol class="breadcrumb"> <li><a href="Introduction.html">Introduction</a></li> </ol> <div class="nav-arrows"> <div class="btn-group btn-group-xs" role="group"><a class="btn btn-default" href="Introduction.html" title="Introduction" role="button"><span class="glyphicon glyphicon-menu-up" aria-hidden="true"></span></a><a class="btn btn-default" href="SystemRequirements.html" title="System Requirements" role="button"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span></a><a class="btn btn-default" href="LoggingIn.html" title="Logging In" role="button"><span class="glyphicon <API key>" aria-hidden="true"></span></a></div> </div> </div> <a id="main-content"></a> <h2>Language</h2> <div class="main-content"> <p></p> <div class="rvps2"><table width="100%" border="1" cellpadding="1" cellspacing="2" style="border-color: #000000; border-style: solid; border-spacing: 2px;"> <tr valign="top"> <td style="border-color: #000000; border-style: solid; padding: 1px;"><p class="rvps2"><span class="rvts19">CDA Term</span></p> </td> <td style="border-color: #000000; border-style: solid; padding: 1px;"><p class="rvps2"><span class="rvts19">FHIR Term</span></p> </td> </tr> <tr valign="top"> <td style="border-color: #000000; border-style: solid; padding: 1px;"><p class="rvps2"><span class="rvts6">Template</span></p> </td> <td style="border-color: #000000; border-style: solid; padding: 1px;"><p class="rvps2"><span class="rvts6">Profile</span></p> </td> </tr> <tr valign="top"> <td style="border-color: #000000; border-style: solid; padding: 1px;"><p class="rvps2"><span class="rvts6">Branch</span></p> </td> <td style="border-color: #000000; border-style: solid; padding: 1px;"><p class="rvps2"><span class="rvts6">Slice</span></p> </td> </tr> <tr valign="top"> <td style="border-color: #000000; border-style: solid; padding: 1px;"><p class="rvps2"><span class="rvts6">Branch Identifier</span></p> </td> <td style="border-color: #000000; border-style: solid; padding: 1px;"><p class="rvps2"><span class="rvts6">Discriminator</span></p> </td> </tr> </table> </div> <p></p> </div> <div id="topic_footer"><div id="<API key>">Copyright &copy; 2019 by Lantana Consulting Group. All Rights Reserved.</div></div> </div> <!-- /#topic-content --> </article> <footer></footer> </div> <!-- /#main --> <div class="mask" data-toggle="sm-nav-expanded"></div> <!-- Modal --> <div class="modal fade" id="hndModal" tabindex="-1" role="dialog" aria-labelledby="hndModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <h4 class="modal-title" id="hndModalLabel"></h4> </div> <div class="modal-body"> </div> <div class="modal-footer"> <button type="button" class="btn btn-primary modal-btn-close" data-dismiss="modal">Close</button> </div> </div> </div> </div> <!-- Scripts --> <script src="vendors/jquery-3.4.1/jquery.min.js"></script> <script src="vendors/bootstrap-3.4.1/js/bootstrap.min.js"></script> <script src="vendors/markjs-8.11.1/jquery.mark.min.js"></script> <script src="vendors/uri-1.19.1/uri.min.js"></script> <script src="vendors/imageMapResizer-1.0.7/imageMapResizer.min.js"></script> <!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> <script src="vendors/bootstrap-3.4.1/js/<API key>.js"></script> <!-- Headroom --> <script src="vendors/headroom-0.9.4/headroom.min.js"></script> <script src="vendors/headroom-0.9.4/jquery.headroom.min.js"></script> <!-- JsTree --> <script src="vendors/jstree-3.3.7/jstree.min.js"></script> <!-- HelpNDoc scripts --> <script src="_translations.js"></script> <script src="js/hndsd.min.js"></script> <script src="js/hndse.min.js"></script> <script src="js/app.min.js"></script> <!-- Scripts --> <script> $(function() { // Create the app var app = new Hnd.App(); // Update translations hnd_ut(app); // Instanciate imageMapResizer imageMapResize(); // Custom JS // Boot the app app.Boot(); }); </script> </body> </html>
#ifndef __FWBASE_H__ #define __FWBASE_H__ #ifndef OPT_PREFIX #define OPT_PREFIX #endif #ifndef OPT_LEVEL #define OPT_LEVEL SSE2 #endif //#if (OPT_LEVEL==1) //#undef OPT_LEVEL //#define OPT_LEVEL SSE2 //#endif #if defined (OPT_F10H) #define CBL_OPTLEVEL CBL_GH #elif defined (OPT_SSE3) #error Not supposed to be using SSE3 code path anywhere! #elif defined (OPT_SSE2) #define CBL_OPTLEVEL CBL_SSE2 #else #define CBL_OPTLEVEL CBL_SSE2 // for fe only ATM. Find a better fix if using it anywhere else #endif // Types typedef signed char Fw8s ; typedef signed short Fw16s; typedef signed int Fw32s; typedef signed long long Fw64s; typedef unsigned char Fw8u ; typedef unsigned short Fw16u; typedef unsigned int Fw32u; typedef unsigned long long Fw64u; typedef float Fw32f; typedef double Fw64f; // MAX/MIN Data Types constants #define FW_MAX_8U CBL_U8_MAX #define FW_MIN_8U CBL_U8_MIN #define FW_MAX_16U CBL_U16_MAX #define FW_MIN_16U CBL_U16_MIN #define FW_MAX_32U CBL_U32_MAX #define FW_MIN_32U CBL_U32_MIN #define FW_MAX_64U CBL_U64_MAX #define FW_MIN_64U CBL_U64_MIN #define FW_MAX_8S CBL_S8_MAX #define FW_MIN_8S CBL_S8_MIN #define FW_MAX_16S CBL_S16_MAX #define FW_MIN_16S CBL_S16_MIN #define FW_MAX_32S CBL_S32_MAX #define FW_MIN_32S CBL_S32_MIN #define FW_MAX_64S CBL_S64_MAX #define FW_MIN_64S CBL_S64_MIN typedef struct Fw16sc { Fw16s re; Fw16s im; }Fw16sc; typedef struct Fw32sc { Fw32s re; Fw32s im; }Fw32sc; typedef struct Fw64sc { Fw64s re; Fw64s im; }Fw64sc; typedef struct Fw32fc { Fw32f re; Fw32f im; } Fw32fc; typedef struct Fw64fc { Fw64f re; Fw64f im; } Fw64fc; typedef struct { int x; int y; } FwiPoint; typedef struct { int width; int height; } FwiSize; typedef struct { int x; int y; int width; int height; } FwiRect; typedef enum { fwAxsHorizontal, fwAxsVertical, fwAxsBoth } FwiAxis; typedef enum _FwiBorderType { fwBorderConst = 0, fwBorderRepl = 1, fwBorderWrap = 2, fwBorderMirror = 3, fwBorderMirrorR = 4, fwBorderMirror2 = 5, fwBorderInMem = 6, fwBorderInMemTop = 0x0010, fwBorderInMemBottom = 0x0020 } FwiBorderType; typedef enum _FwiMaskSize { fwMskSize1x3 = 13, fwMskSize1x5 = 15, fwMskSize3x1 = 31, fwMskSize3x3 = 33, fwMskSize5x1 = 51, fwMskSize5x5 = 55 } FwiMaskSize; // Enumerated Types typedef enum { fwFalse = 0, // No-Normalize sequence of coefficients fwTrue // Normalize sequence of coefficients } FwBool; //! FwCpuType typedef enum { fwCpuUnknown = 0, fwCpuSSE = 0x40, fwCpuSSE2, fwCpuSSE3, fwCpuFamily10h }FwCpuType; typedef struct { int major; int minor; int majorBuild; int build; char targetCpu[4]; const char* Name; const char* Version; const char* BuildDate; } FwLibraryVersion; //! FwStatus value enumeration typedef enum { /* errors */ <API key> = -9999, <API key> = -9998, <API key> = -204 , fwStsCountMatrixErr = -203 , <API key> = -202 , <API key> = -201 , fwStsSrcDataErr = -200 , <API key> = -199 , <API key> = -198 , fwStsFreqTableErr = -197 , <API key> = -196 , fwStsSingularErr = -195 , fwStsSparseErr = -194 , fwStsBitOffsetErr = -193 , fwStsQPErr = -192 , fwStsVLCErr = -191 , <API key> = -190 , fwStsRegExpErr = -189 , <API key> = -188 , <API key> = -187 , <API key> = -186 , <API key> = -185 , <API key> = -184 , <API key> = -183 , <API key> = -182 , fwStsCTRSizeErr = -181 , <API key> = -180 , fwStsNotPosDefErr = -179 , fwStsMessageErr = -177 , fwStsOutOfECErr = -173 , <API key> = -172 , <API key> = -171 , fwStsMP3SideInfoErr = -170 , fwStsBlockStepErr = -169 , fwStsMBStepErr = -168 , fwStsAacPrgNumErr = -167 , fwStsAacSectCbErr = -166 , fwStsAacSfValErr = -164 , fwStsAacCoefValErr = -163 , fwStsAacMaxSfbErr = -162 , fwStsAacPredSfbErr = -161 , fwStsAacPlsDataErr = -160 , fwStsAacGainCtrErr = -159 , fwStsAacSectErr = -158 , <API key> = -157 , fwStsAacTnsLenErr = -156 , fwStsAacTnsOrderErr = -155 , <API key> = -154 , fwStsAacTnsCoefErr = -153 , <API key> = -152 , <API key> = -151 , fwStsAacErr = -150 , <API key> = -149 , <API key> = -148 , <API key> = -147 , fwStsAacWinLenErr = -146 , fwStsAacWinGrpErr = -145 , fwStsAacWinSeqErr = -144 , fwStsAacComWinErr = -143 , <API key> = -142 , fwStsAacChanErr = -141 , <API key> = -140 , <API key> = -139 , <API key> = -138 , fwStsAacScalableErr = -137 , fwStsAacObjTypeErr = -136 , fwStsAacWinShapeErr = -135 , fwStsAacPcmModeErr = -134 , <API key> = -133 , <API key> = -132 , <API key> = -131 , <API key> = -130 , <API key> = -129 , <API key> = -128 , <API key> = -127 , <API key> = -126 , fwStsNoiseRangeErr = -125 , fwStsUnderRunErr = -124 , fwStsPaddingErr = -123 , fwStsCFBSizeErr = -122 , <API key> = -121 , fwStsLengthErr = -119 , fwStsBadModulusErr = -118 , fwStsLPCCalcErr = -117 , fwStsRCCalcErr = -116 , <API key> = -115 , fwStsNoRootFoundErr = -114 , <API key> = -113 , <API key> = -112 , <API key> = -111 , <API key> = -110 , <API key> = -109 , fwStsNotEvenStepErr = -108 , <API key> = -107 , <API key> = -106 , <API key> = -105 , fwStsMP4QPErr = -104 , fwStsMP4BlockIdxErr = -103 , <API key> = -102 , fwStsMP4MVCodeErr = -101 , fwStsMP4VLCCodeErr = -100 , fwStsMP4DCCodeErr = -99 , fwStsMP4FcodeErr = -98 , fwStsMP4AlignErr = -97 , fwStsMP4TempDiffErr = -96 , <API key> = -95 , fwStsMP4ZeroBABErr = -94 , fwStsMP4PredDirErr = -93 , <API key> = -92 , <API key> = -91 , <API key> = -90 , <API key> = -83 , <API key> = -82 , fwStsH263MBStepErr = -81 , <API key> = -80 , <API key> = -79 , <API key> = -78 , <API key> = -77 , fwStsH263QuantErr = -76 , fwStsH263MVCodeErr = -75 , fwStsH263VLCCodeErr = -74 , fwStsH263DCCodeErr = -73 , <API key> = -72 , fwStsFBankFreqErr = -71 , fwStsFBankFlagErr = -70 , fwStsFBankErr = -69 , fwStsNegOccErr = -67 , fwStsCdbkFlagErr = -66 , fwStsSVDCnvgErr = -65 , <API key> = -64 , <API key> = -63 , <API key> = -62 , fwStsDrawTextErr = -61 , <API key> = -60 , <API key> = -59 , fwStsQuadErr = -58 , fwStsRectErr = -57 , fwStsCoeffErr = -56 , fwStsNoiseValErr = -55 , <API key> = -54 , fwStsNumChannelsErr = -53 , fwStsCOIErr = -52 , fwStsDivisorErr = -51 , fwStsAlphaTypeErr = -50 , fwStsGammaRangeErr = -49 , fwStsGrayCoefSumErr = -48 , fwStsChannelErr = -47 , fwStsToneMagnErr = -46 , fwStsToneFreqErr = -45 , fwStsTonePhaseErr = -44 , fwStsTrnglMagnErr = -43 , fwStsTrnglFreqErr = -42 , fwStsTrnglPhaseErr = -41 , fwStsTrnglAsymErr = -40 , fwStsHugeWinErr = -39 , fwStsJaehneErr = -38 , fwStsStrideErr = -37 , fwStsEpsValErr = -36 , fwStsWtOffsetErr = -35 , fwStsAnchorErr = -34 , fwStsMaskSizeErr = -33 , fwStsShiftErr = -32 , <API key> = -31 , fwStsSamplePhaseErr = -30 , fwStsFIRMRFactorErr = -29 , fwStsFIRMRPhaseErr = -28 , fwStsRelFreqErr = -27 , fwStsFIRLenErr = -26 , fwStsIIROrderErr = -25 , <API key> = -24 , <API key> = -23 , <API key> = -22 , fwStsMirrorFlipErr = -21 , <API key> = -20 , <API key> = -19 , fwStsThresholdErr = -18 , <API key> = -17 , fwStsStepErr = -14 , fwStsScaleRangeErr = -13 , fwStsDataTypeErr = -12 , fwStsOutOfRangeErr = -11 , fwStsDivByZeroErr = -10 , fwStsMemAllocErr = -9 , fwStsNullPtrErr = -8 , fwStsRangeErr = -7 , fwStsSizeErr = -6 , fwStsBadArgErr = -5 , fwStsNoMemErr = -4 , fwStsSAReservedErr3 = -3 , fwStsErr = -2 , fwStsSAReservedErr1 = -1 , // no errors fwStsNoErr = 0 , // warnings fwStsNoOperation = 1 , fwStsMisalignedBuf = 2 , fwStsSqrtNegArg = 3 , fwStsInvZero = 4 , <API key> = 5 , fwStsDivByZero = 6 , fwStsLnZeroArg = 7 , fwStsLnNegArg = 8 , fwStsNanArg = 9 , fwStsJPEGMarker = 10 , fwStsResFloor = 11 , fwStsOverflow = 12 , fwStsLSFLow = 13 , fwStsLSFHigh = 14 , fwStsLSFLowAndHigh = 15 , fwStsZeroOcc = 16 , fwStsUnderflow = 17 , fwStsSingularity = 18 , fwStsDomain = 19 , fwStsCpuMismatch = 21 , <API key> = 22 , <API key> = 23 , <API key> = 24 , <API key> = 25 , <API key> = 26 , fwStsOverlongString = 27 , <API key> = 28 , <API key> = 29 , <API key> = 30 , <API key> = 31 , <API key> = 32 , <API key> = 33 , fwStsStreamEnd = 34 , fwStsDoubleSize = 35 , <API key> = 36 , <API key> = 37 , fwStsJPEGMarkerWarn = 38 } FwStatus; #define fwStsOk fwStsNoErr // comparison typedef enum { fwCmpLess , fwCmpLessEq , fwCmpEq , fwCmpGreaterEq, fwCmpGreater } FwCmpOp; // suggested algorithm typedef enum { fwAlgHintNone, fwAlgHintFast, fwAlgHintAccurate } FwHintAlgorithm; // Round mode typedef enum { fwRndZero, fwRndNear } FwRoundMode; // PLATFORM SPECIFIC #if defined( WIN64 ) || defined( _WIN64 ) || \ defined( WIN32 ) || defined( _WIN32 ) || \ defined( WINDOWS ) || defined( _WINDOWS ) #define STDCALL __stdcall #else #define STDCALL #endif typedef void(*WorkFn)(void*); #ifdef __cplusplus extern "C" { #endif // GetLibVersion const FwLibraryVersion* STDCALL fwGetLibVersion (); // GetStatusString const char * STDCALL fwGetStatusString( FwStatus StsCode ); // GetCpuType FwCpuType STDCALL fwGetCpuType(); // GetCpuClocks Fw64u STDCALL fwGetCpuClocks(); // StaticInit FwStatus STDCALL fwStaticInit(); // StaticInitCpu FwStatus STDCALL fwStaticInitCpu( FwCpuType cpu ); // SetNumThreads FwStatus STDCALL fwSetNumThreads( unsigned int numThr ); // GetNumThreads Fw32u STDCALL fwGetNumThreads(); // Malloc void * STDCALL fwMalloc( int length ); // Free void STDCALL fwFree( void * ptr ); // AlignPtr void * STDCALL fwAlignPtr( void *ptr, int alignBytes); // Internal Functions // SetNumThreads_local FwStatus STDCALL <API key>( unsigned int numThr ); // Run void STDCALL fwRun( WorkFn workFn, void* param ); // Wait void STDCALL fwWait(); // GetInitType int STDCALL fwGetInitType(); // BaseData void * STDCALL fwBaseData(); #ifdef __cplusplus } #endif #endif // __FWBASE_H__
var painter = require('services/painter') var types = require('base/types') module.exports = class Shader extends require('base/glslcompiler'){ prototype() { // default shader properties this.props = { // painter uniforms time :{kind:'uniform', block:'painter', value:1.0}, pixelRatio :{kind:'uniform', block:'painter', type:types.float}, pickPass :{kind:'uniform', block:'painter', type:types.float}, fingerInfo :{kind:'uniform', block:'painter', type:types.mat4}, vertexPostMatrix:{kind:'uniform', block:'painter', type:types.mat4}, camPosition :{kind:'uniform', block:'painter', type:types.mat4}, camProjection :{kind:'uniform', block:'painter', type:types.mat4}, paintId :{kind:'uniform', block:'todo', value:0.}, viewScroll :{kind:'uniform', block:'todo', type:types.vec2}, viewSpace :{kind:'uniform', block:'todo', type:types.vec4}, viewPosition :{kind:'uniform', block:'todo', type:types.mat4}, viewInverse :{kind:'uniform', block:'todo', type:types.mat4}, // draw uniforms viewClip :{kind:'uniform', value:[0, 0, 0, 0]}, pickAlpha :{kind:'uniform', value:0.5}, pickId :{mask:0, value:0.}, animStart :{mask:0, value:1.0}, animState :{mask:0, value:0.}, animNext :{mask:0, value:0.}, state :'default', queue :0, id :0, // clipping ordering and scrolling order :0, moveScroll :1, turtleClip :[-50000, -50000, 50000, 50000], } this.defines = { 'PI':'3.141592653589793', 'E':'2.718281828459045', 'LN2':'0.6931471805599453', 'LN10':'2.302585092994046', 'LOG2E':'1.4426950408889634', 'LOG10E':'0.4342944819032518', 'SQRT1_2':'0.70710678118654757', 'TORAD':'0.017453292519943295', 'GOLDEN':'1.618033988749895' } // Allocate non draw block names for(let key in this._props){ var prop = this._props[key] if(prop.kind === 'uniform') { if(!prop.block || prop.block === 'draw') continue painter.nameId('thisDOT' + key) } } // safety for infinite loops this.propAllocLimit = 1500000 this.tweenTime = this.tweenAll this.verbs = { length:function() { if(!$props) return 0 return this.PROPLEN() }, //order:function(overload) { // this.ALLOCDRAW(overload, 0) // return $props reuse :function(overload, length) { this.ALLOCDRAW(overload, 0) // lets flip it again since we are reusing $props.flip() //return $props // alright so. now what. // make sure we are drawn //var $props = this.orderNAME(overload) //var $props = this.$shaders.NAME.$props if(length !== undefined) { console.error("LENGTH NOT ZERO") } // $props.oldLength = // $props.length = length //else if($props.oldLength !== undefined) { // $props.length = $props.oldLength // $props.oldLength = undefined // $props.dirty = false } } } // Entrypoints vertexMain() {$ // reference the props this.time this.animStart this.animState this.animNext //if(this.tween > 0.01) { // this.normalTween = clamp((this.animTime - this.tweenStart) / this.duration, 0.0, 1.0) // T = this.easedTween = this.tweenTime( // this.tween, // this.normalTween, // this.ease.x, // this.ease.y, // this.ease.z, // this.ease.w $INITIALIZEVARIABLES var position = this.vertex() if(this.vertexPostMatrix[0][0] != 1. || this.vertexPostMatrix[1][1] != 1.) { gl_Position = position * this.vertexPostMatrix } else { gl_Position = position } } pixelMain() {$ var color = this.pixel() if(this.pickPass > 0.5) { if(color.a < this.pickAlpha) discard gl_FragColor = vec4(this.paintId / 255., floor(this.pickId / 65536.0)/255., floor(this.pickId / 256.0) / 255., mod(this.pickId, 256.0) / 255.) } else { gl_FragColor = color } } // Timing functions linear(_t) { return clamp(_t, 0., 1.) } ease(_t, _begin, _end) { if(_t < 0.) return 0. if(_t > 1.) return 1. var a = -1. / max(1., (_begin * _begin)) var b = 1. + 1. / max(1., (_end * _end)) var t2 = pow(((a - 1.) * -b) / (a * (1. - b)), _t) return (-a * b + b * a * t2) / (a * t2 - b) } bounce(_t, _dampen) { if(_t < 0.) return 0. if(_t > 1.) return 1. // add bounciness var it = _t * (1. / (1. - _dampen)) + 0.5 var inlog = (_dampen - 1.) * it + 1. if(inlog <= 0.) return 1. var k = floor(log(inlog) / log(_dampen)) var d = pow(_dampen, k) return 1. - (d * (it - (d - 1.) / (_dampen - 1.)) - pow((it - (d - 1.) / (_dampen - 1.)), 2.)) * 4. } elastic(_t, _duration, _frequency, _decay, _ease) { if(_t < 0.) return 0. if(_t > 1.) return 1. var easein = _ease var easeout = 1. if(_ease < 0.) easeout = -_ease,easein = 1. if(_t < _duration) { return this.easeTiming(_t / _duration, easein, easeout) } else { // we have to snap the frequency so we end at 0 var w = (floor(.5 + (1. - _duration) * _frequency * 2.) / ((1. - _duration) * 2.)) * PI * 2. var velo = (this.easeTiming(1.001, easein, easeout) - this.easeTiming(1., easein, easeout)) / (0.001 * _duration) return 1. + velo * ((sin((_t - _duration) * w) / exp((_t - _duration) * _decay)) / w) } } bezier(t, cp0, cp1, cp2, cp3) { if(t < 0.) return 0. if(t > 1.) return 1. if(abs(cp0 - cp1) < 0.001 && abs(cp2 - cp3) < 0.001) return t var epsilon = 1.0 / 200.0 * t var cx = 3.0 * cp0 var bx = 3.0 * (cp2 - cp0) - cx var ax = 1.0 - cx - bx var cy = 3.0 * cp1 var by = 3.0 * (cp3 - cp1) - cy var ay = 1.0 - cy - by var u = t for(let i = 0;i < 6;i++){ var x = ((ax * u + bx) * u + cx) * u - t if(abs(x) < epsilon) return ((ay * u + by) * u + cy) * u var d = (3.0 * ax * u + 2.0 * bx) * u + cx if(abs(d) < 1e-6) break u = u - x / d } if(t > 1.) return (ay + by) + cy if(t < 0.) return 0.0 var l = 0, w = 0.0, v = 1.0 u = t for(let i = 0;i < 8;i++){ var x = ((ax * u + bx) * u + cx) * u if(abs(x - t) < epsilon) return ((ay * u + by) * u + cy) * u if(t > x) w = u else v = u u = (v - w) * .5 + w } return ((ay * u + by) * u + cy) * u } // Fingers fingerPos(i) { var f = this.fingerInfo[i] return (vec4(f.xy, 0., 1.) * this.viewInverse).xy + vec2(this.moveScroll * this.viewScroll.x, this.moveScroll * this.viewScroll.y) } checkFingerDown(f, pos) { pos = (vec4(f.xy, 0., 1.) * this.viewInverse).xy + vec2(this.moveScroll * this.viewScroll.x, this.moveScroll * this.viewScroll.y) return (f[2] > 0. && this.paintId == f[2] && (this.pickId < 0. || this.pickId == f[3]))?true:false } isFingerDown(pos) {$ pos = vec2(0.) if(this.checkFingerDown(this.fingerInfo[0], pos)) return 1 if(this.checkFingerDown(this.fingerInfo[1], pos)) return 2 if(this.checkFingerDown(this.fingerInfo[2], pos)) return 3 if(this.checkFingerDown(this.fingerInfo[3], pos)) return 4 return 0 } checkFingerOver(f, pos) { var f2 = abs(f[2]) pos = (vec4(f.xy, 0., 1.) * this.viewInverse).xy + vec2(this.moveScroll * this.viewScroll.x, this.moveScroll * this.viewScroll.y) return (this.paintId == f2 && (this.pickId < 0. || this.pickId == f[3]))?true:false } isFingerOver(pos) {$ pos = vec2(0.) if(this.checkFingerOver(this.fingerInfo[0], pos)) return 1 if(this.checkFingerOver(this.fingerInfo[1], pos)) return 2 if(this.checkFingerOver(this.fingerInfo[2], pos)) return 3 if(this.checkFingerOver(this.fingerInfo[3], pos)) return 4 return 0 } // Simple vector API antialias(p) { return 1. / length(vec2(length(dFdx(p)), length(dFdy(p)))) } premulAlpha(color) { return vec4(color.rgb * color.a, color.a) } // 2D canvas api for shader viewport(pos = this.mesh.xy * vec2(this.w, this.h)) {$ this.pos = pos this.result = vec4(0.) this._oldShape = this.shape = 1e+20 this.blur = 0.00001 this._aa = this.antialias(pos) this._scale = 1. return pos } translate(x, y) {$ this.pos -= vec2(x, y) } rotate(a, x = 0., y = 0.) {$ var ca = cos(-a), sa = sin(-a) var p = this.pos - vec2(x, y) this.pos = vec2(p.x * ca - p.y * sa, p.x * sa + p.y * ca) + vec2(x, y) } scale(f, x = 0., y = 0.) {$ this._scale *= f this.pos = (this.pos - vec2(x, y)) * f + vec2(x, y) } clear(color) { this.result = vec4(color.rgb * color.a + this.result.rgb * (1. - color.a), color.a) } _calcBlur(w) { var f = w - this.blur var wa = clamp(-w * this._aa, 0., 1.) var wb = this.blur < 0.0001?1.0:clamp(-w / this.blur, 0., 1.) return wa * wb } fillKeep(color) {$ var f = this._calcBlur(this.shape) var source = vec4(color.rgb * color.a, color.a) var dest = this.result this.result = source * f + dest * (1. - source.a * f) return this.result } fill(color) {$ this.fillKeep(color) this._oldShape = this.shape = 1e+20 return this.result } strokeKeep(color, width, displace = 0.) {$ var f = this._calcBlur(abs(this.shape + displace) - width / this._scale) var source = vec4(color.rgb * color.a, color.a) var dest = this.result this.result = source * f + dest * (1. - source.a * f) } stroke(color, width, displace = 0.) {$ this.strokeKeep(color, width, displace) this._oldShape = this.shape = 1e+20 return this.result } glowKeep(color, width, displace = 0.) {$ var f = this._calcBlur(abs(this.shape + displace) - width / this._scale) var source = vec4(color.rgb * color.a, color.a) var dest = this.result this.result = vec4(source.rgb * f, 0.) + dest } glow(color, width, displace = 0.) {$ this.glowKeep(color, width, displace) this._oldShape = this.shape = 1e+20 return this.result } union() { this._oldShape = this.shape = min(this.field, this._oldShape) } intersect() { this._oldShape = this.shape = max(this.field, this._oldShape) } subtract() { this._oldShape = this.shape = max(-this.field, this._oldShape) } gloop(k) { var h = clamp(.5 + .5 * (this._oldShape - this.field) / k, 0., 1.) this._oldShape = this.shape = mix(this._oldShape, this.field, h) - k * h * (1.0 - h) } blend(k){ this._oldShape = this.shape = mix(this._oldShape, this.field, k) } circle(x, y, r) {$ var c = this.pos - vec2(x, y) this.field = (length(c.xy) - r) / this._scale this._oldShape = this.shape this.shape = min(this.shape, this.field) } box(x, y, w, h, r) {$ var p = this.pos - vec2(x, y) var size = vec2(.5 * w, .5 * h) var bp = max(abs(p - size.xy) - (size.xy - vec2(2. * r).xy), vec2(0.)) this.field = (length(bp) - 2. * r) / this._scale this._oldShape = this.shape this.shape = min(this.shape, this.field) } rect(x, y, w, h) {$ var s = vec2(w, h) * .5 var d = abs(vec2(x, y) - this.pos + s) - s var dm = min(d, vec2(0.)) this.field = max(dm.x, dm.y) + length(max(d, vec2(0.))) this._oldShape = this.shape this.shape = min(this.shape, this.field) } moveTo(x, y) {$ this._lastPos = this._startPos = vec2(x, y) } lineTo(x, y) {$ var p = vec2(x, y) var pa = this.pos - this._lastPos.xy var ba = p - this._lastPos var h = clamp(dot(pa, ba) / dot(ba, ba), 0., 1.) this.field = length(pa - ba * h) / this._scale //this.shape = sin(this.mesh.x*this.field)*1. //this.box(10,10,100,100) this._oldShape = this.shape this.shape = min(this.shape, this.field) this._lastPos = p } closePath() {$ this.lineTo(this._startPos.x, this._startPos.y) } hsv2rgb(c) { var K = vec4(1., 2. / 3., 1. / 3., 3.) var p = abs(fract(c.xxx + K.xyz) * 6. - K.www) return vec4(c.z * mix(K.xxx, clamp(p - K.xxx, 0., 1.), c.y), c.w) } hsv2rgbJS(c) { // simply devectorized return [ c[2] * mix(1, clamp(abs(fract(c[0] + 1) * 6. - 3) - 1, 0., 1.), c[1]), c[2] * mix(1, clamp(abs(fract(c[0] + 2/3.) * 6. - 3) - 1, 0., 1.), c[1]), c[2] * mix(1, clamp(abs(fract(c[0] + 1/3.) * 6. - 3) - 1, 0., 1.), c[1]), c[3] ] } rgb2hsv(c) { var K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0) var p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g)) var q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r)) var d = q.x - min(q.w, q.y) var e = 1.0e-10 return vec4(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x, c.w) } rgb2hsvJS(c){ // devectorized var pc = c[1]<c[2]//step(c[2],c[1]) var p0 = pc?c[2]:c[1]//mix(c[2],c[1],pc) var p1 = pc?c[1]:c[2]//mix(c[1],c[2],pc) var p2 = pc?-1:0//mix(-1,0,pc) var p3 = pc?2/3:-1/3//mix(2/3,-1/3,pc) var qc = c[0]<p0//step(p0, c[0]) var q0 = qc?p0:c[0]//mix(p0, c[0], qc) var q1 = p1 var q2 = qc?p3:p2//mix(p3, p2, qc) var q3 = qc?c[0]:p0//mix(c[0], p0, qc) var d = q0 - min(q3, q1) var e = 1.0e-10 return [ abs(q2 + (q3 - q1) / (6.0 * d + e)), d / (q0 + e), q0, c[3] ] } // Default macros }
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>ProcessTraceEvent (Apache UIMA Java SDK 2.8.1 User-Level API Documentation)</title> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><! if (location.href.indexOf('is-external=true') == -1) { parent.document.title="ProcessTraceEvent (Apache UIMA Java SDK 2.8.1 User-Level API Documentation)"; } </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <div class="topNav"><a name="navbar_top"> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/ProcessTraceEvent.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/apache/uima/util/ProcessTrace.html" title="interface in org.apache.uima.util"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../org/apache/uima/util/Progress.html" title="interface in org.apache.uima.util"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/apache/uima/util/ProcessTraceEvent.html" target="_top">Frames</a></li> <li><a href="ProcessTraceEvent.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_top"> </a></div> <div class="header"> <div class="subTitle">org.apache.uima.util</div> <h2 title="Interface ProcessTraceEvent" class="title">Interface ProcessTraceEvent</h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Superinterfaces:</dt> <dd><a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a></dd> </dl> <hr> <br> <pre>public interface <span class="strong">ProcessTraceEvent</span> extends <a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a></pre> <div class="block">Captures information, including timing, about an event that occurred during processing. Events may have sub-events that further break down the steps involved in a complex process.</div> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="field_summary"> </a> <h3>Field Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> <caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Field and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/uima/util/ProcessTraceEvent.html#ANALYSIS">ANALYSIS</a></strong></code> <div class="block">Constant for the ANALYSIS event type.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/uima/util/ProcessTraceEvent.html#ANALYSIS_ENGINE">ANALYSIS_ENGINE</a></strong></code> <div class="block">Constant for the ANALYSIS_ENGINE event type.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/uima/util/ProcessTraceEvent.html#SERVICE">SERVICE</a></strong></code> <div class="block">Constant for the SERVICE event type.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/uima/util/ProcessTraceEvent.html#SERVICE_CALL">SERVICE_CALL</a></strong></code> <div class="block">Constant for the SERVICE_CALL event type.</div> </td> </tr> </table> </li> </ul> <ul class="blockList"> <li class="blockList"><a name="method_summary"> </a> <h3>Method Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/uima/util/ProcessTraceEvent.html#getComponentName()">getComponentName</a></strong>()</code> <div class="block">Retrieves the name of the component that is performing this event.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/uima/util/ProcessTraceEvent.html#getDescription()">getDescription</a></strong>()</code> <div class="block">Retrieves the description of this event.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/uima/util/ProcessTraceEvent.html#getDuration()">getDuration</a></strong>()</code> <div class="block">Gets the duration of this event.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/uima/util/ProcessTraceEvent.html#<API key>()"><API key></a></strong>()</code> <div class="block">Gets the duration of this event, minus the sum of the durations of its direct sub-events.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/uima/util/ProcessTraceEvent.html#getResultMessage()">getResultMessage</a></strong>()</code> <div class="block">Retrieves the result message of this event.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../../../org/apache/uima/util/ProcessTraceEvent.html" title="interface in org.apache.uima.util">ProcessTraceEvent</a>&gt;</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/uima/util/ProcessTraceEvent.html#getSubEvents()">getSubEvents</a></strong>()</code> <div class="block">Gets the sub-events of this event.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/uima/util/ProcessTraceEvent.html#getType()">getType</a></strong>()</code> <div class="block">Gets the type of event.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/uima/util/ProcessTraceEvent.html#toString()">toString</a></strong>()</code> <div class="block">Generates a user-readable representation of this event and its sub-events.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/uima/util/ProcessTraceEvent.html int&nbsp;aIndentLevel)</code> <div class="block">Generates a user-readable representation of this event and its subevents, using the given indentation level and writing to a StringBuffer.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../org/apache/uima/util/ProcessTraceEvent.html int&nbsp;aIndentLevel, int&nbsp;aTotalTime)</code> <div class="block">Generates a user-readable representation of this event and its subevents, using the given indentation level and writing to a StringBuffer.</div> </td> </tr> </table> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="field_detail"> </a> <h3>Field Detail</h3> <a name="ANALYSIS_ENGINE"> </a> <ul class="blockList"> <li class="blockList"> <h4>ANALYSIS_ENGINE</h4> <pre>static final&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> ANALYSIS_ENGINE</pre> <div class="block">Constant for the ANALYSIS_ENGINE event type. This represents the time spent in the Analysis Engine, including the annotator's analysis and framework overhead.</div> <dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#org.apache.uima.util.ProcessTraceEvent.ANALYSIS_ENGINE">Constant Field Values</a></dd></dl> </li> </ul> <a name="ANALYSIS"> </a> <ul class="blockList"> <li class="blockList"> <h4>ANALYSIS</h4> <pre>static final&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> ANALYSIS</pre> <div class="block">Constant for the ANALYSIS event type. This represents the actual analysis performed by an annotator.</div> <dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#org.apache.uima.util.ProcessTraceEvent.ANALYSIS">Constant Field Values</a></dd></dl> </li> </ul> <a name="SERVICE"> </a> <ul class="blockList"> <li class="blockList"> <h4>SERVICE</h4> <pre>static final&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> SERVICE</pre> <div class="block">Constant for the SERVICE event type. This represents the total time spent in execution of a remote service (not including communication and marshalling/unmarshalling overhead).</div> <dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#org.apache.uima.util.ProcessTraceEvent.SERVICE">Constant Field Values</a></dd></dl> </li> </ul> <a name="SERVICE_CALL"> </a> <ul class="blockListLast"> <li class="blockList"> <h4>SERVICE_CALL</h4> <pre>static final&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> SERVICE_CALL</pre> <div class="block">Constant for the SERVICE_CALL event type. This represents the total time spent making a call on a remote service, including marshalling and unmarshalling.</div> <dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#org.apache.uima.util.ProcessTraceEvent.SERVICE_CALL">Constant Field Values</a></dd></dl> </li> </ul> </li> </ul> <ul class="blockList"> <li class="blockList"><a name="method_detail"> </a> <h3>Method Detail</h3> <a name="getComponentName()"> </a> <ul class="blockList"> <li class="blockList"> <h4>getComponentName</h4> <pre><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getComponentName()</pre> <div class="block">Retrieves the name of the component that is performing this event.</div> <dl><dt><span class="strong">Returns:</span></dt><dd>the component name</dd></dl> </li> </ul> <a name="getType()"> </a> <ul class="blockList"> <li class="blockList"> <h4>getType</h4> <pre><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getType()</pre> <div class="block">Gets the type of event. Standard values for this property are defined as constants on this interface, but any String is allowed.</div> <dl><dt><span class="strong">Returns:</span></dt><dd>the event type</dd></dl> </li> </ul> <a name="getDescription()"> </a> <ul class="blockList"> <li class="blockList"> <h4>getDescription</h4> <pre><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getDescription()</pre> <div class="block">Retrieves the description of this event.</div> <dl><dt><span class="strong">Returns:</span></dt><dd>the event Description</dd></dl> </li> </ul> <a name="getDuration()"> </a> <ul class="blockList"> <li class="blockList"> <h4>getDuration</h4> <pre>int&nbsp;getDuration()</pre> <div class="block">Gets the duration of this event.</div> <dl><dt><span class="strong">Returns:</span></dt><dd>the duration of this event, in milliseconds.</dd></dl> </li> </ul> <a name="getResultMessage()"> </a> <ul class="blockList"> <li class="blockList"> <h4>getResultMessage</h4> <pre><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getResultMessage()</pre> <div class="block">Retrieves the result message of this event.</div> <dl><dt><span class="strong">Returns:</span></dt><dd>the event's result message</dd></dl> </li> </ul> <a name="getSubEvents()"> </a> <ul class="blockList"> <li class="blockList"> <h4>getSubEvents</h4> <pre><a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../../../org/apache/uima/util/ProcessTraceEvent.html" title="interface in org.apache.uima.util">ProcessTraceEvent</a>&gt;&nbsp;getSubEvents()</pre> <div class="block">Gets the sub-events of this event.</div> <dl><dt><span class="strong">Returns:</span></dt><dd>a List containing other <code>ProcessTraceEvent</code> objects</dd></dl> </li> </ul> <a name="<API key>()"> </a> <ul class="blockList"> <li class="blockList"> <h4><API key></h4> <pre>int&nbsp;<API key>()</pre> <div class="block">Gets the duration of this event, minus the sum of the durations of its direct sub-events.</div> <dl><dt><span class="strong">Returns:</span></dt><dd>the duration of this event in milliseconds, excluding the time spent in its sub-events</dd></dl> </li> </ul> <a name="toString()"> </a> <ul class="blockList"> <li class="blockList"> <h4>toString</h4> <pre><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;toString()</pre> <div class="block">Generates a user-readable representation of this event and its sub-events.</div> <dl> <dt><strong>Overrides:</strong></dt> <dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true <dt><span class="strong">Returns:</span></dt><dd>the String representation of this event and its sub-events</dd></dl> </li> </ul> <a name="toString(java.lang.StringBuffer, int)"> </a> <ul class="blockList"> <li class="blockList"> <h4>toString</h4> <pre>void&nbsp;toString(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/StringBuffer.html?is-external=true" title="class or interface in java.lang">StringBuffer</a>&nbsp;aBuf, int&nbsp;aIndentLevel)</pre> <div class="block">Generates a user-readable representation of this event and its subevents, using the given indentation level and writing to a StringBuffer. This is useful for writing nested events.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>aBuf</code> - string buffer to add to</dd><dd><code>aIndentLevel</code> - indentation level</dd></dl> </li> </ul> <a name="toString(java.lang.StringBuffer, int, int)"> </a> <ul class="blockListLast"> <li class="blockList"> <h4>toString</h4> <pre>void&nbsp;toString(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/StringBuffer.html?is-external=true" title="class or interface in java.lang">StringBuffer</a>&nbsp;aBuf, int&nbsp;aIndentLevel, int&nbsp;aTotalTime)</pre> <div class="block">Generates a user-readable representation of this event and its subevents, using the given indentation level and writing to a StringBuffer. Also, if the total time for all events is known, this method will print the percentage of time used by this event and its subevents.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>aBuf</code> - string buffer to add to</dd><dd><code>aIndentLevel</code> - indentation level</dd><dd><code>aTotalTime</code> - total time, used to calculate percentags. If not known, pass 0.</dd></dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <div class="bottomNav"><a name="navbar_bottom"> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="<API key>"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/ProcessTraceEvent.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/apache/uima/util/ProcessTrace.html" title="interface in org.apache.uima.util"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../org/apache/uima/util/Progress.html" title="interface in org.apache.uima.util"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/apache/uima/util/ProcessTraceEvent.html" target="_top">Frames</a></li> <li><a href="ProcessTraceEvent.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_bottom"> </a></div> <p class="legalCopy"><small>Copyright & </body> </html>
package com.litesuits.orm.test; import com.litesuits.orm.db.annotation.MapCollection; import com.litesuits.orm.db.utils.ClassUtil; import java.lang.reflect.*; import java.util.*; import java.util.concurrent.<API key>; import java.util.concurrent.LinkedBlockingDeque; /** * @author MaTianyu * @date 14-4-29 */ public class TestNewInstance { public static void main(String[] args) { try { Field absList = A.class.getDeclaredField("absList"); Class c1 = absList.getType(); Class c2 = (Class) ((ParameterizedType) absList.getGenericType()).<API key>()[0]; System.out.println(" " + c1); System.out.println(" " + c2); A a = new A(); absList.set(a, ClassUtil.<API key>(absList)); Collection ca = a.absList; ca.add("hello "); ca.add(" a test "); System.out.println(a); System.out.println(" Field ab = A.class.getDeclaredField("ab"); c1 = ab.getType(); c2 = (Class) ((ParameterizedType) ab.getGenericType()).<API key>()[0]; System.out.println(" " + c1); System.out.println(Collection.class.isAssignableFrom(c1)); System.out.println(c1.isAssignableFrom(Collection.class)); System.out.println(" " + c2); ab.set(a, c1.newInstance()); ca = a.ab; ca.add(c2.newInstance()); ca.add(c2.newInstance()); System.out.println(a); System.out.println(" Field ac = A.class.getDeclaredField("ac"); c1 = ac.getType(); c2 = ac.getType().getComponentType(); System.out.println(" " + c1); System.out.println(c1.isArray()); System.out.println(Collection.class.isAssignableFrom(c1)); System.out.println(" " + c2); System.out.println(ac.getType().getComponentType()); //Constructor cons = c1.getConstructor(int.class); //System.out.println("cons : " + cons); //ac.set(a, cons.newInstance(2)); C o1 = (C) c2.newInstance(); C o2 = (C) c2.newInstance(); Object array = Array.newInstance(c2, 10); Array.set(array, 0, o1); Array.set(array, 1, o2); ac.set(a, array); Object[] oa = a.ac; System.out.println("A is " + a); System.out.println(" Field cc = A.class.getDeclaredField("cc"); c1 = cc.getType(); c2 = (Class) ((ParameterizedType) cc.getGenericType()).<API key>()[0]; System.out.println(" " + c1); System.out.println(Collection.class.isAssignableFrom(c1)); System.out.println(" " + c2); cc.set(a, c1.newInstance()); ca = a.cc; ca.add(c2.newInstance()); ca.add(c2.newInstance()); System.out.println(a); System.out.println(" List<C> l = new ArrayList<C>(); l.add(new C()); Collection cl = l; Type type = l.getClass().<API key>(); System.out.println(((ParameterizedType) type).<API key>()[0]); } catch (<API key> e) { e.printStackTrace(); } catch (<API key> e) { e.printStackTrace(); } catch (<API key> e) { e.printStackTrace(); } } /** * null */ public static Class<?> getGenericType(Field f) { Type type = f.getGenericType(); if (type instanceof ParameterizedType) { type = ((ParameterizedType) type).<API key>()[0]; if (type instanceof Class<?>) return (Class<?>) type; } else if (type instanceof Class<?>) return (Class<?>) type; return null; } public static class A { @MapCollection(LinkedList.class) List<String> absList; C[] ac; ArrayList<B> ab; LinkedList<B> bl; Vector<B> vb; <API key><C> cc; LinkedBlockingDeque<C> lc; @Override public String toString() { return "A{" + "absList=" + absList + ", ac=" + Arrays.toString(ac) + ", ab=" + ab + ", bl=" + bl + ", vb=" + vb + ", cc=" + cc + ", lc=" + lc + '}'; } } public static class B { @Override public String toString() { return "b"; } } public static class C { @Override public String toString() { return "c"; } } }
.score { position: fixed; right: 2em; bottom: 2em; width: 100px; font-size: 24px; }
package org.spincast.plugins.dateformatter.tests; import static org.junit.Assert.assertEquals; import java.time.Instant; import java.time.temporal.ChronoUnit; import java.util.Locale; import org.junit.Test; import org.spincast.plugins.dateformatter.<API key>; import org.spincast.plugins.dateformatter.<API key>; public class <API key> extends <API key> { @Test public void yearsAgoDefault() throws Exception { Instant date = Instant.now(); date = date.minus(10 * 365, ChronoUnit.DAYS); <API key> formatter = <API key>().<API key>(date); String result = formatter.format(); assertEquals("10 years ago", result); } @Test public void yearsAgoDuration() throws Exception { Instant date = Instant.now(); date = date.minus(10 * 365, ChronoUnit.DAYS); <API key> formatter = <API key>().<API key>(date); formatter.formatType(<API key>.DURATION); String result = formatter.format(); assertEquals("10 years", result); } @Test public void yearsAgoUnrounded() throws Exception { Instant date = Instant.now(); date = date.minus(10 * 365, ChronoUnit.DAYS); <API key> formatter = <API key>().<API key>(date); formatter.formatType(<API key>.UNROUNDED); String result = formatter.format(); assertEquals("9 years ago", result); } @Test public void specificLocale() throws Exception { Instant date = Instant.now(); date = date.minus(10 * 365, ChronoUnit.DAYS); <API key> formatter = <API key>().<API key>(date); formatter.locale(Locale.CANADA_FRENCH); String result = formatter.format(); assertEquals("il y a 10 ans", result); } @Test public void test10HoursAgo() throws Exception { Instant date = Instant.now(); date = date.minus(10, ChronoUnit.HOURS); <API key> formatter = <API key>().<API key>(date); String result = formatter.format(); assertEquals("10 hours ago", result); } @Test public void test10HourswAgo() throws Exception { Instant date = Instant.now(); date = date.minus(10, ChronoUnit.HOURS); <API key> formatter = <API key>().<API key>(date); String result = formatter.format(); assertEquals("10 hours ago", result); } @Test public void yearsIn() throws Exception { Instant date = Instant.now(); date = date.plus(10 * 365, ChronoUnit.DAYS); <API key> formatter = <API key>().<API key>(date); String result = formatter.format(); assertEquals("10 years from now", result); } @Test public void <API key>() throws Exception { Instant date = Instant.now(); date = date.plus(10 * 365, ChronoUnit.DAYS); <API key> formatter = <API key>().<API key>(date); formatter.locale(Locale.CANADA_FRENCH); String result = formatter.format(); assertEquals("dans 10 ans", result); } }
#ifndef <API key> #define <API key> #include "ZBE/core/system/system.h" namespace zbe { /** @brief Interface of an archetype that has an area. */ class Area { public: /** \brief Virtual destructor. */ virtual ~Area() {} /** \brief Set area height * \param height */ virtual void setHeight(double height) = 0; /** \brief Set area width * \param width */ virtual void setWidth(double width) = 0; /** \brief Get area height */ virtual double getHeight() = 0; /** \brief Get area width */ virtual double getWidth() = 0; }; } // namespace zbe #endif // <API key>
package com.salesforce.androidsdk.phonegap.ui; import com.salesforce.androidsdk.app.<API key>; import com.salesforce.androidsdk.rest.ClientManager; import com.salesforce.androidsdk.rest.ClientManager.LoginOptions; /** * Sub-class of <API key> that authenticates using hard-coded credentials * */ public class <API key> extends <API key> { static String username = "ut2@cs1.mobilesdk.org"; static String accountName = username + " (<API key>)"; static String refresh<API key>.<API key>"; static String auth<API key>; static String identityUrl = "https://test.salesforce.com"; static String instanceUrl = "https://cs1.salesforce.com"; static String loginUrl = "https://test.salesforce.com"; static String orgId = "00DS0000003E98jMAC"; static String userId = "005S0000004s2iyIAA"; @Override protected ClientManager buildClientManager() { final ClientManager clientManager = super.buildClientManager(); final LoginOptions loginOptions = <API key>.getInstance().getLoginOptions(); clientManager.createNewAccount(accountName, username, refreshToken, authToken, instanceUrl, loginUrl, identityUrl, loginOptions.oauthClientId, orgId, userId, null); return clientManager; } }
<?php define ('DB_USER', "root"); define ('DB_PASS', ""); define ('DB_NAME', "STE_db"); define ('DB_HOST', "localhost"); ?>
package orm.components; import orm.connection.IConnection; import orm.entity.IEntity; import java.io.File; import java.lang.reflect.<API key>; import java.net.URL; import java.sql.ResultSet; import java.sql.SQLException; import java.util.*; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.Map.Entry; public class ORM implements IORM{ private String modelsPackage; private IConnection dbConnection; public ORM(IConnection dbConnection) { this.dbConnection = dbConnection; } public ORM(String modelsPackage, IConnection dbConnection) { this.modelsPackage = modelsPackage; this.dbConnection = dbConnection; this.dbConnection.connect(); } /** * Create the tables interpreting defined models in modelsPackage */ @Override public void sync() { String createTable = ""; for(Entry<String, ArrayList<String>> entry: <API key>().entrySet()){ createTable += "CREATE TABLE IF NOT EXISTS " + entry.getKey() + " ("; int counter = 0; for(String statement: entry.getValue()){ if(counter > 0) createTable += ","; createTable += statement; counter++; } createTable += ");"; } dbConnection.createTable(createTable); } /** * From modelsPackage, get all the classes, and for each classes get their fields. * Each field should have a sqlStatement which will indicate it's type(varchar, int etc.) * * In order to create the table, we need to get those sqlStatements. * * @return Map: field name -> sql statement */ public Map<String, ArrayList<String>> <API key>(){ Map<String, ArrayList<String>> sqlFieldsStatements = new HashMap<String, ArrayList<String>>(); // get all classes from the models package (entities) for(Class<?> clazz: getClassesInPackage(modelsPackage)){ Object instance = null; try { // create a new instance for that class instance = clazz.newInstance(); } catch (<API key> e) { e.printStackTrace(); } catch (<API key> e) { e.printStackTrace(); } ArrayList<String> sqlStatements = new ArrayList<String>(); // get all the fields of a given entity for(Field field : clazz.getDeclaredFields()) { try { Class iField = Class.forName(field.getType().getName()); // check to see if a field implements IField for(Class inter: iField.getInterfaces()){ if(inter.getName().equals("orm.fields.interfaces.IField")){ // get the method call "getSQLStatement" Method method = iField.getDeclaredMethod("getSQLStatement"); String sqlStatement = (String) method.invoke(field.get(instance)); // if the statement contains "PRIMARY KEY" we need to add also the field name if(sqlStatement.contains("PRIMARY KEY")){ // ID int not null, PRIMARY KEY (ID) sqlStatements.add(field.getName() + " " + sqlStatement + field.getName()+ ")"); }else{ sqlStatements.add(field.getName() + " " + sqlStatement); } break; } } } catch (<API key> e) { e.printStackTrace(); } catch (<API key> e) { e.printStackTrace(); } catch (<API key> e) { e.printStackTrace(); } catch (<API key> e) { e.printStackTrace(); } } sqlFieldsStatements.put(clazz.getSimpleName(), sqlStatements); } return sqlFieldsStatements; } /** * Given a certain packageName (eg: a.b.c) it get all the classes from that package * @param packageName: String representing a path to modelsPackage * @return Set: a set of classes which contains all the entities classes */ public Set<Class> getClassesInPackage(String packageName) { Set<Class> classes = new HashSet<Class>(); String packageNameSlashed = packageName.replace(".", "/"); // get a File object for the package URL directoryURL = Thread.currentThread().<API key>().getResource(packageNameSlashed); if (directoryURL == null) { return classes; } String directoryString = directoryURL.getFile(); if (directoryString == null) { return classes; } File directory = new File(directoryString); if (directory.exists()) { // Get the list of the files contained in the package String[] files = directory.list(); for (String fileName : files) { fileName = fileName.substring(0, fileName.length() - 6); try { classes.add(Class.forName(packageName + "." + fileName)); } catch (<API key> e) { e.printStackTrace(); } } } return classes; } /** * Builds a select query, retrieving an entity by an unique identifier * @param entityID: int representing the unique identifier of the entity * @param entity: the entity class * @return a new entity representing the row with the given ID */ @Override public Object retrieve(Integer entityID, Class<?> entity){ // creating and executing the query String sqlStatement = "SELECT * FROM " + entity.getSimpleName() + " WHERE ID=" + entityID.toString() + ";"; ResultSet result = dbConnection.select(sqlStatement); // create a new entity instance Object new_entity = null; try { new_entity = entity.newInstance(); } catch (<API key> e) { e.printStackTrace(); } catch (<API key> e) { e.printStackTrace(); } if(result == null){ return null; } try { if(!result.next()) { return null; } assert new_entity != null; // get all the fields from the entity for(Field field : new_entity.getClass().getDeclaredFields()) { try { Class<?> x = Class.forName(field.getType().getName()); for (Class inter : x.getInterfaces()) { // check to see if the field is an IField if (inter.getName().equals("orm.fields.interfaces.IField")) { for (Method method : x.getDeclaredMethods()) { // look for setValue method if(method.getName().contains("setValue")){ // check if is the right setValue method if(method.getParameterTypes().length != 2) continue; // set the value from query result into the field method.invoke(field.get(new_entity), result, field.getName()); } } break; } } } catch (<API key> e) { e.printStackTrace(); } catch (<API key> e) { e.printStackTrace(); } catch (<API key> e) { e.printStackTrace(); } } } catch (SQLException e) { e.printStackTrace(); } return new_entity; } /** * Helper method that given a certain entity it will return all it's fields. * It uses the Reflection API. * @param entity: an Entity object for which to get its fields * @return Map: Field -> Class */ private Map<Field, Class<?>> getEntitiesFields(IEntity entity){ Map<Field, Class<?>> fields = new HashMap<Field, Class<?>>(); // get Entity class Class<?> clazz = entity.getClass(); // retrieve all the fields from Entity class for(Field field : clazz.getDeclaredFields()) { try { Class iField = Class.forName(field.getType().getName()); // check to see if the field is implementing IField interface for (Class inter : iField.getInterfaces()) { if (inter.getName().equals("orm.fields.interfaces.IField")) { fields.put(field, iField); break; } } } catch (<API key> e) { e.printStackTrace(); } } return fields; } /** * Given a certain entity, it builds the query used to insert that entity in the correct table * @param entity: an Entity object which will be saved in db */ @Override public void create(IEntity entity) { int counter; ArrayList<String> values = new ArrayList<String>(); String statement = "INSERT INTO " + entity.getClass().getSimpleName() + " VALUES ( "; // get all the fields for(Entry<Field, Class<?>> entry: getEntitiesFields(entity).entrySet()){ try{ // retrieve the value of a certain field Method method = entry.getValue().getDeclaredMethod("getValue"); String value = method.invoke(entry.getKey().get(entity)).toString(); values.add(value); } catch (<API key> e) { e.printStackTrace(); } catch (<API key> e) { e.printStackTrace(); } catch (<API key> e) { e.printStackTrace(); } } // builds the query with the given values counter = 0; for(String value: values) { if(counter > 0) statement += ","; statement += value; counter++; } statement += ");"; // execute the query dbConnection.executeSQL(statement, "UPDATE"); } /** * Given a certain entity, it will update its content in db * @param entity: an Entity object which will be updated in db */ @Override public void update(IEntity entity) { int counter=0; Integer ID = 0; String statement = "UPDATE " + entity.getClass().getSimpleName() + " SET "; // retrieve the fields for(Entry<Field, Class<?>> entry: getEntitiesFields(entity).entrySet()){ try { // get the value of a field Method method = entry.getValue().getDeclaredMethod("getValue"); String value = method.invoke(entry.getKey().get(entity)).toString(); // we need to get the correct id in order to update a row if(entry.getKey().getName().equals("ID")){ ID = Integer.parseInt(value); }else { // build the query if (counter > 0) statement += ","; statement += entry.getKey().getName() + "=" + value; counter++; } } catch (<API key> e) { e.printStackTrace(); } catch (<API key> e) { e.printStackTrace(); } catch (<API key> e) { e.printStackTrace(); } } // finish query if(counter > 0) statement += " WHERE ID=" + ID.toString(); // do the actual update dbConnection.executeSQL(statement, "UPDATE"); } /** * Delete the content of a given entity from db * @param entity: an Entity object which will be deleted form db */ @Override public void delete(IEntity entity) { Integer ID = 0; String statement = "DELETE FROM " + entity.getClass().getSimpleName() + " WHERE "; // get the fields for(Entry<Field, Class<?>> entry: getEntitiesFields(entity).entrySet()){ try{ Method method = entry.getValue().getDeclaredMethod("getValue"); String value = method.invoke(entry.getKey().get(entity)).toString(); // search for ID if(entry.getValue().getName().equals("ID")){ ID = Integer.parseInt(value); } } catch (<API key> e) { e.printStackTrace(); } catch (<API key> e) { e.printStackTrace(); } catch (<API key> e) { e.printStackTrace(); } } // build the query statement += " ID=" + ID.toString(); // execute query dbConnection.executeSQL(statement, "UPDATE"); } @Override public void setConnection(IConnection dbConnection) { this.dbConnection = dbConnection; } }
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="de"> <head> <title>Uses of Class org.deidentifier.arx.certificate.elements.ElementNewLine (ARX API Documentation)</title> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><! if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.deidentifier.arx.certificate.elements.ElementNewLine (ARX API Documentation)"; } </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <div class="topNav"><a name="navbar_top"> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../org/deidentifier/arx/certificate/elements/ElementNewLine.html" title="class in org.deidentifier.arx.certificate.elements">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/deidentifier/arx/certificate/elements/class-use/ElementNewLine.html" target="_top">Frames</a></li> <li><a href="ElementNewLine.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip-navbar_top"> </a></div> <div class="header"> <h2 title="Uses of Class org.deidentifier.arx.certificate.elements.ElementNewLine" class="title">Uses of Class<br>org.deidentifier.arx.certificate.elements.ElementNewLine</h2> </div> <div class="classUseContainer">No usage of org.deidentifier.arx.certificate.elements.ElementNewLine</div> <div class="bottomNav"><a name="navbar_bottom"> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="<API key>"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../org/deidentifier/arx/certificate/elements/ElementNewLine.html" title="class in org.deidentifier.arx.certificate.elements">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/deidentifier/arx/certificate/elements/class-use/ElementNewLine.html" target="_top">Frames</a></li> <li><a href="ElementNewLine.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip-navbar_bottom"> </a></div> </body> </html>
package after import ( "strconv" ) type order struct { pid productId cid customerId } type productId struct { id int64 } // some methods on productId struct type customerId struct { id int64 } // some methods on customerId struct type orderId struct { id int64 } func (oid orderId) String() string { return strconv.FormatInt(oid.id, 10) } // some other methods on orderId struct func CreateOrder(pid int64, cid int64) order { return order{ pid: productId{pid}, cid: customerId{cid}, } } func (o order) Submit() (orderId, error) { // do some logic return orderId{int64(3252345234)}, nil }
package no.kantega.security.api.impl.dbuser.profile; import org.apache.commons.lang.StringUtils; public class DbNameQuerier extends <API key> { private String stdQuery = " (GivenName LIKE ? OR Surname LIKE ?)"; @Override public String <API key>() { return stdQuery; } @Override public int <API key>() { return StringUtils.countMatches(stdQuery, "?"); } }
# AUTOGENERATED FILE FROM balenalib/raspberrypi-alpine:3.10-build # remove several traces of python RUN apk del python* # > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. ENV LANG C.UTF-8 # key 63C7CC90: public key "Simon McVittie <smcv@pseudorandom.co.uk>" imported # key 3372DCFA: public key "Donald Stufft (dstufft) <donald@stufft.io>" imported RUN gpg --keyserver keyring.debian.org --recv-keys 4DE8FF2A63C7CC90 \ && gpg --keyserver keyserver.ubuntu.com --recv-key 6E3CBCE93372DCFA \ && gpg --keyserver keyserver.ubuntu.com --recv-keys 0x52a43a1e4b77b059 # point Python at a system-provided certificate database. Otherwise, we might hit <API key>. ENV SSL_CERT_FILE /etc/ssl/certs/ca-certificates.crt ENV PYTHON_VERSION 3.5.10 # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'" ENV PYTHON_PIP_VERSION 21.0.1 ENV SETUPTOOLS_VERSION 56.0.0 RUN set -x \ && curl -SLO "http://resin-packages.s3.amazonaws.com/python/v$PYTHON_VERSION/Python-$PYTHON_VERSION.<API key>.1.tar.gz" \ && echo "<SHA256-like> Python-$PYTHON_VERSION.<API key>.1.tar.gz" | sha256sum -c - \ && tar -xzf "Python-$PYTHON_VERSION.<API key>.1.tar.gz" --strip-components=1 \ && rm -rf "Python-$PYTHON_VERSION.<API key>.1.tar.gz" \ && if [ ! -e /usr/local/bin/pip3 ]; then : \ && curl -SLO "https://raw.githubusercontent.com/pypa/get-pip/<SHA1-like>/get-pip.py" \ && echo "<SHA256-like> get-pip.py" | sha256sum -c - \ && python3 get-pip.py \ && rm get-pip.py \ ; fi \ && pip3 install --no-cache-dir --upgrade --force-reinstall pip=="$PYTHON_PIP_VERSION" setuptools=="$SETUPTOOLS_VERSION" \ && find /usr/local \ \( -type d -a -name test -o -name tests \) \ -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ -exec rm -rf '{}' + \ && cd / \ && rm -rf /usr/src/python ~/.cache # install "virtualenv", since the vast majority of users of this image will want it RUN pip3 install --no-cache-dir virtualenv ENV PYTHON_DBUS_VERSION 1.2.8 # install dbus-python dependencies RUN apk add --no-cache \ dbus-dev \ dbus-glib-dev # install dbus-python RUN set -x \ && mkdir -p /usr/src/dbus-python \ && curl -SL "http://dbus.freedesktop.org/releases/dbus-python/dbus-python-$PYTHON_DBUS_VERSION.tar.gz" -o dbus-python.tar.gz \ && curl -SL "http://dbus.freedesktop.org/releases/dbus-python/dbus-python-$PYTHON_DBUS_VERSION.tar.gz.asc" -o dbus-python.tar.gz.asc \ && gpg --verify dbus-python.tar.gz.asc \ && tar -xzC /usr/src/dbus-python --strip-components=1 -f dbus-python.tar.gz \ && rm dbus-python.tar.gz* \ && cd /usr/src/dbus-python \ && PYTHON_VERSION=$(expr match "$PYTHON_VERSION" '\([0-9]*\.[0-9]*\)') ./configure \ && make -j$(nproc) \ && make install -j$(nproc) \ && cd / \ && rm -rf /usr/src/dbus-python # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ && ln -sf pip3 pip \ && { [ -e easy_install ] || ln -s easy_install-* easy_install; } \ && ln -sf idle3 idle \ && ln -sf pydoc3 pydoc \ && ln -sf python3 python \ && ln -sf python3-config python-config 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@python.sh" \ && echo "Running test-stack@python" \ && chmod +x test-stack@python.sh \ && bash test-stack@python.sh \ && rm -rf test-stack@python.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/bash\nbalena-info\nbusybox ln -sf /bin/busybox /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \ && chmod +x /bin/sh-shim \ && ln -f /bin/sh /bin/sh.real \ && ln -f /bin/sh-shim /bin/sh
package tree import ( "errors" "strings" "sync" cry "github.com/rigelrozanski/passwerk/crypto" ) type PwkTreeReader struct { mtx *sync.Mutex tree TreeReading rVar ReaderVariables } type ReaderVariables struct { usernameHashed string cIdNameUnencrypted string <API key> string <API key> string } func NewPwkTreeReader( mtx *sync.Mutex, tree TreeReading, usernameHashed string, cIdNameUnencrypted string, <API key> string, <API key> string) PwkTreeReader { rVar := ReaderVariables{ usernameHashed: usernameHashed, cIdNameUnencrypted: cIdNameUnencrypted, <API key>: <API key>, <API key>: <API key>, } return PwkTreeReader{ mtx: mtx, tree: tree, rVar: rVar, } } func (ptr *PwkTreeReader) SetVariables( usernameHashed, cIdNameUnencrypted, <API key>, <API key> string) { ptr.rVar = ReaderVariables{ usernameHashed: usernameHashed, cIdNameUnencrypted: cIdNameUnencrypted, <API key>: <API key>, <API key>: <API key>, } } // Subtree Management func (ptr *PwkTreeReader) loadSubTree() (TreeReading, error) { subTree, err := ptr.tree.LoadSubTree(ptr.rVar.usernameHashed) var outTree TreeReading = subTree return outTree, err } // Main Functions //authenticate the master password if func (ptr *PwkTreeReader) AuthMasterPassword() bool { ptr.mtx.Lock() defer ptr.mtx.Unlock() //first check if the username exists if !ptr.tree.Has(getMapKey(ptr.rVar.usernameHashed)) { return false } _, err := ptr.retrieveCIdNames() if err != nil { return false } return true } //retrieve and decrypt the list of saved passwords under and account func (ptr *PwkTreeReader) RetrieveCIdNames() (cIdNames []string, err error) { ptr.mtx.Lock() defer ptr.mtx.Unlock() return ptr.retrieveCIdNames() } func (ptr *PwkTreeReader) retrieveCIdNames() (cIdNames []string, err error) { var subTree TreeReading subTree, err = ptr.loadSubTree() if err != nil { return } cIdListKey := GetCIdListKey(ptr.rVar.usernameHashed) if subTree.Has(cIdListKey) { _, mapValues, _ := subTree.Get(cIdListKey) //get the encrypted cIdNames cIdNames = strings.Split(string(mapValues), "/") //decrypt the cIdNames for i := 0; i < len(cIdNames); i++ { if len(cIdNames[i]) < 1 { continue } cIdNames[i], err = cry.ReadDecrypted(ptr.rVar.<API key>, cIdNames[i]) } return } else { err = errors.New("badAuthentication") return } } //retrieve and decrypt a saved password given an account and id information func (ptr *PwkTreeReader) RetrieveCPassword() (cPassword string, err error) { ptr.mtx.Lock() defer ptr.mtx.Unlock() var subTree TreeReading subTree, err = ptr.loadSubTree() if err != nil { return } cPasswordKey := GetRecordKey(ptr.rVar.usernameHashed, cry.GetHashedHexString(ptr.rVar.cIdNameUnencrypted)) if subTree.Has(cPasswordKey) { _, cPasswordEncrypted, _ := subTree.Get(cPasswordKey) cPassword, err = cry.ReadDecrypted(ptr.rVar.<API key>, string(cPasswordEncrypted)) return } else { err = errors.New("invalidCIdName") return } } // retrieve the original encrypted id text, used for deleting from the stored list of ids for a user func (ptr *PwkTreeReader) <API key>() (<API key> string, err error) { ptr.mtx.Lock() defer ptr.mtx.Unlock() var subTree TreeReading subTree, err = ptr.loadSubTree() if err != nil { return } cIdListKey := GetCIdListKey(ptr.rVar.usernameHashed) _, cIdListValues, exists := subTree.Get(cIdListKey) if !exists { err = errors.New("sub tree doesn't exist") return } //get the encrypted cIdNames cIdNames := strings.Split(string(cIdListValues), "/") //determine the correct value from the cIdNames array and return for i := 0; i < len(cIdNames); i++ { if len(cIdNames[i]) < 1 { continue } var <API key> string <API key>, err = cry.ReadDecrypted(ptr.rVar.<API key>, cIdNames[i]) //remove record from master list and merkle.Tree if ptr.rVar.cIdNameUnencrypted == <API key> { <API key> = cIdNames[i] } } return }
#ifndef <API key> #define <API key> #include <cstdio> #include <cctype> #include <cstdint> #include <cstring> #include "float_common.h" namespace arrow_vendored { namespace fast_float { // Next function can be micro-optimized, but compilers are entirely // able to optimize it well. <API key> bool is_integer(char c) noexcept { return c >= '0' && c <= '9'; } <API key> uint32_t <API key>(const char *chars) noexcept { uint64_t val; ::memcpy(&val, chars, sizeof(uint64_t)); val = (val & 0x0F0F0F0F0F0F0F0F) * 2561 >> 8; val = (val & 0x00FF00FF00FF00FF) * 6553601 >> 16; return uint32_t((val & 0x0000FFFF0000FFFF) * 42949672960001 >> 32); } <API key> bool <API key>(uint64_t val) noexcept { return (((val & 0xF0F0F0F0F0F0F0F0) | (((val + 0x0606060606060606) & 0xF0F0F0F0F0F0F0F0) >> 4)) == 0x3333333333333333); } <API key> bool <API key>(const char *chars) noexcept { uint64_t val; ::memcpy(&val, chars, 8); return <API key>(val); } struct <API key> { int64_t exponent; uint64_t mantissa; const char *lastmatch; bool negative; bool valid; bool too_many_digits; }; // Assuming that you use no more than 19 digits, this will // parse an ASCII string. <API key> <API key> parse_number_string(const char *p, const char *pend, chars_format fmt) noexcept { <API key> answer; answer.valid = false; answer.negative = (*p == '-'); if ((*p == '-') || (*p == '+')) { ++p; if (p == pend) { return answer; } if (!is_integer(*p) && (*p != '.')) { // a sign must be followed by an integer or the dot return answer; } } const char *const start_digits = p; uint64_t i = 0; // an unsigned int avoids signed overflows (which are bad) while ((p != pend) && is_integer(*p)) { // a multiplication by 10 is cheaper than an arbitrary integer // multiplication i = 10 * i + uint64_t(*p - '0'); // might overflow, we will handle the overflow later ++p; } int64_t exponent = 0; if ((p != pend) && (*p == '.')) { ++p; const char *first_after_period = p; #if <API key> == 0 // Fast approach only tested under little endian systems if ((p + 8 <= pend) && <API key>(p)) { i = i * 100000000 + <API key>(p); // in rare cases, this will overflow, but that's ok p += 8; if ((p + 8 <= pend) && <API key>(p)) { i = i * 100000000 + <API key>(p); // in rare cases, this will overflow, but that's ok p += 8; } } #endif while ((p != pend) && is_integer(*p)) { uint8_t digit = uint8_t(*p - '0'); ++p; i = i * 10 + digit; // in rare cases, this will overflow, but that's ok } exponent = first_after_period - p; } // we must have encountered at least one integer! if ((start_digits == p) || ((start_digits == p - 1) && (*start_digits == '.') )) { return answer; } int32_t digit_count = int32_t(p - start_digits - 1); // used later to guard against overflows if ((fmt & chars_format::scientific) && (p != pend) && (('e' == *p) || ('E' == *p))) { const char * location_of_e = p; int64_t exp_number = 0; // exponential part ++p; bool neg_exp = false; if ((p != pend) && ('-' == *p)) { neg_exp = true; ++p; } else if ((p != pend) && ('+' == *p)) { ++p; } if ((p == pend) || !is_integer(*p)) { if(!(fmt & chars_format::fixed)) { // We are in error. return answer; } // Otherwise, we will be ignoring the 'e'. p = location_of_e; } else { while ((p != pend) && is_integer(*p)) { uint8_t digit = uint8_t(*p - '0'); if (exp_number < 0x10000) { exp_number = 10 * exp_number + digit; } ++p; } exponent += (neg_exp ? -exp_number : exp_number); } } else { // If it scientific and not fixed, we have to bail out. if((fmt & chars_format::scientific) && !(fmt & chars_format::fixed)) { return answer; } } answer.lastmatch = p; answer.valid = true; // If we frequently had to deal with long strings of digits, // we could extend our code by using a 128-bit integer instead // of a 64-bit integer. However, this is uncommon. if (((digit_count >= 19))) { // this is uncommon // It is possible that the integer had an overflow. // We have to handle the case where we have 0.0000somenumber. const char *start = start_digits; while (*start == '0' || (*start == '.')) { start++; } // we over-decrement by one when there is a decimal separator digit_count -= int(start - start_digits); if (digit_count >= 19) { answer.mantissa = 0xFFFFFFFFFFFFFFFF; // important: we don't want the mantissa to be used in a fast path uninitialized. answer.too_many_digits = true; return answer; } } answer.too_many_digits = false; answer.exponent = exponent; answer.mantissa = i; return answer; } // This should always succeed since it follows a call to parse_number_string // This function could be optimized. In particular, we could stop after 19 digits // and try to bail out. Furthermore, we should be able to recover the computed // exponent from the pass in parse_number_string. <API key> decimal parse_decimal(const char *p, const char *pend) noexcept { decimal answer; answer.num_digits = 0; answer.decimal_point = 0; answer.truncated = false; // any whitespace has been skipped. answer.negative = (*p == '-'); if ((*p == '-') || (*p == '+')) { ++p; } // skip leading zeroes while ((p != pend) && (*p == '0')) { ++p; } while ((p != pend) && is_integer(*p)) { if (answer.num_digits < max_digits) { answer.digits[answer.num_digits] = uint8_t(*p - '0'); } answer.num_digits++; ++p; } if ((p != pend) && (*p == '.')) { ++p; const char *first_after_period = p; // if we have not yet encountered a zero, we have to skip it as well if(answer.num_digits == 0) { // skip zeros while ((p != pend) && (*p == '0')) { ++p; } } #if <API key> == 0 // We expect that this loop will often take the bulk of the running time // because when a value has lots of digits, these digits often while ((p + 8 <= pend) && (answer.num_digits + 8 < max_digits)) { uint64_t val; ::memcpy(&val, p, sizeof(uint64_t)); if(! <API key>(val)) { break; } // We have eight digits, process them in one go! val -= 0x3030303030303030; ::memcpy(answer.digits + answer.num_digits, &val, sizeof(uint64_t)); answer.num_digits += 8; p += 8; } #endif while ((p != pend) && is_integer(*p)) { if (answer.num_digits < max_digits) { answer.digits[answer.num_digits] = uint8_t(*p - '0'); } answer.num_digits++; ++p; } answer.decimal_point = int32_t(first_after_period - p); } if ((p != pend) && (('e' == *p) || ('E' == *p))) { ++p; bool neg_exp = false; if ((p != pend) && ('-' == *p)) { neg_exp = true; ++p; } else if ((p != pend) && ('+' == *p)) { ++p; } int32_t exp_number = 0; // exponential part while ((p != pend) && is_integer(*p)) { uint8_t digit = uint8_t(*p - '0'); if (exp_number < 0x10000) { exp_number = 10 * exp_number + digit; } ++p; } answer.decimal_point += (neg_exp ? -exp_number : exp_number); } answer.decimal_point += int32_t(answer.num_digits); if(answer.num_digits > max_digits) { answer.truncated = true; answer.num_digits = max_digits; } // In very rare cases, we may have fewer than 19 digits, we want to be able to reliably // assume that all digits up to <API key> have been initialized. for(uint32_t i = answer.num_digits; i < <API key>; i++) { answer.digits[i] = 0; } return answer; } } // namespace fast_float } // namespace arrow_vendored #endif
var redis = require('redis'); var express = require('express'); var app = express(); app.get('/', function (req, res) { res.send('Hello World!'); }); app.get('/event/:event/:period', function (req, res) { var client = redis.createClient(6379, 'localhost'); var event = req.params.event; var period = req.params.period; client.hgetall(event + '_' + period, function (err, object) { res.writeHead(200, { 'Content-Type': 'application/json' }); res.end(JSON.stringify(object)); }); }); app.use(express.static('public')); app.listen(3000, function () { console.log('Example app listening on port 3000!'); });
package ru.job4j.threads; import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.shape.Rectangle; import javafx.stage.Stage; public class PingPong extends Application { private static final String JOB4J = "Пинг-понг www.job4j.ru"; @Override public void start(Stage stage) { int limitX = 300; int limitY = 300; Group group = new Group(); Rectangle rect = new Rectangle(0, 100, 10, 10); group.getChildren().add(rect); Thread t = new Thread(new RectangleMove(rect)); t.start(); stage.setScene(new Scene(group, limitX, limitY)); stage.setTitle(JOB4J); stage.setResizable(true); stage.show(); stage.setOnCloseRequest( event -> t.interrupt() ); } }
<!DOCTYPE html> <html xmlns="http: <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <link rel="SHORTCUT ICON" href="../../../../../img/clover.ico" /> <link rel="stylesheet" href="../../../../../aui/css/aui.min.css" media="all"/> <link rel="stylesheet" href="../../../../../aui/css/aui-experimental.min.css" media="all"/> <!--[if IE 9]><link rel="stylesheet" href="../../../../../aui/css/aui-ie9.min.css" media="all"/><![endif]--> <style type="text/css" media="all"> @import url('../../../../../style.css'); @import url('../../../../../tree.css'); </style> <script src="../../../../../jquery-1.8.3.min.js" type="text/javascript"></script> <script src="../../../../../aui/js/aui.min.js" type="text/javascript"></script> <script src="../../../../../aui/js/aui-experimental.min.js" type="text/javascript"></script> <script src="../../../../../aui/js/aui-soy.min.js" type="text/javascript"></script> <script src="../../../../../package-nodes-tree.js" type="text/javascript"></script> <script src="../../../../../clover-tree.js" type="text/javascript"></script> <script src="../../../../../clover.js" type="text/javascript"></script> <script src="../../../../../clover-descriptions.js" type="text/javascript"></script> <script src="../../../../../cloud.js" type="text/javascript"></script> <title>ABA Route Transit Number Validator 1.0.1-SNAPSHOT</title> </head> <body> <div id="page"> <header id="header" role="banner"> <nav class="aui-header <API key>" role="navigation"> <div class="aui-header-inner"> <div class="aui-header-primary"> <h1 id="logo" class="aui-header-logo <API key>"> <a href="http://openclover.org" title="Visit OpenClover home page"><span class="<API key>">OpenClover</span></a> </h1> </div> <div class="<API key>"> <ul class="aui-nav"> <li id="system-help-menu"> <a class="aui-nav-link" title="Open online documentation" target="_blank" href="http://openclover.org/documentation"> <span class="aui-icon aui-icon-small aui-iconfont-help">&#160;Help</span> </a> </li> </ul> </div> </div> </nav> </header> <div class="aui-page-panel"> <div class="<API key>"> <div class="aui-page-panel-nav <API key>"> <div class="<API key>" style="margin-bottom: 20px;"> <div class="<API key>"> <a href="http://cardatechnologies.com" target="_top"> <div class="aui-avatar aui-avatar-large aui-avatar-project"> <div class="aui-avatar-inner"> <img src="../../../../../img/clover_logo_large.png" alt="Clover icon"/> </div> </div> </a> </div> <div class="<API key>" > <h1> <a href="http://cardatechnologies.com" target="_top"> ABA Route Transit Number Validator 1.0.1-SNAPSHOT </a> </h1> </div> </div> <nav class="aui-navgroup <API key>"> <div class="aui-navgroup-inner"> <ul class="aui-nav"> <li class=""> <a href="../../../../../dashboard.html">Project overview</a> </li> </ul> <div class="aui-nav-heading <API key>"> <strong>Packages</strong> </div> <div class="aui-nav project-packages"> <form method="get" action="#" class="aui <API key>"> <input type="text" autocomplete="off" class="package-filter text" placeholder="Type to filter packages..." name="package-filter" id="package-filter" title="Start typing package name (or part of the name) to search through the tree. Use arrow keys and the Enter key to navigate."/> </form> <p class="<API key> hidden"> <small>No results found.</small> </p> <div class="<API key>" data-root-relative="../../../../../" data-package-name="com.cardatechnologies.utils.validators.abaroutevalidator"> <div class="<API key>"></div> <div class="<API key>"></div> </div> </div> </div> </nav> </div> <section class="<API key>"> <div class="<API key>"> <div class="<API key>"><ol class="aui-nav aui-nav-breadcrumbs"> <li><a href="../../../../../dashboard.html"> Project Clover database Sat Aug 7 2021 12:29:33 MDT</a></li> <li><a href="test-pkg-summary.html">Package com.cardatechnologies.utils.validators.abaroutevalidator</a></li> <li><a href="<API key>.html">Class <API key></a></li> </ol></div> <h1 class="aui-h2-clover"> Test <API key> </h1> <table class="aui"> <thead> <tr> <th>Test</th> <th><label title="The test result. Either a Pass, Fail or Error.">Status</label></th> <th><label title="When the test execution was started">Start time</label></th> <th><label title="The total time in seconds taken to run this test.">Time (seconds)</label></th> <th><label title="A failure or error message if the test is not successful.">Message</label></th> </tr> </thead> <tbody> <tr> <td> <a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/<API key>.html?line=20560#src-20560" ><API key></a> </td> <td> <span class="sortValue">1</span><span class="aui-lozenge aui-lozenge-success">PASS</span> </td> <td> 7 Aug 12:36:48 </td> <td> 0.0 </td> <td> <div></div> <div class="errorMessage"></div> </td> </tr> </tbody> </table> <div>&#160;</div> <table class="aui aui-table-sortable"> <thead> <tr> <th style="white-space:nowrap;"><label title="A class that was directly hit by this test.">Target Class</label></th> <th colspan="4"><label title="The percentage of coverage contributed by each single test.">Coverage contributed by</label> <API key></th> </tr> </thead> <tbody> <tr> <td> <span class="sortValue">com.cardatechnologies.utils.validators.abaroutevalidator.exceptions.<API key></span> &#160;&#160;<a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/exceptions/<API key>.html?id=8462#<API key>" title="<API key>" name="sl-43">com.cardatechnologies.utils.validators.abaroutevalidator.exceptions.<API key></a> </td> <td> <span class="sortValue">0.5714286</span>57.1% </td> <td class="align-middle" style="width: 100%" colspan="3"> <div> <div title="57.1% Covered" style="min-width:40px;" class="barNegative contribBarNegative contribBarNegative"><div class="barPositive contribBarPositive contribBarPositive" style="width:57.1%"></div></div></div> </td> </tr> <tr> <td> <span class="sortValue">com.cardatechnologies.utils.validators.abaroutevalidator.ErrorCodes</span> &#160;&#160;<a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/ErrorCodes.html?id=8462#ErrorCodes" title="ErrorCodes" name="sl-42">com.cardatechnologies.utils.validators.abaroutevalidator.ErrorCodes</a> </td> <td> <span class="sortValue">0.5714286</span>57.1% </td> <td class="align-middle" style="width: 100%" colspan="3"> <div> <div title="57.1% Covered" style="min-width:40px;" class="barNegative contribBarNegative contribBarNegative"><div class="barPositive contribBarPositive contribBarPositive" style="width:57.1%"></div></div></div> </td> </tr> <tr> <td> <span class="sortValue">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</span> &#160;&#160;<a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/AbaRouteValidator.html?id=8462#AbaRouteValidator" title="AbaRouteValidator" name="sl-47">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</a> </td> <td> <span class="sortValue">0.29411766</span>29.4% </td> <td class="align-middle" style="width: 100%" colspan="3"> <div> <div title="29.4% Covered" style="min-width:40px;" class="barNegative contribBarNegative contribBarNegative"><div class="barPositive contribBarPositive contribBarPositive" style="width:29.4%"></div></div></div> </td> </tr> </tbody> </table> </div> <!-- class="<API key>" --> <footer id="footer" role="contentinfo"> <section class="footer-body"> <ul> <li> Report generated by <a target="_new" href="http://openclover.org">OpenClover</a> v 4.4.1 on Sat Aug 7 2021 12:49:26 MDT using coverage data from Sat Aug 7 2021 12:47:23 MDT. </li> </ul> <ul> <li>OpenClover is free and open-source software. </li> </ul> </section> </footer> </section> <!-- class="<API key>" --> </div> <!-- class="<API key>" --> </div> <!-- class="aui-page-panel" --> </div> <!-- id="page" --> </body> </html>
#!/bin/bash # sets property sonar.web.javaAdditionalOpts in sonar.properties to activate debug set -euo pipefail source scripts/property_utils.sh SQ_HOME=$1 echo "enabling SQL TRACE Logs in CE" set_property sonar.log.level.ce.sql TRACE $SQ_HOME/conf/sonar.properties
/* Global Styles */ html, body { height: 100%; } body { padding-top: 50px; /* Required padding for .navbar-fixed-top. Remove if using .navbar-static-top. Change if height of navigation changes. */ } .img-portfolio { margin-bottom: 30px; } .img-hover:hover { opacity: 0.8; } /* Home Page Carousel */ header.carousel { height: 50%; } header.carousel .item, header.carousel .item.active, header.carousel .carousel-inner { height: 100%; } header.carousel .fill { width: 100%; height: 100%; background-position: center; background-size: cover; } /* 404 Page Styles */ .error-404 { font-size: 100px; } /* Pricing Page Styles */ .price { display: block; font-size: 50px; line-height: 50px; } .price sup { top: -20px; left: 2px; font-size: 20px; } .period { display: block; font-style: italic; } /* Footer Styles */ footer { margin: 50px 0; } /* Responsive Styles */ @media(max-width:991px) { .customer-img, .img-related { margin-bottom: 30px; } } @media(max-width:767px) { .img-portfolio { margin-bottom: 15px; } header.carousel .carousel { height: 70%; } }
namespace android { /* JNI Helpers for wifi_hal to WifiNative bridge implementation */ void throwException( JNIEnv *env, const char *message, int line ); jboolean getBoolField(JNIEnv *env, jobject obj, const char *name); jint getIntField(JNIEnv *env, jobject obj, const char *name); jlong getLongField(JNIEnv *env, jobject obj, const char *name); jobject getObjectField(JNIEnv *env, jobject obj, const char *name, const char *type); jlong getLongArrayField(JNIEnv *env, jobject obj, const char *name, int index); jobject getObjectArrayField(JNIEnv *env, jobject obj, const char *name, const char *type, int index); void setIntField(JNIEnv *env, jobject obj, const char *name, jint value); void setLongField(JNIEnv *env, jobject obj, const char *name, jlong value); void setLongArrayField(JNIEnv *env, jobject obj, const char *name, jlongArray value); void setLongArrayElement(JNIEnv *env, jobject obj, const char *name, int index, jlong value); void setStringField(JNIEnv *env, jobject obj, const char *name, const char *value); void reportEvent(JNIEnv *env, jclass cls, const char *method, const char *signature, ...); jobject createObject(JNIEnv *env, const char *className); void setObjectField(JNIEnv *env, jobject obj, const char *name, const char *type, jobject value); jlong getStaticLongField(JNIEnv *env, jobject obj, const char *name); jlong getStaticLongField(JNIEnv *env, jclass cls, const char *name); void setStaticLongField(JNIEnv *env, jobject obj, const char *name, jlong value); void setStaticLongField(JNIEnv *env, jclass cls, const char *name, jlong value); jlong <API key>(JNIEnv *env, jobject obj, const char *name, int index); jlong <API key>(JNIEnv *env, jclass cls, const char *name, int index); void <API key>(JNIEnv *env, jobject obj, const char *name, jlongArray value); void <API key>(JNIEnv *env, jclass obj, const char *name, jlongArray value); } #define THROW(env, message) throwException(env, message, __LINE__)
#pragma once #include <aws/kendra/Kendra_EXPORTS.h> #include <aws/kendra/model/SharePointVersion.h> #include <aws/core/utils/memory/stl/AWSVector.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <aws/kendra/model/<API key>.h> #include <aws/kendra/model/S3Path.h> #include <aws/kendra/model/<API key>.h> #include <utility> namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace kendra { namespace Model { class AWS_KENDRA_API <API key> { public: <API key>(); <API key>(Aws::Utils::Json::JsonView jsonValue); <API key>& operator=(Aws::Utils::Json::JsonView jsonValue); Aws::Utils::Json::JsonValue Jsonize() const; /** * <p>The version of Microsoft SharePoint that you are using as a data source.</p> */ inline const SharePointVersion& <API key>() const{ return m_sharePointVersion; } /** * <p>The version of Microsoft SharePoint that you are using as a data source.</p> */ inline bool <API key>() const { return <API key>; } /** * <p>The version of Microsoft SharePoint that you are using as a data source.</p> */ inline void <API key>(const SharePointVersion& value) { <API key> = true; m_sharePointVersion = value; } /** * <p>The version of Microsoft SharePoint that you are using as a data source.</p> */ inline void <API key>(SharePointVersion&& value) { <API key> = true; m_sharePointVersion = std::move(value); } /** * <p>The version of Microsoft SharePoint that you are using as a data source.</p> */ inline <API key>& <API key>(const SharePointVersion& value) { <API key>(value); return *this;} /** * <p>The version of Microsoft SharePoint that you are using as a data source.</p> */ inline <API key>& <API key>(SharePointVersion&& value) { <API key>(std::move(value)); return *this;} /** * <p>The URLs of the Microsoft SharePoint site that contains the documents that * should be indexed.</p> */ inline const Aws::Vector<Aws::String>& GetUrls() const{ return m_urls; } /** * <p>The URLs of the Microsoft SharePoint site that contains the documents that * should be indexed.</p> */ inline bool UrlsHasBeenSet() const { return m_urlsHasBeenSet; } /** * <p>The URLs of the Microsoft SharePoint site that contains the documents that * should be indexed.</p> */ inline void SetUrls(const Aws::Vector<Aws::String>& value) { m_urlsHasBeenSet = true; m_urls = value; } /** * <p>The URLs of the Microsoft SharePoint site that contains the documents that * should be indexed.</p> */ inline void SetUrls(Aws::Vector<Aws::String>&& value) { m_urlsHasBeenSet = true; m_urls = std::move(value); } /** * <p>The URLs of the Microsoft SharePoint site that contains the documents that * should be indexed.</p> */ inline <API key>& WithUrls(const Aws::Vector<Aws::String>& value) { SetUrls(value); return *this;} /** * <p>The URLs of the Microsoft SharePoint site that contains the documents that * should be indexed.</p> */ inline <API key>& WithUrls(Aws::Vector<Aws::String>&& value) { SetUrls(std::move(value)); return *this;} /** * <p>The URLs of the Microsoft SharePoint site that contains the documents that * should be indexed.</p> */ inline <API key>& AddUrls(const Aws::String& value) { m_urlsHasBeenSet = true; m_urls.push_back(value); return *this; } /** * <p>The URLs of the Microsoft SharePoint site that contains the documents that * should be indexed.</p> */ inline <API key>& AddUrls(Aws::String&& value) { m_urlsHasBeenSet = true; m_urls.push_back(std::move(value)); return *this; } /** * <p>The URLs of the Microsoft SharePoint site that contains the documents that * should be indexed.</p> */ inline <API key>& AddUrls(const char* value) { m_urlsHasBeenSet = true; m_urls.push_back(value); return *this; } inline const Aws::String& GetSecretArn() const{ return m_secretArn; } inline bool SecretArnHasBeenSet() const { return <API key>; } inline void SetSecretArn(const Aws::String& value) { <API key> = true; m_secretArn = value; } inline void SetSecretArn(Aws::String&& value) { <API key> = true; m_secretArn = std::move(value); } inline void SetSecretArn(const char* value) { <API key> = true; m_secretArn.assign(value); } inline <API key>& WithSecretArn(const Aws::String& value) { SetSecretArn(value); return *this;} inline <API key>& WithSecretArn(Aws::String&& value) { SetSecretArn(std::move(value)); return *this;} inline <API key>& WithSecretArn(const char* value) { SetSecretArn(value); return *this;} /** * <p> <code>TRUE</code> to include attachments to documents stored in your * Microsoft SharePoint site in the index; otherwise, <code>FALSE</code>.</p> */ inline bool GetCrawlAttachments() const{ return m_crawlAttachments; } /** * <p> <code>TRUE</code> to include attachments to documents stored in your * Microsoft SharePoint site in the index; otherwise, <code>FALSE</code>.</p> */ inline bool <API key>() const { return <API key>; } /** * <p> <code>TRUE</code> to include attachments to documents stored in your * Microsoft SharePoint site in the index; otherwise, <code>FALSE</code>.</p> */ inline void SetCrawlAttachments(bool value) { <API key> = true; m_crawlAttachments = value; } /** * <p> <code>TRUE</code> to include attachments to documents stored in your * Microsoft SharePoint site in the index; otherwise, <code>FALSE</code>.</p> */ inline <API key>& <API key>(bool value) { SetCrawlAttachments(value); return *this;} /** * <p>Set to <code>TRUE</code> to use the Microsoft SharePoint change log to * determine the documents that need to be updated in the index. Depending on the * size of the SharePoint change log, it may take longer for Amazon Kendra to use * the change log than it takes it to determine the changed documents using the * Amazon Kendra document crawler.</p> */ inline bool GetUseChangeLog() const{ return m_useChangeLog; } /** * <p>Set to <code>TRUE</code> to use the Microsoft SharePoint change log to * determine the documents that need to be updated in the index. Depending on the * size of the SharePoint change log, it may take longer for Amazon Kendra to use * the change log than it takes it to determine the changed documents using the * Amazon Kendra document crawler.</p> */ inline bool <API key>() const { return <API key>; } /** * <p>Set to <code>TRUE</code> to use the Microsoft SharePoint change log to * determine the documents that need to be updated in the index. Depending on the * size of the SharePoint change log, it may take longer for Amazon Kendra to use * the change log than it takes it to determine the changed documents using the * Amazon Kendra document crawler.</p> */ inline void SetUseChangeLog(bool value) { <API key> = true; m_useChangeLog = value; } /** * <p>Set to <code>TRUE</code> to use the Microsoft SharePoint change log to * determine the documents that need to be updated in the index. Depending on the * size of the SharePoint change log, it may take longer for Amazon Kendra to use * the change log than it takes it to determine the changed documents using the * Amazon Kendra document crawler.</p> */ inline <API key>& WithUseChangeLog(bool value) { SetUseChangeLog(value); return *this;} /** * <p>A list of regular expression patterns. Documents that match the patterns are * included in the index. Documents that don't match the patterns are excluded from * the index. If a document matches both an inclusion pattern and an exclusion * pattern, the document is not included in the index.</p> <p>The regex is applied * to the display URL of the SharePoint document.</p> */ inline const Aws::Vector<Aws::String>& <API key>() const{ return m_inclusionPatterns; } /** * <p>A list of regular expression patterns. Documents that match the patterns are * included in the index. Documents that don't match the patterns are excluded from * the index. If a document matches both an inclusion pattern and an exclusion * pattern, the document is not included in the index.</p> <p>The regex is applied * to the display URL of the SharePoint document.</p> */ inline bool <API key>() const { return <API key>; } /** * <p>A list of regular expression patterns. Documents that match the patterns are * included in the index. Documents that don't match the patterns are excluded from * the index. If a document matches both an inclusion pattern and an exclusion * pattern, the document is not included in the index.</p> <p>The regex is applied * to the display URL of the SharePoint document.</p> */ inline void <API key>(const Aws::Vector<Aws::String>& value) { <API key> = true; m_inclusionPatterns = value; } /** * <p>A list of regular expression patterns. Documents that match the patterns are * included in the index. Documents that don't match the patterns are excluded from * the index. If a document matches both an inclusion pattern and an exclusion * pattern, the document is not included in the index.</p> <p>The regex is applied * to the display URL of the SharePoint document.</p> */ inline void <API key>(Aws::Vector<Aws::String>&& value) { <API key> = true; m_inclusionPatterns = std::move(value); } /** * <p>A list of regular expression patterns. Documents that match the patterns are * included in the index. Documents that don't match the patterns are excluded from * the index. If a document matches both an inclusion pattern and an exclusion * pattern, the document is not included in the index.</p> <p>The regex is applied * to the display URL of the SharePoint document.</p> */ inline <API key>& <API key>(const Aws::Vector<Aws::String>& value) { <API key>(value); return *this;} /** * <p>A list of regular expression patterns. Documents that match the patterns are * included in the index. Documents that don't match the patterns are excluded from * the index. If a document matches both an inclusion pattern and an exclusion * pattern, the document is not included in the index.</p> <p>The regex is applied * to the display URL of the SharePoint document.</p> */ inline <API key>& <API key>(Aws::Vector<Aws::String>&& value) { <API key>(std::move(value)); return *this;} /** * <p>A list of regular expression patterns. Documents that match the patterns are * included in the index. Documents that don't match the patterns are excluded from * the index. If a document matches both an inclusion pattern and an exclusion * pattern, the document is not included in the index.</p> <p>The regex is applied * to the display URL of the SharePoint document.</p> */ inline <API key>& <API key>(const Aws::String& value) { <API key> = true; m_inclusionPatterns.push_back(value); return *this; } /** * <p>A list of regular expression patterns. Documents that match the patterns are * included in the index. Documents that don't match the patterns are excluded from * the index. If a document matches both an inclusion pattern and an exclusion * pattern, the document is not included in the index.</p> <p>The regex is applied * to the display URL of the SharePoint document.</p> */ inline <API key>& <API key>(Aws::String&& value) { <API key> = true; m_inclusionPatterns.push_back(std::move(value)); return *this; } /** * <p>A list of regular expression patterns. Documents that match the patterns are * included in the index. Documents that don't match the patterns are excluded from * the index. If a document matches both an inclusion pattern and an exclusion * pattern, the document is not included in the index.</p> <p>The regex is applied * to the display URL of the SharePoint document.</p> */ inline <API key>& <API key>(const char* value) { <API key> = true; m_inclusionPatterns.push_back(value); return *this; } /** * <p>A list of regular expression patterns. Documents that match the patterns are * excluded from the index. Documents that don't match the patterns are included in * the index. If a document matches both an exclusion pattern and an inclusion * pattern, the document is not included in the index.</p> <p>The regex is applied * to the display URL of the SharePoint document.</p> */ inline const Aws::Vector<Aws::String>& <API key>() const{ return m_exclusionPatterns; } /** * <p>A list of regular expression patterns. Documents that match the patterns are * excluded from the index. Documents that don't match the patterns are included in * the index. If a document matches both an exclusion pattern and an inclusion * pattern, the document is not included in the index.</p> <p>The regex is applied * to the display URL of the SharePoint document.</p> */ inline bool <API key>() const { return <API key>; } /** * <p>A list of regular expression patterns. Documents that match the patterns are * excluded from the index. Documents that don't match the patterns are included in * the index. If a document matches both an exclusion pattern and an inclusion * pattern, the document is not included in the index.</p> <p>The regex is applied * to the display URL of the SharePoint document.</p> */ inline void <API key>(const Aws::Vector<Aws::String>& value) { <API key> = true; m_exclusionPatterns = value; } /** * <p>A list of regular expression patterns. Documents that match the patterns are * excluded from the index. Documents that don't match the patterns are included in * the index. If a document matches both an exclusion pattern and an inclusion * pattern, the document is not included in the index.</p> <p>The regex is applied * to the display URL of the SharePoint document.</p> */ inline void <API key>(Aws::Vector<Aws::String>&& value) { <API key> = true; m_exclusionPatterns = std::move(value); } /** * <p>A list of regular expression patterns. Documents that match the patterns are * excluded from the index. Documents that don't match the patterns are included in * the index. If a document matches both an exclusion pattern and an inclusion * pattern, the document is not included in the index.</p> <p>The regex is applied * to the display URL of the SharePoint document.</p> */ inline <API key>& <API key>(const Aws::Vector<Aws::String>& value) { <API key>(value); return *this;} /** * <p>A list of regular expression patterns. Documents that match the patterns are * excluded from the index. Documents that don't match the patterns are included in * the index. If a document matches both an exclusion pattern and an inclusion * pattern, the document is not included in the index.</p> <p>The regex is applied * to the display URL of the SharePoint document.</p> */ inline <API key>& <API key>(Aws::Vector<Aws::String>&& value) { <API key>(std::move(value)); return *this;} /** * <p>A list of regular expression patterns. Documents that match the patterns are * excluded from the index. Documents that don't match the patterns are included in * the index. If a document matches both an exclusion pattern and an inclusion * pattern, the document is not included in the index.</p> <p>The regex is applied * to the display URL of the SharePoint document.</p> */ inline <API key>& <API key>(const Aws::String& value) { <API key> = true; m_exclusionPatterns.push_back(value); return *this; } /** * <p>A list of regular expression patterns. Documents that match the patterns are * excluded from the index. Documents that don't match the patterns are included in * the index. If a document matches both an exclusion pattern and an inclusion * pattern, the document is not included in the index.</p> <p>The regex is applied * to the display URL of the SharePoint document.</p> */ inline <API key>& <API key>(Aws::String&& value) { <API key> = true; m_exclusionPatterns.push_back(std::move(value)); return *this; } /** * <p>A list of regular expression patterns. Documents that match the patterns are * excluded from the index. Documents that don't match the patterns are included in * the index. If a document matches both an exclusion pattern and an inclusion * pattern, the document is not included in the index.</p> <p>The regex is applied * to the display URL of the SharePoint document.</p> */ inline <API key>& <API key>(const char* value) { <API key> = true; m_exclusionPatterns.push_back(value); return *this; } inline const <API key>& GetVpcConfiguration() const{ return m_vpcConfiguration; } inline bool <API key>() const { return <API key>; } inline void SetVpcConfiguration(const <API key>& value) { <API key> = true; m_vpcConfiguration = value; } inline void SetVpcConfiguration(<API key>&& value) { <API key> = true; m_vpcConfiguration = std::move(value); } inline <API key>& <API key>(const <API key>& value) { SetVpcConfiguration(value); return *this;} inline <API key>& <API key>(<API key>&& value) { SetVpcConfiguration(std::move(value)); return *this;} inline const Aws::Vector<<API key>>& GetFieldMappings() const{ return m_fieldMappings; } inline bool <API key>() const { return <API key>; } inline void SetFieldMappings(const Aws::Vector<<API key>>& value) { <API key> = true; m_fieldMappings = value; } inline void SetFieldMappings(Aws::Vector<<API key>>&& value) { <API key> = true; m_fieldMappings = std::move(value); } inline <API key>& WithFieldMappings(const Aws::Vector<<API key>>& value) { SetFieldMappings(value); return *this;} inline <API key>& WithFieldMappings(Aws::Vector<<API key>>&& value) { SetFieldMappings(std::move(value)); return *this;} inline <API key>& AddFieldMappings(const <API key>& value) { <API key> = true; m_fieldMappings.push_back(value); return *this; } inline <API key>& AddFieldMappings(<API key>&& value) { <API key> = true; m_fieldMappings.push_back(std::move(value)); return *this; } /** * <p>The Microsoft SharePoint attribute field that contains the title of the * document.</p> */ inline const Aws::String& <API key>() const{ return <API key>; } /** * <p>The Microsoft SharePoint attribute field that contains the title of the * document.</p> */ inline bool <API key>() const { return <API key>; } /** * <p>The Microsoft SharePoint attribute field that contains the title of the * document.</p> */ inline void <API key>(const Aws::String& value) { <API key> = true; <API key> = value; } /** * <p>The Microsoft SharePoint attribute field that contains the title of the * document.</p> */ inline void <API key>(Aws::String&& value) { <API key> = true; <API key> = std::move(value); } /** * <p>The Microsoft SharePoint attribute field that contains the title of the * document.</p> */ inline void <API key>(const char* value) { <API key> = true; <API key>.assign(value); } /** * <p>The Microsoft SharePoint attribute field that contains the title of the * document.</p> */ inline <API key>& <API key>(const Aws::String& value) { <API key>(value); return *this;} /** * <p>The Microsoft SharePoint attribute field that contains the title of the * document.</p> */ inline <API key>& <API key>(Aws::String&& value) { <API key>(std::move(value)); return *this;} /** * <p>The Microsoft SharePoint attribute field that contains the title of the * document.</p> */ inline <API key>& <API key>(const char* value) { <API key>(value); return *this;} /** * <p>A Boolean value that specifies whether local groups are disabled * (<code>True</code>) or enabled (<code>False</code>). </p> */ inline bool <API key>() const{ return <API key>; } /** * <p>A Boolean value that specifies whether local groups are disabled * (<code>True</code>) or enabled (<code>False</code>). </p> */ inline bool <API key>() const { return <API key>; } /** * <p>A Boolean value that specifies whether local groups are disabled * (<code>True</code>) or enabled (<code>False</code>). </p> */ inline void <API key>(bool value) { <API key> = true; <API key> = value; } /** * <p>A Boolean value that specifies whether local groups are disabled * (<code>True</code>) or enabled (<code>False</code>). </p> */ inline <API key>& <API key>(bool value) { <API key>(value); return *this;} inline const S3Path& <API key>() const{ return <API key>; } inline bool <API key>() const { return <API key>; } inline void <API key>(const S3Path& value) { <API key> = true; <API key> = value; } inline void <API key>(S3Path&& value) { <API key> = true; <API key> = std::move(value); } inline <API key>& <API key>(const S3Path& value) { <API key>(value); return *this;} inline <API key>& <API key>(S3Path&& value) { <API key>(std::move(value)); return *this;} private: SharePointVersion m_sharePointVersion; bool <API key>; Aws::Vector<Aws::String> m_urls; bool m_urlsHasBeenSet; Aws::String m_secretArn; bool <API key>; bool m_crawlAttachments; bool <API key>; bool m_useChangeLog; bool <API key>; Aws::Vector<Aws::String> m_inclusionPatterns; bool <API key>; Aws::Vector<Aws::String> m_exclusionPatterns; bool <API key>; <API key> m_vpcConfiguration; bool <API key>; Aws::Vector<<API key>> m_fieldMappings; bool <API key>; Aws::String <API key>; bool <API key>; bool <API key>; bool <API key>; S3Path <API key>; bool <API key>; }; } // namespace Model } // namespace kendra } // namespace Aws
// $(".mainContainer").css("height",$(window).height()); Jquery method of getting container to fill entire screen, also solved this via CSS $("#findMyWeather").click(function(event) { event.preventDefault(); $(".alert").hide(); if ($("#city").val()!="") { // if users input a city, then we run the get function $.get("scraper.php?city="+$("#city").val(), function( data ) { if (data=="") { $("#fail").fadeIn(); } else { $("#success").html(data).fadeIn(); // Sets html to the data from the scraper website and then fades in the alert } }); } else { $("#noCity").fadeIn(); } });
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Tree Lines - jQuery EasyUI Demo</title> <link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css"> <link rel="stylesheet" type="text/css" href="../../themes/icon.css"> <link rel="stylesheet" type="text/css" href="../demo.css"> <script type="text/javascript" src="../../jquery.min.js"></script> <script type="text/javascript" src="../../jquery.easyui.min.js"></script> </head> <body> <h2>Tree Lines</h2> <div class="demo-info"> <div class="demo-tip icon-tip"></div> <div>This sample shows how to show tree lines.</div> </div> <div style="margin:10px 0;"> </div> <ul class="easyui-tree" data-options="url:'../tree/tree_data1.json',animate:true,lines:true"></ul> </body> </html>
<!DOCTYPE html> <html lang="en"> <head th:substituteby="fragments/headTag :: headTag"> <!-- This <head> is only used for static prototyping purposes (natural templates) --> <!-- and is therefore entirely optionl, as this markup fragment will be included --> <!-- from "fragments.html" at runtime. --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title>PetClinic :: a Spring Framework demonstration</title> <link href="http://netdna.bootstrapcdn.com/<TwitterConsumerkey>/2.3.0/css/bootstrap.min.css" th:href="@{/webjars/bootstrap/2.3.0/css/bootstrap.min.css}" rel="stylesheet"/> <link href="../../../resources/css/petclinic.css" th:href="@{/resources/css/petclinic.css}" rel="stylesheet"/> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js" th:src="@{/webjars/jquery/1.9.0/jquery.js}"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js" th:src="@{/webjars/jquery-ui/1.9.2/js/jquery-ui-1.9.2.custom.js}"></script> <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/themes/smoothness/jquery-ui.css" th:href="@{/webjars/jquery-ui/1.9.2/css/smoothness/jquery-ui-1.9.2.custom.css}" rel="stylesheet"></link> </head> <body> <div class="container"> <div th:include="fragments/bodyHeader" th:remove="tag"> <!-- This div is only used for static prototyping purposes (natural templates) --> <!-- and is therefore entirely optionl, as this markup fragment will be included --> <!-- from "fragments.html" at runtime. --> <img th:src="@{/resources/images/banner-graphic.png}" src="../../../resources/images/banner-graphic.png"/> <div class="navbar" style="width: 601px;"> <div class="navbar-inner"> <ul class="nav"> <li style="width: 100px;"><a href="../welcome.html" th:href="@{/}"><i class="icon-home"></i>Home</a></li> <li style="width: 130px;"><a href="../owners/findOwners.html" th:href="@{/owners/find.html}"><i class="icon-search"></i>Find owners</a></li> <li style="width: 140px;"><a href="../vets/vetList.html" th:href="@{/vets.html}"><i class="icon-th-list"></i>Veterinarians</a></li> <li style="width: 90px;"><a href="../exception.html" th:href="@{/oups.html}" title="trigger a RuntimeException to see how it is handled"><i class="icon-warning-sign"></i>Error</a></li> <li style="width: 80px;"><a href="#" title="not available yet. Work in progress!!"><i class=" icon-question-sign"></i>Help</a></li> </ul> </div> </div> </div> <h2>Owners</h2> <table class="table table-striped"> <thead> <tr> <th style="width: 150px;">Name</th> <th style="width: 200px;">Address</th> <th>City</th> <th>Telephone</th> <th style="width: 100px;">Pets</th> </tr> </thead> <tbody> <tr th:each="owner : ${selections}"> <td> <a href="ownerDetails.html" th:href="@{'/owners/' + ${owner.id}}" th:text="${owner.firstName + ' ' + owner.lastName}">Mary Smith</a> </td> <td th:text="${owner.address}">45, Oxford Street</td> <td th:text="${owner.city}">Cambridge</td> <td th:text="${owner.telephone}">555-555-555</td> <td> <span th:each="pet : ${owner.pets}" th:text="${pet.name}" th:remove="tag"> Rob&nbsp; </span> </td> </tr> </tbody> </table> <table th:substituteby="fragments/footer :: footer" class="footer"> <!-- This table section is only used for static prototyping purposes (natural --> <!-- templates) and is therefore entirely optionl, as this markup fragment will --> <!-- be included from "fragments.html" at runtime. --> <tr> <td></td> <td align="right"> <img src="../../../resources/images/springsource-logo.png" th:src="@{/resources/images/springsource-logo.png}" alt="Sponsored by SpringSource" /> </td> </tr> </table> </div> </body> </html>
import sys from functions import * word_counts = count_words(sys.stdin) for word, count in word_counts.iteritems(): print '%s,%i' % (word, count)
.<API key> .actions-top { height: 70px; } .<API key> .actions-top .el-button { float: right; background-color: #0287fe; font-size: 14px; margin: 15px 0; } .<API key> .type_formore { color: #3a8dff; text-decoration: underline; } .<API key> .type_label { display: block; text-align: left; font-size: 12px; line-height: 16px; } .<API key> .add_dialog .el-dialog { width: 1300px; }
package com.graduation.yinhua.maleambry.view.activity; import android.annotation.SuppressLint; import android.content.Intent; import android.net.http.SslError; import android.os.Build; import android.text.TextUtils; import android.view.KeyEvent; import android.view.View; import android.view.ViewGroup; import android.webkit.SslErrorHandler; import android.webkit.WebChromeClient; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; import com.graduation.yinhua.maleambry.MaleAmbryApp; import com.graduation.yinhua.maleambry.R; import com.graduation.yinhua.maleambry.model.FavoDiscovery; import com.graduation.yinhua.maleambry.model.User; import com.graduation.yinhua.maleambry.view.base.BaseActivity; import butterknife.BindView; public class DetailActivity extends BaseActivity { private static final String TAG = DetailActivity.class.getSimpleName(); @BindView(R.id.toolbar_title) TextView mToolbarTitle; @BindView(R.id.iv_back) ImageView mIvBack; @BindView(R.id.iv_fav) ImageView mIvFav; @BindView(R.id.ll_gallery) LinearLayout mLlGallery; private int did; private WebView mWebView; private WebSettings mWebSettings; @Override protected boolean getImmersiveStatus() { return false; } @Override protected int getContentView() { return R.layout.activity_detail; } @Override protected void initWidgets() { super.initWidgets(); Intent intent = getIntent(); String type = intent.getStringExtra("type"); did = intent.getIntExtra("did", -1); String title = intent.getStringExtra("title"); String thumb_url = intent.getStringExtra("thumb_url"); if(!TextUtils.isEmpty(type) && type.equals("discovery") && did != -1) { mIvFav.setVisibility(View.VISIBLE); if(MaleAmbryApp.containsDiscovery(did)) { mIvFav.setSelected(true); } else { mIvFav.setSelected(false); } } LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); mWebView = new WebView(<API key>()); mWebView.setLayoutParams(params); mLlGallery.addView(mWebView); initWebView(title, thumb_url); // mWebView.setLayerType(View.LAYER_TYPE_SOFTWARE, null); // mLlGallery.setLayerType(View.LAYER_TYPE_HARDWARE, null); } @SuppressLint("NewApi") private void initWebView(final String toolbar_title, String thumb_url) { mWebSettings = mWebView.getSettings(); if (Build.VERSION.SDK_INT >= 19) { mWebSettings.setCacheMode(WebSettings.<API key>); } mWebView.setWebViewClient(new WebViewClient() { @Override public boolean <API key>(WebView view, String url) { view.loadUrl(url); return true; } @Override public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) { handler.proceed(); } }); mWebView.setWebChromeClient(new WebChromeClient() { @Override public void onReceivedTitle(WebView view, String title) { if (TextUtils.isEmpty(toolbar_title)) { mToolbarTitle.setText(title); } else { mToolbarTitle.setText(toolbar_title); } } @Override public void onProgressChanged(WebView view, int newProgress) { super.onProgressChanged(view, newProgress); } }); mWebSettings.<API key>(true); mWebSettings.<API key>(true); mWebSettings.setSupportZoom(true); mWebSettings.<API key>(true); mWebSettings.setUseWideViewPort(true); mWebSettings.<API key>(true); mWebSettings.setAppCacheEnabled(true); mWebSettings.<API key>(true); mWebSettings.setUserAgentString("User-Agent:Android"); mWebView.loadUrl(thumb_url); } @Override protected void initEvents() { super.initEvents(); mIvBack.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { DetailActivity.this.finish(); } }); mIvFav.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { User user = MaleAmbryApp.getUser(); if(MaleAmbryApp.containsDiscovery(did)) { FavoDiscovery.removeFavoDid(user.getApp_token(), did); MaleAmbryApp.removeDiscovery(did); mIvFav.setSelected(false); } else { if(user != null && user.isLogin()) { FavoDiscovery.addFavoDid(user.getApp_token(), did); FavoDiscovery favoDiscovery = new FavoDiscovery(); favoDiscovery.setDid(did); MaleAmbryApp.<API key>().add(favoDiscovery); mIvFav.setSelected(true); } else { Toast.makeText(DetailActivity.this, "", Toast.LENGTH_SHORT).show(); } } } }); } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK && mWebView.canGoBack()) { mWebView.goBack(); return true; } return super.onKeyDown(keyCode, event); } @Override protected void onDestroy() { if (mWebView != null) { mWebView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); mWebView.clearHistory(); ((ViewGroup) mWebView.getParent()).removeView(mWebView); mWebView.destroy(); mWebView = null; } // System.exit(0); super.onDestroy(); } }
<!DOCTYPE html PUBLIC "- <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Indian-books</title> <link rel="stylesheet" href="css/bootstrap.css" type="text/css" /> <link rel="stylesheet" href="css/bootstrap.min.css" type="text/css" /> <link rel="stylesheet" href="css/bootstrap-theme.css" type="text/css" /> <link rel="stylesheet" href="css/bootstrap-theme.min.css" type="text/css" /> <!-- Custom styles for this template --> <link href="css/carousel.css" rel="stylesheet"> <script src="js/bootstrap.js" type="text/javascript"></script> </head> <body> <div class="container"> <!-- Static navbar --> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <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.php">IndianBooks</a> </div> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li class="active"><a href="home.php">About Us</a></li> <li><a href="#">Home</a></li> <!-- <li><a href="#">Link</a></li>--> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Categories<span class="caret"></span></a> <ul class="dropdown-menu" role="menu"> <li><a href="#">Arts</a></li> <li><a href="#">Children</a></li> <li><a href="#">Life</a></li> <li><a href="#">Literate</a></li> <li><a href="#">Social Science</a></li> <li><a href="#">Technology</a></li> <!-- <li class="dropdown-header">Nav header</li> <li><a href="#">k</a></li> <li><a href="#">One more separated link</a></li> --> </ul> </li> <li> <input type="text" style="width:300px; left: 20px; height:35px; position:relative; top:7px;" name="q" autocomplete="off"/></li> <li> <input type="submit" style="height:35px; left: 23px; position:relative; top:7px;" value="Search" /></li> </ul> <ul class="nav navbar-nav navbar-right"> <li><a href="../navbar-static-top/">Login</a></li> <li><a href="Registraction.php">Registraction</a></li> </ul> </div><!--/.nav-collapse --> </div><!--/.container-fluid --> </div> <!-- Carousel --> <!-- <div id="myCarousel" class="carousel slide" data-ride="carousel"> <ol class="carousel-indicators"> <li data-target="#myCarousel" data-slide-to="0" class="active"></li> <li data-target="#myCarousel" data-slide-to="1"></li> <li data-target="#myCarousel" data-slide-to="2"></li> </ol> <div class="carousel-inner"> <div class="item active"> <img src="data:image/gif;base64,<API key>==" alt="First slide"> <div class="container"> <div class="carousel-caption"> <h1>Example headline.</h1> <p>Note: If you're viewing this page via a <code>file://</code> URL, the "next" and "previous" Glyphicon buttons on the left and right might not load/display properly due to web browser security rules.</p> <p><a class="btn btn-lg btn-primary" href="#" role="button">Sign up today</a></p> </div> </div> </div> <div class="item"> <img src="data:image/gif;base64,<API key>==" alt="Second slide"> <div class="container"> <div class="carousel-caption"> <h1>Another example headline.</h1> <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p> <p><a class="btn btn-lg btn-primary" href="#" role="button">Learn more</a></p> </div> </div> </div> <div class="item"> <img src="data:image/gif;base64,<API key>==" alt="Third slide"> <div class="container"> <div class="carousel-caption"> <h1>One more for good measure.</h1> <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p> <p><a class="btn btn-lg btn-primary" href="#" role="button">Browse gallery</a></p> </div> </div> </div> </div> <a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev"><span class="glyphicon <API key>"></span></a> <a class="right carousel-control" href="#myCarousel" role="button" data-slide="next"><span class="glyphicon <API key>"></span></a> </div><!-- /.carousel --> <!-- Main component for a primary marketing message or call to action --> <div class="jumbotron"> <div class="content"> <div class="content" align="center"> <article class="box-2" style="padding-left:15px;"> <h2 class="head-1 hp-1">Contact details:</h2> <ul class="list-2"> <li>Location: Mumbai Powai. <strong style="color: #666666">[Maharastra]</strong></li> <li>Email: <a href="mailto:info@UXevents.in">info@UXevents.in</a></li> <li>Contact number: <strong>07506080175 </strong></li> </ul> </article> <article class="spacing-2"> <h2 class="head-1 hp-1" style="font-size:170%"><br /><br /> <img src="../image/Contact-Us.jpg" /> </h2> </article> <article class="spacing-1"> <h3 class="head-2">Contact us</h3> <form action="enquiry.php" method="post" id="form" class="form"> <input name="frompage" type="hidden" id="frompage" value="yes" /> <fieldset style="width:450px; border: none; padding:12px; margin-top:10px"> <legend> <strong>Enquiry form </strong></legend> <table width="100%" border="0" class="form"> <tr> <td width="284">Name</td> <td width="194"><label> <input type="text" name="name" id="name"> </label></td> </tr> <tr> <td width="284">Email.id</td> <td width="194"><label> <input type="email" name="email" id="email"> </label></td> </tr> <tr> <td>Contact Number</td> <td><label> <input type="text" name="contact" id="contact"> </label></td> </tr> <tr> <td>Event to be organised</td> <td><label> <select name="event" id="event"> <option value="general">General</option> <option value="social">Social</option> <option value="corporate">Corporate</option> <option value="entertainment">Entertainment</option> <option value="educational">Educational</option> </select> </label></td> </tr> <tr> <td>Number of people</td> <td><input type="text" name="no_people" id="no_people"></td> </tr> <tr> <td valign="top">Message/feedback</td> <td><label> <textarea name="message" id="message" cols="45" rows="5"></textarea> </label></td> </tr> <tr> <td>&nbsp;</td> <td><label> <a href="contactdone.php"><input type="submit" name="button" id="button" value="Submit"></a> </label></td> </tr> </table> </fieldset> </form> </article> </div> </div> </div> <!-- FOOTER --> <footer> <p class="pull-right"><a href="#">Back to top</a></p> <p>&copy; 2014 Company, Inc. &middot; <a href="#">Privacy</a> &middot; <a href="#">Terms</a></p> </footer> </div> <!-- /container --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="js/bootstrap.min.js" type="text/javascript"></script> </body> </html>
using System; using System.ComponentModel; using DesktopWidgets.WidgetBase.Settings; namespace DesktopWidgets.Widgets.Weather { public class Settings : WidgetSettingsBase { public Settings() { Style.FontSettings.FontSize = 16; } [Category("Style")] [DisplayName("Unit Type")] public TemperatureUnitType UnitType { get; set; } [Category("General")] [DisplayName("Refresh Interval")] public TimeSpan RefreshInterval { get; set; } = TimeSpan.FromHours(1); [Category("General")] [DisplayName("ZIP Code")] public string ZipCode { get; set; } [Category("General")] [DisplayName("API Key")] public string ApiKey { get; set; } [Category("Style")] [DisplayName("Show Icon")] public bool ShowIcon { get; set; } = true; [Category("Style")] [DisplayName("Show Temperature")] public bool ShowTemperature { get; set; } = true; [Category("Style")] [DisplayName("Show Temperature Range")] public bool ShowTempMinMax { get; set; } = false; [Category("Style")] [DisplayName("Show Description")] public bool ShowDescription { get; set; } = true; } }
package kvledger import ( "time" "github.com/hyperledger/fabric/common/metrics" "github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/txmgr" ) type stats struct { blockProcessingTime metrics.Histogram <API key> metrics.Histogram statedbCommitTime metrics.Histogram transactionsCount metrics.Counter } func newStats(metricsProvider metrics.Provider) *stats { stats := &stats{} stats.blockProcessingTime = metricsProvider.NewHistogram(<API key>) stats.<API key> = metricsProvider.NewHistogram(<API key>) stats.statedbCommitTime = metricsProvider.NewHistogram(<API key>) stats.transactionsCount = metricsProvider.NewCounter(<API key>) return stats } type ledgerStats struct { stats *stats ledgerid string } func (s *stats) ledgerStats(ledgerid string) *ledgerStats { return &ledgerStats{ s, ledgerid, } } func (s *ledgerStats) <API key>(timeTaken time.Duration) { s.stats.blockProcessingTime.With("channel", s.ledgerid).Observe(timeTaken.Seconds()) } func (s *ledgerStats) <API key>(timeTaken time.Duration) { s.stats.<API key>.With("channel", s.ledgerid).Observe(timeTaken.Seconds()) } func (s *ledgerStats) <API key>(timeTaken time.Duration) { s.stats.statedbCommitTime.With("channel", s.ledgerid).Observe(timeTaken.Seconds()) } func (s *ledgerStats) <API key>( txstatsInfo []*txmgr.TxStatInfo, ) { for _, txstat := range txstatsInfo { transactionTypeStr := "unknown" if txstat.TxType != -1 { transactionTypeStr = txstat.TxType.String() } chaincodeName := "unknown" if txstat.ChaincodeID != nil { chaincodeName = txstat.ChaincodeID.Name + ":" + txstat.ChaincodeID.Version } s.stats.transactionsCount.With( "channel", s.ledgerid, "transaction_type", transactionTypeStr, "chaincode", chaincodeName, "validation_code", txstat.ValidationCode.String(), ).Add(1) } } var ( <API key> = metrics.HistogramOpts{ Namespace: "ledger", Subsystem: "", Name: "<API key>", Help: "Time taken in seconds for ledger block processing.", LabelNames: []string{"channel"}, StatsdFormat: "%{#fqname}.%{channel}", Buckets: []float64{0.005, 0.01, 0.015, 0.05, 0.1, 1, 10}, } <API key> = metrics.HistogramOpts{ Namespace: "ledger", Subsystem: "", Name: "<API key>", Help: "Time taken in seconds for committing the block and private data to storage.", LabelNames: []string{"channel"}, StatsdFormat: "%{#fqname}.%{channel}", Buckets: []float64{0.005, 0.01, 0.015, 0.05, 0.1, 1, 10}, } <API key> = metrics.HistogramOpts{ Namespace: "ledger", Subsystem: "", Name: "statedb_commit_time", Help: "Time taken in seconds for committing block changes to state db.", LabelNames: []string{"channel"}, StatsdFormat: "%{#fqname}.%{channel}", Buckets: []float64{0.005, 0.01, 0.015, 0.05, 0.1, 1, 10}, } <API key> = metrics.CounterOpts{ Namespace: "ledger", Subsystem: "", Name: "transaction_count", Help: "Number of transactions processed.", LabelNames: []string{"channel", "transaction_type", "chaincode", "validation_code"}, StatsdFormat: "%{#fqname}.%{channel}.%{transaction_type}.%{chaincode}.%{validation_code}", } )
/** * @fileoverview Alphabetizes static class names. * @author Maciej Chmurski */ 'use strict' // Requirements const { <API key> } = require('../utils') // Rule Definition module.exports = { meta: { type: 'suggestion', docs: { url: 'https://eslint.vuejs.org/rules/<API key>.html', description: 'enforce static class names order', category: undefined }, fixable: 'code', schema: [] }, create: context => { return <API key>(context, { "VAttribute[directive=false][key.name='class']" (node) { const classList = node.value.value const <API key> = classList.split(/(\s+)/) // Detect and reuse any type of whitespace. let divider = '' if (<API key>.length > 1) { divider = <API key>[1] } const <API key> = <API key>.filter(className => className.trim() !== '') const classListSorted = <API key>.sort().join(divider) if (classList !== classListSorted) { context.report({ node, loc: node.loc, message: 'Classes should be ordered alphabetically.', fix: (fixer) => fixer.replaceTextRange( [node.value.range[0], node.value.range[1]], `"${classListSorted}"` ) }) } } }) } }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>D3: Using radio buttons to trigger different combinations of filters</title> <script type="text/javascript" src="../d3.js"></script> <style type="text/css"> p { font-family: Helvetica, sans-serif; font-size: 12px; } input[type=radio] { margin-left: 40px; } </style> </head> <body> <p> <input type="radio" name="filterPreset" value="none" checked="true"> None <input type="radio" name="filterPreset" value="center"> Center <input type="radio" name="filterPreset" value="edges"> Edges <input type="radio" name="filterPreset" value="quadrants"> Quadrants </p> <script type="text/javascript"> //Width and height var w = 600; var h = 300; var padding = 40; //Dynamic, random dataset var dataset = []; //Initialize empty array var numDataPoints = 200; //Number of dummy data points to create var xRange = 1000; //Max range of new x values var yRange = 1000; //Max range of new y values for (var i = 0; i < numDataPoints; i++) { //Loop numDataPoints times var newNumber1 = Math.floor(Math.random() * xRange); //New random integer var newNumber2 = Math.floor(Math.random() * yRange); //New random integer dataset.push([newNumber1, newNumber2]); //Add new number to array } //Create scale functions var xScale = d3.scaleLinear() .domain([0, 1000]) .range([padding, w - padding / 2]); var yScale = d3.scaleLinear() .domain([0, 1000]) .range([h - padding, padding / 2]); //Define X axis var xAxis = d3.axisBottom() .scale(xScale) .ticks(5); //Define Y axis var yAxis = d3.axisLeft() .scale(yScale) .ticks(5); //Create SVG element var svg = d3.select("body") .append("svg") .attr("width", w) .attr("height", h); //Create circles var allCircles = svg.selectAll("circle") .data(dataset) .enter() .append("circle") .attr("cx", function(d) { return xScale(d[0]); }) .attr("cy", function(d) { return yScale(d[1]); }) .attr("r", 2.5); //Create X axis svg.append("g") .attr("class", "axis") .attr("transform", "translate(0," + (h - padding) + ")") .call(xAxis); //Create Y axis svg.append("g") .attr("class", "axis") .attr("transform", "translate(" + padding + ",0)") .call(yAxis); //On radio button change, update styling d3.selectAll("input") .on("click", function() { var view = d3.select(this).node().value; //Reset all to black allCircles.attr("fill", "black"); var midpoint = 500; var colors = d3.schemeCategory10; //Filter and highlight based on different conditions switch (view) { case "center": var distance = 300; allCircles.filter(function(d) { return Math.abs(midpoint - d[0]) < distance && Math.abs(midpoint - d[1]) < distance; }) .attr("fill", colors[1]); break; case "edges": var distance = 300; allCircles.filter(function(d) { return Math.abs(midpoint - d[0]) > distance || Math.abs(midpoint - d[1]) > distance; }) .attr("fill", colors[3]); break; case "quadrants": //Top left allCircles.filter(function(d) { return d[0] <= midpoint && d[1] >= midpoint; }) .attr("fill", colors[0]); //Top right allCircles.filter(function(d) { return d[0] > midpoint && d[1] >= midpoint; }) .attr("fill", colors[1]); //Bottom right allCircles.filter(function(d) { return d[0] > midpoint && d[1] < midpoint; }) .attr("fill", colors[2]); //Bottom left allCircles.filter(function(d) { return d[0] <= midpoint && d[1] < midpoint; }) .attr("fill", colors[3]); break; case "none": default: //Do nothing more } }); </script> </body> </html>
using System; using System.Drawing; using System.Collections; using System.ComponentModel; using DevExpress.XtraReports.UI; <summary> Summary description for <API key> </summary> public class <API key> : DevExpress.XtraReports.UI.XtraReport { private DevExpress.XtraReports.UI.DetailBand Detail; private DevExpress.XtraReports.UI.TopMarginBand TopMargin; private DevExpress.XtraReports.UI.BottomMarginBand BottomMargin; <summary> Required designer variable. </summary> private System.ComponentModel.IContainer components = null; public <API key>() { InitializeComponent(); // TODO: Add constructor logic here } <summary> Clean up any resources being used. </summary> <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Designer generated code <summary> Required method for Designer support - do not modify the contents of this method with the code editor. </summary> private void InitializeComponent() { components = new System.ComponentModel.Container(); this.Detail = new DevExpress.XtraReports.UI.DetailBand(); this.TopMargin = new DevExpress.XtraReports.UI.TopMarginBand(); this.BottomMargin = new DevExpress.XtraReports.UI.BottomMarginBand(); ((System.ComponentModel.ISupportInitialize)(this)).BeginInit(); this.BottomMargin.Height = 100; this.TopMargin.Height = 100; this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] { this.Detail, this.TopMargin, this.BottomMargin}); ((System.ComponentModel.ISupportInitialize)(this)).EndInit(); } #endregion }
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="sv"> <head> <!-- Generated by javadoc (1.8.0_65) on Tue Feb 02 23:10:16 CET 2016 --> <title>Deprecated List</title> <meta name="date" content="2016-02-02"> <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="Deprecated List"; } } 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="se/mah/KD405A/package-summary.html">Package</a></li> <li>Class</li> <li>Use</li> <li><a href="overview-tree.html">Tree</a></li> <li class="navBarCell1Rev">Deprecated</li> <li><a href="index-files/index-1.html">Index</a></li> <li><a href="help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="index.html?deprecated-list.html" target="_top">Frames</a></li> <li><a href="deprecated-list.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"> <h1 title="Deprecated API" class="title">Deprecated API</h1> <h2 title="Contents">Contents</h2> </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="se/mah/KD405A/package-summary.html">Package</a></li> <li>Class</li> <li>Use</li> <li><a href="overview-tree.html">Tree</a></li> <li class="navBarCell1Rev">Deprecated</li> <li><a href="index-files/index-1.html">Index</a></li> <li><a href="help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="index.html?deprecated-list.html" target="_top">Frames</a></li> <li><a href="deprecated-list.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>
package org.webrtc.kite.config.media; import io.cosmosoftware.kite.config.KiteEntity; import io.cosmosoftware.kite.interfaces.JsonBuilder; import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.Parameter; import javax.json.Json; import javax.json.JsonObject; import javax.json.JsonObjectBuilder; import javax.persistence.*; /** * Entity implementation class for Entity: MediaFile. */ @Entity (name = MediaFile.TABLE_NAME) public class MediaFile extends KiteEntity implements JsonBuilder { /** The Constant TABLE_NAME. */ final static String TABLE_NAME = "mediafiles"; /** The Constant serialVersionUID. */ private static final long serialVersionUID = 1L; /** The id. */ private String id; /** The path name name. */ private String filename; /** The file name version. */ private String name; /** The type of the media. */ private MediaFileType type; /** The duration of the media. */ private String duration = "00:00:00"; /** The directory with the Videos and Audios folders are located. */ private String directory = "/home/ubuntu/"; /** * Instantiates a new media file. */ public MediaFile() { super(); } /** * Instantiates a new mediaFile. * * @param jsonObject the json object */ public MediaFile(JsonObject jsonObject) { this(); // Mandatory this.filename = jsonObject.getString("filename"); this.type = MediaFileType.valueOf(jsonObject.getString("type")); // Optional this.directory = jsonObject.getString("directory", directory); this.name = jsonObject.getString("name", this.filename); this.duration = jsonObject.getString("duration", duration); } /** * Gets the id. * * @return the id */ @Id // @GeneratedValue(generator = "uuid") // @GenericGenerator(name = "uuid", strategy = "uuid2") @GeneratedValue (generator = MediaFile.TABLE_NAME) @GenericGenerator (name = MediaFile.TABLE_NAME, strategy = "io.cosmosoftware.kite.dao.KiteIdGenerator", parameters = { @Parameter (name = "prefix", value = "MEDI") }) public String getId() { return this.id; } /** * Sets the id. * * @param id the new id */ public void setId(String id) { this.id = id; } /** * Gets the filename. * * @return the filename */ public String getFilename() { return filename; } /** * Gets the filepath (directory + filename) * * @return the filepath */ @Transient public String getFilepath() { return directory + filename; } /** * Sets the filename. * * @param filename the new filename */ public void setFilename(String filename) { this.filename = filename; } /** * Gets the name. * * @return the name */ public String getName() { return name; } /** * Sets the name. * * @param name the new name */ public void setName(String name) { this.name = name; } /** * Gets the type. * * @return the type */ @Enumerated (EnumType.STRING) public MediaFileType getType() { return type; } /** * Sets the type. * * @param type the new type */ public void setType(MediaFileType type) { this.type = type; } /** * Gets the duration. * * @return the duration */ public String getDuration() { return duration; } /** * Sets the duration. * * @param duration the new duration */ public void setDuration(String duration) { this.duration = duration; } /* * (non-Javadoc) * * @see com.cosmo.kite.interfaces.JsonBuilder#<API key>() */ @Override public JsonObjectBuilder <API key>() throws <API key> { return Json.createObjectBuilder().add("name", this.name).add("filename", this.filename) .add("type", this.type.name()).add("duration", this.duration).add("directory", this.directory); } }
#!/bin/bash # Install files: function install() { echo "Installing into “${1}” …" # Create installation folder: mkdir -pv $1 cd $1 # Remote repo zip file: SOURCE_ZIP="https://github.com/mhulse/bootgeoisie/tarball/master" # Get the zip file and extract all files: curl -sS -#L "$SOURCE_ZIP" | tar -xzv --strip-components 1 --exclude=install.sh echo "# My new project"$'\n' > README.md # Let the use know that we are done: echo $'\n'"Congrats! Installation was successful!"$'\n' # Open installation folder: open "." } # Check if installation director meets our requirements: function empty() { if [ -d "$DIRECTORY" ] && [ "$(ls -A $1)" ]; then echo "“$1” must be an empty directory." echo "Please try running this script again." else # Move on to the installation function: install $1 fi } # Pre-installation options: function menu() { # Prompt the user for feedback: read -p "Path to empty installation directory (Q to quit): " input case $input in [qQ]) # User cancled: echo "Cancled by user, exiting …" ;; *[![:blank:]]*) # Not blank or empty and is set: empty $input ;; *) # Contains only blanks, is empty or unset: echo $'\n'"You must enter a directory path." echo "Please try running this script again." esac } # Tidy up the terminal window: clear # Create menu: menu # Exit program: exit 0 # Done! # For more information about this script, see:
using System; using System.Collections.Generic; using System.Linq; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.GamerServices; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Media; using Microsoft.Xna.Framework.Net; using Microsoft.Xna.Framework.Storage; namespace Slick { <summary> This is the main type for your game </summary> public class Game1 : Microsoft.Xna.Framework.Game { <API key> graphics; SpriteBatch spriteBatch; INotificationWindow notificationBox; const int ScreenWidth = 1280; const int ScreenHeight = 720; const int BoardWidth = 10; const int BoardHeight = 10; const int startingMoney = 10000; public Game1() { graphics = new <API key>(this); graphics.<API key> = ScreenWidth; graphics.<API key> = ScreenHeight; Content.RootDirectory = "Content"; } <summary> Allows the game to perform any initialization it needs to before starting to run. This is where it can query for any required services and load any non-graphic related content. Calling base.Initialize will enumerate through any components and initialize them as well. </summary> protected override void Initialize() { this.IsMouseVisible = true; // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); var random = new Random(); var board = new Board(BoardWidth, BoardHeight, random); var playerList = new[] { new Player("Ian", startingMoney, Color.Red), new Player("Ryan", startingMoney, Color.Blue), new Player("Stefan", startingMoney, Color.Yellow), new Player("Jeremy", startingMoney, Color.Green) }.ToList(); var turnManager = new TurnManager(board, playerList); notificationBox = null; var mouseInputHandler = new MouseInputHandler(this); var mouseInputBehaviour = new MouseInputBehaviour(this, spriteBatch, notificationBox, board, turnManager, mouseInputHandler, ScreenWidth, ScreenHeight); var moneyView = new MoneyView(this, turnManager, spriteBatch, playerList); //var turnIndicatorView = new TurnIndicatorView(this, spriteBatch, turnManager, BoardWidth, BoardHeight); //for(int i = 0; i < BoardWidth; i++) { // board.Cells[i, 0].Owner = playerList[0]; var boardView = new BoardView(this, board, spriteBatch, ScreenWidth, ScreenHeight); Components.Add(boardView); base.Initialize(); } <summary> LoadContent will be called once per game and is the place to load all of your content. </summary> protected override void LoadContent() { // TODO: use this.Content to load your game content here } protected override void Update(GameTime gameTime) { // Allows the game to exit if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed) this.Exit(); // TODO: Add your update logic here base.Update(gameTime); } protected override void Draw(GameTime gameTime) { this.GraphicsDevice.Clear(Color.Pink); spriteBatch.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.BackToFront, SaveStateMode.None); base.Draw(gameTime); spriteBatch.End(); } } }
<?php /** * DO NOT EDIT THIS FILE! * * This file was automatically generated from external sources. * * Any manual change here will be lost the next time the SDK * is updated. You've been warned! */ namespace DTS\eBaySDK\MerchantData\Types; /** * * @property string $ItemID * @property string $SKU * @property \DTS\eBaySDK\MerchantData\Types\FeesType $Fees * @property \DateTime $StartTime * @property \DateTime $EndTime * @property string $CategoryID * @property string $Category2ID * @property \DTS\eBaySDK\MerchantData\Enums\<API key>[] $DiscountReason * @property \DTS\eBaySDK\MerchantData\Types\<API key> $ProductSuggestions * @property \DTS\eBaySDK\MerchantData\Types\<API key> $<API key> */ class <API key> extends \DTS\eBaySDK\MerchantData\Types\<API key> { /** * @var array Properties belonging to objects of this class. */ private static $propertyTypes = [ 'ItemID' => [ 'type' => 'string', 'repeatable' => false, 'attribute' => false, 'elementName' => 'ItemID' ], 'SKU' => [ 'type' => 'string', 'repeatable' => false, 'attribute' => false, 'elementName' => 'SKU' ], 'Fees' => [ 'type' => 'DTS\eBaySDK\MerchantData\Types\FeesType', 'repeatable' => false, 'attribute' => false, 'elementName' => 'Fees' ], 'StartTime' => [ 'type' => 'DateTime', 'repeatable' => false, 'attribute' => false, 'elementName' => 'StartTime' ], 'EndTime' => [ 'type' => 'DateTime', 'repeatable' => false, 'attribute' => false, 'elementName' => 'EndTime' ], 'CategoryID' => [ 'type' => 'string', 'repeatable' => false, 'attribute' => false, 'elementName' => 'CategoryID' ], 'Category2ID' => [ 'type' => 'string', 'repeatable' => false, 'attribute' => false, 'elementName' => 'Category2ID' ], 'DiscountReason' => [ 'type' => 'string', 'repeatable' => true, 'attribute' => false, 'elementName' => 'DiscountReason' ], 'ProductSuggestions' => [ 'type' => 'DTS\eBaySDK\MerchantData\Types\<API key>', 'repeatable' => false, 'attribute' => false, 'elementName' => 'ProductSuggestions' ], '<API key>' => [ 'type' => 'DTS\eBaySDK\MerchantData\Types\<API key>', 'repeatable' => false, 'attribute' => false, 'elementName' => '<API key>' ] ]; /** * @param array $values Optional properties and values to assign to the object. */ public function __construct(array $values = []) { list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values); parent::__construct($parentValues); if (!array_key_exists(__CLASS__, self::$properties)) { self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes); } if (!array_key_exists(__CLASS__, self::$xmlNamespaces)) { self::$xmlNamespaces[__CLASS__] = 'xmlns="urn:ebay:apis:eBLBaseComponents"'; } if (!array_key_exists(__CLASS__, self::$<API key>)) { self::$<API key>[__CLASS__] = '<API key>'; } $this->setValues(__CLASS__, $childValues); } }
<?php /** * XmlConnect controller abstract * * @category Mage * @package Mage_XmlConnect * @author Magento Core Team <core@magentocommerce.com> */ abstract class <API key> extends <API key> { /** * Message status `error` */ const <API key> = 'error'; /** * Message status `warning` */ const <API key> = 'warning'; /** * Message status `success` */ const <API key> = 'success'; /** * Message type `alert` */ const MESSAGE_TYPE_ALERT = 'alert'; /** * Message type `prompt` */ const MESSAGE_TYPE_PROMPT = 'prompt'; /** * Declare content type header * Validate current application * * @return null */ public function preDispatch() { parent::preDispatch(); $this->getResponse()->setHeader('Content-type', 'text/xml; charset=UTF-8'); /** * Load application by specified code and make sure that application exists */ $cookieName = <API key>::<API key>; $appCode = isset($_COOKIE[$cookieName]) ? (string) $_COOKIE[$cookieName] : ''; $<API key> = <API key>::<API key>; $screenSize = isset($_COOKIE[$<API key>]) ? (string) $_COOKIE[$<API key>] : ''; if (!$appCode) { $this->_message( Mage::helper('xmlconnect')->__('Specified invalid app code.'), self::<API key> ); $this->setFlag('', self::FLAG_NO_DISPATCH, true); return; } /** * Check is website offline */ if ((int)Mage::getStoreConfig('general/restriction/is_active') && (int)Mage::getStoreConfig('general/restriction/mode') == 0 ) { $this->_message( Mage::helper('xmlconnect')->__('Website is offline.'), self::<API key> ); $this->setFlag('', self::FLAG_NO_DISPATCH, true); return; } /** @var $appModel <API key> */ $appModel = Mage::getModel('xmlconnect/application')->loadByCode($appCode); $appModel->setScreenSize($screenSize); if ($appModel && $appModel->getId()) { Mage::app()->setCurrentStore( Mage::app()->getStore($appModel->getStoreId())->getCode() ); Mage::getSingleton('core/locale')->emulate($appModel->getStoreId()); Mage::register('current_app', $appModel); } else { $this->_message( Mage::helper('xmlconnect')->__('Specified invalid app code.'), self::<API key> ); $this->setFlag('', self::FLAG_NO_DISPATCH, true); return; } } /** * Validate response body * * @return null */ public function postDispatch() { parent::postDispatch(); $body = $this->getResponse()->getBody(); if (empty($body)) { $this->_message( Mage::helper('xmlconnect')->__('An error occurred while processing your request.'), self::<API key> ); } } /** * Generate message xml and set it to response body * * @param string $text * @param string $status * @param array $children * @return null */ protected function _message($text, $status, $children = array()) { /** @var $message <API key> */ $message = Mage::getModel('xmlconnect/simplexml_element', '<message></message>'); $message->addCustomChild('status', $status); $message->addCustomChild('text', $text); foreach ($children as $node => $value) { $message->addCustomChild($node, $value); } $this->getResponse()->setBody($message->asNiceXml()); } }
<!DOCTYPE html PUBLIC "- <html xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <title>Play! 2.x Provider for Play! 2.4.x 1.0.0-beta1 Reference Package com.google.code.play2.provider.play24</title> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="style" /> </head> <body> <h3> <a href="package-summary.html" target="classFrame">com.google.code.play2.provider.play24</a> </h3> <h3>Classes</h3> <ul> <li> <a href="Play24LessCompiler.html" target="classFrame">CompileResult</a> </li> <li> <a href="Play24LessCompiler.html" target="classFrame"><API key></a> </li> <li> <a href="<API key>.html" target="classFrame"><API key></a> </li> <li> <a href="Play24EbeanEnhancer.html" target="classFrame">Play24EbeanEnhancer</a> </li> <li> <a href="Play24JavaEnhancer.html" target="classFrame">Play24JavaEnhancer</a> </li> <li> <a href="<API key>.html" target="classFrame"><API key></a> </li> <li> <a href="Play24LessCompiler.html" target="classFrame">Play24LessCompiler</a> </li> <li> <a href="Play24Provider.html" target="classFrame">Play24Provider</a> </li> <li> <a href="<API key>.html" target="classFrame"><API key></a> </li> <li> <a href="<API key>.html" target="classFrame"><API key></a> </li> </ul> </body> </html>
/** * * @type {widthDefault} */ var widthDefault = null; /** * * @constructor */ var ObjectOpenAlign = function () { }; /** * @type {Align} */ ObjectOpenAlign.Align = function () { }; /** * * @type {{name: string, connect: null, node: null, nodeBack: null, dataRetorn: null, result: null}} */ ObjectOpenAlign.Align.prototype = { name: "", connect: null, node: null, nodeBack: null, dataRetorn: null, result: null }; /** * * @type {Array} */ ObjectOpenAlign.listAlign = new Array(); /** * * @type {dna.OutputResultAlign.nodes} */ ObjectOpenAlign.nodes = null; /** * * @type {ObjectOpenAlign.Align} */ ObjectOpenAlign.alignCurrent = null; /** * * @param id * @returns {dna.OutputResultAlign} */ ObjectOpenAlign.openAlign = function (id) { if (localStorage.matrixAligns) { return JSON.parse(localStorage.matrixAligns)[parseInt(id, 10)]; } }; /** * @description <API key> */ ObjectOpenAlign.<API key> = function () { var possibilityResult = document.getElementById('possibilityResult'); possibilityResult.appendChild(this.<API key>([ 'N', 'W', 'NW' ], "up-left-diagonal: ")); possibilityResult.appendChild(this.<API key>([ 'W', 'N', 'NW' ], "left-up-diagonal: ")); possibilityResult.appendChild(this.<API key>([ 'N', 'NW', 'W' ], "up-diagonal-left: ")); possibilityResult.appendChild(this.<API key>([ 'W', 'NW', 'N' ], "left-diagonal-up: ")); possibilityResult.appendChild(this.<API key>([ 'NW', 'N', 'W' ], "diagonal-up-left: ")); possibilityResult.appendChild(this.<API key>([ 'NW', 'W', 'N' ], "diagonal-left-up: ")); }; /** * * @param connect * @param text * @returns {HTMLElement|*} */ ObjectOpenAlign.<API key> = function (connect, text) { var htmlP = document.createElement("p"); htmlP.innerHTML = text; var align = this.createAlign(connect, text); htmlP.onclick = function () { EventOpenAlign.<API key> = null; EventOpenAlign.<API key>(align); }; setTimeout(function () { var data = ProcessOpenAlign.alignPossibility(connect); align.result = data; htmlP.innerHTML = htmlP.innerHTML + "Score=" + data.score; }, 0); return htmlP; }; /** * * @param connect * @param name * @returns {ObjectOpenAlign.Align} */ ObjectOpenAlign.createAlign = function (connect, name) { var align = new this.Align(); align.connect = connect; align.name = name; this.listAlign.push(align); return align; }; /** * * @param {dna.OutputResultAlign} */ ObjectOpenAlign.createMatrix = function (data) { var matrix = null; if (data.matrixs && data.matrixs[0]) { matrix = data.matrixs[0]; } else { matrix = data; } this.nodes = matrix.nodes; var sequenceA = matrix.sequenceA; var sequenceB = matrix.sequenceB; var htmlSVG = ""; $('#matrix svg').attr("width", (40 + (this.nodes.length * 10))); $('#matrix svg').attr("height", (100 + (this.nodes[0].length * 10))); $('#matrix svg').attr("vwidth", this.nodes.length); $('#matrix svg').attr("vheight", this.nodes[0].length); for (i = 0; i < sequenceA.length; i++) { htmlSVG += '<text class="textSeqA" vx=' + i + ' x="' + (20 + ((i + 1) * 10)) + '" y="15" width="8" height="8" >' + sequenceA[i] + '</text>'; } for (i = 0; i < sequenceB.length; i++) { htmlSVG += '<text class="textSeqB" vy=' + i + ' x="5" y="' + (30 + ((i + 1) * 10)) + '" width="8" height="8" >' + sequenceB[i] + '</text>'; } for (i = 0; i < this.nodes.length; i++) { for (var j = 0; j < this.nodes[i].length; j++) { if (this.nodes[i][j].candidate) { htmlSVG += '<rect onclick="EventOpenAlign.clickElementRect(this)" class="noAlign" cand="true" vx="' + i + '" vy="' + j + '" x="' + (20 + (i * 10)) + '" y="' + (20 + (j * 10)) + '" />'; htmlSVG += '<text onclick="EventOpenAlign.clickElementText(this)" class="valueTextCandidate" vx="' + i + '" vy="' + j + '" x="' + (20 + (i * 10)) + '" y="' + (25 + (j * 10)) + '" width="10" height="10" >' + this.nodes[i][j].value + '</text>'; } else { htmlSVG += '<rect onclick="EventOpenAlign.clickElementRect(this)" class="noAlign" cand="false" vx="' + i + '" vy="' + j + '" x="' + (20 + (i * 10)) + '" y="' + (20 + (j * 10)) + '" />'; htmlSVG += '<text onclick="EventOpenAlign.clickElementText(this)" class="valueText" vx="' + i + '" vy="' + j + '" x="' + (20 + (i * 10)) + '" y="' + (25 + (j * 10)) + '" width="10" height="10" >' + this.nodes[i][j].value + '</text>'; } } } $("#test").append(this.parseSVG(htmlSVG)); $('#matrix svg text').css('font', '10px sans-serif;'); EventOpenAlign.scaleMatrix(40); }; /** * * @param s * @returns {DocumentFragment|*} */ ObjectOpenAlign.parseSVG = function (s) { var div = document.createElementNS('http: div.innerHTML = '<svg xmlns="http: var frag = document.<API key>(); while (div.firstChild.firstChild) { frag.appendChild(div.firstChild.firstChild); } return frag; }; /** * * @param resultSequenceA * @param resultSequenceB * @returns {string} */ ObjectOpenAlign.mountTableResult = function (resultSequenceA, resultSequenceB) { var htmlStr = ""; htmlStr += "<tbody>"; htmlStr += "<tr>"; var i = 0; for (i = 0; i < resultSequenceA.length; i++) { htmlStr += "<td>"; htmlStr += resultSequenceA[i]; htmlStr += "</td>"; } htmlStr += "</tr>"; htmlStr += "<tr>"; i = 0; for (i = 0; i < resultSequenceA.length; i++) { htmlStr += "<td>"; htmlStr += resultSequenceB[i]; htmlStr += "</td>"; } htmlStr += "</tr>"; htmlStr += "</tbody>"; return htmlStr; }; /** * * @param rect */ ObjectOpenAlign.verifyNode = function (rect, openManual) { var align = this.alignCurrent; if (rect) { var x = rect.getAttribute("vx"); var y = rect.getAttribute("vy"); var node = this.nodes[x][y]; if (ProcessOpenAlign.calculation.methodSequencing === dna.MethodSequencing.LOCAL || ProcessOpenAlign.calculation.methodSequencing === dna.MethodSequencing.SEMIGLOBAL) { if (!align.nodeBack) { align.nodeBack = node; } } align.dataRetorn = ProcessOpenAlign.calculation.nodeVicinity(align.dataRetorn, align.nodeBack, node); align.nodeBack = node; } else { if(!openManual){ align.dataRetorn = ProcessOpenAlign.calculation.nodeVicinity(align.dataRetorn, null, null); } } var nodesC = null; if (align.dataRetorn.arrayNode) { nodesC = align.dataRetorn.arrayNode; } var nodesAlign = null; if (align.dataRetorn.arrayNodeAlign) { nodesAlign = align.dataRetorn.arrayNodeAlign; } $("#matrix rect").attr('class', 'noAlign'); $("#matrix rect[cand='true']").attr('class', 'alignCandidate'); $("#tableResult").html(ObjectOpenAlign.mountTableResult(align.dataRetorn.sbSeqA.toString(), align.dataRetorn.sbSeqB.toString())); if (nodesC) { for (var i = 0; i < nodesC.length; i++) { var nodeC = nodesC[i]; $("#matrix rect[vx=" + nodeC.x + "][vy=" + nodeC.y + "]").attr('class', '<API key>'); } } if (nodesAlign) { for (i = 0; i < nodesAlign.length; i++) { var nodeAlign = nodesAlign[i]; $("#matrix rect[vx=" + nodeAlign.x + "][vy=" + nodeAlign.y + "]").attr('class', 'alignSelect'); } } $(rect).attr('class', 'alignSelectNow'); EventOpenAlign.updateScoreManual(align.dataRetorn.score); EventOpenAlign.resetScrollMatrix(); }; /** * * @param element */ ObjectOpenAlign.openDetailRect = function (element) { var x = element.getAttribute("vx"); var y = element.getAttribute("vy"); console.log(this.nodes[x][y]); var node = this.nodes[x][y]; var nodeDetail = ProcessOpenAlign.calculation.nodeDetail(node); $('#DetailNode').html(node.value); if (nodeDetail.nodeW) { $('#DetailNodeW').html(nodeDetail.nodeW.value); } if (nodeDetail.nodeN) { $('#DetailNodeN').html(nodeDetail.nodeN.value); } if (nodeDetail.nodeNW) { $('#DetailNodeNW').html(nodeDetail.nodeNW.value); } $('#DetailConnectN').hide(); $('#DetailConnectNW').hide(); $('#DetailConnectW').hide(); $('#DetailCalcN').html(nodeDetail.nodeCalcN); $('#DetailCalcNW').html(nodeDetail.nodeCalcNW); $('#DetailCalcW').html(nodeDetail.nodeCalcW); $('#DetailSumN').html(nodeDetail.nodeSumN); $('#DetailSumNW').html(nodeDetail.nodeSumNW); $('#DetailSumW').html(nodeDetail.nodeSumW); $('#DetailSeqA').html(node.charSeqA); $('#DetailSeqB').html(node.charSeqB); for (var i = 0; i < node.connected.length; i++) { $('#DetailConnect' + node.connected[i]).show(); } $('#pageDetailRec').modal({ show: true, keyboard: true }); }; /** * * @constructor */ var EventOpenAlign = { }; /** * * @type {HTMLElement|*} */ EventOpenAlign.<API key> = null; /** * updateScoreManual */ EventOpenAlign.updateScoreManual = function (score) { if (this.<API key>) { var num = this.<API key>.getAttribute('num'); this.<API key>.setAttribute('score', score); this.<API key>.innerHTML = "Manual " + num + ": " + score; } } /** * * @param {dna.OutputResultAlign} */ EventOpenAlign.<API key> = function (align) { $("#matrix rect[cand='true']").attr('class', 'alignCandidate'); for (var i = 0; i < align.result.nodes.length; i++) { var node = align.result.nodes[i]; // $("#matrix rect[vx=" + node.x + "][vy=" + node.y + "]").attr('fill', cor); $("#matrix rect[vx=" + node.x + "][vy=" + node.y + "]").attr('class', 'align'); } $("#tableResult").html(ObjectOpenAlign.mountTableResult(align.result.resultSequenceA, align.result.resultSequenceB)); $("#matrix").height($('body').height() - $(".menuDown").height() - $(".menuUp").height() - 80); $("#matrix").width($('body').width() - 260); }; /** * * @param value */ EventOpenAlign.scaleMatrix = function (value) { $('#matrix svg').each(function () { $(this).attr("width", (40 + ($(this).attr('vwidth') * value))).attr("height", (100 + ($(this).attr('vheight') * value))); }); $("#matrix rect").each(function () { var i = $(this).attr('vx'); var j = $(this).attr('vy'); $(this).attr('width', value).attr('height', value).attr('x', (20 + (i * value))).attr('y', (20 + (j * value))); }); $(".valueText,.valueTextCandidate").each(function () { var i = $(this).attr('vx'); var j = $(this).attr('vy'); var w = 20 + (value / 2); $(this).attr('width', value).attr('height', value).attr('x', (20 + (i * value) + (value / 2))).attr('y', ((w + 5) + (j * value))); // $(this).attr('width', value).attr('height', value).attr('x', (w - 5 + (i * value))).attr('y', ((w + 5) + (j * value))); }); $(".textSeqA").each(function () { var i = parseInt($(this).attr('vx'), 10); var w = 15 + (value / 2); $(this).attr('x', (w + ((i + 1) * value))); }); $(".textSeqB").each(function () { var j = parseInt($(this).attr('vy'), 10); var w = 25 + (value / 2); $(this).attr('y', (w + ((j + 1) * value))); }); // $(".valueTextCandidate").hide(); // $(".valueText").hide(); // if (value >= 20) { // $(".valueTextCandidate").show(); $('#matrix svg text').css('font', value + 'px sans-serif;'); $('.valueTextCandidate').css('font-size', value / 2); $('.valueText').css('font-size', value / 2); $("#matrix Text").undelegate("dblclick").dblclick(function () { try { ObjectOpenAlign.openDetailRect($("#matrix rect[vx=" + this.getAttribute("vx") + "][vy=" + this.getAttribute("vy") + "]")[0]); } catch (e) { } }); $("#matrix rect").undelegate("dblclick").dblclick(function () { ObjectOpenAlign.openDetailRect(this); }); }; /** * * @param {HTMLElement} */ EventOpenAlign.clickElementText = function (ele) { this.clickElementRect($("#matrix rect[vx=" + ele.getAttribute("vx") + "][vy=" + ele.getAttribute("vy") + "]")[0]); }; /** * * @param {HTMLElement} */ EventOpenAlign.clickElementRect = function (ele) { if ($(ele).is(".<API key>")) { $(".alignSelectNow").attr("class", "alignSelect"); $(".<API key>").attr("class", "alignCandidate"); $(ele).attr("class", "alignSelectNow"); ObjectOpenAlign.verifyNode(ele, false); } }; /** * @description <API key> */ EventOpenAlign.<API key> = function () { var p = document.createElement("p"); p.setAttribute('num', (ObjectOpenAlign.listAlign.length + 1)); p.setAttribute('score', 0); p.innerHTML = "Manual " + (ObjectOpenAlign.listAlign.length + 1) + ": 0"; var align = new ObjectOpenAlign.Align(); align.name = p.innerHTML; ObjectOpenAlign.listAlign.push(align); EventOpenAlign.<API key> = p; $("#matrix rect").attr('class', 'noAlign'); $("#matrix rect[cand='true']").attr('class', 'alignCandidate'); p.onclick = function () { EventOpenAlign.<API key> = p; ObjectOpenAlign.alignCurrent = align; ObjectOpenAlign.verifyNode(null, true); }; setTimeout(function () { ObjectOpenAlign.alignCurrent = align; var outputAlign = ProcessOpenAlign.calculation.getOutputAlign(); var nodes = outputAlign.matrixs[0].nodes; if (ProcessOpenAlign.calculation.methodSequencing === dna.MethodSequencing.GLOBAL) { var node = nodes[nodes.length - 1][nodes[0].length - 1]; align.nodeBack = node; var rect = $("#matrix rect[vx=" + node.x + "][vy=" + node.y + "]").attr('class', 'alignSelectNow'); ObjectOpenAlign.verifyNode(rect[0], false); } else if (ProcessOpenAlign.calculation.methodSequencing === dna.MethodSequencing.LOCAL) { var node = null; for (var i = 0; i < nodes.length; i++) { node = nodes[i][nodes[0].length - 1]; $("#matrix rect[vx=" + node.x + "][vy=" + node.y + "]").attr('class', '<API key>'); } for (var i = 0; i < nodes[0].length; i++) { node = nodes[nodes.length - 1][i]; $("#matrix rect[vx=" + node.x + "][vy=" + node.y + "]").attr('class', '<API key>'); } } else if (ProcessOpenAlign.calculation.methodSequencing === dna.MethodSequencing.SEMIGLOBAL) { var node = null; ObjectOpenAlign.verifyNode(); } var elemMatrix = document.getElementById('matrix'); elemMatrix.scrollTop = elemMatrix.scrollHeight; elemMatrix.scrollLeft = elemMatrix.scrollWidth; }, 0); var possibilityResult = document.getElementById('possibilityResult'); possibilityResult.appendChild(p); }; /** * @description resetScrollMatrix */ EventOpenAlign.resetScrollMatrix = function () { if ($(this).is(":hidden")) { $("#matrix").width($(".row").width() - 20); } else { $("#matrix").width(widthDefault); } var elemMatrix = $("#matrix")[0]; var eScrollTop = elemMatrix.scrollTop; var eScrollLeft = elemMatrix.scrollLeft; $("#matrix").height($('body').height() - $(".menuDown").height() - $(".menuUp").height() - 80); $("#matrix").width($('body').width() - 260); elemMatrix.scrollTop = eScrollTop; elemMatrix.scrollLeft = eScrollLeft; }; /** * * @param mouseEvent * @returns {boolean} */ EventOpenAlign.oncontextmenu = function (mouseEvent) { var element = mouseEvent.toElement; if (!element) { element = mouseEvent.target; } if (element.tagName === 'text') { try { ObjectOpenAlign.openDetailRect($("#matrix rect[vx=" + element.getAttribute("vx") + "][vy=" + element.getAttribute("vy") + "]")[0]); } catch (e) { } return false; } else if (element.tagName === 'rect') { ObjectOpenAlign.openDetailRect(element); return false; } return true; }; /** * @description getParameterCss */ EventOpenAlign.getParameterCss = function () { $.get( 'hbs/parameterCss.hbs', function (script) { var template = Handlebars.compile(script); if (localStorage.parameterCss) { $('#parameterCss').remove(); $('head').append(template(JSON.parse(localStorage.parameterCss))); $('#idParameter').html(JSON.stringify(JSON.parse(localStorage.parameterCss), null, 4)); } else { $.getJSON( 'json/parameterCss.json', function (json) { $('#parameterCss').remove(); localStorage.parameterCss = JSON.stringify(json); $('head').append(template(json)); $('#idParameter').html(json); } ); } } ); }; /** * * @param script */ EventOpenAlign.salveParameterCss = function (script) { localStorage.parameterCss = script; this.getParameterCss(); }; /** * * @constructor */ var ProcessOpenAlign = { }; /** * * @type {dna.Calculation} */ ProcessOpenAlign.calculation = null; /** * * @param connect * @returns {dna.OutputResultAlign} */ ProcessOpenAlign.alignPossibility = function (connect) { var hash = window.location.hash; hash = hash.replace(" var matrix = JSON.parse(localStorage.matrix); var alignGlobal = new dna.InputResultAlign(); alignGlobal.idMatrix = parseInt(hash, 10); alignGlobal.matrix = matrix[0]; alignGlobal.connecteds = connect; this.calculation.setInputResultAlign(alignGlobal); this.calculation.findAlign(); var data = this.calculation.<API key>(); console.log(data); return data; }; /** * @description startProcess */ ProcessOpenAlign.startProcess = function () { var hash = window.location.hash; hash = hash.replace(" var inputAlignResult = ObjectOpenAlign.openAlign(hash); delete inputAlignResult.date; // inputAlignResult.arrayMisMatch = new Array(); // inputAlignResult.arrayMisMatch["A-C"] = 10; this.calculation = dna.CalculationFactory.createCalculation(inputAlignResult); this.calculation.calculationNode(); this.calculation.findAligns(); var data = this.calculation.getOutputAlign(); ObjectOpenAlign.createMatrix(data); localStorage.matrix = JSON.stringify(data); }; /** * @description start */ function start() { ObjectOpenAlign.<API key>(); ProcessOpenAlign.startProcess(); $(".valueScale").click(function () { EventOpenAlign.scaleMatrix($(this).val()); }); $("#btnBACK").click(function () { history.back(); }); $("#matrix").height($('body').height() - $(".menuDown").height() - $(".menuUp").height() - 80); $("#matrix").width($('body').width() - 260); } $(function () { widthDefault = $("#matrix").width(); $("#btnScore").click(function () { $("#possibilityResult").toggle(); }); $('link[href*="clean"]').remove(); setTimeout(function () { start(); }, 0); $(".<API key>").click(function () { console.log("Testes" + this); }); $("#saveNew").click(function () { EventOpenAlign.salveParameterCss(JSON.stringify(JSON.parse($("#idParameter").text()))); }); document.oncontextmenu = EventOpenAlign.oncontextmenu; EventOpenAlign.getParameterCss(); }); /** * @description i18n.init * */ i18n.init(function (t) { $("body").i18n(); });
package com.luoruiyong.weblog.ui; import android.Manifest; import android.content.Intent; import android.content.pm.PackageManager; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.app.ActivityCompat; import android.support.v4.content.ContextCompat; import android.support.v7.app.ActionBar; import android.support.v7.widget.Toolbar; import android.text.Editable; import android.text.TextUtils; import android.text.TextWatcher; import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.TextView; import android.widget.Toast; import com.luoruiyong.weblog.R; import com.luoruiyong.weblog.base.BaseMessage; import com.luoruiyong.weblog.base.BaseModel; import com.luoruiyong.weblog.base.BaseUi; import com.luoruiyong.weblog.base.C; import com.luoruiyong.weblog.model.Picture; import com.luoruiyong.weblog.model.UniversalModel; import com.luoruiyong.weblog.util.AppUtil; import com.luoruiyong.weblog.util.LogUtil; import com.luoruiyong.weblog.util.NetworkUtil; import com.luoruiyong.weblog.util.SDUtil; import org.apache.http.NameValuePair; import org.apache.http.message.BasicNameValuePair; import java.util.ArrayList; import java.util.HashMap; import static com.luoruiyong.weblog.R.id.password_ok; public class UiSign extends BaseUi{ private static final String CLASS_NAME = UiSign.class.getSimpleName() + " private ImageView iv_user_icon; private EditText et_account; private EditText et_nickname; private EditText et_password; private EditText et_conferm_password; private ImageView iv_account_ok; private ImageView iv_nickname_ok; private ImageView iv_password_ok; private ImageView <API key>; private TextView tv_error_tips; private LinearLayout ll_error_layout; private RelativeLayout <API key>; private Button btn_sign; private String account; private String nickName; private String password; private String confirm_password; private String imagePath = null; private boolean account_tag = false; private boolean nickName_tag = false; private boolean password_tag = false; private boolean <API key> = false; private final static int CHOOSE_ICON = 0; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.ui_sign); LogUtil.d(CLASS_NAME+""); setToolbar(); bindControls(); } @Override protected void onDestroy() { super.onDestroy(); LogUtil.d(CLASS_NAME+""); } @Override public boolean <API key>(MenuItem item) { switch (item.getItemId()){ case android.R.id.home: LogUtil.d(CLASS_NAME+""); this.finish(); break; } return true; } private void bindControls() { LogUtil.d(CLASS_NAME+""); et_account = (EditText) findViewById(R.id.account); et_nickname = (EditText) findViewById(R.id.nickname); et_password = (EditText) findViewById(R.id.password); et_conferm_password = (EditText) findViewById(R.id.confirm_password); iv_account_ok = (ImageView) findViewById(R.id.account_ok); iv_nickname_ok = (ImageView) findViewById(R.id.nickname_ok); iv_password_ok = (ImageView) findViewById(password_ok); <API key> = (ImageView) findViewById(R.id.confirm_password_ok); iv_user_icon = (ImageView) findViewById(R.id.user_icon); btn_sign = (Button) findViewById(R.id.sign); tv_error_tips = (TextView) findViewById(R.id.error_tips); ll_error_layout = (LinearLayout) findViewById(R.id.error_layout); <API key> = (RelativeLayout) findViewById(R.id.layout_progressbar); MyOnClickListener onClickListener = new MyOnClickListener(); iv_user_icon.setOnClickListener(onClickListener); btn_sign.setOnClickListener(onClickListener); <API key> <API key> = new <API key>(); et_account.<API key>(<API key>); et_nickname.<API key>(<API key>); et_password.<API key>(<API key>); et_conferm_password.<API key>(<API key>); MyTextWatcher textWatcher = new MyTextWatcher(); et_account.<API key>(textWatcher); et_nickname.<API key>(textWatcher); et_password.<API key>(textWatcher); et_conferm_password.<API key>(textWatcher); } private void setToolbar(){ LogUtil.d(CLASS_NAME+""); Toolbar toorbar = (Toolbar) findViewById(R.id.toorbar); toorbar.setTitle(""); setSupportActionBar(toorbar); ActionBar actionBar = getSupportActionBar(); actionBar.<API key>(true); //idandroid.R.id.home actionBar.<API key>(R.drawable.back); } private class MyOnClickListener implements View.OnClickListener{ @Override public void onClick(View view) { switch (view.getId()){ case R.id.sign: sign(); break; case R.id.user_icon: if(ContextCompat.checkSelfPermission(UiSign.this, Manifest.permission.<API key>) != PackageManager.PERMISSION_GRANTED){ ActivityCompat.requestPermissions(UiSign.this,new String[]{Manifest.permission.<API key>},CHOOSE_ICON); LogUtil.d(""); }else { openAlbum(); } break; } } } public void openAlbum(){ Intent intent = new Intent("android.intent.action.GET_CONTENT"); private class <API key> implements View.<API key>{ @Override public void onFocusChange(View view, boolean b) { if (!b) { checkUserInfo(view); } } } private class MyTextWatcher implements TextWatcher{ @Override public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { closeWarn(); } @Override public void onTextChanged(CharSequence charSequence, int i ,int i1, int i2) { if(et_account.isFocused()){ iv_account_ok.setVisibility(View.GONE); account_tag = false; }else if(et_password.isFocused()){ iv_password_ok.setVisibility(View.GONE); <API key>.setVisibility(View.GONE); password_tag = false; }else if(et_nickname.isFocused()){ iv_nickname_ok.setVisibility(View.GONE); nickName_tag = false; } } @Override public void afterTextChanged(Editable editable) { if(et_conferm_password.isFocused()){ checkConfirmPass(); } } } /** * * @param view */ private void checkUserInfo(View view) { switch (view.getId()){ case R.id.account: checkAccount(); break; case R.id.nickname: checkNickName(); break; case R.id.password: checkPassword(); break; } } public void checkAccount(){ account = et_account.getText().toString().trim(); if(account.equals("")){ account_tag = false; return; } if(account_tag=AppUtil.checkAccount(account)){ LogUtil.d(CLASS_NAME+""); doAsyncTask(C.task.checkAccount,C.api.checkAccount,0); }else { showWarn(iv_account_ok,""); } } private void checkNickName(){ nickName = et_nickname.getText().toString().trim(); if(nickName.equals("")){ nickName_tag = false; return; } if(nickName_tag = AppUtil.checkNickName(nickName)){ LogUtil.d(CLASS_NAME+""); doAsyncTask(C.task.checkNickName,C.api.checkNickName,0); }else{ showWarn(iv_nickname_ok,""); } } private void checkPassword(){ password = et_password.getText().toString().trim(); if(password.equals("")){ password_tag = false; return; } if(password_tag = AppUtil.checkPassword(password)){ showOk(iv_password_ok); }else{ showWarn(iv_password_ok,""); } } private void checkConfirmPass(){ confirm_<API key>.getText().toString().trim(); if(confirm_password.equals("")){ <API key> = false; <API key>.setVisibility(View.GONE); return; } if(!password_tag){ showWarn(iv_password_ok,""); return; } if(password.equals(confirm_password)){ <API key> = true; showOk(<API key>); LogUtil.d(CLASS_NAME+""); }else { <API key>.setImageResource(R.drawable.error); <API key>.setVisibility(View.VISIBLE); <API key> = false; LogUtil.d(CLASS_NAME+""); } } /** * * @return truefalse */ private boolean checkInfoAgain() { account = et_account.getText().toString().trim(); if(account.equals("")){ showWarn(iv_account_ok,""); return false; } account_tag = AppUtil.checkAccount(account); if (!account_tag) { showWarn(iv_account_ok,""); return false; } nickName = et_nickname.getText().toString().trim(); if(nickName.equals("")){ showWarn(iv_account_ok,""); return false; } nickName_tag = AppUtil.checkNickName(nickName); if(!nickName_tag){ showWarn(iv_nickname_ok,""); return false; } password = et_password.getText().toString().trim(); if(password.equals("")){ showWarn(iv_password_ok,""); return false; } checkPassword(); if(!password_tag){ return false; }else{ confirm_<API key>.getText().toString().trim(); if(confirm_password.equals("")){ showWarn(iv_account_ok,""); return false; } checkConfirmPass(); if(!<API key>){ showWarn(<API key>,""); return false; } } return true; } private void sign() { if (NetworkUtil.getNetworkState(this) == NetworkUtil.TYPE.NONE) { toast(""); return; } if (!checkInfoAgain()){ return; } HashMap<String, String> params = new HashMap<>(); params.put("account_normal", account); params.put("nickName", nickName); params.put("password", password); if(TextUtils.isEmpty(imagePath)) { doAsyncTask(C.task.sign, C.api.sign, params, 0); }else{ ArrayList<NameValuePair> files = new ArrayList<>(); files.add(new BasicNameValuePair("icon", imagePath)); doAsyncTask(C.task.sign, C.api.sign, params,files, 0); LogUtil.d(CLASS_NAME + ""); } <API key>.setVisibility(View.VISIBLE); } @Override public void onCompleteTask(int taskId, BaseMessage message) { LogUtil.d(CLASS_NAME+""); <API key>.setVisibility(View.GONE); UniversalModel model = null; try { model = (UniversalModel) message.getResult(BaseModel.UNIVERSAL_MODEL); } catch (Exception e) { toast(""); LogUtil.d(CLASS_NAME+e.getMessage()); } switch (taskId) { case C.task.checkAccount: if (model.getStatus().equals(UniversalModel.SUCCEED)) { showOk(iv_account_ok); account_tag = true; LogUtil.d(CLASS_NAME + ""); } else { account_tag = false; showWarn(iv_account_ok, ""); LogUtil.d(CLASS_NAME + ""); } break; case C.task.checkNickName: if (model.getStatus().equals(UniversalModel.SUCCEED)) { showOk(iv_nickname_ok); nickName_tag = true; LogUtil.d(CLASS_NAME + ""); } else { nickName_tag = false; showWarn(iv_nickname_ok, ""); LogUtil.d(CLASS_NAME + ""); } break; case C.task.sign: if (model.getStatus().equals(UniversalModel.SUCCEED)) { LogUtil.d(CLASS_NAME + ""); toast(""); LogUtil.d(CLASS_NAME + ""); forward(UiLogin.class); } else { LogUtil.d(CLASS_NAME + ""); showWarn(iv_account_ok, message.getMessage()); } } } @Override public void onNetworkError(int taskId, String errorInfo) { LogUtil.d(CLASS_NAME+errorInfo); <API key>.setVisibility(View.GONE); if(taskId == C.task.sign){ toast(errorInfo); } } /** * * @param imageView * @param warn // */ private void showWarn(ImageView imageView,String warn){ tv_error_tips.setText(warn); imageView.setVisibility(View.VISIBLE); imageView.setImageResource(R.drawable.error); ll_error_layout.setVisibility(View.VISIBLE); } private void showOk(ImageView imageView){ imageView.setImageResource(R.drawable.ok); imageView.setVisibility(View.VISIBLE); } private void closeWarn(){ ll_error_layout.setVisibility(View.GONE); } @Override public void <API key>(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { if(requestCode == CHOOSE_ICON){ if(grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED){ LogUtil.d(""); openAlbum(); }else{ LogUtil.d(""); Toast.makeText(UiSign.this,"",Toast.LENGTH_LONG).show(); } } } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if(resultCode == RESULT_OK){ if(requestCode == CHOOSE_ICON){ LogUtil.d(CLASS_NAME+""); imagePath = SDUtil.chooseImage(UiSign.this,data); if(!TextUtils.isEmpty(imagePath)){ BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; BitmapFactory.decodeFile(imagePath,options); options.inSampleSize = SDUtil.getSampleRatio(options.outWidth,options.outHeight, Picture.CONTACT_ICON_WIDTH,Picture.CONTACT_ICON_HEIGHT); options.inJustDecodeBounds = false; Bitmap bitmap = BitmapFactory.decodeFile(imagePath,options); iv_user_icon.setImageBitmap(bitmap); LogUtil.d(CLASS_NAME+""); }else{ toast(""); LogUtil.d(CLASS_NAME+""); } } } } }
<!doctype html> <html lang="pt-BR"> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta charset="utf-8"> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css"> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> <title>Sign In</title> </head> <body> <div class="container" style="margin-top: 10%;"> <div class="row"> <div class="col-md-4 col-md-offset-4"> <div class="login-panel panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">Please Sign In</h3> </div> <div class="panel-body"> <form method="post" action="/api/oauth2/login" role="form"> <fieldset> <div class="form-group"> <input class="form-control" placeholder="Username" name="username" type="text" required autofocus> </div> <div class="form-group"> <input class="form-control" placeholder="Password" name="password" type="password" value=""> </div> <div class="checkbox"> <label> <input name="remember" type="checkbox" value="Remember Me">Remember Me </label> </div> <input class="btn btn-lg btn-success btn-block" type="submit" value="Login"> </fieldset> </form> </div> </div> </div> </div> </div> </body> </html>
package com.dmart.objectnosql; import java.lang.reflect.Type; public interface ISerializer { String serialize(Object obj, Type type); Object deserialize(String json, Type type); }
package org.axway.grapes.server.reports.models; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.*; import java.util.stream.Collectors; public class ReportExecution { private static final Logger LOG = LoggerFactory.getLogger(ReportExecution.class); private ReportRequest request; private int sortingColumn = 0; private Comparator<String> comparator; public String[] <API key>() { return resultColumnNames; } private String[] resultColumnNames; private List<String[]> tabularData; public ReportExecution(final ReportRequest request, final String[] colNames) { this.request = request; this.resultColumnNames = colNames; tabularData = new ArrayList<>(); } public void setSorting(int index, Comparator<String> comparator) { if(index >= resultColumnNames.length) { throw new <API key>("Invalid sorting column"); } this.sortingColumn = index; this.comparator = comparator; } public ReportRequest getRequest() { return request; } public List<String[]> getData() { sortByColumn(sortingColumn); return Collections.unmodifiableList(tabularData); } public void addResultRow(String[] row) { if(row.length < resultColumnNames.length) { LOG.warn(String.format("Required column count: %s, got: %s", resultColumnNames.length, row.length)); throw new <API key>("Invalid row data"); } tabularData.add(row); } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ReportExecution that = (ReportExecution) o; if (request != null ? !request.equals(that.request) : that.request != null) return false; // Probably incorrect - comparing Object[] arrays with Arrays.equals if (!Arrays.equals(resultColumnNames, that.resultColumnNames)) return false; if(tabularData != null && that.tabularData != null) { return tabularDataEquals(tabularData, that.tabularData); } return (tabularData == null && that.tabularData == null); } private boolean tabularDataEquals(List<String[]> t1, List<String[]> t2) { if(t1.size() != t2.size()) return false; final List<String> c1 = t1.stream().map(strArray -> StringUtils.join(strArray, ',')).collect(Collectors.toList()); final List<String> c2 = t2.stream().map(strArray -> StringUtils.join(strArray, ',')).collect(Collectors.toList()); c1.removeAll(c2); return c1.isEmpty(); } @Override public int hashCode() { int result = request != null ? request.hashCode() : 0; result = 31 * result + Arrays.hashCode(resultColumnNames); result = 31 * result + (tabularData != null ? tabularData.hashCode() : 0); return result; } private void sortByColumn(int index) { if(null != comparator) { tabularData.sort((r1, r2) -> comparator.compare(r1[index], r2[index])); } else { tabularData.sort(Comparator.comparing(t -> t[index])); } } }
package no.digipost.api.exceptions; import org.springframework.ws.soap.SoapBody; import org.springframework.ws.soap.SoapFault; import org.springframework.ws.soap.SoapMessage; public class <API key> extends <API key> { private final SoapMessage soapMessage; private final SoapFault soapFault; public <API key>(final SoapMessage soapMessage) { super(soapMessage.getFaultReason()); this.soapMessage = soapMessage; this.soapFault = getSoapFault(soapMessage); } protected <API key>(final String message, final SoapMessage soapMessage) { super(message); this.soapMessage = soapMessage; this.soapFault = getSoapFault(soapMessage); } private SoapFault getSoapFault(final SoapMessage soapMessage) { SoapBody body = soapMessage.getSoapBody(); return body != null ? body.getFault() : null; } public SoapMessage getSoapMessage() { return this.soapMessage; } public SoapFault getSoapFault() { return this.soapFault; } }
<?php class MailEventObserver implements <API key> { private $Mailer; private $Config; public $ObserverName = 'Mail'; function __construct() { $this->Mailer = Core::<API key>(); $this->Mailer->From = CONFIG::$EMAIL_ADDRESS; $this->Mailer->FromName = CONFIG::$EMAIL_NAME; } public function SetConfig($config) { $this->Config = $config; $this->Mailer->ClearAddresses(); $this->Mailer->AddAddress($this->Config->GetFieldByName("EventMailTo")->Value); } public static function <API key>() { $ConfigurationForm = new DataForm(); $ConfigurationForm->SetInlineHelp(""); $ConfigurationForm->AppendField( new DataFormField("IsEnabled", FORM_FIELD_TYPE::CHECKBOX, "Enabled")); $ConfigurationForm->AppendField( new DataFormField("EventMailTo", FORM_FIELD_TYPE::TEXT, "E-mail")); $ReflectionInterface = new ReflectionClass("IEventObserver"); $events = $ReflectionInterface->getMethods(); $ConfigurationForm->AppendField(new DataFormField("", FORM_FIELD_TYPE::SEPARATOR, "Notify about following events")); foreach ($events as $event) { $name = substr($event->getName(), 2); $ConfigurationForm->AppendField( new DataFormField( "{$event->getName()}Notify", FORM_FIELD_TYPE::CHECKBOX, "{$name}", false, array(), null, null, EVENT_TYPE::GetEventDescription($name) ) ); } return $ConfigurationForm; } public function __call($method, $args) { // If observer enabled if (!$this->Config || $this->Config->GetFieldByName("IsEnabled")->Value == 0) return; $enabled = $this->Config->GetFieldByName("{$method}Notify"); if (!$enabled || $enabled->Value == 0) return; $DB = Core::GetDBInstance(); // Event name $name = substr($method, 2); // Event message $message = $DB->GetOne("SELECT message FROM events WHERE event_id = ?", array($args[0]->GetEventID())); $farm_name = $DB->GetOne("SELECT name FROM farms WHERE id=?", array($args[0]->GetFarmID())); // Set subject if (!$farm_name) $this->Mailer->Subject = "{$name} event notification (FarmID: {$args[0]->GetFarmID()})"; else $this->Mailer->Subject = "{$name} event notification (FarmID: {$args[0]->GetFarmID()} FarmName: {$farm_name})"; // Set body $this->Mailer->Body = $message; // Send mail $res = $this->Mailer->Send(); if (!$res) Logger::getLogger(__CLASS__)->fatal("Mail sent to '{$this->Config->GetFieldByName("EventMailTo")->Value}'. Result: {$res}"); } } ?>
'use strict'; var moment = require("moment"); var pipesSDK = require('<API key>'); var pipesDb = pipesSDK.pipesDb; var _ = require("lodash"); var global = require("<API key>").global; /** * PipeRunStats class * encapsulate the stats for a particular run */ function pipeRunStats(pipe, steps, callback){ this.pipe = pipe; var logger = this.logger = global.getLogger("pipesRun"); var runDoc = this.runDoc = { type : "run", connectorId : pipe.connectorId, startTime : moment(), pipeId: pipe._id, status: "NOT_STARTED", error: null, tableStats : {}, message:"" }; for ( var i = 0; i < steps.length; i++ ){ //Assign a space for this step steps[i].stats = { label: steps[i].label, status: "NOT_STARTED", error: "" }; runDoc["step" + i] = steps[i].stats; } var save = this.save = function(callback, outerError){ //Create a new run doc and associate it with this pipe pipesDb.saveRun( pipe, runDoc, function( err, runDocument ){ if ( err ){ console.log("Unable to save run information: " + err ); return callback && callback( err ); } //Replace with the latest doc from db runDoc = runDocument; broadcastRunEvent(); return callback && callback( outerError ); }); } var broadcastRunEvent = this.broadcastRunEvent = function(event){ global.emit("runEvent", global.currentRun && global.currentRun.runDoc ); } //Initial save save( callback ); //Public apis this.getId = function(){ return runDoc._id; } this.getPipe = function(){ return this.pipe; } this.setMessage = function( message ){ runDoc.message = message || ""; broadcastRunEvent(); } this.getTableStats = function(){ return runDoc.tableStats; } this.addTableStats = function( stats ){ if ( runDoc.tableStats.hasOwnProperty( stats.tableName )){ //Merge the two objects _.assign( runDoc.tableStats[stats.tableName], stats ); }else{ runDoc.tableStats[stats.tableName] = stats; } //Save the document save(); } /** * start: Called when a run is about to start */ this.start = function( callback ){ logger.info("Starting a new run"); //Set the current run to this if ( global.currentRun ){ // i63 var msg = require("util").format("A run is already in progress %s", global.currentRun._id ); logger.error( msg ); return callback( msg ); } global.currentRun = this; broadcastRunEvent(); runDoc.startTime = moment(); runDoc.status = "RUNNING"; //Add the run id to the pipe to signify that it is running if ( pipe.run !== runDoc._id ){ pipesDb.upsert( pipe._id, function( storedPipe ){ storedPipe.run = runDoc._id; pipe = storedPipe; return storedPipe; }, function( err ){ logger.error( err ); return callback( err ); }); }else{ return callback(); } } /** * done: called when a run is completed */ this.done = function(err ){ global.currentRun = null; if ( err ){ logger.error( err ); if ( err.stack ){ logger.error( err.stack ); } runDoc.status = "ERROR"; runDoc.message = "" + err; }else{ runDoc.status = "FINISHED"; runDoc.message = "Pipe run completed"; // steps might have produced warnings, hence a completed run is not always a successful run } runDoc.endTime = moment(); runDoc.elapsedTime = moment.duration( runDoc.endTime.diff( runDoc.startTime ) ).humanize(); //compute the number of records processed runDoc.numRecords = 0; _.forEach( runDoc.tableStats, function( value, key){ if ( value && value.numRecords ){ runDoc.numRecords += value.numRecords; } }) logger.info( runDoc.message ); //Save the document save(); //Remove the run from the pipe pipesDb.upsert( pipe._id, function( storedPipe ){ if ( storedPipe && storedPipe.hasOwnProperty("run") ){ delete storedPipe["run"]; } return storedPipe; }, function( err ){ if ( err ){ logger.error("Unable to remove reference to run in pipe %s. Error is %s ", pipe._id, err ); } logger.info({ message: "Pipe run completed", runDoc: runDoc }); //Save the log file as an attachment to the run pipesDb.attachLogFileToRun( logger.logPath, runDoc, function(err){ if ( err ){ logger.error("Unable to attach log file %s to run document %s : %s", logger.logPath, runDoc._id, err ); } }); }); broadcastRunEvent(); } } module.exports = pipeRunStats;
# todo: self.instances and self.prefetch not yet implemented. # Currently this provider compares the MD5 hash of the S3 and the local file system file, if that comparison returns # false then the S3 object is pulled and written to the :path on the filesystem. # Example: # s3 { '/path/to/my/filesystem': # ensure => present, # source => '/bucket/path/to/object', # access_key_id => 'mysecret', # secret_access_key => 'anothersecret', # region => 'us-west-1', # Defaults to us-east-1 require 'rubygems' if Puppet.features.rubygems? require 'aws-sdk' if Puppet.features.awssdk? require 'digest' require 'tempfile' Puppet::Type.type(:s3).provide(:s3) do confine :feature => :awssdk confine :feature => :rubygems desc "Securely get shit out of S3. Note this provider requires Version 2 of the aws-sdk. Ensure that v2 is installed." def create Puppet.info('Connecting to AWS S3') # TODO set it up to work even if you don't provide access and secret keys (automatic credintial lookup on ec2 or ~/.aws/credentials ? s3 = Aws::S3::Client.new( :access_key_id => resource[:access_key_id], :secret_access_key => resource[:secret_access_key], :region => resource[:region] || 'us-east-1', ) # Get the name of the bucket and path to the object: source_ary = resource[:source].chomp.split('/') source_ary.shift # Remove prefixed white space bucket = source_ary.shift key = File.join(source_ary) Puppet.info("Pulling bucket: #{bucket}, key: #{key}") # Handle new S3 object resp = s3.get_object( response_target: resource[:path], bucket: bucket, key: key, ) # Create a .etag file when we've downloaded an artifact IO.write(resource[:path]+'.etag', resp.etag) #TODO any kind of exception handling required? end def destroy File.delete(resource[:path]+'.etag') if File.exists?(resource[:path]+'.etag') File.delete(resource[:path]) if File.exists?(resource[:path]) end # TODO Add condition where the ETag isn't cached, but the head_object has # an ETag that is an MD5 (aka, does not match /-\d$/ def exists? # Create a new S3 client object s3 = Aws::S3::Client.new( :access_key_id => resource[:access_key_id], :secret_access_key => resource[:secret_access_key], :region => resource[:region] || 'us-east-1', ) # Do all the same stuff I did for create source_ary = resource[:source].chomp.split('/') source_ary.shift # Remove prefixed white space bucket = source_ary.shift key = File.join(source_ary) if File.exists?(resource[:path] + '.etag') # Read in the cached etag for the file cached_etag = IO.read(resource[:path] + '.etag') # Fetch the current metadata for the file resp = s3.head_object( bucket: bucket, key: key, ) fresh_etag = resp.etag # Compare the current metadata's etag with the cached etag if cached_etag == fresh_etag true else false end # No etag cached file exists, redownload the file and compare MD5 elsif File.exists?(resource[:path]) # Setup a temp file to compare against temp_file = Tempfile.new(resource[:path]) Puppet.info('Setting new S3 object and downloading...') # Grab the object and point it at temp_file resp = s3.get_object( response_target: temp_file, bucket: bucket, key: key, ) # Compare the MD5 hashes, return true or false temp_file_md5 = Digest::MD5.file(temp_file).hexdigest actual_file_md5 = Digest::MD5.file(resource[:path]).hexdigest if temp_file_md5 == actual_file_md5 true else false end end end end
package com.twu.biblioteca.commands; public class CommandListBook extends Command { private volatile static CommandListBook listBookCommand; private CommandListBook(String name) { this.name = name; } public static CommandListBook getInstance() { if(listBookCommand == null) { synchronized (CommandListBook.class) { if(listBookCommand == null) { listBookCommand = new CommandListBook("List Books"); } } } return listBookCommand; } @Override public boolean execute() { try { commandExecutor.printBookList(); } catch (Exception e ) { e.printStackTrace(); return false; } return true; } }
package jp.troter.servlet.httpsession.spi.memcached; import java.util.Enumeration; import java.util.HashMap; import java.util.Map; import java.util.concurrent.TimeoutException; import jp.troter.servlet.httpsession.spi.memcached.initializer.<API key>; import jp.troter.servlet.httpsession.spi.support.<API key>; import jp.troter.servlet.httpsession.state.SessionState; import net.rubyeye.xmemcached.exception.MemcachedException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class <API key> extends <API key> { private static Logger log = LoggerFactory.getLogger(<API key>.class); protected <API key> initializer; @Override public SessionState loadState(String sessionId) { Throwable exception = null; try { Object obj = getInitializer().getMemcachedClient().get(key(sessionId)); if (obj != null) { return <API key>((Cell) obj); } } catch (<API key> e) { log.warn("Interrupt occurred at get method. session_id=" + sessionId, e); exception = e; } catch (MemcachedException e) { log.warn("Memcached exception occurred at get method. session_id=" + sessionId, e); exception = e; } catch (TimeoutException e) { log.warn("Timeout occurred at get method. session_id=" + sessionId, e); exception = e; } if (exception != null) { removeState(sessionId); if (isThrowException()) { throw new RuntimeException(exception); } } return <API key>(); } @Override public void saveState(String sessionId, SessionState sessionState) { Cell cell = storedSessionState(sessionState); Throwable exception = null; try { getInitializer().getMemcachedClient().set(key(sessionId), cell.<API key>(), cell); } catch (<API key> e) { log.warn("Interrupt occurred at set method. session_id=" + sessionId, e); exception = e; } catch (MemcachedException e) { log.warn("Memcached exception occurred at set method. session_id=" + sessionId, e); exception = e; } catch (TimeoutException e) { log.warn("Timeout occurred at set method. session_id=" + sessionId, e); exception = e; } if (exception != null) { if (isThrowException()) { throw new RuntimeException(exception); } } } @Override public void removeState(String sessionId) { Throwable exception = null; try { getInitializer().getMemcachedClient().delete(key(sessionId)); } catch (<API key> e) { log.warn("Interrupt occurred at delete method. session_id=" + sessionId, e); exception = e; } catch (MemcachedException e) { log.warn("Memcached exception occurred at delete method. session_id=" + sessionId, e); exception = e; } catch (TimeoutException e) { log.warn("Timeout occurred at delete method. session_id=" + sessionId, e); exception = e; } if (exception != null) { if (isThrowException()) { throw new RuntimeException(exception); } } } protected SessionState <API key>(Cell cell) { int maxInactiveInterval = cell.<API key>(); long lastAccessedTime = cell.getLastAccessedTime(); if (lastAccessedTime > getTimeoutTime(maxInactiveInterval)) { return <API key>(); } return newSessionState(cell.getAttributes(), lastAccessedTime, false, maxInactiveInterval); } protected Cell storedSessionState(SessionState sessionState) { Map<String, Object> attributes = new HashMap<String, Object>(); for (Enumeration<?> e = sessionState.getAttributeNames(); e.hasMoreElements();) { String name = (String)e.nextElement(); Object value = sessionState.getAttribute(name); if (value == null) { continue; } attributes.put(name, value); } return new Cell(attributes, sessionState.getCreationTime(), sessionState.<API key>()); } protected String key(String sessionId) { return getNameSpace() + "/" + sessionId; } protected <API key> getInitializer() { if (initializer == null) { initializer = <API key>.newInstance(); } return initializer; } }
var jiraOptions = { project : "", base : "" }
class Solution: def convertToTitle(self, n): """ :type n: int :rtype: str """ ret = '' while n / 26 > 1: temp = n % 26 n = n print(n) print(temp) if temp == 0: temp = 26 n -= 1 ret = chr(temp+64)+ret ret = chr(n+64)+ret return ret
package com.fska.swarm.screens; import com.badlogic.gdx.Game; import com.badlogic.gdx.Screen; import com.badlogic.gdx.utils.IntMap; public final class ScreenManager { private static ScreenManager instance; private Game game; private IntMap<Screen> screens; public ScreenManager(){ screens = new IntMap<Screen>(); } public static ScreenManager getInstance(){ if(instance == null){ instance = new ScreenManager(); } return instance; } public void initialize(Game game){ this.game = game; } public void show(SwarmScreen screen){ if(this.game == null) return; if(!screens.containsKey(screen.ordinal())){ screens.put(screen.ordinal(), screen.getScreenInstance()); } game.setScreen(screens.get(screen.ordinal())); } public void dispose(SwarmScreen screen){ if(!screens.containsKey(screen.ordinal())) return; screens.remove(screen.ordinal()).dispose(); } public void dispose(){ for(Screen screen : screens.values()){ screen.dispose(); } screens.clear(); instance = null; } }
package org.enner.flatbuffers.test; import org.enner.flatbuffers.Struct; import java.nio.ByteBuffer; import static org.enner.flatbuffers.Primitives.*; import static org.enner.flatbuffers.Utilities.*; /** * Struct for unit and syntax tests for the various possible * combinations. This is the manually written representation * of what the code generated for a struct should look like. * <p/> * Some types have been omitted because they are already being * tested by the table test class. * <p/> * Primitive types * - x: float * - y: float * - z: float * <p/> * Complex types * - Errors: vector of bytes * * @author Florian Enner < florian @ hebirobotics.com > * @since 10 Jan 2015 */ public class Position extends Struct { public float getX() { return getFloat(getBuffer(), getAddress() + X_OFFSET, 0); } public float getY() { return getFloat(getBuffer(), getAddress() + Y_OFFSET, 0); } public float getZ() { return getFloat(getBuffer(), getAddress() + Z_OFFSET, 0); } public Position setX(float value) { setFloat(getBuffer(), getAddress() + X_OFFSET, value); return this; } public Position setY(float value) { setFloat(getBuffer(), getAddress() + Y_OFFSET, value); return this; } public Position setZ(float value) { setFloat(getBuffer(), getAddress() + Z_OFFSET, value); return this; } public Position setAll(float x, float y, float z) { return setX(x).setY(y).setZ(z); } public static Position withBuffer(ByteBuffer buffer) { checkNotNull(buffer); Position position = new Position(); position.setBuffer(buffer); position.setAddress(NULL); return position; } private Position() { } @Override public int size() { return SIZEOF; } static int X_OFFSET = 0; static int Y_OFFSET = X_OFFSET + SIZEOF_FLOAT; static int Z_OFFSET = Y_OFFSET + SIZEOF_FLOAT; public static int SIZEOF = Z_OFFSET + SIZEOF_FLOAT; }
package org.pjay; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class <API key> { @Test public void contextLoads() { } }
#!/usr/bin/python import json import subprocess import unicodedata def execute(cmd): p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE) p.wait() return (p.stdout.readlines(), p.returncode) def runcmd(cmd): obj = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) (stdout, stderr) = obj.communicate() returncode = obj.returncode return stdout def get_patchset_info(review): out, exit = execute('ssh -i ~/.ssh/id_gerrit review.openstack.org gerrit ' 'query %s --patch-sets --format JSON' % review) data = json.loads(out[0]) return data def Normalize(value): normalized = unicodedata.normalize('NFKD', unicode(value)) normalized = normalized.encode('ascii', 'replace') normalized.replace('\r', '') normalized.replace('\n', ' ') return str(normalized)
/** * <API key>.java * * This file was auto-generated from WSDL * by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter. */ package com.google.api.ads.dfp.axis.v201511; /** * This represents an entry in a map with a key of type ConversionEvent * and value of type TrackingUrls. */ public class <API key> implements java.io.Serializable { private com.google.api.ads.dfp.axis.v201511.ConversionEvent key; private com.google.api.ads.dfp.axis.v201511.TrackingUrls value; public <API key>() { } public <API key>( com.google.api.ads.dfp.axis.v201511.ConversionEvent key, com.google.api.ads.dfp.axis.v201511.TrackingUrls value) { this.key = key; this.value = value; } /** * Gets the key value for this <API key>. * * @return key */ public com.google.api.ads.dfp.axis.v201511.ConversionEvent getKey() { return key; } /** * Sets the key value for this <API key>. * * @param key */ public void setKey(com.google.api.ads.dfp.axis.v201511.ConversionEvent key) { this.key = key; } /** * Gets the value value for this <API key>. * * @return value */ public com.google.api.ads.dfp.axis.v201511.TrackingUrls getValue() { return value; } /** * Sets the value value for this <API key>. * * @param value */ public void setValue(com.google.api.ads.dfp.axis.v201511.TrackingUrls value) { this.value = value; } private java.lang.Object __equalsCalc = null; public synchronized boolean equals(java.lang.Object obj) { if (!(obj instanceof <API key>)) return false; <API key> other = (<API key>) obj; if (obj == null) return false; if (this == obj) return true; if (__equalsCalc != null) { return (__equalsCalc == obj); } __equalsCalc = obj; boolean _equals; _equals = true && ((this.key==null && other.getKey()==null) || (this.key!=null && this.key.equals(other.getKey()))) && ((this.value==null && other.getValue()==null) || (this.value!=null && this.value.equals(other.getValue()))); __equalsCalc = null; return _equals; } private boolean __hashCodeCalc = false; public synchronized int hashCode() { if (__hashCodeCalc) { return 0; } __hashCodeCalc = true; int _hashCode = 1; if (getKey() != null) { _hashCode += getKey().hashCode(); } if (getValue() != null) { _hashCode += getValue().hashCode(); } __hashCodeCalc = false; return _hashCode; } // Type metadata private static org.apache.axis.description.TypeDesc typeDesc = new org.apache.axis.description.TypeDesc(<API key>.class, true); static { typeDesc.setXmlType(new javax.xml.namespace.QName("https: org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("key"); elemField.setXmlName(new javax.xml.namespace.QName("https: elemField.setXmlType(new javax.xml.namespace.QName("https: elemField.setMinOccurs(0); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); elemField = new org.apache.axis.description.ElementDesc(); elemField.setFieldName("value"); elemField.setXmlName(new javax.xml.namespace.QName("https: elemField.setXmlType(new javax.xml.namespace.QName("https: elemField.setMinOccurs(0); elemField.setNillable(false); typeDesc.addFieldDesc(elemField); } /** * Return type metadata object */ public static org.apache.axis.description.TypeDesc getTypeDesc() { return typeDesc; } /** * Get Custom Serializer */ public static org.apache.axis.encoding.Serializer getSerializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanSerializer( _javaType, _xmlType, typeDesc); } /** * Get Custom Deserializer */ public static org.apache.axis.encoding.Deserializer getDeserializer( java.lang.String mechType, java.lang.Class _javaType, javax.xml.namespace.QName _xmlType) { return new org.apache.axis.encoding.ser.BeanDeserializer( _javaType, _xmlType, typeDesc); } }
package com.cdc.androidsamples.widget.entity; /** * @author Charlie Zheng on 2017/5/6. */ public class MyHistogramEntity { private String keyName; private float blueValue; private float blueValuePercent; private float averageValue; private float highestValue; private int rank; public MyHistogramEntity(String keyName, float blueValue, float blueValuePercent, float averageValue, float highestValue, int rank) { this.keyName = keyName; this.blueValue = blueValue; this.blueValuePercent = blueValuePercent; this.averageValue = averageValue; this.highestValue = highestValue; this.rank = rank; } public String getKeyName() { return keyName; } public void setKeyName(String keyName) { this.keyName = keyName; } public float getBlueValue() { return blueValue; } public void setBlueValue(float blueValue) { this.blueValue = blueValue; } public float getBlueValuePercent() { return blueValuePercent; } public void setBlueValuePercent(float blueValuePercent) { this.blueValuePercent = blueValuePercent; } public float getAverageValue() { return averageValue; } public void setAverageValue(float averageValue) { this.averageValue = averageValue; } public float getHighestValue() { return highestValue; } public void setHighestValue(float highestValue) { this.highestValue = highestValue; } public int getRank() { return rank; } public void setRank(int rank) { this.rank = rank; } }
#!/usr/bin/env bash # Script to start hazelcast on docker # Here we eval if some variables exists on the environment if they dont then we set them MIN_HEAP=${MIN_HEAP:=1G} MAX_HEAP=${MAX_HEAP:=1G} GROUP_NAME=${GROUP_NAME=dev} GROUP_PASS=${GROUP_PASS=devpass} # Add docker gateway by default for the case of cassandra running in localhost CASSANDRA_HOST=${CASSANDRA_HOST=172.17.42.1} java -Xms$MIN_HEAP -Xmx$MAX_HEAP -Djava.net.preferIPv4Stack=true -cp "/opt/hazelcast/<API key>.<API key>.jar:/opt/hazelcast/" InstanceStart $GROUP_NAME $GROUP_PASS $CASSANDRA_HOST
'use strict'; var express = require('express'); var conf = require('./conf'); var request = require('request'); var url = require('url'); module.exports = function reportsMiddleware () { var app = express(); app.get('/:name', function (req, res) { var token = req.user.doc.tokens[0]; var phantomUrl = url.parse(conf.phantom.url); phantomUrl.pathname = '/' + req.params.name; phantomUrl.query = req.query; // send request to Phantom request.get(url.format(phantomUrl), { auth: { bearer: token } }).pipe(res); }); return app; };
/* eslint-disable i18next/no-literal-string */ import {css, cx} from "@emotion/css" import {WindowContentProps} from "@touk/window-manager" import _ from "lodash" import React from "react" import {connect} from "react-redux" import {formatAbsolutely} from "../../common/DateUtils" import * as JsonUtils from "../../common/JsonUtils" import HttpService from "../../http/HttpService" import {getProcessId, getProcessVersionId, getVersions} from "../../reducers/selectors/graph" import {<API key>} from "../../reducers/selectors/settings" import "../../stylesheets/visualization.styl" import {WindowContent} from "../../windowManager" import EdgeDetailsContent from "../graph/node-modal/edge/EdgeDetailsContent" import NodeDetailsContent from "../graph/node-modal/NodeDetailsContent" import {ProcessVersionType} from "../Process/types" import {SelectWithFocus} from "../withFocus" interface State { currentDiffId: string, otherVersion: string, remoteVersions: ProcessVersionType[], difference: unknown, } //TODO: handle different textarea heights class VersionsForm extends React.Component<Props, State> { //TODO: better way of detecting remote version? also: how to sort versions?? remotePrefix = "remote-" initState: State = { otherVersion: null, currentDiffId: null, difference: null, remoteVersions: [], } state = this.initState isLayoutChangeOnly(diffId: string): boolean { const {type, currentNode, otherNode} = this.state.difference[diffId] if (type === "NodeDifferent") { return this.<API key>(currentNode, otherNode).every(path => path.startsWith("additionalFields.layoutData")) } } componentDidMount() { if (this.props.processId && this.props.otherEnvironment) { HttpService.fetchRemoteVersions(this.props.processId).then(response => this.setState({remoteVersions: response.data || []})) } } loadVersion(versionId: string) { if (versionId) { HttpService.compareProcesses( this.props.processId, this.props.version, this.versionToPass(versionId), this.isRemote(versionId), ).then( (response) => this.setState({difference: response.data, otherVersion: versionId, currentDiffId: null}), ) } else { this.setState(this.initState) } } isRemote(versionId: string) { return versionId.startsWith(this.remotePrefix) } versionToPass(versionId: string) { return versionId.replace(this.remotePrefix, "") } <API key>(versionId: string) { return this.isRemote(versionId) ? `${this.versionToPass(versionId)} on ${this.props.otherEnvironment}` : versionId } <API key>(version: ProcessVersionType, versionPrefix = "") { const versionId = versionPrefix + version.processVersionId return ( <option key={versionId} value={versionId}> {this.<API key>(versionId)} - created by {version.user} &nbsp; {formatAbsolutely(version.createDate)}</option> ) } render() { return ( <> <div className="esp-form-row"> <p>Version to compare</p> <SelectWithFocus autoFocus={true} id="otherVersion" className="node-input" value={this.state.otherVersion || ""} onChange={(e) => this.loadVersion(e.target.value)} > <option key="" value=""/> {this.props.versions.filter(version => this.props.version !== version.processVersionId) .map(version => this.<API key>(version))} {this.state.remoteVersions.map(version => this.<API key>(version, this.remotePrefix))} </SelectWithFocus> </div> { this.state.otherVersion ? ( <div> <div className="esp-form-row"> <p>Difference to pick</p> <SelectWithFocus id="otherVersion" className="node-input" value={this.state.currentDiffId || ""} onChange={(e) => this.setState({currentDiffId: e.target.value})} > <option key="" value=""/> {_.keys(this.state.difference).map((diffId) => { const isLayoutOnly = this.isLayoutChangeOnly(diffId) return ( <option key={diffId} value={diffId} disabled={isLayoutOnly}>{diffId} {isLayoutOnly && "(position only)"}</option>) })} </SelectWithFocus> </div> {this.state.currentDiffId ? this.printDiff(this.state.currentDiffId) : null} </div> ) : null } </> ) } printDiff(diffId) { const diff = this.state.difference[diffId] switch (diff.type) { case "<API key>": case "<API key>": case "NodeDifferent": return this.renderDiff(diff.currentNode, diff.otherNode, this.printNode) case "<API key>": case "<API key>": case "EdgeDifferent": return this.renderDiff(diff.currentEdge, diff.otherEdge, this.printEdge) case "PropertiesDifferent": return this.renderDiff(diff.currentProperties, diff.otherProperties, this.printProperties) default: console.error(`Difference type ${diff.type} is not supported`) } } renderDiff(currentElement, otherElement, printElement) { const differentPaths = this.<API key>(currentElement, otherElement) return ( <div className="compareContainer"> <div> <div className="versionHeader">Current version</div> {printElement(currentElement, differentPaths)} </div> <div> <div className="versionHeader">Version {this.<API key>(this.state.otherVersion)}</div> {printElement(otherElement, [])} </div> </div> ) } <API key>(currentNode, otherNode) { const diffObject = JsonUtils.objectDiff(currentNode, otherNode) const flattenObj = JsonUtils.flattenObj(diffObject) return _.keys(flattenObj) } printNode(node, pathsToMark) { return node ? ( <NodeDetailsContent isEditMode={false} showValidation={false} showSwitch={false} node={node} pathsToMark={pathsToMark} onChange={() => {return}} /> ) : (<div className="notPresent">Node not present</div>) } printEdge(edge, pathsToMark) { return edge ? ( <EdgeDetailsContent edge={edge} readOnly={true} showValidation={false} showSwitch={false} changeEdgeTypeValue={() => {return}} <API key>={() => {return}} pathsToMark={pathsToMark} variableTypes={{}} /> ) : (<div className="notPresent">Edge not present</div>) } printProperties(property, pathsToMark) { return property ? ( <NodeDetailsContent isEditMode={false} showValidation={false} showSwitch={false} node={property} pathsToMark={pathsToMark} onChange={() => {return}} /> ) : (<div className="notPresent">Properties not present</div>) } } function mapState(state) { return { processId: getProcessId(state), version: getProcessVersionId(state), otherEnvironment: <API key>(state), versions: getVersions(state), } } type Props = ReturnType<typeof mapState> //TODO: move to hooks const CompareVersionsForm = connect(mapState)(VersionsForm) export function <API key>(props: WindowContentProps): JSX.Element { return ( <WindowContent {...props}> <div className={cx("compareModal", "modalContentDark", css({minWidth: 980, padding: "1em"}))}> <CompareVersionsForm/> </div> </WindowContent> ) }
#!/usr/bin/python # -*- coding: utf-8 -*- import os import urllib import zlib import zipfile import math import sys from subprocess import * import subprocess # This script will: # 1. Download the public database from the broad institute # 2. Generate random vcf files thanks to the previous file thanks to databaseExpansion.jar # 4. Delete the different files when they are uploaded as they are not needed anymore # Configuration for the user <API key> = "data/Public_Database_v3" <API key> = "ftp://ftp.broadinstitute.org/pub/ExAC_release/release0.3/ExAC.r0.3.sites.vep.vcf.gz" <API key> = "dbgeneration.jar" db_builder_path = "dbBuilder_fast2.jar" <API key> = "data/" ram_max = 2 # Number of Go the different jar can use disk_max = 20 # Number of Go we can use to store the generated vcf files threads_max = 5 # Number of threads allowed to do the vcf generation # Configuration specific to the files to generate. analyses = [('small', 200,'<API key>'), ('medium', 1000,'<API key>'),('big',5000,'<API key>'),('huge',25000,'<API key>')] # If a problem occured during a previous execution... if os.path.isfile(<API key>+".gz") and abs(os.path.getsize(<API key>+".gz") - 3176043421) > 100*1024: print("File compressed too small, we remove it.") os.remove(<API key>+".gz") if os.path.isfile(<API key>) and abs(os.path.getsize(<API key>) - 23198476257) > 100*1024: print("File uncompressed too small, we remove it.") os.remove(<API key>) # 1. Download the public database from the broad institute if we don't have yet if os.path.isfile(<API key>+".gz") or os.path.isfile(<API key>): print("1. Public database from broad institute found, great!") else: try: print("1.1. Public database from broad institute not found locally, we will download it, be patient... (Please, check if the file is created and its size increasing," \ +" otherwise remove spaces and stuff like that in the path") urllib.urlretrieve(<API key>, <API key>+".gz") except Exception as e: print("1.1. A problem occured during the downloading of the public database, launch the script again or invistigate the error.") print(e) os.remove(<API key>+".gz") sys.exit(0) # 1.2 Decompress the gzip file if not os.path.isfile(<API key>): print("1.2. Decompress public database...") try: os.system('gzip -d '+<API key>+'.gz') except Exception as e: print("1.2. A problem occured during the decompression of the public database.") print(e) sys.exit(0) # 2. Generate random vcf files thanks to the previous file thanks to databaseExpansion.jar def jarExecution(*args): env = dict(os.environ) env['JAVA_OPTS'] = '-d64 -Xms'+str(ram_max-1)+'g -Xmx'+str(ram_max)+'g' subprocess.call(['java', '-jar']+list(args), env=env) #subprocess.call(['java', '-d64', '-Xms'+str(ram_max-2)+'g', '-Xmx'+str(ram_max)+'g', '-jar']+list(args)) def checkIfSampleDone(sample_name): # Check if a sample is already done or not samples = [line.strip() for line in open('samples_done.txt')] found = False sample_name = str(sample_name) for sample in samples: if sample and sample_name == sample: found = True break return found def sampleIsDone(sample_name): if os.path.isfile('samples_done.txt'): with open('samples_done.txt', 'a') as file: file.write(str(sample_name)+'\r\n') skipped_files = 0 starting_sample = 100 for analyse in analyses: # We create an appropriate number of files by step max_vcf_step = min(analyse[1], (disk_max*1024)/150) max_vcf_step = 3 for first_sample in xrange(1, analyse[1], max_vcf_step): max_vcf_step = min(max_vcf_step, analyse[1] - first_sample) if checkIfSampleDone(starting_sample + first_sample) and checkIfSampleDone(starting_sample + first_sample + max_vcf_step - 1): print("Samples ["+str(starting_sample+first_sample)+"; "+str(starting_sample+first_sample+max_vcf_step - 1)+"] already done, we go to the next interval.") continue print("2. Generate random vcf files for the analysis "+analyse[0]+": "+str(max_vcf_step)+" out of "+str(analyse[1])+" vcf.") args = [''+<API key>+'', "--o", <API key>, "--d", <API key>+"r_"+analyse[0], "--s", str(max_vcf_step), "--f", "false", "--t", str(threads_max), "--i", str(starting_sample + first_sample)] try: #jarWrapper(*args) jarExecution(*args) except Exception as e: print("2. A problem occured during the vcf generation...") print(e) sys.exit(0) print("3. Importing the different samples") error = 0 for i in xrange(first_sample, first_sample+max_vcf_step): path_to_file = <API key>+"r_"+analyse[0]+"_s"+str(max_vcf_step)+"_"+str(starting_sample + first_sample)+"."+str(i-first_sample) if checkIfSampleDone(starting_sample + i): print("Sample "+str(starting_sample+i)+" already done, we go to the next one.") os.remove(path_to_file) continue if os.path.isfile("sql/lock"): os.remove("sql/lock") result = False args = [''+db_builder_path+'', "--tool", "variants", "--sample", "NA"+str(starting_sample + i).zfill(5), "--project", analyse[2], "--analysis", analyse[0], "--vcfpath", ''+path_to_file+''] try: jarExecution(*args) result = True except Exception as e: result = False print(e) if result is False: error += 1 if error < 3: print("3. Problem during the importation of the sample file '"+path_to_file+"' (attempt "+str(error)+"/3), we try again...") i = i - 1 else: print("3. Problem during the importation of the sample file '"+path_to_file+"' (attempt "+str(error)+"/3), we skip this vcf.") skipped_files += 1 else: error = 0 sampleIsDone(starting_sample + i) # 4. Delete the current file just used as we will not use it again anymore if os.path.isfile(path_to_file): print("Delete the file...") os.remove(path_to_file) starting_sample += analyse[1] + 1 if skipped_files < 20: print("----> It seems the import is done, with "+str(skipped_files)+" sample(s) skipped. Thank you.") else: print("----> It seems the import is done, but there were "+str(skipped_files)+" sample(s) skipped... Thank you anyway.")
package org.adligo.fabricate.depot; import org.adligo.fabricate.common.util.StringUtils; public class ArtifactKey { private final String projectName_; private final String artifactType_; private final String platformName_; public ArtifactKey(String projectName, String artifactType, String platformName) { if (StringUtils.isEmpty(projectName)) { throw new <API key>("projectName"); } projectName_ = projectName; if (StringUtils.isEmpty(artifactType)) { throw new <API key>("artifactType"); } artifactType_ = artifactType; if (StringUtils.isEmpty(platformName)) { throw new <API key>("platformName"); } platformName_ = platformName; } public String getProjectName() { return projectName_; } public String getArtifactType() { return artifactType_; } public String getPlatformName() { return platformName_; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + artifactType_.hashCode(); result = prime * result + platformName_.hashCode(); result = prime * result + projectName_.hashCode(); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ArtifactKey other = (ArtifactKey) obj; if (!artifactType_.equals(other.artifactType_)) { return false; } if (!platformName_.equals(other.platformName_)) { return false; } if (!projectName_.equals(other.projectName_)) { return false; } return true; } @Override public String toString() { return "ArtifactKey [projectName=" + projectName_ + ", artifactType=" + artifactType_ + ", platformName=" + platformName_ + "]"; } }
# coding=utf-8 from flask import g from mongoengine.connection import get_db from .model_document import ModelDocument, ModelQuerySet __all__ = ('<API key>',) class <API key>(ModelQuerySet): def __init__(self, document, collection): # make a local copy of the Document class for this QuerySet, to prevent # database, so that new attributes can be set on it new_document = self._copy_class(document) # this copies what may be class-level attributes from 'document', # to instance-level attributes on 'new_document', freezing them current_db_alias = document._get_db_alias() new_document._get_db_alias = staticmethod(lambda: current_db_alias) current_collection = document._get_collection() new_document._get_collection = staticmethod(lambda: current_collection) super(<API key>, self).__init__(new_document, collection) @staticmethod def _copy_class(cls): # TODO: move this to a common utils new_cls_dict = dict(cls.__dict__) new_cls_dict['meta'] = new_cls_dict.pop('_meta') return type(cls.__name__, cls.__bases__, new_cls_dict) class <API key>(ModelDocument): """ An abstract class for documents that may reside in one of multiple databases. """ # TODO: prevent this class from being instantiated directly meta = { 'abstract': True, 'allow_inheritance': False, 'db_alias': None, # this shouldn't actually be used 'queryset_class': <API key>, 'auto_create_index': False, # don't change; see '_get_collection' for why this is set } @property def database(self): # the import is required here to prevent circular imports # TODO: remove this import statement from ..image_store import <API key> return <API key>.objects.with_id(self._db_alias) @classmethod def _get_db_alias(cls): """ Helper method to provide the current database, as set by a <API key> context manager. This would be better as a property, but Python has poor support for classmethod descriptors, particularly with mutators. """ try: return g.<API key>[-1] except (AttributeError, IndexError): raise NotImplemented('A "%s" must be used inside a "<API key>" context (\'with\' statement).' % cls.__name__) @classmethod def _get_db(cls): """ Overrides the Document._get_collection classmethod. This will only be called on class instances, as instantiated objects have this method patched by 'self.switch_db'. """ return get_db(cls._get_db_alias()) @classmethod def _get_collection(cls): if issubclass(<API key>, cls): # setting the '_collections' property on one of the common base # classes would prevent the derived classes from having their own # seperate instances of the property raise NotImplementedError('"_get_collection" should only be called on concrete model classes.') if not hasattr(cls, '_collections'): cls._collections = dict() db_alias = cls._get_db_alias() try: cls._collection = cls._collections[db_alias] except KeyError: cls._collection = None # 'cls._collection' is set as a side effect of the superclass # '_get_collection' cls._collections[db_alias] = super(<API key>, cls)._get_collection() # unless meta['auto_create_index'] is false, the superclass # '_get_collection' will attempt to call 'ensure_indexes', which # in turn calls '_get_collection', leading to infinite recursion # so, wait until the necessary '_collection' / '_collections' values # are set after the return, and only then call 'ensure_indexes' cls.ensure_indexes() return cls._collection def __init__(self, *args, **kwargs): super(<API key>, self).__init__(*args, **kwargs) # make the new database persistent to this instance # cls_db_alias = type(self)._get_db_alias() cls_db_alias = self._get_db_alias() self._db_alias = cls_db_alias # save the value for use in the 'database' property self.switch_db(cls_db_alias) # this patches over 'self._get_db'
require 'spec_helper' describe Trakio do subject { Trakio } after { Trakio.default_instance = nil } describe '#identify' do context "when a distinct_id is provided" do context "when properties are provided" do it "sends an identify request" do stub = stub_request(:post, "https://api.trak.io/v1/identify"). with(:body => { token: 'my_api_token', data: { distinct_id: 'user@example.com', properties: { name: 'Tobie', }, } }).to_return(:body => { status: 'success', trak_id: '1234567890', distinct_ids: ['user@example.com'], }.to_json) trakio = Trakio.new 'my_api_token' trakio.identify distinct_id: 'user@example.com', properties: { name: 'Tobie' } expect(stub).to have_been_requested end end end context "when a distinct_id isn't provided but is set on instance" do context "when properties are provided" do it "sends an identify request" do stub = stub_request(:post, "https://api.trak.io/v1/identify"). with(:body => { token: 'my_api_token', data: { distinct_id: 'user@example.com', properties: { name: 'Tobie', }, } }).to_return(:body => { status: 'success', trak_id: '1234567890', distinct_ids: ['user@example.com'], }.to_json) trakio = Trakio.new 'my_api_token', distinct_id: 'user@example.com' trakio.identify properties: { name: 'Tobie' } expect(stub).to have_been_requested end end end context "when a distinct_id isn't provided" do context "when properties are provided" do it "raises an error" do trakio = Trakio.new 'my_api_token' expect { trakio.identify properties: { name: 'Tobie' } }.to raise_error Trakio::Exceptions::MissingParameter end end end context "when distinct_id and company_id are both set" do context "via arguments" do it "adds it to the company's people_distinct_ids" do stub = stub_request(:post, "https://api.trak.io/v1/identify"). with(:body => { token: 'my_api_token', data: { distinct_id: 'user@example.com', properties: { name: 'Tobie', company: [{ company_id: 'massive_dynamics', role: 'widgets' }, { company_id: 'acme_ltd' }] }, } }.to_json).to_return(:body => { status: 'success' }.to_json) trakio = Trakio.new 'my_api_token' trakio.identify distinct_id: 'user@example.com', company_id: 'acme_ltd', properties: { name: 'Tobie', company: { company_id: 'massive_dynamics', role: 'widgets' } } expect(stub).to have_been_requested end end context "via configuration" do it "adds it to the company's people_distinct_ids" do stub = stub_request(:post, "https://api.trak.io/v1/identify"). with(:body => { token: 'my_api_token', data: { distinct_id: 'user@example.com', properties: { name: 'Tobie', company: [{ company_id: 'massive_dynamics', role: 'widgets' }, { company_id: 'monarch', role: 'widgets' }, { company_id: 'acme_ltd' }], }, } }.to_json).to_return(:body => { status: 'success' }.to_json) trakio = Trakio.new 'my_api_token', distinct_id: 'user@example.com', company_id: 'acme_ltd' trakio.identify properties: { name: 'Tobie', company: [{ company_id: 'massive_dynamics', role: 'widgets' }], companies: [{ company_id: 'monarch', role: 'widgets' }] } expect(stub).to have_been_requested end end context "but company is also passed in properties" do it "doesn't send duplicates" do stub = stub_request(:post, "https://api.trak.io/v1/identify"). with(:body => { token: 'my_api_token', data: { distinct_id: 'user@example.com', properties: { name: 'Tobie', company: [{ company_id: 'massive_dynamics', role: 'widgets' }, { company_id: 'monarch', role: 'widgets' }], }, } }.to_json).to_return(:body => { status: 'success' }.to_json) trakio = Trakio.new 'my_api_token', distinct_id: 'user@example.com', company_id: 'monarch' trakio.identify properties: { name: 'Tobie', company: [{ company_id: 'massive_dynamics', role: 'widgets' }], companies: [{ company_id: 'monarch', role: 'widgets' }] } expect(stub).to have_been_requested end end end end end
#Swagger to JS Codegen [![Build Status](http: This package generates a nodejs or angularjs class from a [swagger specification file](https: ##Installation bash npm install swagger-js-codegen ##Example javascript var fs = require('fs'); var CodeGen = require('swagger-js-codegen').CodeGen; var file = 'swagger/spec.json'; var swagger = JSON.parse(fs.readFileSync(file, 'UTF-8')); var nodejsSourceCode = CodeGen.getNodeCode({ className: 'Test', swagger: swagger }); var angularjsSourceCode = CodeGen.getAngularCode({ className: 'Test', swagger: swagger }); console.log(nodejsSourceCode); console.log(angularjsSourceCode); ## Grunt task [There is a grunt task](https://github.com/wcandillon/<API key>) that enables you to integrate the code generation in your development pipeline. This is extremely convenient if your application is using APIs which are documented/specified in the swagger format. ##Who is using it? [28.io](http:
<!DOCTYPE HTML PUBLIC "- <!--NewPage <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_45) on Tue Apr 22 01:43:54 UTC 2014 --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE> Uses of Class org.apache.hadoop.hbase.tmpl.regionserver.RSStatusTmplImpl (HBase 0.94.19 API) </TITLE> <META NAME="date" CONTENT="2014-04-22"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.apache.hadoop.hbase.tmpl.regionserver.RSStatusTmplImpl (HBase 0.94.19 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/hbase/tmpl/regionserver/RSStatusTmplImpl.html" title="class in org.apache.hadoop.hbase.tmpl.regionserver"><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/hbase/tmpl/regionserver//<API key>.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="RSStatusTmplImpl.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.hbase.tmpl.regionserver.RSStatusTmplImpl</B></H2> </CENTER> No usage of org.apache.hadoop.hbase.tmpl.regionserver.RSStatusTmplImpl <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/hbase/tmpl/regionserver/RSStatusTmplImpl.html" title="class in org.apache.hadoop.hbase.tmpl.regionserver"><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/hbase/tmpl/regionserver//<API key>.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="RSStatusTmplImpl.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>