text
stringlengths
2
1.04M
meta
dict
<?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\Test\Trading\Types; use DTS\eBaySDK\Trading\Types\ReviseFixedPriceItemResponseType; class ReviseFixedPriceItemResponseTypeTest extends \PHPUnit_Framework_TestCase { private $obj; protected function setUp() { $this->obj = new ReviseFixedPriceItemResponseType(); } public function testCanBeCreated() { $this->assertInstanceOf('\DTS\eBaySDK\Trading\Types\ReviseFixedPriceItemResponseType', $this->obj); } public function testExtendsAbstractResponseType() { $this->assertInstanceOf('\DTS\eBaySDK\Trading\Types\AbstractResponseType', $this->obj); } }
{ "content_hash": "c5a8b8b5e7df32b4d7f01c3179ffb235", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 107, "avg_line_length": 25.575757575757574, "alnum_prop": 0.716824644549763, "repo_name": "davidtsadler/ebay-sdk-php", "id": "fdb16fb764bf7b95a56910d4ef37f0f92c12c0fd", "size": "844", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/Trading/Types/ReviseFixedPriceItemResponseTypeTest.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Makefile", "bytes": "10944" }, { "name": "PHP", "bytes": "9958599" } ], "symlink_target": "" }
<?php $this->beginContent('//layouts/headfoot'); ?> <div id="page" class="two_columns"> <?php echo $content; ?> </div> <?php $this->endContent(); ?>
{ "content_hash": "f53626e7bdc6ec8876b034875d02bd4e", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 51, "avg_line_length": 30.4, "alnum_prop": 0.6052631578947368, "repo_name": "shenjia/zApp", "id": "b501217a5d374fc2ff144c045aadd49acd9f0706", "size": "152", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "code/frontend/views/layouts/two_columns.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "68898" }, { "name": "JavaScript", "bytes": "54334" }, { "name": "PHP", "bytes": "74738" }, { "name": "Shell", "bytes": "1140" } ], "symlink_target": "" }
require 'chef/resource/package' require 'chef/resource/chef_gem' module InfluxDB # Some helpers to interact with InfluxDB module Helpers # TODO : Configurable administrator creds def self.client(user = 'root', pass = 'root', run_context) install_influxdb(run_context) require_influxdb InfluxDB::Client.new(username: user, password: pass) end def self.render_config(hash, run_context, config_file) install_toml(run_context) require_toml config_file(hash, run_context, config_file) end def self.install_toml(run_context) toml_gem = Chef::Resource::ChefGem.new('toml', run_context) toml_gem.run_action :install end def self.install_influxdb(run_context) influxdb_gem = Chef::Resource::ChefGem.new('influxdb', run_context) influxdb_gem.version '0.1.8' influxdb_gem.run_action :install end def self.require_toml require 'toml' end def self.require_influxdb require 'influxdb' end def self.config_file(hash, run_context, config_file) f = Chef::Resource::File.new(config_file, run_context) f.owner 'root' f.mode 00644 f.content TOML::Generator.new(hash).body f.run_action :create end end end
{ "content_hash": "a321cca172ea23bd92ce01e4a38749fa", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 73, "avg_line_length": 26.95744680851064, "alnum_prop": 0.664561957379637, "repo_name": "datasift/chef-influxdb", "id": "4d3db30790931b91e1ebed2f25022667957bd982", "size": "2019", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "libraries/default.rb", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Ruby", "bytes": "30674" } ], "symlink_target": "" }
layout: post title: A4. RENEWABLE ENERGY SOURCES AND DRIVES date: 2017-06-02 11:00:00 end-date: '2017-06-02 12:30 PM' participants: Prof. Bruno FRANÇOIS location: Hall A --- **1. &nbsp;&nbsp; Power Control of PMSG for Wind Turbine Using Maximum Torque per Ampere Strategy** <br>Zahari Zarkov, Boris Demirkov **2. &nbsp;&nbsp; Small Wind Generator System with Non-Inverting Buck-Boost Converter and Battery Storage** <br>Zahari Zarkov, Ivan Bachev, Vladimir Lazarov **3. &nbsp;&nbsp; Experimental Design of Stand-alone Field Oriented Control for WECS in Variable Speed DFIG-based on Hysteresis Current Controller** <br>Fayssal Amrane, Azeddine Chaiba, Bruno Francois, Badreddine Babes **4. &nbsp;&nbsp; Electrical Energy Wireless Transfert: Application to electric roads** <br>Mehdi Rouissiya, Ikram El Abbassi, Bilal Amghar, Alain Jaafari, Moumen Darcherif **5. &nbsp;&nbsp; Critical meteorological conditions and the electrical power balance in Bulgaria** <br>Nelly Harizanova **6. &nbsp;&nbsp; Features in the selection and operation of ac motors for electric propulsion system in ships** <br>Lyubomir Dimitrov, Stefka Kanturska
{ "content_hash": "32def467fd17152ee698516d81823da7", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 148, "avg_line_length": 43.76923076923077, "alnum_prop": 0.7759226713532513, "repo_name": "BozhkoZ/schedule", "id": "96f4640f332056ceccf4729974edc4b9622a32a4", "size": "1143", "binary": false, "copies": "1", "ref": "refs/heads/gh-pages", "path": "_posts/2017-06-02-a4--renewable-energy-sources-and-drives.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "11601" }, { "name": "HTML", "bytes": "10846" }, { "name": "Ruby", "bytes": "1115" } ], "symlink_target": "" }
<? function api_getComments_front() { ?> <p><big>Fetch comments left on OpenAustralia.</big></p> <p>With no arguments, returns most recent comments in reverse date order.</p> <h4>Arguments</h4> <dl> <dt>date (optional)</dt> <dd>Fetch the comments for this date.</dd> <dt>search (optional)</dt> <dd>Fetch the comments that contain this term.</dd> <dt>user_id (optional)</dt> <dd>Fetch the comments by a particular user ID.</dd> <dt>pid</dt> <dd>Fetch the comments made on a particular person ID (Representative/Senator).</dd> <dt>page (optional)</dt> <dd>Page of results to return.</dd> <dt>num (optional)</dt> <dd>Number of results to return.</dd> </dl> <? } function api_getComments_search($s) { $args = array ( 's' => $s, 'p' => get_http_var('page'), 'num' => get_http_var('num'), ); $commentlist = new COMMENTLIST; $commentlist->display('search', $args, 'api'); } function api_getComments() { $args = array( 'page' => get_http_var('p'), 'num' => get_http_var('num'), ); $COMMENTLIST = new COMMENTLIST; $COMMENTLIST->display('recent', $args, 'api'); } function api_getComments_pid($pid) { $args = array( 'page' => get_http_var('p'), 'num' => get_http_var('num'), 'pid' => $pid ); $COMMENTLIST = new COMMENTLIST; $COMMENTLIST->display('recent', $args, 'api'); } ?>
{ "content_hash": "896d006ea56f05a7d275859d57064566", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 84, "avg_line_length": 23.403508771929825, "alnum_prop": 0.6266866566716641, "repo_name": "archoo/twfy", "id": "c45b4e2b951994b4340c6d56222c50e9ba9ec4d0", "size": "1334", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "www/docs/api/api_getComments.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "3470" }, { "name": "CSS", "bytes": "41322" }, { "name": "HTML", "bytes": "32324" }, { "name": "PHP", "bytes": "1112688" }, { "name": "Perl", "bytes": "171359" }, { "name": "Python", "bytes": "12569" }, { "name": "Ruby", "bytes": "12932" }, { "name": "Shell", "bytes": "8910" } ], "symlink_target": "" }
#include <assert.h> #include <stdlib.h> #include "customer.h" #include "map.h" #include "pair.h" #include "manager.h" #include "reservation.h" #include "tm.h" #include "types.h" /* ============================================================================= * DECLARATION OF TM_CALLABLE FUNCTIONS * ============================================================================= */ TM_CALLABLE static long queryNumFree (TM_ARGDECL MAP_T* tablePtr, long id); TM_CALLABLE static long queryPrice (TM_ARGDECL MAP_T* tablePtr, long id); TM_CALLABLE static bool_t reserve (TM_ARGDECL MAP_T* tablePtr, MAP_T* customerTablePtr, long customerId, long id, reservation_type_t type); TM_CALLABLE bool_t addReservation (TM_ARGDECL MAP_T* tablePtr, long id, long num, long price); /* ============================================================================= * tableAlloc * ============================================================================= */ static MAP_T* tableAlloc () { return MAP_ALLOC(NULL, NULL); } /* ============================================================================= * manager_alloc * ============================================================================= */ manager_t* manager_alloc () { manager_t* managerPtr; managerPtr = (manager_t*)malloc(sizeof(manager_t)); assert(managerPtr != NULL); managerPtr->carTablePtr = tableAlloc(); managerPtr->roomTablePtr = tableAlloc(); managerPtr->flightTablePtr = tableAlloc(); managerPtr->customerTablePtr = tableAlloc(); assert(managerPtr->carTablePtr != NULL); assert(managerPtr->roomTablePtr != NULL); assert(managerPtr->flightTablePtr != NULL); assert(managerPtr->customerTablePtr != NULL); return managerPtr; } /* ============================================================================= * tableFree * -- Note: contents are not deallocated * ============================================================================= */ static void tableFree (MAP_T* mapPtr) { MAP_FREE(mapPtr); } /* ============================================================================= * manager_free * ============================================================================= */ void manager_free (manager_t* managerPtr) { tableFree(managerPtr->carTablePtr); tableFree(managerPtr->roomTablePtr); tableFree(managerPtr->flightTablePtr); tableFree(managerPtr->customerTablePtr); } /* ============================================================================= * ADMINISTRATIVE INTERFACE * ============================================================================= */ /* ============================================================================= * addReservation * -- If 'num' > 0 then add, if < 0 remove * -- Adding 0 seats is error if does not exist * -- If 'price' < 0, do not update price * -- Returns TRUE on success, else FALSE * ============================================================================= */ bool_t addReservation (TM_ARGDECL MAP_T* tablePtr, long id, long num, long price) { reservation_t* reservationPtr; reservationPtr = (reservation_t*)TMMAP_FIND(tablePtr, id); if (reservationPtr == NULL) { /* Create new reservation */ if (num < 1 || price < 0) { return FALSE; } reservationPtr = RESERVATION_ALLOC(id, num, price); assert(reservationPtr != NULL); TMMAP_INSERT(tablePtr, id, reservationPtr); } else { /* Update existing reservation */ if (!RESERVATION_ADD_TO_TOTAL(reservationPtr, num)) { return FALSE; } if ((long)TM_SHARED_READ(reservationPtr->numTotal) == 0) { bool_t status = TMMAP_REMOVE(tablePtr, id); if (status == FALSE) { TM_RESTART(); } RESERVATION_FREE(reservationPtr); } else { RESERVATION_UPDATE_PRICE(reservationPtr, price); } } return TRUE; } bool_t addReservation_seq (MAP_T* tablePtr, long id, long num, long price) { reservation_t* reservationPtr; bool_t status; reservationPtr = (reservation_t*)MAP_FIND(tablePtr, id); if (reservationPtr == NULL) { /* Create new reservation */ if (num < 1 || price < 0) { return FALSE; } reservationPtr = reservation_alloc_seq(id, num, price); assert(reservationPtr != NULL); status = MAP_INSERT(tablePtr, id, reservationPtr); assert(status); } else { /* Update existing reservation */ if (!reservation_addToTotal_seq(reservationPtr, num)) { return FALSE; } if (reservationPtr->numTotal == 0) { status = MAP_REMOVE(tablePtr, id); assert(status); } else { reservation_updatePrice_seq(reservationPtr, price); } } return TRUE; } /* ============================================================================= * manager_addCar * -- Add cars to a city * -- Adding to an existing car overwrite the price if 'price' >= 0 * -- Returns TRUE on success, else FALSE * ============================================================================= */ bool_t manager_addCar (TM_ARGDECL manager_t* managerPtr, long carId, long numCars, long price) { return addReservation(TM_ARG managerPtr->carTablePtr, carId, numCars, price); } bool_t manager_addCar_seq (manager_t* managerPtr, long carId, long numCars, long price) { return addReservation_seq(managerPtr->carTablePtr, carId, numCars, price); } /* ============================================================================= * manager_deleteCar * -- Delete cars from a city * -- Decreases available car count (those not allocated to a customer) * -- Fails if would make available car count negative * -- If decresed to 0, deletes entire entry * -- Returns TRUE on success, else FALSE * ============================================================================= */ bool_t manager_deleteCar (TM_ARGDECL manager_t* managerPtr, long carId, long numCar) { /* -1 keeps old price */ return addReservation(TM_ARG managerPtr->carTablePtr, carId, -numCar, -1); } /* ============================================================================= * manager_addRoom * -- Add rooms to a city * -- Adding to an existing room overwrite the price if 'price' >= 0 * -- Returns TRUE on success, else FALSE * ============================================================================= */ bool_t manager_addRoom (TM_ARGDECL manager_t* managerPtr, long roomId, long numRoom, long price) { return addReservation(TM_ARG managerPtr->roomTablePtr, roomId, numRoom, price); } bool_t manager_addRoom_seq (manager_t* managerPtr, long roomId, long numRoom, long price) { return addReservation_seq(managerPtr->roomTablePtr, roomId, numRoom, price); } /* ============================================================================= * manager_deleteRoom * -- Delete rooms from a city * -- Decreases available room count (those not allocated to a customer) * -- Fails if would make available room count negative * -- If decresed to 0, deletes entire entry * -- Returns TRUE on success, else FALSE * ============================================================================= */ bool_t manager_deleteRoom (TM_ARGDECL manager_t* managerPtr, long roomId, long numRoom) { /* -1 keeps old price */ return addReservation(TM_ARG managerPtr->roomTablePtr, roomId, -numRoom, -1); } /* ============================================================================= * manager_addFlight * -- Add seats to a flight * -- Adding to an existing flight overwrite the price if 'price' >= 0 * -- Returns TRUE on success, FALSE on failure * ============================================================================= */ bool_t manager_addFlight (TM_ARGDECL manager_t* managerPtr, long flightId, long numSeat, long price) { return addReservation(TM_ARG managerPtr->flightTablePtr, flightId, numSeat, price); } bool_t manager_addFlight_seq (manager_t* managerPtr, long flightId, long numSeat, long price) { return addReservation_seq(managerPtr->flightTablePtr, flightId, numSeat, price); } /* ============================================================================= * manager_deleteFlight * -- Delete an entire flight * -- Fails if customer has reservation on this flight * -- Returns TRUE on success, else FALSE * ============================================================================= */ bool_t manager_deleteFlight (TM_ARGDECL manager_t* managerPtr, long flightId) { reservation_t* reservationPtr; reservationPtr = (reservation_t*)TMMAP_FIND(managerPtr->flightTablePtr, flightId); if (reservationPtr == NULL) { return FALSE; } if ((long)TM_SHARED_READ(reservationPtr->numUsed) > 0) { return FALSE; /* somebody has a reservation */ } return addReservation(TM_ARG managerPtr->flightTablePtr, flightId, -1*(long)TM_SHARED_READ(reservationPtr->numTotal), -1 /* -1 keeps old price */); } /* ============================================================================= * manager_addCustomer * -- If customer already exists, returns failure * -- Returns TRUE on success, else FALSE * ============================================================================= */ bool_t manager_addCustomer (TM_ARGDECL manager_t* managerPtr, long customerId) { customer_t* customerPtr; bool_t status; if (TMMAP_CONTAINS(managerPtr->customerTablePtr, customerId)) { return FALSE; } customerPtr = CUSTOMER_ALLOC(customerId); assert(customerPtr != NULL); status = TMMAP_INSERT(managerPtr->customerTablePtr, customerId, customerPtr); if (status == FALSE) { TM_RESTART(); } return TRUE; } bool_t manager_addCustomer_seq (manager_t* managerPtr, long customerId) { customer_t* customerPtr; bool_t status; if (MAP_CONTAINS(managerPtr->customerTablePtr, customerId)) { return FALSE; } customerPtr = customer_alloc_seq(customerId); assert(customerPtr != NULL); status = MAP_INSERT(managerPtr->customerTablePtr, customerId, customerPtr); assert(status); return TRUE; } /* ============================================================================= * manager_deleteCustomer * -- Delete this customer and associated reservations * -- If customer does not exist, returns success * -- Returns TRUE on success, else FALSE * ============================================================================= */ bool_t manager_deleteCustomer (TM_ARGDECL manager_t* managerPtr, long customerId) { customer_t* customerPtr; MAP_T* reservationTables[NUM_RESERVATION_TYPE]; list_t* reservationInfoListPtr; list_iter_t it; bool_t status; customerPtr = (customer_t*)TMMAP_FIND(managerPtr->customerTablePtr, customerId); if (customerPtr == NULL) { return FALSE; } reservationTables[RESERVATION_CAR] = managerPtr->carTablePtr; reservationTables[RESERVATION_ROOM] = managerPtr->roomTablePtr; reservationTables[RESERVATION_FLIGHT] = managerPtr->flightTablePtr; /* Cancel this customer's reservations */ reservationInfoListPtr = customerPtr->reservationInfoListPtr; TMLIST_ITER_RESET(&it, reservationInfoListPtr); while (TMLIST_ITER_HASNEXT(&it, reservationInfoListPtr)) { reservation_info_t* reservationInfoPtr; reservation_t* reservationPtr; reservationInfoPtr = (reservation_info_t*)TMLIST_ITER_NEXT(&it, reservationInfoListPtr); reservationPtr = (reservation_t*)TMMAP_FIND(reservationTables[reservationInfoPtr->type], reservationInfoPtr->id); if (reservationPtr == NULL) { TM_RESTART(); } status = RESERVATION_CANCEL(reservationPtr); if (status == FALSE) { TM_RESTART(); } RESERVATION_INFO_FREE(reservationInfoPtr); } status = TMMAP_REMOVE(managerPtr->customerTablePtr, customerId); if (status == FALSE) { TM_RESTART(); } CUSTOMER_FREE(customerPtr); return TRUE; } /* ============================================================================= * QUERY INTERFACE * ============================================================================= */ /* ============================================================================= * queryNumFree * -- Return numFree of a reservation, -1 if failure * ============================================================================= */ static long queryNumFree (TM_ARGDECL MAP_T* tablePtr, long id) { long numFree = -1; reservation_t* reservationPtr; reservationPtr = (reservation_t*)TMMAP_FIND(tablePtr, id); if (reservationPtr != NULL) { numFree = (long)TM_SHARED_READ(reservationPtr->numFree); } return numFree; } /* ============================================================================= * queryPrice * -- Return price of a reservation, -1 if failure * ============================================================================= */ static long queryPrice (TM_ARGDECL MAP_T* tablePtr, long id) { long price = -1; reservation_t* reservationPtr; reservationPtr = (reservation_t*)TMMAP_FIND(tablePtr, id); if (reservationPtr != NULL) { price = (long)TM_SHARED_READ(reservationPtr->price); } return price; } /* ============================================================================= * manager_queryCar * -- Return the number of empty seats on a car * -- Returns -1 if the car does not exist * ============================================================================= */ long manager_queryCar (TM_ARGDECL manager_t* managerPtr, long carId) { return queryNumFree(TM_ARG managerPtr->carTablePtr, carId); } /* ============================================================================= * manager_queryCarPrice * -- Return the price of the car * -- Returns -1 if the car does not exist * ============================================================================= */ long manager_queryCarPrice (TM_ARGDECL manager_t* managerPtr, long carId) { return queryPrice(TM_ARG managerPtr->carTablePtr, carId); } /* ============================================================================= * manager_queryRoom * -- Return the number of empty seats on a room * -- Returns -1 if the room does not exist * ============================================================================= */ long manager_queryRoom (TM_ARGDECL manager_t* managerPtr, long roomId) { return queryNumFree(TM_ARG managerPtr->roomTablePtr, roomId); } /* ============================================================================= * manager_queryRoomPrice * -- Return the price of the room * -- Returns -1 if the room does not exist * ============================================================================= */ long manager_queryRoomPrice (TM_ARGDECL manager_t* managerPtr, long roomId) { return queryPrice(TM_ARG managerPtr->roomTablePtr, roomId); } /* ============================================================================= * manager_queryFlight * -- Return the number of empty seats on a flight * -- Returns -1 if the flight does not exist * ============================================================================= */ long manager_queryFlight (TM_ARGDECL manager_t* managerPtr, long flightId) { return queryNumFree(TM_ARG managerPtr->flightTablePtr, flightId); } /* ============================================================================= * manager_queryFlightPrice * -- Return the price of the flight * -- Returns -1 if the flight does not exist * ============================================================================= */ long manager_queryFlightPrice (TM_ARGDECL manager_t* managerPtr, long flightId) { return queryPrice(TM_ARG managerPtr->flightTablePtr, flightId); } /* ============================================================================= * manager_queryCustomerBill * -- Return the total price of all reservations held for a customer * -- Returns -1 if the customer does not exist * ============================================================================= */ long manager_queryCustomerBill (TM_ARGDECL manager_t* managerPtr, long customerId) { long bill = -1; customer_t* customerPtr; customerPtr = (customer_t*)TMMAP_FIND(managerPtr->customerTablePtr, customerId); if (customerPtr != NULL) { bill = CUSTOMER_GET_BILL(customerPtr); } return bill; } /* ============================================================================= * RESERVATION INTERFACE * ============================================================================= */ /* ============================================================================= * reserve * -- Customer is not allowed to reserve same (type, id) multiple times * -- Returns TRUE on success, else FALSE * ============================================================================= */ static bool_t reserve (TM_ARGDECL MAP_T* tablePtr, MAP_T* customerTablePtr, long customerId, long id, reservation_type_t type) { customer_t* customerPtr; reservation_t* reservationPtr; customerPtr = (customer_t*)TMMAP_FIND(customerTablePtr, customerId); if (customerPtr == NULL) { return FALSE; } reservationPtr = (reservation_t*)TMMAP_FIND(tablePtr, id); if (reservationPtr == NULL) { return FALSE; } if (!RESERVATION_MAKE(reservationPtr)) { return FALSE; } if (!CUSTOMER_ADD_RESERVATION_INFO( customerPtr, type, id, (long)TM_SHARED_READ(reservationPtr->price))) { /* Undo previous successful reservation */ bool_t status = RESERVATION_CANCEL(reservationPtr); if (status == FALSE) { TM_RESTART(); } return FALSE; } return TRUE; } /* ============================================================================= * manager_reserveCar * -- Returns failure if the car or customer does not exist * -- Returns TRUE on success, else FALSE * ============================================================================= */ bool_t manager_reserveCar (TM_ARGDECL manager_t* managerPtr, long customerId, long carId) { return reserve(TM_ARG managerPtr->carTablePtr, managerPtr->customerTablePtr, customerId, carId, RESERVATION_CAR); } /* ============================================================================= * manager_reserveRoom * -- Returns failure if the room or customer does not exist * -- Returns TRUE on success, else FALSE * ============================================================================= */ bool_t manager_reserveRoom (TM_ARGDECL manager_t* managerPtr, long customerId, long roomId) { return reserve(TM_ARG managerPtr->roomTablePtr, managerPtr->customerTablePtr, customerId, roomId, RESERVATION_ROOM); } /* ============================================================================= * manager_reserveFlight * -- Returns failure if the flight or customer does not exist * -- Returns TRUE on success, else FALSE * ============================================================================= */ bool_t manager_reserveFlight (TM_ARGDECL manager_t* managerPtr, long customerId, long flightId) { return reserve(TM_ARG managerPtr->flightTablePtr, managerPtr->customerTablePtr, customerId, flightId, RESERVATION_FLIGHT); } /* ============================================================================= * cancel * -- Customer is not allowed to cancel multiple times * -- Returns TRUE on success, else FALSE * ============================================================================= */ static bool_t cancel (TM_ARGDECL MAP_T* tablePtr, MAP_T* customerTablePtr, long customerId, long id, reservation_type_t type) { customer_t* customerPtr; reservation_t* reservationPtr; customerPtr = (customer_t*)TMMAP_FIND(customerTablePtr, customerId); if (customerPtr == NULL) { return FALSE; } reservationPtr = (reservation_t*)TMMAP_FIND(tablePtr, id); if (reservationPtr == NULL) { return FALSE; } if (!RESERVATION_CANCEL(reservationPtr)) { return FALSE; } if (!CUSTOMER_REMOVE_RESERVATION_INFO(customerPtr, type, id)) { /* Undo previous successful cancellation */ bool_t status = RESERVATION_MAKE(reservationPtr); if (status == FALSE) { TM_RESTART(); } return FALSE; } return TRUE; } /* ============================================================================= * manager_cancelCar * -- Returns failure if the car, reservation, or customer does not exist * -- Returns TRUE on success, else FALSE * ============================================================================= */ bool_t manager_cancelCar (TM_ARGDECL manager_t* managerPtr, long customerId, long carId) { return cancel(TM_ARG managerPtr->carTablePtr, managerPtr->customerTablePtr, customerId, carId, RESERVATION_CAR); } /* ============================================================================= * manager_cancelRoom * -- Returns failure if the room, reservation, or customer does not exist * -- Returns TRUE on success, else FALSE * ============================================================================= */ bool_t manager_cancelRoom (TM_ARGDECL manager_t* managerPtr, long customerId, long roomId) { return cancel(TM_ARG managerPtr->roomTablePtr, managerPtr->customerTablePtr, customerId, roomId, RESERVATION_ROOM); } /* ============================================================================= * manager_cancelFlight * -- Returns failure if the flight, reservation, or customer does not exist * -- Returns TRUE on success, else FALSE * ============================================================================= */ bool_t manager_cancelFlight (TM_ARGDECL manager_t* managerPtr, long customerId, long flightId) { return cancel(TM_ARG managerPtr->flightTablePtr, managerPtr->customerTablePtr, customerId, flightId, RESERVATION_FLIGHT); } /* ============================================================================= * TEST_MANAGER * ============================================================================= */ #ifdef TEST_MANAGER #include <assert.h> #include <stdio.h> int main () { manager_t* managerPtr; assert(memory_init(1, 4, 2)); puts("Starting..."); managerPtr = manager_alloc(); /* Test administrative interface for cars */ assert(!manager_addCar(managerPtr, 0, -1, 0)); /* negative num */ assert(!manager_addCar(managerPtr, 0, 0, -1)); /* negative price */ assert(!manager_addCar(managerPtr, 0, 0, 0)); /* zero num */ assert(manager_addCar(managerPtr, 0, 1, 1)); assert(!manager_deleteCar(managerPtr, 1, 0)); /* does not exist */ assert(!manager_deleteCar(managerPtr, 0, 2)); /* cannot remove that many */ assert(manager_addCar(managerPtr, 0, 1, 0)); assert(manager_deleteCar(managerPtr, 0, 1)); assert(manager_deleteCar(managerPtr, 0, 1)); assert(!manager_deleteCar(managerPtr, 0, 1)); /* none left */ assert(manager_queryCar(managerPtr, 0) == -1); /* does not exist */ /* Test administrative interface for rooms */ assert(!manager_addRoom(managerPtr, 0, -1, 0)); /* negative num */ assert(!manager_addRoom(managerPtr, 0, 0, -1)); /* negative price */ assert(!manager_addRoom(managerPtr, 0, 0, 0)); /* zero num */ assert(manager_addRoom(managerPtr, 0, 1, 1)); assert(!manager_deleteRoom(managerPtr, 1, 0)); /* does not exist */ assert(!manager_deleteRoom(managerPtr, 0, 2)); /* cannot remove that many */ assert(manager_addRoom(managerPtr, 0, 1, 0)); assert(manager_deleteRoom(managerPtr, 0, 1)); assert(manager_deleteRoom(managerPtr, 0, 1)); assert(!manager_deleteRoom(managerPtr, 0, 1)); /* none left */ assert(manager_queryRoom(managerPtr, 0) == -1); /* does not exist */ /* Test administrative interface for flights and customers */ assert(!manager_addFlight(managerPtr, 0, -1, 0)); /* negative num */ assert(!manager_addFlight(managerPtr, 0, 0, -1)); /* negative price */ assert(!manager_addFlight(managerPtr, 0, 0, 0)); assert(manager_addFlight(managerPtr, 0, 1, 0)); assert(!manager_deleteFlight(managerPtr, 1)); /* does not exist */ assert(!manager_deleteFlight(managerPtr, 2)); /* cannot remove that many */ assert(!manager_cancelFlight(managerPtr, 0, 0)); /* do not have reservation */ assert(!manager_reserveFlight(managerPtr, 0, 0)); /* customer does not exist */ assert(!manager_deleteCustomer(managerPtr, 0)); /* does not exist */ assert(manager_addCustomer(managerPtr, 0)); assert(!manager_addCustomer(managerPtr, 0)); /* already exists */ assert(manager_reserveFlight(managerPtr, 0, 0)); assert(manager_addFlight(managerPtr, 0, 1, 0)); assert(!manager_deleteFlight(managerPtr, 0)); /* someone has reservation */ assert(manager_cancelFlight(managerPtr, 0, 0)); assert(manager_deleteFlight(managerPtr, 0)); assert(!manager_deleteFlight(managerPtr, 0)); /* does not exist */ assert(manager_queryFlight(managerPtr, 0) == -1); /* does not exist */ assert(manager_deleteCustomer(managerPtr, 0)); /* Test query interface for cars */ assert(manager_addCustomer(managerPtr, 0)); assert(manager_queryCar(managerPtr, 0) == -1); /* does not exist */ assert(manager_queryCarPrice(managerPtr, 0) == -1); /* does not exist */ assert(manager_addCar(managerPtr, 0, 1, 2)); assert(manager_queryCar(managerPtr, 0) == 1); assert(manager_queryCarPrice(managerPtr, 0) == 2); assert(manager_addCar(managerPtr, 0, 1, -1)); assert(manager_queryCar(managerPtr, 0) == 2); assert(manager_reserveCar(managerPtr, 0, 0)); assert(manager_queryCar(managerPtr, 0) == 1); assert(manager_deleteCar(managerPtr, 0, 1)); assert(manager_queryCar(managerPtr, 0) == 0); assert(manager_queryCarPrice(managerPtr, 0) == 2); assert(manager_addCar(managerPtr, 0, 1, 1)); assert(manager_queryCarPrice(managerPtr, 0) == 1); assert(manager_deleteCustomer(managerPtr, 0)); assert(manager_queryCar(managerPtr, 0) == 2); assert(manager_deleteCar(managerPtr, 0, 2)); /* Test query interface for rooms */ assert(manager_addCustomer(managerPtr, 0)); assert(manager_queryRoom(managerPtr, 0) == -1); /* does not exist */ assert(manager_queryRoomPrice(managerPtr, 0) == -1); /* does not exist */ assert(manager_addRoom(managerPtr, 0, 1, 2)); assert(manager_queryRoom(managerPtr, 0) == 1); assert(manager_queryRoomPrice(managerPtr, 0) == 2); assert(manager_addRoom(managerPtr, 0, 1, -1)); assert(manager_queryRoom(managerPtr, 0) == 2); assert(manager_reserveRoom(managerPtr, 0, 0)); assert(manager_queryRoom(managerPtr, 0) == 1); assert(manager_deleteRoom(managerPtr, 0, 1)); assert(manager_queryRoom(managerPtr, 0) == 0); assert(manager_queryRoomPrice(managerPtr, 0) == 2); assert(manager_addRoom(managerPtr, 0, 1, 1)); assert(manager_queryRoomPrice(managerPtr, 0) == 1); assert(manager_deleteCustomer(managerPtr, 0)); assert(manager_queryRoom(managerPtr, 0) == 2); assert(manager_deleteRoom(managerPtr, 0, 2)); /* Test query interface for flights */ assert(manager_addCustomer(managerPtr, 0)); assert(manager_queryFlight(managerPtr, 0) == -1); /* does not exist */ assert(manager_queryFlightPrice(managerPtr, 0) == -1); /* does not exist */ assert(manager_addFlight(managerPtr, 0, 1, 2)); assert(manager_queryFlight(managerPtr, 0) == 1); assert(manager_queryFlightPrice(managerPtr, 0) == 2); assert(manager_addFlight(managerPtr, 0, 1, -1)); assert(manager_queryFlight(managerPtr, 0) == 2); assert(manager_reserveFlight(managerPtr, 0, 0)); assert(manager_queryFlight(managerPtr, 0) == 1); assert(manager_addFlight(managerPtr, 0, 1, 1)); assert(manager_queryFlightPrice(managerPtr, 0) == 1); assert(manager_deleteCustomer(managerPtr, 0)); assert(manager_queryFlight(managerPtr, 0) == 3); assert(manager_deleteFlight(managerPtr, 0)); /* Test query interface for customer bill */ assert(manager_queryCustomerBill(managerPtr, 0) == -1); /* does not exist */ assert(manager_addCustomer(managerPtr, 0)); assert(manager_queryCustomerBill(managerPtr, 0) == 0); assert(manager_addCar(managerPtr, 0, 1, 1)); assert(manager_addRoom(managerPtr, 0, 1, 2)); assert(manager_addFlight(managerPtr, 0, 1, 3)); assert(manager_reserveCar(managerPtr, 0, 0)); assert(manager_queryCustomerBill(managerPtr, 0) == 1); assert(!manager_reserveCar(managerPtr, 0, 0)); assert(manager_queryCustomerBill(managerPtr, 0) == 1); assert(manager_addCar(managerPtr, 0, 0, 2)); assert(manager_queryCar(managerPtr, 0) == 0); assert(manager_queryCustomerBill(managerPtr, 0) == 1); assert(manager_reserveRoom(managerPtr, 0, 0)); assert(manager_queryCustomerBill(managerPtr, 0) == 3); assert(!manager_reserveRoom(managerPtr, 0, 0)); assert(manager_queryCustomerBill(managerPtr, 0) == 3); assert(manager_addRoom(managerPtr, 0, 0, 2)); assert(manager_queryRoom(managerPtr, 0) == 0); assert(manager_queryCustomerBill(managerPtr, 0) == 3); assert(manager_reserveFlight(managerPtr, 0, 0)); assert(manager_queryCustomerBill(managerPtr, 0) == 6); assert(!manager_reserveFlight(managerPtr, 0, 0)); assert(manager_queryCustomerBill(managerPtr, 0) == 6); assert(manager_addFlight(managerPtr, 0, 0, 2)); assert(manager_queryFlight(managerPtr, 0) == 0); assert(manager_queryCustomerBill(managerPtr, 0) == 6); assert(manager_deleteCustomer(managerPtr, 0)); assert(manager_deleteCar(managerPtr, 0, 1)); assert(manager_deleteRoom(managerPtr, 0, 1)); assert(manager_deleteFlight(managerPtr, 0)); /* Test reservation interface */ assert(manager_addCustomer(managerPtr, 0)); assert(manager_queryCustomerBill(managerPtr, 0) == 0); assert(manager_addCar(managerPtr, 0, 1, 1)); assert(manager_addRoom(managerPtr, 0, 1, 2)); assert(manager_addFlight(managerPtr, 0, 1, 3)); assert(!manager_cancelCar(managerPtr, 0, 0)); /* do not have reservation */ assert(manager_reserveCar(managerPtr, 0, 0)); assert(manager_queryCar(managerPtr, 0) == 0); assert(manager_cancelCar(managerPtr, 0, 0)); assert(manager_queryCar(managerPtr, 0) == 1); assert(!manager_cancelRoom(managerPtr, 0, 0)); /* do not have reservation */ assert(manager_reserveRoom(managerPtr, 0, 0)); assert(manager_queryRoom(managerPtr, 0) == 0); assert(manager_cancelRoom(managerPtr, 0, 0)); assert(manager_queryRoom(managerPtr, 0) == 1); assert(!manager_cancelFlight(managerPtr, 0, 0)); /* do not have reservation */ assert(manager_reserveFlight(managerPtr, 0, 0)); assert(manager_queryFlight(managerPtr, 0) == 0); assert(manager_cancelFlight(managerPtr, 0, 0)); assert(manager_queryFlight(managerPtr, 0) == 1); assert(manager_deleteCar(managerPtr, 0, 1)); assert(manager_deleteRoom(managerPtr, 0, 1)); assert(manager_deleteFlight(managerPtr, 0)); assert(manager_deleteCustomer(managerPtr, 0)); manager_free(managerPtr); puts("All tests passed."); return 0; } #endif /* TEST_MANAGER */ /* ============================================================================= * * End of manager.c * * ============================================================================= */
{ "content_hash": "565fed29fe1296801fde30df68a81b48", "timestamp": "", "source": "github", "line_count": 974, "max_line_length": 113, "avg_line_length": 33.52361396303901, "alnum_prop": 0.5376393482788191, "repo_name": "nmldiegues/tuner-icac14", "id": "60f8a1d55a0ad41f0a6fa5d384cdd9db7fdd8977", "size": "35651", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "tuner-selective/vacation/manager.c", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "2428016" }, { "name": "C++", "bytes": "57985" }, { "name": "Makefile", "bytes": "26959" }, { "name": "Objective-C", "bytes": "21552" }, { "name": "Python", "bytes": "3242" }, { "name": "Shell", "bytes": "1215" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>dpdgraph: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.15.1 / dpdgraph - 0.6.8</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> dpdgraph <small> 0.6.8 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-05-04 02:00:26 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-05-04 02:00:26 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils conf-gmp 4 Virtual package relying on a GMP lib system installation coq 8.15.1 Formal proof management system dune 3.1.1 Fast, portable, and opinionated build system ocaml 4.13.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.13.1 Official release 4.13.1 ocaml-config 2 OCaml Switch Configuration ocaml-options-vanilla 1 Ensure that OCaml is compiled with no special options enabled ocamlfind 1.9.3 A library manager for OCaml zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;yves.bertot@inria.fr&quot; license: &quot;LGPL-2.1-only&quot; homepage: &quot;https://github.com/karmaki/coq-dpdgraph&quot; build: [ [&quot;./configure&quot;] [&quot;echo&quot; &quot;%{jobs}%&quot; &quot;jobs for the linter&quot;] [make &quot;-j%{jobs}%&quot; &quot;WARN_ERR=&quot;] ] bug-reports: &quot;https://github.com/karmaki/coq-dpdgraph/issues&quot; dev-repo: &quot;git+https://github.com/karmaki/coq-dpdgraph.git&quot; install: [ [make &quot;install&quot; &quot;BINDIR=%{bin}%&quot;] ] depends: [ &quot;ocaml&quot; {} &quot;coq&quot; {&gt;= &quot;8.12&quot; &amp; &lt; &quot;8.13~&quot;} &quot;ocamlgraph&quot; ] authors: [ &quot;Anne Pacalet&quot; &quot;Yves Bertot&quot;] synopsis: &quot;Compute dependencies between Coq objects (definitions, theorems) and produce graphs&quot; url { src: &quot;https://github.com/Karmaki/coq-dpdgraph/releases/download/v0.6.8/coq-dpdgraph-0.6.8.tgz&quot; checksum: &quot;sha256=7c40b5c362240f3968ce3f6ff39f0c2b08f8687091ff487c477ff066c738a983&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-dpdgraph.0.6.8 coq.8.15.1</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.15.1). The following dependencies couldn&#39;t be met: - coq-dpdgraph -&gt; coq &lt; 8.13~ -&gt; ocaml &lt; 4.12 base of this switch (use `--unlock-base&#39; to force) No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-dpdgraph.0.6.8</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
{ "content_hash": "65f45301a1390f777176e76d7ac36e2a", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 159, "avg_line_length": 41.21556886227545, "alnum_prop": 0.535231730350138, "repo_name": "coq-bench/coq-bench.github.io", "id": "f441c0a2ddaf384157dcb16d941aa7d3d97857dd", "size": "6908", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.13.1-2.0.10/released/8.15.1/dpdgraph/0.6.8.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
/* Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.camunda.bpm.container.impl.ejb.deployment; import org.camunda.bpm.container.ExecutorService; import org.camunda.bpm.container.impl.jmx.kernel.MBeanService; import org.camunda.bpm.container.impl.jmx.kernel.MBeanServiceContainer; /** * <p>MBean Service delegating to the Jca ExecutorService</p> * * @author Daniel Meyer */ public class JcaExecutorServiceDelegate implements MBeanService<ExecutorService>, JcaExecutorServiceDelegateMBean { private ExecutorService executorService; public JcaExecutorServiceDelegate(ExecutorService executorService) { this.executorService = executorService; } public void start(MBeanServiceContainer mBeanServiceContainer) { // nothing to do } public void stop(MBeanServiceContainer mBeanServiceContainer) { // nothing to do } public ExecutorService getValue() { return executorService; } }
{ "content_hash": "6d040cd92a5700d65958b93799d87b4b", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 115, "avg_line_length": 32.79545454545455, "alnum_prop": 0.7671517671517671, "repo_name": "1and1/camunda-bpm-platform", "id": "ca92bb588e79ad0c80192cb461825464628282f3", "size": "1443", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "javaee/ejb-service/src/main/java/org/camunda/bpm/container/impl/ejb/deployment/JcaExecutorServiceDelegate.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "3524" }, { "name": "CSS", "bytes": "41455" }, { "name": "HTML", "bytes": "207609" }, { "name": "Java", "bytes": "8707800" }, { "name": "JavaScript", "bytes": "636111" }, { "name": "Shell", "bytes": "3423" }, { "name": "XSLT", "bytes": "13061" } ], "symlink_target": "" }
module AgnosticBackend module Queryable class Attribute < TreeNode include AgnosticBackend::Utilities attr_reader :name, :parent def initialize(name, parent:, context:) super([], context) @name, @parent = name, parent end def ==(o) super && o.name == name end def type value_for_key(context.index.schema, name).try(:type) end end end end
{ "content_hash": "8b495a7294f2371b8da8886959502174", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 60, "avg_line_length": 19.681818181818183, "alnum_prop": 0.5866050808314087, "repo_name": "tlatsas/agnostic_backend", "id": "2e6cd3dec8d17cbe03b9eb6a787cd7b56bf0d465", "size": "433", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/agnostic_backend/queryable/attribute.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "231255" }, { "name": "Shell", "bytes": "115" } ], "symlink_target": "" }
use std::fmt::Display; use std::marker::PhantomData; use gtk::{ Button, Inhibit, Label, Window, WindowType, prelude::ButtonExt, prelude::ContainerExt, prelude::LabelExt, prelude::WidgetExt, }; use gtk::Orientation::{Horizontal, Vertical}; use relm::{ connect, Component, ContainerWidget, Relm, Update, Widget, WidgetTest, }; use relm_derive::Msg; use self::CounterMsg::*; use self::Msg::*; trait IncDec { fn dec(&mut self); fn inc(&mut self); } impl IncDec for i32 { fn dec(&mut self) { *self -= 1; } fn inc(&mut self) { *self += 1; } } impl IncDec for i64 { fn dec(&mut self) { *self -= 1; } fn inc(&mut self) { *self += 1; } } struct Model<S, T> { counter1: S, _counter2: T, } #[derive(Msg)] enum CounterMsg { Decrement, Increment, } struct Counter<S, T> { counter_label: Label, model: Model<S, T>, vbox: gtk::Box, _phantom1: PhantomData<S>, _phantom2: PhantomData<T>, } impl<S: Clone + Display + IncDec, T: Clone + Display + IncDec> Update for Counter<S, T> { type Model = Model<S, T>; type ModelParam = (S, T); type Msg = CounterMsg; fn model(_: &Relm<Self>, (value1, value2): (S, T)) -> Self::Model { Model { counter1: value1, _counter2: value2, } } fn update(&mut self, event: CounterMsg) { let label = &self.counter_label; match event { Decrement => { self.model.counter1.dec(); label.set_text(&self.model.counter1.to_string()); }, Increment => { self.model.counter1.inc(); label.set_text(&self.model.counter1.to_string()); }, } } } impl<S: Clone + Display + IncDec, T: Clone + Display + IncDec> Widget for Counter<S, T> { type Root = gtk::Box; fn root(&self) -> Self::Root { self.vbox.clone() } fn view(relm: &Relm<Self>, model: Self::Model) -> Self { let vbox = gtk::Box::new(Vertical, 0); let plus_button = Button::with_label("+"); vbox.add(&plus_button); let counter_label = Label::new(Some(model.counter1.to_string().as_ref())); counter_label.set_widget_name("label"); vbox.add(&counter_label); let minus_button = Button::with_label("-"); vbox.add(&minus_button); connect!(relm, plus_button, connect_clicked(_), Increment); connect!(relm, minus_button, connect_clicked(_), Decrement); Counter { counter_label: counter_label, model, vbox: vbox, _phantom1: PhantomData, _phantom2: PhantomData, } } } #[derive(Msg)] enum Msg { Quit, } struct Components { _counter1: Component<Counter<i32, i64>>, _counter2: Component<Counter<i32, i64>>, } #[derive(Clone)] struct Widgets { counter1: <Counter<i32, i64> as Widget>::Root, counter2: gtk::Box, window: Window, } struct Win { _components: Components, widgets: Widgets, } impl Update for Win { type Model = (); type ModelParam = (); type Msg = Msg; fn model(_: &Relm<Self>, _: ()) -> () { () } fn update(&mut self, event: Msg) { match event { Quit => gtk::main_quit(), } } } impl Widget for Win { type Root = Window; fn root(&self) -> Self::Root { self.widgets.window.clone() } fn view(relm: &Relm<Self>, _model: ()) -> Win { let window = Window::new(WindowType::Toplevel); let hbox = gtk::Box::new(Horizontal, 0); let counter1 = hbox.add_widget::<Counter<i32, i64>>((2, 3)); let counter2 = hbox.add_widget::<Counter<i32, i64>>((3, 4)); window.add(&hbox); window.show_all(); connect!(relm, window, connect_delete_event(_, _), return (Some(Quit), Inhibit(false))); Win { widgets: Widgets { counter1: counter1.widget().clone(), counter2: counter2.widget().clone(), window: window, }, _components: Components { _counter1: counter1, _counter2: counter2, }, } } } impl WidgetTest for Win { type Streams = (); fn get_streams(&self) -> Self::Streams { } type Widgets = Widgets; fn get_widgets(&self) -> Self::Widgets { self.widgets.clone() } } fn main() { Win::run(()).expect("Win::run failed"); } #[cfg(test)] mod tests { use gtk::{Label, prelude::LabelExt}; use gtk_test::{assert_text, find_child_by_name}; use crate::Win; #[test] fn model_params() { let (_component, _, widgets) = relm::init_test::<Win>(()).expect("init_test failed"); let label1: Label = find_child_by_name(&widgets.counter1, "label").expect("label"); let label2: Label = find_child_by_name(&widgets.counter2, "label").expect("label"); assert_text!(label1, 2); assert_text!(label2, 3); } }
{ "content_hash": "f399ae97383ae9781ba6cd0b006759c7", "timestamp": "", "source": "github", "line_count": 243, "max_line_length": 96, "avg_line_length": 21.152263374485596, "alnum_prop": 0.5348249027237354, "repo_name": "antoyo/relm", "id": "12ff5a0deaeec73af60954c929e7cdd84490c16c", "size": "6280", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "relm-examples/tests/multi-generic-widget.rs", "mode": "33188", "license": "mit", "language": [ { "name": "Rust", "bytes": "587474" }, { "name": "Shell", "bytes": "183" } ], "symlink_target": "" }
CREATE TABLE TB_LANCA_ARQUIVO ( ID INTEGER NOT NULL , ID_ARQU_REMESSA INTEGER NOT NULL , TP_ARQUIVO NCHAR (3) , DT_ENVIO DATE , DT_RECEBIMENTO INTEGER , NM_CAMINHO_ARQUIVO NVARCHAR2 (249) ) ; CREATE INDEX TB_LANCA_ARQUIVO__IDX ON TB_LANCA_ARQUIVO ( ID ASC ) ; ALTER TABLE TB_LANCA_ARQUIVO ADD CONSTRAINT TB_LANCA_ARQUIVO_PK PRIMARY KEY ( ID ) ; CREATE TABLE TB_LANCA_AVALIACAO ( ID INTEGER NOT NULL , ID_AVALIACAO_ROOT INTEGER NOT NULL , ID_USU_AVALIADOR INTEGER NOT NULL , NM_TITULO NVARCHAR2 (250) , DT_AVALIACAO DATE , SN_STATUS CHAR (1) ) ; CREATE INDEX TB_LANCA_AVALIACAO__IDX ON TB_LANCA_AVALIACAO ( ID ASC ) ; ALTER TABLE TB_LANCA_AVALIACAO ADD CONSTRAINT TB_LANCA_AVALIACAO_PK PRIMARY KEY ( ID ) ; CREATE TABLE TB_LANCA_BOLETO ( ID INTEGER NOT NULL , DT_GERACAO DATE , DT_VENCIMENTO DATE , VL_VALOR NUMBER (10,2) , LO_DESCRICAO CLOB , CD_CAMINHO_BOLETO NVARCHAR2 (250) ) ; CREATE INDEX TB_LANCA_BOLETO__IDX ON TB_LANCA_BOLETO ( ID ASC ) ; ALTER TABLE TB_LANCA_BOLETO ADD CONSTRAINT TB_LANCA_BOLETO_PK PRIMARY KEY ( ID ) ; CREATE TABLE TB_LANCA_CLIENTE ( ID INTEGER NOT NULL , NM_TITULO NVARCHAR2 (1) , CD_FORNECEDOR INTEGER ) ; CREATE INDEX TB_LANCA_CLIENTE__IDX ON TB_LANCA_CLIENTE ( ID ASC ) ; ALTER TABLE TB_LANCA_CLIENTE ADD CONSTRAINT TB_LANCA_CLIENTE_PK PRIMARY KEY ( ID ) ; CREATE TABLE TB_LANCA_CLIENTE_SETOR ( ID INTEGER NOT NULL , ID_CLIENTE INTEGER NOT NULL , ID_SETOR INTEGER NOT NULL ) ; ALTER TABLE TB_LANCA_CLIENTE_SETOR ADD CONSTRAINT TB_LANCA_CLIENTE_SETOR_PK PRIMARY KEY ( ID ) ; CREATE TABLE TB_LANCA_CONTRATO ( ID INTEGER NOT NULL , ID_CLIENTE INTEGER NOT NULL , NM_TITULO NVARCHAR2 (220) , DT_INICIO DATE , DT_FINAL DATE , DT_REAJUSTE DATE ) ; CREATE INDEX TB_CONTRATO__IDX ON TB_LANCA_CONTRATO ( ID ASC ) ; ALTER TABLE TB_LANCA_CONTRATO ADD CONSTRAINT TB_CONTRATO_PK PRIMARY KEY ( ID ) ; CREATE TABLE TB_LANCA_LANCAMENTO ( ID INTEGER NOT NULL , ID_CONTRATO INTEGER NOT NULL , ID_SERVICO INTEGER NOT NULL , ID_USU_CONTRATO INTEGER NOT NULL , ID_USU_LANCADOR INTEGER NOT NULL , ID_AVALICAO INTEGER NOT NULL , VL_LANCAMENTO NUMBER (10,2) , VL_FIXO NUMBER (10,2) , VL_VARIAVEL NUMBER (10,2) , DT_LANCAMENTO DATE , DT_COMPETENCIA DATE ) ; CREATE INDEX TB_LANCA_LANCAMENTO__IDX ON TB_LANCA_LANCAMENTO ( ID ASC ) ; ALTER TABLE TB_LANCA_LANCAMENTO ADD CONSTRAINT TB_LANCA_LANCAMENTO_PK PRIMARY KEY ( ID ) ; CREATE TABLE TB_LANCA_LANCAMENTO_BOLETO ( ID INTEGER NOT NULL , ID_BOLETO INTEGER NOT NULL , ID_LANCAMENTO INTEGER NOT NULL ) ; CREATE INDEX TB_LNC_LNC_BLT__IDX ON TB_LANCA_LANCAMENTO_BOLETO ( ID ASC ) ; ALTER TABLE TB_LANCA_LANCAMENTO_BOLETO ADD CONSTRAINT TB_LANCA_LANCAMENTO_BOLETO_PK PRIMARY KEY ( ID ) ; CREATE TABLE TB_LANCA_SERVICO ( ID INTEGER NOT NULL , ID_TP_SERVICO INTEGER NOT NULL , NM_TITULO NVARCHAR2 (250) , CD_HISTORICO_PADRAO INTEGER , CD_TP_DOCUMENTO INTEGER , CD_CONTA_CONTABIL INTEGER , CD_CONTA_RESULTADO INTEGER , CD_CONTA_CUSTO INTEGER ) ; CREATE INDEX TB_SERVICO__IDX ON TB_LANCA_SERVICO ( ID ASC ) ; ALTER TABLE TB_LANCA_SERVICO ADD CONSTRAINT TB_LANCA_SERVICO_PK PRIMARY KEY ( ID ) ; CREATE TABLE TB_LANCA_SERVICO_CONTRATO ( ID INTEGER NOT NULL , ID_SERVICO INTEGER NOT NULL , ID_CONTRATO INTEGER NOT NULL , VL_SERVICO NUMBER (10,2) ) ; CREATE INDEX TB_LANCA_SERVICO_CONTRATO__IDX ON TB_LANCA_SERVICO_CONTRATO ( ID ASC ) ; ALTER TABLE TB_LANCA_SERVICO_CONTRATO ADD CONSTRAINT TB_LANCA_SERVICO_CONTRATO_PK PRIMARY KEY ( ID ) ; CREATE TABLE TB_LANCA_SERVICO_USUARIO ( ID INTEGER NOT NULL , ID_SERVICO INTEGER NOT NULL , ID_USUARIO INTEGER NOT NULL ) ; CREATE INDEX TB_LANCA_SERVICO_USUARIO__IDX ON TB_LANCA_SERVICO_USUARIO ( ID ASC ) ; ALTER TABLE TB_LANCA_SERVICO_USUARIO ADD CONSTRAINT TB_LANCA_SERVICO_USUARIO_PK PRIMARY KEY ( ID ) ; CREATE TABLE TB_LANCA_SETOR ( ID INTEGER NOT NULL , NM_TITULO NVARCHAR2 (245) , LO_DETALHES CLOB , VL_AREA NUMBER (10,2) ) ; CREATE INDEX TB_LANCA_SETOR__IDX ON TB_LANCA_SETOR ( ID ASC ) ; ALTER TABLE TB_LANCA_SETOR ADD CONSTRAINT TB_LANCA_SETOR_PK PRIMARY KEY ( ID ) ; CREATE TABLE TB_LANCA_TIPO_SERVICO ( ID INTEGER NOT NULL , NM_TITULO NVARCHAR2 (250) , SN_COBRA_SETOR CHAR (1) ) ; COMMENT ON COLUMN TB_LANCA_TIPO_SERVICO.SN_COBRA_SETOR IS 'INDICA QUE O SERVIÇO DEVE SER COBRADO POR SETOR' ; ALTER TABLE TB_LANCA_TIPO_SERVICO ADD CONSTRAINT TB_LANCA_TIPO_SERVICO_PK PRIMARY KEY ( ID ) ; CREATE TABLE TB_LANCA_TRANSMISSAO ( ID INTEGER NOT NULL , ID_ARQUIVO INTEGER NOT NULL , DT_TRANSMISSAO DATE ) ; CREATE INDEX TB_LANCA_TRANSMISSAO__IDX ON TB_LANCA_TRANSMISSAO ( ID ASC ) ; ALTER TABLE TB_LANCA_TRANSMISSAO ADD CONSTRAINT TB_LANCA_TRANSMISSAO_PK PRIMARY KEY ( ID ) ; CREATE TABLE TB_LANCA_TRANS_LANC ( ID INTEGER NOT NULL , ID_TRANSMISSAO INTEGER NOT NULL , ID_LANCAMENTO INTEGER NOT NULL ) ; CREATE INDEX TB_LANCA_TRANS_LANC__IDX ON TB_LANCA_TRANS_LANC ( ID ASC ) ; ALTER TABLE TB_LANCA_TRANS_LANC ADD CONSTRAINT TB_LANCA_TRANS_LANC_PK PRIMARY KEY ( ID ) ; CREATE TABLE TB_LANCA_USUARIO ( ID INTEGER NOT NULL , ID_USER_PTC INTEGER NOT NULL , CD_PERFIL CHAR (1) NOT NULL ) ; COMMENT ON COLUMN TB_LANCA_USUARIO.CD_PERFIL IS 'A = Administrador; G = Gestores; C = Controladoria; F = Financeiro' ; CREATE INDEX TB_LANCA_USUARIO__IDX ON TB_LANCA_USUARIO ( ID ASC ) ; ALTER TABLE TB_LANCA_USUARIO ADD CONSTRAINT TB_LANCA_USUARIO_PK PRIMARY KEY ( ID ) ; ALTER TABLE TB_LANCA_ARQUIVO ADD CONSTRAINT ID_ARQUIVO_FK FOREIGN KEY ( ID_ARQU_REMESSA ) REFERENCES TB_LANCA_ARQUIVO ( ID ) ; ALTER TABLE TB_LANCA_TRANSMISSAO ADD CONSTRAINT ID_ARQUIVO_FKv2 FOREIGN KEY ( ID_ARQUIVO ) REFERENCES TB_LANCA_ARQUIVO ( ID ) ; ALTER TABLE TB_LANCA_LANCAMENTO ADD CONSTRAINT ID_AVALIACAO_FK FOREIGN KEY ( ID_AVALICAO ) REFERENCES TB_LANCA_AVALIACAO ( ID ) ; ALTER TABLE TB_LANCA_AVALIACAO ADD CONSTRAINT ID_AVALIACAO_ROOT_FK FOREIGN KEY ( ID_AVALIACAO_ROOT ) REFERENCES TB_LANCA_AVALIACAO ( ID ) ; ALTER TABLE TB_LANCA_LANCAMENTO_BOLETO ADD CONSTRAINT ID_BOLETO_FK FOREIGN KEY ( ID_BOLETO ) REFERENCES TB_LANCA_BOLETO ( ID ) ; ALTER TABLE TB_LANCA_CLIENTE_SETOR ADD CONSTRAINT ID_CLIENTE_FK FOREIGN KEY ( ID_CLIENTE ) REFERENCES TB_LANCA_CLIENTE ( ID ) ; ALTER TABLE TB_LANCA_CONTRATO ADD CONSTRAINT ID_CLIENTE_FKv2 FOREIGN KEY ( ID_CLIENTE ) REFERENCES TB_LANCA_CLIENTE ( ID ) ; ALTER TABLE TB_LANCA_LANCAMENTO ADD CONSTRAINT ID_CONTRATO_FK FOREIGN KEY ( ID_CONTRATO ) REFERENCES TB_LANCA_CONTRATO ( ID ) ; ALTER TABLE TB_LANCA_SERVICO_CONTRATO ADD CONSTRAINT ID_CONTRATO_FKv2 FOREIGN KEY ( ID_CONTRATO ) REFERENCES TB_LANCA_CONTRATO ( ID ) ; ALTER TABLE TB_LANCA_LANCAMENTO_BOLETO ADD CONSTRAINT ID_LANCAMENTO_FK FOREIGN KEY ( ID_LANCAMENTO ) REFERENCES TB_LANCA_LANCAMENTO ( ID ) ; ALTER TABLE TB_LANCA_TRANS_LANC ADD CONSTRAINT ID_LANCAMENTO_FKv2 FOREIGN KEY ( ID_LANCAMENTO ) REFERENCES TB_LANCA_LANCAMENTO ( ID ) ; ALTER TABLE TB_LANCA_LANCAMENTO ADD CONSTRAINT ID_SERVICO_FK FOREIGN KEY ( ID_SERVICO ) REFERENCES TB_LANCA_SERVICO ( ID ) ; ALTER TABLE TB_LANCA_SERVICO_CONTRATO ADD CONSTRAINT ID_SERVICO_FKv2 FOREIGN KEY ( ID_SERVICO ) REFERENCES TB_LANCA_SERVICO ( ID ) ; ALTER TABLE TB_LANCA_SERVICO_USUARIO ADD CONSTRAINT ID_SERVICO_FKv3 FOREIGN KEY ( ID_SERVICO ) REFERENCES TB_LANCA_SERVICO ( ID ) ; ALTER TABLE TB_LANCA_CLIENTE_SETOR ADD CONSTRAINT ID_SETOR_FK FOREIGN KEY ( ID_SETOR ) REFERENCES TB_LANCA_SETOR ( ID ) ; ALTER TABLE TB_LANCA_SERVICO ADD CONSTRAINT ID_TP_SERVICO_FK FOREIGN KEY ( ID_TP_SERVICO ) REFERENCES TB_LANCA_TIPO_SERVICO ( ID ) ; ALTER TABLE TB_LANCA_TRANS_LANC ADD CONSTRAINT ID_TRANSMISSAO_FK FOREIGN KEY ( ID_TRANSMISSAO ) REFERENCES TB_LANCA_TRANSMISSAO ( ID ) ; ALTER TABLE TB_LANCA_USUARIO ADD CONSTRAINT ID_USER_PTC_FK FOREIGN KEY ( ID_USER_PTC ) REFERENCES TB_PTC_USUARIO_PUSER ( ID_PUSER ) ; ALTER TABLE TB_LANCA_SERVICO_USUARIO ADD CONSTRAINT ID_USUARIO_FK FOREIGN KEY ( ID_USUARIO ) REFERENCES TB_LANCA_USUARIO ( ID ) ; ALTER TABLE TB_LANCA_AVALIACAO ADD CONSTRAINT ID_USU_AVALIADOR_FK FOREIGN KEY ( ID_USU_AVALIADOR ) REFERENCES TB_PTC_USUARIO_PUSER ( ID_PUSER ) ; ALTER TABLE TB_LANCA_LANCAMENTO ADD CONSTRAINT ID_USU_CONTRATO_FK FOREIGN KEY ( ID_USU_CONTRATO ) REFERENCES TB_PTC_USUARIO_PUSER ( ID_PUSER ) ; ALTER TABLE TB_LANCA_LANCAMENTO ADD CONSTRAINT ID_USU_LANCADOR_FK FOREIGN KEY ( ID_USU_LANCADOR ) REFERENCES TB_PTC_USUARIO_PUSER ( ID_PUSER ) ; -- Relatório do Resumo do Oracle SQL Developer Data Modeler: -- -- CREATE TABLE 16 -- CREATE INDEX 14 -- ALTER TABLE 38 -- CREATE VIEW 0 -- ALTER VIEW 0 -- CREATE PACKAGE 0 -- CREATE PACKAGE BODY 0 -- CREATE PROCEDURE 0 -- CREATE FUNCTION 0 -- CREATE TRIGGER 0 -- ALTER TRIGGER 0 -- CREATE COLLECTION TYPE 0 -- CREATE STRUCTURED TYPE 0 -- CREATE STRUCTURED TYPE BODY 0 -- CREATE CLUSTER 0 -- CREATE CONTEXT 0 -- CREATE DATABASE 0 -- CREATE DIMENSION 0 -- CREATE DIRECTORY 0 -- CREATE DISK GROUP 0 -- CREATE ROLE 0 -- CREATE ROLLBACK SEGMENT 0 -- CREATE SEQUENCE 0 -- CREATE MATERIALIZED VIEW 0 -- CREATE SYNONYM 0 -- CREATE TABLESPACE 0 -- CREATE USER 0 -- -- DROP TABLESPACE 0 -- DROP DATABASE 0 -- -- REDACTION POLICY 0 -- -- ORDS DROP SCHEMA 0 -- ORDS ENABLE SCHEMA 0 -- ORDS ENABLE OBJECT 0 -- -- ERRORS 0 -- WARNINGS 0
{ "content_hash": "43970db4d43867018d4c43c997b7ed81", "timestamp": "", "source": "github", "line_count": 308, "max_line_length": 145, "avg_line_length": 34.34415584415584, "alnum_prop": 0.6388731329173757, "repo_name": "jairoandre/lance-web-hot", "id": "f3e657e255de8e4ea4cb093721b3bb41812bd175", "size": "10757", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "db.sql", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "28" }, { "name": "CSS", "bytes": "2784" }, { "name": "JavaScript", "bytes": "128950" } ], "symlink_target": "" }
<?php namespace Oro\Bundle\PlatformBundle\Form; use Doctrine\Common\Cache\CacheProvider; use Oro\Bundle\PlatformBundle\Provider\PackageProvider; class UrlGenerator { const URL = '//r.orocrm.com/a/'; const FORM_JS = 'f.js'; /** @var PackageProvider */ protected $packageProvider; /** @var CacheProvider */ protected $cacheProvider; /** * @var array */ private static $aliases = [ PackageProvider::PACKAGE_PLATFORM => 'p', PackageProvider::PACKAGE_COMMERCE => 'o', PackageProvider::PACKAGE_CRM => 'r', ]; /** * @param PackageProvider $packageProvider * @param CacheProvider $cacheProvider */ public function __construct(PackageProvider $packageProvider, CacheProvider $cacheProvider) { $this->packageProvider = $packageProvider; $this->cacheProvider = $cacheProvider; } /** * @return string */ public function getFormUrl() { if ($this->cacheProvider->contains('url')) { return $this->cacheProvider->fetch('url'); } $packages = $this->packageProvider->getOroPackages(false); $url = self::URL; foreach ($packages as $package) { $packageName = str_replace( PackageProvider::ORO_NAMESPACE . PackageProvider::NAMESPACE_DELIMITER, '', $package->getPrettyName() ); if (!array_key_exists($packageName, self::$aliases)) { continue; } $url .= sprintf('%s/%s/', self::$aliases[$packageName], $package->getPrettyVersion()); } $url .= self::FORM_JS; $this->cacheProvider->save('url', $url); return $url; } }
{ "content_hash": "0f707ca7872f18a650acb46588dd4000", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 98, "avg_line_length": 24.788732394366196, "alnum_prop": 0.5727272727272728, "repo_name": "trustify/oroplatform", "id": "d0ff8b79fd35d281c1fa89fedd0fdfb17012b19f", "size": "1760", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "src/Oro/Bundle/PlatformBundle/Form/UrlGenerator.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "723257" }, { "name": "Cucumber", "bytes": "8610" }, { "name": "HTML", "bytes": "1597517" }, { "name": "JavaScript", "bytes": "5554468" }, { "name": "PHP", "bytes": "29776857" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <?xml-model href="../schema/schema-att-wildcard1.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?> <root xmlns="http://www.example.com" b="a" l="a"> <child xmlns="http://www.other.com">
{ "content_hash": "a37b98da94c9ceb84b79ce2bd81bce2b", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 129, "avg_line_length": 65, "alnum_prop": 0.6730769230769231, "repo_name": "aerhard/linter-autocomplete-jing", "id": "e3322b96ba9f308207c885e1abeb9c7d1f6e6010", "size": "260", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "spec/autocomplete/xml/rng-att-wildcard1-1.xml", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "8229" }, { "name": "TypeScript", "bytes": "80384" } ], "symlink_target": "" }
function Sclass = ST_wentworth(phi) % Report wentworth class of a particular grain size phi % % function wentworth(phi) % % DESCRIPTION: % Report the wentworth of a grain size phi % % INPUT: % phi: sediment grain size in phi scale % % OUTPUT: % prints wentworth class to screen % % EXAMPLE USAGE % wentworth(2.5) % % Author(s): % Geoff Cowles (University of Massachusetts Dartmouth) % % Revision history % %============================================================================== global ftbverbose [~, subname] = fileparts(mfilename('fullpath')); if ftbverbose fprintf('\nbegin : %s\n', subname) end ClassNames = {'boulder','cobble','pebble','granule','very coarse sand', ... 'coarse sand','medium sand','fine sand','very fine sand','coarse silt', ... 'medium silt','fine silt','very fine silt','coarse clay','medium clay','fine clay'}; ClassLbound = [-1e6,-8,-6,-2,-1,0,1,2,3,4,5,6,7,8,9,10]; pts = find(phi-ClassLbound > 0); ClassIndex = pts(end); Sclass = char(ClassNames{ClassIndex}); %fprintf('class of phi = %f is: %s\n',phi,class); if ftbverbose fprintf('end : %s\n', subname) end
{ "content_hash": "b659254ac47cceb27d0e213121052858", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 88, "avg_line_length": 27.095238095238095, "alnum_prop": 0.616871704745167, "repo_name": "pwcazenave/fvcom-toolbox", "id": "c9da83e16d7cf1b0110e29b17773630cae2c7db6", "size": "1138", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "utilities/ST_wentworth.m", "mode": "33188", "license": "mit", "language": [ { "name": "Fortran", "bytes": "1745" }, { "name": "MATLAB", "bytes": "1331266" }, { "name": "Shell", "bytes": "309" }, { "name": "Tcl", "bytes": "17023" } ], "symlink_target": "" }
package org.wso2.carbon.mdm.mobileservices.windows.operations; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.wso2.carbon.mdm.mobileservices.windows.operations.util.Constants; import java.util.Iterator; import java.util.List; /** * Commands sent from the device. */ public class Replace { int commandId = -1; List<Item> items; public int getCommandId() { return commandId; } public void setCommandId(int commandId) { this.commandId = commandId; } public List<Item> getItems() { return items; } public void setItems(List<Item> items) { this.items = items; } public void buildReplaceElement(Document doc, Element rootElement) { if (getItems() != null) { Element replace = doc.createElement(Constants.REPLACE); rootElement.appendChild(replace); if (getCommandId() != -1) { Element commandId = doc.createElement(Constants.COMMAND_ID); commandId.appendChild(doc.createTextNode(String.valueOf(getCommandId()))); replace.appendChild(commandId); } if (getItems() != null) { for (Iterator<Item> itemIterator = getItems().iterator(); itemIterator.hasNext(); ) { Item item = itemIterator.next(); if (item != null) { item.buildItemElement(doc, replace); } } } } } }
{ "content_hash": "caa4d4fa33143b63317a5410ce03c226", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 89, "avg_line_length": 23.51851851851852, "alnum_prop": 0.6968503937007874, "repo_name": "jelacote/product-mdm", "id": "f63c68a02a58d0fca1e2bd08b51caf4dc8608c4c", "size": "1944", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "modules/mobile-agents/windows/jax-rs/src/main/java/org/wso2/carbon/mdm/mobileservices/windows/operations/Replace.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "3319" }, { "name": "CSS", "bytes": "145738" }, { "name": "HTML", "bytes": "465432" }, { "name": "Java", "bytes": "1318371" }, { "name": "JavaScript", "bytes": "965478" }, { "name": "Shell", "bytes": "5635" } ], "symlink_target": "" }
run_spec(__dirname, ["flow", "babel", "typescript"], { jsxBracketSameLine: true, errors: { typescript: ["in-end-tag.js"], }, });
{ "content_hash": "1935d2a3453b3df03471632474dc0d49", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 54, "avg_line_length": 23.166666666666668, "alnum_prop": 0.5827338129496403, "repo_name": "jlongster/prettier", "id": "39e36879a2104819254ba172775307183dbb7626", "size": "139", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "tests/format/jsx/comments/jsfmt.spec.js", "mode": "33188", "license": "mit", "language": [ { "name": "Emacs Lisp", "bytes": "9170" }, { "name": "JavaScript", "bytes": "867713" } ], "symlink_target": "" }
FROM balenalib/nitrogen8mm-fedora:31-run RUN dnf -y update \ && dnf clean all \ && dnf -y install \ gzip \ java-1.8.0-openjdk \ java-1.8.0-openjdk-devel \ tar \ && dnf clean all # set JAVA_HOME ENV JAVA_HOME /usr/lib/jvm/java-openjdk 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 [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo $'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v8 \nOS: Fedora 31 \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nOpenJDK v8-jre \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info RUN echo $'#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \ && chmod +x /bin/sh-shim \ && cp /bin/sh /bin/sh.real \ && mv /bin/sh-shim /bin/sh
{ "content_hash": "16065048c951e967e684b2593e2a64fa", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 673, "avg_line_length": 58.90909090909091, "alnum_prop": 0.7106481481481481, "repo_name": "nghiant2710/base-images", "id": "05c4c2c368d0a76c0e579665fd10588a307c0b7c", "size": "1317", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "balena-base-images/openjdk/nitrogen8mm/fedora/31/8-jre/run/Dockerfile", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "144558581" }, { "name": "JavaScript", "bytes": "16316" }, { "name": "Shell", "bytes": "368690" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <!-- #%L U-QASAR %% Copyright (C) 2012 - 2015 U-QASAR Consortium %% Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. #L% --> <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> <properties> <entry key="label.success"><![CDATA[Die Bestätigung der Registrierung für <strong>{0}</strong> war erfolgreich. Sie können Sich jetzt mit Ihrer E-Mail Adresse (<em>{1}</em>) und Ihrem Passwort am System anmelden.]]></entry> <entry key="label.success.ldap"><![CDATA[Die Bestätigung der Registrierung für <strong>{0}</strong> war erfolgreich. Sie können Sich jetzt mit Ihrem LDAP Benutzernamen (<em>{1}</em>) und Ihrem LDAP Passwort am System anmelden.]]></entry> <entry key="label.error"><![CDATA[Die Bestätigung der Registrierung konnte nicht abgeschlossen werden!<br />Für den angegeben Token (<em>{0}</em>) konnte kein noch offener Registrierungsantrag gefunden werden.]]></entry> <entry key="page.title">Registrierung bestätigen</entry> <entry key="label.success.loginlink">Um zur Anmeldung zu gelangen, klicken Sie hier oder warten Sie {0} Sekunden.</entry> </properties>
{ "content_hash": "fcc3058165cc1c7768806cd4cbee7291", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 237, "avg_line_length": 56.724137931034484, "alnum_prop": 0.7337386018237082, "repo_name": "minzen/u-qasar.platform", "id": "93146f656649c9aab42c4dd0aff2cd2ddcf71a1b", "size": "1654", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "src/main/java/eu/uqasar/web/pages/auth/register/ConfirmRegistrationPage_de.properties.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "139122" }, { "name": "FreeMarker", "bytes": "50779" }, { "name": "HTML", "bytes": "443889" }, { "name": "Java", "bytes": "2767914" }, { "name": "JavaScript", "bytes": "232593" } ], "symlink_target": "" }
/* Code from Head First C. */ #include <stdio.h> #include <string.h> #include <errno.h> #include <stdlib.h> #include <sys/socket.h> #include <arpa/inet.h> #include <sys/types.h> #include <unistd.h> #include <signal.h> int listener_d = 0; void error(char *msg) { fprintf(stderr, "%s: %s\n", msg, strerror(errno)); exit(1); } int catch_signal(int sig, void (*handler)(int)) { struct sigaction action; action.sa_handler = handler; sigemptyset(&action.sa_mask); action.sa_flags = 0; return sigaction(sig, &action, NULL); } void handle_shutdown(int sig) { if (listener_d) close(listener_d); fprintf(stderr, "Bye!\n"); exit(EXIT_SUCCESS); } int open_listener_socket(void) { int s = socket(PF_INET, SOCK_STREAM, 0); if (s == -1) error("Can't open listener socket"); return s; } int open_client_socket(void) { static struct sockaddr_storage client_address; static unsigned int address_size = sizeof(client_address); int s; if ((s = accept(listener_d, (struct sockaddr *)&client_address, &address_size)) == -1) error("Can't open client socket"); return s; } void bind_to_port(int socket, int port) { struct sockaddr_in name; name.sin_family = PF_INET; name.sin_port = (in_port_t)htons(port); name.sin_addr.s_addr = htonl(INADDR_ANY); int reuse = 1; if (setsockopt(socket, SOL_SOCKET, SO_REUSEADDR, (char *)&reuse, sizeof(int)) == -1) error("Can't set the 'reuse' option on the socket"); if (bind(socket, (struct sockaddr *)&name, sizeof(name)) == -1) error("Can't bind to socket"); } int say(int socket, char *s) { int result = send(socket, s, strlen(s), 0); if (result == -1) fprintf(stderr, "%s: %s\n", "Error talking to the client", strerror(errno)); return result; } int read_in(int socket, char *buf, int len) { /* treat the socket stream as a regular IO stream, so we can do character IO */ FILE *fp = fdopen(socket, "r"); int i = 0, ch; /* eat any leading whitespace */ while (isspace(ch = fgetc(fp)) && ch != EOF) ; if (ferror(fp)) error("fgetc"); while (ch != '\n' && ch != EOF) { if (i < len) buf[i++] = ch; ch = fgetc(fp); } if (ferror(fp)) error("fgetc"); /* terminate the string, eating any trailing whitespace */ while (isspace(buf[--i])) { buf[i] = '\0'; } return strlen(buf); } int main(int argc, char *argv[]) { int connect_d = 0, rc = 0; char intro_msg[] = "Internet Knock-Knock Protocol Server\nKnock, knock.\n"; if (catch_signal(SIGINT, handle_shutdown) == -1) error("Setting interrupt handler"); int port = 30000; listener_d = open_listener_socket(); bind_to_port(listener_d, port); if (listen(listener_d, 10) == -1) error("Can't listen"); printf("Waiting for connection on port %d\n", port); char buf[255]; while (1) { connect_d = open_client_socket(); if (say(connect_d, intro_msg) == -1) { close(connect_d); continue; } read_in(connect_d, buf, sizeof(buf)); // check to make sure they said "Who's there?" if (say(connect_d, "Surrealist giraffe.\n") == -1) { close(connect_d); continue; } read_in(connect_d, buf, sizeof(buf)); // check to make sure they said "Surrealist giraffe who?" if (say(connect_d, "Bathtub full of brightly-colored machine tools.\n") == -1) { close(connect_d); continue; } close(connect_d); } return 0; }
{ "content_hash": "5081933044b0bdc563b85d165e5ccb3e", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 81, "avg_line_length": 21.496932515337424, "alnum_prop": 0.6024543378995434, "repo_name": "joeylmaalouf/ExercisesInC", "id": "4fd8d8a9ccabdc2ce3c95183ebdfff26636580e7", "size": "3504", "binary": false, "copies": "34", "ref": "refs/heads/master", "path": "exercises/ex11/ikkp-server.c", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "137309" }, { "name": "Makefile", "bytes": "1586" }, { "name": "Python", "bytes": "855" } ], "symlink_target": "" }
Overriding Default FOSUserBundle Forms ====================================== Overriding a Form Type ---------------------- The default forms packaged with the FOSUserBundle provide functionality for registering new user, updating your profile, changing your password and much more. These forms work well with the bundle's default classes and controllers. But, as you start to add more properties to your ``User`` class or you decide you want to add a few options to the registration form you will find that you need to override the forms in the bundle. Suppose that you have created an ORM user class with the following class name, ``AppBundle\Entity\User``. In this class, you have added a ``name`` property because you would like to save the user's name as well as their username and email address. Now, when a user registers for your site they should enter in their name as well as their username, email and password. Below is an example ``$name`` property and its validators. .. code-block:: php // src/AppBundle/Entity/User.php use FOS\UserBundle\Entity\User as BaseUser; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert; class User extends BaseUser { /** * @ORM\Id * @ORM\Column(type="integer") * @ORM\GeneratedValue(strategy="AUTO") */ protected $id; /** * @ORM\Column(type="string", length=255) * * @Assert\NotBlank(message="Please enter your name.", groups={"Registration", "Profile"}) * @Assert\Length( * min=3, * max=255, * minMessage="The name is too short.", * maxMessage="The name is too long.", * groups={"Registration", "Profile"} * ) */ protected $name; // ... } .. note:: By default, the Registration validation group is used when validating a new user registration. Unless you have overridden this value in the configuration, make sure you add the validation group named Registration to your name property. If you try and register using the default registration form you will find that your new ``name`` property is not part of the form. You need to create a custom form type and configure the bundle to use it. The first step is to create a new form type in your own bundle. The following class inherits from the base FOSUserBundle ``fos_user_registration`` type using the form type hierarchy and then adds the custom ``name`` field. .. code-block:: php // src/AppBundle/Form/RegistrationType.php namespace AppBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; class RegistrationType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add('name'); } public function getParent() { return 'FOS\UserBundle\Form\Type\RegistrationFormType'; // Or for Symfony < 2.8 // return 'fos_user_registration'; } public function getBlockPrefix() { return 'app_user_registration'; } // For Symfony 2.x public function getName() { return $this->getBlockPrefix(); } } .. note:: If you don't want to reuse the fields added in FOSUserBundle by default, you can omit the ``getParent`` method and configure all fields yourself. Now that you have created your custom form type, you must declare it as a service and add a tag to it. The tag must have a ``name`` value of ``form.type`` and an ``alias`` value that is the equal to the string returned from the ``getName`` method of your form type class. The ``alias`` that you specify is what you will use in the FOSUserBundle configuration to let the bundle know that you want to use your custom form. Below is an example of configuring your form type as a service: .. configuration-block:: .. code-block:: yaml # app/config/services.yml services: app.form.registration: class: AppBundle\Form\RegistrationType tags: - { name: form.type, alias: app_user_registration } .. code-block:: xml <!-- app/config/services.xml --> <?xml version="1.0" encoding="UTF-8" ?> <container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> <services> <service id="app.form.registration" class="AppBundle\Form\RegistrationType"> <tag name="form.type" alias="app_user_registration" /> </service> </services> </container> Finally, you must update the configuration of the FOSUserBundle so that it will use your form type instead of the default one. Below is the configuration for changing the registration form type in YAML. .. code-block:: yaml # app/config/config.yml fos_user: # ... registration: form: type: AppBundle\Form\RegistrationType # if you are using Symfony < 2.8 you should use the type name instead # type: app_user_registration Note how the ``alias`` value used in your form type's service configuration tag is used in the bundle configuration to tell the FOSUserBundle to use your custom form type. .. note:: If you need to add some logic to the processing of the form, you can use a listener :doc:`hooking into the controller </controller_events>`.
{ "content_hash": "08747bd3e71710a37fe0218ff679b372", "timestamp": "", "source": "github", "line_count": 171, "max_line_length": 128, "avg_line_length": 33.96491228070175, "alnum_prop": 0.6496212121212122, "repo_name": "AlphaWhack/app", "id": "4c165c2afaef6474ab02b44447cf828d56f2d2ef", "size": "5808", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "vendor/friendsofsymfony/user-bundle/Resources/doc/overriding_forms.rst", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ApacheConf", "bytes": "2907" }, { "name": "CSS", "bytes": "63809" }, { "name": "HTML", "bytes": "94587" }, { "name": "JavaScript", "bytes": "131747" }, { "name": "PHP", "bytes": "129782" } ], "symlink_target": "" }
<!-- - Copyright 1999-2011 Alibaba Group. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>com.alibaba</groupId> <artifactId>dubbo-remoting</artifactId> <version>2.5.6</version> </parent> <artifactId>dubbo-remoting-zookeeper</artifactId> <packaging>jar</packaging> <name>${project.artifactId}</name> <description>The zookeeper remoting module of dubbo project</description> <properties> <skip_maven_deploy>true</skip_maven_deploy> </properties> <dependencies> <dependency> <groupId>com.alibaba</groupId> <artifactId>dubbo-common</artifactId> <version>${project.parent.version}</version> </dependency> <dependency> <groupId>org.apache.zookeeper</groupId> <artifactId>zookeeper</artifactId> </dependency> <dependency> <groupId>com.github.sgroschupf</groupId> <artifactId>zkclient</artifactId> </dependency> <dependency> <groupId>com.netflix.curator</groupId> <artifactId>curator-framework</artifactId> </dependency> </dependencies> </project>
{ "content_hash": "da5c034f2f3602c401eac8b0d0746efa", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 104, "avg_line_length": 36.68, "alnum_prop": 0.7082878953107961, "repo_name": "yshaojie/dubbo", "id": "c77890af5f45eb1ea2cdee0cfe5c2db2c745ae28", "size": "1834", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "dubbo-remoting/dubbo-remoting-zookeeper/pom.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "3447" }, { "name": "CSS", "bytes": "18582" }, { "name": "Java", "bytes": "5312844" }, { "name": "JavaScript", "bytes": "63148" }, { "name": "Lex", "bytes": "2077" }, { "name": "Shell", "bytes": "7011" }, { "name": "Thrift", "bytes": "668" } ], "symlink_target": "" }
/** * @since 2016-10-11 19:24 * @author vivaxy */ var zoom = 14; var lng = 121.4203236; var lat = 31.2162311; var container = document.querySelector('.js-container'); var centerPoint = new BMap.Point(lng, lat); // 百度地图API功能 var map = new BMap.Map(container); // 创建Map实例 map.centerAndZoom(centerPoint, zoom); // 初始化地图,设置中心点坐标和地图级别 map.disableDragging(); map.disableDoubleClickZoom(); // map.enableContinuousZoom(); map.disablePinchToZoom(); var marker = new BMap.Marker(centerPoint); map.addOverlay(marker);
{ "content_hash": "a2162501341d98414eec789825b90b46", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 59, "avg_line_length": 23.363636363636363, "alnum_prop": 0.72568093385214, "repo_name": "vivaxy/course", "id": "0a7d2bfe9e4e9c1927d71a32a0a8eb37602a99f5", "size": "568", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "libraries/bmap/mark-point/index.js", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "3240" }, { "name": "C++", "bytes": "10495" }, { "name": "CSS", "bytes": "48470" }, { "name": "HTML", "bytes": "560079" }, { "name": "Java", "bytes": "2827" }, { "name": "JavaScript", "bytes": "6702666" }, { "name": "Makefile", "bytes": "664" }, { "name": "Objective-C", "bytes": "8877" }, { "name": "Python", "bytes": "2603" }, { "name": "Shell", "bytes": "1759" }, { "name": "Starlark", "bytes": "3389" }, { "name": "TypeScript", "bytes": "39454" } ], "symlink_target": "" }
from autobahn.wamp import Api # create an API object to use the decorator style # register/subscribe WAMP actions api = Api() @api.register(u'com.example.add2') def add2(a, b): return a + b @api.subscribe(u'com.example.on-hello', details=True) def on_hello(msg, details=None): print(u'Someone said: {}'.format(msg)) details.session.leave() @coroutine def component1(reactor, session): """ A first component, which gets called "setup-like". When it returns, this signals that the component is ready for work. """ # expose the API on the session yield session.expose(api) @coroutine def component2(reactor, session): """ A second component, which gets called "main-like". When it returns, this will automatically close the session. """ result = yield session.call(u'com.example.add2', 2, 3) session.publish(u'com.example.on-hello', u'result={}'.format(result)) if __name__ == '__main__': from autobahn.twisted.component import Component, run # Components wrap either a setup or main function and # can be configured with transports, authentication and so on. components = [ Component(setup=component1), Component(main=component2) ] # a convenience runner is provided which takes a list of # components and runs all of them run(components)
{ "content_hash": "b92be2d79a6d556d6235091f5b2f81ee", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 73, "avg_line_length": 28.229166666666668, "alnum_prop": 0.6856088560885609, "repo_name": "RyanHope/AutobahnPython", "id": "4ecd24732d4c9ef2d07c84334e0791a4e0354265", "size": "1355", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "examples/twisted/wamp/work/newapi/test_newapi13.py", "mode": "33188", "license": "mit", "language": [ { "name": "Makefile", "bytes": "3648" }, { "name": "Python", "bytes": "983364" } ], "symlink_target": "" }
namespace chromeos { // PpdCache manages a cache of locally-stored PPD files. At its core, it // operates like a persistent hash from PpdReference to files. If you give the // same PpdReference to Find() that was previously given to store, you should // get the same FilePath back out (unless the previous entry has timed out of // the cache). However, changing *any* field in PpdReference will make the // previous cache entry invalid. This is the intentional behavior -- we want to // re-run the resolution logic if we have new meta-information about a printer. class COMPONENT_EXPORT(CHROMEOS_PRINTING) PpdCache : public base::RefCounted<PpdCache> { public: struct FindResult { // Did we find something? If this is false, none of the other fields are // valid. bool success = false; // How old is this entry? Zero on failure. base::TimeDelta age; // Contents of the entry. Empty on failure. std::string contents; }; using FindCallback = base::OnceCallback<void(const FindResult& result)>; // Create and return a Ppdcache that uses cache_dir to store state. If // cache_base_dir does not exist, it will be lazily created the first time the // cache needs to store state. static scoped_refptr<PpdCache> Create(const base::FilePath& cache_base_dir); // Create a PpdCache that uses the given task runner for background // processing. static scoped_refptr<PpdCache> CreateForTesting( const base::FilePath& cache_base_dir, scoped_refptr<base::SequencedTaskRunner> io_task_runner); // Start a Find, looking, for an entry with the given key that is at most // |max_age| old. |cb| will be invoked on the calling thread. virtual void Find(const std::string& key, FindCallback cb) = 0; // Store |contents| at the the location indicated by |key|. The // file operation will complete asynchronously. virtual void Store(const std::string& key, const std::string& contents) = 0; // Store the given contents at the given key, and change the resulting // cache file's last modified date to be |age| before now. virtual void StoreForTesting(const std::string& key, const std::string& contents, base::TimeDelta age) = 0; protected: friend class base::RefCounted<PpdCache>; virtual ~PpdCache() {} }; } // namespace chromeos #endif // CHROMEOS_PRINTING_PPD_CACHE_H_
{ "content_hash": "418904366d2cdeb3a7014cf2ffa743d0", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 80, "avg_line_length": 40.71666666666667, "alnum_prop": 0.6962750716332379, "repo_name": "scheib/chromium", "id": "d350c8eed10e7d7a5ece12654576db6e2e1ca377", "size": "2932", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "chromeos/printing/ppd_cache.h", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
'use strict'; const childProcess = require('child_process'); const childModule = require.resolve('./child/index'); function fork(forkModule, options) { const child = childProcess.fork(childModule, { cwd: process.cwd(), env: process.env, execArgv: options.execArgv, silent: true }); child.send({ module: forkModule }); // return a send() function for this child return { send(data) { try { child.send(data); } catch (e) { // this *should* be picked up by onExit and the operation requeued } }, child }; } module.exports = fork;
{ "content_hash": "71102bbbf8b4e8a9f77328bc77eb65f2", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 74, "avg_line_length": 19.516129032258064, "alnum_prop": 0.6198347107438017, "repo_name": "gunaangs/Feedonymous", "id": "233ebf5342a967743c01f5ee8bfdab3e3c9e9e2b", "size": "920", "binary": false, "copies": "7", "ref": "refs/heads/master", "path": "node_modules/metro-bundler/src/worker-farm/lib/fork.js", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "595419" }, { "name": "JavaScript", "bytes": "17045" }, { "name": "Objective-C", "bytes": "4420" }, { "name": "Python", "bytes": "1732" } ], "symlink_target": "" }
import unittest import time from app import create_app, db from app.models import User, Permission, AnonymousUser, Role class UserModelTestCase(unittest.TestCase): def setUp(self): self.app = create_app('testing') self.app_context = self.app.app_context() self.app_context.push() db.create_all() Role.insert_roles() def tearDown(self): db.session.remove() db.drop_all() self.app_context.pop() def test_password_setter(self): u = User(password='cat') self.assertTrue(u.password_hash is not None) def test_no_password_getter(self): u = User(password='cat') with self.assertRaises(AttributeError): u.password def test_password_verification(self): u = User(password='cat') self.assertTrue(u.verify_password('cat')) self.assertFalse(u.verify_password('dog')) def test_password_salts_are_random(self): u = User(password='cat') u2 = User(password='dog') self.assertTrue(u.password_hash != u2.password_hash) def test_invalid_confirmation_token(self): u1 = User(password='cat') u2 = User(password='dog') db.session.add(u1) db.session.add(u2) db.session.commit() token = u1.generate_confirmation_token() self.assertFalse(u2.confirm(token)) def test_expired_confirmation_token(self): u = User(password='cat') db.session.add(u) db.session.commit() token = u.generate_confirmation_token(1) time.sleep(2) self.assertFalse(u.confirm(token)) def test_valid_reset_token(self): u = User(password='cat') db.session.add(u) db.session.commit() token = u.generate_reset_token() self.assertTrue(u.reset_password(token, 'dog')) self.assertTrue(u.verify_password('dog')) def test_invalid_reset_token(self): u1 = User(password='cat') u2 = User(password='dog') db.session.add(u1) db.session.add(u2) db.session.commit() token = u1.generate_reset_token() self.assertFalse(u2.reset_password(token, 'horse')) self.assertTrue(u2.verify_password('dog')) def test_valid_email_change_token(self): u = User(email='john@example.com', password='cat') db.session.add(u) db.session.commit() token = u.generate_email_change_token('susan@example.org') self.assertTrue(u.change_email(token)) self.assertTrue(u.email == 'susan@example.org') def test_invalid_email_change_token(self): u1 = User(email='john@example.com', password='cat') u2 = User(email='susan@example.org', password='dog') db.session.add(u1) db.session.add(u2) db.session.commit() token = u1.generate_email_change_token('david@example.net') self.assertFalse(u2.change_email(token)) self.assertTrue(u2.email == 'susan@example.org') def test_duplicate_email_change_token(self): u1 = User(email='john@example.com', password='cat') u2 = User(email='susan@example.org', password='dog') db.session.add(u1) db.session.add(u2) db.session.commit() token = u2.generate_email_change_token('john@example.com') self.assertFalse(u2.change_email(token)) self.assertTrue(u2.email == 'susan@example.org') def test_roles_and_permissions(self): u = User(email='john@example.com', password='cat') self.assertTrue(u.can(Permission.WRITE_ARTICLES)) self.assertFalse(u.can(Permission.MODERATE_COMMENTS)) def test_anonymous_user(self): u = AnonymousUser() self.assertFalse(u.can(Permission.FOLLOW)) def test_gravatar(self): # 测试头像链接生成函数 u = User(email='dronly@example.com') with self.app.test_request_context('/'): gravatar = u.gravatar() gravatar_size = u.gravatar(size=256) gravatar_pg = u.gravatar(rating='pg') gravatar_retro = u.gravatar(default='retro') with self.app.test_request_context('/', base_url='https://example.com'): gravatar_ssl = u.gravatar() self.assertIn("http://www.gravatar.com/avatar/" + "f59a5c7a91436fdcf6a2c9cae4472dbb", gravatar) self.assertIn("s=256", gravatar_size) self.assertIn("r=pg", gravatar_pg) self.assertIn("d=retro", gravatar_retro) self.assertIn("https://secure.gravatar.com/avatar/" + "f59a5c7a91436fdcf6a2c9cae4472dbb", gravatar_ssl)
{ "content_hash": "7039d60b116d8bb67629732b3d378600", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 80, "avg_line_length": 35.8062015503876, "alnum_prop": 0.6139857111928989, "repo_name": "dronly/flask-blog", "id": "3b5aceec9197106859c3e037a853636b7012f969", "size": "4662", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/test_user_model.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "564" }, { "name": "HTML", "bytes": "9562" }, { "name": "Mako", "bytes": "412" }, { "name": "Python", "bytes": "38849" } ], "symlink_target": "" }
'use strict'; import headerTpl from './header.html'; function headerComponent($log) { 'ngInject'; var directive = { restrict: 'E', templateUrl: headerTpl, controller: HeaderController, controllerAs: 'headerController', bindToController: true }; return directive; function HeaderController () { this.routes = [ { name: 'HOME', target: 'main' }, { name: 'USERS', target: 'users' }, { name: 'ABOUT', target: 'about' } ]; } } export default headerComponent;
{ "content_hash": "ebf8a389eab486ac739f6fc8b458430f", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 38, "avg_line_length": 15.783783783783784, "alnum_prop": 0.5513698630136986, "repo_name": "asarenski/angular1Example", "id": "453579850ac69617982554f192103122beac6359", "size": "584", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/app/components/header/header.directive.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1657" }, { "name": "HTML", "bytes": "3471" }, { "name": "JavaScript", "bytes": "32217" } ], "symlink_target": "" }
<div class="row"> {% for post in site.posts %} <div class="col s12 m6"> <div class="card"> <div class="card-image"> <img src="{{post.image}}"> <span class="card-title"><a style="color:white">{{ post.title | escape }}</a></span> <a id="{{post.url}}" class="btn-floating halfway-fab waves-effect waves-light red" href="{{ post.url | relative_url }}"><i class="material-icons">more_horiz</i></a> </div> <div class="card-content"> <p>{{post.excerpt}}</p> </div> </div> </div> {% endfor %} </div>
{ "content_hash": "d7384037323edaeb197eb6ae7b28665f", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 172, "avg_line_length": 33.23529411764706, "alnum_prop": 0.5451327433628319, "repo_name": "rcodin/rcodin.github.io", "id": "87f1253ad38849615dd00324763c2f874e6eaa83", "size": "565", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "_includes/blog-feed.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "3642" }, { "name": "HTML", "bytes": "15615" }, { "name": "JavaScript", "bytes": "635" }, { "name": "Ruby", "bytes": "2753" } ], "symlink_target": "" }
'use strict'; const symbols = require('./symbols'); const Metadata = require('../util/meta'); const lifecycle = require('./decorators/lifecycle'); const coreServices = require('./services'); const $err = require('../util/application_error'); /*! * Initializer function for modules `Module`. * * @private */ async function initModule (ravelInstance) { const self = this; const name = Metadata.getClassMetaValue(Object.getPrototypeOf(self), '@role', 'name'); // run @postinject handlers const postInjects = Metadata.getClassMeta(Object.getPrototypeOf(self), '@postinject', Object.create(null)); await Promise.all(Object.keys(postInjects).map(f => postInjects[f].call(self))); // connect any Ravel lifecycle handlers to the appropriate events function connectHandlers (decorator, event) { const handlers = Metadata.getClassMeta(Object.getPrototypeOf(self), decorator, Object.create(null)); for (const f of Object.keys(handlers)) { ravelInstance.once(event, async (...args) => { ravelInstance.$log.trace(`${name}: Invoking ${decorator} ${f}`); await handlers[f].apply(self, args); }); } } connectHandlers('@postinit', 'post init'); connectHandlers('@prelisten', 'pre listen'); connectHandlers('@koaconfig', 'pre routes init'); connectHandlers('@postlisten', 'post listen'); connectHandlers('@preclose', 'end'); // connect @interval const handlers = Metadata.getClassMeta(Object.getPrototypeOf(self), '@interval', Object.create(null)); const intervals = []; ravelInstance.once('post listen', () => { for (const f of Object.keys(handlers)) { intervals.push(setInterval(() => { ravelInstance.$log.trace(`${name}: Invoking @interval ${f}`); handlers[f].handler.call(self); }, handlers[f].interval)); } }); ravelInstance.once('end', () => { intervals.forEach((i) => clearInterval(i)); }); // register middleware const middleware = Metadata.getClassMeta(Object.getPrototypeOf(self), '@middleware', Object.create(null)); ravelInstance.once('post module init', () => { for (const m of Object.keys(middleware)) { if (ravelInstance[symbols.moduleFactories][m]) { throw new $err.DuplicateEntry( `Unable to register @middleware with name ${m}, which conflicts with an existing Module name`); } else { ravelInstance.$log.info(`Registering middleware with name ${m}`); middleware[m].fn = middleware[m].fn.bind(self); ravelInstance[symbols.middleware][m] = middleware[m]; } } }); } module.exports = function (Ravel) { /** * Retrieve an initialized Ravel `Module` by its injection name, after `app.init()`. * Useful for [testing](#testing-ravel-applications). * * @param {string} name - The injection name of the module. */ Ravel.prototype.module = function (name) { if (!this.initialized) { throw new this.$err.General('Cannot retrieve a Module reference from Ravel before app.init().'); } return this[symbols.modules][name]; }; /** * Register a `Module` or a plain class with Ravel. Must be a file exporting a single class. * * @private * @param {Function} moduleClass - The class for a Module. */ Ravel.prototype[symbols.loadModule] = function (moduleClass) { const name = Metadata.getClassMetaValue(moduleClass.prototype, '@role', 'name'); if (name === undefined) { throw new this.$err.IllegalValue(`Name required for module ${moduleClass.name}`); } if (this[symbols.moduleFactories][name]) { // if a module with this name has already been registered, error out throw new this.$err.DuplicateEntry( `Module with name '${name}' has already been registered.`); } // store reference to this ravel instance in metadata Metadata.putClassMeta(moduleClass.prototype, 'ravel', 'instance', this); // store name in metadata Metadata.putClassMeta(moduleClass.prototype, 'source', 'name', name); // store known module with path as the key, so someone can reflect on the class this[symbols.registerClassFunc](name, moduleClass); // build injection function this[symbols.moduleFactories][name] = async () => { // perform DI on module factory, allowing for core services const temp = this[symbols.injector].inject(coreServices(this, name), moduleClass); await initModule.call(temp, this); // overwrite uninitialized module with the correct one this[symbols.modules][name] = temp; return temp; }; this[symbols.moduleFactories][name].moduleName = name; this[symbols.moduleFactories][name].dependencies = this[symbols.injector].getDependencies(moduleClass); this[symbols.moduleFactories][name].parents = []; this[symbols.moduleFactories][name].children = []; // save uninitialized module to Ravel.modules // temporarily, until it is replaced by an // instantiated version in _moduleInit this[symbols.modules][name] = Object.create(null); }; /** * Private module init. * * Performs module initialization, detecting dependency cycles * and executing module factories in dependency order in Ravel.init(). * * @private */ Ravel.prototype[symbols.moduleInit] = async function () { const rootFactories = Object.create(null); // build dependency graph for (const moduleName of Object.keys(this[symbols.moduleFactories])) { const dependencies = this[symbols.moduleFactories][moduleName].dependencies; const factoryDeps = []; for (let d = 0; d < dependencies.length; d++) { if (this[symbols.moduleFactories][dependencies[d]] !== undefined) { // build two-way edge factoryDeps.push(this[symbols.moduleFactories][dependencies[d]]); this[symbols.moduleFactories][dependencies[d]].children.push(this[symbols.moduleFactories][moduleName]); } } this[symbols.moduleFactories][moduleName].parents = factoryDeps; // If this module has no dependencies on other client module factories, // then it is a root node. if (this[symbols.moduleFactories][moduleName].parents.length === 0) { this[symbols.moduleFactories][moduleName].maxDepth = 0; rootFactories[moduleName] = this[symbols.moduleFactories][moduleName]; } } // calculate max depth of each factory, then sort by it. detect cyclical dependencies. const instantiationOrder = []; const visitedMeta = new WeakMap(); const calcDepth = (moduleFactory, visitedTag, startModule, last) => { if (!visitedTag) { visitedTag = Math.random(); } if (!startModule) { startModule = moduleFactory.moduleName; } if (visitedMeta.get(moduleFactory) === visitedTag) { throw new this.$err.General( `Module instantiation failed. A cyclical dependency exists between modules ${startModule} and ${last}`); } else if (moduleFactory.maxDepth === undefined) { visitedMeta.set(moduleFactory, visitedTag); let maxDepth = -1; for (const p of moduleFactory.parents) { // if (!moduleFactory.parents.hasOwnProperty(p)) {continue;} const pDepth = p.maxDepth !== undefined ? p.maxDepth : calcDepth(p, visitedTag, startModule, moduleFactory.moduleName); maxDepth = Math.max(maxDepth, pDepth); } moduleFactory.maxDepth = maxDepth + 1; } return moduleFactory.maxDepth; }; for (const moduleName of Object.keys(this[symbols.moduleFactories])) { const depth = calcDepth(this[symbols.moduleFactories][moduleName]); if (!instantiationOrder[depth]) { instantiationOrder[depth] = []; } instantiationOrder[depth].push(this[symbols.moduleFactories][moduleName]); this.$log.info(`Registering module with name ${moduleName}`); } // instantiate in depth order for (let currDepth = 0; currDepth < instantiationOrder.length; currDepth++) { for (let m = 0; m < instantiationOrder[currDepth].length; m++) { await instantiationOrder[currDepth][m](); } } }; }; /*! * Export `Module` decorator, and sub-decorators */ module.exports.Module = require('./decorators/module'); module.exports.Module.postinject = lifecycle.postinject; module.exports.Module.postinit = lifecycle.postinit; module.exports.Module.prelisten = lifecycle.prelisten; module.exports.Module.koaconfig = lifecycle.koaconfig; module.exports.Module.postlisten = lifecycle.postlisten; module.exports.Module.preclose = lifecycle.preclose; module.exports.Module.interval = lifecycle.interval; module.exports.Module.middleware = require('./decorators/middleware'); module.exports.Module.authconfig = require('../auth/decorators/authconfig');
{ "content_hash": "7a3e4192b125251dbe0ef094adfb96c7", "timestamp": "", "source": "github", "line_count": 212, "max_line_length": 114, "avg_line_length": 41.528301886792455, "alnum_prop": 0.676056338028169, "repo_name": "raveljs/ravel", "id": "245d55638b6a4663b3803d4182ebcf2204b89aa6", "size": "8804", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "lib/core/module.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "17009" }, { "name": "JavaScript", "bytes": "489463" } ], "symlink_target": "" }
package com.amazonaws.services.migrationhubrefactorspaces.model.transform; import java.math.*; import javax.annotation.Generated; import com.amazonaws.services.migrationhubrefactorspaces.model.*; import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; import com.amazonaws.transform.*; import com.fasterxml.jackson.core.JsonToken; import static com.fasterxml.jackson.core.JsonToken.*; /** * DefaultRouteInput JSON Unmarshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class DefaultRouteInputJsonUnmarshaller implements Unmarshaller<DefaultRouteInput, JsonUnmarshallerContext> { public DefaultRouteInput unmarshall(JsonUnmarshallerContext context) throws Exception { DefaultRouteInput defaultRouteInput = new DefaultRouteInput(); int originalDepth = context.getCurrentDepth(); String currentParentElement = context.getCurrentParentElement(); int targetDepth = originalDepth + 1; JsonToken token = context.getCurrentToken(); if (token == null) token = context.nextToken(); if (token == VALUE_NULL) { return null; } while (true) { if (token == null) break; if (token == FIELD_NAME || token == START_OBJECT) { if (context.testExpression("ActivationState", targetDepth)) { context.nextToken(); defaultRouteInput.setActivationState(context.getUnmarshaller(String.class).unmarshall(context)); } } else if (token == END_ARRAY || token == END_OBJECT) { if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) { if (context.getCurrentDepth() <= originalDepth) break; } } token = context.nextToken(); } return defaultRouteInput; } private static DefaultRouteInputJsonUnmarshaller instance; public static DefaultRouteInputJsonUnmarshaller getInstance() { if (instance == null) instance = new DefaultRouteInputJsonUnmarshaller(); return instance; } }
{ "content_hash": "bad4cfc1fdc886722ac861409bb04a19", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 136, "avg_line_length": 35.42857142857143, "alnum_prop": 0.6577060931899642, "repo_name": "aws/aws-sdk-java", "id": "791aaf2f34bce286103c902f1468a3712bb32c55", "size": "2812", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "aws-java-sdk-migrationhubrefactorspaces/src/main/java/com/amazonaws/services/migrationhubrefactorspaces/model/transform/DefaultRouteInputJsonUnmarshaller.java", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
namespace Microsoft.Azure.Management.Compute.Models { using Microsoft.Azure; using Microsoft.Azure.Management; using Microsoft.Azure.Management.Compute; using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; public partial class ContainerServiceDiagnosticsProfile { /// <summary> /// Initializes a new instance of the /// ContainerServiceDiagnosticsProfile class. /// </summary> public ContainerServiceDiagnosticsProfile() { CustomInit(); } /// <summary> /// Initializes a new instance of the /// ContainerServiceDiagnosticsProfile class. /// </summary> /// <param name="vmDiagnostics">Profile for the container service VM /// diagnostic agent.</param> public ContainerServiceDiagnosticsProfile(ContainerServiceVMDiagnostics vmDiagnostics) { VmDiagnostics = vmDiagnostics; CustomInit(); } /// <summary> /// An initialization method that performs custom operations like setting defaults /// </summary> partial void CustomInit(); /// <summary> /// Gets or sets profile for the container service VM diagnostic agent. /// </summary> [JsonProperty(PropertyName = "vmDiagnostics")] public ContainerServiceVMDiagnostics VmDiagnostics { get; set; } /// <summary> /// Validate the object. /// </summary> /// <exception cref="ValidationException"> /// Thrown if validation fails /// </exception> public virtual void Validate() { if (VmDiagnostics == null) { throw new ValidationException(ValidationRules.CannotBeNull, "VmDiagnostics"); } if (VmDiagnostics != null) { VmDiagnostics.Validate(); } } } }
{ "content_hash": "ec050a13b86d2b92178fca37c94c7c14", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 94, "avg_line_length": 31.467741935483872, "alnum_prop": 0.5884161968221425, "repo_name": "atpham256/azure-sdk-for-net", "id": "b67fcc30892a22ceabc1abf134b735cb88b147ac", "size": "2263", "binary": false, "copies": "5", "ref": "refs/heads/psSdkJson6", "path": "src/SDKs/Compute/Management.Compute/Generated/Models/ContainerServiceDiagnosticsProfile.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "118" }, { "name": "Batchfile", "bytes": "13648" }, { "name": "C#", "bytes": "66239925" }, { "name": "CSS", "bytes": "685" }, { "name": "JavaScript", "bytes": "7875" }, { "name": "PowerShell", "bytes": "21530" }, { "name": "Shell", "bytes": "14256" }, { "name": "XSLT", "bytes": "6114" } ], "symlink_target": "" }
ffff
{ "content_hash": "ece926d8c0356205276a45266d361161", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 4, "avg_line_length": 4, "alnum_prop": 1, "repo_name": "alesevimor/angular-seed", "id": "9720664829a6494d99be2e6633e91e4ebe34b8ca", "size": "4", "binary": false, "copies": "26", "ref": "refs/heads/master", "path": "src/app/views/view1.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "366" }, { "name": "HTML", "bytes": "207" }, { "name": "JavaScript", "bytes": "2175" }, { "name": "TypeScript", "bytes": "40879" } ], "symlink_target": "" }
using IntelliTect.Coalesce; using IntelliTect.Coalesce.Mapping; using IntelliTect.Coalesce.Models; using System; using System.Collections.Generic; using System.Linq; using System.Security.Claims; namespace Coalesce.Web.Vue2.Models { public partial class PersonCriteriaDtoGen : GeneratedDto<Coalesce.Domain.PersonCriteria> { public PersonCriteriaDtoGen() { } private string _Name; private int? _BirthdayMonth; private string _EmailDomain; public string Name { get => _Name; set { _Name = value; Changed(nameof(Name)); } } public int? BirthdayMonth { get => _BirthdayMonth; set { _BirthdayMonth = value; Changed(nameof(BirthdayMonth)); } } public string EmailDomain { get => _EmailDomain; set { _EmailDomain = value; Changed(nameof(EmailDomain)); } } /// <summary> /// Map from the domain object to the properties of the current DTO instance. /// </summary> public override void MapFrom(Coalesce.Domain.PersonCriteria obj, IMappingContext context, IncludeTree tree = null) { if (obj == null) return; var includes = context.Includes; // Fill the properties of the object. this.Name = obj.Name; this.BirthdayMonth = obj.BirthdayMonth; this.EmailDomain = obj.EmailDomain; } /// <summary> /// Map from the current DTO instance to the domain object. /// </summary> public override void MapTo(Coalesce.Domain.PersonCriteria entity, IMappingContext context) { var includes = context.Includes; if (OnUpdate(entity, context)) return; if (ShouldMapTo(nameof(Name))) entity.Name = Name; if (ShouldMapTo(nameof(BirthdayMonth))) entity.BirthdayMonth = BirthdayMonth; if (ShouldMapTo(nameof(EmailDomain))) entity.EmailDomain = EmailDomain; } } }
{ "content_hash": "9a220d0954b97f02e139e8c38b640f2a", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 122, "avg_line_length": 32.109375, "alnum_prop": 0.6077858880778588, "repo_name": "IntelliTect/Coalesce", "id": "adaaa0b8cc071dd4f9c509090d4188438262c05d", "size": "2055", "binary": false, "copies": "1", "ref": "refs/heads/dev", "path": "playground/Coalesce.Web.Vue2/Models/Generated/PersonCriteriaDto.g.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "1155125" }, { "name": "HTML", "bytes": "368410" }, { "name": "JavaScript", "bytes": "6348" }, { "name": "SCSS", "bytes": "22198" }, { "name": "TypeScript", "bytes": "679613" }, { "name": "Vue", "bytes": "240977" } ], "symlink_target": "" }
[CmdletBinding()] param() # Arrange. . $PSScriptRoot\..\lib\Initialize-Test.ps1 Invoke-VstsTaskScript -ScriptBlock { $tempDirectory = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), [System.IO.Path]::GetRandomFileName()) New-Item -Path $tempDirectory -ItemType Directory | ForEach-Object { $_.FullName } try { # Create the following layout: # realDir # realDir/file # symDir -> realDir New-Item -Path "$tempDirectory\realDir" -ItemType Directory New-Item -Path "$tempDirectory\realDir\file" -ItemType File & cmd.exe /S /C "mklink /J `"$tempDirectory\symDir`" `"$tempDirectory\realDir`"" Get-Item -LiteralPath "$tempDirectory\symDir\file" $options = New-VstsFindOptions -FollowSymbolicLinks # equivalent to "find -L" # Act. $actual = & (Get-Module VstsTaskSdk) Get-FindResult -Path "$tempDirectory\symDir" -Options $options # Assert. $expected = @( "$tempDirectory\symDir" "$tempDirectory\symDir\file" ) Assert-AreEqual ($expected | Sort-Object) ($actual | Sort-Object) } finally { # Remove the junction folder first. Otherwise PowerShell 4 may fail recursively # deleting $tempDirectory. Remove-Item $tempDirectory\symDir -Recurse -Force -ErrorAction Ignore Remove-Item $tempDirectory -Recurse -Force } }
{ "content_hash": "e2b9cb564c09145eb6e48319d86856a5", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 118, "avg_line_length": 39.666666666666664, "alnum_prop": 0.6393557422969187, "repo_name": "Microsoft/vsts-task-lib", "id": "8ea902aa8989e912168c10cbe99728ede44f4e7d", "size": "1428", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "powershell/Tests/L0/Get-FindResult.FollowsSpecifiedSymlinkWhen-L.ps1", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "181" }, { "name": "C#", "bytes": "13326" }, { "name": "HTML", "bytes": "35" }, { "name": "JavaScript", "bytes": "20915" }, { "name": "PowerShell", "bytes": "292455" }, { "name": "Shell", "bytes": "283" }, { "name": "TypeScript", "bytes": "531191" } ], "symlink_target": "" }
> Verb stores certain information on a few objects that should not be overwritten. These properties are: - `verb.cache` - `verb.cache.data` - `verb.options` <!-- TODO: generate a list of methods and objects -->
{ "content_hash": "d74d58e6cd0ff8b254e363ff238265d8", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 102, "avg_line_length": 21.6, "alnum_prop": 0.7129629629629629, "repo_name": "GerHobbelt/verb", "id": "c238d8329bf5c7f5690a06b02c03b6beb16aa339", "size": "240", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "docs/_templates/protected-properties.md", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "98772" } ], "symlink_target": "" }
// Generated Source interface CalledNumberInfo { /** * Called phone number */ phoneNumber?: string; } export default CalledNumberInfo;
{ "content_hash": "a4ad4436a9ee652d6fa9fa49a4a3da82", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 32, "avg_line_length": 14.181818181818182, "alnum_prop": 0.6602564102564102, "repo_name": "ringcentral/ringcentral-js-client", "id": "a7d3ee8261c0be35a7150f78272262a970310404", "size": "156", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/definitions/CalledNumberInfo.ts", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "2462" }, { "name": "JavaScript", "bytes": "4782" }, { "name": "Shell", "bytes": "953" }, { "name": "TypeScript", "bytes": "572774" } ], "symlink_target": "" }
It is now possible to have multiple search pages in a site, each with it's own separate restrictions as to which class or classes are searchable. Asides from the traditional 'search all of the SiteTree' this module provides more flexibility. An administrator can do the following: * Create a search page that searches just blog posts * Create a search page that searches just Flickr photos, represented as DataObjects * Fields within the search can be weighted, e.g. make the Title twice as important as the Content * Vary the number of search results from the default of 10 * Add classes to manipulate the search and the results, allowing for aggregated searches Note that the above changes are instant, there is no need to reindex the data, it is the query that is altered. The content administrator can make these changes within the CMS. * Override the template of search results, necessary when dealing with results not having a Title or Link. ##Adding a Search Page to a Site Using the standard mechanism for adding a page in the CMS, add a page of type `ElasticSearchPage` at an appropriate location for the search intended, e.g. `/search`, `/blog/search`, or `/photos/search`. ##Configuring a Search Page ###Search Site Tree Only Select the 'Site Tree Only' checkbox, and then save the page. This will simulate the standard SilverStripe search, namely all pages in the SiteTree, but using Elasticsearch for the free text searching. ![Search the SiteTree Only] (https://raw.githubusercontent.com/gordonbanderson/silverstripe-elastica/screenshots/screenshots/elastica001-site-tree-only.png "Search the SiteTree Only") ###Selected List of ClassNames It is possible to restrict the classes that are searched, useful for example if searching a particular subsection of a site likes of a blog. In the example below only pages of type Blog or BlogPost are returned from the search. ![Search Blogs Only] (https://raw.githubusercontent.com/gordonbanderson/silverstripe-elastica/screenshots/screenshots/elastica002-blogpost.png "Search Blogs Only") Note that a list of the available classes is shown just below for reference. This can be copied and pasted into the TagField of available classes. ![List of Available Classes] (https://raw.githubusercontent.com/gordonbanderson/silverstripe-elastica/screenshots/screenshots/elastica003.png "List of Available Classes") ###Number of Results The default number of results is 10, this can be changed to any number as required. In the screenshot below, the number of results has been changed to 20 ![Change Number of Search Results] (https://raw.githubusercontent.com/gordonbanderson/silverstripe-elastica/screenshots/screenshots/elastica006-number-of-results.png "Change Number of Search Results") ###Field Editing After saving an Elastic Search Page, the fields available will be shown in the Search/Fields tab. The fields available from the list of selected classes will be shown and are editable. Note that a field weight <= 0 is invalid and the page cannot be saved. ![List of Searchable Fields] (https://raw.githubusercontent.com/gordonbanderson/silverstripe-elastica/screenshots/screenshots/elastica005-fields-weighting.png "List of Searchable Fields") * Weighting - adjust the weight of that field, making it more or less important * Use for Search? - true to use the field in the search, false not to * Use for Similar Search? - true to use the field when doing a simiilarity search, false not to * Show Search Highlights - show query terms highlight in the search results for the field in question ![Editing Weighting] (https://raw.githubusercontent.com/gordonbanderson/silverstripe-elastica/screenshots/screenshots/elastica004-alter-weighting.png "Editing Weighting") If a field searched for is not present in all the objects being searched, the search does not fail. An example of this would be a BlogPost having BlogTags associated with it, whereas of course a standard Page does not have this field. Page and BlogPost however have Title and Content fields in common. ##Autocompletion Autocompletion should only be indexed for relatively short fields as it is extremely verbose in the number of terms indexed. Good examples of suitable fields are the title of a page or the full name of a Member. ![Autocomplete] (https://raw.githubusercontent.com/gordonbanderson/silverstripe-elastica/screenshots/screenshots/elastica-autocomplete.png "Editing Autocompletion") To enable autocomplete click on the Search/AutoComplete tab. A drop down list of autocompleteable fields is shown, of which only one can be selected. There are 3 options for what can happen when autocompleted text is selected. * GoToRecord - go directly to a page showing the record whose field was autocompleted * Similar - find objects similar to that represented by the selected autocomplete text * Search - search using the terms of the title of the selected autocomplete text ##Aggregations Aggregations are sufficiently complex they are on a [separate page](./Aggregation.md). ##Similarity Searching A similarity search, or in Elasticsearch parlance a 'more like this' query finds documents similar o the one used as the basis for the search. It has several configurable parameters and some experimentation may be required depending on site content. * Stop Words - terms to ignore when querying * Minimum term frequency - minimum number of times a term can appear in a field to be used * Maximum terms selected - the maximum number of terms selected to be used for similarity search * Minimum document frequency - the minimum number of documents a term appears in * Maximum document frequency - the maximum number of documents a term appears in. Can be used to filter stop words * Minimum word length - the minimum length of a term for it to be considered * Maximum word length - the maximum length of a term for it to be considered * Number of %age of matching terms - see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-minimum-should-match.html for a detailed explanation. Note that the default values are as per the Elasticsearch documentation. Clicking on the button 'Restore Defaults' restores these values (after a Save). ![Similarity Searching] (https://raw.githubusercontent.com/gordonbanderson/silverstripe-elastica/screenshots/screenshots/elastica-similarity.png "Editing similarity search parameters") ##Overriding the SearchPage Template It is most likely necessary to override the default template when rendering search results for DataObjects, as they may not have the methods _Title_ and _AbsoluteLink_ necessary to render them. This requires another module that can alter the template for a given page. ###Installation of Template Override Module ####Composer ```bash composer require weboftalent/template-override 3.1.x-dev ``` ####Git ```bash git clone https://github.com/gordonbanderson/template-override.git cd template-override git checkout 3.1 ``` ###Using Template Override Simple navigate to the tab 'Template', or i18n equivalent, and enter the name of the template in the text field provided. If the value is left empty, the normal template will be used. ![Setting Templates to BlogSearchResults.ss] (https://raw.githubusercontent.com/gordonbanderson/silverstripe-elastica/screenshots/screenshots/elastica007-blog-search-results-template.png "Setting Templates to BlogSearchResults.ss")
{ "content_hash": "e1329c2523a70aa2f3760133c14a85c3", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 141, "avg_line_length": 47.74193548387097, "alnum_prop": 0.8014864864864865, "repo_name": "gordonbanderson/silverstripe-elastica", "id": "ab470f2f987c23577ec9dde59823b6ced31c7e4e", "size": "7429", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/en/SearchPages.md", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "3787" }, { "name": "JavaScript", "bytes": "39565" }, { "name": "PHP", "bytes": "423109" }, { "name": "Scheme", "bytes": "7265" } ], "symlink_target": "" }
Quick start guide -------------------------------------------------------------- If you are familiar with processing you probably know that there are two main functions which set the picture into motion. They are `setup` and `draw`. The function: * `setup` initializes the window scene and state of the animation. * `draw` is for redrawing the animation and updating the state. We are going to draw the Sun and a planet that spins around the Sun. The typical processing code may look like this: ~~~Java // constants float rad = 55; float winWidth = 300; float winHeight = 300; float centerX = winWidth / 2; float centerY = winHeight / 2; // state float t; // standard callbacks void setup() { size(winWidth, winHeight); t = 0; } void draw() { background(255); drawSun(); drawPlanet(); updateState(); } // user defined functions void drawSun() { fill(0); ellipse(centerX, centerY, 30, 30); } void drawPlanet() { float x = centerX + rad * cos(t); float y = centerY + rad * sin(t); fill(145); ellipse(x, y, 12, 12); } void updateState() { t += 0.025; } ~~~ If you know the Java you already know the syntax of Processing. The Processing uses simplified version of Java syntax (no need for many boilerplate keywords, ability to write top-level functions). Let's read this code by blocks. The first block of code defines the constant parameters. They stay fixed for the lifetime of the program: ~~~Java // constants float rad = 55; float winWidth = 300; float winHeight = 300; float centerX = winWidth / 2; float centerY = winHeight / 2; ~~~ The next thing is to define a variable for the state: ~~~Java // state float t; ~~~ Then we set the window sizes and state: ~~~Java void setup() { size(winWidth, winHeight); t = 0; } ~~~ The `setup` is keyword. The user should define this function to initialize the state. We are ready to draw the picture of our universe on the screen: ~~~Java void draw() { background(255); drawSun(); drawPlanet(); updateState(); } ~~~ The first command clears the background with white color. The color values are measured in values from the interval 0 to 255. The `draw` is also a keyword. Then we invoke user-defined functions to draw the sun, planet and to update the state. Let's draw the Sun: ~~~Java void drawSun() { fill(0); ellipse(centerX, centerY, 30, 30); } ~~~ The first command (`fill`) sets the fill color for all following shapes that we are going to draw. We set it to black. The next command draws a centered circle. The planet is more interesting, because it's going to move: ~~~Java void drawPlanet() { float x = centerX + rad * cos(t); float y = centerY + rad * sin(t); fill(145); ellipse(x, y, 12, 12); } ~~~ There is a bit of trigonometry going on. We just calculate the position of planet that depends on the state `t`. The `t` is the angle of rotation. The next steps are similar to the drawing of the Sun. We draw a circle that is a bit smaller. The last step is to update the state so that with every new frame the angle increases: ~~~Java void updateState() { t += 0.025; } ~~~ The code is complete. We can hit the run button in the Processing environment and it will show us the tiny movie. Let's discuss how to write this program in Haskell with our library. I've tried to make the library as close to Processing as possible, but there are some tricks that can not be done in Haskell. The processing is imperative or object oriented language and Haskell is purely functional. So some stuff like access to global variables is not available in Haskell. But we will find the way out of it. I promise! So read on. Let's start with importing our library: ~~~Haskell import Graphics.Proc ~~~ Then we can define a block of constants: ~~~Haskell -- constants rad = 55 width = 300 height = 300 centerX = width / 2 centerY = height / 2 ~~~ The code is quite the same. No surprises here. There is a tiny difference in naming. I've renamed the `winWidth` to just `width`. In the processing width is a special name that returns the current width of the window. It's often used in the drawing to scale things. But with Haskell I've decided to rename width to winWidth. So that we can use this name as a simple constant. It's rare case when we want to change the size of the window so it's much convenient to use as a pure constant. So the `winWidth` and `winHeight` are special functions in Haskell to read current width and height of the window. The next thing is to define a state and initialize it with setup. With Java it was a simple global variable definition. But we can not use globals in Haskell. The trick is to augment our standard functions `setup` and `draw` with state passing. In the Java or Processing code the `setup` has no arguments and produced nothing. Java folks are used to this way of state manipulation but we are going to do it going functional way. Our `setup` function is going to produce initial state value: ~~~Haskell setup :: Pio Double setup = do size (P2 width height) return 0 ~~~ With the first command (`size`) we set the sizes of the windows. The `P2` constructs 2D point. Also we have P3 when we need to use one more dimension. With second command we return the value of our state. Later we are going to pass it as an argument to `draw` function. Notice the type signature of the function. The value is wrapped in `Pio`. The `Pio` is short for Processing IO-monad. That's familiar to Haskellers IO-monad that is augmented with Processing features (drawing primitives, noise generators, time queries and so on). So the bottom line is that haskell `setup` function should produce a state wrapped in special case of IO-monad. Let's draw everything: ~~~Haskell draw :: Double -> Draw draw t = do background (grey 255) drawSun drawPlanet t ~~~ We do the same things we did in Processing. but now we get the state as an argument and we pass it to the function `drawPlanet` that is going to need the state. Also notice that there is no state update. We are going to do it with the separate function. Notice the type `Draw`. It's just an alias for `Pio ()`. There is a slight difference in color handling. The function `grey` constructs RGB-color out of single value. Why do we need that? In Processing like in Java we can define several functions with the same name. They are distinguished with type-signatures of the arguments. But Haskell is more restrictive. We should have only one function with the given name. So Processing `background` function can take one or three arguments. If it has only one it constructs the grey color if it has three it uses them as red, green and blue parameters of the color. In Haskell we use the function `grey` to construct the grey colors and `rgb` to construct simple colors. Also there are functions `greya` and `rgba` they have another one argument for **a**lpha or transparency. Let's draw the sun and the planet: ~~~Haskell drawSun = do fill (grey 0) ellipse (P2 centerX centerY) (P2 30 30) ~~~ The Sun is static so we don't need any input. Notice the difference of `ellipse` function. In Haskell I've decided to express arguments of all 2D functions with points or pairs of doubles (type `P2`). The Processing always uses a plain float values. It's ok for introduction but I often find that the point type is much more convenient. Let's draw a planet: ~~~Haskell drawPlanet t = do fill (grey 145) ellipse (P2 x y) (P2 12 12) where x = centerX + rad * cos t y = centerY + rad * sin t ~~~ You can see that in Haskell we pass the state into the function in order to use it. The trigonometry stuff goes on here and we draw it in the same manner as the Sun. The cool thing about using points in place of numbers is that in Haskell we have numeric instances for points. We can rewrite the code like this: ~~~Haskell winSizes = (P2 300 300) center = 0.5 *^ winSizes drawPlanet t = do fill (grey 145) ellipse p 12 where p = center + rad *^ (P2 (cos t) (sin t)) ~~~ The operator `*^` multiplies both values o the pair with the given value. So it multiplies a double value by point or scales the point with the value. The `+` and numeric literals are *overloaded* for points. We can sum them up and a numeric value `12` produces a pair of `(P2 12 12)`. So the formula becomes a single line definition: ~~~Haskell p = center + rad *^ (P2 (cos t) (sin t)) ~~~ We are ready to update the state: ~~~Haskell update :: Double -> Pio Double update t = return (t + 0.025) ~~~ It's much the same thing we did, but now the state update is written explicitly in the type signature of the function. So we can set the things in motion! But the Haskell language knows nothing about special meaning that we put into the names `setup` and `draw`. We need to give it a hint! To run the standard processing callback functions we use the function `runProc`: ~~~Haskell main = runProc $ def { procSetup = setup , procDraw = draw , procUpdate = update } ~~~ The function `runProc` takes in a `Proc` data structure. The `Proc` contains all callbacks that we are going to use. Many callbacks are specified with default values. To specify only part of callbacks that we are going to use we use the trick with Haskell default values. The Proc has instance of class `Data.Default`. This class has only one method: ~~~Haskell class Default a where def = a instance Default st => Default (Proc st) where def = Proc { ... } ~~~ So the `def` contains all callback we need. Then we can set the callbacks we need with our functions: ~~~Haskell def { procSetup = setup , procDraw = draw , procUpdate = update } ~~~ and pass this value to the `runProc` function. Here is the complete code for Haskell program: ~~~Haskell import Graphics.Proc main = runProc $ def { procSetup = setup , procDraw = draw , procUpdate = update } -- constants rad = 55 sizes = (P2 300 300) center = 0.5 *^ sizes -- standard functions setup :: Pio Double setup = do size sizes return 0 draw :: Double -> Draw draw t = do background (grey 255) drawSun drawPlanet t update :: Double -> Pio Double update t = return (t + 0.0025) -- drawing drawSun = do fill (grey 0) ellipse center 30 drawPlanet t = do fill (grey 145) ellipse p 12 where p = center + rad *^ (P2 (cos t) (sin t) ) ~~~ You can save the file and run it with runhaskell utility. ### Recap The code is almost the same as Processing code but there are differences. Let's briefly recall all of them: * In Processing we can use global variables to update the state. In Haskell we explicitly pass the state and update it. Standard callbacks take in state as an argument or pass it as a result. The `setup` function produces initial state. The `draw` takes in state as an argument. The function `update` takes in the state and produces the new value. * In Haskell the state update is separated from drawing process. We have two function `draw` and `update`: ~~~Haskell draw :: st -> Draw update :: st -> Pio st ~~~ * We have a special monad `Pio`, that augments the IO-monad with processing functionality. We can use `liftIO` function to turn IO-actions to `Pio`s: ~~~Haskell text <- liftIO (readFile "file.txt") ~~~ There is a handy alias: ~~~Haskell type Draw = Pio () ~~~ * Processing has standard names for drawing and setup functions. In Haskell we should use the `runProc` function to run the animation and specify the callbacks in the special data structure `Proc`. * Processing often uses simple numbers where point type can be more appropriate. So in Processing we draw a line with four arguments: ~~~Java line(x1, y1, x2, y2) ~~~ But in Haskell two points is enough: ~~~Haskell let p1 = P2 x1 y1 p2 = P2 x2 y2 line p1 p2 ~~~ We can do all numerical operations with points and quite more. The points implementation is based upon the package `vector-space`. See it on hackage for complete API of points/vectors. * We use special functions to construct colors: ~~~Haskell grey :: Double -> Col greya :: Double -> Double -> Col rgb :: Double -> Double -> Double -> Col rgba :: Double -> Double -> Double -> Double -> Col fill :: Col -> Draw stroke :: Col -> Draw background :: Col -> Draw ~~~ That's enough to start coding something interesting! For the next tips you can read the reference of Processing language. The structure of the `Graphics.Proc` module is the same as in the reference document. I've tried to be as close to original definitions as possible so I hope that you can easily grasp the meaning of the Haskell function by reading the original Processing documentation. You can find that many functions are already implemented. But some are not. The processing-for-haskell is far from completion, but still you can write some cool graphics with it. Hope you enjoy it. You can read and execute the examples (see the directory `examples` in the source code). ### Surprises for seasoned processingers * In Processing we can write animation and accumulate the pictures on the screen if we not redraw it with background. In Haskell right now we can only use animation mode. The accumulation of pictures is not reliable. We can emulate the desired behavior by accumulating state. We can create a list of objects to draw and re-render all of them on each step. * In Haskell library the `draw` is split to two functions. One for drawing (`procDraw`) and another one fro state update (`procUpdate`). * `strokeWidth` is not yet implemented properly. So it's better to use circles in place of big points and rectangles or quads in place of weighty lines. * The angle for `rotate` function is measured in TAUs. It's modern way to measure rotation which is much more convenient then traditional degrees or radians. The TAU is a ratio of full circle. So the interval is `[0, 1]`. For example 90 degrees is 0.25, 180 degrees is 0.5.
{ "content_hash": "d4266b9240ce2c03f8404f85e67de3ac", "timestamp": "", "source": "github", "line_count": 486, "max_line_length": 131, "avg_line_length": 28.89917695473251, "alnum_prop": 0.7214667141331434, "repo_name": "anton-k/processing-for-haskell", "id": "bb468823d044d605b16ef7329b3b9ee71ca7dbcc", "size": "14045", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tutorial/QuickStartForProcessingers.md", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Haskell", "bytes": "81790" }, { "name": "Makefile", "bytes": "86" } ], "symlink_target": "" }
package com.amazonaws.services.billingconductor.model.transform; import javax.annotation.Generated; import com.amazonaws.SdkClientException; import com.amazonaws.Request; import com.amazonaws.http.HttpMethodName; import com.amazonaws.services.billingconductor.model.*; import com.amazonaws.transform.Marshaller; import com.amazonaws.protocol.*; import com.amazonaws.protocol.Protocol; import com.amazonaws.annotation.SdkInternalApi; /** * ListAccountAssociationsRequest Marshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") @SdkInternalApi public class ListAccountAssociationsRequestProtocolMarshaller implements Marshaller<Request<ListAccountAssociationsRequest>, ListAccountAssociationsRequest> { private static final OperationInfo SDK_OPERATION_BINDING = OperationInfo.builder().protocol(Protocol.REST_JSON).requestUri("/list-account-associations") .httpMethodName(HttpMethodName.POST).hasExplicitPayloadMember(false).hasPayloadMembers(true).serviceName("AWSBillingConductor").build(); private final com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory; public ListAccountAssociationsRequestProtocolMarshaller(com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory) { this.protocolFactory = protocolFactory; } public Request<ListAccountAssociationsRequest> marshall(ListAccountAssociationsRequest listAccountAssociationsRequest) { if (listAccountAssociationsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { final ProtocolRequestMarshaller<ListAccountAssociationsRequest> protocolMarshaller = protocolFactory.createProtocolMarshaller( SDK_OPERATION_BINDING, listAccountAssociationsRequest); protocolMarshaller.startMarshalling(); ListAccountAssociationsRequestMarshaller.getInstance().marshall(listAccountAssociationsRequest, protocolMarshaller); return protocolMarshaller.finishMarshalling(); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
{ "content_hash": "49edcf7a022baf4f73c15511dd4fca7d", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 158, "avg_line_length": 43.1764705882353, "alnum_prop": 0.7797456857402362, "repo_name": "aws/aws-sdk-java", "id": "2ea843d288efc496ed1cf2e195a7ddcef472771b", "size": "2782", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "aws-java-sdk-billingconductor/src/main/java/com/amazonaws/services/billingconductor/model/transform/ListAccountAssociationsRequestProtocolMarshaller.java", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package org.graylog2.jersey.container.netty; import com.sun.security.auth.UserPrincipal; import javax.ws.rs.core.SecurityContext; import java.security.Principal; public class DefaultSecurityContextFactory implements SecurityContextFactory { @Override public SecurityContext create(final String userName, String credential, final boolean isSecure, final String authcScheme, String host) { final String principal = userName; return new SecurityContext() { @Override public Principal getUserPrincipal() { return new UserPrincipal(principal); } @Override public boolean isUserInRole(String role) { return false; } @Override public boolean isSecure() { return isSecure; } @Override public String getAuthenticationScheme() { return authcScheme; } }; } }
{ "content_hash": "394d0b3877de7a7f4b35041c375b12df", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 140, "avg_line_length": 27.054054054054053, "alnum_prop": 0.6083916083916084, "repo_name": "cailin186/jersey-netty", "id": "2a8633dddb842e0edf5bd3c1ade57cbb8aad00db", "size": "1597", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/main/java/org/graylog2/jersey/container/netty/DefaultSecurityContextFactory.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "44045" } ], "symlink_target": "" }
layout: page title: Palace Enterprises Party date: 2016-05-24 author: Olivia Best tags: weekly links, java status: published summary: Praesent tincidunt convallis velit, sed tempor. banner: images/banner/meeting-01.jpg booking: startDate: 11/28/2019 endDate: 12/02/2019 ctyhocn: TULBYHX groupCode: PEP published: true --- Morbi eget massa eu eros vulputate tempus. Sed blandit orci nec volutpat varius. Fusce scelerisque eu elit non mattis. Nunc congue diam orci, ut porttitor purus congue sed. Fusce a nulla lacus. Sed sodales faucibus nibh ac eleifend. Suspendisse viverra fringilla tellus, vitae varius nulla dignissim non. Ut non rutrum odio. In gravida urna dolor, ut laoreet nisi malesuada at. Praesent sagittis luctus arcu, ac aliquam nibh rhoncus sit amet. Nullam sagittis tincidunt ornare. Suspendisse potenti. Fusce quis ultricies lacus. Suspendisse eu pellentesque velit. * Pellentesque ut dui ullamcorper, auctor arcu in, maximus nibh * Suspendisse porttitor dui lobortis, placerat diam vitae, bibendum ante * Sed at ipsum ac sem porta dignissim at eget purus * Aenean sagittis sapien et nisl venenatis tincidunt. Pellentesque posuere dapibus urna vel laoreet. Morbi non tortor sit amet dolor pharetra aliquet. Phasellus fringilla felis eu justo mattis hendrerit. Donec imperdiet ligula libero, at maximus nunc consectetur vel. Cras vestibulum arcu quis nisi viverra, vitae tincidunt est venenatis. Maecenas malesuada vitae tortor quis molestie. Suspendisse rhoncus pulvinar facilisis. Suspendisse vehicula erat ac diam eleifend, vitae consectetur libero porta. Etiam porttitor ante vel ligula vehicula placerat. Sed blandit quam et urna tempor accumsan. Proin elementum metus est, quis ullamcorper elit sollicitudin id. Vivamus finibus, diam id gravida ultricies, neque dui euismod neque, eu fermentum velit elit efficitur enim. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam rutrum leo et ante dapibus, vitae posuere arcu pharetra. Cras vitae sollicitudin velit. Cras eget varius sem. Etiam malesuada vehicula metus, ac blandit leo mollis eget.
{ "content_hash": "69aff77085b31c6d18f85b0a55096368", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 560, "avg_line_length": 88.125, "alnum_prop": 0.8141843971631205, "repo_name": "KlishGroup/prose-pogs", "id": "3ccdb67b9450b6fc59febc6299b435d4bf69f7d2", "size": "2119", "binary": false, "copies": "1", "ref": "refs/heads/gh-pages", "path": "pogs/T/TULBYHX/PEP/index.md", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
SYNONYM #### According to Index Fungorum #### Published in null #### Original name Scleroderma strobilinum Kalchbr., 1875 ### Remarks null
{ "content_hash": "00d04303410b7c2c5c51cd62538a16a6", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 38, "avg_line_length": 10.923076923076923, "alnum_prop": 0.7183098591549296, "repo_name": "mdoering/backbone", "id": "6db4a839c103b4782781b9f931961c44e3c3dacc", "size": "226", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Fungi/Basidiomycota/Agaricomycetes/Agaricales/Phelloriniaceae/Phellorinia/Phellorinia herculeana/ Syn. Phellorinia herculeana strobilina/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package org.http4s package headers import org.http4s.parser.HttpHeaderParser import org.http4s.util.NonEmptyList object `WWW-Authenticate` extends HeaderKey.Internal[`WWW-Authenticate`] with HeaderKey.Recurring { override def parse(s: String): ParseResult[`WWW-Authenticate`] = HttpHeaderParser.WWW_AUTHENTICATE(s) } final case class `WWW-Authenticate`(values: NonEmptyList[Challenge]) extends Header.RecurringRenderable { override def key: `WWW-Authenticate`.type = `WWW-Authenticate` type Value = Challenge }
{ "content_hash": "57fdd5594174fa17961ebe48fabbc5e1", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 105, "avg_line_length": 32.8125, "alnum_prop": 0.7904761904761904, "repo_name": "m4dc4p/http4s", "id": "354944b6a9f63c44fe88137f30d2470e71ff8723", "size": "525", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "core/src/main/scala/org/http4s/headers/WWW-Authenticate.scala", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "18" }, { "name": "JavaScript", "bytes": "9" }, { "name": "Scala", "bytes": "996951" }, { "name": "Shell", "bytes": "1264" } ], "symlink_target": "" }
package org.apache.dubbo.metadata.definition.builder; import org.apache.dubbo.metadata.definition.TypeDefinitionBuilder; import org.apache.dubbo.metadata.definition.model.TypeDefinition; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.text.MessageFormat; import java.util.Arrays; import java.util.Map; /** * 2015/1/27. */ public class MapTypeBuilder implements TypeBuilder { @Override public boolean accept(Type type, Class<?> clazz) { if (clazz == null) { return false; } return Map.class.isAssignableFrom(clazz); } @Override public TypeDefinition build(Type type, Class<?> clazz, Map<Class<?>, TypeDefinition> typeCache) { if (!(type instanceof ParameterizedType)) { return new TypeDefinition(clazz.getName()); } ParameterizedType parameterizedType = (ParameterizedType) type; Type[] actualTypeArgs = parameterizedType.getActualTypeArguments(); if (actualTypeArgs == null || actualTypeArgs.length != 2) { throw new IllegalArgumentException(MessageFormat.format( "[ServiceDefinitionBuilder] Map type [{0}] with unexpected amount of arguments [{1}]." + Arrays.toString(actualTypeArgs), type, actualTypeArgs)); } for (Type actualType : actualTypeArgs) { if (actualType instanceof ParameterizedType) { // Nested collection or map. Class<?> rawType = (Class<?>) ((ParameterizedType) actualType).getRawType(); TypeDefinitionBuilder.build(actualType, rawType, typeCache); } else if (actualType instanceof Class<?>) { Class<?> actualClass = (Class<?>) actualType; TypeDefinitionBuilder.build(null, actualClass, typeCache); } } return new TypeDefinition(type.toString()); } }
{ "content_hash": "6de887b36a54e257b3b4751794b4af9e", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 106, "avg_line_length": 36.58490566037736, "alnum_prop": 0.6456936565239815, "repo_name": "aglne/dubbo", "id": "a2070829ffa64787c92d76913a7e34cabfdcaf21", "size": "2740", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "dubbo-metadata-report/dubbo-metadata-definition/src/main/java/org/apache/dubbo/metadata/definition/builder/MapTypeBuilder.java", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "3447" }, { "name": "CSS", "bytes": "18582" }, { "name": "Java", "bytes": "5301948" }, { "name": "JavaScript", "bytes": "63148" }, { "name": "Lex", "bytes": "2077" }, { "name": "Shell", "bytes": "7011" }, { "name": "Thrift", "bytes": "668" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en" data-ng-app="app"> <head> <meta charset="utf-8" /> <title>BKD Kabupaten Sampang - Company Profile</title> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" /> <link rel="stylesheet" href="css/bootstrap.css" type="text/css" /> <link rel="stylesheet" href="css/animate.css" type="text/css" /> <link rel="stylesheet" href="css/font-awesome.min.css" type="text/css" /> <link rel="stylesheet" href="css/app.css" type="text/css" /> <link rel="stylesheet" href="css/toaster.min.css" type="text/css" /> <link rel="stylesheet" href="css/select.min.css" type="text/css" /> <link rel="stylesheet" href="css/loading-bar.css" type="text/css" /> </head> <body ng-controller="AppCtrl"> <toaster-container></toaster-container> <div class="app ng-scope app-header-fixed app-aside-dock" id="app" ng-class="" ui-view></div> <script src="vendor/jquery/jquery.min.js"></script> <script src="vendor/angular/angular.js"></script> <script src="vendor/angular/angular-locale_id-id.js"></script> <script src="vendor/angular/angular-animate/angular-animate.js"></script> <script src="vendor/angular/angular-sanitize/angular-sanitize.js"></script> <!-- Vendor --> <script src="vendor/angular/angular-ui-router/angular-ui-router.js"></script> <script src="vendor/libs/moment.min.js"></script> <script src="vendor/libs/screenfull.min.js"></script> <script src="vendor/angular/angular-bootstrap/ui-bootstrap-tpls.js"></script> <script src="vendor/angular/oclazyload/ocLazyLoad.js"></script> <script src="vendor/angular/angular-smart-table/smart-table.js"></script> <script src="vendor/angular/angular-toaster/toaster.min.js"></script> <script src="vendor/modules/angular-ui-select/select.min.js"></script> <script src="vendor/modules/loading-bar.js"></script> <!-- App --> <script src="js/app.js"></script> <script src="js/config.js"></script> <script src="js/config.lazyload.js"></script> <script src="js/config.router.js"></script> <script src="js/main.js"></script> <script src="js/directives.js"></script> <script src="js/data.js"></script> </body> </html>
{ "content_hash": "f0932031afd7903e6c255d60963dec27", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 97, "avg_line_length": 52, "alnum_prop": 0.6440170940170941, "repo_name": "landasystems/bkd_cp", "id": "de117e52fe04447d066600e2cd9ffa24a53a18e1", "size": "2340", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/index.html", "mode": "33261", "license": "bsd-3-clause", "language": [ { "name": "ApacheConf", "bytes": "367" }, { "name": "Batchfile", "bytes": "1541" }, { "name": "CSS", "bytes": "334252" }, { "name": "HTML", "bytes": "45148" }, { "name": "JavaScript", "bytes": "274568" }, { "name": "PHP", "bytes": "403582" } ], "symlink_target": "" }
html,body,h1,h2,h3,h4,h5,h6,div,dl,dt,dd,ul,ol,li,p,blockquote,pre,hr,figure,table,caption,th,td,form,fieldset,legend,input,button,textarea,menu{margin:0;padding:0;} header,footer,section,article,aside,nav,hgroup,address,figure,figcaption,menu,details{display:block;} table{border-collapse:collapse;border-spacing:0;} caption,th{text-align:left;font-weight:normal;} html,body,fieldset,img,iframe,abbr{border:0;} i,cite,em,var,address,dfn{font-style:normal;} [hidefocus],summary{outline:0;} li{list-style:none;} /*h1,h2,h3,h4,h5,h6,small{font-size:100%;}*/ sup,sub{font-size:83%;} pre,code,kbd,samp{font-family:inherit;} q:before,q:after{content:none;} textarea{overflow:auto;resize:none;} label,summary{cursor:default;} a,button{cursor:pointer;} /*h1,h2,h3,h4,h5,h6,em,strong,b{font-weight:normal;}*/ del,ins,u,s,a,a:hover{text-decoration:none;} body,textarea,input,button,select,keygen,legend{font:12px/1.14 arial,simsun;color:#333;outline:0;} body{background:#fff;} a{color:#0063dc;} a:hover{color:#C1BEF4;}
{ "content_hash": "c419b1f49da38d40dba14f3f36aee16b", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 165, "avg_line_length": 42.208333333333336, "alnum_prop": 0.7630799605133267, "repo_name": "Lirongkun/baiduIFE-stage1", "id": "2e3075dffc4cf9a6c5a75c7bcf3cdf569f271af5", "size": "1013", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "task_05/css/reset.css", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "14067" }, { "name": "HTML", "bytes": "37466" } ], "symlink_target": "" }
angular.module('myApp.navigation', []) .controller('NavigationCtrl', [function() { }]);
{ "content_hash": "eaaedd4dcc2bc73302003db4546db78a", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 47, "avg_line_length": 31.666666666666668, "alnum_prop": 0.631578947368421, "repo_name": "Ivelina-Evy/WiredeltaChallenge", "id": "9dcfb1efa07de3898071d95e07d97faecbd6ace1", "size": "95", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/partial/navigation/navigation.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "3242" }, { "name": "HTML", "bytes": "15143" }, { "name": "JavaScript", "bytes": "6354" } ], "symlink_target": "" }
import React from 'react'; import {Layout, BackTop} from 'antd'; import {Route} from 'react-router-dom'; import Home from "../routes/Home/index"; import Setting from "../routes/Setting/index"; import User from "../routes/User/index"; import './Content.css'; class Content extends React.Component{ render(){ return ( <Layout.Content className="content"> <Route exact={true} path='/' component={Home}/> <Route path='/setting' component={Setting}/> <Route path='/users' component={User}/> <BackTop /> </Layout.Content> ); } } export default Content;
{ "content_hash": "3858a6a34c41ecbe13eb6a2c5e1ebdc0", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 63, "avg_line_length": 30, "alnum_prop": 0.5893939393939394, "repo_name": "RichardTianke/react-ant-design-demo-blog", "id": "05d3bc7589e81ffdfbb7d9e327bf6a64be78faef", "size": "660", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/components/Main/Content.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "570" }, { "name": "HTML", "bytes": "1590" }, { "name": "JavaScript", "bytes": "61232" } ], "symlink_target": "" }
#import <OCMock/OCMock.h> #import <XCTest/XCTest.h> #import "GMUPlacemark.h" @interface GMUPlacemarkTest : XCTestCase @end static NSString *const kTitle = @"Placemark"; static NSString *const kSnippet = @"A test placemark."; static NSString *const kStyleUrl = @"#test"; @implementation GMUPlacemarkTest - (void)testInitWithGeometry { id geometry = OCMProtocolMock(@protocol(GMUGeometry)); id style = OCMClassMock([GMUStyle class]); GMUPlacemark *placemark = [[GMUPlacemark alloc] initWithGeometry:geometry title:kTitle snippet:kSnippet style:style styleUrl:kStyleUrl]; XCTAssertEqualObjects(placemark.geometry, geometry); XCTAssertEqualObjects(placemark.title, kTitle); XCTAssertEqualObjects(placemark.snippet, kSnippet); XCTAssertEqualObjects(placemark.style, style); XCTAssertEqualObjects(placemark.styleUrl, kStyleUrl); } @end
{ "content_hash": "f7554520cb05478c0d8aa69b6f31d9a8", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 78, "avg_line_length": 34.15625, "alnum_prop": 0.6120768526989936, "repo_name": "mountainvat/google-maps-ios-utils", "id": "123a3156e83d6cac71cbb7b98d27a13b490540f8", "size": "1688", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "test/unit/Geometry/GMUPlacemarkTest.m", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "651" }, { "name": "Objective-C", "bytes": "313540" }, { "name": "Objective-C++", "bytes": "2944" }, { "name": "Ruby", "bytes": "1553" } ], "symlink_target": "" }
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.facebook.presto.plugin.prometheus; import com.facebook.presto.common.block.Block; import java.time.Instant; import static java.util.Objects.requireNonNull; public class PrometheusStandardizedRow { private final Block labels; private final Instant timestamp; private final Double value; public PrometheusStandardizedRow(Block labels, Instant timestamp, Double value) { this.labels = requireNonNull(labels, "labels is null"); this.timestamp = requireNonNull(timestamp, "timestamp is null"); this.value = requireNonNull(value, "value is null"); } public Block getLabels() { return labels; } public Instant getTimestamp() { return timestamp; } public Double getValue() { return value; } }
{ "content_hash": "ff4a22e3a1b1ba5e68cb4a3d14e24b8d", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 83, "avg_line_length": 28.06122448979592, "alnum_prop": 0.7061818181818181, "repo_name": "facebook/presto", "id": "ba6ab3e2aeaaf3be5d50cff27c922efeb96b695d", "size": "1375", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "presto-prometheus/src/main/java/com/facebook/presto/plugin/prometheus/PrometheusStandardizedRow.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ANTLR", "bytes": "23084" }, { "name": "HTML", "bytes": "65534" }, { "name": "Java", "bytes": "15096490" }, { "name": "JavaScript", "bytes": "4863" }, { "name": "Makefile", "bytes": "6819" }, { "name": "PLSQL", "bytes": "6538" }, { "name": "Python", "bytes": "4479" }, { "name": "SQLPL", "bytes": "6363" }, { "name": "Shell", "bytes": "9520" } ], "symlink_target": "" }
package org.apache.camel.processor; import java.text.NumberFormat; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import org.apache.camel.AsyncCallback; import org.apache.camel.AsyncProcessor; import org.apache.camel.CamelContext; import org.apache.camel.Exchange; import org.apache.camel.support.ServiceSupport; import org.apache.camel.util.AsyncProcessorHelper; import org.apache.camel.util.CamelLogger; import org.apache.camel.util.ObjectHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * A logger for logging message throughput. * * @version */ public class ThroughputLogger extends ServiceSupport implements AsyncProcessor { private static final Logger LOG = LoggerFactory.getLogger(ThroughputLogger.class); private final AtomicInteger receivedCounter = new AtomicInteger(); private NumberFormat numberFormat = NumberFormat.getNumberInstance(); private long groupReceivedCount; private boolean groupActiveOnly; private Integer groupSize; private long groupDelay = 1000; private Long groupInterval; private long startTime; private long groupStartTime; private String action = "Received"; private CamelContext camelContext; private ScheduledExecutorService logSchedulerService; private CamelLogger log; private String lastLogMessage; private double rate; private double average; public ThroughputLogger(CamelLogger log) { this.log = log; } public ThroughputLogger(CamelLogger log, Integer groupSize) { this(log); setGroupSize(groupSize); } public ThroughputLogger(CamelLogger log, CamelContext camelContext, Long groupInterval, Long groupDelay, Boolean groupActiveOnly) { this(log); this.camelContext = camelContext; setGroupInterval(groupInterval); setGroupActiveOnly(groupActiveOnly); if (groupDelay != null) { setGroupDelay(groupDelay); } } public void process(Exchange exchange) throws Exception { AsyncProcessorHelper.process(this, exchange); } public boolean process(Exchange exchange, AsyncCallback callback) { if (startTime == 0) { startTime = System.currentTimeMillis(); } int receivedCount = receivedCounter.incrementAndGet(); //only process if groupSize is set...otherwise we're in groupInterval mode if (groupSize != null) { if (receivedCount % groupSize == 0) { lastLogMessage = createLogMessage(exchange, receivedCount); log.log(lastLogMessage); } } callback.done(true); return true; } public Integer getGroupSize() { return groupSize; } public void setGroupSize(Integer groupSize) { if (groupSize == null || groupSize <= 0) { throw new IllegalArgumentException("groupSize must be positive, was: " + groupSize); } this.groupSize = groupSize; } public Long getGroupInterval() { return groupInterval; } public void setGroupInterval(Long groupInterval) { if (groupInterval == null || groupInterval <= 0) { throw new IllegalArgumentException("groupInterval must be positive, was: " + groupInterval); } this.groupInterval = groupInterval; } public long getGroupDelay() { return groupDelay; } public void setGroupDelay(long groupDelay) { this.groupDelay = groupDelay; } public boolean getGroupActiveOnly() { return groupActiveOnly; } private void setGroupActiveOnly(boolean groupActiveOnly) { this.groupActiveOnly = groupActiveOnly; } public NumberFormat getNumberFormat() { return numberFormat; } public void setNumberFormat(NumberFormat numberFormat) { this.numberFormat = numberFormat; } public String getAction() { return action; } public void setAction(String action) { this.action = action; } public void reset() { startTime = 0; receivedCounter.set(0); groupStartTime = 0; groupReceivedCount = 0; average = 0.0d; rate = 0.0d; lastLogMessage = null; } public double getRate() { return rate; } public double getAverage() { return average; } public int getReceivedCounter() { return receivedCounter.get(); } public String getLastLogMessage() { return lastLogMessage; } @Override public void doStart() throws Exception { // if an interval was specified, create a background thread if (groupInterval != null) { ObjectHelper.notNull(camelContext, "CamelContext", this); logSchedulerService = camelContext.getExecutorServiceManager().newScheduledThreadPool(this, "ThroughputLogger", 1); Runnable scheduledLogTask = new ScheduledLogTask(); LOG.info("Scheduling throughput log to run every " + groupInterval + " millis."); // must use fixed rate to have it trigger at every X interval logSchedulerService.scheduleAtFixedRate(scheduledLogTask, groupDelay, groupInterval, TimeUnit.MILLISECONDS); } } @Override public void doStop() throws Exception { if (logSchedulerService != null) { camelContext.getExecutorServiceManager().shutdown(logSchedulerService); logSchedulerService = null; } } protected String createLogMessage(Exchange exchange, int receivedCount) { long time = System.currentTimeMillis(); if (groupStartTime == 0) { groupStartTime = startTime; } rate = messagesPerSecond(groupSize, groupStartTime, time); average = messagesPerSecond(receivedCount, startTime, time); long duration = time - groupStartTime; groupStartTime = time; return getAction() + ": " + receivedCount + " messages so far. Last group took: " + duration + " millis which is: " + numberFormat.format(rate) + " messages per second. average: " + numberFormat.format(average); } /** * Background task that logs throughput stats. */ private final class ScheduledLogTask implements Runnable { public void run() { // only run if CamelContext has been fully started if (!camelContext.getStatus().isStarted()) { LOG.trace("ThroughputLogger cannot start because CamelContext({}) has not been started yet", camelContext.getName()); return; } createGroupIntervalLogMessage(); } } protected void createGroupIntervalLogMessage() { // this indicates that no messages have been received yet...don't log yet if (startTime == 0) { return; } int receivedCount = receivedCounter.get(); // if configured, hide log messages when no new messages have been received if (groupActiveOnly && receivedCount == groupReceivedCount) { return; } long time = System.currentTimeMillis(); if (groupStartTime == 0) { groupStartTime = startTime; } long duration = time - groupStartTime; long currentCount = receivedCount - groupReceivedCount; rate = messagesPerSecond(currentCount, groupStartTime, time); average = messagesPerSecond(receivedCount, startTime, time); groupStartTime = time; groupReceivedCount = receivedCount; lastLogMessage = getAction() + ": " + currentCount + " new messages, with total " + receivedCount + " so far. Last group took: " + duration + " millis which is: " + numberFormat.format(rate) + " messages per second. average: " + numberFormat.format(average); log.log(lastLogMessage); } protected double messagesPerSecond(long messageCount, long startTime, long endTime) { // timeOneMessage = elapsed / messageCount // messagePerSend = 1000 / timeOneMessage double rate = messageCount * 1000.0; rate /= endTime - startTime; return rate; } }
{ "content_hash": "51113f2915b4781b0fed6af623d6184c", "timestamp": "", "source": "github", "line_count": 262, "max_line_length": 147, "avg_line_length": 31.950381679389313, "alnum_prop": 0.6511766814000717, "repo_name": "igarashitm/camel", "id": "8cc0616be13966a46f8edbbf59a9b8c7ea8d806b", "size": "9174", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "camel-core/src/main/java/org/apache/camel/processor/ThroughputLogger.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ActionScript", "bytes": "20202" }, { "name": "CSS", "bytes": "221391" }, { "name": "Elm", "bytes": "5970" }, { "name": "Groovy", "bytes": "18886" }, { "name": "Java", "bytes": "37040626" }, { "name": "JavaScript", "bytes": "3695475" }, { "name": "PHP", "bytes": "88860" }, { "name": "Ruby", "bytes": "11588" }, { "name": "Scala", "bytes": "266906" }, { "name": "Shell", "bytes": "13168" }, { "name": "TypeScript", "bytes": "715" }, { "name": "XQuery", "bytes": "1483" }, { "name": "XSLT", "bytes": "72262" } ], "symlink_target": "" }
AnalyticsAdminService --------------------------------------- .. automodule:: google.analytics.admin_v1beta.services.analytics_admin_service :members: :inherited-members: .. automodule:: google.analytics.admin_v1beta.services.analytics_admin_service.pagers :members: :inherited-members:
{ "content_hash": "44dbd3e8ab3c44fcba78e642b2218dd2", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 85, "avg_line_length": 30.5, "alnum_prop": 0.6655737704918033, "repo_name": "googleapis/python-analytics-admin", "id": "aca3ba6d59772900fd3b69098595db292c027384", "size": "305", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "docs/admin_v1beta/analytics_admin_service.rst", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "2050" }, { "name": "Python", "bytes": "5576405" }, { "name": "Shell", "bytes": "30687" } ], "symlink_target": "" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Search &mdash; Bulbs 0.2 documentation</title> <link rel="stylesheet" href="_static/alabaster.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: './', VERSION: '0.2', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/doctools.js"></script> <script type="text/javascript" src="_static/searchtools.js"></script> <link rel="top" title="Bulbs 0.2 documentation" href="index.html" /> <script type="text/javascript"> jQuery(function() { Search.loadIndex("searchindex.js"); }); </script> <script type="text/javascript" id="searchindexloader"></script> <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" /> </head> <body role="document"> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body" role="main"> <h1 id="search-documentation">Search</h1> <div id="fallback" class="admonition warning"> <script type="text/javascript">$('#fallback').hide();</script> <p> Please activate JavaScript to enable the search functionality. </p> </div> <p> From here you can search these documents. Enter your search words into the box below and click "search". Note that the search function will automatically search for all of the words. Pages containing fewer words won't appear in the result list. </p> <form action="" method="get"> <input type="text" name="q" value="" /> <input type="submit" value="search" /> <span id="search-progress" style="padding-left: 10px"></span> </form> <div id="search-results"> </div> </div> </div> </div> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> <div class="sphinxsidebarwrapper"><div class="relations"> <h3>Related Topics</h3> <ul> <li><a href="index.html">Documentation overview</a><ul> </ul></li> </ul> </div> </div> </div> <div class="clearer"></div> </div> <div class="footer"> &copy;2016, John Murphy. | Powered by <a href="http://sphinx-doc.org/">Sphinx 1.4</a> &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.7</a> </div> </body> </html>
{ "content_hash": "7a365c2dc3a866dd39430ba63f7a9f47", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 93, "avg_line_length": 29.828282828282827, "alnum_prop": 0.6112428039282086, "repo_name": "CrystallineEntity/bulbs", "id": "64fb2ea9190e0794b5727b4ad7aeda8959350fd5", "size": "2953", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "docs/_build/html/search.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "6934" }, { "name": "JavaScript", "bytes": "1082" }, { "name": "Mako", "bytes": "38352" }, { "name": "Python", "bytes": "50070" } ], "symlink_target": "" }
require 'libglade2' require 'sta-viewer_glade' class StaViewer < StaViewerGlade def initialize(path_or_data, root = nil, domain = nil, localedir = nil, flag = GladeXML::FILE) bindtextdomain(domain, localedir, nil, "UTF-8") super(path_or_data, root = nil, domain = nil, localedir = nil, flag = GladeXML::FILE) end def on_window1_destroy_event(widget, arg0) Gtk.main_quit end def on_toolbutton1_clicked(widget) Gtk.main_quit end end # Main program if __FILE__ == $0 # Set values as your own application. PROG_PATH = "sta-viewer.glade" PROG_NAME = "STA Viewer" Gtk.init StaViewer.new(PROG_PATH, nil, PROG_NAME) Gtk.main end
{ "content_hash": "4ed9fdbd58cefa225816f7f2da7f645e", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 96, "avg_line_length": 25.88888888888889, "alnum_prop": 0.6552217453505007, "repo_name": "satokano/stamanagement", "id": "036374e9efd5917a77618789c815af5a252c2a1e", "size": "789", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "testgui/sta-viewer.rb", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "61063" }, { "name": "Ruby", "bytes": "1691" } ], "symlink_target": "" }
Paragraph which includes styled docker image reference. _namespace/image-name:4.2.1_. More than one actually, here it is again, with a different version `namespace/image-name:33.44.55`. Also in code blocks: ```yaml image: namespace/image-name:8.7.6 ``` More text
{ "content_hash": "520c77ed0bbcdb97015084a8ea2195de", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 185, "avg_line_length": 29.555555555555557, "alnum_prop": 0.7518796992481203, "repo_name": "joemaller/version-everything", "id": "9daa7d9b29cce49807a9e030ea3b3508d5cd9f57", "size": "302", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/fixture/deep/dotfile/readme-with-docker-image-tag.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "470" }, { "name": "Dockerfile", "bytes": "38" }, { "name": "JavaScript", "bytes": "65541" }, { "name": "PHP", "bytes": "226" } ], "symlink_target": "" }
package com.amazonaws.services.elastictranscoder.model; import java.io.Serializable; import com.amazonaws.AmazonWebServiceRequest; /** * <p> * The <code>UpdatePipelineRequest</code> structure. * </p> */ public class UpdatePipelineRequest extends AmazonWebServiceRequest implements Serializable, Cloneable { /** * <p> * The ID of the pipeline that you want to update. * </p> */ private String id; /** * <p> * The name of the pipeline. We recommend that the name be unique within the * AWS account, but uniqueness is not enforced. * </p> * <p> * Constraints: Maximum 40 characters * </p> */ private String name; /** * <p> * The Amazon S3 bucket in which you saved the media files that you want to * transcode and the graphics that you want to use as watermarks. * </p> */ private String inputBucket; /** * <p> * The IAM Amazon Resource Name (ARN) for the role that you want Elastic * Transcoder to use to transcode jobs for this pipeline. * </p> */ private String role; /** * <p> * The AWS Key Management Service (AWS KMS) key that you want to use with * this pipeline. * </p> * <p> * If you use either <code>S3</code> or <code>S3-AWS-KMS</code> as your * <code>Encryption:Mode</code>, you don't need to provide a key with your * job because a default key, known as an AWS-KMS key, is created for you * automatically. You need to provide an AWS-KMS key only if you want to use * a non-default AWS-KMS key, or if you are using an * <code>Encryption:Mode</code> of <code>AES-PKCS7</code>, * <code>AES-CTR</code>, or <code>AES-GCM</code>. * </p> */ private String awsKmsKeyArn; private Notifications notifications; /** * <p> * The optional <code>ContentConfig</code> object specifies information * about the Amazon S3 bucket in which you want Elastic Transcoder to save * transcoded files and playlists: which bucket to use, which users you want * to have access to the files, the type of access you want users to have, * and the storage class that you want to assign to the files. * </p> * <p> * If you specify values for <code>ContentConfig</code>, you must also * specify values for <code>ThumbnailConfig</code>. * </p> * <p> * If you specify values for <code>ContentConfig</code> and * <code>ThumbnailConfig</code>, omit the <code>OutputBucket</code> object. * </p> * <ul> * <li><b>Bucket</b>: The Amazon S3 bucket in which you want Elastic * Transcoder to save transcoded files and playlists.</li> * <li><b>Permissions</b> (Optional): The Permissions object specifies which * users you want to have access to transcoded files and the type of access * you want them to have. You can grant permissions to a maximum of 30 users * and/or predefined Amazon S3 groups.</li> * <li><b>Grantee Type</b>: Specify the type of value that appears in the * <code>Grantee</code> object: * <ul> * <li><b>Canonical</b>: The value in the <code>Grantee</code> object is * either the canonical user ID for an AWS account or an origin access * identity for an Amazon CloudFront distribution. For more information * about canonical user IDs, see Access Control List (ACL) Overview in the * Amazon Simple Storage Service Developer Guide. For more information about * using CloudFront origin access identities to require that users use * CloudFront URLs instead of Amazon S3 URLs, see Using an Origin Access * Identity to Restrict Access to Your Amazon S3 Content. <important>A * canonical user ID is not the same as an AWS account number.</important></li> * <li><b>Email</b>: The value in the <code>Grantee</code> object is the * registered email address of an AWS account.</li> * <li><b>Group</b>: The value in the <code>Grantee</code> object is one of * the following predefined Amazon S3 groups: <code>AllUsers</code>, * <code>AuthenticatedUsers</code>, or <code>LogDelivery</code>.</li> * </ul> * </li> * <li><b>Grantee</b>: The AWS user or group that you want to have access to * transcoded files and playlists. To identify the user or group, you can * specify the canonical user ID for an AWS account, an origin access * identity for a CloudFront distribution, the registered email address of * an AWS account, or a predefined Amazon S3 group</li> * <li><b>Access</b>: The permission that you want to give to the AWS user * that you specified in <code>Grantee</code>. Permissions are granted on * the files that Elastic Transcoder adds to the bucket, including playlists * and video files. Valid values include: * <ul> * <li><code>READ</code>: The grantee can read the objects and metadata for * objects that Elastic Transcoder adds to the Amazon S3 bucket.</li> * <li><code>READ_ACP</code>: The grantee can read the object ACL for * objects that Elastic Transcoder adds to the Amazon S3 bucket.</li> * <li><code>WRITE_ACP</code>: The grantee can write the ACL for the objects * that Elastic Transcoder adds to the Amazon S3 bucket.</li> * <li><code>FULL_CONTROL</code>: The grantee has <code>READ</code>, * <code>READ_ACP</code>, and <code>WRITE_ACP</code> permissions for the * objects that Elastic Transcoder adds to the Amazon S3 bucket.</li> * </ul> * </li> * <li><b>StorageClass</b>: The Amazon S3 storage class, * <code>Standard</code> or <code>ReducedRedundancy</code>, that you want * Elastic Transcoder to assign to the video files and playlists that it * stores in your Amazon S3 bucket.</li> * </ul> */ private PipelineOutputConfig contentConfig; /** * <p> * The <code>ThumbnailConfig</code> object specifies several values, * including the Amazon S3 bucket in which you want Elastic Transcoder to * save thumbnail files, which users you want to have access to the files, * the type of access you want users to have, and the storage class that you * want to assign to the files. * </p> * <p> * If you specify values for <code>ContentConfig</code>, you must also * specify values for <code>ThumbnailConfig</code> even if you don't want to * create thumbnails. * </p> * <p> * If you specify values for <code>ContentConfig</code> and * <code>ThumbnailConfig</code>, omit the <code>OutputBucket</code> object. * </p> * <ul> * <li><b>Bucket</b>: The Amazon S3 bucket in which you want Elastic * Transcoder to save thumbnail files.</li> * <li><b>Permissions</b> (Optional): The <code>Permissions</code> object * specifies which users and/or predefined Amazon S3 groups you want to have * access to thumbnail files, and the type of access you want them to have. * You can grant permissions to a maximum of 30 users and/or predefined * Amazon S3 groups.</li> * <li><b>GranteeType</b>: Specify the type of value that appears in the * Grantee object: * <ul> * <li><b>Canonical</b>: The value in the <code>Grantee</code> object is * either the canonical user ID for an AWS account or an origin access * identity for an Amazon CloudFront distribution. <important>A canonical * user ID is not the same as an AWS account number.</important></li> * <li><b>Email</b>: The value in the <code>Grantee</code> object is the * registered email address of an AWS account.</li> * <li><b>Group</b>: The value in the <code>Grantee</code> object is one of * the following predefined Amazon S3 groups: <code>AllUsers</code>, * <code>AuthenticatedUsers</code>, or <code>LogDelivery</code>.</li> * </ul> * </li> * <li><b>Grantee</b>: The AWS user or group that you want to have access to * thumbnail files. To identify the user or group, you can specify the * canonical user ID for an AWS account, an origin access identity for a * CloudFront distribution, the registered email address of an AWS account, * or a predefined Amazon S3 group.</li> * <li><b>Access</b>: The permission that you want to give to the AWS user * that you specified in <code>Grantee</code>. Permissions are granted on * the thumbnail files that Elastic Transcoder adds to the bucket. Valid * values include: * <ul> * <li><code>READ</code>: The grantee can read the thumbnails and metadata * for objects that Elastic Transcoder adds to the Amazon S3 bucket.</li> * <li><code>READ_ACP</code>: The grantee can read the object ACL for * thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.</li> * <li><code>WRITE_ACP</code>: The grantee can write the ACL for the * thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.</li> * <li><code>FULL_CONTROL</code>: The grantee has <code>READ</code>, * <code>READ_ACP</code>, and <code>WRITE_ACP</code> permissions for the * thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.</li> * </ul> * </li> * <li><b>StorageClass</b>: The Amazon S3 storage class, * <code>Standard</code> or <code>ReducedRedundancy</code>, that you want * Elastic Transcoder to assign to the thumbnails that it stores in your * Amazon S3 bucket.</li> * </ul> */ private PipelineOutputConfig thumbnailConfig; /** * <p> * The ID of the pipeline that you want to update. * </p> * * @param id * The ID of the pipeline that you want to update. */ public void setId(String id) { this.id = id; } /** * <p> * The ID of the pipeline that you want to update. * </p> * * @return The ID of the pipeline that you want to update. */ public String getId() { return this.id; } /** * <p> * The ID of the pipeline that you want to update. * </p> * * @param id * The ID of the pipeline that you want to update. * @return Returns a reference to this object so that method calls can be * chained together. */ public UpdatePipelineRequest withId(String id) { setId(id); return this; } /** * <p> * The name of the pipeline. We recommend that the name be unique within the * AWS account, but uniqueness is not enforced. * </p> * <p> * Constraints: Maximum 40 characters * </p> * * @param name * The name of the pipeline. We recommend that the name be unique * within the AWS account, but uniqueness is not enforced.</p> * <p> * Constraints: Maximum 40 characters */ public void setName(String name) { this.name = name; } /** * <p> * The name of the pipeline. We recommend that the name be unique within the * AWS account, but uniqueness is not enforced. * </p> * <p> * Constraints: Maximum 40 characters * </p> * * @return The name of the pipeline. We recommend that the name be unique * within the AWS account, but uniqueness is not enforced.</p> * <p> * Constraints: Maximum 40 characters */ public String getName() { return this.name; } /** * <p> * The name of the pipeline. We recommend that the name be unique within the * AWS account, but uniqueness is not enforced. * </p> * <p> * Constraints: Maximum 40 characters * </p> * * @param name * The name of the pipeline. We recommend that the name be unique * within the AWS account, but uniqueness is not enforced.</p> * <p> * Constraints: Maximum 40 characters * @return Returns a reference to this object so that method calls can be * chained together. */ public UpdatePipelineRequest withName(String name) { setName(name); return this; } /** * <p> * The Amazon S3 bucket in which you saved the media files that you want to * transcode and the graphics that you want to use as watermarks. * </p> * * @param inputBucket * The Amazon S3 bucket in which you saved the media files that you * want to transcode and the graphics that you want to use as * watermarks. */ public void setInputBucket(String inputBucket) { this.inputBucket = inputBucket; } /** * <p> * The Amazon S3 bucket in which you saved the media files that you want to * transcode and the graphics that you want to use as watermarks. * </p> * * @return The Amazon S3 bucket in which you saved the media files that you * want to transcode and the graphics that you want to use as * watermarks. */ public String getInputBucket() { return this.inputBucket; } /** * <p> * The Amazon S3 bucket in which you saved the media files that you want to * transcode and the graphics that you want to use as watermarks. * </p> * * @param inputBucket * The Amazon S3 bucket in which you saved the media files that you * want to transcode and the graphics that you want to use as * watermarks. * @return Returns a reference to this object so that method calls can be * chained together. */ public UpdatePipelineRequest withInputBucket(String inputBucket) { setInputBucket(inputBucket); return this; } /** * <p> * The IAM Amazon Resource Name (ARN) for the role that you want Elastic * Transcoder to use to transcode jobs for this pipeline. * </p> * * @param role * The IAM Amazon Resource Name (ARN) for the role that you want * Elastic Transcoder to use to transcode jobs for this pipeline. */ public void setRole(String role) { this.role = role; } /** * <p> * The IAM Amazon Resource Name (ARN) for the role that you want Elastic * Transcoder to use to transcode jobs for this pipeline. * </p> * * @return The IAM Amazon Resource Name (ARN) for the role that you want * Elastic Transcoder to use to transcode jobs for this pipeline. */ public String getRole() { return this.role; } /** * <p> * The IAM Amazon Resource Name (ARN) for the role that you want Elastic * Transcoder to use to transcode jobs for this pipeline. * </p> * * @param role * The IAM Amazon Resource Name (ARN) for the role that you want * Elastic Transcoder to use to transcode jobs for this pipeline. * @return Returns a reference to this object so that method calls can be * chained together. */ public UpdatePipelineRequest withRole(String role) { setRole(role); return this; } /** * <p> * The AWS Key Management Service (AWS KMS) key that you want to use with * this pipeline. * </p> * <p> * If you use either <code>S3</code> or <code>S3-AWS-KMS</code> as your * <code>Encryption:Mode</code>, you don't need to provide a key with your * job because a default key, known as an AWS-KMS key, is created for you * automatically. You need to provide an AWS-KMS key only if you want to use * a non-default AWS-KMS key, or if you are using an * <code>Encryption:Mode</code> of <code>AES-PKCS7</code>, * <code>AES-CTR</code>, or <code>AES-GCM</code>. * </p> * * @param awsKmsKeyArn * The AWS Key Management Service (AWS KMS) key that you want to use * with this pipeline.</p> * <p> * If you use either <code>S3</code> or <code>S3-AWS-KMS</code> as * your <code>Encryption:Mode</code>, you don't need to provide a key * with your job because a default key, known as an AWS-KMS key, is * created for you automatically. You need to provide an AWS-KMS key * only if you want to use a non-default AWS-KMS key, or if you are * using an <code>Encryption:Mode</code> of <code>AES-PKCS7</code>, * <code>AES-CTR</code>, or <code>AES-GCM</code>. */ public void setAwsKmsKeyArn(String awsKmsKeyArn) { this.awsKmsKeyArn = awsKmsKeyArn; } /** * <p> * The AWS Key Management Service (AWS KMS) key that you want to use with * this pipeline. * </p> * <p> * If you use either <code>S3</code> or <code>S3-AWS-KMS</code> as your * <code>Encryption:Mode</code>, you don't need to provide a key with your * job because a default key, known as an AWS-KMS key, is created for you * automatically. You need to provide an AWS-KMS key only if you want to use * a non-default AWS-KMS key, or if you are using an * <code>Encryption:Mode</code> of <code>AES-PKCS7</code>, * <code>AES-CTR</code>, or <code>AES-GCM</code>. * </p> * * @return The AWS Key Management Service (AWS KMS) key that you want to use * with this pipeline.</p> * <p> * If you use either <code>S3</code> or <code>S3-AWS-KMS</code> as * your <code>Encryption:Mode</code>, you don't need to provide a * key with your job because a default key, known as an AWS-KMS key, * is created for you automatically. You need to provide an AWS-KMS * key only if you want to use a non-default AWS-KMS key, or if you * are using an <code>Encryption:Mode</code> of * <code>AES-PKCS7</code>, <code>AES-CTR</code>, or * <code>AES-GCM</code>. */ public String getAwsKmsKeyArn() { return this.awsKmsKeyArn; } /** * <p> * The AWS Key Management Service (AWS KMS) key that you want to use with * this pipeline. * </p> * <p> * If you use either <code>S3</code> or <code>S3-AWS-KMS</code> as your * <code>Encryption:Mode</code>, you don't need to provide a key with your * job because a default key, known as an AWS-KMS key, is created for you * automatically. You need to provide an AWS-KMS key only if you want to use * a non-default AWS-KMS key, or if you are using an * <code>Encryption:Mode</code> of <code>AES-PKCS7</code>, * <code>AES-CTR</code>, or <code>AES-GCM</code>. * </p> * * @param awsKmsKeyArn * The AWS Key Management Service (AWS KMS) key that you want to use * with this pipeline.</p> * <p> * If you use either <code>S3</code> or <code>S3-AWS-KMS</code> as * your <code>Encryption:Mode</code>, you don't need to provide a key * with your job because a default key, known as an AWS-KMS key, is * created for you automatically. You need to provide an AWS-KMS key * only if you want to use a non-default AWS-KMS key, or if you are * using an <code>Encryption:Mode</code> of <code>AES-PKCS7</code>, * <code>AES-CTR</code>, or <code>AES-GCM</code>. * @return Returns a reference to this object so that method calls can be * chained together. */ public UpdatePipelineRequest withAwsKmsKeyArn(String awsKmsKeyArn) { setAwsKmsKeyArn(awsKmsKeyArn); return this; } /** * @param notifications */ public void setNotifications(Notifications notifications) { this.notifications = notifications; } /** * @return */ public Notifications getNotifications() { return this.notifications; } /** * @param notifications * @return Returns a reference to this object so that method calls can be * chained together. */ public UpdatePipelineRequest withNotifications(Notifications notifications) { setNotifications(notifications); return this; } /** * <p> * The optional <code>ContentConfig</code> object specifies information * about the Amazon S3 bucket in which you want Elastic Transcoder to save * transcoded files and playlists: which bucket to use, which users you want * to have access to the files, the type of access you want users to have, * and the storage class that you want to assign to the files. * </p> * <p> * If you specify values for <code>ContentConfig</code>, you must also * specify values for <code>ThumbnailConfig</code>. * </p> * <p> * If you specify values for <code>ContentConfig</code> and * <code>ThumbnailConfig</code>, omit the <code>OutputBucket</code> object. * </p> * <ul> * <li><b>Bucket</b>: The Amazon S3 bucket in which you want Elastic * Transcoder to save transcoded files and playlists.</li> * <li><b>Permissions</b> (Optional): The Permissions object specifies which * users you want to have access to transcoded files and the type of access * you want them to have. You can grant permissions to a maximum of 30 users * and/or predefined Amazon S3 groups.</li> * <li><b>Grantee Type</b>: Specify the type of value that appears in the * <code>Grantee</code> object: * <ul> * <li><b>Canonical</b>: The value in the <code>Grantee</code> object is * either the canonical user ID for an AWS account or an origin access * identity for an Amazon CloudFront distribution. For more information * about canonical user IDs, see Access Control List (ACL) Overview in the * Amazon Simple Storage Service Developer Guide. For more information about * using CloudFront origin access identities to require that users use * CloudFront URLs instead of Amazon S3 URLs, see Using an Origin Access * Identity to Restrict Access to Your Amazon S3 Content. <important>A * canonical user ID is not the same as an AWS account number.</important></li> * <li><b>Email</b>: The value in the <code>Grantee</code> object is the * registered email address of an AWS account.</li> * <li><b>Group</b>: The value in the <code>Grantee</code> object is one of * the following predefined Amazon S3 groups: <code>AllUsers</code>, * <code>AuthenticatedUsers</code>, or <code>LogDelivery</code>.</li> * </ul> * </li> * <li><b>Grantee</b>: The AWS user or group that you want to have access to * transcoded files and playlists. To identify the user or group, you can * specify the canonical user ID for an AWS account, an origin access * identity for a CloudFront distribution, the registered email address of * an AWS account, or a predefined Amazon S3 group</li> * <li><b>Access</b>: The permission that you want to give to the AWS user * that you specified in <code>Grantee</code>. Permissions are granted on * the files that Elastic Transcoder adds to the bucket, including playlists * and video files. Valid values include: * <ul> * <li><code>READ</code>: The grantee can read the objects and metadata for * objects that Elastic Transcoder adds to the Amazon S3 bucket.</li> * <li><code>READ_ACP</code>: The grantee can read the object ACL for * objects that Elastic Transcoder adds to the Amazon S3 bucket.</li> * <li><code>WRITE_ACP</code>: The grantee can write the ACL for the objects * that Elastic Transcoder adds to the Amazon S3 bucket.</li> * <li><code>FULL_CONTROL</code>: The grantee has <code>READ</code>, * <code>READ_ACP</code>, and <code>WRITE_ACP</code> permissions for the * objects that Elastic Transcoder adds to the Amazon S3 bucket.</li> * </ul> * </li> * <li><b>StorageClass</b>: The Amazon S3 storage class, * <code>Standard</code> or <code>ReducedRedundancy</code>, that you want * Elastic Transcoder to assign to the video files and playlists that it * stores in your Amazon S3 bucket.</li> * </ul> * * @param contentConfig * The optional <code>ContentConfig</code> object specifies * information about the Amazon S3 bucket in which you want Elastic * Transcoder to save transcoded files and playlists: which bucket to * use, which users you want to have access to the files, the type of * access you want users to have, and the storage class that you want * to assign to the files.</p> * <p> * If you specify values for <code>ContentConfig</code>, you must * also specify values for <code>ThumbnailConfig</code>. * </p> * <p> * If you specify values for <code>ContentConfig</code> and * <code>ThumbnailConfig</code>, omit the <code>OutputBucket</code> * object. * </p> * <ul> * <li><b>Bucket</b>: The Amazon S3 bucket in which you want Elastic * Transcoder to save transcoded files and playlists.</li> * <li><b>Permissions</b> (Optional): The Permissions object * specifies which users you want to have access to transcoded files * and the type of access you want them to have. You can grant * permissions to a maximum of 30 users and/or predefined Amazon S3 * groups.</li> * <li><b>Grantee Type</b>: Specify the type of value that appears in * the <code>Grantee</code> object: * <ul> * <li><b>Canonical</b>: The value in the <code>Grantee</code> object * is either the canonical user ID for an AWS account or an origin * access identity for an Amazon CloudFront distribution. For more * information about canonical user IDs, see Access Control List * (ACL) Overview in the Amazon Simple Storage Service Developer * Guide. For more information about using CloudFront origin access * identities to require that users use CloudFront URLs instead of * Amazon S3 URLs, see Using an Origin Access Identity to Restrict * Access to Your Amazon S3 Content. <important>A canonical user ID * is not the same as an AWS account number.</important></li> * <li><b>Email</b>: The value in the <code>Grantee</code> object is * the registered email address of an AWS account.</li> * <li><b>Group</b>: The value in the <code>Grantee</code> object is * one of the following predefined Amazon S3 groups: * <code>AllUsers</code>, <code>AuthenticatedUsers</code>, or * <code>LogDelivery</code>.</li> * </ul> * </li> * <li><b>Grantee</b>: The AWS user or group that you want to have * access to transcoded files and playlists. To identify the user or * group, you can specify the canonical user ID for an AWS account, * an origin access identity for a CloudFront distribution, the * registered email address of an AWS account, or a predefined Amazon * S3 group</li> * <li><b>Access</b>: The permission that you want to give to the AWS * user that you specified in <code>Grantee</code>. Permissions are * granted on the files that Elastic Transcoder adds to the bucket, * including playlists and video files. Valid values include: * <ul> * <li><code>READ</code>: The grantee can read the objects and * metadata for objects that Elastic Transcoder adds to the Amazon S3 * bucket.</li> * <li><code>READ_ACP</code>: The grantee can read the object ACL for * objects that Elastic Transcoder adds to the Amazon S3 bucket.</li> * <li><code>WRITE_ACP</code>: The grantee can write the ACL for the * objects that Elastic Transcoder adds to the Amazon S3 bucket.</li> * <li><code>FULL_CONTROL</code>: The grantee has <code>READ</code>, * <code>READ_ACP</code>, and <code>WRITE_ACP</code> permissions for * the objects that Elastic Transcoder adds to the Amazon S3 bucket.</li> * </ul> * </li> * <li><b>StorageClass</b>: The Amazon S3 storage class, * <code>Standard</code> or <code>ReducedRedundancy</code>, that you * want Elastic Transcoder to assign to the video files and playlists * that it stores in your Amazon S3 bucket.</li> */ public void setContentConfig(PipelineOutputConfig contentConfig) { this.contentConfig = contentConfig; } /** * <p> * The optional <code>ContentConfig</code> object specifies information * about the Amazon S3 bucket in which you want Elastic Transcoder to save * transcoded files and playlists: which bucket to use, which users you want * to have access to the files, the type of access you want users to have, * and the storage class that you want to assign to the files. * </p> * <p> * If you specify values for <code>ContentConfig</code>, you must also * specify values for <code>ThumbnailConfig</code>. * </p> * <p> * If you specify values for <code>ContentConfig</code> and * <code>ThumbnailConfig</code>, omit the <code>OutputBucket</code> object. * </p> * <ul> * <li><b>Bucket</b>: The Amazon S3 bucket in which you want Elastic * Transcoder to save transcoded files and playlists.</li> * <li><b>Permissions</b> (Optional): The Permissions object specifies which * users you want to have access to transcoded files and the type of access * you want them to have. You can grant permissions to a maximum of 30 users * and/or predefined Amazon S3 groups.</li> * <li><b>Grantee Type</b>: Specify the type of value that appears in the * <code>Grantee</code> object: * <ul> * <li><b>Canonical</b>: The value in the <code>Grantee</code> object is * either the canonical user ID for an AWS account or an origin access * identity for an Amazon CloudFront distribution. For more information * about canonical user IDs, see Access Control List (ACL) Overview in the * Amazon Simple Storage Service Developer Guide. For more information about * using CloudFront origin access identities to require that users use * CloudFront URLs instead of Amazon S3 URLs, see Using an Origin Access * Identity to Restrict Access to Your Amazon S3 Content. <important>A * canonical user ID is not the same as an AWS account number.</important></li> * <li><b>Email</b>: The value in the <code>Grantee</code> object is the * registered email address of an AWS account.</li> * <li><b>Group</b>: The value in the <code>Grantee</code> object is one of * the following predefined Amazon S3 groups: <code>AllUsers</code>, * <code>AuthenticatedUsers</code>, or <code>LogDelivery</code>.</li> * </ul> * </li> * <li><b>Grantee</b>: The AWS user or group that you want to have access to * transcoded files and playlists. To identify the user or group, you can * specify the canonical user ID for an AWS account, an origin access * identity for a CloudFront distribution, the registered email address of * an AWS account, or a predefined Amazon S3 group</li> * <li><b>Access</b>: The permission that you want to give to the AWS user * that you specified in <code>Grantee</code>. Permissions are granted on * the files that Elastic Transcoder adds to the bucket, including playlists * and video files. Valid values include: * <ul> * <li><code>READ</code>: The grantee can read the objects and metadata for * objects that Elastic Transcoder adds to the Amazon S3 bucket.</li> * <li><code>READ_ACP</code>: The grantee can read the object ACL for * objects that Elastic Transcoder adds to the Amazon S3 bucket.</li> * <li><code>WRITE_ACP</code>: The grantee can write the ACL for the objects * that Elastic Transcoder adds to the Amazon S3 bucket.</li> * <li><code>FULL_CONTROL</code>: The grantee has <code>READ</code>, * <code>READ_ACP</code>, and <code>WRITE_ACP</code> permissions for the * objects that Elastic Transcoder adds to the Amazon S3 bucket.</li> * </ul> * </li> * <li><b>StorageClass</b>: The Amazon S3 storage class, * <code>Standard</code> or <code>ReducedRedundancy</code>, that you want * Elastic Transcoder to assign to the video files and playlists that it * stores in your Amazon S3 bucket.</li> * </ul> * * @return The optional <code>ContentConfig</code> object specifies * information about the Amazon S3 bucket in which you want Elastic * Transcoder to save transcoded files and playlists: which bucket * to use, which users you want to have access to the files, the * type of access you want users to have, and the storage class that * you want to assign to the files.</p> * <p> * If you specify values for <code>ContentConfig</code>, you must * also specify values for <code>ThumbnailConfig</code>. * </p> * <p> * If you specify values for <code>ContentConfig</code> and * <code>ThumbnailConfig</code>, omit the <code>OutputBucket</code> * object. * </p> * <ul> * <li><b>Bucket</b>: The Amazon S3 bucket in which you want Elastic * Transcoder to save transcoded files and playlists.</li> * <li><b>Permissions</b> (Optional): The Permissions object * specifies which users you want to have access to transcoded files * and the type of access you want them to have. You can grant * permissions to a maximum of 30 users and/or predefined Amazon S3 * groups.</li> * <li><b>Grantee Type</b>: Specify the type of value that appears * in the <code>Grantee</code> object: * <ul> * <li><b>Canonical</b>: The value in the <code>Grantee</code> * object is either the canonical user ID for an AWS account or an * origin access identity for an Amazon CloudFront distribution. For * more information about canonical user IDs, see Access Control * List (ACL) Overview in the Amazon Simple Storage Service * Developer Guide. For more information about using CloudFront * origin access identities to require that users use CloudFront * URLs instead of Amazon S3 URLs, see Using an Origin Access * Identity to Restrict Access to Your Amazon S3 Content. * <important>A canonical user ID is not the same as an AWS account * number.</important></li> * <li><b>Email</b>: The value in the <code>Grantee</code> object is * the registered email address of an AWS account.</li> * <li><b>Group</b>: The value in the <code>Grantee</code> object is * one of the following predefined Amazon S3 groups: * <code>AllUsers</code>, <code>AuthenticatedUsers</code>, or * <code>LogDelivery</code>.</li> * </ul> * </li> * <li><b>Grantee</b>: The AWS user or group that you want to have * access to transcoded files and playlists. To identify the user or * group, you can specify the canonical user ID for an AWS account, * an origin access identity for a CloudFront distribution, the * registered email address of an AWS account, or a predefined * Amazon S3 group</li> * <li><b>Access</b>: The permission that you want to give to the * AWS user that you specified in <code>Grantee</code>. Permissions * are granted on the files that Elastic Transcoder adds to the * bucket, including playlists and video files. Valid values * include: * <ul> * <li><code>READ</code>: The grantee can read the objects and * metadata for objects that Elastic Transcoder adds to the Amazon * S3 bucket.</li> * <li><code>READ_ACP</code>: The grantee can read the object ACL * for objects that Elastic Transcoder adds to the Amazon S3 bucket. * </li> * <li><code>WRITE_ACP</code>: The grantee can write the ACL for the * objects that Elastic Transcoder adds to the Amazon S3 bucket.</li> * <li><code>FULL_CONTROL</code>: The grantee has <code>READ</code>, * <code>READ_ACP</code>, and <code>WRITE_ACP</code> permissions for * the objects that Elastic Transcoder adds to the Amazon S3 bucket. * </li> * </ul> * </li> * <li><b>StorageClass</b>: The Amazon S3 storage class, * <code>Standard</code> or <code>ReducedRedundancy</code>, that you * want Elastic Transcoder to assign to the video files and * playlists that it stores in your Amazon S3 bucket.</li> */ public PipelineOutputConfig getContentConfig() { return this.contentConfig; } /** * <p> * The optional <code>ContentConfig</code> object specifies information * about the Amazon S3 bucket in which you want Elastic Transcoder to save * transcoded files and playlists: which bucket to use, which users you want * to have access to the files, the type of access you want users to have, * and the storage class that you want to assign to the files. * </p> * <p> * If you specify values for <code>ContentConfig</code>, you must also * specify values for <code>ThumbnailConfig</code>. * </p> * <p> * If you specify values for <code>ContentConfig</code> and * <code>ThumbnailConfig</code>, omit the <code>OutputBucket</code> object. * </p> * <ul> * <li><b>Bucket</b>: The Amazon S3 bucket in which you want Elastic * Transcoder to save transcoded files and playlists.</li> * <li><b>Permissions</b> (Optional): The Permissions object specifies which * users you want to have access to transcoded files and the type of access * you want them to have. You can grant permissions to a maximum of 30 users * and/or predefined Amazon S3 groups.</li> * <li><b>Grantee Type</b>: Specify the type of value that appears in the * <code>Grantee</code> object: * <ul> * <li><b>Canonical</b>: The value in the <code>Grantee</code> object is * either the canonical user ID for an AWS account or an origin access * identity for an Amazon CloudFront distribution. For more information * about canonical user IDs, see Access Control List (ACL) Overview in the * Amazon Simple Storage Service Developer Guide. For more information about * using CloudFront origin access identities to require that users use * CloudFront URLs instead of Amazon S3 URLs, see Using an Origin Access * Identity to Restrict Access to Your Amazon S3 Content. <important>A * canonical user ID is not the same as an AWS account number.</important></li> * <li><b>Email</b>: The value in the <code>Grantee</code> object is the * registered email address of an AWS account.</li> * <li><b>Group</b>: The value in the <code>Grantee</code> object is one of * the following predefined Amazon S3 groups: <code>AllUsers</code>, * <code>AuthenticatedUsers</code>, or <code>LogDelivery</code>.</li> * </ul> * </li> * <li><b>Grantee</b>: The AWS user or group that you want to have access to * transcoded files and playlists. To identify the user or group, you can * specify the canonical user ID for an AWS account, an origin access * identity for a CloudFront distribution, the registered email address of * an AWS account, or a predefined Amazon S3 group</li> * <li><b>Access</b>: The permission that you want to give to the AWS user * that you specified in <code>Grantee</code>. Permissions are granted on * the files that Elastic Transcoder adds to the bucket, including playlists * and video files. Valid values include: * <ul> * <li><code>READ</code>: The grantee can read the objects and metadata for * objects that Elastic Transcoder adds to the Amazon S3 bucket.</li> * <li><code>READ_ACP</code>: The grantee can read the object ACL for * objects that Elastic Transcoder adds to the Amazon S3 bucket.</li> * <li><code>WRITE_ACP</code>: The grantee can write the ACL for the objects * that Elastic Transcoder adds to the Amazon S3 bucket.</li> * <li><code>FULL_CONTROL</code>: The grantee has <code>READ</code>, * <code>READ_ACP</code>, and <code>WRITE_ACP</code> permissions for the * objects that Elastic Transcoder adds to the Amazon S3 bucket.</li> * </ul> * </li> * <li><b>StorageClass</b>: The Amazon S3 storage class, * <code>Standard</code> or <code>ReducedRedundancy</code>, that you want * Elastic Transcoder to assign to the video files and playlists that it * stores in your Amazon S3 bucket.</li> * </ul> * * @param contentConfig * The optional <code>ContentConfig</code> object specifies * information about the Amazon S3 bucket in which you want Elastic * Transcoder to save transcoded files and playlists: which bucket to * use, which users you want to have access to the files, the type of * access you want users to have, and the storage class that you want * to assign to the files.</p> * <p> * If you specify values for <code>ContentConfig</code>, you must * also specify values for <code>ThumbnailConfig</code>. * </p> * <p> * If you specify values for <code>ContentConfig</code> and * <code>ThumbnailConfig</code>, omit the <code>OutputBucket</code> * object. * </p> * <ul> * <li><b>Bucket</b>: The Amazon S3 bucket in which you want Elastic * Transcoder to save transcoded files and playlists.</li> * <li><b>Permissions</b> (Optional): The Permissions object * specifies which users you want to have access to transcoded files * and the type of access you want them to have. You can grant * permissions to a maximum of 30 users and/or predefined Amazon S3 * groups.</li> * <li><b>Grantee Type</b>: Specify the type of value that appears in * the <code>Grantee</code> object: * <ul> * <li><b>Canonical</b>: The value in the <code>Grantee</code> object * is either the canonical user ID for an AWS account or an origin * access identity for an Amazon CloudFront distribution. For more * information about canonical user IDs, see Access Control List * (ACL) Overview in the Amazon Simple Storage Service Developer * Guide. For more information about using CloudFront origin access * identities to require that users use CloudFront URLs instead of * Amazon S3 URLs, see Using an Origin Access Identity to Restrict * Access to Your Amazon S3 Content. <important>A canonical user ID * is not the same as an AWS account number.</important></li> * <li><b>Email</b>: The value in the <code>Grantee</code> object is * the registered email address of an AWS account.</li> * <li><b>Group</b>: The value in the <code>Grantee</code> object is * one of the following predefined Amazon S3 groups: * <code>AllUsers</code>, <code>AuthenticatedUsers</code>, or * <code>LogDelivery</code>.</li> * </ul> * </li> * <li><b>Grantee</b>: The AWS user or group that you want to have * access to transcoded files and playlists. To identify the user or * group, you can specify the canonical user ID for an AWS account, * an origin access identity for a CloudFront distribution, the * registered email address of an AWS account, or a predefined Amazon * S3 group</li> * <li><b>Access</b>: The permission that you want to give to the AWS * user that you specified in <code>Grantee</code>. Permissions are * granted on the files that Elastic Transcoder adds to the bucket, * including playlists and video files. Valid values include: * <ul> * <li><code>READ</code>: The grantee can read the objects and * metadata for objects that Elastic Transcoder adds to the Amazon S3 * bucket.</li> * <li><code>READ_ACP</code>: The grantee can read the object ACL for * objects that Elastic Transcoder adds to the Amazon S3 bucket.</li> * <li><code>WRITE_ACP</code>: The grantee can write the ACL for the * objects that Elastic Transcoder adds to the Amazon S3 bucket.</li> * <li><code>FULL_CONTROL</code>: The grantee has <code>READ</code>, * <code>READ_ACP</code>, and <code>WRITE_ACP</code> permissions for * the objects that Elastic Transcoder adds to the Amazon S3 bucket.</li> * </ul> * </li> * <li><b>StorageClass</b>: The Amazon S3 storage class, * <code>Standard</code> or <code>ReducedRedundancy</code>, that you * want Elastic Transcoder to assign to the video files and playlists * that it stores in your Amazon S3 bucket.</li> * @return Returns a reference to this object so that method calls can be * chained together. */ public UpdatePipelineRequest withContentConfig( PipelineOutputConfig contentConfig) { setContentConfig(contentConfig); return this; } /** * <p> * The <code>ThumbnailConfig</code> object specifies several values, * including the Amazon S3 bucket in which you want Elastic Transcoder to * save thumbnail files, which users you want to have access to the files, * the type of access you want users to have, and the storage class that you * want to assign to the files. * </p> * <p> * If you specify values for <code>ContentConfig</code>, you must also * specify values for <code>ThumbnailConfig</code> even if you don't want to * create thumbnails. * </p> * <p> * If you specify values for <code>ContentConfig</code> and * <code>ThumbnailConfig</code>, omit the <code>OutputBucket</code> object. * </p> * <ul> * <li><b>Bucket</b>: The Amazon S3 bucket in which you want Elastic * Transcoder to save thumbnail files.</li> * <li><b>Permissions</b> (Optional): The <code>Permissions</code> object * specifies which users and/or predefined Amazon S3 groups you want to have * access to thumbnail files, and the type of access you want them to have. * You can grant permissions to a maximum of 30 users and/or predefined * Amazon S3 groups.</li> * <li><b>GranteeType</b>: Specify the type of value that appears in the * Grantee object: * <ul> * <li><b>Canonical</b>: The value in the <code>Grantee</code> object is * either the canonical user ID for an AWS account or an origin access * identity for an Amazon CloudFront distribution. <important>A canonical * user ID is not the same as an AWS account number.</important></li> * <li><b>Email</b>: The value in the <code>Grantee</code> object is the * registered email address of an AWS account.</li> * <li><b>Group</b>: The value in the <code>Grantee</code> object is one of * the following predefined Amazon S3 groups: <code>AllUsers</code>, * <code>AuthenticatedUsers</code>, or <code>LogDelivery</code>.</li> * </ul> * </li> * <li><b>Grantee</b>: The AWS user or group that you want to have access to * thumbnail files. To identify the user or group, you can specify the * canonical user ID for an AWS account, an origin access identity for a * CloudFront distribution, the registered email address of an AWS account, * or a predefined Amazon S3 group.</li> * <li><b>Access</b>: The permission that you want to give to the AWS user * that you specified in <code>Grantee</code>. Permissions are granted on * the thumbnail files that Elastic Transcoder adds to the bucket. Valid * values include: * <ul> * <li><code>READ</code>: The grantee can read the thumbnails and metadata * for objects that Elastic Transcoder adds to the Amazon S3 bucket.</li> * <li><code>READ_ACP</code>: The grantee can read the object ACL for * thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.</li> * <li><code>WRITE_ACP</code>: The grantee can write the ACL for the * thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.</li> * <li><code>FULL_CONTROL</code>: The grantee has <code>READ</code>, * <code>READ_ACP</code>, and <code>WRITE_ACP</code> permissions for the * thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.</li> * </ul> * </li> * <li><b>StorageClass</b>: The Amazon S3 storage class, * <code>Standard</code> or <code>ReducedRedundancy</code>, that you want * Elastic Transcoder to assign to the thumbnails that it stores in your * Amazon S3 bucket.</li> * </ul> * * @param thumbnailConfig * The <code>ThumbnailConfig</code> object specifies several values, * including the Amazon S3 bucket in which you want Elastic * Transcoder to save thumbnail files, which users you want to have * access to the files, the type of access you want users to have, * and the storage class that you want to assign to the files.</p> * <p> * If you specify values for <code>ContentConfig</code>, you must * also specify values for <code>ThumbnailConfig</code> even if you * don't want to create thumbnails. * </p> * <p> * If you specify values for <code>ContentConfig</code> and * <code>ThumbnailConfig</code>, omit the <code>OutputBucket</code> * object. * </p> * <ul> * <li><b>Bucket</b>: The Amazon S3 bucket in which you want Elastic * Transcoder to save thumbnail files.</li> * <li><b>Permissions</b> (Optional): The <code>Permissions</code> * object specifies which users and/or predefined Amazon S3 groups * you want to have access to thumbnail files, and the type of access * you want them to have. You can grant permissions to a maximum of * 30 users and/or predefined Amazon S3 groups.</li> * <li><b>GranteeType</b>: Specify the type of value that appears in * the Grantee object: * <ul> * <li><b>Canonical</b>: The value in the <code>Grantee</code> object * is either the canonical user ID for an AWS account or an origin * access identity for an Amazon CloudFront distribution. * <important>A canonical user ID is not the same as an AWS account * number.</important></li> * <li><b>Email</b>: The value in the <code>Grantee</code> object is * the registered email address of an AWS account.</li> * <li><b>Group</b>: The value in the <code>Grantee</code> object is * one of the following predefined Amazon S3 groups: * <code>AllUsers</code>, <code>AuthenticatedUsers</code>, or * <code>LogDelivery</code>.</li> * </ul> * </li> * <li><b>Grantee</b>: The AWS user or group that you want to have * access to thumbnail files. To identify the user or group, you can * specify the canonical user ID for an AWS account, an origin access * identity for a CloudFront distribution, the registered email * address of an AWS account, or a predefined Amazon S3 group.</li> * <li><b>Access</b>: The permission that you want to give to the AWS * user that you specified in <code>Grantee</code>. Permissions are * granted on the thumbnail files that Elastic Transcoder adds to the * bucket. Valid values include: * <ul> * <li><code>READ</code>: The grantee can read the thumbnails and * metadata for objects that Elastic Transcoder adds to the Amazon S3 * bucket.</li> * <li><code>READ_ACP</code>: The grantee can read the object ACL for * thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.</li> * <li><code>WRITE_ACP</code>: The grantee can write the ACL for the * thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.</li> * <li><code>FULL_CONTROL</code>: The grantee has <code>READ</code>, * <code>READ_ACP</code>, and <code>WRITE_ACP</code> permissions for * the thumbnails that Elastic Transcoder adds to the Amazon S3 * bucket.</li> * </ul> * </li> * <li><b>StorageClass</b>: The Amazon S3 storage class, * <code>Standard</code> or <code>ReducedRedundancy</code>, that you * want Elastic Transcoder to assign to the thumbnails that it stores * in your Amazon S3 bucket.</li> */ public void setThumbnailConfig(PipelineOutputConfig thumbnailConfig) { this.thumbnailConfig = thumbnailConfig; } /** * <p> * The <code>ThumbnailConfig</code> object specifies several values, * including the Amazon S3 bucket in which you want Elastic Transcoder to * save thumbnail files, which users you want to have access to the files, * the type of access you want users to have, and the storage class that you * want to assign to the files. * </p> * <p> * If you specify values for <code>ContentConfig</code>, you must also * specify values for <code>ThumbnailConfig</code> even if you don't want to * create thumbnails. * </p> * <p> * If you specify values for <code>ContentConfig</code> and * <code>ThumbnailConfig</code>, omit the <code>OutputBucket</code> object. * </p> * <ul> * <li><b>Bucket</b>: The Amazon S3 bucket in which you want Elastic * Transcoder to save thumbnail files.</li> * <li><b>Permissions</b> (Optional): The <code>Permissions</code> object * specifies which users and/or predefined Amazon S3 groups you want to have * access to thumbnail files, and the type of access you want them to have. * You can grant permissions to a maximum of 30 users and/or predefined * Amazon S3 groups.</li> * <li><b>GranteeType</b>: Specify the type of value that appears in the * Grantee object: * <ul> * <li><b>Canonical</b>: The value in the <code>Grantee</code> object is * either the canonical user ID for an AWS account or an origin access * identity for an Amazon CloudFront distribution. <important>A canonical * user ID is not the same as an AWS account number.</important></li> * <li><b>Email</b>: The value in the <code>Grantee</code> object is the * registered email address of an AWS account.</li> * <li><b>Group</b>: The value in the <code>Grantee</code> object is one of * the following predefined Amazon S3 groups: <code>AllUsers</code>, * <code>AuthenticatedUsers</code>, or <code>LogDelivery</code>.</li> * </ul> * </li> * <li><b>Grantee</b>: The AWS user or group that you want to have access to * thumbnail files. To identify the user or group, you can specify the * canonical user ID for an AWS account, an origin access identity for a * CloudFront distribution, the registered email address of an AWS account, * or a predefined Amazon S3 group.</li> * <li><b>Access</b>: The permission that you want to give to the AWS user * that you specified in <code>Grantee</code>. Permissions are granted on * the thumbnail files that Elastic Transcoder adds to the bucket. Valid * values include: * <ul> * <li><code>READ</code>: The grantee can read the thumbnails and metadata * for objects that Elastic Transcoder adds to the Amazon S3 bucket.</li> * <li><code>READ_ACP</code>: The grantee can read the object ACL for * thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.</li> * <li><code>WRITE_ACP</code>: The grantee can write the ACL for the * thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.</li> * <li><code>FULL_CONTROL</code>: The grantee has <code>READ</code>, * <code>READ_ACP</code>, and <code>WRITE_ACP</code> permissions for the * thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.</li> * </ul> * </li> * <li><b>StorageClass</b>: The Amazon S3 storage class, * <code>Standard</code> or <code>ReducedRedundancy</code>, that you want * Elastic Transcoder to assign to the thumbnails that it stores in your * Amazon S3 bucket.</li> * </ul> * * @return The <code>ThumbnailConfig</code> object specifies several values, * including the Amazon S3 bucket in which you want Elastic * Transcoder to save thumbnail files, which users you want to have * access to the files, the type of access you want users to have, * and the storage class that you want to assign to the files.</p> * <p> * If you specify values for <code>ContentConfig</code>, you must * also specify values for <code>ThumbnailConfig</code> even if you * don't want to create thumbnails. * </p> * <p> * If you specify values for <code>ContentConfig</code> and * <code>ThumbnailConfig</code>, omit the <code>OutputBucket</code> * object. * </p> * <ul> * <li><b>Bucket</b>: The Amazon S3 bucket in which you want Elastic * Transcoder to save thumbnail files.</li> * <li><b>Permissions</b> (Optional): The <code>Permissions</code> * object specifies which users and/or predefined Amazon S3 groups * you want to have access to thumbnail files, and the type of * access you want them to have. You can grant permissions to a * maximum of 30 users and/or predefined Amazon S3 groups.</li> * <li><b>GranteeType</b>: Specify the type of value that appears in * the Grantee object: * <ul> * <li><b>Canonical</b>: The value in the <code>Grantee</code> * object is either the canonical user ID for an AWS account or an * origin access identity for an Amazon CloudFront distribution. * <important>A canonical user ID is not the same as an AWS account * number.</important></li> * <li><b>Email</b>: The value in the <code>Grantee</code> object is * the registered email address of an AWS account.</li> * <li><b>Group</b>: The value in the <code>Grantee</code> object is * one of the following predefined Amazon S3 groups: * <code>AllUsers</code>, <code>AuthenticatedUsers</code>, or * <code>LogDelivery</code>.</li> * </ul> * </li> * <li><b>Grantee</b>: The AWS user or group that you want to have * access to thumbnail files. To identify the user or group, you can * specify the canonical user ID for an AWS account, an origin * access identity for a CloudFront distribution, the registered * email address of an AWS account, or a predefined Amazon S3 group. * </li> * <li><b>Access</b>: The permission that you want to give to the * AWS user that you specified in <code>Grantee</code>. Permissions * are granted on the thumbnail files that Elastic Transcoder adds * to the bucket. Valid values include: * <ul> * <li><code>READ</code>: The grantee can read the thumbnails and * metadata for objects that Elastic Transcoder adds to the Amazon * S3 bucket.</li> * <li><code>READ_ACP</code>: The grantee can read the object ACL * for thumbnails that Elastic Transcoder adds to the Amazon S3 * bucket.</li> * <li><code>WRITE_ACP</code>: The grantee can write the ACL for the * thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.</li> * <li><code>FULL_CONTROL</code>: The grantee has <code>READ</code>, * <code>READ_ACP</code>, and <code>WRITE_ACP</code> permissions for * the thumbnails that Elastic Transcoder adds to the Amazon S3 * bucket.</li> * </ul> * </li> * <li><b>StorageClass</b>: The Amazon S3 storage class, * <code>Standard</code> or <code>ReducedRedundancy</code>, that you * want Elastic Transcoder to assign to the thumbnails that it * stores in your Amazon S3 bucket.</li> */ public PipelineOutputConfig getThumbnailConfig() { return this.thumbnailConfig; } /** * <p> * The <code>ThumbnailConfig</code> object specifies several values, * including the Amazon S3 bucket in which you want Elastic Transcoder to * save thumbnail files, which users you want to have access to the files, * the type of access you want users to have, and the storage class that you * want to assign to the files. * </p> * <p> * If you specify values for <code>ContentConfig</code>, you must also * specify values for <code>ThumbnailConfig</code> even if you don't want to * create thumbnails. * </p> * <p> * If you specify values for <code>ContentConfig</code> and * <code>ThumbnailConfig</code>, omit the <code>OutputBucket</code> object. * </p> * <ul> * <li><b>Bucket</b>: The Amazon S3 bucket in which you want Elastic * Transcoder to save thumbnail files.</li> * <li><b>Permissions</b> (Optional): The <code>Permissions</code> object * specifies which users and/or predefined Amazon S3 groups you want to have * access to thumbnail files, and the type of access you want them to have. * You can grant permissions to a maximum of 30 users and/or predefined * Amazon S3 groups.</li> * <li><b>GranteeType</b>: Specify the type of value that appears in the * Grantee object: * <ul> * <li><b>Canonical</b>: The value in the <code>Grantee</code> object is * either the canonical user ID for an AWS account or an origin access * identity for an Amazon CloudFront distribution. <important>A canonical * user ID is not the same as an AWS account number.</important></li> * <li><b>Email</b>: The value in the <code>Grantee</code> object is the * registered email address of an AWS account.</li> * <li><b>Group</b>: The value in the <code>Grantee</code> object is one of * the following predefined Amazon S3 groups: <code>AllUsers</code>, * <code>AuthenticatedUsers</code>, or <code>LogDelivery</code>.</li> * </ul> * </li> * <li><b>Grantee</b>: The AWS user or group that you want to have access to * thumbnail files. To identify the user or group, you can specify the * canonical user ID for an AWS account, an origin access identity for a * CloudFront distribution, the registered email address of an AWS account, * or a predefined Amazon S3 group.</li> * <li><b>Access</b>: The permission that you want to give to the AWS user * that you specified in <code>Grantee</code>. Permissions are granted on * the thumbnail files that Elastic Transcoder adds to the bucket. Valid * values include: * <ul> * <li><code>READ</code>: The grantee can read the thumbnails and metadata * for objects that Elastic Transcoder adds to the Amazon S3 bucket.</li> * <li><code>READ_ACP</code>: The grantee can read the object ACL for * thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.</li> * <li><code>WRITE_ACP</code>: The grantee can write the ACL for the * thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.</li> * <li><code>FULL_CONTROL</code>: The grantee has <code>READ</code>, * <code>READ_ACP</code>, and <code>WRITE_ACP</code> permissions for the * thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.</li> * </ul> * </li> * <li><b>StorageClass</b>: The Amazon S3 storage class, * <code>Standard</code> or <code>ReducedRedundancy</code>, that you want * Elastic Transcoder to assign to the thumbnails that it stores in your * Amazon S3 bucket.</li> * </ul> * * @param thumbnailConfig * The <code>ThumbnailConfig</code> object specifies several values, * including the Amazon S3 bucket in which you want Elastic * Transcoder to save thumbnail files, which users you want to have * access to the files, the type of access you want users to have, * and the storage class that you want to assign to the files.</p> * <p> * If you specify values for <code>ContentConfig</code>, you must * also specify values for <code>ThumbnailConfig</code> even if you * don't want to create thumbnails. * </p> * <p> * If you specify values for <code>ContentConfig</code> and * <code>ThumbnailConfig</code>, omit the <code>OutputBucket</code> * object. * </p> * <ul> * <li><b>Bucket</b>: The Amazon S3 bucket in which you want Elastic * Transcoder to save thumbnail files.</li> * <li><b>Permissions</b> (Optional): The <code>Permissions</code> * object specifies which users and/or predefined Amazon S3 groups * you want to have access to thumbnail files, and the type of access * you want them to have. You can grant permissions to a maximum of * 30 users and/or predefined Amazon S3 groups.</li> * <li><b>GranteeType</b>: Specify the type of value that appears in * the Grantee object: * <ul> * <li><b>Canonical</b>: The value in the <code>Grantee</code> object * is either the canonical user ID for an AWS account or an origin * access identity for an Amazon CloudFront distribution. * <important>A canonical user ID is not the same as an AWS account * number.</important></li> * <li><b>Email</b>: The value in the <code>Grantee</code> object is * the registered email address of an AWS account.</li> * <li><b>Group</b>: The value in the <code>Grantee</code> object is * one of the following predefined Amazon S3 groups: * <code>AllUsers</code>, <code>AuthenticatedUsers</code>, or * <code>LogDelivery</code>.</li> * </ul> * </li> * <li><b>Grantee</b>: The AWS user or group that you want to have * access to thumbnail files. To identify the user or group, you can * specify the canonical user ID for an AWS account, an origin access * identity for a CloudFront distribution, the registered email * address of an AWS account, or a predefined Amazon S3 group.</li> * <li><b>Access</b>: The permission that you want to give to the AWS * user that you specified in <code>Grantee</code>. Permissions are * granted on the thumbnail files that Elastic Transcoder adds to the * bucket. Valid values include: * <ul> * <li><code>READ</code>: The grantee can read the thumbnails and * metadata for objects that Elastic Transcoder adds to the Amazon S3 * bucket.</li> * <li><code>READ_ACP</code>: The grantee can read the object ACL for * thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.</li> * <li><code>WRITE_ACP</code>: The grantee can write the ACL for the * thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.</li> * <li><code>FULL_CONTROL</code>: The grantee has <code>READ</code>, * <code>READ_ACP</code>, and <code>WRITE_ACP</code> permissions for * the thumbnails that Elastic Transcoder adds to the Amazon S3 * bucket.</li> * </ul> * </li> * <li><b>StorageClass</b>: The Amazon S3 storage class, * <code>Standard</code> or <code>ReducedRedundancy</code>, that you * want Elastic Transcoder to assign to the thumbnails that it stores * in your Amazon S3 bucket.</li> * @return Returns a reference to this object so that method calls can be * chained together. */ public UpdatePipelineRequest withThumbnailConfig( PipelineOutputConfig thumbnailConfig) { setThumbnailConfig(thumbnailConfig); return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getId() != null) sb.append("Id: " + getId() + ","); if (getName() != null) sb.append("Name: " + getName() + ","); if (getInputBucket() != null) sb.append("InputBucket: " + getInputBucket() + ","); if (getRole() != null) sb.append("Role: " + getRole() + ","); if (getAwsKmsKeyArn() != null) sb.append("AwsKmsKeyArn: " + getAwsKmsKeyArn() + ","); if (getNotifications() != null) sb.append("Notifications: " + getNotifications() + ","); if (getContentConfig() != null) sb.append("ContentConfig: " + getContentConfig() + ","); if (getThumbnailConfig() != null) sb.append("ThumbnailConfig: " + getThumbnailConfig()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof UpdatePipelineRequest == false) return false; UpdatePipelineRequest other = (UpdatePipelineRequest) obj; if (other.getId() == null ^ this.getId() == null) return false; if (other.getId() != null && other.getId().equals(this.getId()) == false) return false; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getInputBucket() == null ^ this.getInputBucket() == null) return false; if (other.getInputBucket() != null && other.getInputBucket().equals(this.getInputBucket()) == false) return false; if (other.getRole() == null ^ this.getRole() == null) return false; if (other.getRole() != null && other.getRole().equals(this.getRole()) == false) return false; if (other.getAwsKmsKeyArn() == null ^ this.getAwsKmsKeyArn() == null) return false; if (other.getAwsKmsKeyArn() != null && other.getAwsKmsKeyArn().equals(this.getAwsKmsKeyArn()) == false) return false; if (other.getNotifications() == null ^ this.getNotifications() == null) return false; if (other.getNotifications() != null && other.getNotifications().equals(this.getNotifications()) == false) return false; if (other.getContentConfig() == null ^ this.getContentConfig() == null) return false; if (other.getContentConfig() != null && other.getContentConfig().equals(this.getContentConfig()) == false) return false; if (other.getThumbnailConfig() == null ^ this.getThumbnailConfig() == null) return false; if (other.getThumbnailConfig() != null && other.getThumbnailConfig().equals(this.getThumbnailConfig()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getInputBucket() == null) ? 0 : getInputBucket().hashCode()); hashCode = prime * hashCode + ((getRole() == null) ? 0 : getRole().hashCode()); hashCode = prime * hashCode + ((getAwsKmsKeyArn() == null) ? 0 : getAwsKmsKeyArn() .hashCode()); hashCode = prime * hashCode + ((getNotifications() == null) ? 0 : getNotifications() .hashCode()); hashCode = prime * hashCode + ((getContentConfig() == null) ? 0 : getContentConfig() .hashCode()); hashCode = prime * hashCode + ((getThumbnailConfig() == null) ? 0 : getThumbnailConfig() .hashCode()); return hashCode; } @Override public UpdatePipelineRequest clone() { return (UpdatePipelineRequest) super.clone(); } }
{ "content_hash": "17829034b3884bf9a6332333f0fbc841", "timestamp": "", "source": "github", "line_count": 1521, "max_line_length": 89, "avg_line_length": 49.62130177514793, "alnum_prop": 0.6181996449108302, "repo_name": "dump247/aws-sdk-java", "id": "954796331da4f32920ed06ebd60bffe4fdc4c7d1", "size": "76061", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "aws-java-sdk-elastictranscoder/src/main/java/com/amazonaws/services/elastictranscoder/model/UpdatePipelineRequest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "FreeMarker", "bytes": "117958" }, { "name": "Java", "bytes": "104374753" }, { "name": "Scilab", "bytes": "3375" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?><!-- ~ Copyright 2018 Coinbase, Inc. ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. --> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.coinbase.sample.TransactionsActivity"> <TextView android:id="@+id/accountText" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:layout_marginTop="16dp" android:layout_marginBottom="16dp" android:layout_marginLeft="30dp" android:layout_marginRight="30dp" android:hint="@string/no_accounts_loaded" android:textAppearance="?android:attr/textAppearanceLarge" /> <android.support.v4.widget.SwipeRefreshLayout android:id="@+id/swipeRefreshLayout" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignParentBottom="true" android:layout_below="@+id/accountText"> <android.support.v7.widget.RecyclerView android:id="@+id/recyclerView" android:layout_width="match_parent" android:layout_height="match_parent" /> </android.support.v4.widget.SwipeRefreshLayout> </RelativeLayout>
{ "content_hash": "90d92161b74a5e166f9ce259ac5d8a03", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 76, "avg_line_length": 39.78, "alnum_prop": 0.6928104575163399, "repo_name": "coinbase/coinbase-java", "id": "e4266659a8d979a97cdd6c7ca662400464d9cf33", "size": "1989", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/res/layout/activity_transactions.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "573586" }, { "name": "Kotlin", "bytes": "43421" }, { "name": "Shell", "bytes": "1147" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <!-- Copyright 2014-2018 Red Hat, Inc. and/or its affiliates and other contributors as indicated by the @author tags. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.hawkular.metrics</groupId> <artifactId>hawkular-metrics-parent</artifactId> <version>0.31.0-SNAPSHOT</version> <relativePath>../../pom.xml</relativePath> </parent> <artifactId>hawkular-metrics-api-util</artifactId> <name>Hawkular Metrics REST API Util</name> <description>Common dependencies used by the REST API</description> <dependencies> <dependency> <groupId>${project.groupId}</groupId> <artifactId>hawkular-metrics-core-service</artifactId> <version>${project.version}</version> </dependency> <dependency> <!-- Just to pull dropwizard metrics-core in the right version --> <groupId>com.datastax.cassandra</groupId> <artifactId>cassandra-driver-core</artifactId> </dependency> <dependency> <groupId>org.hawkular.metrics</groupId> <artifactId>hawkular-metrics-model</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>io.reactivex</groupId> <artifactId>rxjava</artifactId> </dependency> <dependency> <groupId>javax.enterprise</groupId> <artifactId>cdi-api</artifactId> </dependency> </dependencies> </project>
{ "content_hash": "4c8a50aab1e21091c4774ebdcf01bc8a", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 108, "avg_line_length": 35.725806451612904, "alnum_prop": 0.6952595936794582, "repo_name": "burmanm/hawkular-metrics", "id": "a6eeda7483c98f5c8e30eadd58502da731b4eb16", "size": "2215", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "api/metrics-api-util/pom.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ANTLR", "bytes": "2804" }, { "name": "CSS", "bytes": "2004" }, { "name": "Groovy", "bytes": "449160" }, { "name": "HTML", "bytes": "3336" }, { "name": "Java", "bytes": "1541256" }, { "name": "JavaScript", "bytes": "1856" }, { "name": "Scala", "bytes": "3984" }, { "name": "Shell", "bytes": "7099" }, { "name": "XSLT", "bytes": "22575" } ], "symlink_target": "" }
<instance description="" template="weapon"> <group name="weapon_bag"> <group name="accuracy"> <float name="near" value="0.6" /> <float name="far" value="0.18" /> <float name="mid" value="0.3" /> </group> <group name="aim"> <group name="fire_aim_time"> <float name="max" value="0.25" /> <float name="min" value="0.25" /> </group> <float name="post_firing_aim_time" value="0.5" /> <float name="post_firing_cooldown_interval" value="0" /> <group name="ready_aim_time"> <float name="max" value="0.3" /> <float name="min" value="0.3" /> </group> <group name="aim_time_multiplier"> <float name="near" value="0.5" /> <float name="far" value="1" /> <float name="mid" value="0.75" /> </group> </group> <group name="anim_table"> <string name="cooldown_time_name" value="Pistol_CoolDownTime" /> <string name="state_name" value="Pistol_State" /> <string name="track_horizontal" value="Pistol_Angle" /> <string name="track_horizontal_speed" value="" /> <string name="track_vertical" value="Pistol_Tilt" /> <string name="track_vertical_speed" value="" /> <string name="variety_name" value="" /> <string name="visibility_name" value="Colt45_Visible" /> <string name="target_range_name" value="" /> </group> <group name="area_effect"> <group name="accuracy"> <float name="far" value="0.6" /> <float name="near" value="5" /> <float name="mid" value="2.8" /> </group> <group name="area_info"> <float name="angle_left" value="0" /> <float name="angle_right" value="0" /> <enum name="area_type" value="circle" /> <float name="radius" value="0" /> </group> <group name="damage"> <float name="far" value="0.25" /> <float name="near" value="1" /> <float name="mid" value="0.625" /> </group> <group name="damage_friendly"> <float name="far" value="0.25" /> <float name="near" value="1" /> <float name="mid" value="0.625" /> </group> <group name="distance"> <float name="far" value="0" /> <float name="near" value="0" /> <float name="mid" value="0" /> </group> <bool name="has_friendly_fire" value="False" /> <bool name="can_harm_shooter" value="False" /> <group name="suppression"> <float name="far" value="0" /> <float name="near" value="0" /> <float name="mid" value="0" /> </group> <group name="suppression_friendly"> <float name="far" value="0" /> <float name="near" value="0" /> <float name="mid" value="0" /> </group> <bool name="damage_all_in_hold" value="False" /> <template_reference name="aoe_penetration" value="tables\range_table"> <float name="far" value="1" /> <float name="mid" value="1" /> <float name="near" value="1" /> </template_reference> <group name="building_damage"> <float name="near" value="1" /> <float name="mid" value="1" /> <float name="far" value="1" /> </group> <instance_reference name="weapon_building_damage" value="weapon_building_damage\aoe_profile_no_change" /> <enum name="aoe_origin_and_direction" value="hit_position_and_direction" /> </group> <group name="behaviour"> <bool name="aa_weapon" value="False" /> <bool name="aa_weapon_shoot_through" value="False" /> <bool name="artillery_force_obey_los" value="False" /> <bool name="attack_team_weapon_user" value="False" /> <bool name="can_be_offhanded" value="False" /> <bool name="can_be_substituted" value="False" /> <float name="combat_slot_offset" value="0" /> <bool name="enable_auto_target_search" value="True" /> <bool name="fire_at_building_combat_slot" value="False" /> <float name="ground_hit_rate" value="1" /> <bool name="ignore_shot_blocking" value="False" /> <bool name="non_moving_setup" value="False" /> <bool name="point_blank" value="True" /> <bool name="prevents_prone" value="False" /> <bool name="reset_rotation_on_teardown" value="False" /> <bool name="share_parent_anim" value="False" /> <bool name="single_handed_weapon" value="False" /> <bool name="substitute_weapon" value="False" /> <bool name="support_weapon" value="False" /> <bool name="surprises_idle" value="False" /> <bool name="piercing" value="False" /> <float name="reaction_radius" value="0" /> <bool name="can_be_pilfered" value="True" /> <bool name="causes_combat" value="True" /> <bool name="can_abort_winddown" value="False" /> <enum name="reaction_type" value="normal" /> <bool name="ignore_relations" value="False" /> <template_reference name="wants_prone_firing_option" value="options\none"> </template_reference> <enum name="attack_ground_type" value="not_allowed" /> </group> <group name="burst"> <bool name="can_burst" value="False" /> <group name="duration"> <float name="max" value="0" /> <float name="min" value="0" /> </group> <group name="incremental_target_table"> <float name="accuracy_multiplier" value="1" /> <group name="search_radius"> <float name="far" value="0" /> <float name="near" value="0" /> <float name="mid" value="0" /> </group> </group> <group name="rate_of_fire"> <float name="max" value="0" /> <float name="min" value="0" /> </group> <group name="duration_multiplier"> <float name="near" value="1" /> <float name="far" value="1" /> <float name="mid" value="1" /> </group> <group name="rate_of_fire_multiplier"> <float name="near" value="1" /> <float name="far" value="1" /> <float name="mid" value="1" /> </group> <bool name="focus_fire" value="True" /> </group> <group name="cooldown"> <group name="duration"> <float name="max" value="1" /> <float name="min" value="0.5" /> </group> <group name="duration_multiplier"> <float name="near" value="0.5" /> <float name="far" value="1" /> <float name="mid" value="0.75" /> </group> </group> <group name="cover_table"> <group name="tp_defcover"> <float name="accuracy_multiplier" value="1" /> <float name="damage_multiplier" value="1" /> <float name="penetration_multiplier" value="1" /> <float name="suppression_multiplier" value="1" /> </group> <group name="tp_defcover_narrow"> <float name="accuracy_multiplier" value="1" /> <float name="damage_multiplier" value="1" /> <float name="penetration_multiplier" value="1" /> <float name="suppression_multiplier" value="1" /> </group> <group name="tp_garrison_cover"> <float name="accuracy_multiplier" value="0.55" /> <float name="damage_multiplier" value="0.5" /> <float name="penetration_multiplier" value="1" /> <float name="suppression_multiplier" value="0" /> </group> <group name="tp_garrison_halftrack"> <float name="accuracy_multiplier" value="0.5" /> <float name="damage_multiplier" value="0.5" /> <float name="penetration_multiplier" value="1" /> <float name="suppression_multiplier" value="0" /> </group> <group name="tp_heavy"> <float name="accuracy_multiplier" value="0.5" /> <float name="damage_multiplier" value="0.5" /> <float name="penetration_multiplier" value="1" /> <float name="suppression_multiplier" value="0.1" /> </group> <group name="tp_light"> <float name="accuracy_multiplier" value="0.5" /> <float name="damage_multiplier" value="1" /> <float name="penetration_multiplier" value="1" /> <float name="suppression_multiplier" value="0.5" /> </group> <group name="tp_negative"> <float name="accuracy_multiplier" value="1.25" /> <float name="damage_multiplier" value="1.25" /> <float name="penetration_multiplier" value="1" /> <float name="suppression_multiplier" value="1.5" /> </group> <group name="tp_open"> <float name="accuracy_multiplier" value="1.25" /> <float name="damage_multiplier" value="1.25" /> <float name="penetration_multiplier" value="1" /> <float name="suppression_multiplier" value="1" /> </group> <group name="tp_smoke"> <float name="accuracy_multiplier" value="0.25" /> <float name="damage_multiplier" value="1" /> <float name="penetration_multiplier" value="1" /> <float name="suppression_multiplier" value="0.05" /> </group> <group name="tp_trench"> <float name="accuracy_multiplier" value="0.4" /> <float name="damage_multiplier" value="1" /> <float name="penetration_multiplier" value="1" /> <float name="suppression_multiplier" value="0" /> </group> <group name="tp_water"> <float name="accuracy_multiplier" value="1" /> <float name="damage_multiplier" value="1.5" /> <float name="penetration_multiplier" value="1" /> <float name="suppression_multiplier" value="1" /> </group> <group name="tp_z_bunker"> <float name="accuracy_multiplier" value="0.35" /> <float name="damage_multiplier" value="0.35" /> <float name="penetration_multiplier" value="1" /> <float name="suppression_multiplier" value="0" /> </group> <group name="tp_z_emplacement"> <float name="accuracy_multiplier" value="0.5" /> <float name="damage_multiplier" value="1" /> <float name="penetration_multiplier" value="1" /> <float name="suppression_multiplier" value="0.75" /> </group> <group name="tp_z_ice"> <float name="accuracy_multiplier" value="1" /> <float name="damage_multiplier" value="1" /> <float name="penetration_multiplier" value="1" /> <float name="suppression_multiplier" value="1" /> </group> <group name="tp_z_snow"> <float name="accuracy_multiplier" value="1" /> <float name="damage_multiplier" value="1" /> <float name="penetration_multiplier" value="1" /> <float name="suppression_multiplier" value="1" /> </group> <group name="tp_zz_deep_snow"> <float name="accuracy_multiplier" value="1" /> <float name="damage_multiplier" value="1" /> <float name="penetration_multiplier" value="1" /> <float name="suppression_multiplier" value="1" /> </group> <group name="tp_zz_mud"> <float name="accuracy_multiplier" value="1" /> <float name="damage_multiplier" value="1" /> <float name="penetration_multiplier" value="1" /> <float name="suppression_multiplier" value="1" /> </group> <group name="tp_zz_team_weapon_heavy"> <float name="accuracy_multiplier" value="0.5" /> <float name="damage_multiplier" value="0.5" /> <float name="penetration_multiplier" value="1" /> <float name="suppression_multiplier" value="0.1" /> </group> </group> <group name="damage"> <float name="max" value="14" /> <float name="min" value="14" /> <list name="on_penetrated_actions"> </list> </group> <group name="damage_over_time"> <template_reference name="damage_over_time" value="dot_type\none"> </template_reference> </group> <group name="deflection"> <float name="deflection_damage_multiplier" value="0" /> <bool name="has_deflection_damage" value="False" /> <list name="on_deflected_actions"> </list> </group> <group name="fire"> <float name="wind_down" value="0" /> <float name="wind_up" value="0" /> <list name="on_fire_actions"> </list> </group> <float name="flinch_radius" value="0" /> <string name="fx_action_target_name" value="colt45_target" /> <bool name="fx_always_visible" value="False" /> <float name="fx_building_hit_delay" value="0" /> <float name="fx_delay_in_building" value="0" /> <string name="fx_munition_name" value="pistol" /> <string name="fx_tracer_name" value="colt45_tracer" /> <float name="fx_tracer_speed" value="120" /> <bool name="fx_use_building_panel_normal" value="True" /> <locstring name="help_text" value="0" /> <icon name="icon_name" value="" /> <group name="moving"> <float name="accuracy_multiplier" value="0.5" /> <float name="burst_multiplier" value="1" /> <float name="cooldown_multiplier" value="1" /> <bool name="disable_moving_firing" value="False" /> <float name="moving_end_time" value="0" /> <float name="moving_start_time" value="0" /> </group> <string name="name" value="Colt M1911 45 Pistol" /> <group name="offhand"> <float name="offhand_end_time" value="0" /> <float name="offhand_start_time" value="0" /> </group> <group name="priority"> <float name="current_target" value="8" /> <group name="distance"> <float name="far" value="-10" /> <float name="near" value="60" /> <float name="mid" value="25" /> </group> <float name="rotation" value="-0.035" /> <float name="window_bonus" value="0" /> <float name="threat" value="20" /> <float name="penetration" value="2" /> <float name="suggested_target" value="1000" /> <bool name="over_penetration_priority_penalty" value="True" /> </group> <group name="projectile"> <bool name="delete_previous_on_hit" value="False" /> <instance_reference name="projectile" value="" /> </group> <group name="range"> <float name="max" value="40" /> <float name="min" value="0" /> <group name="distance"> <float name="near" value="10" /> <float name="far" value="40" /> <float name="mid" value="25" /> </group> </group> <group name="reload"> <group name="duration"> <float name="max" value="3" /> <float name="min" value="3" /> </group> <group name="duration_multiplier"> <float name="far" value="1" /> <float name="near" value="0.5" /> <float name="mid" value="0.75" /> </group> <group name="frequency"> <float name="max" value="6" /> <float name="min" value="6" /> </group> <list name="on_reload_actions"> </list> </group> <group name="scatter"> <float name="angle_scatter" value="10" /> <bool name="burst_pattern_enable" value="False" /> <float name="delay_bracket_change_chance" value="0" /> <float name="distance_bracket_count_air" value="0" /> <float name="distance_bracket_count_ground" value="1" /> <float name="distance_scatter_max" value="15" /> <float name="distance_scatter_obj_hit_min" value="0" /> <float name="distance_scatter_offset" value="0.8" /> <float name="distance_scatter_ratio" value="0.8" /> <float name="fow_angle_multiplier" value="1" /> <float name="fow_distance_multiplier" value="1" /> <float name="max_tilt_angle" value="5" /> <float name="min_tilt_angle" value="2" /> <float name="tilt_max_distance" value="20" /> <float name="tilt_scatter_chance" value="0.5" /> </group> <group name="setup"> <float name="duration" value="0" /> <bool name="has_instant_setup" value="False" /> <bool name="can_interrupt_setup" value="False" /> <float name="attach_duration" value="0" /> </group> <group name="suppressed"> <float name="pinned_burst_multiplier" value="1" /> <float name="pinned_cooldown_multiplier" value="1" /> <float name="pinned_reload_multiplier" value="1" /> <float name="suppressed_burst_multiplier" value="1" /> <float name="suppressed_cooldown_multiplier" value="1" /> <float name="suppressed_reload_multiplier" value="1" /> </group> <group name="suppression"> <float name="nearby_suppression_multiplier" value="0" /> <float name="nearby_suppression_radius" value="0" /> <group name="target_pinned_multipliers"> <float name="accuracy_multiplier" value="0.25" /> <float name="damage_multiplier" value="1" /> <float name="penetration_multiplier" value="1" /> <float name="suppression_multiplier" value="0.1" /> </group> <group name="target_suppressed_multipliers"> <float name="accuracy_multiplier" value="0.5" /> <float name="damage_multiplier" value="1" /> <float name="penetration_multiplier" value="1" /> <float name="suppression_multiplier" value="0.5" /> </group> <float name="amount" value="0" /> </group> <group name="teardown"> <float name="duration" value="0" /> </group> <group name="tracking"> <float name="fire_cone_angle" value="5" /> <group name="normal"> <float name="max_down" value="-90" /> <float name="max_left" value="-60" /> <float name="max_right" value="60" /> <float name="max_up" value="40" /> <float name="speed_horizontal" value="360" /> <float name="speed_vertical" value="90" /> </group> <float name="pivot_end_time" value="0" /> <bool name="pivot_only" value="False" /> <float name="pivot_start_time" value="0" /> </group> <locstring name="ui_name" value="0" /> <enum name="weapon_type" value="small_arms" /> <instance_reference name="ui_range" value="" /> <instance_reference name="ui_setfacing" value="" /> <group name="penetration"> <float name="near" value="0.5" /> <float name="far" value="0.5" /> <float name="mid" value="0.5" /> </group> <group name="ui_map_colour"> <int name="red" value="0" /> <int name="green" value="0" /> <int name="blue" value="0" /> <int name="alpha" value="0" /> </group> </group> <uniqueid name="pbgid" value="340" /> </instance>
{ "content_hash": "d66782f94bc043d78f51e6d06374ced6", "timestamp": "", "source": "github", "line_count": 444, "max_line_length": 108, "avg_line_length": 38.2972972972973, "alnum_prop": 0.6197953422724065, "repo_name": "Ruhrpottpatriot/LastCrusade", "id": "9975f2a49910c11927fde46330c7e1376a5c93f3", "size": "17004", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/instances/weapon/soviet/small_arms/single_fire/pistol/weapon_crew_colt_m1911_45_pistol_mp.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "AMPL", "bytes": "5218" }, { "name": "CSS", "bytes": "2640" }, { "name": "HTML", "bytes": "117223" }, { "name": "Lua", "bytes": "87140" } ], "symlink_target": "" }
import { MongoClient } from 'mongodb'; const MONGODB_URI = process.env.MONGODB_URI; // Somewhere outside the class: // async function instantiateClientAndConnect() { const client = new CofactsMongoClient(MONGODB_URI, { useUnifiedTopology: true, }); await client.mongoClient.connect(); return client; } export default class CofactsMongoClient { /** * @type {?Promise<CofactsMongoClient>} */ static _instance = null; static async getInstance() { return (this._instance = this._instance || instantiateClientAndConnect()); } /** * Use CofactsMongoClient.getInstance(). Do not use constructor * * @param {string} uri * @param {import('mongodb').MongoClientOptions} options */ constructor(uri, options) { this.mongoClient = new MongoClient(uri, options); } get db() { return this.mongoClient.db(); } /** * * @param {string} name */ async collection(name) { return this.db.collection(name); } async close() { await this.mongoClient.close(); this._instance = null; } }
{ "content_hash": "83a288409eb5848b3f4ef28cd9081130", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 78, "avg_line_length": 20.84313725490196, "alnum_prop": 0.6594543744120414, "repo_name": "cofacts/rumors-line-bot", "id": "8ebad544f07135060c16c10c30d7236371f7fc59", "size": "1063", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/database/mongoClient.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1104" }, { "name": "Dockerfile", "bytes": "766" }, { "name": "HTML", "bytes": "10463" }, { "name": "JavaScript", "bytes": "419642" }, { "name": "Shell", "bytes": "493" }, { "name": "Svelte", "bytes": "76454" } ], "symlink_target": "" }
* **spanner/spannertest:** support JSON_VALUE function ([#5173](https://www.github.com/googleapis/google-cloud-go/issues/5173)) ([ac98735](https://www.github.com/googleapis/google-cloud-go/commit/ac98735cb1adc9384c5b2caeb9aac938db275bf7)) * **spanner/spansql:** support CAST and SAFE_CAST ([#5057](https://www.github.com/googleapis/google-cloud-go/issues/5057)) ([54cbf4c](https://www.github.com/googleapis/google-cloud-go/commit/54cbf4c0a0305e680b213f84487110dfeaf8e7e1)) * **spanner:** add ToStructLenient method to decode to struct fields with no error return with un-matched row's column with struct's exported fields. ([#5153](https://www.github.com/googleapis/google-cloud-go/issues/5153)) ([899ffbf](https://www.github.com/googleapis/google-cloud-go/commit/899ffbf8ce42b1597ca3cd59bfd9f042054b8ae2)) ## [1.27.0](https://www.github.com/googleapis/google-cloud-go/compare/spanner/v1.26.0...spanner/v1.27.0) (2021-10-19) ### Features * **spanner:** implement valuer and scanner interfaces ([#4936](https://www.github.com/googleapis/google-cloud-go/issues/4936)) ([4537b45](https://www.github.com/googleapis/google-cloud-go/commit/4537b45d2611ce480abfb5d186b59e7258ec872c)) ## [1.26.0](https://www.github.com/googleapis/google-cloud-go/compare/spanner/v1.25.0...spanner/v1.26.0) (2021-10-11) ### Features * **spanner/spannertest:** implement RowDeletionPolicy in spannertest ([#4961](https://www.github.com/googleapis/google-cloud-go/issues/4961)) ([7800a33](https://www.github.com/googleapis/google-cloud-go/commit/7800a3303b97204a0573780786388437bbbf2673)), refs [#4782](https://www.github.com/googleapis/google-cloud-go/issues/4782) * **spanner/spannertest:** Support generated columns ([#4742](https://www.github.com/googleapis/google-cloud-go/issues/4742)) ([324d11d](https://www.github.com/googleapis/google-cloud-go/commit/324d11d3c19ffbd77848c8e19c972b70ff5e9268)) * **spanner/spansql:** fill in missing hash functions ([#4808](https://www.github.com/googleapis/google-cloud-go/issues/4808)) ([37ee2d9](https://www.github.com/googleapis/google-cloud-go/commit/37ee2d95220efc1aaf0280d0aa2c01ae4b9d4c1b)) * **spanner/spansql:** support JSON data type ([#4959](https://www.github.com/googleapis/google-cloud-go/issues/4959)) ([e84e408](https://www.github.com/googleapis/google-cloud-go/commit/e84e40830752fc8bc0ccdd869fa7b8fd0c80f306)) * **spanner/spansql:** Support multiple joins in query ([#4743](https://www.github.com/googleapis/google-cloud-go/issues/4743)) ([81a308e](https://www.github.com/googleapis/google-cloud-go/commit/81a308e909a3ae97504a49fbc9982f7eeb6be80c)) ## [1.25.0](https://www.github.com/googleapis/google-cloud-go/compare/spanner/v1.24.1...spanner/v1.25.0) (2021-08-25) ### Features * **spanner/spansql:** add support for STARTS_WITH function ([#4670](https://www.github.com/googleapis/google-cloud-go/issues/4670)) ([7a56af0](https://www.github.com/googleapis/google-cloud-go/commit/7a56af03d1505d9a29d1185a50e261c0e90fdb1a)), refs [#4661](https://www.github.com/googleapis/google-cloud-go/issues/4661) * **spanner:** add support for JSON data type ([#4104](https://www.github.com/googleapis/google-cloud-go/issues/4104)) ([ade8ab1](https://www.github.com/googleapis/google-cloud-go/commit/ade8ab111315d84fa140ddde020387a78668dfa4)) ### Bug Fixes * **spanner/spannertest:** Fix the "LIKE" clause handling for prefix and suffix matches ([#4655](https://www.github.com/googleapis/google-cloud-go/issues/4655)) ([a2118f0](https://www.github.com/googleapis/google-cloud-go/commit/a2118f02fb03bfc50952699318f35c23dc234c41)) * **spanner:** invalid numeric should throw an error ([#3926](https://www.github.com/googleapis/google-cloud-go/issues/3926)) ([cde8697](https://www.github.com/googleapis/google-cloud-go/commit/cde8697be01f1ef57806275c0ddf54f87bb9a571)) ### [1.24.1](https://www.github.com/googleapis/google-cloud-go/compare/spanner/v1.24.0...spanner/v1.24.1) (2021-08-11) ### Bug Fixes * **spanner/spansql:** only add comma after other option ([#4551](https://www.github.com/googleapis/google-cloud-go/issues/4551)) ([3ac1e00](https://www.github.com/googleapis/google-cloud-go/commit/3ac1e007163803d315dcf5db612fe003f6eab978)) * **spanner:** allow decoding null values to spanner.Decoder ([#4558](https://www.github.com/googleapis/google-cloud-go/issues/4558)) ([45ddaca](https://www.github.com/googleapis/google-cloud-go/commit/45ddaca606a372d9293bf2e2b3dc6d4398166c43)), refs [#4552](https://www.github.com/googleapis/google-cloud-go/issues/4552) ## [1.24.0](https://www.github.com/googleapis/google-cloud-go/compare/spanner/v1.23.0...spanner/v1.24.0) (2021-07-29) ### Features * **spanner/spansql:** add ROW DELETION POLICY parsing ([#4496](https://www.github.com/googleapis/google-cloud-go/issues/4496)) ([3d6c6c7](https://www.github.com/googleapis/google-cloud-go/commit/3d6c6c7873e1b75e8b492ede2e561411dc40536a)) * **spanner/spansql:** fix unstable SelectFromTable SQL ([#4473](https://www.github.com/googleapis/google-cloud-go/issues/4473)) ([39bc4ec](https://www.github.com/googleapis/google-cloud-go/commit/39bc4eca655d0180b18378c175d4a9a77fe1602f)) * **spanner/spansql:** support ALTER DATABASE ([#4403](https://www.github.com/googleapis/google-cloud-go/issues/4403)) ([1458dc9](https://www.github.com/googleapis/google-cloud-go/commit/1458dc9c21d98ffffb871943f178678cc3c21306)) * **spanner/spansql:** support table_hint_expr at from_clause on query_statement ([#4457](https://www.github.com/googleapis/google-cloud-go/issues/4457)) ([7047808](https://www.github.com/googleapis/google-cloud-go/commit/7047808794cf463c6a96d7b59ef5af3ed94fd7cf)) * **spanner:** add row.String() and refine error message for decoding a struct array ([#4431](https://www.github.com/googleapis/google-cloud-go/issues/4431)) ([f6258a4](https://www.github.com/googleapis/google-cloud-go/commit/f6258a47a4dfadc02dcdd75b53fd5f88c5dcca30)) * **spanner:** allow untyped nil values in parameterized queries ([#4482](https://www.github.com/googleapis/google-cloud-go/issues/4482)) ([c1ba18b](https://www.github.com/googleapis/google-cloud-go/commit/c1ba18b1b1fc45de6e959cc22a5c222cc80433ee)) ### Bug Fixes * **spanner/spansql:** fix DATE and TIMESTAMP parsing. ([#4480](https://www.github.com/googleapis/google-cloud-go/issues/4480)) ([dec7a67](https://www.github.com/googleapis/google-cloud-go/commit/dec7a67a3e980f6f5e0d170919da87e1bffe923f)) ## [1.23.0](https://www.github.com/googleapis/google-cloud-go/compare/spanner/v1.22.0...spanner/v1.23.0) (2021-07-08) ### Features * **spanner/admin/database:** add leader_options to InstanceConfig and default_leader to Database ([7aa0e19](https://www.github.com/googleapis/google-cloud-go/commit/7aa0e195a5536dd060a1fca871bd3c6f946d935e)) ## [1.22.0](https://www.github.com/googleapis/google-cloud-go/compare/spanner/v1.21.0...spanner/v1.22.0) (2021-06-30) ### Features * **spanner:** support request and transaction tags ([#4336](https://www.github.com/googleapis/google-cloud-go/issues/4336)) ([f08c73a](https://www.github.com/googleapis/google-cloud-go/commit/f08c73a75e2d2a8b9a0b184179346cb97c82e9e5)) * **spanner:** enable request options for batch read ([#4337](https://www.github.com/googleapis/google-cloud-go/issues/4337)) ([b9081c3](https://www.github.com/googleapis/google-cloud-go/commit/b9081c36ed6495a67f8e458ad884bdb8da5b7fbc)) ## [1.21.0](https://www.github.com/googleapis/google-cloud-go/compare/spanner/v1.20.0...spanner/v1.21.0) (2021-06-23) ### Miscellaneous Chores * **spanner:** trigger a release for low cost instance ([#4264](https://www.github.com/googleapis/google-cloud-go/issues/4264)) ([24c4451](https://www.github.com/googleapis/google-cloud-go/commit/24c4451404cdf4a83cc7a35ee1911d654d2ba132)) ## [1.20.0](https://www.github.com/googleapis/google-cloud-go/compare/spanner/v1.19.0...spanner/v1.20.0) (2021-06-08) ### Features * **spanner:** add the support of optimizer statistics package ([#2717](https://www.github.com/googleapis/google-cloud-go/issues/2717)) ([29c7247](https://www.github.com/googleapis/google-cloud-go/commit/29c724771f0b19849c76e62d4bc8e9342922bf75)) ## [1.19.0](https://www.github.com/googleapis/google-cloud-go/compare/spanner/v1.18.0...spanner/v1.19.0) (2021-06-03) ### Features * **spanner/spannertest:** support multiple aggregations ([#3965](https://www.github.com/googleapis/google-cloud-go/issues/3965)) ([1265dc3](https://www.github.com/googleapis/google-cloud-go/commit/1265dc3289693f79fcb9c5785a424eb510a50007)) * **spanner/spansql:** case insensitive parsing of keywords and functions ([#4034](https://www.github.com/googleapis/google-cloud-go/issues/4034)) ([ddb09d2](https://www.github.com/googleapis/google-cloud-go/commit/ddb09d22a737deea0d0a9ab58cd5d337164bbbfe)) * **spanner:** add a database name getter to client ([#4190](https://www.github.com/googleapis/google-cloud-go/issues/4190)) ([7fce29a](https://www.github.com/googleapis/google-cloud-go/commit/7fce29af404f0623b483ca6d6f2af4c726105fa6)) * **spanner:** add custom instance config to tests ([#4194](https://www.github.com/googleapis/google-cloud-go/issues/4194)) ([e935345](https://www.github.com/googleapis/google-cloud-go/commit/e9353451237e658bde2e41b30e8270fbc5987b39)) ### Bug Fixes * **spanner:** add missing NUMERIC type to the doc for Row ([#4116](https://www.github.com/googleapis/google-cloud-go/issues/4116)) ([9a3b416](https://www.github.com/googleapis/google-cloud-go/commit/9a3b416221f3c8b3793837e2a459b1d7cd9c479f)) * **spanner:** indent code example for Encoder and Decoder ([#4128](https://www.github.com/googleapis/google-cloud-go/issues/4128)) ([7c1f48f](https://www.github.com/googleapis/google-cloud-go/commit/7c1f48f307284c26c10cd5787dbc94136a2a36a6)) * **spanner:** mark SessionPoolConfig.MaxBurst deprecated ([#4115](https://www.github.com/googleapis/google-cloud-go/issues/4115)) ([d60a686](https://www.github.com/googleapis/google-cloud-go/commit/d60a68649f85f1edfbd8f11673bb280813c2b771)) ## [1.18.0](https://www.github.com/googleapis/google-cloud-go/compare/spanner/v1.17.0...spanner/v1.18.0) (2021-04-29) ### Features * **spanner/admin/database:** add `progress` field to `UpdateDatabaseDdlMetadata` ([9029071](https://www.github.com/googleapis/google-cloud-go/commit/90290710158cf63de918c2d790df48f55a23adc5)) ## [1.17.0](https://www.github.com/googleapis/google-cloud-go/compare/spanner/v1.16.0...spanner/v1.17.0) (2021-03-31) ### Features * **spanner/admin/database:** add tagging request options ([2b02a03](https://www.github.com/googleapis/google-cloud-go/commit/2b02a03ff9f78884da5a8e7b64a336014c61bde7)) * **spanner:** add RPC Priority request options ([b5b4da6](https://www.github.com/googleapis/google-cloud-go/commit/b5b4da6952922440d03051f629f3166f731dfaa3)) * **spanner:** Add support for RPC priority ([#3341](https://www.github.com/googleapis/google-cloud-go/issues/3341)) ([88cf097](https://www.github.com/googleapis/google-cloud-go/commit/88cf097649f1cdf01cab531eabdff7fbf2be3f8f)) ## [1.16.0](https://www.github.com/googleapis/google-cloud-go/compare/v1.15.0...v1.16.0) (2021-03-17) ### Features * **spanner:** add `optimizer_statistics_package` field in `QueryOptions` ([18c88c4](https://www.github.com/googleapis/google-cloud-go/commit/18c88c437bd1741eaf5bf5911b9da6f6ea7cd75d)) * **spanner/admin/database:** add CMEK fields to backup and database ([16597fa](https://github.com/googleapis/google-cloud-go/commit/16597fa1ce549053c7183e8456e23f554a5501de)) ### Bug Fixes * **spanner/spansql:** fix parsing of NOT IN operator ([#3724](https://www.github.com/googleapis/google-cloud-go/issues/3724)) ([7636478](https://www.github.com/googleapis/google-cloud-go/commit/76364784d82073b80929ae60fd42da34c8050820)) ## [1.15.0](https://www.github.com/googleapis/google-cloud-go/compare/v1.14.1...v1.15.0) (2021-02-24) ### Features * **spanner/admin/database:** add CMEK fields to backup and database ([47037ed](https://www.github.com/googleapis/google-cloud-go/commit/47037ed33cd36edfff4ba7c4a4ea332140d5e67b)) * **spanner/admin/database:** add CMEK fields to backup and database ([16597fa](https://www.github.com/googleapis/google-cloud-go/commit/16597fa1ce549053c7183e8456e23f554a5501de)) ### Bug Fixes * **spanner:** parallelize session deletion when closing pool ([#3701](https://www.github.com/googleapis/google-cloud-go/issues/3701)) ([75ac7d2](https://www.github.com/googleapis/google-cloud-go/commit/75ac7d2506e706869ae41cf186b0c873b146e926)), refs [#3685](https://www.github.com/googleapis/google-cloud-go/issues/3685) ### [1.14.1](https://www.github.com/googleapis/google-cloud-go/compare/v1.14.0...v1.14.1) (2021-02-09) ### Bug Fixes * **spanner:** restore removed scopes ([#3684](https://www.github.com/googleapis/google-cloud-go/issues/3684)) ([232d3a1](https://www.github.com/googleapis/google-cloud-go/commit/232d3a17bdadb92864592351a335ec920a68f9bf)) ## [1.14.0](https://www.github.com/googleapis/google-cloud-go/compare/spanner/v1.13.0...v1.14.0) (2021-02-09) ### Features * **spanner/admin/database:** adds PITR fields to backup and database ([0959f27](https://www.github.com/googleapis/google-cloud-go/commit/0959f27e85efe94d39437ceef0ff62ddceb8e7a7)) * **spanner/spannertest:** restructure column alteration implementation ([#3616](https://www.github.com/googleapis/google-cloud-go/issues/3616)) ([176400b](https://www.github.com/googleapis/google-cloud-go/commit/176400be9ab485fb343b8994bc49ac2291d8eea9)) * **spanner/spansql:** add complete set of array functions ([#3633](https://www.github.com/googleapis/google-cloud-go/issues/3633)) ([13d50b9](https://www.github.com/googleapis/google-cloud-go/commit/13d50b93cc8348c54641b594371a96ecdb1bcabc)) * **spanner/spansql:** add complete set of string functions ([#3625](https://www.github.com/googleapis/google-cloud-go/issues/3625)) ([34027ad](https://www.github.com/googleapis/google-cloud-go/commit/34027ada6a718603be2987b4084ce5e0ead6413c)) * **spanner:** add option for returning Spanner commit stats ([c7ecf0f](https://www.github.com/googleapis/google-cloud-go/commit/c7ecf0f3f454606b124e52d20af2545b2c68646f)) * **spanner:** add option for returning Spanner commit stats ([7bdebad](https://www.github.com/googleapis/google-cloud-go/commit/7bdebadbe06774c94ab745dfef4ce58ce40a5582)) * **spanner:** support CommitStats ([#3444](https://www.github.com/googleapis/google-cloud-go/issues/3444)) ([b7c3ca6](https://www.github.com/googleapis/google-cloud-go/commit/b7c3ca6c83cbdca95d734df8aa07c5ddb8ab3db0)) ### Bug Fixes * **spanner/spannertest:** support queries in ExecuteSql ([#3640](https://www.github.com/googleapis/google-cloud-go/issues/3640)) ([8eede84](https://www.github.com/googleapis/google-cloud-go/commit/8eede8411a5521f45a5c3f8091c42b3c5407ea90)), refs [#3639](https://www.github.com/googleapis/google-cloud-go/issues/3639) * **spanner/spansql:** fix SelectFromJoin behavior ([#3571](https://www.github.com/googleapis/google-cloud-go/issues/3571)) ([e0887c7](https://www.github.com/googleapis/google-cloud-go/commit/e0887c762a4c58f29b3e5b49ee163a36a065463c)) ## [1.13.0](https://www.github.com/googleapis/google-cloud-go/compare/spanner/v1.12.0...v1.13.0) (2021-01-15) ### Features * **spanner/spannertest:** implement ANY_VALUE aggregation function ([#3428](https://www.github.com/googleapis/google-cloud-go/issues/3428)) ([e16c3e9](https://www.github.com/googleapis/google-cloud-go/commit/e16c3e9b412762b85483f3831ee586a5e6631313)) * **spanner/spannertest:** implement FULL JOIN ([#3218](https://www.github.com/googleapis/google-cloud-go/issues/3218)) ([99f7212](https://www.github.com/googleapis/google-cloud-go/commit/99f7212bd70bb333c1aa1c7a57348b4dfd80d31b)) * **spanner/spannertest:** implement SELECT ... FROM UNNEST(...) ([#3431](https://www.github.com/googleapis/google-cloud-go/issues/3431)) ([deb466f](https://www.github.com/googleapis/google-cloud-go/commit/deb466f497a1e6df78fcad57c3b90b1a4ccd93b4)) * **spanner/spannertest:** support array literals ([#3438](https://www.github.com/googleapis/google-cloud-go/issues/3438)) ([69e0110](https://www.github.com/googleapis/google-cloud-go/commit/69e0110f4977035cd1a705c3034c3ba96cadf36f)) * **spanner/spannertest:** support AVG aggregation function ([#3286](https://www.github.com/googleapis/google-cloud-go/issues/3286)) ([4788415](https://www.github.com/googleapis/google-cloud-go/commit/4788415c908f58c1cc08c951f1a7f17cdaf35aa2)) * **spanner/spannertest:** support Not Null constraint ([#3491](https://www.github.com/googleapis/google-cloud-go/issues/3491)) ([c36aa07](https://www.github.com/googleapis/google-cloud-go/commit/c36aa0785e798b9339d540e691850ca3c474a288)) * **spanner/spannertest:** support UPDATE DML ([#3201](https://www.github.com/googleapis/google-cloud-go/issues/3201)) ([1dec6f6](https://www.github.com/googleapis/google-cloud-go/commit/1dec6f6a31768a3f70bfec7274828301c22ea10b)) * **spanner/spansql:** define structures and parse UPDATE DML statements ([#3192](https://www.github.com/googleapis/google-cloud-go/issues/3192)) ([23b6904](https://www.github.com/googleapis/google-cloud-go/commit/23b69042c58489df512703259f54d075ba0c0722)) * **spanner/spansql:** support DATE and TIMESTAMP literals ([#3557](https://www.github.com/googleapis/google-cloud-go/issues/3557)) ([1961930](https://www.github.com/googleapis/google-cloud-go/commit/196193034a15f84dc3d3c27901990e8be77fca85)) * **spanner/spansql:** support for parsing generated columns ([#3373](https://www.github.com/googleapis/google-cloud-go/issues/3373)) ([9b1d06f](https://www.github.com/googleapis/google-cloud-go/commit/9b1d06fc90a4c07899c641a893dba0b47a1cead9)) * **spanner/spansql:** support NUMERIC data type ([#3411](https://www.github.com/googleapis/google-cloud-go/issues/3411)) ([1bc65d9](https://www.github.com/googleapis/google-cloud-go/commit/1bc65d9124ba22db5bec4c71b6378c27dfc04724)) * **spanner:** Add a DirectPath fallback integration test ([#3487](https://www.github.com/googleapis/google-cloud-go/issues/3487)) ([de821c5](https://www.github.com/googleapis/google-cloud-go/commit/de821c59fb81e9946216d205162b59de8b5ce71c)) * **spanner:** attempt DirectPath by default ([#3516](https://www.github.com/googleapis/google-cloud-go/issues/3516)) ([bbc61ed](https://www.github.com/googleapis/google-cloud-go/commit/bbc61ed368453b28aaf5bed627ca2499a3591f63)) * **spanner:** include User agent ([#3465](https://www.github.com/googleapis/google-cloud-go/issues/3465)) ([4e1ef1b](https://www.github.com/googleapis/google-cloud-go/commit/4e1ef1b3fb536ef950249cdee02cc0b6c2b56e86)) * **spanner:** run E2E test over DirectPath ([#3466](https://www.github.com/googleapis/google-cloud-go/issues/3466)) ([18e3a4f](https://www.github.com/googleapis/google-cloud-go/commit/18e3a4fe2a0c59c6295db2d85c7893ac51688083)) * **spanner:** support NUMERIC in mutations ([#3328](https://www.github.com/googleapis/google-cloud-go/issues/3328)) ([fa90737](https://www.github.com/googleapis/google-cloud-go/commit/fa90737a2adbe0cefbaba4aa1046a6efbba2a0e9)) ### Bug Fixes * **spanner:** fix session leak ([#3461](https://www.github.com/googleapis/google-cloud-go/issues/3461)) ([11fb917](https://www.github.com/googleapis/google-cloud-go/commit/11fb91711db5b941995737980cef7b48b611fefd)), refs [#3460](https://www.github.com/googleapis/google-cloud-go/issues/3460) ## [1.12.0](https://www.github.com/googleapis/google-cloud-go/compare/spanner/v1.11.0...v1.12.0) (2020-11-10) ### Features * **spanner:** add metadata to RowIterator ([#3050](https://www.github.com/googleapis/google-cloud-go/issues/3050)) ([9a2289c](https://www.github.com/googleapis/google-cloud-go/commit/9a2289c3a38492bc2e84e0f4000c68a8718f5c11)), closes [#1805](https://www.github.com/googleapis/google-cloud-go/issues/1805) * **spanner:** export ToSpannerError ([#3133](https://www.github.com/googleapis/google-cloud-go/issues/3133)) ([b951d8b](https://www.github.com/googleapis/google-cloud-go/commit/b951d8bd194b76da0a8bf2ce7cf85b546d2e051c)), closes [#3122](https://www.github.com/googleapis/google-cloud-go/issues/3122) * **spanner:** support rw-transaction with options ([#3058](https://www.github.com/googleapis/google-cloud-go/issues/3058)) ([5130694](https://www.github.com/googleapis/google-cloud-go/commit/51306948eef9d26cff70453efc3eb500ddef9117)) * **spanner/spannertest:** make SELECT list aliases visible to ORDER BY ([#3054](https://www.github.com/googleapis/google-cloud-go/issues/3054)) ([7d2d83e](https://www.github.com/googleapis/google-cloud-go/commit/7d2d83ee1cce58d4014d5570bc599bcef1ed9c22)), closes [#3043](https://www.github.com/googleapis/google-cloud-go/issues/3043) ## v1.11.0 * Features: - feat(spanner): add KeySetFromKeys function (#2837) * Misc: - test(spanner): check for Aborted error (#3039) - test(spanner): fix potential race condition in TestRsdBlockingStates (#3017) - test(spanner): compare data instead of struct (#3013) - test(spanner): fix flaky oc_test.go (#2838) - docs(spanner): document NULL value (#2885) * spansql/spannertest: - Support JOINs (all but FULL JOIN) (#2936, #2924, #2896, #3042, #3037, #2995, #2945, #2931) - feat(spanner/spansql): parse CHECK constraints (#3046) - fix(spanner/spansql): fix parsing of unary minus and plus (#2997) - fix(spanner/spansql): fix parsing of adjacent inline and leading comments (#2851) - fix(spanner/spannertest): fix ORDER BY combined with SELECT aliases (#3043) - fix(spanner/spannertest): generate query output columns in construction order (#2990) - fix(spanner/spannertest): correct handling of NULL AND FALSE (#2991) - fix(spanner/spannertest): correct handling of tri-state boolean expression evaluation (#2983) - fix(spanner/spannertest): fix handling of NULL with LIKE operator (#2982) - test(spanner/spannertest): migrate most test code to integration_test.go (#2977) - test(spanner/spansql): add fuzz target for ParseQuery (#2909) - doc(spanner/spannertest): document the implementation (#2996) - perf(spanner/spannertest): speed up no-wait DDL changes (#2994) - perf(spanner/spansql): make fewer allocations during SQL (#2969) * Backward Incompatible Changes - chore(spanner/spansql): use ID type for identifiers throughout (#2889) - chore(spanner/spansql): restructure FROM, TABLESAMPLE (#2888) ## v1.10.0 * feat(spanner): add support for NUMERIC data type (#2415) * feat(spanner): add custom type support to spanner.Key (#2748) * feat(spanner/spannertest): add support for bool parameter types (#2674) * fix(spanner): update PDML to take sessions from pool (#2736) * spanner/spansql: update docs on TableAlteration, ColumnAlteration (#2825) * spanner/spannertest: support dropping columns (#2823) * spanner/spannertest: implement GetDatabase (#2802) * spanner/spannertest: fix aggregation in query evaluation for empty inputs (#2803) ## v1.9.0 * Features: - feat(spanner): support custom field type (#2614) * Bugfixes: - fix(spanner): call ctx.cancel after stats have been recorded (#2728) - fix(spanner): retry session not found for read (#2724) - fix(spanner): specify credentials with SPANNER_EMULATOR_HOST (#2701) - fix(spanner): update pdml to retry EOS internal error (#2678) * Misc: - test(spanner): unskip tests for emulator (#2675) * spansql/spannertest: - spanner/spansql: restructure types and parsing for column options (#2656) - spanner/spannertest: return error for Read with no keys (#2655) ## v1.8.0 * Features: - feat(spanner): support of client-level custom retry settings (#2599) - feat(spanner): add a statement-based way to run read-write transaction. (#2545) * Bugfixes: - fix(spanner): set 'gccl' to the request header. (#2609) - fix(spanner): add the missing resource prefix (#2605) - fix(spanner): fix the upgrade of protobuf. (#2583) - fix(spanner): do not copy protobuf messages by value. (#2581) - fix(spanner): fix the required resource prefix. (#2580) - fix(spanner): add extra field to ignore with cmp (#2577) - fix(spanner): remove appengine-specific numChannels. (#2513) * Misc: - test(spanner): log warning instead of fail for stress test (#2559) - test(spanner): fix failed TestRsdBlockingStates test (#2597) - chore(spanner): cleanup mockserver and mockclient (#2414) ## v1.7.0 * Retry: - Only retry certain types of internal errors. (#2460) * Tracing/metrics: - Never sample `ping()` trace spans (#2520) - Add oc tests for session pool metrics. (#2416) * Encoding: - Allow encoding struct with custom types to mutation (#2529) * spannertest: - Fix evaluation on IN (#2479) - Support MIN/MAX aggregation functions (#2411) * Misc: - Fix TestClient_WithGRPCConnectionPoolAndNumChannels_Misconfigured test (#2539) - Cleanup backoff files and rename a variable (#2526) - Fix TestIntegration_DML test to return err from tx (#2509) - Unskip tests for emulator 0.8.0. (#2494) - Fix TestIntegration_StartBackupOperation test. (#2418) - Fix flakiness in TestIntegration_BatchDML_Error - Unskip TestIntegration_BatchDML and TestIntegration_BatchDML_TwoStatements for emulator by checking the existence of status. - Fix TestStressSessionPool test by taking lock while getting sessions from hc. ## v1.6.0 * Sessions: - Increase the number of sessions in batches instead of one by one when additional sessions are needed. The step size is set to 25, which means that whenever the session pool needs at least one more session, it will create a batch of 25 sessions. * Emulator: - Run integration tests against the emulator in Kokoro Presubmit. * RPC retrying: - Retry CreateDatabase on retryable codes. * spannertest: - Change internal representation of DATE/TIMESTAMP values. * spansql: - Cleanly parse adjacent comment marker/terminator. - Support FROM aliases in SELECT statements. * Misc: - Fix comparing errors in tests. - Fix flaky session pool test. - Increase timeout in TestIntegration_ReadOnlyTransaction. - Fix incorrect instance IDs when deleting instances in tests. - Clean up test instances. - Clearify docs on Aborted transaction. - Fix timeout+staleness bound for test - Remove the support for resource-based routing. - Fix TestTransaction_SessionNotFound test. ## v1.5.1 * Fix incorrect decreasing metrics, numReads and numWrites. * Fix an issue that XXX fields/methods are internal to proto and may change at any time. XXX_Merge panics in proto v1.4.0. Use proto.Merge instead of XXX_Merge. * spannertest: handle list parameters in RPC interfacea. ## v1.5.0 * Metrics - Instrument client library with adding OpenCensus metrics. This allows for better monitoring of the session pool. * Session management - Switch the session keepalive method from GetSession to SELECT 1. * Emulator - Use client hooks for admin clients running against an emulator. With this change, users can use SPANNER_EMULATOR_HOST for initializing admin clients when running against an emulator. * spansql - Add space between constraint name and foreign key def. * Misc - Fix segfault when a non-existent credentials file had been specified. - Fix cleaning up instances in integration tests. - Fix race condition in batch read-only transaction. - Fix the flaky TestLIFOTakeWriteSessionOrder test. - Fix ITs to order results in SELECT queries. - Fix the documentation of timestamp bounds. - Fix the regex issue in managing backups. ## v1.4.0 - Support managed backups. This includes the API methods for CreateBackup, GetBackup, UpdateBackup, DeleteBackup and others. Also includes a simple wrapper in DatabaseAdminClient to create a backup. - Update the healthcheck interval. The default interval is updated to 50 mins. By default, the first healthcheck is scheduled between 10 and 55 mins and the subsequent healthchecks are between 45 and 55 mins. This update avoids overloading the backend service with frequent healthchecking. ## v1.3.0 * Query options: - Adds the support of providing query options (optimizer version) via three ways (precedence follows the order): `client-level < environment variables < query-level`. The environment variable is set by "SPANNER_OPTIMIZER_VERSION". * Connection pooling: - Use the new connection pooling in gRPC. This change deprecates `ClientConfig.numChannels` and users should move to `WithGRPCConnectionPool(numChannels)` at their earliest convenience. Example: ```go // numChannels (deprecated): err, client := NewClientWithConfig(ctx, database, ClientConfig{NumChannels: 8}) // gRPC connection pool: err, client := NewClientWithConfig(ctx, database, ClientConfig{}, option.WithGRPCConnectionPool(8)) ``` * Error handling: - Do not rollback after failed commit. - Return TransactionOutcomeUnknownError if a DEADLINE_EXCEEDED or CANCELED error occurs while a COMMIT request is in flight. * spansql: - Added support for IN expressions and OFFSET clauses. - Fixed parsing of table constraints. - Added support for foreign key constraints in ALTER TABLE and CREATE TABLE. - Added support for GROUP BY clauses. * spannertest: - Added support for IN expressions and OFFSET clauses. - Added support for GROUP BY clauses. - Fixed data race in query execution. - No longer rejects reads specifying an index to use. - Return last commit timestamp as read timestamp when requested. - Evaluate add, subtract, multiply, divide, unary negation, unary not, bitwise and/xor/or operations, as well as reporting column types for expressions involving any possible arithmetic operator.arithmetic expressions. - Fixed handling of descending primary keys. * Misc: - Change default healthcheck interval to 30 mins to reduce the GetSession calls made to the backend. - Add marshal/unmarshal json for nullable types to support NullString, NullInt64, NullFloat64, NullBool, NullTime, NullDate. - Use ResourceInfo to extract error. - Extract retry info from status. ## v1.2.1 - Fix session leakage for ApplyAtLeastOnce. Previously session handles where leaked whenever Commit() returned a non-abort, non-session-not-found error, due to a missing recycle() call. - Fix error for WriteStruct with pointers. This fixes a specific check for encoding and decoding to pointer types. - Fix a GRPCStatus issue that returns a Status that has Unknown code if the base error is nil. Now, it always returns a Status based on Code field of current error. ## v1.2.0 - Support tracking stacktrace of sessionPool.take() that allows the user to instruct the session pool to keep track of the stacktrace of each goroutine that checks out a session from the pool. This is disabled by default, but it can be enabled by setting `SessionPoolConfig.TrackSessionHandles: true`. - Add resource-based routing that includes a step to retrieve the instance-specific endpoint before creating the session client when creating a new spanner client. This is disabled by default, but it can be enabled by setting `GOOGLE_CLOUD_SPANNER_ENABLE_RESOURCE_BASED_ROUTING`. - Make logger configurable so that the Spanner client can now be configured to use a specific logger instead of the standard logger. - Support encoding custom types that point back to supported basic types. - Allow decoding Spanner values to custom types that point back to supported types. ## v1.1.0 - The String() method of NullString, NullTime and NullDate will now return an unquoted string instead of a quoted string. This is a BREAKING CHANGE. If you relied on the old behavior, please use fmt.Sprintf("%q", T). - The Spanner client will now use the new BatchCreateSessions RPC to initialize the session pool. This will improve the startup time of clients that are initialized with a minimum number of sessions greater than zero (i.e. SessionPoolConfig.MinOpened>0). - Spanner clients that are created with the NewClient method will now default to a minimum of 100 opened sessions in the pool (i.e. SessionPoolConfig.MinOpened=100). This will improve the performance of the first transaction/query that is executed by an application, as a session will normally not have to be created as part of the transaction. Spanner clients that are created with the NewClientWithConfig method are not affected by this change. - Spanner clients that are created with the NewClient method will now default to a write sessions fraction of 0.2 in the pool (i.e. SessionPoolConfig.WriteSessions=0.2). Spanner clients that are created with the NewClientWithConfig method are not affected by this change. - The session pool maintenance worker has been improved so it keeps better track of the actual number of sessions needed. It will now less often delete and re-create sessions. This can improve the overall performance of applications with a low transaction rate. ## v1.0.0 This is the first tag to carve out spanner as its own module. See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository.
{ "content_hash": "b54e9ffe19d1beabc0740db5db13671e", "timestamp": "", "source": "github", "line_count": 481, "max_line_length": 334, "avg_line_length": 68.64864864864865, "alnum_prop": 0.7656268927922472, "repo_name": "cloudspannerecosystem/gcsb", "id": "bddabea7b4c8fa0373859abbc0440ae0aa8a06da", "size": "33165", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "vendor/cloud.google.com/go/spanner/CHANGES.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "411" }, { "name": "Go", "bytes": "268541" }, { "name": "Makefile", "bytes": "415" } ], "symlink_target": "" }
<?php namespace Symfony\Component\Console; use Symfony\Component\Console\Descriptor\TextDescriptor; use Symfony\Component\Console\Descriptor\XmlDescriptor; use Symfony\Component\Console\Exception\ExceptionInterface; use Symfony\Component\Console\Helper\DebugFormatterHelper; use Symfony\Component\Console\Helper\ProcessHelper; use Symfony\Component\Console\Helper\QuestionHelper; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\ArgvInput; use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Input\InputDefinition; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputAwareInterface; use Symfony\Component\Console\Output\BufferedOutput; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\ConsoleOutput; use Symfony\Component\Console\Output\ConsoleOutputInterface; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Command\HelpCommand; use Symfony\Component\Console\Command\ListCommand; use Symfony\Component\Console\Helper\HelperSet; use Symfony\Component\Console\Helper\FormatterHelper; use Symfony\Component\Console\Helper\DialogHelper; use Symfony\Component\Console\Helper\ProgressHelper; use Symfony\Component\Console\Helper\TableHelper; use Symfony\Component\Console\Event\ConsoleCommandEvent; use Symfony\Component\Console\Event\ConsoleExceptionEvent; use Symfony\Component\Console\Event\ConsoleTerminateEvent; use Symfony\Component\Console\Exception\CommandNotFoundException; use Symfony\Component\Console\Exception\LogicException; use Symfony\Component\EventDispatcher\EventDispatcherInterface; /** * An Application is the container for a collection of commands. * * It is the main entry point of a Console application. * * This class is optimized for a standard CLI environment. * * Usage: * * $app = new Application('myapp', '1.0 (stable)'); * $app->add(new SimpleCommand()); * $app->run(); * * @author Fabien Potencier <fabien@symfony.com> */ class Application { private $commands = array(); private $wantHelps = false; private $runningCommand; private $name; private $version; private $catchExceptions = true; private $autoExit = true; private $definition; private $helperSet; private $dispatcher; private $terminalDimensions; private $defaultCommand; /** * Constructor. * * @param string $name The name of the application * @param string $version The version of the application */ public function __construct($name = 'UNKNOWN', $version = 'UNKNOWN') { $this->name = $name; $this->version = $version; $this->defaultCommand = 'list'; $this->helperSet = $this->getDefaultHelperSet(); $this->definition = $this->getDefaultInputDefinition(); foreach ($this->getDefaultCommands() as $command) { $this->add($command); } } public function setDispatcher(EventDispatcherInterface $dispatcher) { $this->dispatcher = $dispatcher; } /** * Runs the current application. * * @param InputInterface $input An Input instance * @param OutputInterface $output An Output instance * * @return int 0 if everything went fine, or an error code * * @throws \Exception When doRun returns Exception */ public function run(InputInterface $input = null, OutputInterface $output = null) { if (null === $input) { $input = new ArgvInput(); } if (null === $output) { $output = new ConsoleOutput(); } $this->configureIO($input, $output); try { $exitCode = $this->doRun($input, $output); } catch (\Exception $e) { if (!$this->catchExceptions) { throw $e; } if ($output instanceof ConsoleOutputInterface) { $this->renderException($e, $output->getErrorOutput()); } else { $this->renderException($e, $output); } $exitCode = $e->getCode(); if (is_numeric($exitCode)) { $exitCode = (int) $exitCode; if (0 === $exitCode) { $exitCode = 1; } } else { $exitCode = 1; } } if ($this->autoExit) { if ($exitCode > 255) { $exitCode = 255; } exit($exitCode); } return $exitCode; } /** * Runs the current application. * * @param InputInterface $input An Input instance * @param OutputInterface $output An Output instance * * @return int 0 if everything went fine, or an error code */ public function doRun(InputInterface $input, OutputInterface $output) { if (true === $input->hasParameterOption(array('--version', '-V'))) { $output->writeln($this->getLongVersion()); return 0; } $name = $this->getCommandName($input); if (true === $input->hasParameterOption(array('--help', '-h'))) { if (!$name) { $name = 'help'; $input = new ArrayInput(array('command' => 'help')); } else { $this->wantHelps = true; } } if (!$name) { $name = $this->defaultCommand; $input = new ArrayInput(array('command' => $this->defaultCommand)); } // the command name MUST be the first element of the input $command = $this->find($name); $this->runningCommand = $command; $exitCode = $this->doRunCommand($command, $input, $output); $this->runningCommand = null; return $exitCode; } /** * Set a helper set to be used with the command. * * @param HelperSet $helperSet The helper set */ public function setHelperSet(HelperSet $helperSet) { $this->helperSet = $helperSet; } /** * Get the helper set associated with the command. * * @return HelperSet The HelperSet instance associated with this command */ public function getHelperSet() { return $this->helperSet; } /** * Set an input definition set to be used with this application. * * @param InputDefinition $definition The input definition */ public function setDefinition(InputDefinition $definition) { $this->definition = $definition; } /** * Gets the InputDefinition related to this Application. * * @return InputDefinition The InputDefinition instance */ public function getDefinition() { return $this->definition; } /** * Gets the help message. * * @return string A help message. */ public function getHelp() { return $this->getLongVersion(); } /** * Sets whether to catch exceptions or not during commands execution. * * @param bool $boolean Whether to catch exceptions or not during commands execution */ public function setCatchExceptions($boolean) { $this->catchExceptions = (bool) $boolean; } /** * Sets whether to automatically exit after a command execution or not. * * @param bool $boolean Whether to automatically exit after a command execution or not */ public function setAutoExit($boolean) { $this->autoExit = (bool) $boolean; } /** * Gets the name of the application. * * @return string The application name */ public function getName() { return $this->name; } /** * Sets the application name. * * @param string $name The application name */ public function setName($name) { $this->name = $name; } /** * Gets the application version. * * @return string The application version */ public function getVersion() { return $this->version; } /** * Sets the application version. * * @param string $version The application version */ public function setVersion($version) { $this->version = $version; } /** * Returns the long version of the application. * * @return string The long application version */ public function getLongVersion() { if ('UNKNOWN' !== $this->getName() && 'UNKNOWN' !== $this->getVersion()) { return sprintf('<info>%s</info> version <comment>%s</comment>', $this->getName(), $this->getVersion()); } return '<info>Console Tool</info>'; } /** * Registers a new command. * * @param string $name The command name * * @return Command The newly created command */ public function register($name) { return $this->add(new Command($name)); } /** * Adds an array of command objects. * * @param Command[] $commands An array of commands */ public function addCommands(array $commands) { foreach ($commands as $command) { $this->add($command); } } /** * Adds a command object. * * If a command with the same name already exists, it will be overridden. * * @param Command $command A Command object * * @return Command The registered command */ public function add(Command $command) { $command->setApplication($this); if (!$command->isEnabled()) { $command->setApplication(null); return; } if (null === $command->getDefinition()) { throw new LogicException(sprintf('Command class "%s" is not correctly initialized. You probably forgot to call the parent constructor.', get_class($command))); } $this->commands[$command->getName()] = $command; foreach ($command->getAliases() as $alias) { $this->commands[$alias] = $command; } return $command; } /** * Returns a registered command by name or alias. * * @param string $name The command name or alias * * @return Command A Command object * * @throws CommandNotFoundException When command name given does not exist */ public function get($name) { if (!isset($this->commands[$name])) { throw new CommandNotFoundException(sprintf('The command "%s" does not exist.', $name)); } $command = $this->commands[$name]; if ($this->wantHelps) { $this->wantHelps = false; $helpCommand = $this->get('help'); $helpCommand->setCommand($command); return $helpCommand; } return $command; } /** * Returns true if the command exists, false otherwise. * * @param string $name The command name or alias * * @return bool true if the command exists, false otherwise */ public function has($name) { return isset($this->commands[$name]); } /** * Returns an array of all unique namespaces used by currently registered commands. * * It does not returns the global namespace which always exists. * * @return array An array of namespaces */ public function getNamespaces() { $namespaces = array(); foreach ($this->commands as $command) { $namespaces = array_merge($namespaces, $this->extractAllNamespaces($command->getName())); foreach ($command->getAliases() as $alias) { $namespaces = array_merge($namespaces, $this->extractAllNamespaces($alias)); } } return array_values(array_unique(array_filter($namespaces))); } /** * Finds a registered namespace by a name or an abbreviation. * * @param string $namespace A namespace or abbreviation to search for * * @return string A registered namespace * * @throws CommandNotFoundException When namespace is incorrect or ambiguous */ public function findNamespace($namespace) { $allNamespaces = $this->getNamespaces(); $expr = preg_replace_callback('{([^:]+|)}', function ($matches) { return preg_quote($matches[1]).'[^:]*'; }, $namespace); $namespaces = preg_grep('{^'.$expr.'}', $allNamespaces); if (empty($namespaces)) { $message = sprintf('There are no commands defined in the "%s" namespace.', $namespace); if ($alternatives = $this->findAlternatives($namespace, $allNamespaces)) { if (1 == count($alternatives)) { $message .= "\n\nDid you mean this?\n "; } else { $message .= "\n\nDid you mean one of these?\n "; } $message .= implode("\n ", $alternatives); } throw new CommandNotFoundException($message, $alternatives); } $exact = in_array($namespace, $namespaces, true); if (count($namespaces) > 1 && !$exact) { throw new CommandNotFoundException(sprintf('The namespace "%s" is ambiguous (%s).', $namespace, $this->getAbbreviationSuggestions(array_values($namespaces))), array_values($namespaces)); } return $exact ? $namespace : reset($namespaces); } /** * Finds a command by name or alias. * * Contrary to get, this command tries to find the best * match if you give it an abbreviation of a name or alias. * * @param string $name A command name or a command alias * * @return Command A Command instance * * @throws CommandNotFoundException When command name is incorrect or ambiguous */ public function find($name) { $allCommands = array_keys($this->commands); $expr = preg_replace_callback('{([^:]+|)}', function ($matches) { return preg_quote($matches[1]).'[^:]*'; }, $name); $commands = preg_grep('{^'.$expr.'}', $allCommands); if (empty($commands) || count(preg_grep('{^'.$expr.'$}', $commands)) < 1) { if (false !== $pos = strrpos($name, ':')) { // check if a namespace exists and contains commands $this->findNamespace(substr($name, 0, $pos)); } $message = sprintf('Command "%s" is not defined.', $name); if ($alternatives = $this->findAlternatives($name, $allCommands)) { if (1 == count($alternatives)) { $message .= "\n\nDid you mean this?\n "; } else { $message .= "\n\nDid you mean one of these?\n "; } $message .= implode("\n ", $alternatives); } throw new CommandNotFoundException($message, $alternatives); } // filter out aliases for commands which are already on the list if (count($commands) > 1) { $commandList = $this->commands; $commands = array_filter($commands, function ($nameOrAlias) use ($commandList, $commands) { $commandName = $commandList[$nameOrAlias]->getName(); return $commandName === $nameOrAlias || !in_array($commandName, $commands); }); } $exact = in_array($name, $commands, true); if (count($commands) > 1 && !$exact) { $suggestions = $this->getAbbreviationSuggestions(array_values($commands)); throw new CommandNotFoundException(sprintf('Command "%s" is ambiguous (%s).', $name, $suggestions), array_values($commands)); } return $this->get($exact ? $name : reset($commands)); } /** * Gets the commands (registered in the given namespace if provided). * * The array keys are the full names and the values the command instances. * * @param string $namespace A namespace name * * @return Command[] An array of Command instances */ public function all($namespace = null) { if (null === $namespace) { return $this->commands; } $commands = array(); foreach ($this->commands as $name => $command) { if ($namespace === $this->extractNamespace($name, substr_count($namespace, ':') + 1)) { $commands[$name] = $command; } } return $commands; } /** * Returns an array of possible abbreviations given a set of names. * * @param array $names An array of names * * @return array An array of abbreviations */ public static function getAbbreviations($names) { $abbrevs = array(); foreach ($names as $name) { for ($len = strlen($name); $len > 0; --$len) { $abbrev = substr($name, 0, $len); $abbrevs[$abbrev][] = $name; } } return $abbrevs; } /** * Returns a text representation of the Application. * * @param string $namespace An optional namespace name * @param bool $raw Whether to return raw command list * * @return string A string representing the Application * * @deprecated since version 2.3, to be removed in 3.0. */ public function asText($namespace = null, $raw = false) { @trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0.', E_USER_DEPRECATED); $descriptor = new TextDescriptor(); $output = new BufferedOutput(BufferedOutput::VERBOSITY_NORMAL, !$raw); $descriptor->describe($output, $this, array('namespace' => $namespace, 'raw_output' => true)); return $output->fetch(); } /** * Returns an XML representation of the Application. * * @param string $namespace An optional namespace name * @param bool $asDom Whether to return a DOM or an XML string * * @return string|\DOMDocument An XML string representing the Application * * @deprecated since version 2.3, to be removed in 3.0. */ public function asXml($namespace = null, $asDom = false) { @trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0.', E_USER_DEPRECATED); $descriptor = new XmlDescriptor(); if ($asDom) { return $descriptor->getApplicationDocument($this, $namespace); } $output = new BufferedOutput(); $descriptor->describe($output, $this, array('namespace' => $namespace)); return $output->fetch(); } /** * Renders a caught exception. * * @param \Exception $e An exception instance * @param OutputInterface $output An OutputInterface instance */ public function renderException($e, $output) { do { $title = sprintf(' [%s] ', get_class($e)); $len = $this->stringWidth($title); $width = $this->getTerminalWidth() ? $this->getTerminalWidth() - 1 : PHP_INT_MAX; // HHVM only accepts 32 bits integer in str_split, even when PHP_INT_MAX is a 64 bit integer: https://github.com/facebook/hhvm/issues/1327 if (defined('HHVM_VERSION') && $width > 1 << 31) { $width = 1 << 31; } $formatter = $output->getFormatter(); $lines = array(); foreach (preg_split('/\r?\n/', $e->getMessage()) as $line) { foreach ($this->splitStringByWidth($line, $width - 4) as $line) { // pre-format lines to get the right string length $lineLength = $this->stringWidth(preg_replace('/\[[^m]*m/', '', $formatter->format($line))) + 4; $lines[] = array($line, $lineLength); $len = max($lineLength, $len); } } $messages = array('', ''); $messages[] = $emptyLine = $formatter->format(sprintf('<error>%s</error>', str_repeat(' ', $len))); $messages[] = $formatter->format(sprintf('<error>%s%s</error>', $title, str_repeat(' ', max(0, $len - $this->stringWidth($title))))); foreach ($lines as $line) { $messages[] = $formatter->format(sprintf('<error> %s %s</error>', $line[0], str_repeat(' ', $len - $line[1]))); } $messages[] = $emptyLine; $messages[] = ''; $messages[] = ''; $output->writeln($messages, OutputInterface::OUTPUT_RAW | OutputInterface::VERBOSITY_QUIET); if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { $output->writeln('<comment>Exception trace:</comment>', OutputInterface::VERBOSITY_QUIET); // exception related properties $trace = $e->getTrace(); array_unshift($trace, array( 'function' => '', 'file' => $e->getFile() !== null ? $e->getFile() : 'n/a', 'line' => $e->getLine() !== null ? $e->getLine() : 'n/a', 'args' => array(), )); for ($i = 0, $count = count($trace); $i < $count; ++$i) { $class = isset($trace[$i]['class']) ? $trace[$i]['class'] : ''; $type = isset($trace[$i]['type']) ? $trace[$i]['type'] : ''; $function = $trace[$i]['function']; $file = isset($trace[$i]['file']) ? $trace[$i]['file'] : 'n/a'; $line = isset($trace[$i]['line']) ? $trace[$i]['line'] : 'n/a'; $output->writeln(sprintf(' %s%s%s() at <info>%s:%s</info>', $class, $type, $function, $file, $line), OutputInterface::VERBOSITY_QUIET); } $output->writeln('', OutputInterface::VERBOSITY_QUIET); $output->writeln('', OutputInterface::VERBOSITY_QUIET); } } while ($e = $e->getPrevious()); if (null !== $this->runningCommand) { $output->writeln(sprintf('<info>%s</info>', sprintf($this->runningCommand->getSynopsis(), $this->getName())), OutputInterface::VERBOSITY_QUIET); $output->writeln('', OutputInterface::VERBOSITY_QUIET); $output->writeln('', OutputInterface::VERBOSITY_QUIET); } } /** * Tries to figure out the terminal width in which this application runs. * * @return int|null */ protected function getTerminalWidth() { $dimensions = $this->getTerminalDimensions(); return $dimensions[0]; } /** * Tries to figure out the terminal height in which this application runs. * * @return int|null */ protected function getTerminalHeight() { $dimensions = $this->getTerminalDimensions(); return $dimensions[1]; } /** * Tries to figure out the terminal dimensions based on the current environment. * * @return array Array containing width and height */ public function getTerminalDimensions() { if ($this->terminalDimensions) { return $this->terminalDimensions; } if ('\\' === DIRECTORY_SEPARATOR) { // extract [w, H] from "wxh (WxH)" if (preg_match('/^(\d+)x\d+ \(\d+x(\d+)\)$/', trim(getenv('ANSICON')), $matches)) { return array((int) $matches[1], (int) $matches[2]); } // extract [w, h] from "wxh" if (preg_match('/^(\d+)x(\d+)$/', $this->getConsoleMode(), $matches)) { return array((int) $matches[1], (int) $matches[2]); } } if ($sttyString = $this->getSttyColumns()) { // extract [w, h] from "rows h; columns w;" if (preg_match('/rows.(\d+);.columns.(\d+);/i', $sttyString, $matches)) { return array((int) $matches[2], (int) $matches[1]); } // extract [w, h] from "; h rows; w columns" if (preg_match('/;.(\d+).rows;.(\d+).columns/i', $sttyString, $matches)) { return array((int) $matches[2], (int) $matches[1]); } } return array(null, null); } /** * Sets terminal dimensions. * * Can be useful to force terminal dimensions for functional tests. * * @param int $width The width * @param int $height The height * * @return Application The current application */ public function setTerminalDimensions($width, $height) { $this->terminalDimensions = array($width, $height); return $this; } /** * Configures the input and output instances based on the user arguments and options. * * @param InputInterface $input An InputInterface instance * @param OutputInterface $output An OutputInterface instance */ protected function configureIO(InputInterface $input, OutputInterface $output) { if (true === $input->hasParameterOption(array('--ansi'))) { $output->setDecorated(true); } elseif (true === $input->hasParameterOption(array('--no-ansi'))) { $output->setDecorated(false); } if (true === $input->hasParameterOption(array('--no-interaction', '-n'))) { $input->setInteractive(false); } elseif (function_exists('posix_isatty') && $this->getHelperSet()->has('question')) { $inputStream = $this->getHelperSet()->get('question')->getInputStream(); if (!@posix_isatty($inputStream) && false === getenv('SHELL_INTERACTIVE')) { $input->setInteractive(false); } } if (true === $input->hasParameterOption(array('--quiet', '-q'))) { $output->setVerbosity(OutputInterface::VERBOSITY_QUIET); } else { if ($input->hasParameterOption('-vvv') || $input->hasParameterOption('--verbose=3') || $input->getParameterOption('--verbose') === 3) { $output->setVerbosity(OutputInterface::VERBOSITY_DEBUG); } elseif ($input->hasParameterOption('-vv') || $input->hasParameterOption('--verbose=2') || $input->getParameterOption('--verbose') === 2) { $output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE); } elseif ($input->hasParameterOption('-v') || $input->hasParameterOption('--verbose=1') || $input->hasParameterOption('--verbose') || $input->getParameterOption('--verbose')) { $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); } } } /** * Runs the current command. * * If an event dispatcher has been attached to the application, * events are also dispatched during the life-cycle of the command. * * @param Command $command A Command instance * @param InputInterface $input An Input instance * @param OutputInterface $output An Output instance * * @return int 0 if everything went fine, or an error code * * @throws \Exception when the command being run threw an exception */ protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output) { foreach ($command->getHelperSet() as $helper) { if ($helper instanceof InputAwareInterface) { $helper->setInput($input); } } if (null === $this->dispatcher) { return $command->run($input, $output); } // bind before the console.command event, so the listeners have access to input options/arguments try { $command->mergeApplicationDefinition(); $input->bind($command->getDefinition()); } catch (ExceptionInterface $e) { // ignore invalid options/arguments for now, to allow the event listeners to customize the InputDefinition } $event = new ConsoleCommandEvent($command, $input, $output); $this->dispatcher->dispatch(ConsoleEvents::COMMAND, $event); if ($event->commandShouldRun()) { try { $exitCode = $command->run($input, $output); } catch (\Exception $e) { $event = new ConsoleExceptionEvent($command, $input, $output, $e, $e->getCode()); $this->dispatcher->dispatch(ConsoleEvents::EXCEPTION, $event); $e = $event->getException(); $event = new ConsoleTerminateEvent($command, $input, $output, $e->getCode()); $this->dispatcher->dispatch(ConsoleEvents::TERMINATE, $event); throw $e; } } else { $exitCode = ConsoleCommandEvent::RETURN_CODE_DISABLED; } $event = new ConsoleTerminateEvent($command, $input, $output, $exitCode); $this->dispatcher->dispatch(ConsoleEvents::TERMINATE, $event); return $event->getExitCode(); } /** * Gets the name of the command based on input. * * @param InputInterface $input The input interface * * @return string The command name */ protected function getCommandName(InputInterface $input) { return $input->getFirstArgument(); } /** * Gets the default input definition. * * @return InputDefinition An InputDefinition instance */ protected function getDefaultInputDefinition() { return new InputDefinition(array( new InputArgument('command', InputArgument::REQUIRED, 'The command to execute'), new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display this help message'), new InputOption('--quiet', '-q', InputOption::VALUE_NONE, 'Do not output any message'), new InputOption('--verbose', '-v|vv|vvv', InputOption::VALUE_NONE, 'Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug'), new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display this application version'), new InputOption('--ansi', '', InputOption::VALUE_NONE, 'Force ANSI output'), new InputOption('--no-ansi', '', InputOption::VALUE_NONE, 'Disable ANSI output'), new InputOption('--no-interaction', '-n', InputOption::VALUE_NONE, 'Do not ask any interactive question'), )); } /** * Gets the default commands that should always be available. * * @return Command[] An array of default Command instances */ protected function getDefaultCommands() { return array(new HelpCommand(), new ListCommand()); } /** * Gets the default helper set with the helpers that should always be available. * * @return HelperSet A HelperSet instance */ protected function getDefaultHelperSet() { return new HelperSet(array( new FormatterHelper(), new DialogHelper(false), new ProgressHelper(false), new TableHelper(false), new DebugFormatterHelper(), new ProcessHelper(), new QuestionHelper(), )); } /** * Runs and parses stty -a if it's available, suppressing any error output. * * @return string */ private function getSttyColumns() { if (!function_exists('proc_open')) { return; } $descriptorspec = array(1 => array('pipe', 'w'), 2 => array('pipe', 'w')); $process = proc_open('stty -a | grep columns', $descriptorspec, $pipes, null, null, array('suppress_errors' => true)); if (is_resource($process)) { $info = stream_get_contents($pipes[1]); fclose($pipes[1]); fclose($pipes[2]); proc_close($process); return $info; } } /** * Runs and parses mode CON if it's available, suppressing any error output. * * @return string <width>x<height> or null if it could not be parsed */ private function getConsoleMode() { if (!function_exists('proc_open')) { return; } $descriptorspec = array(1 => array('pipe', 'w'), 2 => array('pipe', 'w')); $process = proc_open('mode CON', $descriptorspec, $pipes, null, null, array('suppress_errors' => true)); if (is_resource($process)) { $info = stream_get_contents($pipes[1]); fclose($pipes[1]); fclose($pipes[2]); proc_close($process); if (preg_match('/--------+\r?\n.+?(\d+)\r?\n.+?(\d+)\r?\n/', $info, $matches)) { return $matches[2].'x'.$matches[1]; } } } /** * Returns abbreviated suggestions in string format. * * @param array $abbrevs Abbreviated suggestions to convert * * @return string A formatted string of abbreviated suggestions */ private function getAbbreviationSuggestions($abbrevs) { return sprintf('%s, %s%s', $abbrevs[0], $abbrevs[1], count($abbrevs) > 2 ? sprintf(' and %d more', count($abbrevs) - 2) : ''); } /** * Returns the namespace part of the command name. * * This method is not part of public API and should not be used directly. * * @param string $name The full name of the command * @param string $limit The maximum number of parts of the namespace * * @return string The namespace of the command */ public function extractNamespace($name, $limit = null) { $parts = explode(':', $name); array_pop($parts); return implode(':', null === $limit ? $parts : array_slice($parts, 0, $limit)); } /** * Finds alternative of $name among $collection, * if nothing is found in $collection, try in $abbrevs. * * @param string $name The string * @param array|\Traversable $collection The collection * * @return array A sorted array of similar string */ private function findAlternatives($name, $collection) { $threshold = 1e3; $alternatives = array(); $collectionParts = array(); foreach ($collection as $item) { $collectionParts[$item] = explode(':', $item); } foreach (explode(':', $name) as $i => $subname) { foreach ($collectionParts as $collectionName => $parts) { $exists = isset($alternatives[$collectionName]); if (!isset($parts[$i]) && $exists) { $alternatives[$collectionName] += $threshold; continue; } elseif (!isset($parts[$i])) { continue; } $lev = levenshtein($subname, $parts[$i]); if ($lev <= strlen($subname) / 3 || '' !== $subname && false !== strpos($parts[$i], $subname)) { $alternatives[$collectionName] = $exists ? $alternatives[$collectionName] + $lev : $lev; } elseif ($exists) { $alternatives[$collectionName] += $threshold; } } } foreach ($collection as $item) { $lev = levenshtein($name, $item); if ($lev <= strlen($name) / 3 || false !== strpos($item, $name)) { $alternatives[$item] = isset($alternatives[$item]) ? $alternatives[$item] - $lev : $lev; } } $alternatives = array_filter($alternatives, function ($lev) use ($threshold) { return $lev < 2 * $threshold; }); asort($alternatives); return array_keys($alternatives); } /** * Sets the default Command name. * * @param string $commandName The Command name */ public function setDefaultCommand($commandName) { $this->defaultCommand = $commandName; } private function stringWidth($string) { if (!function_exists('mb_strwidth')) { return strlen($string); } if (false === $encoding = mb_detect_encoding($string)) { return strlen($string); } return mb_strwidth($string, $encoding); } private function splitStringByWidth($string, $width) { // str_split is not suitable for multi-byte characters, we should use preg_split to get char array properly. // additionally, array_slice() is not enough as some character has doubled width. // we need a function to split string not by character count but by string width if (!function_exists('mb_strwidth')) { return str_split($string, $width); } if (false === $encoding = mb_detect_encoding($string)) { return str_split($string, $width); } $utf8String = mb_convert_encoding($string, 'utf8', $encoding); $lines = array(); $line = ''; foreach (preg_split('//u', $utf8String) as $char) { // test if $char could be appended to current line if (mb_strwidth($line.$char, 'utf8') <= $width) { $line .= $char; continue; } // if not, push current line to array and make new line $lines[] = str_pad($line, $width); $line = $char; } if ('' !== $line) { $lines[] = count($lines) ? str_pad($line, $width) : $line; } mb_convert_variables($encoding, 'utf8', $lines); return $lines; } /** * Returns all namespaces of the command name. * * @param string $name The full name of the command * * @return array The namespaces of the command */ private function extractAllNamespaces($name) { // -1 as third argument is needed to skip the command short name when exploding $parts = explode(':', $name, -1); $namespaces = array(); foreach ($parts as $part) { if (count($namespaces)) { $namespaces[] = end($namespaces).':'.$part; } else { $namespaces[] = $part; } } return $namespaces; } }
{ "content_hash": "fac42fdf35f4b9162fe076c36e6a30bc", "timestamp": "", "source": "github", "line_count": 1143, "max_line_length": 198, "avg_line_length": 33.58792650918635, "alnum_prop": 0.5640123987392879, "repo_name": "linovarona/symfony", "id": "71ac6aed41ddcf59efff5e4906541aa0bab38ebd", "size": "38620", "binary": false, "copies": "3", "ref": "refs/heads/2.8", "path": "src/Symfony/Component/Console/Application.php", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "8656" }, { "name": "CSS", "bytes": "10309" }, { "name": "HTML", "bytes": "254081" }, { "name": "PHP", "bytes": "11994330" }, { "name": "Shell", "bytes": "643" }, { "name": "TypeScript", "bytes": "195" } ], "symlink_target": "" }
namespace Kvasir { //Analog comparators ACMP0/1/2/3 namespace AcmpCtrl{ ///<Comparator block control register using Addr = Register::Address<0x40008000,0x00000000,0x00000000,unsigned>; ///Reserved. constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,0),Register::ReadWriteAccess,unsigned> reserved{}; ///Selects the which comparators set and reset the ROSC output. enum class RoscctlVal { acmp1Acmp0=0x00000000, ///<ACMP1/ACMP0. The ROSC output is set by ACMP1 and reset by ACMP0. acmp0Acmp1=0x00000001, ///<ACMP0/ACMP1. The ROSC output is set by ACMP0 and reset by ACMP1. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(8,8),Register::ReadWriteAccess,RoscctlVal> roscctl{}; namespace RoscctlValC{ constexpr Register::FieldValue<decltype(roscctl)::Type,RoscctlVal::acmp1Acmp0> acmp1Acmp0{}; constexpr Register::FieldValue<decltype(roscctl)::Type,RoscctlVal::acmp0Acmp1> acmp0Acmp1{}; } ///Selects the reset source for the ROSC output. enum class ExtresetVal { internal=0x00000000, ///<Internal. The ROSC output is reset by the internal chip reset. fromPinRoscReset=0x00000001, ///<From pin ROSC_RESET. The ROSC output is reset by the ROSC_RESET input. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(9,9),Register::ReadWriteAccess,ExtresetVal> extReset{}; namespace ExtresetValC{ constexpr Register::FieldValue<decltype(extReset)::Type,ExtresetVal::internal> internal{}; constexpr Register::FieldValue<decltype(extReset)::Type,ExtresetVal::fromPinRoscReset> fromPinRoscReset{}; } ///Reserved. constexpr Register::FieldLocation<Addr,Register::maskFromRange(31,10),Register::ReadWriteAccess,unsigned> reserved{}; } namespace AcmpCmp0{ ///<Comparator 0 source control using Addr = Register::Address<0x40008004,0x00000000,0x00000000,unsigned>; ///Comparator enable control. enum class EnVal { disabled=0x00000000, ///<Disabled. Comparator disabled. enabled=0x00000001, ///<Enabled. Comparator is enabled. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(0,0),Register::ReadWriteAccess,EnVal> en{}; namespace EnValC{ constexpr Register::FieldValue<decltype(en)::Type,EnVal::disabled> disabled{}; constexpr Register::FieldValue<decltype(en)::Type,EnVal::enabled> enabled{}; } ///Reserved. constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,1),Register::ReadWriteAccess,unsigned> reserved{}; ///Interrupt enable. enum class IntenVal { disabled=0x00000000, ///<Disabled. Interrupts are disabled.. enabled=0x00000001, ///<Enabled. Interrupts are enabled.. Must set to 1 for interrupts to propagate to the NVIC and start-up logic. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(2,2),Register::ReadWriteAccess,IntenVal> inten{}; namespace IntenValC{ constexpr Register::FieldValue<decltype(inten)::Type,IntenVal::disabled> disabled{}; constexpr Register::FieldValue<decltype(inten)::Type,IntenVal::enabled> enabled{}; } ///Comparator status. This bit reflects the comparator output constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,3),Register::ReadWriteAccess,unsigned> stat{}; ///VM input select. enum class VmVal { vrefDivider0=0x00000000, ///<Vref divider 0. acmpI1=0x00000001, ///<ACMP_I1. acmpI2=0x00000002, ///<ACMP_I2. acmp0I3=0x00000003, ///<ACMP0_I3. acmp0I4=0x00000004, ///<ACMP0_I4. internal0=0x00000005, ///<Internal 0.9 V band gap reference. tempSensor=0x00000006, ///<Temp sensor. adc02=0x00000007, ///<ADC0_2. Input for ADC0 channel 2. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(6,4),Register::ReadWriteAccess,VmVal> vm{}; namespace VmValC{ constexpr Register::FieldValue<decltype(vm)::Type,VmVal::vrefDivider0> vrefDivider0{}; constexpr Register::FieldValue<decltype(vm)::Type,VmVal::acmpI1> acmpI1{}; constexpr Register::FieldValue<decltype(vm)::Type,VmVal::acmpI2> acmpI2{}; constexpr Register::FieldValue<decltype(vm)::Type,VmVal::acmp0I3> acmp0I3{}; constexpr Register::FieldValue<decltype(vm)::Type,VmVal::acmp0I4> acmp0I4{}; constexpr Register::FieldValue<decltype(vm)::Type,VmVal::internal0> internal0{}; constexpr Register::FieldValue<decltype(vm)::Type,VmVal::tempSensor> tempSensor{}; constexpr Register::FieldValue<decltype(vm)::Type,VmVal::adc02> adc02{}; } ///Reserved. constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,7),Register::ReadWriteAccess,unsigned> reserved{}; ///VP input select. enum class VpVal { vrefDivider0=0x00000000, ///<Vref divider 0. acmpI1=0x00000001, ///<ACMP_I1. acmpI2=0x00000002, ///<ACMP_I2. acmp0I3=0x00000003, ///<ACMP0_I3. acmp0I4=0x00000004, ///<ACMP0_I4. internal0=0x00000005, ///<Internal 0.9 V band gap reference. tempSensor=0x00000006, ///<Temp sensor. adc02=0x00000007, ///<ADC0_2. Input for ADC0 channel 2. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(10,8),Register::ReadWriteAccess,VpVal> vp{}; namespace VpValC{ constexpr Register::FieldValue<decltype(vp)::Type,VpVal::vrefDivider0> vrefDivider0{}; constexpr Register::FieldValue<decltype(vp)::Type,VpVal::acmpI1> acmpI1{}; constexpr Register::FieldValue<decltype(vp)::Type,VpVal::acmpI2> acmpI2{}; constexpr Register::FieldValue<decltype(vp)::Type,VpVal::acmp0I3> acmp0I3{}; constexpr Register::FieldValue<decltype(vp)::Type,VpVal::acmp0I4> acmp0I4{}; constexpr Register::FieldValue<decltype(vp)::Type,VpVal::internal0> internal0{}; constexpr Register::FieldValue<decltype(vp)::Type,VpVal::tempSensor> tempSensor{}; constexpr Register::FieldValue<decltype(vp)::Type,VpVal::adc02> adc02{}; } ///Reserved. constexpr Register::FieldLocation<Addr,Register::maskFromRange(12,11),Register::ReadWriteAccess,unsigned> reserved{}; ///Hysteresis control. When enabled, hysteresis determines the difference required between the comparator inputs before the comparator output switches. The difference must be in the direction opposite of the current comparator output. enum class HysVal { hysteresisIsTurned=0x00000000, ///<Hysteresis is turned off, comparator output will change as the input voltages cross. hysteresisEq5Mv=0x00000001, ///<Hysteresis = 5 mV. hysteresisEq10Mv=0x00000002, ///<Hysteresis = 10 mV. hysteresisEq15Mv=0x00000003, ///<Hysteresis = 15 mV. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(14,13),Register::ReadWriteAccess,HysVal> hys{}; namespace HysValC{ constexpr Register::FieldValue<decltype(hys)::Type,HysVal::hysteresisIsTurned> hysteresisIsTurned{}; constexpr Register::FieldValue<decltype(hys)::Type,HysVal::hysteresisEq5Mv> hysteresisEq5Mv{}; constexpr Register::FieldValue<decltype(hys)::Type,HysVal::hysteresisEq10Mv> hysteresisEq10Mv{}; constexpr Register::FieldValue<decltype(hys)::Type,HysVal::hysteresisEq15Mv> hysteresisEq15Mv{}; } ///Selects the polarity of the CMP output for purposes of generating level interrupts. enum class IntpolVal { notInverted=0x00000000, ///<Not inverted. The output is used as-is for generating interrupts. inverted=0x00000001, ///<Inverted. The output is used inverted for generating interrupts. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,15),Register::ReadWriteAccess,IntpolVal> intpol{}; namespace IntpolValC{ constexpr Register::FieldValue<decltype(intpol)::Type,IntpolVal::notInverted> notInverted{}; constexpr Register::FieldValue<decltype(intpol)::Type,IntpolVal::inverted> inverted{}; } ///Select interrupt type. enum class InttypeVal { edge=0x00000000, ///<Edge. Comparator interrupt is edge triggered. level=0x00000001, ///<Level. Comparator interrupt is level triggered. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(16,16),Register::ReadWriteAccess,InttypeVal> inttype{}; namespace InttypeValC{ constexpr Register::FieldValue<decltype(inttype)::Type,InttypeVal::edge> edge{}; constexpr Register::FieldValue<decltype(inttype)::Type,InttypeVal::level> level{}; } ///Select edge triggered interrupt to be active on either high or low transitions, when INTTYPE = 0. enum class IntedgeVal { falling=0x00000000, ///<Falling. Comparator interrupt is active on falling edges. rising=0x00000001, ///<Rising. Comparator interrupt is active on rising edges. bothEdges=0x00000002, ///<Both edges. Comparator Interrupt is active on both edges. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(18,17),Register::ReadWriteAccess,IntedgeVal> intedge{}; namespace IntedgeValC{ constexpr Register::FieldValue<decltype(intedge)::Type,IntedgeVal::falling> falling{}; constexpr Register::FieldValue<decltype(intedge)::Type,IntedgeVal::rising> rising{}; constexpr Register::FieldValue<decltype(intedge)::Type,IntedgeVal::bothEdges> bothEdges{}; } ///Interrupt flag. enum class IntflagVal { notPending=0x00000000, ///<Not pending. The Comparator interrupt is not pending. pending=0x00000001, ///<Pending. The Comparator interrupt is pending. Writing a 1 to this bit clears the flag. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(19,19),Register::ReadWriteAccess,IntflagVal> intflag{}; namespace IntflagValC{ constexpr Register::FieldValue<decltype(intflag)::Type,IntflagVal::notPending> notPending{}; constexpr Register::FieldValue<decltype(intflag)::Type,IntflagVal::pending> pending{}; } ///Voltage ladder enable for comparator 0. enum class VladenVal { disabled=0x00000000, ///<Disabled. The Comparator voltage ladder is disabled. enabled=0x00000001, ///<Enabled. The Comparator voltage ladder is enabled. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(20,20),Register::ReadWriteAccess,VladenVal> vladen{}; namespace VladenValC{ constexpr Register::FieldValue<decltype(vladen)::Type,VladenVal::disabled> disabled{}; constexpr Register::FieldValue<decltype(vladen)::Type,VladenVal::enabled> enabled{}; } ///Reserved. constexpr Register::FieldLocation<Addr,Register::maskFromRange(21,21),Register::ReadWriteAccess,unsigned> reserved{}; ///Voltage reference select for comparator 0 voltage ladder. enum class VladrefVal { vrefCmpPin=0x00000000, ///<VREF_CMP pin. vddaPin=0x00000001, ///<VDDA pin. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(22,22),Register::ReadWriteAccess,VladrefVal> vladref{}; namespace VladrefValC{ constexpr Register::FieldValue<decltype(vladref)::Type,VladrefVal::vrefCmpPin> vrefCmpPin{}; constexpr Register::FieldValue<decltype(vladref)::Type,VladrefVal::vddaPin> vddaPin{}; } ///Reserved. constexpr Register::FieldLocation<Addr,Register::maskFromRange(23,23),Register::ReadWriteAccess,unsigned> reserved{}; ///Voltage ladder value for comparator 0. The reference voltage Vref depends on the setting of VLADREF (either VDD(3V3) or voltage on pin VREF_CMP). 00000 = Vss. 00001 = 1 x Vref / 31. 00010 = 2 x Vref / 31. ... 11111 = Vref constexpr Register::FieldLocation<Addr,Register::maskFromRange(28,24),Register::ReadWriteAccess,unsigned> vsel{}; ///Configure the propagation delay. A shorter propagation delay means higher power consumption. Use values from 0x0 (shortest propagation delay and highest power consumption) to 0x2 (longest propagation delay and lowest power consumption). See the data sheet for details. constexpr Register::FieldLocation<Addr,Register::maskFromRange(30,29),Register::ReadWriteAccess,unsigned> dly{}; ///Reserved. constexpr Register::FieldLocation<Addr,Register::maskFromRange(31,31),Register::ReadWriteAccess,unsigned> reserved{}; } namespace AcmpCmp1{ ///<Comparator 1 source control using Addr = Register::Address<0x4000800c,0x00000000,0x00000000,unsigned>; ///Comparator enable control. enum class EnVal { disabled=0x00000000, ///<Disabled. Comparator disabled. enabled=0x00000001, ///<Enabled. Comparator is enabled. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(0,0),Register::ReadWriteAccess,EnVal> en{}; namespace EnValC{ constexpr Register::FieldValue<decltype(en)::Type,EnVal::disabled> disabled{}; constexpr Register::FieldValue<decltype(en)::Type,EnVal::enabled> enabled{}; } ///Reserved. constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,1),Register::ReadWriteAccess,unsigned> reserved{}; ///Interrupt enable. enum class IntenVal { disabled=0x00000000, ///<Disabled. Interrupts are disabled.. enabled=0x00000001, ///<Enabled. Interrupts are enabled.. Must set to 1 for interrupts to propagate to the NVIC and start-up logic. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(2,2),Register::ReadWriteAccess,IntenVal> inten{}; namespace IntenValC{ constexpr Register::FieldValue<decltype(inten)::Type,IntenVal::disabled> disabled{}; constexpr Register::FieldValue<decltype(inten)::Type,IntenVal::enabled> enabled{}; } ///Comparator status. This bit reflects the comparator output constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,3),Register::ReadWriteAccess,unsigned> stat{}; ///VM input select. enum class VmVal { vrefDivider1=0x00000000, ///<Vref divider 1. acmpI1=0x00000001, ///<ACMP_I1. acmpI2=0x00000002, ///<ACMP_I2. acmp1I3=0x00000003, ///<ACMP1_I3. acmp1I4=0x00000004, ///<ACMP1_I4. internal0=0x00000005, ///<Internal 0.9 V band gap reference. adc01=0x00000006, ///<ADC0_1. Input for ADC0 channel 1. adc03=0x00000007, ///<ADC0_3. Input for ADC0 channel 3. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(6,4),Register::ReadWriteAccess,VmVal> vm{}; namespace VmValC{ constexpr Register::FieldValue<decltype(vm)::Type,VmVal::vrefDivider1> vrefDivider1{}; constexpr Register::FieldValue<decltype(vm)::Type,VmVal::acmpI1> acmpI1{}; constexpr Register::FieldValue<decltype(vm)::Type,VmVal::acmpI2> acmpI2{}; constexpr Register::FieldValue<decltype(vm)::Type,VmVal::acmp1I3> acmp1I3{}; constexpr Register::FieldValue<decltype(vm)::Type,VmVal::acmp1I4> acmp1I4{}; constexpr Register::FieldValue<decltype(vm)::Type,VmVal::internal0> internal0{}; constexpr Register::FieldValue<decltype(vm)::Type,VmVal::adc01> adc01{}; constexpr Register::FieldValue<decltype(vm)::Type,VmVal::adc03> adc03{}; } ///Reserved. constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,7),Register::ReadWriteAccess,unsigned> reserved{}; ///VP input select. enum class VpVal { vrefDivider1=0x00000000, ///<Vref divider 1. acmpI1=0x00000001, ///<ACMP_I1. acmpI2=0x00000002, ///<ACMP_I2. acmp1I3=0x00000003, ///<ACMP1_I3. acmp1I4=0x00000004, ///<ACMP1_I4. internal0=0x00000005, ///<Internal 0.9 V band gap reference. adc01=0x00000006, ///<ADC0_1. Input for ADC0 channel 1. adc03=0x00000007, ///<ADC0_3. Input for ADC0 channel 3. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(10,8),Register::ReadWriteAccess,VpVal> vp{}; namespace VpValC{ constexpr Register::FieldValue<decltype(vp)::Type,VpVal::vrefDivider1> vrefDivider1{}; constexpr Register::FieldValue<decltype(vp)::Type,VpVal::acmpI1> acmpI1{}; constexpr Register::FieldValue<decltype(vp)::Type,VpVal::acmpI2> acmpI2{}; constexpr Register::FieldValue<decltype(vp)::Type,VpVal::acmp1I3> acmp1I3{}; constexpr Register::FieldValue<decltype(vp)::Type,VpVal::acmp1I4> acmp1I4{}; constexpr Register::FieldValue<decltype(vp)::Type,VpVal::internal0> internal0{}; constexpr Register::FieldValue<decltype(vp)::Type,VpVal::adc01> adc01{}; constexpr Register::FieldValue<decltype(vp)::Type,VpVal::adc03> adc03{}; } ///Reserved. constexpr Register::FieldLocation<Addr,Register::maskFromRange(12,11),Register::ReadWriteAccess,unsigned> reserved{}; ///Hysteresis control. When enabled, hysteresis determines the difference required between the comparator inputs before the comparator output switches. The difference must be in the direction opposite of the current comparator output. enum class HysVal { hysteresisIsTurned=0x00000000, ///<Hysteresis is turned off, comparator output will change as the input voltages cross. hysteresisEq5Mv=0x00000001, ///<Hysteresis = 5 mV. hysteresisEq10Mv=0x00000002, ///<Hysteresis = 10 mV. hysteresisEq15Mv=0x00000003, ///<Hysteresis = 15 mV. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(14,13),Register::ReadWriteAccess,HysVal> hys{}; namespace HysValC{ constexpr Register::FieldValue<decltype(hys)::Type,HysVal::hysteresisIsTurned> hysteresisIsTurned{}; constexpr Register::FieldValue<decltype(hys)::Type,HysVal::hysteresisEq5Mv> hysteresisEq5Mv{}; constexpr Register::FieldValue<decltype(hys)::Type,HysVal::hysteresisEq10Mv> hysteresisEq10Mv{}; constexpr Register::FieldValue<decltype(hys)::Type,HysVal::hysteresisEq15Mv> hysteresisEq15Mv{}; } ///Selects the polarity of the CMP output for purposes of generating level interrupts. enum class IntpolVal { notInverted=0x00000000, ///<Not inverted. The output is used as-is for generating interrupts. inverted=0x00000001, ///<Inverted. The output is used inverted for generating interrupts. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,15),Register::ReadWriteAccess,IntpolVal> intpol{}; namespace IntpolValC{ constexpr Register::FieldValue<decltype(intpol)::Type,IntpolVal::notInverted> notInverted{}; constexpr Register::FieldValue<decltype(intpol)::Type,IntpolVal::inverted> inverted{}; } ///Select interrupt type. enum class InttypeVal { edge=0x00000000, ///<Edge. Comparator interrupt is edge triggered. level=0x00000001, ///<Level. Comparator interrupt is level triggered. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(16,16),Register::ReadWriteAccess,InttypeVal> inttype{}; namespace InttypeValC{ constexpr Register::FieldValue<decltype(inttype)::Type,InttypeVal::edge> edge{}; constexpr Register::FieldValue<decltype(inttype)::Type,InttypeVal::level> level{}; } ///Select edge triggered interrupt to be active on either high or low transitions, when INTTYPE = 0. enum class IntedgeVal { falling=0x00000000, ///<Falling. Comparator interrupt is active on falling edges. rising=0x00000001, ///<Rising. Comparator interrupt is active on rising edges. bothEdges=0x00000002, ///<Both edges. Comparator Interrupt is active on both edges. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(18,17),Register::ReadWriteAccess,IntedgeVal> intedge{}; namespace IntedgeValC{ constexpr Register::FieldValue<decltype(intedge)::Type,IntedgeVal::falling> falling{}; constexpr Register::FieldValue<decltype(intedge)::Type,IntedgeVal::rising> rising{}; constexpr Register::FieldValue<decltype(intedge)::Type,IntedgeVal::bothEdges> bothEdges{}; } ///Interrupt flag. enum class IntflagVal { notPending=0x00000000, ///<Not pending. The Comparator interrupt is not pending. pending=0x00000001, ///<Pending. The Comparator interrupt is pending. Writing a 1 to this bit clears the flag. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(19,19),Register::ReadWriteAccess,IntflagVal> intflag{}; namespace IntflagValC{ constexpr Register::FieldValue<decltype(intflag)::Type,IntflagVal::notPending> notPending{}; constexpr Register::FieldValue<decltype(intflag)::Type,IntflagVal::pending> pending{}; } ///Voltage ladder enable for comparator 1. enum class VladenVal { disabled=0x00000000, ///<Disabled. The Comparator voltage ladder is disabled. enabled=0x00000001, ///<Enabled. The Comparator voltage ladder is enabled. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(20,20),Register::ReadWriteAccess,VladenVal> vladen{}; namespace VladenValC{ constexpr Register::FieldValue<decltype(vladen)::Type,VladenVal::disabled> disabled{}; constexpr Register::FieldValue<decltype(vladen)::Type,VladenVal::enabled> enabled{}; } ///Reserved. constexpr Register::FieldLocation<Addr,Register::maskFromRange(21,21),Register::ReadWriteAccess,unsigned> reserved{}; ///Voltage reference select for comparator 1 voltage ladder. enum class VladrefVal { vrefCmpPin=0x00000000, ///<VREF_CMP pin. vddaPin=0x00000001, ///<VDDA pin. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(22,22),Register::ReadWriteAccess,VladrefVal> vladref{}; namespace VladrefValC{ constexpr Register::FieldValue<decltype(vladref)::Type,VladrefVal::vrefCmpPin> vrefCmpPin{}; constexpr Register::FieldValue<decltype(vladref)::Type,VladrefVal::vddaPin> vddaPin{}; } ///Reserved. constexpr Register::FieldLocation<Addr,Register::maskFromRange(23,23),Register::ReadWriteAccess,unsigned> reserved{}; ///Voltage ladder value for comparator 1. The reference voltage Vref depends on the setting of VLADREF (either VDD(3V3) or voltage on pin VREF_CMP). 00000 = Vss. 00001 = 1 x Vref / 31. 00010 = 2 x Vref / 31. ... 11111 = Vref constexpr Register::FieldLocation<Addr,Register::maskFromRange(28,24),Register::ReadWriteAccess,unsigned> vsel{}; ///Configure the propagation delay. A shorter propagation delay means higher power consumption. Use values from 0x0 (shortest propagation delay and highest power consumption) to 0x2 (longest propagation delay and lowest power consumption). See the data sheet for details. constexpr Register::FieldLocation<Addr,Register::maskFromRange(30,29),Register::ReadWriteAccess,unsigned> dly{}; ///Reserved. constexpr Register::FieldLocation<Addr,Register::maskFromRange(31,31),Register::ReadWriteAccess,unsigned> reserved{}; } namespace AcmpCmp2{ ///<Comparator 2 source control using Addr = Register::Address<0x40008014,0x00000000,0x00000000,unsigned>; ///Comparator enable control. enum class EnVal { disabled=0x00000000, ///<Disabled. Comparator disabled. enabled=0x00000001, ///<Enabled. Comparator is enabled. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(0,0),Register::ReadWriteAccess,EnVal> en{}; namespace EnValC{ constexpr Register::FieldValue<decltype(en)::Type,EnVal::disabled> disabled{}; constexpr Register::FieldValue<decltype(en)::Type,EnVal::enabled> enabled{}; } ///Reserved. constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,1),Register::ReadWriteAccess,unsigned> reserved{}; ///Interrupt enable. enum class IntenVal { disabled=0x00000000, ///<Disabled. Interrupts are disabled.. enabled=0x00000001, ///<Enabled. Interrupts are enabled.. Must set to 1 for interrupts to propagate to the NVIC and start-up logic. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(2,2),Register::ReadWriteAccess,IntenVal> inten{}; namespace IntenValC{ constexpr Register::FieldValue<decltype(inten)::Type,IntenVal::disabled> disabled{}; constexpr Register::FieldValue<decltype(inten)::Type,IntenVal::enabled> enabled{}; } ///Comparator status. This bit reflects the comparator output constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,3),Register::ReadWriteAccess,unsigned> stat{}; ///VM input select. enum class VmVal { vrefDivider2=0x00000000, ///<Vref divider 2. acmpI1=0x00000001, ///<ACMP_I1. acmpI2=0x00000002, ///<ACMP_I2. acmp2I3=0x00000003, ///<ACMP2_I3. acmp2I4=0x00000004, ///<ACMP2_I4. internal0=0x00000005, ///<Internal 0.9 V band gap reference. adc00=0x00000006, ///<ADC0_0. Input for ADC0 channel 0. adc12=0x00000007, ///<ADC1_2. Input for ADC1 channel 2. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(6,4),Register::ReadWriteAccess,VmVal> vm{}; namespace VmValC{ constexpr Register::FieldValue<decltype(vm)::Type,VmVal::vrefDivider2> vrefDivider2{}; constexpr Register::FieldValue<decltype(vm)::Type,VmVal::acmpI1> acmpI1{}; constexpr Register::FieldValue<decltype(vm)::Type,VmVal::acmpI2> acmpI2{}; constexpr Register::FieldValue<decltype(vm)::Type,VmVal::acmp2I3> acmp2I3{}; constexpr Register::FieldValue<decltype(vm)::Type,VmVal::acmp2I4> acmp2I4{}; constexpr Register::FieldValue<decltype(vm)::Type,VmVal::internal0> internal0{}; constexpr Register::FieldValue<decltype(vm)::Type,VmVal::adc00> adc00{}; constexpr Register::FieldValue<decltype(vm)::Type,VmVal::adc12> adc12{}; } ///Reserved. constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,7),Register::ReadWriteAccess,unsigned> reserved{}; ///VP input select. enum class VpVal { vrefDivider2=0x00000000, ///<Vref divider 2. acmpI1=0x00000001, ///<ACMP_I1. acmpI2=0x00000002, ///<ACMP_I2. acmp2I3=0x00000003, ///<ACMP2_I3. acmp2I4=0x00000004, ///<ACMP2_I4. internal0=0x00000005, ///<Internal 0.9 V band gap reference. adc00=0x00000006, ///<ADC0_0. Input for ADC0 channel 0. adc12=0x00000007, ///<ADC1_2. Input for ADC1 channel 2. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(10,8),Register::ReadWriteAccess,VpVal> vp{}; namespace VpValC{ constexpr Register::FieldValue<decltype(vp)::Type,VpVal::vrefDivider2> vrefDivider2{}; constexpr Register::FieldValue<decltype(vp)::Type,VpVal::acmpI1> acmpI1{}; constexpr Register::FieldValue<decltype(vp)::Type,VpVal::acmpI2> acmpI2{}; constexpr Register::FieldValue<decltype(vp)::Type,VpVal::acmp2I3> acmp2I3{}; constexpr Register::FieldValue<decltype(vp)::Type,VpVal::acmp2I4> acmp2I4{}; constexpr Register::FieldValue<decltype(vp)::Type,VpVal::internal0> internal0{}; constexpr Register::FieldValue<decltype(vp)::Type,VpVal::adc00> adc00{}; constexpr Register::FieldValue<decltype(vp)::Type,VpVal::adc12> adc12{}; } ///Reserved. constexpr Register::FieldLocation<Addr,Register::maskFromRange(12,11),Register::ReadWriteAccess,unsigned> reserved{}; ///Hysteresis control. When enabled, hysteresis determines the difference required between the comparator inputs before the comparator output switches. The difference must be in the direction opposite of the current comparator output. enum class HysVal { hysteresisIsTurned=0x00000000, ///<Hysteresis is turned off, comparator output will change as the input voltages cross. hysteresisEq5Mv=0x00000001, ///<Hysteresis = 5 mV. hysteresisEq10Mv=0x00000002, ///<Hysteresis = 10 mV. hysteresisEq15Mv=0x00000003, ///<Hysteresis = 15 mV. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(14,13),Register::ReadWriteAccess,HysVal> hys{}; namespace HysValC{ constexpr Register::FieldValue<decltype(hys)::Type,HysVal::hysteresisIsTurned> hysteresisIsTurned{}; constexpr Register::FieldValue<decltype(hys)::Type,HysVal::hysteresisEq5Mv> hysteresisEq5Mv{}; constexpr Register::FieldValue<decltype(hys)::Type,HysVal::hysteresisEq10Mv> hysteresisEq10Mv{}; constexpr Register::FieldValue<decltype(hys)::Type,HysVal::hysteresisEq15Mv> hysteresisEq15Mv{}; } ///Selects the polarity of the CMP output for purposes of generating level interrupts. enum class IntpolVal { notInverted=0x00000000, ///<Not inverted. The output is used as-is for generating interrupts. inverted=0x00000001, ///<Inverted. The output is used inverted for generating interrupts. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,15),Register::ReadWriteAccess,IntpolVal> intpol{}; namespace IntpolValC{ constexpr Register::FieldValue<decltype(intpol)::Type,IntpolVal::notInverted> notInverted{}; constexpr Register::FieldValue<decltype(intpol)::Type,IntpolVal::inverted> inverted{}; } ///Select interrupt type. enum class InttypeVal { edge=0x00000000, ///<Edge. Comparator interrupt is edge triggered. level=0x00000001, ///<Level. Comparator interrupt is level triggered. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(16,16),Register::ReadWriteAccess,InttypeVal> inttype{}; namespace InttypeValC{ constexpr Register::FieldValue<decltype(inttype)::Type,InttypeVal::edge> edge{}; constexpr Register::FieldValue<decltype(inttype)::Type,InttypeVal::level> level{}; } ///Select edge triggered interrupt to be active on either high or low transitions, when INTTYPE = 0. enum class IntedgeVal { falling=0x00000000, ///<Falling. Comparator interrupt is active on falling edges. rising=0x00000001, ///<Rising. Comparator interrupt is active on rising edges. bothEdges=0x00000002, ///<Both edges. Comparator Interrupt is active on both edges. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(18,17),Register::ReadWriteAccess,IntedgeVal> intedge{}; namespace IntedgeValC{ constexpr Register::FieldValue<decltype(intedge)::Type,IntedgeVal::falling> falling{}; constexpr Register::FieldValue<decltype(intedge)::Type,IntedgeVal::rising> rising{}; constexpr Register::FieldValue<decltype(intedge)::Type,IntedgeVal::bothEdges> bothEdges{}; } ///Interrupt flag. enum class IntflagVal { notPending=0x00000000, ///<Not pending. The Comparator interrupt is not pending. pending=0x00000001, ///<Pending. The Comparator interrupt is pending. Writing a 1 to this bit clears the flag. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(19,19),Register::ReadWriteAccess,IntflagVal> intflag{}; namespace IntflagValC{ constexpr Register::FieldValue<decltype(intflag)::Type,IntflagVal::notPending> notPending{}; constexpr Register::FieldValue<decltype(intflag)::Type,IntflagVal::pending> pending{}; } ///Voltage ladder enable for comparator 2. enum class VladenVal { disabled=0x00000000, ///<Disabled. The Comparator voltage ladder is disabled. enabled=0x00000001, ///<Enabled. The Comparator voltage ladder is enabled. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(20,20),Register::ReadWriteAccess,VladenVal> vladen{}; namespace VladenValC{ constexpr Register::FieldValue<decltype(vladen)::Type,VladenVal::disabled> disabled{}; constexpr Register::FieldValue<decltype(vladen)::Type,VladenVal::enabled> enabled{}; } ///Reserved. constexpr Register::FieldLocation<Addr,Register::maskFromRange(21,21),Register::ReadWriteAccess,unsigned> reserved{}; ///Voltage reference select for comparator 2 voltage ladder. enum class VladrefVal { vrefCmpPin=0x00000000, ///<VREF_CMP pin. vddaPin=0x00000001, ///<VDDA pin. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(22,22),Register::ReadWriteAccess,VladrefVal> vladref{}; namespace VladrefValC{ constexpr Register::FieldValue<decltype(vladref)::Type,VladrefVal::vrefCmpPin> vrefCmpPin{}; constexpr Register::FieldValue<decltype(vladref)::Type,VladrefVal::vddaPin> vddaPin{}; } ///Reserved. constexpr Register::FieldLocation<Addr,Register::maskFromRange(23,23),Register::ReadWriteAccess,unsigned> reserved{}; ///Voltage ladder value for comparator 2. The reference voltage Vref depends on the setting of VLADREF (either VDD(3V3) or voltage on pin VREF_CMP). 00000 = Vss. 00001 = 1 x Vref / 31. 00010 = 2 x Vref / 31. ... 11111 = Vref constexpr Register::FieldLocation<Addr,Register::maskFromRange(28,24),Register::ReadWriteAccess,unsigned> vsel{}; ///Configure the propagation delay. A shorter propagation delay means higher power consumption. Use values from 0x0 (shortest propagation delay and highest power consumption) to 0x2 (longest propagation delay and lowest power consumption). See the data sheet for details. constexpr Register::FieldLocation<Addr,Register::maskFromRange(30,29),Register::ReadWriteAccess,unsigned> dly{}; ///Reserved. constexpr Register::FieldLocation<Addr,Register::maskFromRange(31,31),Register::ReadWriteAccess,unsigned> reserved{}; } namespace AcmpCmp3{ ///<Comparator 3 source control using Addr = Register::Address<0x4000801c,0x00000000,0x00000000,unsigned>; ///Comparator enable control. enum class EnVal { disabled=0x00000000, ///<Disabled. Comparator disabled. enabled=0x00000001, ///<Enabled. Comparator is enabled. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(0,0),Register::ReadWriteAccess,EnVal> en{}; namespace EnValC{ constexpr Register::FieldValue<decltype(en)::Type,EnVal::disabled> disabled{}; constexpr Register::FieldValue<decltype(en)::Type,EnVal::enabled> enabled{}; } ///Reserved. constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,1),Register::ReadWriteAccess,unsigned> reserved{}; ///Interrupt enable. enum class IntenVal { disabled=0x00000000, ///<Disabled. Interrupts are disabled.. enabled=0x00000001, ///<Enabled. Interrupts are enabled.. Must set to 1 for interrupts to propagate to the NVIC and start-up logic. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(2,2),Register::ReadWriteAccess,IntenVal> inten{}; namespace IntenValC{ constexpr Register::FieldValue<decltype(inten)::Type,IntenVal::disabled> disabled{}; constexpr Register::FieldValue<decltype(inten)::Type,IntenVal::enabled> enabled{}; } ///Comparator status. This bit reflects the comparator output constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,3),Register::ReadWriteAccess,unsigned> stat{}; ///VM input select. enum class VmVal { vrefDivider3=0x00000000, ///<Vref divider 3. acmpI1=0x00000001, ///<ACMP_I1. acmpI2=0x00000002, ///<ACMP_I2. acmp3I3=0x00000003, ///<ACMP3_I3. acmp3I4=0x00000004, ///<ACMP3_I4. internal0=0x00000005, ///<Internal 0.9 V band gap reference. adc11=0x00000006, ///<ADC1_1. Input for ADC1 channel 1. adc13=0x00000007, ///<ADC1_3. Input for ADC1 channel 3. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(6,4),Register::ReadWriteAccess,VmVal> vm{}; namespace VmValC{ constexpr Register::FieldValue<decltype(vm)::Type,VmVal::vrefDivider3> vrefDivider3{}; constexpr Register::FieldValue<decltype(vm)::Type,VmVal::acmpI1> acmpI1{}; constexpr Register::FieldValue<decltype(vm)::Type,VmVal::acmpI2> acmpI2{}; constexpr Register::FieldValue<decltype(vm)::Type,VmVal::acmp3I3> acmp3I3{}; constexpr Register::FieldValue<decltype(vm)::Type,VmVal::acmp3I4> acmp3I4{}; constexpr Register::FieldValue<decltype(vm)::Type,VmVal::internal0> internal0{}; constexpr Register::FieldValue<decltype(vm)::Type,VmVal::adc11> adc11{}; constexpr Register::FieldValue<decltype(vm)::Type,VmVal::adc13> adc13{}; } ///Reserved. constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,7),Register::ReadWriteAccess,unsigned> reserved{}; ///VP input select. enum class VpVal { vrefDivider3=0x00000000, ///<Vref divider 3. acmpI1=0x00000001, ///<ACMP_I1. acmpI2=0x00000002, ///<ACMP_I2. acmp3I3=0x00000003, ///<ACMP3_I3. acmp3I4=0x00000004, ///<ACMP3_I4. internal0=0x00000005, ///<Internal 0.9 V band gap reference. adc11=0x00000006, ///<ADC1_1. Input for ADC1 channel 1. adc13=0x00000007, ///<ADC1_3. Input for ADC1 channel 3. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(10,8),Register::ReadWriteAccess,VpVal> vp{}; namespace VpValC{ constexpr Register::FieldValue<decltype(vp)::Type,VpVal::vrefDivider3> vrefDivider3{}; constexpr Register::FieldValue<decltype(vp)::Type,VpVal::acmpI1> acmpI1{}; constexpr Register::FieldValue<decltype(vp)::Type,VpVal::acmpI2> acmpI2{}; constexpr Register::FieldValue<decltype(vp)::Type,VpVal::acmp3I3> acmp3I3{}; constexpr Register::FieldValue<decltype(vp)::Type,VpVal::acmp3I4> acmp3I4{}; constexpr Register::FieldValue<decltype(vp)::Type,VpVal::internal0> internal0{}; constexpr Register::FieldValue<decltype(vp)::Type,VpVal::adc11> adc11{}; constexpr Register::FieldValue<decltype(vp)::Type,VpVal::adc13> adc13{}; } ///Reserved. constexpr Register::FieldLocation<Addr,Register::maskFromRange(12,11),Register::ReadWriteAccess,unsigned> reserved{}; ///Hysteresis control. When enabled, hysteresis determines the difference required between the comparator inputs before the comparator output switches. The difference must be in the direction opposite of the current comparator output. enum class HysVal { hysteresisIsTurned=0x00000000, ///<Hysteresis is turned off, comparator output will change as the input voltages cross. hysteresisEq5Mv=0x00000001, ///<Hysteresis = 5 mV. hysteresisEq10Mv=0x00000002, ///<Hysteresis = 10 mV. hysteresisEq15Mv=0x00000003, ///<Hysteresis = 15 mV. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(14,13),Register::ReadWriteAccess,HysVal> hys{}; namespace HysValC{ constexpr Register::FieldValue<decltype(hys)::Type,HysVal::hysteresisIsTurned> hysteresisIsTurned{}; constexpr Register::FieldValue<decltype(hys)::Type,HysVal::hysteresisEq5Mv> hysteresisEq5Mv{}; constexpr Register::FieldValue<decltype(hys)::Type,HysVal::hysteresisEq10Mv> hysteresisEq10Mv{}; constexpr Register::FieldValue<decltype(hys)::Type,HysVal::hysteresisEq15Mv> hysteresisEq15Mv{}; } ///Selects the polarity of the CMP output for purposes of generating level interrupts. enum class IntpolVal { notInverted=0x00000000, ///<Not inverted. The output is used as-is for generating interrupts. inverted=0x00000001, ///<Inverted. The output is used inverted for generating interrupts. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(15,15),Register::ReadWriteAccess,IntpolVal> intpol{}; namespace IntpolValC{ constexpr Register::FieldValue<decltype(intpol)::Type,IntpolVal::notInverted> notInverted{}; constexpr Register::FieldValue<decltype(intpol)::Type,IntpolVal::inverted> inverted{}; } ///Select interrupt type. enum class InttypeVal { edge=0x00000000, ///<Edge. Comparator interrupt is edge triggered. level=0x00000001, ///<Level. Comparator interrupt is level triggered. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(16,16),Register::ReadWriteAccess,InttypeVal> inttype{}; namespace InttypeValC{ constexpr Register::FieldValue<decltype(inttype)::Type,InttypeVal::edge> edge{}; constexpr Register::FieldValue<decltype(inttype)::Type,InttypeVal::level> level{}; } ///Select edge triggered interrupt to be active on either high or low transitions, when INTTYPE = 0. enum class IntedgeVal { falling=0x00000000, ///<Falling. Comparator interrupt is active on falling edges. rising=0x00000001, ///<Rising. Comparator interrupt is active on rising edges. bothEdges=0x00000002, ///<Both edges. Comparator Interrupt is active on both edges. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(18,17),Register::ReadWriteAccess,IntedgeVal> intedge{}; namespace IntedgeValC{ constexpr Register::FieldValue<decltype(intedge)::Type,IntedgeVal::falling> falling{}; constexpr Register::FieldValue<decltype(intedge)::Type,IntedgeVal::rising> rising{}; constexpr Register::FieldValue<decltype(intedge)::Type,IntedgeVal::bothEdges> bothEdges{}; } ///Interrupt flag. enum class IntflagVal { notPending=0x00000000, ///<Not pending. The Comparator interrupt is not pending. pending=0x00000001, ///<Pending. The Comparator interrupt is pending. Writing a 1 to this bit clears the flag. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(19,19),Register::ReadWriteAccess,IntflagVal> intflag{}; namespace IntflagValC{ constexpr Register::FieldValue<decltype(intflag)::Type,IntflagVal::notPending> notPending{}; constexpr Register::FieldValue<decltype(intflag)::Type,IntflagVal::pending> pending{}; } ///Voltage ladder enable for comparator 3. enum class VladenVal { disabled=0x00000000, ///<Disabled. The Comparator voltage ladder is disabled. enabled=0x00000001, ///<Enabled. The Comparator voltage ladder is enabled. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(20,20),Register::ReadWriteAccess,VladenVal> vladen{}; namespace VladenValC{ constexpr Register::FieldValue<decltype(vladen)::Type,VladenVal::disabled> disabled{}; constexpr Register::FieldValue<decltype(vladen)::Type,VladenVal::enabled> enabled{}; } ///Reserved. constexpr Register::FieldLocation<Addr,Register::maskFromRange(21,21),Register::ReadWriteAccess,unsigned> reserved{}; ///Voltage reference select for comparator 3 voltage ladder. enum class VladrefVal { vrefCmpPin=0x00000000, ///<VREF_CMP pin. vddaPin=0x00000001, ///<VDDA pin. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(22,22),Register::ReadWriteAccess,VladrefVal> vladref{}; namespace VladrefValC{ constexpr Register::FieldValue<decltype(vladref)::Type,VladrefVal::vrefCmpPin> vrefCmpPin{}; constexpr Register::FieldValue<decltype(vladref)::Type,VladrefVal::vddaPin> vddaPin{}; } ///Reserved. constexpr Register::FieldLocation<Addr,Register::maskFromRange(23,23),Register::ReadWriteAccess,unsigned> reserved{}; ///Voltage ladder value for comparator 3. The reference voltage Vref depends on the setting of VLADREF (either VDD(3V3) or voltage on pin VREF_CMP). 00000 = Vss. 00001 = 1 x Vref / 31. 00010 = 2 x Vref / 31. ... 11111 = Vref constexpr Register::FieldLocation<Addr,Register::maskFromRange(28,24),Register::ReadWriteAccess,unsigned> vsel{}; ///Configure the propagation delay. A shorter propagation delay means higher power consumption. Use values from 0x0 (shortest propagation delay and highest power consumption) to 0x2 (longest propagation delay and lowest power consumption). See the data sheet for details. constexpr Register::FieldLocation<Addr,Register::maskFromRange(30,29),Register::ReadWriteAccess,unsigned> dly{}; ///Reserved. constexpr Register::FieldLocation<Addr,Register::maskFromRange(31,31),Register::ReadWriteAccess,unsigned> reserved{}; } namespace AcmpCmpfiltr0{ ///<Comparator 0 pin filter set-up using Addr = Register::Address<0x40008008,0x00000000,0x00000000,unsigned>; ///Digital filter sample mode. enum class SmodeVal { bypassInputFilter=0x00000000, ///<Bypass input filter. v1ClockCycle=0x00000001, ///<1 clock cycle. Input pulses shorter than one filter clock are rejected. v2ClockCycles=0x00000002, ///<2 clock cycles. Input pulses shorter than two filter clocks are rejected. v3ClockCycles=0x00000003, ///<3 clock cycles. Input pulses shorter than three filter clocks are rejected. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,0),Register::ReadWriteAccess,SmodeVal> sMode{}; namespace SmodeValC{ constexpr Register::FieldValue<decltype(sMode)::Type,SmodeVal::bypassInputFilter> bypassInputFilter{}; constexpr Register::FieldValue<decltype(sMode)::Type,SmodeVal::v1ClockCycle> v1ClockCycle{}; constexpr Register::FieldValue<decltype(sMode)::Type,SmodeVal::v2ClockCycles> v2ClockCycles{}; constexpr Register::FieldValue<decltype(sMode)::Type,SmodeVal::v3ClockCycles> v3ClockCycles{}; } ///Select clock divider for comparator clock CMP_PCLK. enum class ClkdivVal { cmpPclk=0x00000000, ///<CMP_PCLK. cmpPclkdiv2=0x00000001, ///<CMP_PCLK/2. cmpPclkdiv4=0x00000002, ///<CMP_PCLK/4. cmpPclkdiv8=0x00000003, ///<CMP_PCLK/8. cmpPclkdiv16=0x00000004, ///<CMP_PCLK/16. cmpPclkdiv32=0x00000005, ///<CMP_PCLK/32. cmpPclkdiv64=0x00000006, ///<CMP_PCLK/64. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(4,2),Register::ReadWriteAccess,ClkdivVal> clkdiv{}; namespace ClkdivValC{ constexpr Register::FieldValue<decltype(clkdiv)::Type,ClkdivVal::cmpPclk> cmpPclk{}; constexpr Register::FieldValue<decltype(clkdiv)::Type,ClkdivVal::cmpPclkdiv2> cmpPclkdiv2{}; constexpr Register::FieldValue<decltype(clkdiv)::Type,ClkdivVal::cmpPclkdiv4> cmpPclkdiv4{}; constexpr Register::FieldValue<decltype(clkdiv)::Type,ClkdivVal::cmpPclkdiv8> cmpPclkdiv8{}; constexpr Register::FieldValue<decltype(clkdiv)::Type,ClkdivVal::cmpPclkdiv16> cmpPclkdiv16{}; constexpr Register::FieldValue<decltype(clkdiv)::Type,ClkdivVal::cmpPclkdiv32> cmpPclkdiv32{}; constexpr Register::FieldValue<decltype(clkdiv)::Type,ClkdivVal::cmpPclkdiv64> cmpPclkdiv64{}; } ///Reserved constexpr Register::FieldLocation<Addr,Register::maskFromRange(31,5),Register::ReadWriteAccess,unsigned> reserved{}; } namespace AcmpCmpfiltr1{ ///<Comparator 0 pin filter set-up using Addr = Register::Address<0x40008010,0x00000000,0x00000000,unsigned>; ///Digital filter sample mode. enum class SmodeVal { bypassInputFilter=0x00000000, ///<Bypass input filter. v1ClockCycle=0x00000001, ///<1 clock cycle. Input pulses shorter than one filter clock are rejected. v2ClockCycles=0x00000002, ///<2 clock cycles. Input pulses shorter than two filter clocks are rejected. v3ClockCycles=0x00000003, ///<3 clock cycles. Input pulses shorter than three filter clocks are rejected. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,0),Register::ReadWriteAccess,SmodeVal> sMode{}; namespace SmodeValC{ constexpr Register::FieldValue<decltype(sMode)::Type,SmodeVal::bypassInputFilter> bypassInputFilter{}; constexpr Register::FieldValue<decltype(sMode)::Type,SmodeVal::v1ClockCycle> v1ClockCycle{}; constexpr Register::FieldValue<decltype(sMode)::Type,SmodeVal::v2ClockCycles> v2ClockCycles{}; constexpr Register::FieldValue<decltype(sMode)::Type,SmodeVal::v3ClockCycles> v3ClockCycles{}; } ///Select clock divider for comparator clock CMP_PCLK. enum class ClkdivVal { cmpPclk=0x00000000, ///<CMP_PCLK. cmpPclkdiv2=0x00000001, ///<CMP_PCLK/2. cmpPclkdiv4=0x00000002, ///<CMP_PCLK/4. cmpPclkdiv8=0x00000003, ///<CMP_PCLK/8. cmpPclkdiv16=0x00000004, ///<CMP_PCLK/16. cmpPclkdiv32=0x00000005, ///<CMP_PCLK/32. cmpPclkdiv64=0x00000006, ///<CMP_PCLK/64. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(4,2),Register::ReadWriteAccess,ClkdivVal> clkdiv{}; namespace ClkdivValC{ constexpr Register::FieldValue<decltype(clkdiv)::Type,ClkdivVal::cmpPclk> cmpPclk{}; constexpr Register::FieldValue<decltype(clkdiv)::Type,ClkdivVal::cmpPclkdiv2> cmpPclkdiv2{}; constexpr Register::FieldValue<decltype(clkdiv)::Type,ClkdivVal::cmpPclkdiv4> cmpPclkdiv4{}; constexpr Register::FieldValue<decltype(clkdiv)::Type,ClkdivVal::cmpPclkdiv8> cmpPclkdiv8{}; constexpr Register::FieldValue<decltype(clkdiv)::Type,ClkdivVal::cmpPclkdiv16> cmpPclkdiv16{}; constexpr Register::FieldValue<decltype(clkdiv)::Type,ClkdivVal::cmpPclkdiv32> cmpPclkdiv32{}; constexpr Register::FieldValue<decltype(clkdiv)::Type,ClkdivVal::cmpPclkdiv64> cmpPclkdiv64{}; } ///Reserved constexpr Register::FieldLocation<Addr,Register::maskFromRange(31,5),Register::ReadWriteAccess,unsigned> reserved{}; } namespace AcmpCmpfiltr2{ ///<Comparator 0 pin filter set-up using Addr = Register::Address<0x40008018,0x00000000,0x00000000,unsigned>; ///Digital filter sample mode. enum class SmodeVal { bypassInputFilter=0x00000000, ///<Bypass input filter. v1ClockCycle=0x00000001, ///<1 clock cycle. Input pulses shorter than one filter clock are rejected. v2ClockCycles=0x00000002, ///<2 clock cycles. Input pulses shorter than two filter clocks are rejected. v3ClockCycles=0x00000003, ///<3 clock cycles. Input pulses shorter than three filter clocks are rejected. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,0),Register::ReadWriteAccess,SmodeVal> sMode{}; namespace SmodeValC{ constexpr Register::FieldValue<decltype(sMode)::Type,SmodeVal::bypassInputFilter> bypassInputFilter{}; constexpr Register::FieldValue<decltype(sMode)::Type,SmodeVal::v1ClockCycle> v1ClockCycle{}; constexpr Register::FieldValue<decltype(sMode)::Type,SmodeVal::v2ClockCycles> v2ClockCycles{}; constexpr Register::FieldValue<decltype(sMode)::Type,SmodeVal::v3ClockCycles> v3ClockCycles{}; } ///Select clock divider for comparator clock CMP_PCLK. enum class ClkdivVal { cmpPclk=0x00000000, ///<CMP_PCLK. cmpPclkdiv2=0x00000001, ///<CMP_PCLK/2. cmpPclkdiv4=0x00000002, ///<CMP_PCLK/4. cmpPclkdiv8=0x00000003, ///<CMP_PCLK/8. cmpPclkdiv16=0x00000004, ///<CMP_PCLK/16. cmpPclkdiv32=0x00000005, ///<CMP_PCLK/32. cmpPclkdiv64=0x00000006, ///<CMP_PCLK/64. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(4,2),Register::ReadWriteAccess,ClkdivVal> clkdiv{}; namespace ClkdivValC{ constexpr Register::FieldValue<decltype(clkdiv)::Type,ClkdivVal::cmpPclk> cmpPclk{}; constexpr Register::FieldValue<decltype(clkdiv)::Type,ClkdivVal::cmpPclkdiv2> cmpPclkdiv2{}; constexpr Register::FieldValue<decltype(clkdiv)::Type,ClkdivVal::cmpPclkdiv4> cmpPclkdiv4{}; constexpr Register::FieldValue<decltype(clkdiv)::Type,ClkdivVal::cmpPclkdiv8> cmpPclkdiv8{}; constexpr Register::FieldValue<decltype(clkdiv)::Type,ClkdivVal::cmpPclkdiv16> cmpPclkdiv16{}; constexpr Register::FieldValue<decltype(clkdiv)::Type,ClkdivVal::cmpPclkdiv32> cmpPclkdiv32{}; constexpr Register::FieldValue<decltype(clkdiv)::Type,ClkdivVal::cmpPclkdiv64> cmpPclkdiv64{}; } ///Reserved constexpr Register::FieldLocation<Addr,Register::maskFromRange(31,5),Register::ReadWriteAccess,unsigned> reserved{}; } namespace AcmpCmpfiltr3{ ///<Comparator 0 pin filter set-up using Addr = Register::Address<0x40008020,0x00000000,0x00000000,unsigned>; ///Digital filter sample mode. enum class SmodeVal { bypassInputFilter=0x00000000, ///<Bypass input filter. v1ClockCycle=0x00000001, ///<1 clock cycle. Input pulses shorter than one filter clock are rejected. v2ClockCycles=0x00000002, ///<2 clock cycles. Input pulses shorter than two filter clocks are rejected. v3ClockCycles=0x00000003, ///<3 clock cycles. Input pulses shorter than three filter clocks are rejected. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,0),Register::ReadWriteAccess,SmodeVal> sMode{}; namespace SmodeValC{ constexpr Register::FieldValue<decltype(sMode)::Type,SmodeVal::bypassInputFilter> bypassInputFilter{}; constexpr Register::FieldValue<decltype(sMode)::Type,SmodeVal::v1ClockCycle> v1ClockCycle{}; constexpr Register::FieldValue<decltype(sMode)::Type,SmodeVal::v2ClockCycles> v2ClockCycles{}; constexpr Register::FieldValue<decltype(sMode)::Type,SmodeVal::v3ClockCycles> v3ClockCycles{}; } ///Select clock divider for comparator clock CMP_PCLK. enum class ClkdivVal { cmpPclk=0x00000000, ///<CMP_PCLK. cmpPclkdiv2=0x00000001, ///<CMP_PCLK/2. cmpPclkdiv4=0x00000002, ///<CMP_PCLK/4. cmpPclkdiv8=0x00000003, ///<CMP_PCLK/8. cmpPclkdiv16=0x00000004, ///<CMP_PCLK/16. cmpPclkdiv32=0x00000005, ///<CMP_PCLK/32. cmpPclkdiv64=0x00000006, ///<CMP_PCLK/64. }; constexpr Register::FieldLocation<Addr,Register::maskFromRange(4,2),Register::ReadWriteAccess,ClkdivVal> clkdiv{}; namespace ClkdivValC{ constexpr Register::FieldValue<decltype(clkdiv)::Type,ClkdivVal::cmpPclk> cmpPclk{}; constexpr Register::FieldValue<decltype(clkdiv)::Type,ClkdivVal::cmpPclkdiv2> cmpPclkdiv2{}; constexpr Register::FieldValue<decltype(clkdiv)::Type,ClkdivVal::cmpPclkdiv4> cmpPclkdiv4{}; constexpr Register::FieldValue<decltype(clkdiv)::Type,ClkdivVal::cmpPclkdiv8> cmpPclkdiv8{}; constexpr Register::FieldValue<decltype(clkdiv)::Type,ClkdivVal::cmpPclkdiv16> cmpPclkdiv16{}; constexpr Register::FieldValue<decltype(clkdiv)::Type,ClkdivVal::cmpPclkdiv32> cmpPclkdiv32{}; constexpr Register::FieldValue<decltype(clkdiv)::Type,ClkdivVal::cmpPclkdiv64> cmpPclkdiv64{}; } ///Reserved constexpr Register::FieldLocation<Addr,Register::maskFromRange(31,5),Register::ReadWriteAccess,unsigned> reserved{}; } }
{ "content_hash": "982f311a0f4c77ece28f511a5179d09e", "timestamp": "", "source": "github", "line_count": 830, "max_line_length": 280, "avg_line_length": 70.54819277108433, "alnum_prop": 0.6688241823926223, "repo_name": "porkybrain/Kvasir", "id": "ff6c95c40a7f2ef18f725a5c2f1f0e637eaf6256", "size": "58601", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Lib/Chip/CM3/NXP/LPC15xx_v0.7/ACMP.hpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "16510" }, { "name": "C++", "bytes": "763437041" }, { "name": "CMake", "bytes": "1504" }, { "name": "Python", "bytes": "13637" } ], "symlink_target": "" }
ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "8bae707cd1f79a2455252f6b989ae609", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.307692307692308, "alnum_prop": 0.6940298507462687, "repo_name": "mdoering/backbone", "id": "5057f595072c7b0e0da10b65d3102f25f5942b28", "size": "183", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Magnoliales/Annonaceae/Porcelia/Porcelia dependens/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package org.elasticsearch.index.mapper.selector; import org.apache.lucene.document.FieldSelectorResult; import org.elasticsearch.common.lucene.document.ResetFieldSelector; import org.elasticsearch.index.mapper.internal.UidFieldMapper; /** * An optimized field selector that loads just the uid. */ public class UidFieldSelector implements ResetFieldSelector { public static final UidFieldSelector INSTANCE = new UidFieldSelector(); private UidFieldSelector() { } @Override public FieldSelectorResult accept(String fieldName) { if (UidFieldMapper.NAME.equals(fieldName)) { return FieldSelectorResult.LOAD_AND_BREAK; } return FieldSelectorResult.NO_LOAD; } @Override public void reset() { } @Override public String toString() { return "uid"; } }
{ "content_hash": "df7dcb7d5d894fe53303045664fa7287", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 75, "avg_line_length": 23.5, "alnum_prop": 0.7127659574468085, "repo_name": "umangmehta12/elasticsearch-server", "id": "8da00802873162920f1aa52fc82fa0ed220662c9", "size": "1651", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "elasticsearch-server-node/src/main/java/org/elasticsearch/index/mapper/selector/UidFieldSelector.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "4946" }, { "name": "Groovy", "bytes": "71687" }, { "name": "HTML", "bytes": "1143" }, { "name": "Java", "bytes": "10587397" }, { "name": "Shell", "bytes": "71762" }, { "name": "Thrift", "bytes": "1897" } ], "symlink_target": "" }
'use strict'; // FIRST SOLUTION export function zeroMatrix1(matrix) { if (!matrix || !matrix.length) throw Error('invalid matrix'); if (matrix.length === 1 && matrix[0].length === 1) return matrix; const coordsSet = new Set(); matrix.forEach((row, i) => { row.forEach((cell, x) => cell === 0 && coordsSet.add([i, x])); }); coordsSet.forEach(coord => { const row = coord[0], col = coord[1]; matrix[row].forEach((cell, index) => matrix[row][index] = 0); // Going through each row again to check for column even though column will have changed when the row it's in changed matrix.forEach(rowArr => rowArr[col] = 0); }); return matrix; } // |---~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~---| // SECOND MORE OPTIMIZED SOLUTION export function zeroMatrix2(matrix) { if (!matrix || !matrix.length) throw Error('invalid matrix'); if (matrix.length === 1 && matrix[0].length === 1) return matrix; const colCoords = new Set(); matrix.forEach(row => { if (row.includes(0)) { row.forEach((columnCell, index) => { if (columnCell === 0) colCoords.add(index); row[index] = 0; }); } }); // Only goes through columns that have not already changed to zero matrix.forEach(row => { if (row[0] !== 0) { colCoords.forEach(col => row[col] = 0); } }); return matrix; } // const matrix = [ // [1, 2, 0, 4], // [0, 13, 14, 5], // [11, 16, 0, 6], // [10, 9, 8, 7] // ]; // console.log(zeroMatrix2(matrix));
{ "content_hash": "b2196953a4372e05954f5cbb6a592d3c", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 121, "avg_line_length": 24.241935483870968, "alnum_prop": 0.5688622754491018, "repo_name": "ruthnaebeck/codeboard", "id": "af983037b80eacd98c87191025b798911db40b28", "size": "1503", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "public/questions-specs/pending/1.08-zeroMatrix.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "2220" }, { "name": "HTML", "bytes": "511" }, { "name": "JavaScript", "bytes": "213123" }, { "name": "Shell", "bytes": "1794" } ], "symlink_target": "" }
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "e882a12073105f3dc307339aff55314e", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.6917293233082706, "repo_name": "mdoering/backbone", "id": "9ccd718e184ef3d89a0b985855367233519259ec", "size": "186", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Stenoseris graciliflora/ Syn. Prenanthes graciliflora/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
from secret import twitter_instance from json import dump import sys tw = twitter_instance() # [1] response = tw.users.report_spam(screen_name='showa_yojyo') # [2] dump(response, sys.stdout, ensure_ascii=False, indent=4, sort_keys=True)
{ "content_hash": "e3d02ba6b16d69f8a1e81e55142373c5", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 72, "avg_line_length": 21.818181818181817, "alnum_prop": 0.7416666666666667, "repo_name": "showa-yojyo/notebook", "id": "997a70e5515af26e8e41186733e2b4b66e834afa", "size": "371", "binary": false, "copies": "2", "ref": "refs/heads/develop", "path": "doc/source/_sample/ptt/users-report_spam.py", "mode": "33261", "license": "mit", "language": [], "symlink_target": "" }
package org.apache.camel.component.http; import java.io.Closeable; import java.net.URI; import java.net.URISyntaxException; import java.util.Map; import javax.net.ssl.HostnameVerifier; import org.apache.camel.Consumer; import org.apache.camel.PollingConsumer; import org.apache.camel.Processor; import org.apache.camel.Producer; import org.apache.camel.api.management.ManagedAttribute; import org.apache.camel.api.management.ManagedResource; import org.apache.camel.http.base.HttpHelper; import org.apache.camel.http.base.cookie.CookieHandler; import org.apache.camel.http.common.HttpCommonEndpoint; import org.apache.camel.spi.Metadata; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; import org.apache.camel.support.jsse.SSLContextParameters; import org.apache.camel.util.IOHelper; import org.apache.camel.util.ObjectHelper; import org.apache.http.HttpHost; import org.apache.http.client.CookieStore; import org.apache.http.client.HttpClient; import org.apache.http.client.config.RequestConfig; import org.apache.http.conn.HttpClientConnectionManager; import org.apache.http.conn.ssl.DefaultHostnameVerifier; import org.apache.http.impl.client.BasicCookieStore; import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.pool.ConnPoolControl; import org.apache.http.pool.PoolStats; import org.apache.http.protocol.HttpContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * For calling out to external HTTP servers using Apache HTTP Client 4.x. */ @UriEndpoint(firstVersion = "2.3.0", scheme = "http,https", title = "HTTP,HTTPS", syntax = "http:httpUri", producerOnly = true, label = "http", lenientProperties = true) @ManagedResource(description = "Managed HttpEndpoint") public class HttpEndpoint extends HttpCommonEndpoint { private static final Logger LOG = LoggerFactory.getLogger(HttpEndpoint.class); @UriParam(label = "security", description = "To configure security using SSLContextParameters." + " Important: Only one instance of org.apache.camel.util.jsse.SSLContextParameters is supported per HttpComponent." + " If you need to use 2 or more different instances, you need to define a new HttpComponent per instance you need.") protected SSLContextParameters sslContextParameters; @UriParam(label = "advanced", description = "To use a custom HttpContext instance") private HttpContext httpContext; @UriParam(label = "advanced", description = "Register a custom configuration strategy for new HttpClient instances" + " created by producers or consumers such as to configure authentication mechanisms etc.") private HttpClientConfigurer httpClientConfigurer; @UriParam(label = "advanced", prefix = "httpClient.", multiValue = true, description = "To configure the HttpClient using the key/values from the Map.") private Map<String, Object> httpClientOptions; @UriParam(label = "advanced", description = "To use a custom HttpClientConnectionManager to manage connections") private HttpClientConnectionManager clientConnectionManager; @UriParam(label = "advanced", description = "Provide access to the http client request parameters used on new RequestConfig instances used by producers or consumers of this endpoint.") private HttpClientBuilder clientBuilder; @UriParam(label = "advanced", description = "Sets a custom HttpClient to be used by the producer") private HttpClient httpClient; @UriParam(label = "advanced", defaultValue = "false", description = "To use System Properties as fallback for configuration") private boolean useSystemProperties; // timeout @Metadata(label = "timeout", defaultValue = "-1", description = "The timeout in milliseconds used when requesting a connection" + " from the connection manager. A timeout value of zero is interpreted as an infinite timeout." + " A timeout value of zero is interpreted as an infinite timeout." + " A negative value is interpreted as undefined (system default).") private int connectionRequestTimeout = -1; @Metadata(label = "timeout", defaultValue = "-1", description = "Determines the timeout in milliseconds until a connection is established." + " A timeout value of zero is interpreted as an infinite timeout." + " A timeout value of zero is interpreted as an infinite timeout." + " A negative value is interpreted as undefined (system default).") private int connectTimeout = -1; @Metadata(label = "timeout", defaultValue = "-1", description = "Defines the socket timeout in milliseconds," + " which is the timeout for waiting for data or, put differently," + " a maximum period inactivity between two consecutive data packets)." + " A timeout value of zero is interpreted as an infinite timeout." + " A negative value is interpreted as undefined (system default).") private int socketTimeout = -1; @UriParam(label = "producer,advanced", description = "To use a custom CookieStore." + " By default the BasicCookieStore is used which is an in-memory only cookie store." + " Notice if bridgeEndpoint=true then the cookie store is forced to be a noop cookie store as cookie shouldn't be stored as we are just bridging (eg acting as a proxy)." + " If a cookieHandler is set then the cookie store is also forced to be a noop cookie store as cookie handling is then performed by the cookieHandler.") private CookieStore cookieStore = new BasicCookieStore(); @UriParam(label = "producer", defaultValue = "true", description = "Whether to clear expired cookies before sending the HTTP request." + " This ensures the cookies store does not keep growing by adding new cookies which is newer removed when they are expired.") private boolean clearExpiredCookies = true; @UriParam(label = "producer,security", description = "If this option is true, camel-http sends preemptive basic authentication to the server.") private boolean authenticationPreemptive; @UriParam(label = "producer,advanced", description = "Whether the HTTP GET should include the message body or not." + " By default HTTP GET do not include any HTTP body. However in some rare cases users may need to be able to include the message body.") private boolean getWithBody; @UriParam(label = "producer,advanced", description = "Whether the HTTP DELETE should include the message body or not." + " By default HTTP DELETE do not include any HTTP body. However in some rare cases users may need to be able to include the message body.") private boolean deleteWithBody; @UriParam(label = "advanced", defaultValue = "200", description = "The maximum number of connections.") private int maxTotalConnections; @UriParam(label = "advanced", defaultValue = "20", description = "The maximum number of connections per route.") private int connectionsPerRoute; @UriParam(label = "security", description = "To use a custom X509HostnameVerifier such as DefaultHostnameVerifier or NoopHostnameVerifier") private HostnameVerifier x509HostnameVerifier; @UriParam(label = "producer", description = "To use custom host header for producer. When not set in query will " + "be ignored. When set will override host header derived from url.") private String customHostHeader; public HttpEndpoint() { } public HttpEndpoint(String endPointURI, HttpComponent component, URI httpURI) throws URISyntaxException { this(endPointURI, component, httpURI, null); } public HttpEndpoint(String endPointURI, HttpComponent component, URI httpURI, HttpClientConnectionManager clientConnectionManager) throws URISyntaxException { this(endPointURI, component, httpURI, HttpClientBuilder.create(), clientConnectionManager, null); } public HttpEndpoint(String endPointURI, HttpComponent component, HttpClientBuilder clientBuilder, HttpClientConnectionManager clientConnectionManager, HttpClientConfigurer clientConfigurer) throws URISyntaxException { this(endPointURI, component, null, clientBuilder, clientConnectionManager, clientConfigurer); } public HttpEndpoint(String endPointURI, HttpComponent component, URI httpURI, HttpClientBuilder clientBuilder, HttpClientConnectionManager clientConnectionManager, HttpClientConfigurer clientConfigurer) throws URISyntaxException { super(endPointURI, component, httpURI); this.clientBuilder = clientBuilder; this.httpClientConfigurer = clientConfigurer; this.clientConnectionManager = clientConnectionManager; } @Override public Producer createProducer() throws Exception { return new HttpProducer(this); } @Override public Consumer createConsumer(Processor processor) throws Exception { throw new UnsupportedOperationException("Cannot consume from http endpoint"); } @Override public PollingConsumer createPollingConsumer() throws Exception { HttpPollingConsumer answer = new HttpPollingConsumer(this); configurePollingConsumer(answer); return answer; } public synchronized HttpClient getHttpClient() { if (httpClient == null) { httpClient = createHttpClient(); } return httpClient; } /** * Sets a custom HttpClient to be used by the producer */ public void setHttpClient(HttpClient httpClient) { this.httpClient = httpClient; } /** * Factory method to create a new {@link HttpClient} instance * <p/> * Producers and consumers should use the {@link #getHttpClient()} method instead. */ protected HttpClient createHttpClient() { ObjectHelper.notNull(clientBuilder, "httpClientBuilder"); ObjectHelper.notNull(clientConnectionManager, "httpConnectionManager"); // setup the cookieStore clientBuilder.setDefaultCookieStore(cookieStore); // setup the httpConnectionManager clientBuilder.setConnectionManager(clientConnectionManager); if (getComponent() != null && getComponent().getClientConnectionManager() == getClientConnectionManager()) { clientBuilder.setConnectionManagerShared(true); } if (!useSystemProperties) { // configure http proxy from camelContext if (ObjectHelper.isNotEmpty(getCamelContext().getGlobalOption("http.proxyHost")) && ObjectHelper.isNotEmpty(getCamelContext().getGlobalOption("http.proxyPort"))) { String host = getCamelContext().getGlobalOption("http.proxyHost"); int port = Integer.parseInt(getCamelContext().getGlobalOption("http.proxyPort")); String scheme = getCamelContext().getGlobalOption("http.proxyScheme"); // fallback and use either http or https depending on secure if (scheme == null) { scheme = HttpHelper.isSecureConnection(getEndpointUri()) ? "https" : "http"; } LOG.debug("CamelContext properties http.proxyHost, http.proxyPort, and http.proxyScheme detected. Using http proxy host: {} port: {} scheme: {}", host, port, scheme); HttpHost proxy = new HttpHost(host, port, scheme); clientBuilder.setProxy(proxy); } } else { clientBuilder.useSystemProperties(); } if (isAuthenticationPreemptive()) { // setup the PreemptiveAuthInterceptor here clientBuilder.addInterceptorFirst(new PreemptiveAuthInterceptor()); } HttpClientConfigurer configurer = getHttpClientConfigurer(); if (configurer != null) { configurer.configureHttpClient(clientBuilder); } if (isBridgeEndpoint()) { // need to use noop cookiestore as we do not want to keep cookies in memory clientBuilder.setDefaultCookieStore(new NoopCookieStore()); } LOG.debug("Setup the HttpClientBuilder {}", clientBuilder); return clientBuilder.build(); } @Override public HttpComponent getComponent() { return (HttpComponent) super.getComponent(); } @Override protected void doStop() throws Exception { if (getComponent() != null && getComponent().getClientConnectionManager() != clientConnectionManager) { // need to shutdown the ConnectionManager clientConnectionManager.shutdown(); } if (httpClient instanceof Closeable) { IOHelper.close((Closeable)httpClient); } } // Properties //------------------------------------------------------------------------- public HttpClientBuilder getClientBuilder() { return clientBuilder; } /** * Provide access to the http client request parameters used on new {@link RequestConfig} instances * used by producers or consumers of this endpoint. */ public void setClientBuilder(HttpClientBuilder clientBuilder) { this.clientBuilder = clientBuilder; } public HttpClientConfigurer getHttpClientConfigurer() { return httpClientConfigurer; } /** * Register a custom configuration strategy for new {@link HttpClient} instances * created by producers or consumers such as to configure authentication mechanisms etc */ public void setHttpClientConfigurer(HttpClientConfigurer httpClientConfigurer) { this.httpClientConfigurer = httpClientConfigurer; } public HttpContext getHttpContext() { return httpContext; } /** * To use a custom HttpContext instance */ public void setHttpContext(HttpContext httpContext) { this.httpContext = httpContext; } public HttpClientConnectionManager getClientConnectionManager() { return clientConnectionManager; } /** * To use a custom HttpClientConnectionManager to manage connections */ public void setClientConnectionManager(HttpClientConnectionManager clientConnectionManager) { this.clientConnectionManager = clientConnectionManager; } public boolean isClearExpiredCookies() { return clearExpiredCookies; } /** * Whether to clear expired cookies before sending the HTTP request. * This ensures the cookies store does not keep growing by adding new cookies which is newer removed when they are expired. */ public void setClearExpiredCookies(boolean clearExpiredCookies) { this.clearExpiredCookies = clearExpiredCookies; } public boolean isDeleteWithBody() { return deleteWithBody; } /** * Whether the HTTP DELETE should include the message body or not. * <p/> * By default HTTP DELETE do not include any HTTP body. However in some rare cases users may need to be able to include the * message body. */ public void setDeleteWithBody(boolean deleteWithBody) { this.deleteWithBody = deleteWithBody; } public boolean isGetWithBody() { return getWithBody; } /** * Whether the HTTP GET should include the message body or not. * <p/> * By default HTTP GET do not include any HTTP body. However in some rare cases users may need to be able to include the * message body. */ public void setGetWithBody(boolean getWithBody) { this.getWithBody = getWithBody; } public CookieStore getCookieStore() { return cookieStore; } /** * To use a custom CookieStore. * By default the BasicCookieStore is used which is an in-memory only cookie store. * Notice if bridgeEndpoint=true then the cookie store is forced to be a noop cookie store as cookie * shouldn't be stored as we are just bridging (eg acting as a proxy). * If a cookieHandler is set then the cookie store is also forced to be a noop cookie store as cookie handling is * then performed by the cookieHandler. */ public void setCookieStore(CookieStore cookieStore) { this.cookieStore = cookieStore; } @Override public void setCookieHandler(CookieHandler cookieHandler) { super.setCookieHandler(cookieHandler); // if we set an explicit cookie handler this.cookieStore = new NoopCookieStore(); } public boolean isAuthenticationPreemptive() { return authenticationPreemptive; } /** * If this option is true, camel-http sends preemptive basic authentication to the server. */ public void setAuthenticationPreemptive(boolean authenticationPreemptive) { this.authenticationPreemptive = authenticationPreemptive; } public Map<String, Object> getHttpClientOptions() { return httpClientOptions; } /** * To configure the HttpClient using the key/values from the Map. */ public void setHttpClientOptions(Map<String, Object> httpClientOptions) { this.httpClientOptions = httpClientOptions; } public boolean isUseSystemProperties() { return useSystemProperties; } /** * To use System Properties as fallback for configuration */ public void setUseSystemProperties(boolean useSystemProperties) { this.useSystemProperties = useSystemProperties; } public int getMaxTotalConnections() { return maxTotalConnections; } /** * The maximum number of connections. */ public void setMaxTotalConnections(int maxTotalConnections) { this.maxTotalConnections = maxTotalConnections; } public int getConnectionsPerRoute() { return connectionsPerRoute; } /** * The maximum number of connections per route. */ public void setConnectionsPerRoute(int connectionsPerRoute) { this.connectionsPerRoute = connectionsPerRoute; } public HostnameVerifier getX509HostnameVerifier() { return x509HostnameVerifier; } /** * To use a custom X509HostnameVerifier such as {@link DefaultHostnameVerifier} * or {@link org.apache.http.conn.ssl.NoopHostnameVerifier}. */ public void setX509HostnameVerifier(HostnameVerifier x509HostnameVerifier) { this.x509HostnameVerifier = x509HostnameVerifier; } public SSLContextParameters getSslContextParameters() { return sslContextParameters; } /** * To configure security using SSLContextParameters. * Important: Only one instance of org.apache.camel.util.jsse.SSLContextParameters is supported per HttpComponent. * If you need to use 2 or more different instances, you need to define a new HttpComponent per instance you need. */ public void setSslContextParameters(SSLContextParameters sslContextParameters) { this.sslContextParameters = sslContextParameters; } public int getConnectionRequestTimeout() { return connectionRequestTimeout; } /** * The timeout in milliseconds used when requesting a connection * from the connection manager. A timeout value of zero is interpreted * as an infinite timeout. * <p> * A timeout value of zero is interpreted as an infinite timeout. * A negative value is interpreted as undefined (system default). * </p> * <p> * Default: {@code -1} * </p> */ public void setConnectionRequestTimeout(int connectionRequestTimeout) { this.connectionRequestTimeout = connectionRequestTimeout; } public int getConnectTimeout() { return connectTimeout; } /** * Determines the timeout in milliseconds until a connection is established. * A timeout value of zero is interpreted as an infinite timeout. * <p> * A timeout value of zero is interpreted as an infinite timeout. * A negative value is interpreted as undefined (system default). * </p> * <p> * Default: {@code -1} * </p> */ public void setConnectTimeout(int connectTimeout) { this.connectTimeout = connectTimeout; } public int getSocketTimeout() { return socketTimeout; } /** * Defines the socket timeout ({@code SO_TIMEOUT}) in milliseconds, * which is the timeout for waiting for data or, put differently, * a maximum period inactivity between two consecutive data packets). * <p> * A timeout value of zero is interpreted as an infinite timeout. * A negative value is interpreted as undefined (system default). * </p> * <p> * Default: {@code -1} * </p> */ public void setSocketTimeout(int socketTimeout) { this.socketTimeout = socketTimeout; } /** * Defines a custom host header which will be sent when producing http request. * <p> * When not set in query will be ignored. When set will override * host header derived from url. * </p> * <p> * Default: {@code null} * </p> */ public void setCustomHostHeader(String customHostHeader) { this.customHostHeader = customHostHeader; } public String getCustomHostHeader() { return customHostHeader; } @ManagedAttribute(description = "Maximum number of allowed persistent connections") public int getClientConnectionsPoolStatsMax() { ConnPoolControl<?> pool = null; if (clientConnectionManager instanceof ConnPoolControl) { pool = (ConnPoolControl<?>) clientConnectionManager; } if (pool != null) { PoolStats stats = pool.getTotalStats(); if (stats != null) { return stats.getMax(); } } return -1; } @ManagedAttribute(description = "Number of available idle persistent connections") public int getClientConnectionsPoolStatsAvailable() { ConnPoolControl<?> pool = null; if (clientConnectionManager instanceof ConnPoolControl) { pool = (ConnPoolControl<?>) clientConnectionManager; } if (pool != null) { PoolStats stats = pool.getTotalStats(); if (stats != null) { return stats.getAvailable(); } } return -1; } @ManagedAttribute(description = "Number of persistent connections tracked by the connection manager currently being used to execute requests") public int getClientConnectionsPoolStatsLeased() { ConnPoolControl<?> pool = null; if (clientConnectionManager instanceof ConnPoolControl) { pool = (ConnPoolControl<?>) clientConnectionManager; } if (pool != null) { PoolStats stats = pool.getTotalStats(); if (stats != null) { return stats.getLeased(); } } return -1; } @ManagedAttribute(description = "Number of connection requests being blocked awaiting a free connection." + " This can happen only if there are more worker threads contending for fewer connections.") public int getClientConnectionsPoolStatsPending() { ConnPoolControl<?> pool = null; if (clientConnectionManager instanceof ConnPoolControl) { pool = (ConnPoolControl<?>) clientConnectionManager; } if (pool != null) { PoolStats stats = pool.getTotalStats(); if (stats != null) { return stats.getPending(); } } return -1; } }
{ "content_hash": "585b2a9e288eec42067b52f8bbc6aea4", "timestamp": "", "source": "github", "line_count": 569, "max_line_length": 188, "avg_line_length": 41.39718804920914, "alnum_prop": 0.6913181914667799, "repo_name": "zregvart/camel", "id": "5e43f447a91d7ca2b955baab30209149577d05ff", "size": "24357", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "components/camel-http/src/main/java/org/apache/camel/component/http/HttpEndpoint.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Apex", "bytes": "6521" }, { "name": "Batchfile", "bytes": "2353" }, { "name": "CSS", "bytes": "5472" }, { "name": "Elm", "bytes": "10852" }, { "name": "FreeMarker", "bytes": "8015" }, { "name": "Groovy", "bytes": "20938" }, { "name": "HTML", "bytes": "914791" }, { "name": "Java", "bytes": "90321137" }, { "name": "JavaScript", "bytes": "101298" }, { "name": "RobotFramework", "bytes": "8461" }, { "name": "Shell", "bytes": "11165" }, { "name": "TSQL", "bytes": "28835" }, { "name": "Tcl", "bytes": "4974" }, { "name": "Thrift", "bytes": "6979" }, { "name": "XQuery", "bytes": "546" }, { "name": "XSLT", "bytes": "280849" } ], "symlink_target": "" }
class PrefService; namespace user_prefs { class PrefRegistrySyncable; } namespace password_manager { class LoginDatabase; } // PasswordStoreX is used on Linux and other non-Windows, non-Mac OS X // operating systems. It uses a "native backend" to actually store the password // data when such a backend is available, and otherwise falls back to using the // login database like PasswordStoreDefault. It also handles automatically // migrating password data to a native backend from the login database. // // There are currently native backends for GNOME Keyring and KWallet. class PasswordStoreX : public password_manager::PasswordStoreDefault { public: // NativeBackends more or less implement the PaswordStore interface, but // with return values rather than implicit consumer notification. class NativeBackend { public: virtual ~NativeBackend() {} virtual bool Init() = 0; virtual password_manager::PasswordStoreChangeList AddLogin( const autofill::PasswordForm& form) = 0; // Updates |form| and appends the changes to |changes|. |changes| shouldn't // be null. Returns false iff the operation failed due to a system backend // error. virtual bool UpdateLogin( const autofill::PasswordForm& form, password_manager::PasswordStoreChangeList* changes) = 0; // Removes |form| and appends the changes to |changes|. |changes| shouldn't // be null. Returns false iff the operation failed due to a system backend // error. virtual bool RemoveLogin( const autofill::PasswordForm& form, password_manager::PasswordStoreChangeList* changes) = 0; // Removes all logins created/synced from |delete_begin| onwards (inclusive) // and before |delete_end|. You may use a null Time value to do an unbounded // delete in either direction. virtual bool RemoveLoginsCreatedBetween( base::Time delete_begin, base::Time delete_end, password_manager::PasswordStoreChangeList* changes) = 0; virtual bool RemoveLoginsSyncedBetween( base::Time delete_begin, base::Time delete_end, password_manager::PasswordStoreChangeList* changes) = 0; // Sets the 'skip_zero_click' flag to 'true' for all logins in the database // that match |origin_filter|. virtual bool DisableAutoSignInForOrigins( const base::Callback<bool(const GURL&)>& origin_filter, password_manager::PasswordStoreChangeList* changes) = 0; // The three methods below overwrite |forms| with all stored credentials // matching |form|, all stored non-blacklisted credentials, and all stored // blacklisted credentials, respectively. On success, they return true. virtual bool GetLogins(const FormDigest& form, ScopedVector<autofill::PasswordForm>* forms) WARN_UNUSED_RESULT = 0; virtual bool GetAutofillableLogins( ScopedVector<autofill::PasswordForm>* forms) WARN_UNUSED_RESULT = 0; virtual bool GetBlacklistLogins(ScopedVector<autofill::PasswordForm>* forms) WARN_UNUSED_RESULT = 0; virtual bool GetAllLogins(ScopedVector<autofill::PasswordForm>* forms) WARN_UNUSED_RESULT = 0; }; // Takes ownership of |login_db| and |backend|. |backend| may be NULL in which // case this PasswordStoreX will act the same as PasswordStoreDefault. PasswordStoreX(scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner, scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner, std::unique_ptr<password_manager::LoginDatabase> login_db, NativeBackend* backend); private: friend class PasswordStoreXTest; ~PasswordStoreX() override; // Implements PasswordStore interface. password_manager::PasswordStoreChangeList AddLoginImpl( const autofill::PasswordForm& form) override; password_manager::PasswordStoreChangeList UpdateLoginImpl( const autofill::PasswordForm& form) override; password_manager::PasswordStoreChangeList RemoveLoginImpl( const autofill::PasswordForm& form) override; password_manager::PasswordStoreChangeList RemoveLoginsByURLAndTimeImpl( const base::Callback<bool(const GURL&)>& url_filter, base::Time delete_begin, base::Time delete_end) override; password_manager::PasswordStoreChangeList RemoveLoginsCreatedBetweenImpl( base::Time delete_begin, base::Time delete_end) override; password_manager::PasswordStoreChangeList RemoveLoginsSyncedBetweenImpl( base::Time delete_begin, base::Time delete_end) override; password_manager::PasswordStoreChangeList DisableAutoSignInForOriginsImpl( const base::Callback<bool(const GURL&)>& origin_filter) override; ScopedVector<autofill::PasswordForm> FillMatchingLogins( const FormDigest& form) override; bool FillAutofillableLogins( ScopedVector<autofill::PasswordForm>* forms) override; bool FillBlacklistLogins( ScopedVector<autofill::PasswordForm>* forms) override; // Check to see whether migration is necessary, and perform it if so. void CheckMigration(); // Return true if we should try using the native backend. bool use_native_backend() { return !!backend_.get(); } // Return true if we can fall back on the default store, warning the first // time we call it when falling back is necessary. See |allow_fallback_|. bool allow_default_store(); // Synchronously migrates all the passwords stored in the login database to // the native backend. If successful, the login database will be left with no // stored passwords, and the number of passwords migrated will be returned. // (This might be 0 if migration was not necessary.) Returns < 0 on failure. ssize_t MigrateLogins(); // The native backend in use, or NULL if none. std::unique_ptr<NativeBackend> backend_; // Whether we have already attempted migration to the native store. bool migration_checked_; // Whether we should allow falling back to the default store. If there is // nothing to migrate, then the first attempt to use the native store will // be the first time we try to use it and we should allow falling back. If // we have migrated successfully, then we do not allow falling back. bool allow_fallback_; DISALLOW_COPY_AND_ASSIGN(PasswordStoreX); }; #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_X_H_
{ "content_hash": "428f58e18024c176f4358f3e8b523c43", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 80, "avg_line_length": 44.95070422535211, "alnum_prop": 0.7306908976970077, "repo_name": "danakj/chromium", "id": "e1b6f16b755a7545a2a4cf095b72f17a3eddae49", "size": "6902", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "chrome/browser/password_manager/password_store_x.h", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
import unittest from quantum.common import utils from quantum.plugins.nec.common import config from quantum.plugins.nec.db import api as ndb from quantum.plugins.nec.db import models as nmodels from quantum.plugins.nec import ofc_manager class OFCManagerTest(unittest.TestCase): """Class conisting of OFCManager unit tests""" def setUp(self): driver = "quantum.tests.unit.nec.stub_ofc_driver.StubOFCDriver" config.CONF.set_override('driver', driver, 'OFC') ndb.initialize() self.ofc = ofc_manager.OFCManager() def tearDown(self): ndb.clear_db() def get_random_params(self): """create random parameters for portinfo test""" tenant = utils.str_uuid() network = utils.str_uuid() port = utils.str_uuid() _filter = utils.str_uuid() none = utils.str_uuid() return tenant, network, port, _filter, none def testa_create_ofc_tenant(self): """test create ofc_tenant""" t, n, p, f, none = self.get_random_params() self.assertFalse(ndb.find_ofc_item(nmodels.OFCTenant, t)) self.ofc.create_ofc_tenant(t) self.assertTrue(ndb.find_ofc_item(nmodels.OFCTenant, t)) tenant = ndb.find_ofc_item(nmodels.OFCTenant, t) self.assertEqual(tenant.id, "ofc-" + t[:-4]) def testb_exists_ofc_tenant(self): """test exists_ofc_tenant""" t, n, p, f, none = self.get_random_params() self.assertFalse(self.ofc.exists_ofc_tenant(t)) self.ofc.create_ofc_tenant(t) self.assertTrue(self.ofc.exists_ofc_tenant(t)) def testc_delete_ofc_tenant(self): """test delete ofc_tenant""" t, n, p, f, none = self.get_random_params() self.ofc.create_ofc_tenant(t) self.assertTrue(ndb.find_ofc_item(nmodels.OFCTenant, t)) self.ofc.delete_ofc_tenant(t) self.assertFalse(ndb.find_ofc_item(nmodels.OFCTenant, t)) def testd_create_ofc_network(self): """test create ofc_network""" t, n, p, f, none = self.get_random_params() self.ofc.create_ofc_tenant(t) self.assertFalse(ndb.find_ofc_item(nmodels.OFCNetwork, n)) self.ofc.create_ofc_network(t, n) self.assertTrue(ndb.find_ofc_item(nmodels.OFCNetwork, n)) network = ndb.find_ofc_item(nmodels.OFCNetwork, n) self.assertEqual(network.id, "ofc-" + n[:-4]) def teste_exists_ofc_network(self): """test exists_ofc_network""" t, n, p, f, none = self.get_random_params() self.ofc.create_ofc_tenant(t) self.assertFalse(self.ofc.exists_ofc_network(n)) self.ofc.create_ofc_network(t, n) self.assertTrue(self.ofc.exists_ofc_network(n)) def testf_delete_ofc_network(self): """test delete ofc_network""" t, n, p, f, none = self.get_random_params() self.ofc.create_ofc_tenant(t) self.ofc.create_ofc_network(t, n) self.assertTrue(ndb.find_ofc_item(nmodels.OFCNetwork, n)) self.ofc.delete_ofc_network(t, n) self.assertFalse(ndb.find_ofc_item(nmodels.OFCNetwork, n)) def testg_create_ofc_port(self): """test create ofc_port""" t, n, p, f, none = self.get_random_params() self.ofc.create_ofc_tenant(t) self.ofc.create_ofc_network(t, n) ndb.add_portinfo(p, "0xabc", 1, 65535, "00:11:22:33:44:55") self.assertFalse(ndb.find_ofc_item(nmodels.OFCPort, p)) self.ofc.create_ofc_port(t, n, p) self.assertTrue(ndb.find_ofc_item(nmodels.OFCPort, p)) port = ndb.find_ofc_item(nmodels.OFCPort, p) self.assertEqual(port.id, "ofc-" + p[:-4]) def testh_exists_ofc_port(self): """test exists_ofc_port""" t, n, p, f, none = self.get_random_params() self.ofc.create_ofc_tenant(t) self.ofc.create_ofc_network(t, n) ndb.add_portinfo(p, "0xabc", 2, 65535, "00:12:22:33:44:55") self.assertFalse(self.ofc.exists_ofc_port(p)) self.ofc.create_ofc_port(t, n, p) self.assertTrue(self.ofc.exists_ofc_port(p)) def testi_delete_ofc_port(self): """test delete ofc_port""" t, n, p, f, none = self.get_random_params() self.ofc.create_ofc_tenant(t) self.ofc.create_ofc_network(t, n) ndb.add_portinfo(p, "0xabc", 3, 65535, "00:13:22:33:44:55") self.ofc.create_ofc_port(t, n, p) self.assertTrue(ndb.find_ofc_item(nmodels.OFCPort, p)) self.ofc.delete_ofc_port(t, n, p) self.assertFalse(ndb.find_ofc_item(nmodels.OFCPort, p)) def testj_create_ofc_packet_filter(self): """test create ofc_filter""" t, n, p, f, none = self.get_random_params() self.ofc.create_ofc_tenant(t) self.ofc.create_ofc_network(t, n) self.assertFalse(ndb.find_ofc_item(nmodels.OFCFilter, f)) self.ofc.create_ofc_packet_filter(t, n, f, {}) self.assertTrue(ndb.find_ofc_item(nmodels.OFCFilter, f)) _filter = ndb.find_ofc_item(nmodels.OFCFilter, f) self.assertEqual(_filter.id, "ofc-" + f[:-4]) def testk_exists_ofc_packet_filter(self): """test exists_ofc_packet_filter""" t, n, p, f, none = self.get_random_params() self.ofc.create_ofc_tenant(t) self.ofc.create_ofc_network(t, n) self.assertFalse(self.ofc.exists_ofc_packet_filter(f)) self.ofc.create_ofc_packet_filter(t, n, f, {}) self.assertTrue(self.ofc.exists_ofc_packet_filter(f)) def testl_delete_ofc_packet_filter(self): """test delete ofc_filter""" t, n, p, f, none = self.get_random_params() self.ofc.create_ofc_tenant(t) self.ofc.create_ofc_network(t, n) self.ofc.create_ofc_packet_filter(t, n, f, {}) self.assertTrue(ndb.find_ofc_item(nmodels.OFCFilter, f)) self.ofc.delete_ofc_packet_filter(t, n, f) self.assertFalse(ndb.find_ofc_item(nmodels.OFCFilter, f))
{ "content_hash": "2a055e40f2a78ad8c01921b276468127", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 71, "avg_line_length": 41.42657342657343, "alnum_prop": 0.6205266711681297, "repo_name": "psiwczak/quantum", "id": "05dde8e52a06a2646edcce4fe91a508ece92c3d8", "size": "6623", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "quantum/tests/unit/nec/test_ofc_manager.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "JavaScript", "bytes": "67928" }, { "name": "Perl", "bytes": "32974" }, { "name": "Python", "bytes": "2446843" }, { "name": "Scala", "bytes": "3005" }, { "name": "Shell", "bytes": "7879" } ], "symlink_target": "" }
@interface GHSearchUserViewController : GHTableViewController { @private NSString *_searchString; NSArray *_users; } @property (nonatomic, copy) NSString *searchString; @property (nonatomic, retain) NSArray *users; - (id)initWithSearchString:(NSString *)searchString; @end
{ "content_hash": "94c88ff858a137569bd52eb2f772af76", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 63, "avg_line_length": 23.666666666666668, "alnum_prop": 0.7605633802816901, "repo_name": "OliverLetterer/iHubSC", "id": "65575abc7ee40b9ce511160078708c8a95c6f664", "size": "488", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "iGithub/iPhone/UI/Search/GHSearchUserViewController.h", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "125460" }, { "name": "Objective-C", "bytes": "1568361" }, { "name": "Ruby", "bytes": "302" } ], "symlink_target": "" }
static double g_pixelRatio = 1.0; static const size_t kInitialWindowWidth = 800; static const size_t kInitialWindowHeight = 600; // Maximum damage history - for triple buffering we need to store damage for // last two frames; Some Android devices (Pixel 4) use quad buffering. static const int kMaxHistorySize = 10; // Keeps track of the most recent frame damages so that existing damage can // be easily computed. std::list<FlutterRect> damage_history_; // Keeps track of the existing damage associated with each FBO ID std::unordered_map<intptr_t, FlutterRect*> existing_damage_map_; EGLDisplay display_; EGLSurface surface_; static_assert(FLUTTER_ENGINE_VERSION == 1, "This Flutter Embedder was authored against the stable Flutter " "API at version 1. There has been a serious breakage in the " "API. Please read the ChangeLog and take appropriate action " "before updating this assertion"); void GLFWcursorPositionCallbackAtPhase(GLFWwindow* window, FlutterPointerPhase phase, double x, double y) { FlutterPointerEvent event = {}; event.struct_size = sizeof(event); event.phase = phase; event.x = x * g_pixelRatio; event.y = y * g_pixelRatio; event.timestamp = std::chrono::duration_cast<std::chrono::microseconds>( std::chrono::high_resolution_clock::now().time_since_epoch()) .count(); FlutterEngineSendPointerEvent( reinterpret_cast<FlutterEngine>(glfwGetWindowUserPointer(window)), &event, 1); } void GLFWcursorPositionCallback(GLFWwindow* window, double x, double y) { GLFWcursorPositionCallbackAtPhase(window, FlutterPointerPhase::kMove, x, y); } void GLFWmouseButtonCallback(GLFWwindow* window, int key, int action, int mods) { if (key == GLFW_MOUSE_BUTTON_1 && action == GLFW_PRESS) { double x, y; glfwGetCursorPos(window, &x, &y); GLFWcursorPositionCallbackAtPhase(window, FlutterPointerPhase::kDown, x, y); glfwSetCursorPosCallback(window, GLFWcursorPositionCallback); } if (key == GLFW_MOUSE_BUTTON_1 && action == GLFW_RELEASE) { double x, y; glfwGetCursorPos(window, &x, &y); GLFWcursorPositionCallbackAtPhase(window, FlutterPointerPhase::kUp, x, y); glfwSetCursorPosCallback(window, nullptr); } } static void GLFWKeyCallback(GLFWwindow* window, int key, int scancode, int action, int mods) { if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) { glfwSetWindowShouldClose(window, GLFW_TRUE); } } void GLFWwindowSizeCallback(GLFWwindow* window, int width, int height) { FlutterWindowMetricsEvent event = {}; event.struct_size = sizeof(event); event.width = width * g_pixelRatio; event.height = height * g_pixelRatio; event.pixel_ratio = g_pixelRatio; FlutterEngineSendWindowMetricsEvent( reinterpret_cast<FlutterEngine>(glfwGetWindowUserPointer(window)), &event); } // Auxiliary function used to transform a FlutterRect into the format that is // expected by the EGL functions (i.e. array of EGLint). static std::array<EGLint, 4> RectToInts(const FlutterRect rect) { EGLint height; eglQuerySurface(display_, surface_, EGL_HEIGHT, &height); std::array<EGLint, 4> res{ static_cast<int>(rect.left), height - static_cast<int>(rect.bottom), static_cast<int>(rect.right) - static_cast<int>(rect.left), static_cast<int>(rect.bottom) - static_cast<int>(rect.top)}; return res; } // Auxiliary function to union the damage regions comprised by two FlutterRect // element. It saves the result of this join in the rect variable. static void JoinFlutterRect(FlutterRect* rect, FlutterRect additional_rect) { rect->left = std::min(rect->left, additional_rect.left); rect->top = std::min(rect->top, additional_rect.top); rect->right = std::max(rect->right, additional_rect.right); rect->bottom = std::max(rect->bottom, additional_rect.bottom); } // Auxiliary function used to check if the given list of extensions contains the // requested extension name. static bool HasExtension(const char* extensions, const char* name) { const char* r = strstr(extensions, name); auto len = strlen(name); // check that the extension name is terminated by space or null terminator return r != nullptr && (r[len] == ' ' || r[len] == 0); } bool RunFlutter(GLFWwindow* window, const std::string& project_path, const std::string& icudtl_path) { FlutterRendererConfig config = {}; config.type = kOpenGL; config.open_gl.struct_size = sizeof(config.open_gl); config.open_gl.make_current = [](void* userdata) -> bool { glfwMakeContextCurrent(static_cast<GLFWwindow*>(userdata)); return true; }; config.open_gl.clear_current = [](void*) -> bool { glfwMakeContextCurrent(nullptr); // is this even a thing? return true; }; config.open_gl.present_with_info = [](void* userdata, const FlutterPresentInfo* info) -> bool { // Free the existing damage that was allocated to this frame. free(existing_damage_map_[info->fbo_id]); // Get list of extensions. const char* extensions = eglQueryString(display_, EGL_EXTENSIONS); // Retrieve the set damage region function. PFNEGLSETDAMAGEREGIONKHRPROC set_damage_region_ = nullptr; if (HasExtension(extensions, "EGL_KHR_partial_update")) { set_damage_region_ = reinterpret_cast<PFNEGLSETDAMAGEREGIONKHRPROC>( eglGetProcAddress("eglSetDamageRegionKHR")); } // Retrieve the swap buffers with damage function. PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC swap_buffers_with_damage_ = nullptr; if (HasExtension(extensions, "EGL_EXT_swap_buffers_with_damage")) { swap_buffers_with_damage_ = reinterpret_cast<PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC>( eglGetProcAddress("eglSwapBuffersWithDamageEXT")); } else if (HasExtension(extensions, "EGL_KHR_swap_buffers_with_damage")) { swap_buffers_with_damage_ = reinterpret_cast<PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC>( eglGetProcAddress("eglSwapBuffersWithDamageKHR")); } if (set_damage_region_) { // Set the buffer damage as the damage region. auto buffer_rects = RectToInts(info->buffer_damage.damage[0]); set_damage_region_(display_, surface_, buffer_rects.data(), 1); } // Add frame damage to damage history damage_history_.push_back(info->frame_damage.damage[0]); if (damage_history_.size() > kMaxHistorySize) { damage_history_.pop_front(); } if (swap_buffers_with_damage_) { // Swap buffers with frame damage. auto frame_rects = RectToInts(info->frame_damage.damage[0]); return swap_buffers_with_damage_(display_, surface_, frame_rects.data(), 1); } else { // If the required extensions for partial repaint were not provided, do // full repaint. return eglSwapBuffers(display_, surface_); } }; config.open_gl.fbo_callback = [](void*) -> uint32_t { return 0; // FBO0 }; config.open_gl.populate_existing_damage = [](void* userdata, intptr_t fbo_id, FlutterDamage* existing_damage) -> void { // Given the FBO age, create existing damage region by joining all frame // damages since FBO was last used EGLint age; if (glfwExtensionSupported("GL_EXT_buffer_age") == GLFW_TRUE) { eglQuerySurface(display_, surface_, EGL_BUFFER_AGE_EXT, &age); } else { age = 4; // Virtually no driver should have a swapchain length > 4. } existing_damage->num_rects = 1; // Allocate the array of rectangles for the existing damage. existing_damage_map_[fbo_id] = static_cast<FlutterRect*>( malloc(sizeof(FlutterRect) * existing_damage->num_rects)); existing_damage_map_[fbo_id][0] = FlutterRect{0, 0, kInitialWindowWidth, kInitialWindowHeight}; existing_damage->damage = existing_damage_map_[fbo_id]; if (age > 1) { --age; // join up to (age - 1) last rects from damage history for (auto i = damage_history_.rbegin(); i != damage_history_.rend() && age > 0; ++i, --age) { if (i == damage_history_.rbegin()) { if (i != damage_history_.rend()) { existing_damage->damage[0] = {i->left, i->top, i->right, i->bottom}; } } else { JoinFlutterRect(&(existing_damage->damage[0]), *i); } } } }; config.open_gl.gl_proc_resolver = [](void*, const char* name) -> void* { return reinterpret_cast<void*>(glfwGetProcAddress(name)); }; config.open_gl.fbo_reset_after_present = true; // This directory is generated by `flutter build bundle`. std::string assets_path = project_path + "/build/flutter_assets"; FlutterProjectArgs args = { .struct_size = sizeof(FlutterProjectArgs), .assets_path = assets_path.c_str(), .icu_data_path = icudtl_path.c_str(), // Find this in your bin/cache directory. }; FlutterEngine engine = nullptr; FlutterEngineResult result = FlutterEngineRun(FLUTTER_ENGINE_VERSION, &config, // renderer &args, window, &engine); if (result != kSuccess || engine == nullptr) { std::cout << "Could not run the Flutter Engine." << std::endl; return false; } glfwSetWindowUserPointer(window, engine); GLFWwindowSizeCallback(window, kInitialWindowWidth, kInitialWindowHeight); return true; } void printUsage() { std::cout << "usage: embedder_example_drm <path to project> <path to icudtl.dat>" << std::endl; } void GLFW_ErrorCallback(int error, const char* description) { std::cout << "GLFW Error: (" << error << ") " << description << std::endl; } int main(int argc, const char* argv[]) { if (argc != 3) { printUsage(); return 1; } std::string project_path = argv[1]; std::string icudtl_path = argv[2]; glfwSetErrorCallback(GLFW_ErrorCallback); int result = glfwInit(); if (result != GLFW_TRUE) { std::cout << "Could not initialize GLFW." << std::endl; return EXIT_FAILURE; } #if defined(__linux__) glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_EGL_CONTEXT_API); #endif GLFWwindow* window = glfwCreateWindow( kInitialWindowWidth, kInitialWindowHeight, "Flutter", NULL, NULL); if (window == nullptr) { std::cout << "Could not create GLFW window." << std::endl; return EXIT_FAILURE; } int framebuffer_width, framebuffer_height; glfwGetFramebufferSize(window, &framebuffer_width, &framebuffer_height); g_pixelRatio = framebuffer_width / kInitialWindowWidth; // Get the display and surface variables. display_ = glfwGetEGLDisplay(); surface_ = glfwGetEGLSurface(window); bool run_result = RunFlutter(window, project_path, icudtl_path); if (!run_result) { std::cout << "Could not run the Flutter engine." << std::endl; return EXIT_FAILURE; } glfwSetKeyCallback(window, GLFWKeyCallback); glfwSetWindowSizeCallback(window, GLFWwindowSizeCallback); glfwSetMouseButtonCallback(window, GLFWmouseButtonCallback); while (!glfwWindowShouldClose(window)) { glfwWaitEvents(); } glfwDestroyWindow(window); glfwTerminate(); return EXIT_SUCCESS; }
{ "content_hash": "66c0b8252f4dddfb03c2650509b2977b", "timestamp": "", "source": "github", "line_count": 312, "max_line_length": 80, "avg_line_length": 36.80128205128205, "alnum_prop": 0.6598153631771468, "repo_name": "rmacnak-google/engine", "id": "d75811092f9275d2e698e86302d4d85304973ef2", "size": "12020", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "examples/glfw_drm/FlutterEmbedderGLFW.cc", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Batchfile", "bytes": "6111" }, { "name": "C", "bytes": "365332" }, { "name": "C++", "bytes": "10588063" }, { "name": "CSS", "bytes": "64" }, { "name": "Dart", "bytes": "6784393" }, { "name": "Dockerfile", "bytes": "3107" }, { "name": "GLSL", "bytes": "105587" }, { "name": "HTML", "bytes": "200" }, { "name": "Java", "bytes": "2388255" }, { "name": "Objective-C", "bytes": "430403" }, { "name": "Objective-C++", "bytes": "1778585" }, { "name": "Python", "bytes": "261091" }, { "name": "Roff", "bytes": "55608" }, { "name": "Shell", "bytes": "53348" } ], "symlink_target": "" }
package com.indeed.proctor.consumer.spring; import com.google.common.collect.ImmutableSet; import com.google.common.io.CharStreams; import com.indeed.proctor.common.AbstractProctorLoader; import com.indeed.proctor.common.ProctorResult; import com.indeed.proctor.common.ProctorSpecification; import com.indeed.proctor.common.ProctorUtils; import com.indeed.proctor.common.StringProctorLoader; import com.indeed.proctor.common.model.TestType; import com.indeed.proctor.consumer.AbstractGroups; import org.junit.Test; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; public class SampleRandomGroupsHttpHandlerTest { private static final String PROCTOR_MATRIX_JSON = "proctor-matrix.json"; private static final String PROCTOR_SPECIFICATION_JSON = "proctor-specification.json"; private static final AbstractProctorLoader PROCTOR_LOADER; static { PROCTOR_LOADER = getProctorLoader(); PROCTOR_LOADER.load(); } @Test public void testGetTestType() { final SampleRandomGroupsHttpHandler.ContextSupplier<Object> mockedSupplier = mock(SampleRandomGroupsHttpHandler.ContextSupplier.class); final SampleRandomGroupsHttpHandler<Object> handler = new SampleRandomGroupsHttpHandler<>(PROCTOR_LOADER, mockedSupplier); assertThat(handler.getTestType(ImmutableSet.of("account1_tst"))) .isEqualTo(TestType.ACCOUNT); assertThat(handler.getTestType(ImmutableSet.of("account1_tst", "account2_tst"))) .isEqualTo(TestType.ACCOUNT); assertThatThrownBy(() -> handler.getTestType(ImmutableSet.of("account1_tst", "email_tst"))) .isInstanceOf(IllegalArgumentException.class) .hasMessageStartingWith("Target test group list contains tests of multiple test types: "); assertThatThrownBy(() -> handler.getTestType(ImmutableSet.of("account1_tst", "unknown_tst"))) .isInstanceOf(IllegalArgumentException.class) .hasMessage("Unrecognized test name: 'unknown_tst'"); verifyNoMoreInteractions(mockedSupplier); } @Test public void testRunSampling() { final SampleRandomGroupsHttpHandler.ContextSupplier<Object> mockedSupplier = mock(SampleRandomGroupsHttpHandler.ContextSupplier.class); final AbstractGroups mockedGroups = mock(AbstractGroups.class); final Object context = new Object(); when(mockedGroups.getAsProctorResult()).thenReturn(ProctorResult.EMPTY); when(mockedSupplier.getRandomGroups(eq(context), any())) .thenReturn(mockedGroups); final SampleRandomGroupsHttpHandler<Object> handler = new SampleRandomGroupsHttpHandler<>(PROCTOR_LOADER, mockedSupplier); // check if the keys in the return value are correct assertThat(handler.runSampling(context, ImmutableSet.of("account1_tst"), TestType.ACCOUNT, 10)) .containsOnlyKeys( "account1_tst-1", "account1_tst0", "account1_tst1" ); // check if methods of mocked instances are correctly called verify(mockedGroups, times(10)).getAsProctorResult(); verify(mockedSupplier, times(10)).getRandomGroups(eq(context), any()); verifyNoMoreInteractions(mockedSupplier, mockedGroups); } @Test public void testGetTargetTestGroups() { final SampleRandomGroupsHttpHandler.ContextSupplier<Object> mockedSupplier = mock(SampleRandomGroupsHttpHandler.ContextSupplier.class); final SampleRandomGroupsHttpHandler<Object> handler = new SampleRandomGroupsHttpHandler<>(PROCTOR_LOADER, mockedSupplier); assertThat(handler.getTargetTestGroups(ImmutableSet.of("account1_tst", "email_tst"))) .containsExactlyInAnyOrder( "account1_tst-1", "account1_tst0", "account1_tst1", "email_tst0", "email_tst1", "email_tst2", "email_tst3", "email_tst4" ); verifyNoMoreInteractions(mockedSupplier); } private static AbstractProctorLoader getProctorLoader() { return new StringProctorLoader( getProctorSpecification(), PROCTOR_MATRIX_JSON, getProctorMatrixJsonAsString() ); } private static String getProctorMatrixJsonAsString() { try (final InputStream inputStream = SampleRandomGroupsHttpHandlerTest.class.getResourceAsStream(PROCTOR_MATRIX_JSON); final Reader reader = new InputStreamReader(inputStream)) { return CharStreams.toString(reader); } catch (final IOException e) { throw new RuntimeException("failed to read " + PROCTOR_MATRIX_JSON); } } private static ProctorSpecification getProctorSpecification() { try (final InputStream inputStream = SampleRandomGroupsHttpHandlerTest.class.getResourceAsStream(PROCTOR_SPECIFICATION_JSON)) { return ProctorUtils.readSpecification(inputStream); } catch (final IOException e) { throw new RuntimeException("failed to read " + PROCTOR_SPECIFICATION_JSON); } } }
{ "content_hash": "3e290d44edd5aa34f374ba609abee3f2", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 143, "avg_line_length": 45.71653543307087, "alnum_prop": 0.6951429555632105, "repo_name": "indeedeng/proctor", "id": "fa2a8831f6a9b79a912d419eadc470b6403dc366", "size": "5806", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "proctor-consumer/src/test/java/com/indeed/proctor/consumer/spring/SampleRandomGroupsHttpHandlerTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "70988" }, { "name": "FreeMarker", "bytes": "31160" }, { "name": "Java", "bytes": "2118921" }, { "name": "JavaScript", "bytes": "190450" } ], "symlink_target": "" }
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <title>Custom Terminals</title> <link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.78.1"> <link rel="home" href="../../index.html" title="Chapter&#160;1.&#160;Phoenix 3.0"> <link rel="up" href="../inside.html" title="Inside Phoenix"> <link rel="prev" href="rules.html" title="Predefined Expressions and Rules"> <link rel="next" href="placeholder_unification.html" title="Placeholder Unification"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table cellpadding="2" width="100%"><tr> <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td> <td align="center"><a href="../../../../../../index.html">Home</a></td> <td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td> <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> <td align="center"><a href="../../../../../../more/index.htm">More</a></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="rules.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../inside.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="placeholder_unification.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> </div> <div class="section"> <div class="titlepage"><div><div><h3 class="title"> <a name="phoenix.inside.custom_terminals"></a><a class="link" href="custom_terminals.html" title="Custom Terminals">Custom Terminals</a> </h3></div></div></div> <p> Custom Terminals are used in Phoenix to handle special values transparently. For example, as Phoenix captures everything by value, we needed to use <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">reference_wrapper</span></code> to bring reference semantics into Phoenix. </p> <p> Custom terminals could be any wrapper class: </p> <pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">is_custom_terminal</span><span class="special">;</span> </pre> <p> needs to be specialized in order for Phoenix to recognize this wrapper type. <code class="computeroutput"><span class="identifier">default_action</span></code> calls <code class="computeroutput"><span class="identifier">custom_terminal</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span></code>. </p> <p> Example: </p> <pre class="programlisting"><span class="comment">// Call out boost::reference_wrapper for special handling</span> <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">is_custom_terminal</span><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">reference_wrapper</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="special">:</span> <span class="identifier">mpl</span><span class="special">::</span><span class="identifier">true_</span> <span class="special">{};</span> <span class="comment">// Special handling for boost::reference_wrapper</span> <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">custom_terminal</span><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">reference_wrapper</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="special">{</span> <span class="keyword">typedef</span> <span class="identifier">T</span> <span class="special">&amp;</span><span class="identifier">result_type</span><span class="special">;</span> <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Context</span><span class="special">&gt;</span> <span class="identifier">T</span> <span class="special">&amp;</span><span class="keyword">operator</span><span class="special">()(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">reference_wrapper</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">r</span><span class="special">,</span> <span class="identifier">Context</span> <span class="special">&amp;)</span> <span class="keyword">const</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">r</span><span class="special">;</span> <span class="special">}</span> <span class="special">};</span> </pre> </div> <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> <td align="left"></td> <td align="right"><div class="copyright-footer">Copyright &#169; 2002-2005, 2010 Joel de Guzman, Dan Marsden, Thomas Heller<p> Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) </p> </div></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="rules.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../inside.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="placeholder_unification.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> </div> </body> </html>
{ "content_hash": "38cd42b8a394c6e1781cda3ee60386d0", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 532, "avg_line_length": 84.225, "alnum_prop": 0.6629563668744435, "repo_name": "ryancoleman/autodock-vina", "id": "4c8130c94814c5efdc2fa057601b2aa6b326c848", "size": "6738", "binary": false, "copies": "7", "ref": "refs/heads/master", "path": "boost_1_54_0/libs/phoenix/doc/html/phoenix/inside/custom_terminals.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "106823" }, { "name": "C++", "bytes": "198249" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_65) on Wed Sep 03 20:05:59 PDT 2014 --> <meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> <title>Uses of Class org.apache.hadoop.hbase.client.PerClientRandomNonceGenerator (HBase 0.98.6-hadoop2 API)</title> <meta name="date" content="2014-09-03"> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.apache.hadoop.hbase.client.PerClientRandomNonceGenerator (HBase 0.98.6-hadoop2 API)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../org/apache/hadoop/hbase/client/PerClientRandomNonceGenerator.html" title="class in org.apache.hadoop.hbase.client">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/apache/hadoop/hbase/client/class-use/PerClientRandomNonceGenerator.html" target="_top">Frames</a></li> <li><a href="PerClientRandomNonceGenerator.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class org.apache.hadoop.hbase.client.PerClientRandomNonceGenerator" class="title">Uses of Class<br>org.apache.hadoop.hbase.client.PerClientRandomNonceGenerator</h2> </div> <div class="classUseContainer">No usage of org.apache.hadoop.hbase.client.PerClientRandomNonceGenerator</div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../org/apache/hadoop/hbase/client/PerClientRandomNonceGenerator.html" title="class in org.apache.hadoop.hbase.client">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/apache/hadoop/hbase/client/class-use/PerClientRandomNonceGenerator.html" target="_top">Frames</a></li> <li><a href="PerClientRandomNonceGenerator.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2014 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> </body> </html>
{ "content_hash": "738f64457ebe92cadd3fc3465cac079b", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 183, "avg_line_length": 40.21367521367522, "alnum_prop": 0.6303931987247609, "repo_name": "lshain/hbase-0.98.6-hadoop2", "id": "bbcd86d23125aa3c17161776d7b31f4af53abd4e", "size": "4705", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/devapidocs/org/apache/hadoop/hbase/client/class-use/PerClientRandomNonceGenerator.html", "mode": "33261", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "39965" }, { "name": "JavaScript", "bytes": "1347" }, { "name": "Ruby", "bytes": "260273" }, { "name": "Shell", "bytes": "97997" } ], "symlink_target": "" }
package com.torah.game.myrpggame.utils; import android.app.Activity; import android.content.Context; import android.content.res.Resources; import android.graphics.Point; import android.os.Build; import android.view.ViewConfiguration; import com.torah.game.myrpggame.MainApplication; import java.lang.reflect.Method; /** * Created by torahli on 2015/9/11. */ public class UIutils { /** * dp转px * * @param dipValue * @return */ public static int dip2px(float dipValue) { final float scale = MainApplication.getApplication().getResources().getDisplayMetrics().density; return (int) (dipValue * scale + 0.5f); } /** * 返回从资源中取得的像素值,sp和dp按比例转为像素 * * @param dimensResource * @return */ public static float getDimension(Context context, int dimensResource) { return context.getResources().getDimension(dimensResource); } public static int getColor(int colorRes) { return MainApplication.getApplication().getResources().getColor(colorRes); } public static String getStringRes(int stringRes) { return MainApplication.getApplication().getResources().getString(stringRes); } /** * 获取虚拟按键栏高度 * * @param context * @return */ public static int getNavigationBarHeight(Context context) { int result = 0; if (hasNavBar(context)) { Resources res = context.getResources(); int resourceId = res.getIdentifier("navigation_bar_height", "dimen", "android"); if (resourceId > 0) { result = res.getDimensionPixelSize(resourceId); } } return result; } public static void getScreenHW(Activity activity) { // 获取屏幕高 TODO Point point = new Point(); activity.getWindowManager().getDefaultDisplay().getSize(point); int screenHeight = point.y + (isMeizu() ? 0 : getNavigationBarHeight(activity)); } /** * 判断是否meizu手机 * * @return */ public static boolean isMeizu() { return Build.BRAND.equals("Meizu"); } /** * 检查是否存在虚拟按键栏 * * @param context * @return */ private static boolean hasNavBar(Context context) { Resources res = context.getResources(); int resourceId = res.getIdentifier("config_showNavigationBar", "bool", "android"); if (resourceId != 0) { boolean hasNav = res.getBoolean(resourceId); // check override flag String sNavBarOverride = getNavBarOverride(); if ("1".equals(sNavBarOverride)) { hasNav = false; } else if ("0".equals(sNavBarOverride)) { hasNav = true; } return hasNav; } else { // fallback return !ViewConfiguration.get(context).hasPermanentMenuKey(); } } /** * 判断虚拟按键栏是否重写 * * @return */ private static String getNavBarOverride() { String sNavBarOverride = null; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { try { Class c = Class.forName("android.os.SystemProperties"); Method m = c.getDeclaredMethod("get", String.class); m.setAccessible(true); sNavBarOverride = (String) m.invoke(null, "qemu.hw.mainkeys"); } catch (Throwable e) { } } return sNavBarOverride; } }
{ "content_hash": "61bc1d0395a3607f8d9d13b098c0fc82", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 104, "avg_line_length": 28.40650406504065, "alnum_prop": 0.5935890097309674, "repo_name": "Torahlzy/FoeverGame", "id": "773bce4b5cf289e1e0f524fd12e39444215ba7a8", "size": "3622", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/java/com/torah/game/myrpggame/utils/UIutils.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "65257" } ], "symlink_target": "" }
typedef uint_least16_t char16_t; typedef uint_least32_t char32_t; # endif typedef float swift_float2 __attribute__((__ext_vector_type__(2))); typedef float swift_float3 __attribute__((__ext_vector_type__(3))); typedef float swift_float4 __attribute__((__ext_vector_type__(4))); typedef double swift_double2 __attribute__((__ext_vector_type__(2))); typedef double swift_double3 __attribute__((__ext_vector_type__(3))); typedef double swift_double4 __attribute__((__ext_vector_type__(4))); typedef int swift_int2 __attribute__((__ext_vector_type__(2))); typedef int swift_int3 __attribute__((__ext_vector_type__(3))); typedef int swift_int4 __attribute__((__ext_vector_type__(4))); typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #endif #if !defined(SWIFT_PASTE) # define SWIFT_PASTE_HELPER(x, y) x##y # define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) #endif #if !defined(SWIFT_METATYPE) # define SWIFT_METATYPE(X) Class #endif #if !defined(SWIFT_CLASS_PROPERTY) # if __has_feature(objc_class_property) # define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ # else # define SWIFT_CLASS_PROPERTY(...) # endif #endif #if __has_attribute(objc_runtime_name) # define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) #else # define SWIFT_RUNTIME_NAME(X) #endif #if __has_attribute(swift_name) # define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) #else # define SWIFT_COMPILE_NAME(X) #endif #if __has_attribute(objc_method_family) # define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) #else # define SWIFT_METHOD_FAMILY(X) #endif #if __has_attribute(noescape) # define SWIFT_NOESCAPE __attribute__((noescape)) #else # define SWIFT_NOESCAPE #endif #if __has_attribute(warn_unused_result) # define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #else # define SWIFT_WARN_UNUSED_RESULT #endif #if __has_attribute(noreturn) # define SWIFT_NORETURN __attribute__((noreturn)) #else # define SWIFT_NORETURN #endif #if !defined(SWIFT_CLASS_EXTRA) # define SWIFT_CLASS_EXTRA #endif #if !defined(SWIFT_PROTOCOL_EXTRA) # define SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_ENUM_EXTRA) # define SWIFT_ENUM_EXTRA #endif #if !defined(SWIFT_CLASS) # if __has_attribute(objc_subclassing_restricted) # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA # define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA # else # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA # define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA # endif #endif #if !defined(SWIFT_PROTOCOL) # define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA # define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA #endif #if !defined(SWIFT_EXTENSION) # define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) #endif #if !defined(OBJC_DESIGNATED_INITIALIZER) # if __has_attribute(objc_designated_initializer) # define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) # else # define OBJC_DESIGNATED_INITIALIZER # endif #endif #if !defined(SWIFT_ENUM_ATTR) # if defined(__has_attribute) && __has_attribute(enum_extensibility) # define SWIFT_ENUM_ATTR __attribute__((enum_extensibility(open))) # else # define SWIFT_ENUM_ATTR # endif #endif #if !defined(SWIFT_ENUM) # define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_ATTR SWIFT_ENUM_EXTRA _name : _type # if __has_feature(generalized_swift_name) # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR SWIFT_ENUM_EXTRA _name : _type # else # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) SWIFT_ENUM(_type, _name) # endif #endif #if !defined(SWIFT_UNAVAILABLE) # define SWIFT_UNAVAILABLE __attribute__((unavailable)) #endif #if !defined(SWIFT_UNAVAILABLE_MSG) # define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) #endif #if !defined(SWIFT_AVAILABILITY) # define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) #endif #if !defined(SWIFT_DEPRECATED) # define SWIFT_DEPRECATED __attribute__((deprecated)) #endif #if !defined(SWIFT_DEPRECATED_MSG) # define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) #endif #if __has_feature(attribute_diagnose_if_objc) # define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) #else # define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) #endif #if __has_feature(modules) @import ObjectiveC; @import Foundation; #endif #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" #pragma clang diagnostic ignored "-Wduplicate-method-arg" #if __has_warning("-Wpragma-clang-attribute") # pragma clang diagnostic ignored "-Wpragma-clang-attribute" #endif #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wnullability" SWIFT_MODULE_NAMESPACE_PUSH("SWXMLHash") @class NSXMLParser; /// The implementation of XMLParserDelegate and where the parsing actually happens. SWIFT_CLASS("_TtC9SWXMLHash13FullXMLParser") @interface FullXMLParser : NSObject <NSXMLParserDelegate> - (void)parser:(NSXMLParser * _Nonnull)parser didStartElement:(NSString * _Nonnull)elementName namespaceURI:(NSString * _Nullable)namespaceURI qualifiedName:(NSString * _Nullable)qName attributes:(NSDictionary<NSString *, NSString *> * _Nonnull)attributeDict; - (void)parser:(NSXMLParser * _Nonnull)parser foundCharacters:(NSString * _Nonnull)string; - (void)parser:(NSXMLParser * _Nonnull)parser didEndElement:(NSString * _Nonnull)elementName namespaceURI:(NSString * _Nullable)namespaceURI qualifiedName:(NSString * _Nullable)qName; - (nonnull instancetype)init SWIFT_UNAVAILABLE; @end /// The implementation of XMLParserDelegate and where the lazy parsing actually happens. SWIFT_CLASS("_TtC9SWXMLHash13LazyXMLParser") @interface LazyXMLParser : NSObject <NSXMLParserDelegate> @property (nonatomic, copy) NSData * _Nullable data; - (void)parser:(NSXMLParser * _Nonnull)parser didStartElement:(NSString * _Nonnull)elementName namespaceURI:(NSString * _Nullable)namespaceURI qualifiedName:(NSString * _Nullable)qName attributes:(NSDictionary<NSString *, NSString *> * _Nonnull)attributeDict; - (void)parser:(NSXMLParser * _Nonnull)parser foundCharacters:(NSString * _Nonnull)string; - (void)parser:(NSXMLParser * _Nonnull)parser didEndElement:(NSString * _Nonnull)elementName namespaceURI:(NSString * _Nullable)namespaceURI qualifiedName:(NSString * _Nullable)qName; - (BOOL)onMatch SWIFT_WARN_UNUSED_RESULT; - (nonnull instancetype)init SWIFT_UNAVAILABLE; @end SWIFT_MODULE_NAMESPACE_POP #pragma clang diagnostic pop
{ "content_hash": "c58816bd471e7015b3b953453d39e978", "timestamp": "", "source": "github", "line_count": 171, "max_line_length": 259, "avg_line_length": 41.21637426900585, "alnum_prop": 0.7468785471055619, "repo_name": "yopeso/Taylor", "id": "240df3468b00b79d97d5e51d2af0bfa04d0abc85", "size": "8382", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "Carthage/Build/Mac/SWXMLHash.framework/Versions/A/Headers/SWXMLHash-Swift.h", "mode": "33188", "license": "mit", "language": [ { "name": "Makefile", "bytes": "4106" }, { "name": "Objective-C", "bytes": "4732" }, { "name": "Python", "bytes": "13620" }, { "name": "Shell", "bytes": "1353" }, { "name": "Swift", "bytes": "578179" } ], "symlink_target": "" }
package io.scigraph.vocabulary; import static org.junit.Assert.assertThat; import static org.hamcrest.Matchers.*; import static org.mockito.Mockito.mock; import io.scigraph.frames.Concept; import io.scigraph.frames.NodeProperties; import io.scigraph.lucene.LuceneUtils; import io.scigraph.neo4j.GraphUtil; import io.scigraph.neo4j.NodeTransformer; import io.scigraph.util.GraphTestBase; import io.scigraph.vocabulary.Vocabulary.Query; import java.io.IOException; import java.util.List; import org.junit.Before; import org.junit.Test; import org.neo4j.graphdb.Node; import org.prefixcommons.CurieUtil; /*** * TODO: Some of these tests should be moved directly to the analyzer */ public class VocabularyNeo4jScoringTest extends GraphTestBase { VocabularyNeo4jImpl vocabulary; Concept cell; Concept onCell; NodeTransformer transformer = new NodeTransformer(); Concept buildConcept(String iri, String label, String... categories) { Node concept = createNode(iri); GraphUtil.addProperty(concept, Concept.LABEL, label); GraphUtil.addProperty(concept, NodeProperties.LABEL + LuceneUtils.EXACT_SUFFIX, label); for (String category : categories) { GraphUtil.addProperty(concept, Concept.CATEGORY, category); } return transformer.apply(concept); } @Before public void setupGraph() throws IOException { cell = buildConcept("http://x.org/#birnlex5", "Cell cell", "BL:5"); onCell = buildConcept("http://x.org/#birnlex6", "Something on cell", "HP:0008"); vocabulary = new VocabularyNeo4jImpl(graphDb, null, mock(CurieUtil.class), new NodeTransformer()); } @Test public void testGetConceptsFromTerm() { Query query = new Vocabulary.Query.Builder("cell").build(); List<Concept> results = vocabulary.searchConcepts(query); assertThat(results, containsInAnyOrder(cell, onCell)); } }
{ "content_hash": "aa6de4ff7a266b2ad7bd03fe97d54035", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 93, "avg_line_length": 32.083333333333336, "alnum_prop": 0.7288311688311688, "repo_name": "SciGraph/SciGraph", "id": "afb10262bce69e3f90416ffb57d3ebf93eff93fe", "size": "2551", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "SciGraph-core/src/test/java/io/scigraph/vocabulary/VocabularyNeo4jScoringTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "307" }, { "name": "HTML", "bytes": "5854" }, { "name": "Java", "bytes": "896391" }, { "name": "Shell", "bytes": "6588" } ], "symlink_target": "" }
package com.amazonaws.services.chime.model.transform; import javax.annotation.Generated; import com.amazonaws.SdkClientException; import com.amazonaws.Request; import com.amazonaws.http.HttpMethodName; import com.amazonaws.services.chime.model.*; import com.amazonaws.transform.Marshaller; import com.amazonaws.protocol.*; import com.amazonaws.protocol.Protocol; import com.amazonaws.annotation.SdkInternalApi; /** * GetUserRequest Marshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") @SdkInternalApi public class GetUserRequestProtocolMarshaller implements Marshaller<Request<GetUserRequest>, GetUserRequest> { private static final OperationInfo SDK_OPERATION_BINDING = OperationInfo.builder().protocol(Protocol.REST_JSON) .requestUri("/accounts/{accountId}/users/{userId}").httpMethodName(HttpMethodName.GET).hasExplicitPayloadMember(false).hasPayloadMembers(false) .serviceName("AmazonChime").build(); private final com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory; public GetUserRequestProtocolMarshaller(com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory) { this.protocolFactory = protocolFactory; } public Request<GetUserRequest> marshall(GetUserRequest getUserRequest) { if (getUserRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { final ProtocolRequestMarshaller<GetUserRequest> protocolMarshaller = protocolFactory .createProtocolMarshaller(SDK_OPERATION_BINDING, getUserRequest); protocolMarshaller.startMarshalling(); GetUserRequestMarshaller.getInstance().marshall(getUserRequest, protocolMarshaller); return protocolMarshaller.finishMarshalling(); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
{ "content_hash": "8f0a8c2bde7a63f294d20ec7f6f36d16", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 155, "avg_line_length": 38.21153846153846, "alnum_prop": 0.7468545546049321, "repo_name": "aws/aws-sdk-java", "id": "758239b5ac1131fd796a4462660fa3a22526726a", "size": "2567", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "aws-java-sdk-chime/src/main/java/com/amazonaws/services/chime/model/transform/GetUserRequestProtocolMarshaller.java", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
@interface CPERootViewController : UIViewController <UIPageViewControllerDelegate> @property (strong, nonatomic) UIPageViewController *pageViewController; @end
{ "content_hash": "a2775336cea0271a7f8fef0f4a05acc2", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 82, "avg_line_length": 32.4, "alnum_prop": 0.8518518518518519, "repo_name": "chrisjeane/ColorPalette", "id": "f5a2a271639c2857fd2e273ac5c7bc364547fbd3", "size": "1375", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Example/ColorPaletteExample/CPERootViewController.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "348119" }, { "name": "Objective-C", "bytes": "74616" }, { "name": "Ruby", "bytes": "6678" }, { "name": "Shell", "bytes": "7104" } ], "symlink_target": "" }
const ip = require('ip') const path = require('path') const webpack = require('webpack') const merge = require('webpack-merge') const HtmlWebpackPlugin = require('html-webpack-plugin') const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') const settings = require('../settings/core').dev const baseWebpackConfig = require('./webpack.base') const resolve = dir => path.join(__dirname, '..', dir) const port = process.env.PORT || settings.port Object.keys(baseWebpackConfig.entry).forEach(name => { baseWebpackConfig.entry[name] = ['./config/dev-client'].concat(baseWebpackConfig.entry[name]) }) module.exports = merge(baseWebpackConfig, { devtool: '#cheap-module-eval-source-map', output: { publicPath: `http://${ip.address()}:${port}${settings.publicPath}` }, plugins: [ new webpack.DefinePlugin({ 'process.env': settings.env }), new webpack.HotModuleReplacementPlugin(), new webpack.NoEmitOnErrorsPlugin(), new HtmlWebpackPlugin({ filename: 'index.html', favicon: resolve('public/favicon.ico'), template: settings.remoteLog ? resolve('static/dev.html') : resolve('static/index.html'), inject: true }), new FriendlyErrorsPlugin() ] })
{ "content_hash": "3672b7c7ed28511de056c4e0bedee1bd", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 95, "avg_line_length": 34.138888888888886, "alnum_prop": 0.6956875508543532, "repo_name": "halo-design/halo-optimus", "id": "f8e0591adebd90f7ebc81d9ab0c9b2edb9b8ec18", "size": "1229", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "config/webpack.dev.js", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "350" }, { "name": "CSS", "bytes": "25738" }, { "name": "HTML", "bytes": "8584" }, { "name": "JavaScript", "bytes": "347695" } ], "symlink_target": "" }
(function($){ "use strict"; $.jB.extend("form.field.select", { alias : "select", attributes : ["id","class"], inputAttributes : ['name', 'multiple', 'size', 'disabled', 'title', 'tabindex'], selectAttributes : ['label','value','disabled','selected'], init : function() { if (this.items === undefined) { throw new Error("Dropdown has no elements"); } }, doLayout : function() { var label = new $.jB.form.field.label(this.cfg), that = this, selectElement; this.element = $("<div>").append(label.doLayout()); selectElement = $("<select>").attr($.jB.util.intersect(this.inputAttributes,this)); $.each(this.items,function(index,opt) { selectElement.append($("<option>").text(opt.label).attr($.jB.util.intersect(that.selectAttributes,opt))); }); this.element.append(selectElement); this.buildElementAttr().buildStyleAttr().buildClassAttr(); return this.element; } }); })(jQuery);
{ "content_hash": "be799294443affded34ee1b2c88361a6", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 117, "avg_line_length": 27.473684210526315, "alnum_prop": 0.5766283524904214, "repo_name": "stacyjeptha/jBuilder", "id": "a661d5974fc4ad8dc714c9046cef99069e0f4f4f", "size": "1044", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/form/field/select.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "5550" }, { "name": "HTML", "bytes": "2494" }, { "name": "JavaScript", "bytes": "91627" } ], "symlink_target": "" }
extern "Java" { namespace gnu { namespace javax { namespace crypto { namespace jce { namespace key { class TwofishKeyGeneratorImpl; } } } } } } class gnu::javax::crypto::jce::key::TwofishKeyGeneratorImpl : public ::gnu::javax::crypto::jce::key::SecretKeyGeneratorImpl { public: TwofishKeyGeneratorImpl(); static ::java::lang::Class class$; }; #endif // __gnu_javax_crypto_jce_key_TwofishKeyGeneratorImpl__
{ "content_hash": "b8a1f0721113170668c264a45089c0f6", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 123, "avg_line_length": 17.82758620689655, "alnum_prop": 0.5802707930367504, "repo_name": "the-linix-project/linix-kernel-source", "id": "aa31ef4336b67ccc9a4a6568622d19bcccc20f88", "size": "785", "binary": false, "copies": "160", "ref": "refs/heads/master", "path": "gccsrc/gcc-4.7.2/libjava/gnu/javax/crypto/jce/key/TwofishKeyGeneratorImpl.h", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Ada", "bytes": "38139979" }, { "name": "Assembly", "bytes": "3723477" }, { "name": "Awk", "bytes": "83739" }, { "name": "C", "bytes": "103607293" }, { "name": "C#", "bytes": "55726" }, { "name": "C++", "bytes": "38577421" }, { "name": "CLIPS", "bytes": "6933" }, { "name": "CSS", "bytes": "32588" }, { "name": "Emacs Lisp", "bytes": "13451" }, { "name": "FORTRAN", "bytes": "4294984" }, { "name": "GAP", "bytes": "13089" }, { "name": "Go", "bytes": "11277335" }, { "name": "Haskell", "bytes": "2415" }, { "name": "Java", "bytes": "45298678" }, { "name": "JavaScript", "bytes": "6265" }, { "name": "Matlab", "bytes": "56" }, { "name": "OCaml", "bytes": "148372" }, { "name": "Objective-C", "bytes": "995127" }, { "name": "Objective-C++", "bytes": "436045" }, { "name": "PHP", "bytes": "12361" }, { "name": "Pascal", "bytes": "40318" }, { "name": "Perl", "bytes": "358808" }, { "name": "Python", "bytes": "60178" }, { "name": "SAS", "bytes": "1711" }, { "name": "Scilab", "bytes": "258457" }, { "name": "Shell", "bytes": "2610907" }, { "name": "Tcl", "bytes": "17983" }, { "name": "TeX", "bytes": "1455571" }, { "name": "XSLT", "bytes": "156419" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace Wizchat.Models { public class LoginRequest { public string Name { get; set; } public string ConnectionId { get; set; } } }
{ "content_hash": "c6108f13fe179e728ce085a1cfe0c7b3", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 48, "avg_line_length": 18.642857142857142, "alnum_prop": 0.6781609195402298, "repo_name": "nimesh89/wizchat", "id": "b8c043f57dcd3dfe36e46af5de438544caf0ba57", "size": "263", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Wizchat/Models/LoginRequest.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "12679" }, { "name": "CSS", "bytes": "405" }, { "name": "HTML", "bytes": "6818" }, { "name": "JavaScript", "bytes": "328792" }, { "name": "PowerShell", "bytes": "468" } ], "symlink_target": "" }
//Utility to convert .gr to mtx for programs that can't read gr #include "util.h" #include "graphio.h" int main(int argc, char **argv) { char *inputFilename; char *outputFilename; if (!parseCmdLineSimple(argc, argv, "ss", &inputFilename, &outputFilename)) { printf("Usage: gr2mtx input output\n"); exit(1); } int nVertices; std::vector<int> srcs; std::vector<int> dsts; std::vector<int> edgeValues; loadGraph(inputFilename, nVertices, srcs, dsts, &edgeValues); printf("Read input file with %d vertices and %zd edges\n", nVertices, dsts.size()); printf("writing output\n"); writeGraph_mtx(outputFilename, nVertices, dsts.size() , &srcs[0], &dsts[0], &edgeValues[0]); }
{ "content_hash": "1815c05c9022e209d7350ccdf3f59946", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 85, "avg_line_length": 24.586206896551722, "alnum_prop": 0.6774193548387096, "repo_name": "RoyalCaliber/vertexAPI2", "id": "27f7b5a2be88708be122930d1d0894cb3cea842a", "size": "1462", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "gr2mtx.cpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "5411" }, { "name": "C++", "bytes": "96947" }, { "name": "Python", "bytes": "10200" } ], "symlink_target": "" }
module.exports = function() { var fs = require('fs'); var _ = require('lodash'); var walk = require('walk'); var options = this.options(); var done = this.async(); var lastmod = '2013-11-14'; var base = 'http://one-month-of-chat-logs.github.io/'; var sitemaps = []; var pages = []; var sitemapSize = 25000; var maxSitemaps = Number.MAX_VALUE; var template = _.template(fs.readFileSync(options.sitemap).toString()); var sitemapTemplateString = fs.readFileSync(options.sitemapindex).toString(); var sitemapTemplate = _.template(sitemapTemplateString); var ended; function writeSitemaps() { var fname = options.sitemapdir + '/sitemap-' + sitemaps.length + '.xml'; if (!pages.length) return; fs.writeFileSync(fname, template({pages: pages})); sitemaps.push({ url: base + fname, lastmod: lastmod }); pages = []; } function finish() { writeSitemaps(); fs.writeFileSync(options.sitemapdir + '/sitemap-index.xml', sitemapTemplate({sitemaps: sitemaps})); ended = true; done(); } walk.walk(options.docdir).on('names', function(dir, names) { if (ended) return; for (var name, i = 0, l = names.length; name = names[i], i < l; i++) { if (!/.txt$/.test(name)) continue; pages.push({ url: base + dir + '/' + name, lastmod: lastmod }); if (pages.length >= sitemapSize) { writeSitemaps(); if (sitemaps.length >= maxSitemaps) { finish(); break; } } } }).on('end', finish); }; module.exports.desc = 'generate the sitemap.xml listing all of the links';
{ "content_hash": "e4b09642e45292956de7fbe047a1db49", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 79, "avg_line_length": 25.615384615384617, "alnum_prop": 0.5921921921921922, "repo_name": "one-month-of-chat-logs/one-month-of-chat-logs.github.io", "id": "a50c12097f67c0f538a79a6d5c0722574c63f6a2", "size": "1665", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tasks/generate-sitemap.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "7393" } ], "symlink_target": "" }
@ECHO OFF pushd %~dp0 REM Command file for Sphinx documentation if "%SPHINXBUILD%" == "" ( set SPHINXBUILD=sphinx-build ) set SOURCEDIR=source set BUILDDIR=build set SPHINXPROJ=Seattlefoodtruckbot if "%1" == "" goto help %SPHINXBUILD% >NUL 2>NUL if errorlevel 9009 ( echo. echo.The 'sphinx-build' command was not found. Make sure you have Sphinx echo.installed, then set the SPHINXBUILD environment variable to point echo.to the full path of the 'sphinx-build' executable. Alternatively you echo.may add the Sphinx directory to PATH. echo. echo.If you don't have Sphinx installed, grab it from echo.http://sphinx-doc.org/ exit /b 1 ) %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% goto end :help %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% :end popd
{ "content_hash": "c0eaddb7abc4582f692c183a882674ed", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 74, "avg_line_length": 22.97222222222222, "alnum_prop": 0.7097944377267231, "repo_name": "rprakashg/foodtruck-slack-bot", "id": "4541ec73ba59eb766c8eefd7569af1704ea4aeb1", "size": "827", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/make.bat", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "61" }, { "name": "Go", "bytes": "16059" }, { "name": "Shell", "bytes": "174" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <container> <alias id="alias_1" service="service_1" public="true"/> <alias id="alias_2" service="service_2" public="false"/> <definition id="definition_1" class="Full\Qualified\Class1" public="true" synthetic="false" lazy="true" shared="true" abstract="true" autowired="false" file=""> <factory class="Full\Qualified\FactoryClass" method="get"/> </definition> <definition id="definition_2" class="Full\Qualified\Class2" public="false" synthetic="true" lazy="false" shared="true" abstract="false" autowired="false" file="/path/to/file"> <factory service="factory.service" method="get"/> <calls> <call method="setMailer"/> </calls> <tags> <tag name="tag1"> <parameter name="attr1">val1</parameter> <parameter name="attr2">val2</parameter> </tag> <tag name="tag1"> <parameter name="attr3">val3</parameter> </tag> <tag name="tag2"/> </tags> </definition> <definition id="definition_autowired" class="AutowiredService" public="true" synthetic="false" lazy="false" shared="true" abstract="false" autowired="true" file=""/> <definition id="definition_autowired_with_methods" class="AutowiredService" public="true" synthetic="false" lazy="false" shared="true" abstract="false" autowired="true" file=""> <autowired-calls> <autowired-call>set*</autowired-call> <autowired-call>addFoo</autowired-call> </autowired-calls> </definition> <service id="service_container" class="Symfony\Component\DependencyInjection\ContainerBuilder"/> </container>
{ "content_hash": "a2453c50ce0352c14b90649bc8adb59c", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 179, "avg_line_length": 49.90625, "alnum_prop": 0.6775203506574827, "repo_name": "chrisguitarguy/symfony", "id": "8bb8ac1495341cfc9b48a55dc03455c04e4c1c28", "size": "1597", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.xml", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "8656" }, { "name": "HTML", "bytes": "297128" }, { "name": "JavaScript", "bytes": "345" }, { "name": "M4", "bytes": "2250" }, { "name": "PHP", "bytes": "13112046" }, { "name": "Shell", "bytes": "375" } ], "symlink_target": "" }
package eu.atos.sla.parser.data.wsag; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement(name = "VariableSet") public class VariableSet { @XmlElement(name = "Variable") private List<Variable> variables; public List<Variable> getVariables() { return variables; } public void setVariable(List<Variable> variables) { this.variables = variables; } }
{ "content_hash": "955566623e36da13b466870186acfab8", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 52, "avg_line_length": 21.62962962962963, "alnum_prop": 0.7791095890410958, "repo_name": "SeaCloudsEU/sla-core", "id": "4dfcba1616f4874c303abf414a431329dd1a82ab", "size": "1238", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "sla-tools/src/main/java/eu/atos/sla/parser/data/wsag/VariableSet.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "2589" }, { "name": "Java", "bytes": "915852" }, { "name": "Python", "bytes": "1243" }, { "name": "Shell", "bytes": "22416" } ], "symlink_target": "" }
FactoryBot.define do factory :individual, class: Greensub::Individual do sequence(:identifier) { |n| "IndividualIdentifier#{n}" } sequence(:name) { |n| "IndividualName#{n}" } sequence(:email) { |n| "IndividualEmail#{n}" } end end
{ "content_hash": "d00ca1d4640dcce0a13cd7afb5b5ad81", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 60, "avg_line_length": 35.142857142857146, "alnum_prop": 0.6666666666666666, "repo_name": "mlibrary/heliotrope", "id": "13969ce7578200aa721c129aad8949ac270c377e", "size": "277", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "spec/factories/greensub/individuals.rb", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "85607" }, { "name": "Dockerfile", "bytes": "1783" }, { "name": "HTML", "bytes": "1058656" }, { "name": "JavaScript", "bytes": "2022914" }, { "name": "Ruby", "bytes": "2968933" }, { "name": "SCSS", "bytes": "284624" }, { "name": "Shell", "bytes": "3683" }, { "name": "XSLT", "bytes": "23018" } ], "symlink_target": "" }
package com.asakusafw.info.value; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; /** * Represents a list of {@link ValueInfo}. * @since 0.9.2 */ public final class ListInfo implements ValueInfo { static final String KIND = "list"; //$NON-NLS-1$ private static final ListInfo EMPTY = new ListInfo(Collections.emptyList()); @JsonProperty(Constants.ID_ELEMENTS) @JsonInclude(Include.NON_EMPTY) private final List<ValueInfo> elements; private ListInfo(List<ValueInfo> elements) { Objects.requireNonNull(elements); this.elements = elements; } /** * Returns an instance represents the given list. * @param elements the element values * @return the instance */ @JsonCreator public static ListInfo of( @JsonProperty(Constants.ID_ELEMENTS) List<? extends ValueInfo> elements) { if (elements == null || elements.isEmpty()) { return EMPTY; } else { return new ListInfo(Collections.unmodifiableList(new ArrayList<>(elements))); } } /** * Returns an instance represents the given list. * @param elements the element values * @return the instance */ public static ListInfo of(ValueInfo... elements) { return of(Arrays.asList(elements)); } @Override public Kind getKind() { return Kind.LIST; } @Override public List<String> getObject() { return getElements().stream() .map(ValueInfo::getObject) .map(String::valueOf) .collect(Collectors.toList()); } /** * Returns the element values. * @return the element values */ public List<ValueInfo> getElements() { return elements; } @Override public int hashCode() { final int prime = 31; int result = Objects.hashCode(getKind()); result = prime * result + Objects.hashCode(getElements()); return result; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof ListInfo)) { return false; } ListInfo other = (ListInfo) obj; return Objects.equals(elements, other.elements); } @Override public String toString() { return String.format("%s(%s)", getKind(), getObject()); } }
{ "content_hash": "13ccb2eb9a9acf9f151bddac19e82247", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 89, "avg_line_length": 26.345794392523363, "alnum_prop": 0.6211422490244768, "repo_name": "asakusafw/asakusafw", "id": "1355d626790a863995d4d056c05d6cbdf0599e1e", "size": "3431", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "info/model/src/main/java/com/asakusafw/info/value/ListInfo.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "31" }, { "name": "CSS", "bytes": "650" }, { "name": "Groovy", "bytes": "277016" }, { "name": "Java", "bytes": "12812573" }, { "name": "Lex", "bytes": "12506" }, { "name": "Shell", "bytes": "10149" } ], "symlink_target": "" }
using System.IO; using ExtendedXmlSerializer.ExtensionModel.Xml; using FluentAssertions; using Xunit; namespace ExtendedXmlSerializer.Tests.ExtensionModel.Xml { public class XmlReaderFactoryTests { [Fact] public void Same() { var sut = new XmlReaderFactory(); sut.Get(new MemoryStream()) .NameTable.Should() .BeSameAs(sut.Get(new MemoryStream()) .NameTable); } } }
{ "content_hash": "81a0e1703802bc57a3303554bc4862be", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 56, "avg_line_length": 20.7, "alnum_prop": 0.6956521739130435, "repo_name": "wojtpl2/ExtendedXmlSerializer", "id": "4d091a259529fa31c3e66080f6dee3b690e10be6", "size": "416", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "test/ExtendedXmlSerializer.Tests/ExtensionModel/Xml/XmlReaderFactoryTests.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "3073219" }, { "name": "HTML", "bytes": "41908" }, { "name": "PowerShell", "bytes": "3456" } ], "symlink_target": "" }
<?php include_once '_start.php'; use Bootstrapper\MediaObject; class MediaObjectTest extends BootstrapperWrapper { public function createMatcher($image = null, $pull = null, $title = null) { if (!$image) { $image = '<img src="http://test/bar" class="media-object" alt="bar">'; } if (!$pull) { $pull = 'left'; } return '<div class="foo media" data-foo="bar">' . '<a class="pull-' . $pull . '">' . $image . '</a>' . '<div class="media-body">' . $title . 'foo' . '</div>' . '</div>'; } public function titles() { $titles = array(); for ($i = 1; $i <= 6; $i++) { $titles[] = array( 'with_h' . $i, '<h' . $i . ' class="foo media-heading" data-foo="bar">foobar</h' . $i . '>', ); } return $titles; } public function tearDown() { parent::tearDown(); MediaObject::close_list(); MediaObject::$object = null; } public function testOpenList() { $open = MediaObject::open_list($this->testAttributes); $matcher = '<ul class="foo media-list" data-foo="bar">'; $this->assertEquals($matcher, $open); } public function testCloseList() { $close = MediaObject::close_list(); $matcher = '</ul>'; $this->assertEquals($matcher, $close); } public function testBaseMediaObject() { $media = MediaObject::create('foo', 'bar', $this->testAttributes)->__toString(); $matcher = $this->createMatcher(); $this->assertEquals($matcher, $media); } public function testWithImage() { $media = MediaObject::create('foo', null, $this->testAttributes) ->with_image('bar', 'alt', $this->testAttributes)->__toString(); $matcher = $this->createMatcher( '<img src="http://test/bar" class="foo media-object" data-foo="bar" alt="alt">' ); $this->assertEquals($matcher, $media); } public function testPullLeft() { $media1 = MediaObject::create('foo', 'bar', $this->testAttributes)->pull_left()->__toString(); $media2 = MediaObject::create('foo', 'bar', $this->testAttributes)->pull('left')->__toString(); $matcher = $this->createMatcher(); $this->assertEquals($matcher, $media1); $this->assertEquals($matcher, $media2); } public function testPullRight() { $media1 = MediaObject::create('foo', 'bar', $this->testAttributes)->pull_right()->__toString(); $media2 = MediaObject::create('foo', 'bar', $this->testAttributes)->pull('right')->__toString(); $matcher = $this->createMatcher(null, 'right'); $this->assertEquals($matcher, $media1); $this->assertEquals($matcher, $media2); } public function testPullWhatever() { $media1 = MediaObject::create('foo', 'bar', $this->testAttributes)->pull_whatever()->__toString(); $media2 = MediaObject::create('foo', 'bar', $this->testAttributes)->pull('whatever')->__toString(); $matcher = $this->createMatcher(); $this->assertEquals($matcher, $media1); $this->assertEquals($matcher, $media2); } public function testWithTitle() { $media = MediaObject::create('foo', 'bar', $this->testAttributes)->with_title('<h1>foobar</h1>')->__toString(); $matcher = $this->createMatcher(null, null, '<h1>foobar</h1>'); $this->assertEquals($matcher, $media); } /** * @dataProvider titles */ public function testMagicTitles($title, $expected) { $media = MediaObject::create('foo', 'bar', $this->testAttributes)->$title( 'foobar', $this->testAttributes )->__toString(); $matcher = $this->createMatcher(null, null, $expected); $this->assertEquals($matcher, $media); } public function testNesting() { $media = MediaObject::create('foo', 'bar', $this->testAttributes) ->nest(MediaObject::create('foo2', 'bar2')->with_h1('foobar')) ->__toString(); $matcher = '<div class="foo media" data-foo="bar">' . '<a class="pull-left"><img src="http://test/bar" class="media-object" alt="bar"></a>' . '<div class="media-body">foo' . '<div class="media">' . '<a class="pull-left"><img src="http://test/bar2" class="media-object" alt="bar2"></a>' . '<div class="media-body"><h1 class="media-heading">foobar</h1>foo2</div>' . '</div>' . '</div>' . '</div>'; $this->assertEquals($matcher, $media); } }
{ "content_hash": "e8161c2915cb0a3b2340ab95a2e43c01", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 119, "avg_line_length": 29.1144578313253, "alnum_prop": 0.5272087730188288, "repo_name": "Vrian7ipx/cascadadev", "id": "3d4d3506e39aa41a843b31b83183fbb7d3e85b34", "size": "4833", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "vendor/patricktalmadge/bootstrapper/tests/MediaObjectTest.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "323" }, { "name": "CSS", "bytes": "133553" }, { "name": "Java", "bytes": "1796855" }, { "name": "JavaScript", "bytes": "2253089" }, { "name": "PHP", "bytes": "28338917" } ], "symlink_target": "" }
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package de.fuberlin.wiwiss.silk.learning.active.linkselector import de.fuberlin.wiwiss.silk.entity._ import de.fuberlin.wiwiss.silk.linkagerule.similarity.{Aggregation, Comparison} import de.fuberlin.wiwiss.silk.util.DPair import de.fuberlin.wiwiss.silk.linkagerule.input.PathInput import de.fuberlin.wiwiss.silk.linkagerule.LinkageRule import de.fuberlin.wiwiss.silk.plugins.aggegrator.MinimumAggregator import de.fuberlin.wiwiss.silk.evaluation.ReferenceEntities import de.fuberlin.wiwiss.silk.plugins.aggegrator.MinimumAggregator import scala.Some import de.fuberlin.wiwiss.silk.plugins.distance.equality.EqualityMetric import de.fuberlin.wiwiss.silk.plugins.distance.equality.EqualityMetric object LinkSelectorTest extends App { val selector1: LinkSelector = JensenShannonDivergenceSelector(fulfilledOnly = true) val selector2: LinkSelector = JensenShannonDivergenceSelector(fulfilledOnly = false) val referenceLinks = ReferenceEntities.fromEntities( positiveEntities = entities("Frankenstein", "2000", "Frankenstein", "2000") :: Nil, negativeEntities = entities("Frankenstein", "2000", "Rambo", "1900") :: entities("Frankenstein", "2000", "Matrix", "2000") :: Nil ) val unlabeledLinks = Seq( link("Frankenstein", "2000", "Rambo", "1900"), link("Frankenstein", "2000", "Frankenstein", "1900"), link("Frankenstein", "2000", "Matrix", "2000"), link("Frankenstein", "2000", "Frankenstein", "2000") ) val rules = rule(true, true) :: rule(false, true) :: rule(false, true) :: rule(true, false) :: Nil println(selector1(rules, unlabeledLinks, referenceLinks)) println(selector2(rules, unlabeledLinks, referenceLinks)) def rule(matchLabel: Boolean, matchDate: Boolean) = { def labelComparison = Comparison( metric = EqualityMetric(), inputs = DPair(PathInput(path = Path.parse("?a/<label>")), PathInput(path = Path.parse("?b/<label>"))) ) def dateComparison = Comparison( metric = EqualityMetric(), inputs = DPair(PathInput(path = Path.parse("?a/<date>")), PathInput(path = Path.parse("?b/<date>"))) ) val operator = (matchLabel, matchDate) match { case (false, false) => None case (true, false) => Some(labelComparison) case (false, true) => Some(dateComparison) case (true, true) => { Some( Aggregation( aggregator = MinimumAggregator(), operators = Seq(labelComparison, dateComparison) ) ) } } new WeightedLinkageRule(operator, 0.0) } def link(label1: String, date1: String, label2: String, date2: String) = { new Link( source = label1 + date1, target = label2 + date2, entities = Some(entities(label1, date1, label2, date2)) ) } def entities(label1: String, date1: String, label2: String, date2: String) = { val sourceEntityDesc = EntityDescription("a", SparqlRestriction.empty, IndexedSeq(Path.parse("?a/<label>"), Path.parse("?a/<date>"))) val targetEntityDesc = EntityDescription("b", SparqlRestriction.empty, IndexedSeq(Path.parse("?b/<label>"), Path.parse("?b/<date>"))) DPair( source = new Entity(label1 + date1, IndexedSeq(Set(label1), Set(date1)), sourceEntityDesc), target = new Entity(label2 + date2, IndexedSeq(Set(label2), Set(date2)), targetEntityDesc) ) } }
{ "content_hash": "d4cc86b3dca848767bbe4d3761002246", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 137, "avg_line_length": 40.45360824742268, "alnum_prop": 0.6977573904179408, "repo_name": "fusepoolP3/p3-silk", "id": "e48c613446c2f6d6001d28ab07698a584cf1713c", "size": "3924", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "silk-learning/src/test/scala/de/fuberlin/wiwiss/silk/learning/active/linkselector/LinkSelectorTest.scala", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "43338" }, { "name": "HTML", "bytes": "125298" }, { "name": "Java", "bytes": "1013" }, { "name": "JavaScript", "bytes": "975385" }, { "name": "Scala", "bytes": "3508272" } ], "symlink_target": "" }
""" This is the installation script for Satchmo. It will create the base Satchmo configuration. Before running this script, you must have python and pip installed. It is also recommended that you install Python Imaging using your distribution's package method. The simplest way to install Satchmo would be: pip install -r http://bitbucket.org/chris1610/satchmo/raw/tip/scripts/requirements.txt pip install -e hg+http://bitbucket.org/chris1610/satchmo/#egg=satchmo Then run: python clonesatchmo.py """ import os import shutil from random import choice import re from optparse import OptionParser import string __VERSION__ = "0.2" def parse_command_line(): usage = 'usage: %prog [options]' version = 'Version: %prog ' + '%s' % __VERSION__ parser = OptionParser(usage=usage, version=version) parser.add_option('-s', '--site', action='store',type='string', default='store', dest='site_name', help="Top level directory name for the site. [default: %default]") parser.add_option('-l', '--localsite', action='store',type='string', default='localsite', dest='local_site_name', help="Name for the local application stub. [default: %default]") parser.add_option('--skel', action='store', type='string', default = None, dest='skeleton_dir', help="Path to the skeleton directory") opts, args = parser.parse_args() return opts, args def check_skeleton_dir(skel_dir): """ Verify that the skeleton directory exists and that it points to a location with a localsite subdir. """ if skel_dir is None: return (True, "") if os.path.isdir(skel_dir): check_dir = os.path.join(skel_dir, 'localsite') if not os.path.isdir(check_dir): return (False, "Skeleton directory does not contain localsite subdirectory. Path should be /path/to/satchmo/projects/skeleton") else: return (False, "Invalid skeleton directory. Path should be /path/to/satchmo/projects/skeleton") return (True, "") def install_pil(): os.system('pip install %s' % pil_requirements) def create_satchmo_site(site_name, skeleton_dir): """ If we are passed a skeleton_dir, use it If we aren't we assume the script is being run from the source tree so we try to find it. If this doesn't work, let the user know they need to specify it manually """ if skeleton_dir: src_dir = os.path.abspath(skeleton_dir) else: clone_dir = os.path.dirname(__file__) src_dir = os.path.abspath(os.path.join(clone_dir,'../satchmo/projects/skeleton')) result,msg = check_skeleton_dir(src_dir) if not result: return (False, msg) dest_dir = os.path.join('./',site_name) shutil.copytree(src_dir, dest_dir) return (True, "") def customize_files(site_name, local_site_name): """ We need to make a couple of change to the files copied from the skeleton directory. Set the SECRET_KEY to a random value Set the ROOT_URLCONF Set the DJANGO_PROJECT Set the DJANGO_SETTINGS_MODULE We also need to change the directory name to local_site_name """ dest_dir = os.path.join('./',site_name) # Create a random SECRET_KEY hash, and put it in the main settings. main_settings_file = os.path.join(dest_dir, 'settings.py') settings_contents = open(main_settings_file, 'r').read() fp = open(main_settings_file, 'w') secret_key = ''.join([choice('abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)') for i in range(50)]) settings_contents = re.sub(r"(?<=SECRET_KEY = ')'", secret_key + "'", settings_contents) # Configure the other variables that need to be modified root_urlconf = site_name + '.urls' settings_contents = re.sub(r"(?<=ROOT_URLCONF = ')'", root_urlconf + "'",settings_contents) django_settings = site_name + '.settings' settings_contents = re.sub(r"(?<=DJANGO_PROJECT = ')'", site_name + "'",settings_contents) settings_contents = re.sub(r"(?<=DJANGO_SETTINGS_MODULE = ')'", django_settings + "'",settings_contents) local_app = "%s.%s" % (site_name,local_site_name) settings_contents = settings_contents.replace("simple.localsite",local_app) fp.write(settings_contents) fp.close() # rename the local_app directory os.rename(os.path.join(dest_dir,'localsite'), os.path.join(dest_dir,local_site_name)) def setup_satchmo(site_name, local_site_name): """ Do the final configs for satchmo """ os.system('cd %s && python manage.py satchmo_copy_static' % site_name) os.system('cd %s && python manage.py syncdb' % site_name) os.system('cd %s && python manage.py satchmo_load_l10n' % site_name) os.system('cd %s && python manage.py satchmo_load_store' % site_name) os.system('cd %s && python manage.py satchmo_rebuild_pricing' % site_name) if __name__ == '__main__': opts, args = parse_command_line() errors = [] dest_dir = os.path.join('./',opts.site_name) result, msg = check_skeleton_dir(opts.skeleton_dir) if not result: errors.append(msg) if os.path.isdir(dest_dir): errors.append("The destination directory already exists. This script can only be used to create new projects.") try: import PIL as Image except ImportError: errors.append("The Python Imaging Library is not installed. Install from your distribution binaries.") if errors: for error in errors: print error exit() print "Creating the Satchmo Application" result, msg = create_satchmo_site(opts.site_name, opts.skeleton_dir) if not result: print msg exit() print "Customizing the files" customize_files(opts.site_name, opts.local_site_name) print "Performing initial data synching" setup_satchmo(opts.site_name, opts.local_site_name) print "Store installation complete." print "You may run the server by typying: \n cd %s \n python manage.py runserver" % opts.site_name
{ "content_hash": "2ef2d29cdb3362f89a3401336ef46574", "timestamp": "", "source": "github", "line_count": 151, "max_line_length": 139, "avg_line_length": 40.43046357615894, "alnum_prop": 0.6545454545454545, "repo_name": "dokterbob/satchmo", "id": "08a5f7f7e3c6f2bf8f89d09d7d154423724ea9e3", "size": "6127", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "scripts/clonesatchmo.py", "mode": "33261", "license": "bsd-3-clause", "language": [ { "name": "JavaScript", "bytes": "72496" }, { "name": "Python", "bytes": "1690527" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <resources name="en" flag="gb" title="English"> <string name="_bx_market"><![CDATA[Market]]></string> <string name="_bx_market_cmts"><![CDATA[Market's Reviews]]></string> <string name="_bx_market_option_enable_recurring"><![CDATA[Allow to sell subscriptions]]></string> <string name="_bx_market_option_recurring_reserve"><![CDATA[Reserve (in days) to accept and process recurring payment notification]]></string> <string name="_bx_market_option_summary_chars"><![CDATA[Number of characters in auto-cropped product summary]]></string> <string name="_bx_market_option_plain_summary_chars"><![CDATA[Number of characters in plain product description when product hasn't thumb]]></string> <string name="_bx_market_option_per_page_browse"><![CDATA[Number of items per page]]></string> <string name="_bx_market_option_per_page_profile"><![CDATA[Number of items on profile page]]></string> <string name="_bx_market_option_rss_num"><![CDATA[Number of items in RSS feed]]></string> <string name="_bx_market_option_searchable_fields"><![CDATA[Searchable fields for keyword search]]></string> <string name="_bx_market_form_entry"><![CDATA[Product]]></string> <string name="_bx_market_form_entry_display_add"><![CDATA[Add Product]]></string> <string name="_bx_market_form_entry_display_edit"><![CDATA[Edit Product]]></string> <string name="_bx_market_form_entry_display_delete"><![CDATA[Delete Product]]></string> <string name="_bx_market_form_entry_display_view"><![CDATA[View Product]]></string> <string name="_bx_market_form_entry_display_view_full"><![CDATA[Full View Product]]></string> <string name="_bx_market_form_entry_input_author"><![CDATA[Author]]></string> <string name="_bx_market_form_entry_input_sys_do_submit"><![CDATA[Submit]]></string> <string name="_bx_market_form_entry_input_do_submit"><![CDATA[Submit]]></string> <string name="_bx_market_form_entry_input_sys_do_publish"><![CDATA[Publish]]></string> <string name="_bx_market_form_entry_input_do_publish"><![CDATA[Publish]]></string> <string name="_bx_market_form_entry_input_sys_title"><![CDATA[Title]]></string> <string name="_bx_market_form_entry_input_title"><![CDATA[Title]]></string> <string name="_bx_market_form_entry_input_title_err"><![CDATA[Title is essential. Please, fill in this field]]></string> <string name="_bx_market_form_entry_input_sys_name"><![CDATA[Name]]></string> <string name="_bx_market_form_entry_input_name"><![CDATA[Name]]></string> <string name="_bx_market_form_entry_input_name_err"><![CDATA[Name should be unique and is needed for internal usage. Please, fill in this field]]></string> <string name="_bx_market_form_entry_input_sys_cat"><![CDATA[Category]]></string> <string name="_bx_market_form_entry_input_cat"><![CDATA[Category]]></string> <string name="_bx_market_form_entry_input_cat_err"><![CDATA[Please select category]]></string> <string name="_bx_market_form_entry_input_sys_price_single"><![CDATA[Price]]></string> <string name="_bx_market_form_entry_input_price_single"><![CDATA[Price]]></string> <string name="_bx_market_form_entry_input_price_single_inf"><![CDATA[Leave empty to make the product free.]]></string> <string name="_bx_market_form_entry_input_sys_price_recurring"><![CDATA[Recurring price]]></string> <string name="_bx_market_form_entry_input_price_recurring"><![CDATA[Price]]></string> <string name="_bx_market_form_entry_input_price_recurring_inf"><![CDATA[Select 'None' to make the product free.]]></string> <string name="_bx_market_form_entry_input_sys_duration_recurring"><![CDATA[Billing period]]></string> <string name="_bx_market_form_entry_input_duration_recurring"><![CDATA[Billing period]]></string> <string name="_bx_market_form_entry_input_sys_trial_recurring"><![CDATA[Recurring trial]]></string> <string name="_bx_market_form_entry_input_trial_recurring"><![CDATA[Trial period]]></string> <string name="_bx_market_form_entry_input_trial_recurring_inf"><![CDATA[The number of days new customers should receive a free trial. Leave empty to disable trial period.]]></string> <string name="_bx_market_form_entry_input_sys_header_beg_single"><![CDATA[One-time payment: begin]]></string> <string name="_bx_market_form_entry_input_header_beg_single"><![CDATA[One-time payment]]></string> <string name="_bx_market_form_entry_input_sys_header_beg_recurring"><![CDATA[Recurring payment: begin]]></string> <string name="_bx_market_form_entry_input_header_beg_recurring"><![CDATA[Recurring payment]]></string> <string name="_bx_market_form_entry_input_sys_header_beg_privacy"><![CDATA[Privacy: begin]]></string> <string name="_bx_market_form_entry_input_header_beg_privacy"><![CDATA[Privacy]]></string> <string name="_bx_market_form_entry_input_sys_header_end_single"><![CDATA[One-time payment: end]]></string> <string name="_bx_market_form_entry_input_sys_header_end_recurring"><![CDATA[Recurring payment: end]]></string> <string name="_bx_market_form_entry_input_sys_header_end_privacy"><![CDATA[Privacy: end]]></string> <string name="_bx_market_form_entry_input_sys_text"><![CDATA[Text]]></string> <string name="_bx_market_form_entry_input_text"><![CDATA[Text]]></string> <string name="_bx_market_form_entry_input_text_err"><![CDATA[Text field can't be empty]]></string> <string name="_bx_market_form_entry_input_sys_notes"><![CDATA[Notes]]></string> <string name="_bx_market_form_entry_input_notes"><![CDATA[Notes]]></string> <string name="_bx_market_form_entry_input_sys_delete_confirm"><![CDATA[Delete confirmation]]></string> <string name="_bx_market_form_entry_input_delete_confirm"><![CDATA[I am sure I want to delete this product]]></string> <string name="_bx_market_form_entry_input_delete_confirm_info"><![CDATA[This action can not be undone]]></string> <string name="_bx_market_form_entry_input_delete_confirm_error"><![CDATA[Please check this checkbox if you really want to delete the product]]></string> <string name="_bx_market_form_entry_input_sys_pictures"><![CDATA[Pictures]]></string> <string name="_bx_market_form_entry_input_pictures"><![CDATA[Pictures]]></string> <string name="_bx_market_form_entry_input_pictures_title"><![CDATA[Title]]></string> <string name="_bx_market_form_entry_input_pictures_use_as_thumb"><![CDATA[Product icon]]></string> <string name="_bx_market_form_entry_input_pictures_use_as_cover"><![CDATA[Product cover]]></string> <string name="_bx_market_form_entry_input_sys_files"><![CDATA[Files]]></string> <string name="_bx_market_form_entry_input_files"><![CDATA[Files]]></string> <string name="_bx_market_form_entry_input_files_use_as_main"><![CDATA[Use as Main]]></string> <string name="_bx_market_form_entry_input_files_name"><![CDATA[Name:]]></string> <string name="_bx_market_form_entry_input_files_version"><![CDATA[Version:]]></string> <string name="_bx_market_form_entry_input_files_type"><![CDATA[Type:]]></string> <string name="_bx_market_form_entry_input_files_type_version"><![CDATA[version]]></string> <string name="_bx_market_form_entry_input_files_type_update"><![CDATA[update]]></string> <string name="_bx_market_form_entry_input_files_version_from"><![CDATA[Version from:]]></string> <string name="_bx_market_form_entry_input_files_version_to"><![CDATA[Version to:]]></string> <string name="_bx_market_form_entry_input_files_version_from_x_to_y"><![CDATA[Version from {0} to {1}]]></string> <string name="_bx_market_form_entry_input_sys_allow_view_to"><![CDATA[Who can view]]></string> <string name="_bx_market_form_entry_input_allow_view_to"><![CDATA[Who can view]]></string> <string name="_bx_market_form_entry_input_sys_allow_purchase_to"><![CDATA[Who can purchase]]></string> <string name="_bx_market_form_entry_input_allow_purchase_to"><![CDATA[Who can purchase]]></string> <string name="_bx_market_form_entry_input_sys_allow_comment_to"><![CDATA[Who can review]]></string> <string name="_bx_market_form_entry_input_allow_comment_to"><![CDATA[Who can review]]></string> <string name="_bx_market_form_entry_input_sys_allow_vote_to"><![CDATA[Who can vote]]></string> <string name="_bx_market_form_entry_input_allow_vote_to"><![CDATA[Who can vote]]></string> <string name="_bx_market_form_entry_input_sys_added"><![CDATA[Created]]></string> <string name="_bx_market_form_entry_input_added"><![CDATA[Created]]></string> <string name="_bx_market_form_entry_input_sys_changed"><![CDATA[Updated]]></string> <string name="_bx_market_form_entry_input_changed"><![CDATA[Updated]]></string> <string name="_bx_market_form_entry_input_sys_warning_single"><![CDATA[Warning for single payments]]></string> <string name="_bx_market_form_entry_input_sys_warning_recurring"><![CDATA[Warning for recurring payments]]></string> <string name="_bx_market_form_entry_input_sys_subentries"><![CDATA[Subproducts]]></string> <string name="_bx_market_form_entry_input_subentries"><![CDATA[Subproducts]]></string> <string name="_bx_market_form_entry_input_subentries_inf"><![CDATA[Leave empty if you don't want to create association.]]></string> <string name="_bx_market_form_entry_input_subentries_placeholder"><![CDATA[Type product name here...]]></string> <string name="_bx_market_acl_action_create_entry"><![CDATA[Create Product]]></string> <string name="_bx_market_acl_action_delete_entry"><![CDATA[Delete Product]]></string> <string name="_bx_market_acl_action_download_entry"><![CDATA[Download Product]]></string> <string name="_bx_market_acl_action_view_entry"><![CDATA[View Product]]></string> <string name="_bx_market_acl_action_set_cover"><![CDATA[Set Product Cover]]></string> <string name="_bx_market_acl_action_set_subentries"><![CDATA[Set Product Subproducts]]></string> <string name="_bx_market_acl_action_set_thumb"><![CDATA[Set Product Thumbnail]]></string> <string name="_bx_market_acl_action_edit_any_entry"><![CDATA[Edit Any Product]]></string> <string name="_bx_market_privacy_group_customers"><![CDATA[Customers]]></string> <string name="_bx_market_page_title_sys_create_entry"><![CDATA[New Product]]></string> <string name="_bx_market_page_title_create_entry"><![CDATA[New Product]]></string> <string name="_bx_market_page_block_title_create_entry"><![CDATA[New Product]]></string> <string name="_bx_market_page_title_sys_edit_entry"><![CDATA[Edit Product]]></string> <string name="_bx_market_page_title_edit_entry"><![CDATA[Edit Product]]></string> <string name="_bx_market_page_block_title_edit_entry"><![CDATA[Edit Product]]></string> <string name="_bx_market_page_title_sys_delete_entry"><![CDATA[Delete Product]]></string> <string name="_bx_market_page_title_delete_entry"><![CDATA[Delete Product]]></string> <string name="_bx_market_page_block_title_delete_entry"><![CDATA[Delete Product]]></string> <string name="_bx_market_page_title_sys_download_entry"><![CDATA[Download Product]]></string> <string name="_bx_market_page_title_download_entry"><![CDATA[Download Product]]></string> <string name="_bx_market_page_block_title_download_entry"><![CDATA[Download Product]]></string> <string name="_bx_market_page_title_sys_view_entry"><![CDATA[View Product]]></string> <string name="_bx_market_page_title_view_entry"><![CDATA[{title}]]></string> <string name="_bx_market_page_block_title_entry_text"><![CDATA[Product Overview]]></string> <string name="_bx_market_page_title_browse"><![CDATA[Products]]></string> <string name="_bx_market_page_title_search_results"><![CDATA[Products matching "{0}"]]></string> <string name="_bx_market_page_title_browse_by_author"><![CDATA[Products of {display_name}]]></string> <string name="_bx_market_page_title_browse_featured"><![CDATA[Featured Products]]></string> <string name="_bx_market_page_title_browse_latest"><![CDATA[Latest Products]]></string> <string name="_bx_market_page_title_browse_popular"><![CDATA[Popular Products]]></string> <string name="_bx_market_page_title_browse_updated"><![CDATA[Updated Products]]></string> <string name="_bx_market_page_title_browse_category"><![CDATA[Products by category: {0}]]></string> <string name="_bx_market_page_title_browse_keyword"><![CDATA[Products by hashtag: {0}]]></string> <string name="_bx_market_page_title_sys_home"><![CDATA[Market Home]]></string> <string name="_bx_market_page_title_home"><![CDATA[Market]]></string> <string name="_bx_market_page_block_title_featured_entries"><![CDATA[Featured Products]]></string> <string name="_bx_market_page_block_title_featured_entries_view_extended"><![CDATA[Featured Products (Extended View)]]></string> <string name="_bx_market_page_block_title_featured_entries_view_full"><![CDATA[Featured Products (Full View)]]></string> <string name="_bx_market_page_block_title_latest_entries"><![CDATA[Latest Products]]></string> <string name="_bx_market_page_block_title_latest_entries_view_extended"><![CDATA[Latest Products (Extended View)]]></string> <string name="_bx_market_page_block_title_latest_entries_view_full"><![CDATA[Latest Products (Full View)]]></string> <string name="_bx_market_page_block_title_entry_social_sharing"><![CDATA[Share]]></string> <string name="_bx_market_page_block_title_entry_author"><![CDATA[Vendor]]></string> <string name="_bx_market_page_block_title_entry_author_entries"><![CDATA[More Products From {0}]]></string> <string name="_bx_market_page_block_title_entry_actions"><![CDATA[Actions]]></string> <string name="_bx_market_page_block_title_entry_breadcrumb"><![CDATA[Breadcrumb]]></string> <string name="_bx_market_page_block_title_entry_comments"><![CDATA[Reviews]]></string> <string name="_bx_market_page_block_title_entry_comments_link"><![CDATA[Reviews to <a href="{entry_link}">{title}</a>]]></string> <string name="_bx_market_page_block_title_entry_comments_n"><![CDATA[Reviews ({0})]]></string> <string name="_bx_market_page_block_title_entry_info"><![CDATA[Info]]></string> <string name="_bx_market_page_block_title_entry_info_link"><![CDATA[<a href="{entry_link}">{title}</a> Info]]></string> <string name="_bx_market_page_block_title_entry_location"><![CDATA[Location]]></string> <string name="_bx_market_page_block_title_entry_attachments"><![CDATA[Attachments]]></string> <string name="_bx_market_page_block_title_entry_all_actions"><![CDATA[All Actions]]></string> <string name="_bx_market_page_block_title_entry_rating"><![CDATA[Rating]]></string> <string name="_bx_market_page_title_sys_entries_latest"><![CDATA[Latest Products]]></string> <string name="_bx_market_page_title_entries_latest"><![CDATA[Latest Products]]></string> <string name="_bx_market_page_title_sys_entries_featured"><![CDATA[Featured Products]]></string> <string name="_bx_market_page_title_entries_featured"><![CDATA[Featured Products]]></string> <string name="_bx_market_page_title_sys_entries_popular"><![CDATA[Popular Products]]></string> <string name="_bx_market_page_title_entries_popular"><![CDATA[Popular Products]]></string> <string name="_bx_market_page_title_sys_entries_updated"><![CDATA[Updated Products]]></string> <string name="_bx_market_page_title_entries_updated"><![CDATA[Updated Products]]></string> <string name="_bx_market_page_block_title_popular_entries"><![CDATA[Popular Products]]></string> <string name="_bx_market_page_block_title_popular_entries_view_extended"><![CDATA[Popular Products (Extended View)]]></string> <string name="_bx_market_page_block_title_popular_entries_view_full"><![CDATA[Popular Products (Full View)]]></string> <string name="_bx_market_page_block_title_updated_entries"><![CDATA[Updated Products]]></string> <string name="_bx_market_page_block_title_updated_entries_view_extended"><![CDATA[Updated Products (Extended View)]]></string> <string name="_bx_market_page_block_title_updated_entries_view_full"><![CDATA[Updated Products (Full View)]]></string> <string name="_bx_market_page_title_sys_view_entry_comments"><![CDATA[Product Reviews]]></string> <string name="_bx_market_page_title_view_entry_comments"><![CDATA[Reviews to {title}]]></string> <string name="_bx_market_page_title_sys_view_entry_info"><![CDATA[Product Info]]></string> <string name="_bx_market_page_title_view_entry_info"><![CDATA[{title} Info]]></string> <string name="_bx_market_page_title_sys_entries_of_author"><![CDATA[Products of author]]></string> <string name="_bx_market_page_title_entries_of_author"><![CDATA[Products by {display_name}]]></string> <string name="_bx_market_page_block_title_favorites_of_author"><![CDATA[Favorites by <a href="{profile_link}">{display_name}</a>]]></string> <string name="_bx_market_page_block_title_sys_favorites_of_author"><![CDATA[Favorites of author]]></string> <string name="_bx_market_page_block_title_entries_of_author"><![CDATA[Products by <a href="{profile_link}">{display_name}</a>]]></string> <string name="_bx_market_page_block_title_sys_entries_of_author"><![CDATA[Products of author]]></string> <string name="_bx_market_page_block_title_entries_actions"><![CDATA[Products actions]]></string> <string name="_bx_market_page_block_title_browse_cmts"><![CDATA[Products' Reviews]]></string> <string name="_bx_market_page_title_sys_manage"><![CDATA[Manage Own Products]]></string> <string name="_bx_market_page_title_sys_manage_administration"><![CDATA[Manage All Products]]></string> <string name="_bx_market_page_title_manage"><![CDATA[Manage Products]]></string> <string name="_bx_market_page_block_title_system_manage"><![CDATA[Manage Own Products]]></string> <string name="_bx_market_page_block_title_system_manage_administration"><![CDATA[Manage All Products]]></string> <string name="_bx_market_page_block_title_manage"><![CDATA[Manage Products]]></string> <string name="_bx_market_page_block_title_popular_keywords"><![CDATA[Popular Hashtags]]></string> <string name="_bx_market_page_block_title_cats"><![CDATA[Products Categories]]></string> <string name="_bx_market_page_title_sys_entries_categories"><![CDATA[Categories]]></string> <string name="_bx_market_page_title_entries_categories"><![CDATA[Categories]]></string> <string name="_bx_market_page_block_title_categories_entries"><![CDATA[Products]]></string> <string name="_bx_market_page_title_sys_licenses"><![CDATA[Licenses]]></string> <string name="_bx_market_page_title_licenses"><![CDATA[Licenses]]></string> <string name="_bx_market_page_block_title_licenses"><![CDATA[Licenses]]></string> <string name="_bx_market_page_block_title_licenses_note"><![CDATA[Note]]></string> <string name="_bx_market_page_block_content_licenses_note"><![CDATA[The licenses are for reference only. There is no need to "register" them, as you can simply download and install licensed UNA apps directly from your site Studio Apps store.]]></string> <string name="_bx_market_page_block_title_view_profile"><![CDATA[My Products]]></string> <string name="_bx_market_page_title_sys_entries_search"><![CDATA[Search]]></string> <string name="_bx_market_page_title_entries_search"><![CDATA[Search]]></string> <string name="_bx_market_page_block_title_search_form"><![CDATA[Search Form]]></string> <string name="_bx_market_page_block_title_search_results"><![CDATA[Search Results]]></string> <string name="_bx_market_page_block_title_search_form_cmts"><![CDATA[Comments Search Form]]></string> <string name="_bx_market_page_block_title_search_results_cmts"><![CDATA[Comments Search Results]]></string> <string name="_bx_market_menu_set_title_view_entry"><![CDATA[Product Actions]]></string> <string name="_bx_market_menu_title_view_entry"><![CDATA[Product Actions]]></string> <string name="_bx_market_menu_title_view_entry_popup"><![CDATA[Product Actions (in popup)]]></string> <string name="_bx_market_menu_title_submenu"><![CDATA[Market Submenu]]></string> <string name="_bx_market_menu_set_title_submenu"><![CDATA[Market Submenu]]></string> <string name="_bx_market_menu_item_title_system_create_entry"><![CDATA[New Product]]></string> <string name="_bx_market_menu_item_title_create_entry"><![CDATA[New Product]]></string> <string name="_bx_market_menu_item_title_system_edit_entry"><![CDATA[Edit Product]]></string> <string name="_bx_market_menu_item_title_edit_entry"><![CDATA[Edit Product]]></string> <string name="_bx_market_menu_item_title_system_delete_entry"><![CDATA[Delete Product]]></string> <string name="_bx_market_menu_item_title_delete_entry"><![CDATA[Delete Product]]></string> <string name="_bx_market_menu_item_title_system_add_to_cart"><![CDATA[Add to Cart]]></string> <string name="_bx_market_menu_item_title_add_to_cart"><![CDATA[Buy for {0}{1}]]></string> <string name="_bx_market_menu_item_title_system_subscribe"><![CDATA[Rent]]></string> <string name="_bx_market_menu_item_title_subscribe"><![CDATA[Rent for {0}{1}/{2}]]></string> <string name="_bx_market_menu_item_title_system_download"><![CDATA[Download]]></string> <string name="_bx_market_menu_item_title_download"><![CDATA[Download]]></string> <string name="_bx_market_menu_item_title_system_entries_home"><![CDATA[Market]]></string> <string name="_bx_market_menu_item_title_entries_home"><![CDATA[Market]]></string> <string name="_bx_market_menu_item_title_system_entries_categories"><![CDATA[Categories]]></string> <string name="_bx_market_menu_item_title_entries_categories"><![CDATA[Categories]]></string> <string name="_bx_market_menu_item_title_system_entries_public"><![CDATA[Storefront]]></string> <string name="_bx_market_menu_item_title_entries_public"><![CDATA[Storefront]]></string> <string name="_bx_market_menu_item_title_system_entries_search"><![CDATA[Search]]></string> <string name="_bx_market_menu_item_title_entries_search"><![CDATA[Search]]></string> <string name="_bx_market_menu_item_title_system_entries_manage"><![CDATA[Manage Products]]></string> <string name="_bx_market_menu_item_title_entries_manage"><![CDATA[Manage]]></string> <string name="_bx_market_menu_item_title_system_entries_latest"><![CDATA[Latest Products]]></string> <string name="_bx_market_menu_item_title_entries_latest"><![CDATA[Latest]]></string> <string name="_bx_market_menu_item_title_system_entries_featured"><![CDATA[Featured Products]]></string> <string name="_bx_market_menu_item_title_entries_featured"><![CDATA[Featured]]></string> <string name="_bx_market_menu_item_title_system_entries_popular"><![CDATA[Popular Products]]></string> <string name="_bx_market_menu_item_title_entries_popular"><![CDATA[Popular]]></string> <string name="_bx_market_menu_item_title_system_entries_updated"><![CDATA[Updated Products]]></string> <string name="_bx_market_menu_item_title_entries_updated"><![CDATA[Updated]]></string> <string name="_bx_market_menu_title_view_entry_submenu"><![CDATA[View Product Submenu]]></string> <string name="_bx_market_menu_set_title_view_entry_submenu"><![CDATA[View Product Submenu]]></string> <string name="_bx_market_menu_item_title_system_view_entry_submenu_entry"><![CDATA[Overview]]></string> <string name="_bx_market_menu_item_title_view_entry_submenu_entry"><![CDATA[Overview]]></string> <string name="_bx_market_menu_item_title_system_view_entry_submenu_comments"><![CDATA[Reviews]]></string> <string name="_bx_market_menu_item_title_view_entry_submenu_comments"><![CDATA[Reviews]]></string> <string name="_bx_market_menu_item_title_system_view_entry_submenu_info"><![CDATA[Info]]></string> <string name="_bx_market_menu_item_title_view_entry_submenu_info"><![CDATA[Info]]></string> <string name="_bx_market_menu_item_title_system_view_entries_author"><![CDATA[Products]]></string> <string name="_bx_market_menu_item_title_view_entries_author"><![CDATA[Products]]></string> <string name="_bx_market_menu_title_entries_my"><![CDATA[My Products Action Menu]]></string> <string name="_bx_market_menu_set_title_entries_my"><![CDATA[My Products Menu]]></string> <string name="_bx_market_menu_item_title_system_manage_my_products"><![CDATA[My products]]></string> <string name="_bx_market_menu_item_title_manage_my_products"><![CDATA[{addon} products]]></string> <string name="_bx_market_menu_set_title_manage_tools"><![CDATA[Manage Tools Submenu]]></string> <string name="_bx_market_menu_title_manage_tools"><![CDATA[Manage Tools Submenu]]></string> <string name="_bx_market_menu_item_title_system_manage_account"><![CDATA[Manage account]]></string> <string name="_bx_market_menu_item_title_manage_account"><![CDATA[Manage account]]></string> <string name="_bx_market_menu_item_title_system_admt_products"><![CDATA[Products]]></string> <string name="_bx_market_menu_item_title_admt_products"><![CDATA[Products - {addon} hidden]]></string> <string name="_bx_market_menu_item_title_manage_my"><![CDATA[My Products]]></string> <string name="_bx_market_menu_item_title_manage_all"><![CDATA[All Products]]></string> <string name="_bx_market_menu_item_title_system_licenses"><![CDATA[Licenses]]></string> <string name="_bx_market_menu_item_title_licenses"><![CDATA[Licenses]]></string> <string name="_bx_market_menu_title_snippet"><![CDATA[Snippet Actions]]></string> <string name="_bx_market_menu_set_title_snippet"><![CDATA[Snippet Actions]]></string> <string name="_bx_market_menu_item_title_system_snippet_more"><![CDATA[More Actions]]></string> <string name="_bx_market_menu_item_title_snippet_more"><![CDATA[More Actions]]></string> <string name="_bx_market_menu_item_title_downloads_more"><![CDATA[Show More]]></string> <string name="_bx_market_grid_filter_item_title_adm_select_one_filter1"><![CDATA[All Statuses]]></string> <string name="_bx_market_grid_filter_item_title_adm_active"><![CDATA[Active]]></string> <string name="_bx_market_grid_filter_item_title_adm_hidden"><![CDATA[Hidden]]></string> <string name="_bx_market_grid_column_title_adm_active"><![CDATA[Active]]></string> <string name="_bx_market_grid_column_title_adm_title"><![CDATA[Title]]></string> <string name="_bx_market_grid_column_title_adm_added"><![CDATA[Added]]></string> <string name="_bx_market_grid_column_title_adm_author"><![CDATA[Author]]></string> <string name="_bx_market_grid_action_title_adm_edit"><![CDATA[Edit]]></string> <string name="_bx_market_grid_action_title_adm_delete"><![CDATA[Delete]]></string> <string name="_bx_market_grid_action_title_adm_more_actions"><![CDATA[More Actions]]></string> <string name="_bx_market_grid_action_err_delete"><![CDATA[Cannot delete the selected product(s).]]></string> <string name="_bx_market_grid_txt_account_manager"><![CDATA[Redirect to manage account.]]></string> <string name="_bx_market_grid_column_title_lcs_product"><![CDATA[Product]]></string> <string name="_bx_market_grid_column_title_lcs_license"><![CDATA[License]]></string> <string name="_bx_market_grid_column_title_lcs_type"><![CDATA[Type]]></string> <string name="_bx_market_grid_column_title_lcs_domain"><![CDATA[Domain]]></string> <string name="_bx_market_grid_column_title_lcs_added"><![CDATA[Begin]]></string> <string name="_bx_market_grid_column_title_lcs_expired"><![CDATA[Expire]]></string> <string name="_bx_market_grid_action_title_lcs_reset"><![CDATA[Reset]]></string> <string name="_bx_market_grid_action_err_cannot_perform"><![CDATA[Cannot perform the action. Please report.]]></string> <string name="_bx_market_grid_txt_lcs_type_single"><![CDATA[one-time]]></string> <string name="_bx_market_grid_txt_lcs_type_recurring"><![CDATA[recurring]]></string> <string name="_bx_market_grid_txt_lcs_never"><![CDATA[never]]></string> <string name="_bx_market_chart_growth"><![CDATA[Market: Growth]]></string> <string name="_bx_market_chart_growth_speed"><![CDATA[Market: Growth Speed]]></string> <string name="_bx_market_search_extended"><![CDATA[Market Search]]></string> <string name="_bx_market_search_extended_cmts"><![CDATA[Market Comments Search]]></string> <string name="_bx_market_pre_lists_cats"><![CDATA[Product categories]]></string> <string name="_bx_market_cat_administration"><![CDATA[Administration]]></string> <string name="_bx_market_cat_adult"><![CDATA[Adult]]></string> <string name="_bx_market_cat_advertisement"><![CDATA[Advertisement]]></string> <string name="_bx_market_cat_affiliates"><![CDATA[Affiliates]]></string> <string name="_bx_market_cat_authentication"><![CDATA[Authentication]]></string> <string name="_bx_market_cat_calendars"><![CDATA[Calendars]]></string> <string name="_bx_market_cat_communication"><![CDATA[Communication]]></string> <string name="_bx_market_cat_content"><![CDATA[Content]]></string> <string name="_bx_market_cat_conversion"><![CDATA[Conversion]]></string> <string name="_bx_market_cat_core_changes"><![CDATA[Core Changes]]></string> <string name="_bx_market_cat_dating"><![CDATA[Dating]]></string> <string name="_bx_market_cat_documentation"><![CDATA[Documentation]]></string> <string name="_bx_market_cat_ecommerce"><![CDATA[eCommerce]]></string> <string name="_bx_market_cat_events"><![CDATA[Events]]></string> <string name="_bx_market_cat_feedback"><![CDATA[Feedback]]></string> <string name="_bx_market_cat_flash"><![CDATA[Flash]]></string> <string name="_bx_market_cat_games"><![CDATA[Games]]></string> <string name="_bx_market_cat_graphics"><![CDATA[Graphics]]></string> <string name="_bx_market_cat_hosting"><![CDATA[Hosting]]></string> <string name="_bx_market_cat_integrations"><![CDATA[Integrations]]></string> <string name="_bx_market_cat_location"><![CDATA[Location]]></string> <string name="_bx_market_cat_management"><![CDATA[Management]]></string> <string name="_bx_market_cat_mobile"><![CDATA[Mobile]]></string> <string name="_bx_market_cat_multimedia"><![CDATA[Multimedia]]></string> <string name="_bx_market_cat_music"><![CDATA[Music]]></string> <string name="_bx_market_cat_navigation"><![CDATA[Navigation]]></string> <string name="_bx_market_cat_other"><![CDATA[Other]]></string> <string name="_bx_market_cat_performance"><![CDATA[Performance]]></string> <string name="_bx_market_cat_photos"><![CDATA[Photos]]></string> <string name="_bx_market_cat_search"><![CDATA[Search]]></string> <string name="_bx_market_cat_security"><![CDATA[Security]]></string> <string name="_bx_market_cat_services"><![CDATA[Services]]></string> <string name="_bx_market_cat_social"><![CDATA[Social]]></string> <string name="_bx_market_cat_spam_prevention"><![CDATA[Spam Prevention]]></string> <string name="_bx_market_cat_statistics"><![CDATA[Statistics]]></string> <string name="_bx_market_cat_templates"><![CDATA[Templates]]></string> <string name="_bx_market_cat_tools"><![CDATA[Tools]]></string> <string name="_bx_market_cat_translations"><![CDATA[Translations]]></string> <string name="_bx_market_cat_video"><![CDATA[Video]]></string> <string name="_bx_market_pre_lists_prices"><![CDATA[Product prices]]></string> <string name="_bx_market_cat_price_0"><![CDATA[None]]></string> <string name="_bx_market_cat_price_1"><![CDATA[1]]></string> <string name="_bx_market_cat_price_2"><![CDATA[2]]></string> <string name="_bx_market_cat_price_3"><![CDATA[3]]></string> <string name="_bx_market_cat_price_4"><![CDATA[4]]></string> <string name="_bx_market_cat_price_5"><![CDATA[5]]></string> <string name="_bx_market_pre_lists_durations"><![CDATA[Product durations]]></string> <string name="_bx_market_cat_duration_day"><![CDATA[daily]]></string> <string name="_bx_market_cat_duration_week"><![CDATA[weekly]]></string> <string name="_bx_market_cat_duration_month"><![CDATA[monthly]]></string> <string name="_bx_market_cat_duration_year"><![CDATA[yearly]]></string> <string name="_bx_market_vote_counter"><![CDATA[{0} ratings]]></string> <string name="_bx_market_err_access_denied"><![CDATA[Access denied.]]></string> <string name="_bx_market_err_no_payments"><![CDATA[There is no installed payment processing module.]]></string> <string name="_bx_market_err_not_accept_payments"><![CDATA[You need to activate at least one payment provider. You may do it via My Account menu -> Settings page -> <a href="{0}">Payments</a> tab.]]></string> <string name="_bx_market_err_not_accept_payments_single"><![CDATA[You need to activate at least one payment provider, which is working with Shopping Cart. You may do it via My Account menu -> Settings page -> <a href="{0}">Payments</a> tab.]]></string> <string name="_bx_market_err_not_accept_payments_recurring"><![CDATA[You need to activate at least one payment provider, which is working with Subscriptions. You may do it via My Account menu -> Settings page -> <a href="{0}">Payments</a> tab.]]></string> <string name="_bx_market_txt_all_entries_by"><![CDATA[<a href="{0}">All Products by {1} ({2})</a>]]></string> <string name="_bx_market_txt_category"><![CDATA[Category:]]></string> <string name="_bx_market_txt_most_current_version"><![CDATA[The most current version]]></string> <string name="_bx_market_txt_sample_single"><![CDATA[product]]></string> <string name="_bx_market_txt_sample_single_with_article"><![CDATA[a product]]></string> <string name="_bx_market_txt_sample_comment_single"><![CDATA[comment to product]]></string> <string name="_bx_market_txt_sample_vote_single"><![CDATA[vote to product]]></string> <string name="_bx_market_txt_author_added_product"><![CDATA[{0} {1}]]></string> <string name="_bx_market_txt_joined"><![CDATA[Joined:]]></string> <string name="_bx_market_txt_last_active"><![CDATA[Last Active:]]></string> <string name="_bx_market_txt_price_single"><![CDATA[Buy for {0}{1}]]></string> <string name="_bx_market_txt_price_single_short"><![CDATA[{0}{1}]]></string> <string name="_bx_market_txt_price_recurring"><![CDATA[Rent for {0}{1}/{2}]]></string> <string name="_bx_market_txt_price_recurring_short"><![CDATA[{0}{1}/{2}]]></string> <string name="_bx_market_txt_price_free"><![CDATA[Free]]></string> <string name="_bx_market_txt_per_day"><![CDATA[day]]></string> <string name="_bx_market_txt_per_day_short"><![CDATA[day]]></string> <string name="_bx_market_txt_per_week"><![CDATA[week]]></string> <string name="_bx_market_txt_per_week_short"><![CDATA[week]]></string> <string name="_bx_market_txt_per_month"><![CDATA[month]]></string> <string name="_bx_market_txt_per_month_short"><![CDATA[month]]></string> <string name="_bx_market_txt_per_year"><![CDATA[year]]></string> <string name="_bx_market_txt_per_year_short"><![CDATA[year]]></string> <string name="_bx_market_txt_get_for_free"><![CDATA[Download for Free]]></string> </resources>
{ "content_hash": "6a8bbd9bbea279c718999212d183dc87", "timestamp": "", "source": "github", "line_count": 390, "max_line_length": 257, "avg_line_length": 89.8076923076923, "alnum_prop": 0.694332619557459, "repo_name": "camperjz/una", "id": "1e5ccc49bdf4d0cf7adfdb0a82f0bb296e968c94", "size": "35025", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "modules/boonex/market/updates/9.0.6_9.0.7/source/install/langs/en.xml", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "3856790" }, { "name": "HTML", "bytes": "1890197" }, { "name": "JavaScript", "bytes": "15456704" }, { "name": "PHP", "bytes": "69609918" }, { "name": "Shell", "bytes": "1532" } ], "symlink_target": "" }
<?php defined('BASEPATH') OR exit('No direct script access allowed'); $route['default_controller'] = 'main'; $route['404_override'] = ''; $route['translate_uri_dashes'] = FALSE; $route['dashboard'] = 'items/dashboard'; $route['wish_items/create'] = 'items/add_item'; $route['create'] = 'items/create_item'; $route['join/(:any)'] = 'items/wish_list_join/$1'; $route['remove/(:any)'] = 'items/remove_wish/$1'; $route['wish_items/(:any)'] = 'items/show_item/$1'; $route['destroy/(:any)'] = 'items/destroy/$1';
{ "content_hash": "c710899ef1b68973284befa034d3a024", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 63, "avg_line_length": 36.357142857142854, "alnum_prop": 0.6404715127701375, "repo_name": "junhwang77/wish_list", "id": "fc0a20db3492128e6f0eb46a293488fbb92262fc", "size": "509", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "application/config/routes.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "1487" }, { "name": "CSS", "bytes": "15876" }, { "name": "HTML", "bytes": "8413296" }, { "name": "JavaScript", "bytes": "92173" }, { "name": "PHP", "bytes": "1770864" } ], "symlink_target": "" }
package org.apache.skywalking.apm.collector.storage.es.define.alarm; import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchColumnDefine; import org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchTableDefine; import org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmTable; /** * @author peng-yongsheng */ public class ApplicationAlarmEsTableDefine extends ElasticSearchTableDefine { public ApplicationAlarmEsTableDefine() { super(ApplicationAlarmTable.TABLE); } @Override public int refreshInterval() { return 2; } @Override public void initialize() { addColumn(new ElasticSearchColumnDefine(ApplicationAlarmTable.COLUMN_APPLICATION_ID, ElasticSearchColumnDefine.Type.Integer.name())); addColumn(new ElasticSearchColumnDefine(ApplicationAlarmTable.COLUMN_SOURCE_VALUE, ElasticSearchColumnDefine.Type.Integer.name())); addColumn(new ElasticSearchColumnDefine(ApplicationAlarmTable.COLUMN_ALARM_TYPE, ElasticSearchColumnDefine.Type.Integer.name())); addColumn(new ElasticSearchColumnDefine(ApplicationAlarmTable.COLUMN_ALARM_CONTENT, ElasticSearchColumnDefine.Type.Text.name())); addColumn(new ElasticSearchColumnDefine(ApplicationAlarmTable.COLUMN_LAST_TIME_BUCKET, ElasticSearchColumnDefine.Type.Long.name())); } }
{ "content_hash": "225b647bec8324fdc237195d26988157", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 141, "avg_line_length": 42.9375, "alnum_prop": 0.7933042212518195, "repo_name": "hanahmily/sky-walking", "id": "1c0cd6285390998c82867ed4f935794485fa787f", "size": "2178", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/alarm/ApplicationAlarmEsTableDefine.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "1040" }, { "name": "Java", "bytes": "5231297" }, { "name": "Shell", "bytes": "4434" } ], "symlink_target": "" }
module WebIDL module ParseTree class DictionaryMember < Treetop::Runtime::SyntaxNode def build(parent) raise unless default.empty? or default.respond_to?(:build) dm = Ast::DictionaryMember.new parent, type.build(parent), name.build, (default.build unless default.empty?) end end # Attribute end # ParseTree end # WebIDL
{ "content_hash": "dcc209f529ceff162c97cb0e4a60c621", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 76, "avg_line_length": 30, "alnum_prop": 0.525, "repo_name": "jarib/webidl", "id": "834012b7a8dc803fbefaf1806465ce46dbaece4f", "size": "480", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/webidl/parse_tree/dictionary_member.rb", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "3360859" }, { "name": "Ruby", "bytes": "47221" } ], "symlink_target": "" }