text
stringlengths
2
1.04M
meta
dict
#include <libtest/common.h> #include <libmemcached/memcached.h> #include <libmemcached/util.h> using namespace libtest; #include <cassert> #include <cerrno> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <signal.h> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #include <libtest/server.h> #include <libtest/wait.h> #include <libtest/memcached.h> #ifndef __INTEL_COMPILER #pragma GCC diagnostic ignored "-Wold-style-cast" #endif using namespace libtest; class Memcached : public libtest::Server { std::string _username; std::string _password; public: Memcached(const std::string& host_arg, const in_port_t port_arg, const bool is_socket_arg, const std::string& username_arg, const std::string& password_arg) : libtest::Server(host_arg, port_arg, is_socket_arg), _username(username_arg), _password(password_arg) { } Memcached(const std::string& host_arg, const in_port_t port_arg, const bool is_socket_arg) : libtest::Server(host_arg, port_arg, is_socket_arg) { set_pid_file(); } virtual const char *sasl() const { return NULL; } const std::string& password() const { return _password; } const std::string& username() const { return _username; } pid_t get_pid(bool error_is_ok) { // Memcached is slow to start, so we need to do this if (not pid_file().empty()) { if (error_is_ok and not wait_for_pidfile()) { Error << "Pidfile was not found:" << pid_file(); return -1; } } pid_t local_pid; memcached_return_t rc= MEMCACHED_SUCCESS; if (has_socket()) { local_pid= libmemcached_util_getpid(socket().c_str(), 0, &rc); } else { local_pid= libmemcached_util_getpid(hostname().c_str(), port(), &rc); } if (error_is_ok and ((memcached_failed(rc) or not is_pid_valid(local_pid)))) { Error << "libmemcached_util_getpid(" << memcached_strerror(NULL, rc) << ") pid: " << local_pid << " for:" << *this; } return local_pid; } bool ping() { // Memcached is slow to start, so we need to do this if (not pid_file().empty()) { if (not wait_for_pidfile()) { Error << "Pidfile was not found:" << pid_file(); return -1; } } memcached_return_t rc; bool ret; if (has_socket()) { ret= libmemcached_util_ping(socket().c_str(), 0, &rc); } else { ret= libmemcached_util_ping(hostname().c_str(), port(), &rc); } if (memcached_failed(rc) or not ret) { Error << "libmemcached_util_ping(" << hostname() << ", " << port() << ") error: " << memcached_strerror(NULL, rc); } return ret; } const char *name() { return "memcached"; }; const char *executable() { return MEMCACHED_BINARY; } const char *pid_file_option() { return "-P "; } const char *socket_file_option() const { return "-s "; } const char *daemon_file_option() { return "-d"; } const char *log_file_option() { return NULL; } const char *port_option() { return "-p "; } bool is_libtool() { return false; } bool broken_socket_cleanup() { return true; } // Memcached's pidfile is broken bool broken_pid_file() { return true; } bool build(int argc, const char *argv[]); }; class MemcachedSaSL : public Memcached { public: MemcachedSaSL(const std::string& host_arg, const in_port_t port_arg, const bool is_socket_arg, const std::string& username_arg, const std::string &password_arg) : Memcached(host_arg, port_arg, is_socket_arg, username_arg, password_arg) { } const char *name() { return "memcached-sasl"; }; const char *sasl() const { return " -S -B binary "; } const char *executable() { return MEMCACHED_SASL_BINARY; } pid_t get_pid(bool error_is_ok) { // Memcached is slow to start, so we need to do this if (not pid_file().empty()) { if (error_is_ok and not wait_for_pidfile()) { Error << "Pidfile was not found:" << pid_file(); return -1; } } pid_t local_pid; memcached_return_t rc; if (has_socket()) { local_pid= libmemcached_util_getpid2(socket().c_str(), 0, username().c_str(), password().c_str(), &rc); } else { local_pid= libmemcached_util_getpid2(hostname().c_str(), port(), username().c_str(), password().c_str(), &rc); } if (error_is_ok and ((memcached_failed(rc) or not is_pid_valid(local_pid)))) { Error << "libmemcached_util_getpid2(" << memcached_strerror(NULL, rc) << ") username: " << username() << " password: " << password() << " pid: " << local_pid << " for:" << *this; } return local_pid; } bool ping() { // Memcached is slow to start, so we need to do this if (not pid_file().empty()) { if (not wait_for_pidfile()) { Error << "Pidfile was not found:" << pid_file(); return -1; } } memcached_return_t rc; bool ret; if (has_socket()) { ret= libmemcached_util_ping2(socket().c_str(), 0, username().c_str(), password().c_str(), &rc); } else { ret= libmemcached_util_ping2(hostname().c_str(), port(), username().c_str(), password().c_str(), &rc); } if (memcached_failed(rc) or not ret) { Error << "libmemcached_util_ping2(" << hostname() << ", " << port() << ", " << username() << ", " << password() << ") error: " << memcached_strerror(NULL, rc); } return ret; } }; #include <sstream> bool Memcached::build(int argc, const char *argv[]) { std::stringstream arg_buffer; if (getuid() == 0 or geteuid() == 0) { arg_buffer << " -u root "; } arg_buffer << " -l 127.0.0.1 "; arg_buffer << " -m 128 "; arg_buffer << " -M "; if (sasl()) { arg_buffer << sasl(); } for (int x= 1 ; x < argc ; x++) { arg_buffer << " " << argv[x] << " "; } set_extra_args(arg_buffer.str()); return true; } namespace libtest { libtest::Server *build_memcached(const std::string& hostname, const in_port_t try_port) { return new Memcached(hostname, try_port, false); } libtest::Server *build_memcached_socket(const std::string& socket_file, const in_port_t try_port) { return new Memcached(socket_file, try_port, true); } libtest::Server *build_memcached_sasl(const std::string& hostname, const in_port_t try_port, const std::string& username, const std::string &password) { if (username.empty()) { return new MemcachedSaSL(hostname, try_port, false, "memcached", "memcached"); } return new MemcachedSaSL(hostname, try_port, false, username, password); } libtest::Server *build_memcached_sasl_socket(const std::string& socket_file, const in_port_t try_port, const std::string& username, const std::string &password) { if (username.empty()) { return new MemcachedSaSL(socket_file, try_port, true, "memcached", "memcached"); } return new MemcachedSaSL(socket_file, try_port, true, username, password); } }
{ "content_hash": "7f0e757a1bb52c5c62fe035fc2619af4", "timestamp": "", "source": "github", "line_count": 335, "max_line_length": 184, "avg_line_length": 21.235820895522387, "alnum_prop": 0.5938993533876863, "repo_name": "tellybug/Libmemcached", "id": "daf6787cf69b9c86bd2afaaefe2b58772c2b47d8", "size": "8011", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "libtest/memcached.cc", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "731631" }, { "name": "C++", "bytes": "1330955" }, { "name": "D", "bytes": "923" }, { "name": "Python", "bytes": "29120" }, { "name": "Shell", "bytes": "1278083" } ], "symlink_target": "" }
FROM balenalib/parallella-hdmi-resin-ubuntu:eoan-run # remove several traces of debian python RUN apt-get purge -y python.* # http://bugs.python.org/issue19846 # > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. ENV LANG C.UTF-8 # install python dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ netbase \ && rm -rf /var/lib/apt/lists/* # key 63C7CC90: public key "Simon McVittie <smcv@pseudorandom.co.uk>" imported # key 3372DCFA: public key "Donald Stufft (dstufft) <donald@stufft.io>" imported RUN gpg --keyserver keyring.debian.org --recv-keys 4DE8FF2A63C7CC90 \ && gpg --keyserver keyserver.ubuntu.com --recv-key 6E3CBCE93372DCFA \ && gpg --keyserver keyserver.ubuntu.com --recv-keys 0x52a43a1e4b77b059 ENV PYTHON_VERSION 3.9.4 # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'" ENV PYTHON_PIP_VERSION 21.0.1 ENV SETUPTOOLS_VERSION 56.0.0 RUN set -x \ && buildDeps=' \ curl \ ' \ && apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \ && curl -SLO "http://resin-packages.s3.amazonaws.com/python/v$PYTHON_VERSION/Python-$PYTHON_VERSION.linux-armv7hf-openssl1.1.tar.gz" \ && echo "fe3cb03bf50d2128ff7c98e16308c5c2c4363983c87e26e0ffe4b280bf78e070 Python-$PYTHON_VERSION.linux-armv7hf-openssl1.1.tar.gz" | sha256sum -c - \ && tar -xzf "Python-$PYTHON_VERSION.linux-armv7hf-openssl1.1.tar.gz" --strip-components=1 \ && rm -rf "Python-$PYTHON_VERSION.linux-armv7hf-openssl1.1.tar.gz" \ && ldconfig \ && if [ ! -e /usr/local/bin/pip3 ]; then : \ && curl -SLO "https://raw.githubusercontent.com/pypa/get-pip/430ba37776ae2ad89f794c7a43b90dc23bac334c/get-pip.py" \ && echo "19dae841a150c86e2a09d475b5eb0602861f2a5b7761ec268049a662dbd2bd0c get-pip.py" | sha256sum -c - \ && python3 get-pip.py \ && rm get-pip.py \ ; fi \ && pip3 install --no-cache-dir --upgrade --force-reinstall pip=="$PYTHON_PIP_VERSION" setuptools=="$SETUPTOOLS_VERSION" \ && find /usr/local \ \( -type d -a -name test -o -name tests \) \ -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ -exec rm -rf '{}' + \ && cd / \ && rm -rf /usr/src/python ~/.cache # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ && ln -sf pip3 pip \ && { [ -e easy_install ] || ln -s easy_install-* easy_install; } \ && ln -sf idle3 idle \ && ln -sf pydoc3 pydoc \ && ln -sf python3 python \ && ln -sf python3-config python-config # set PYTHONPATH to point to dist-packages ENV PYTHONPATH /usr/lib/python3/dist-packages:$PYTHONPATH CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"] RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@python.sh" \ && echo "Running test-stack@python" \ && chmod +x test-stack@python.sh \ && bash test-stack@python.sh \ && rm -rf test-stack@python.sh RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v7 \nOS: Ubuntu eoan \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nPython v3.9.4, Pip v21.0.1, Setuptools v56.0.0 \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": "775d808fd3f7c62192c85232aeb8bce3", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 706, "avg_line_length": 51.98717948717949, "alnum_prop": 0.7082614056720099, "repo_name": "nghiant2710/base-images", "id": "04f64a8111e06633418bd2a451ef6944a7210eff", "size": "4076", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "balena-base-images/python/parallella-hdmi-resin/ubuntu/eoan/3.9.4/run/Dockerfile", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "144558581" }, { "name": "JavaScript", "bytes": "16316" }, { "name": "Shell", "bytes": "368690" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace NodePowerTools { public class ThemeHelper { } }
{ "content_hash": "040d2b7f1ad381160ad0f5c0b48d6aca", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 33, "avg_line_length": 13.25, "alnum_prop": 0.7232704402515723, "repo_name": "MicrosoftWebMatrix/NodePowerTools", "id": "56178820acd767d09701088b1b1ff0ba6f1a0e81", "size": "161", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "NodePowerTools/ThemeHelper.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "28737" }, { "name": "JavaScript", "bytes": "5274" } ], "symlink_target": "" }
#include "stm32f10x_conf.h" #include <string.h> #include <stdbool.h> #include "bsp_powermanage.h" #include "led.h" #include "adc.h" #include "commander.h" #include "radiolink.h" static float batteryVoltage; static float batteryVoltageMin = 6.0; static float batteryVoltageMax = 0.0; static int32_t batteryVRawFilt = PM_BAT_ADC_FOR_3_VOLT; static int32_t batteryVRefRawFilt = PM_BAT_ADC_FOR_1p2_VOLT; static uint32_t batteryLowTimeStamp; static uint32_t batteryCriticalLowTimeStamp; static bool isInit; const static float bat671723HS25C[10] = { 3.00, // 00% 3.78, // 10% 3.83, // 20% 3.87, // 30% 3.89, // 40% 3.92, // 50% 3.96, // 60% 4.00, // 70% 4.04, // 80% 4.10 // 90% }; void pmInit(void) { GPIO_InitTypeDef GPIO_InitStructure; if(isInit) return; RCC_APB2PeriphClockCmd(PM_GPIO_IN_PGOOD_PERIF | PM_GPIO_IN_CHG_PERIF | PM_GPIO_SYSOFF_PERIF | PM_GPIO_EN1_PERIF | PM_GPIO_EN2_PERIF | PM_GPIO_BAT_PERIF, ENABLE); // Configure PM PGOOD pin (Power good) GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz; GPIO_InitStructure.GPIO_Pin = PM_GPIO_IN_PGOOD; GPIO_Init(PM_GPIO_IN_PGOOD_PORT, &GPIO_InitStructure); // Configure PM CHG pin (Charge) GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz; GPIO_InitStructure.GPIO_Pin = PM_GPIO_IN_CHG; GPIO_Init(PM_GPIO_IN_CHG_PORT, &GPIO_InitStructure); // Configure PM EN2 pin GPIO_InitStructure.GPIO_Pin = PM_GPIO_EN2; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_10MHz; GPIO_Init(PM_GPIO_EN2_PORT, &GPIO_InitStructure); // Configure PM EN1 pin GPIO_InitStructure.GPIO_Pin = PM_GPIO_EN1; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_10MHz; GPIO_Init(PM_GPIO_EN1_PORT, &GPIO_InitStructure); // Configure PM SYSOFF pin GPIO_InitStructure.GPIO_Pin = PM_GPIO_SYSOFF; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_10MHz; GPIO_Init(PM_GPIO_SYSOFF_PORT, &GPIO_InitStructure); // Configure battery ADC pin GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_10MHz; GPIO_InitStructure.GPIO_Pin = PM_GPIO_BAT; GPIO_Init(PM_GPIO_BAT_PORT, &GPIO_InitStructure); xTaskCreate(pmTask, (const signed char * const)"PWRMGNT", configMINIMAL_STACK_SIZE, NULL, /*priority*/3, NULL); isInit = true; } bool pmTest(void) { return isInit; } /** * IIR low pass filter the samples. */ static int16_t pmBatteryIIRLPFilter(uint16_t in, int32_t* filt) { int32_t inScaled; int32_t filttmp = *filt; int16_t out; // Shift to keep accuracy inScaled = in << PM_BAT_IIR_SHIFT; // Calculate IIR filter filttmp = filttmp + (((inScaled-filttmp) >> 8) * PM_BAT_IIR_LPF_ATT_FACTOR); // Scale and round out = (filttmp >> 8) + ((filttmp & (1 << (PM_BAT_IIR_SHIFT - 1))) >> (PM_BAT_IIR_SHIFT - 1)); *filt = filttmp; return out; } /** * Sets the battery voltage and its min and max values */ static void pmSetBatteryVoltage(float voltage) { batteryVoltage = voltage; if (batteryVoltageMax < voltage) { batteryVoltageMax = voltage; } if (batteryVoltageMin > voltage) { batteryVoltageMin = voltage; } } /** * Shutdown system */ static void pmSystemShutdown(void) { #ifdef ACTIVATE_AUTO_SHUTDOWN GPIO_SetBits(PM_GPIO_SYSOFF_PORT, PM_GPIO_SYSOFF); #endif } /** * Returns a number from 0 to 9 where 0 is completely discharged * and 9 is 90% charged. */ static int32_t pmBatteryChargeFromVoltage(float voltage) { int charge = 0; if (voltage < bat671723HS25C[0]) { return 0; } if (voltage > bat671723HS25C[9]) { return 9; } while (voltage > bat671723HS25C[charge]) { charge++; } return charge; } float pmGetBatteryVoltage(void) { return batteryVoltage; } float pmGetBatteryVoltageMin(void) { return batteryVoltageMin; } float pmGetBatteryVoltageMax(void) { return batteryVoltageMax; } void pmBatteryUpdate(AdcGroup* adcValues) { float vBat; int16_t vBatRaw; int16_t vBatRefRaw; vBatRaw = pmBatteryIIRLPFilter(adcValues->vbat.val, &batteryVRawFilt); vBatRefRaw = pmBatteryIIRLPFilter(adcValues->vbat.vref, &batteryVRefRawFilt); vBat = adcConvertToVoltageFloat(vBatRaw, vBatRefRaw) * PM_BAT_DIVIDER; pmSetBatteryVoltage(vBat); } void pmSetChargeState(PMChargeStates chgState) { switch (chgState) { case charge100mA: GPIO_ResetBits(PM_GPIO_EN1_PORT, PM_GPIO_EN1); GPIO_ResetBits(PM_GPIO_EN2_PORT, PM_GPIO_EN2); break; case charge500mA: GPIO_SetBits(PM_GPIO_EN1_PORT, PM_GPIO_EN1); GPIO_ResetBits(PM_GPIO_EN2_PORT, PM_GPIO_EN2); break; case chargeMax: GPIO_ResetBits(PM_GPIO_EN1_PORT, PM_GPIO_EN1); GPIO_SetBits(PM_GPIO_EN2_PORT, PM_GPIO_EN2); break; } } PMStates pmUpdateState() { PMStates pmState; bool isCharging = !GPIO_ReadInputDataBit(PM_GPIO_IN_CHG_PORT, PM_GPIO_IN_CHG); bool isPgood = !GPIO_ReadInputDataBit(PM_GPIO_IN_PGOOD_PORT, PM_GPIO_IN_PGOOD); uint32_t batteryLowTime; batteryLowTime = xTaskGetTickCount() - batteryLowTimeStamp; if (isPgood && !isCharging) { pmState = charged; } else if (isPgood && isCharging) { pmState = charging; } else if (!isPgood && !isCharging && (batteryLowTime > PM_BAT_LOW_TIMEOUT)) { pmState = lowPower; } else { pmState = battery; } return pmState; } void pmTask(void *param) { PMStates pmState; PMStates pmStateOld = battery; uint32_t tickCount; vTaskSetApplicationTaskTag(0, (void*)TASK_PM_ID_NBR); tickCount = xTaskGetTickCount(); batteryLowTimeStamp = tickCount; batteryCriticalLowTimeStamp = tickCount; vTaskDelay(1000); while(1) { vTaskDelay(100); tickCount = xTaskGetTickCount(); if (pmGetBatteryVoltage() > PM_BAT_LOW_VOLTAGE) { batteryLowTimeStamp = tickCount; } if (pmGetBatteryVoltage() > PM_BAT_CRITICAL_LOW_VOLTAGE) { batteryCriticalLowTimeStamp = tickCount; } pmState = pmUpdateState(); if (pmState != pmStateOld) { // Actions on state change switch (pmState) { case charged: ledseqStop(LED_GREEN, seq_charging); ledseqRun(LED_GREEN, seq_charged); systemSetCanFly(false); break; case charging: ledseqStop(LED_RED, seq_lowbat); ledseqStop(LED_GREEN, seq_charged); ledseqRun(LED_GREEN, seq_charging); systemSetCanFly(false); //Due to voltage change radio must be restarted radiolinkReInit(); break; case lowPower: ledseqRun(LED_RED, seq_lowbat); systemSetCanFly(true); break; case battery: ledseqStop(LED_GREEN, seq_charging); ledseqStop(LED_GREEN, seq_charged); systemSetCanFly(true); //Due to voltage change radio must be restarted radiolinkReInit(); break; default: systemSetCanFly(true); break; } pmStateOld = pmState; } // Actions during state switch (pmState) { case charged: break; case charging: { uint32_t onTime; onTime = pmBatteryChargeFromVoltage(pmGetBatteryVoltage()) * (LEDSEQ_CHARGE_CYCLE_TIME / 10); ledseqSetTimes(seq_charging, onTime, LEDSEQ_CHARGE_CYCLE_TIME - onTime); } break; case lowPower: { uint32_t batteryCriticalLowTime; batteryCriticalLowTime = tickCount - batteryCriticalLowTimeStamp; if (batteryCriticalLowTime > PM_BAT_CRITICAL_LOW_TIMEOUT) { pmSystemShutdown(); } } break; case battery: { if ((commanderGetInactivityTime() > PM_SYSTEM_SHUTDOWN_TIMEOUT)) { pmSystemShutdown(); } } break; default: break; } } }
{ "content_hash": "a1ffebee193ade531327cb18e2b688f4", "timestamp": "", "source": "github", "line_count": 338, "max_line_length": 95, "avg_line_length": 24.189349112426036, "alnum_prop": 0.6479941291585127, "repo_name": "fangchuan/Apollo-Rover", "id": "e627f247330009ba0b7479910cbd721939fa2e6b", "size": "9175", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "User/bsp/src/bsp_powermanage.c", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "855583" }, { "name": "C", "bytes": "10296889" }, { "name": "C++", "bytes": "72255" }, { "name": "CSS", "bytes": "8268" }, { "name": "HTML", "bytes": "595144" }, { "name": "Objective-C", "bytes": "2970" }, { "name": "Perl", "bytes": "2645" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en-us"> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.js"></script> <script src="/public/lib/leaflet-ajax/dist/leaflet.ajax.min.js"></script> <script src='//api.tiles.mapbox.com/mapbox.js/plugins/leaflet-fullscreen/v0.0.2/Leaflet.fullscreen.min.js'></script> <link href='//api.tiles.mapbox.com/mapbox.js/plugins/leaflet-fullscreen/v0.0.2/leaflet.fullscreen.css' rel='stylesheet' /> <script src="/public/lib/leaflet-gpx/gpx.js"></script> <!-- Facebook tags --> <meta property="og:title" content="Home"> <meta property="og:type" content="website"> <meta property="og:url" content="http://sysadm.cz//"> <meta property="og:image" content="http://sysadm.cz"> <meta property="og:description" content=""> <meta property="og:site_name" content="sysadm.cz"> <meta property="og:locale" content=""> <meta property="fb:admins" content=""> <!-- <meta property="fb:app_id" content=""> --> <!-- Enable responsiveness on mobile devices--> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1"> <title> sysadm.cz </title> <!-- CSS --> <link rel="stylesheet" href="/public/css/poole.css"> <link rel="stylesheet" href="/public/css/syntax.css"> <link rel="stylesheet" href="/public/css/lanyon.css"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=PT+Serif:400,400italic,700%7CPT+Sans:400"> <!-- Icons --> <link rel="apple-touch-icon-precomposed" sizes="144x144" href="/public/apple-touch-icon-precomposed.png"> <link rel="shortcut icon" href="/public/favicon.ico"> <!-- RSS --> <link rel="alternate" type="application/rss+xml" title="RSS" href="/atom.xml"> </head> <body class="sidebar-overlay"> <!-- Target for toggling the sidebar `.sidebar-checkbox` is for regular styles, `#sidebar-checkbox` for behavior. --> <input type="checkbox" class="sidebar-checkbox" id="sidebar-checkbox"> <!-- Toggleable sidebar --> <div class="sidebar" id="sidebar"> <div class="sidebar-item"> <p>the pages with experience one of the bigdata admin</p> </div> <nav class="sidebar-nav"> <a class="sidebar-nav-item" href="/">Home</a> <a class="sidebar-nav-item" href="/about/">About</a> <a class="sidebar-nav-item" href="/tag/">Tags</a> <a class="sidebar-nav-item" href="/atom.xml">Feed</a> <a class="sidebar-nav-item" href="/">Latest posts</a> <ul class="posts"> <li> <span>22 May 2016</span> &raquo; <a href="/2016/05/22/Better-balancer-for-solr/"> Better balancer and more for Apache Solr</a> </li> <li> <span>08 Apr 2016</span> &raquo; <a href="/2016/04/08/One-more-step-to-autodeploy/"> One more step to autodeploy</a> </li> <li> <span>16 Feb 2016</span> &raquo; <a href="/2016/02/16/Azkaban-eboshi/"> Azkaban workflow manager + eboshi</a> </li> <li> <span>07 Jan 2016</span> &raquo; <a href="/2016/01/07/Inconsistency-jmx-hbck/"> Corrupt blocks in HDFS?</a> </li> <li> <span>05 Dec 2015</span> &raquo; <a href="/2015/12/05/Upgrade-opscenter/"> Upgrade OpsCenter to version 5.2.2</a> </li> <li> <span>24 Nov 2015</span> &raquo; <a href="/2015/11/24/Welcome/"> Welcome to my new page</a> </li> </ul> </nav> </div> <!-- Wrap is the content to shift when toggling the sidebar. We wrap the content to avoid any CSS collisions with our real content. --> <div class="wrap"> <div class="masthead"> <div class="container"> <h3 class="masthead-title"> <small><img alt="hadoop" src="/public/images/hadoop-elephant.png" style="margin: -12px 10px; float: left;"></small> <a href="/" title="Home">sysadm.cz</a> </h3> </div> </div> <div class="container content"> <div class="posts"> <article class="post"> <h1 class="post-title"> <a href="/2016/05/22/Better-balancer-for-solr/"> Better balancer and more for Apache Solr </a> </h1> <time datetime="2016-05-22T00:00:00+02:00" class="post-date">22 May 2016</time> <p><img alt="solr" src="/public/images/solr.png" align="left" style="margin: 0px 15px 0px 15px; float: right;" /></p> <p>Our team have some <a href="http://lucene.apache.org/solr/" target="_blank">Apache Solr</a> servers.</p> <p><a class="btn btn-sm btn-primary" href="/2016/05/22/Better-balancer-for-solr//#read-more" role="button">Read more <i class="fa fa-arrow-circle-right"></i></a> </p> <a href="/tag/solr">#solr</a> </article> <article class="post"> <h1 class="post-title"> <a href="/2016/04/08/One-more-step-to-autodeploy/"> One more step to autodeploy </a> </h1> <time datetime="2016-04-08T00:00:00+02:00" class="post-date">08 Apr 2016</time> <p><img alt="saltstack" src="/public/images/saltstack.png" align="left" style="margin: 0px 15px 0px 15px; float: right;" /></p> <p>For maintenance of our servers we use <a href="http://saltstack.com/" target="_blank">Satl Stack</a>. Few days ago we installed packages from states and define versions in pillars. So we had for every cluster some states (e.g. workers.sls, launchers.sls, masters.sls). When we wanted add some package we had to edit state and pillar. Additionally, if we had to adjust config for this package we had edit more states. One day we said we have to find better way for install package. The way where deployers can edit (via merge request to our gitlab - where we have our salt states with pillars) configs and versions that are in productions servers.</p> <p><a class="btn btn-sm btn-primary" href="/2016/04/08/One-more-step-to-autodeploy//#read-more" role="button">Read more <i class="fa fa-arrow-circle-right"></i></a> </p> <a href="/tag/salt">#salt</a> </article> <article class="post"> <h1 class="post-title"> <a href="/2016/02/16/Azkaban-eboshi/"> Azkaban workflow manager + eboshi </a> </h1> <time datetime="2016-02-16T00:00:00+01:00" class="post-date">16 Feb 2016</time> <p><img alt="azkaban" src="/public/images/azkaban-flow.png" align="left" style="margin: 0px 15px 0px 15px; float: right;" /></p> <p>Some days ago we looked for some scheduler for execute our MapReduce jobs. We chose <a href="https://github.com/azkaban/azkaban">Azkaban</a> workflow manager and <a href="https://github.com/wyukawa/eboshi">eboshi</a> (because we wanted autodeploy via Salt Stack). Now I want to write about our experiences with this project.</p> <p><a class="btn btn-sm btn-primary" href="/2016/02/16/Azkaban-eboshi//#read-more" role="button">Read more <i class="fa fa-arrow-circle-right"></i></a> </p> <a href="/tag/yarn">#yarn</a> </article> <article class="post"> <h1 class="post-title"> <a href="/2016/01/07/Inconsistency-jmx-hbck/"> Corrupt blocks in HDFS? </a> </h1> <time datetime="2016-01-07T00:00:00+01:00" class="post-date">07 Jan 2016</time> <p><img alt="hadoopbinary" src="/public/images/hadoopbinary.png" align="left" style="margin: 0px 15px 0px 15px; float: right;" /></p> <p>Few weeks ago we saw corrupt blocks in HDFS in jmx output (like http://namenode:50070/jmx). So we didn't start panic and run fsck. Hadoop fsck output said status <b>HEALTHY</b> and this was true.</p> <p><br /></p> <div class="highlight"><pre><code>... "PendingReplicationBlocks" : 0, "UnderReplicatedBlocks" : 0, "CorruptBlocks" : 5, "ScheduledReplicationBlocks" : 0, "PendingDeletionBlocks" : 0, ...</code></pre></div> <p>Result: Dont trust jmx everytime!</p> <p><u>UPDATE:</u> same situation is in HBase jmx and Regions In Transition (ritcount). We had some RIT, but jmx sayed <code>"ritCount":0</code>. JMX is bigger and biiger liars every day.</p> <a href="/tag/hadoop">#hadoop</a> </article> <article class="post"> <h1 class="post-title"> <a href="/2015/12/05/Upgrade-opscenter/"> Upgrade OpsCenter to version 5.2.2 </a> </h1> <time datetime="2015-12-05T00:00:00+01:00" class="post-date">05 Dec 2015</time> <p><img alt="opscenter-nodata" src="/public/images/nodata.png" align="left" style="margin: 0px 15px 0px 15px; float: right;" /></p> <p>Today I decided how I upgraded OpsCenter on one of us cluster. One of reasons was that box "Cluster Health" still loading only and I want try the newest version.</p> <p>This bring me some throuble (like every upgrade :-)). First I had to upgrade all datastax-agents on each node. After that on WebUI OpsCenter I saw "No Data" in some boxes (specifically a "write requests", "disk utilization", "write request latency" and "load").</p> <p><a class="btn btn-sm btn-primary" href="/2015/12/05/Upgrade-opscenter//#read-more" role="button">Read more <i class="fa fa-arrow-circle-right"></i></a> </p> <a href="/tag/cassandra">#cassandra</a> </article> </div> <div class="pagination"> <a class="pagination-item older" href="/page2">Older</a> <span class="pagination-item newer">Newer</span> </div> </div> </div> <label for="sidebar-checkbox" class="sidebar-toggle"></label> <script> (function(document) { var toggle = document.querySelector('.sidebar-toggle'); var sidebar = document.querySelector('#sidebar'); var checkbox = document.querySelector('#sidebar-checkbox'); document.addEventListener('click', function(e) { var target = e.target; if(!checkbox.checked || sidebar.contains(target) || (target === checkbox || target === toggle)) return; checkbox.checked = false; }, false); })(document); </script> <!-- Analytics begin --> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-71156455-1', 'auto'); ga('send', 'pageview'); </script> <!-- Analytics end --> </body> </html>
{ "content_hash": "8b43026e3de3af9a1953409f817d7b84", "timestamp": "", "source": "github", "line_count": 428, "max_line_length": 653, "avg_line_length": 26.035046728971963, "alnum_prop": 0.6080947680157947, "repo_name": "v1dlak/sysadm.cz", "id": "7c82b9f83473ef71734b70933e5b9cc8de5a884f", "size": "11143", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "_posts/_site/index.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "71891" }, { "name": "HTML", "bytes": "195334" }, { "name": "Ruby", "bytes": "10783" } ], "symlink_target": "" }
A small directive which essentially is a color picker but with a few extra functions - for AngularJS. Based on [ng-color-picker](https://github.com/joujiahe/ng-color-picker). **Requirements**: Angular 1.2+ ![Screenshot](assets/screenshot.png) # Features - Customize the appearance of the color picker (vertical, horizontal, columns etc.) - Generate random colors - Generate gradient colors # Demo - [Demo](http://simeg.github.io/ngjs-color-picker) - [Plunker](http://embed.plnkr.co/INXf3efkYeP1gWaF9SId/preview) # Installation ## npm: ``` bash npm install --save ngjs-color-picker ``` You may have to run ``` bash grunt wiredep ``` to make grunt automatically add the needed files to your `index.html`. ## Manually: Clone or [download](https://github.com/simeg/ngjs-color-picker/archive/master.zip) the repository and include the production file in your application. ``` html <script type="text/javascript" src="dist/ngjs-color-picker.js"></script> ``` Inject the directive as a dependency in your app: ``` javascript angular.module('myApp', ['ngjsColorPicker']); ``` # Usage and documentation For documentation, examples and usage see the [GitHub page for this repository](http://simeg.github.io/ngjs-color-picker). ## Option prioritization 1. Custom colors 2. Random colors 3. Gradient 4. Default colors # Contribute :raised_hands: Run `npm install` and then you're able to start dev server with ``` bash npm run serve ``` The server is then available at [http://localhost:8080](http://localhost:8080). The file `dev/app/ngjs-color-picker.js` is a symlink to `source/ngjs-color-picker.js`, so you can edit either one of them and the change will be shown on the dev server. (Development server environment created using awesome [angular-webpack](https://github.com/preboot/angular-webpack)). # TODO * **See [issues](https://github.com/simeg/ngjs-color-picker/issues)** * Click (or something) to get the hex-code for the color (rgb should also be available) * Add reverse option for gradient * Include color themes (Good palettes: http://jsfiddle.net/nicgirault/bqph3pkL/) * Add option to select rows instead of columns
{ "content_hash": "65caf4f968094ef069eac4fe2ee02cae", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 174, "avg_line_length": 31, "alnum_prop": 0.7489481065918654, "repo_name": "simeg/ngjs-color-picker", "id": "7c384a34a703d1b8729aae54d584efc688a666e3", "size": "2397", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "1495" }, { "name": "JavaScript", "bytes": "35810" } ], "symlink_target": "" }
<?xml version="1.0" ?><!DOCTYPE TS><TS language="fa_IR" version="2.1"> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About YEScoin</source> <translation type="unfinished"/> </message> <message> <location line="+39"/> <source>&lt;b&gt;YEScoin&lt;/b&gt; version</source> <translation type="unfinished"/> </message> <message> <location line="+41"/> <source>Copyright © 2009-2014 The Bitcoin developers Copyright © 2012-2014 The NovaCoin developers Copyright © 2014 The YEScoin developers</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>Double-click to edit address or label</source> <translation>برای ویرایش حساب و یا برچسب دوبار کلیک نمایید</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation>گشایش حسابی جدید</translation> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation>کپی کردن حساب انتخاب شده به حافظه سیستم - کلیپ بورد</translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation type="unfinished"/> </message> <message> <location line="-46"/> <source>These are your YEScoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source> <translation type="unfinished"/> </message> <message> <location line="+60"/> <source>&amp;Copy Address</source> <translation>و کپی آدرس</translation> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a YEScoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation type="unfinished"/> </message> <message> <location line="-14"/> <source>Verify a message to ensure it was signed with a specified YEScoin address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>و حذف</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+65"/> <source>Copy &amp;Label</source> <translation>کپی و برچسب</translation> </message> <message> <location line="+2"/> <source>&amp;Edit</source> <translation>و ویرایش</translation> </message> <message> <location line="+250"/> <source>Export Address Book Data</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>سی.اس.وی. (فایل جداگانه دستوری)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation>برچسب</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>حساب</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(برچسب ندارد)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>رمز/پَس فرِیز را وارد کنید</translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation>رمز/پَس فرِیز جدید را وارد کنید</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>رمز/پَس فرِیز را دوباره وارد کنید</translation> </message> <message> <location line="+33"/> <source>Serves to disable the trivial sendmoney when OS account compromised. Provides no real security.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>For staking only</source> <translation type="unfinished"/> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+35"/> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;10 or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation>رمز/پَس فرِیز جدید را در wallet وارد کنید. برای انتخاب رمز/پَس فرِیز از 10 کاراکتر تصادفی یا بیشتر و یا هشت کلمه یا بیشتر استفاده کنید. </translation> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation>wallet را رمزگذاری کنید</translation> </message> <message> <location line="+7"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>برای انجام این عملکرد به رمز/پَس فرِیزِwallet نیاز است تا آن را از حالت قفل درآورد.</translation> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>باز کردن قفل wallet </translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>برای کشف رمز wallet، به رمز/پَس فرِیزِwallet نیاز است.</translation> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation>کشف رمز wallet</translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation>تغییر رمز/پَس فرِیز</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>رمز/پَس فرِیزِ قدیم و جدید را در wallet وارد کنید</translation> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation>رمزگذاری wallet را تایید کنید</translation> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR COINS&lt;/b&gt;!</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> <translation type="unfinished"/> </message> <message> <location line="+103"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation type="unfinished"/> </message> <message> <location line="-133"/> <location line="+60"/> <source>Wallet encrypted</source> <translation>تایید رمزگذاری</translation> </message> <message> <location line="-58"/> <source>YEScoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your coins from being stolen by malware infecting your computer.</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+44"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>رمزگذاری تایید نشد</translation> </message> <message> <location line="-56"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>رمزگذاری به علت خطای داخلی تایید نشد. wallet شما رمزگذاری نشد</translation> </message> <message> <location line="+7"/> <location line="+50"/> <source>The supplied passphrases do not match.</source> <translation>رمزهای/پَس فرِیزهایِ وارد شده با هم تطابق ندارند</translation> </message> <message> <location line="-38"/> <source>Wallet unlock failed</source> <translation>قفل wallet باز نشد</translation> </message> <message> <location line="+1"/> <location line="+12"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>رمزهای/پَس فرِیزهایِ وارد شده wallet برای کشف رمز اشتباه است.</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>کشف رمز wallet انجام نشد</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation type="unfinished"/> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+282"/> <source>Sign &amp;message...</source> <translation>امضا و پیام</translation> </message> <message> <location line="+251"/> <source>Synchronizing with network...</source> <translation>به روز رسانی با شبکه...</translation> </message> <message> <location line="-319"/> <source>&amp;Overview</source> <translation>و بازبینی</translation> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation>نمای کلی از wallet را نشان بده</translation> </message> <message> <location line="+17"/> <source>&amp;Transactions</source> <translation>و تراکنش</translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation>تاریخچه تراکنش را باز کن</translation> </message> <message> <location line="+5"/> <source>&amp;Address Book</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Edit the list of stored addresses and labels</source> <translation type="unfinished"/> </message> <message> <location line="-13"/> <source>&amp;Receive coins</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show the list of addresses for receiving payments</source> <translation type="unfinished"/> </message> <message> <location line="-7"/> <source>&amp;Send coins</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>E&amp;xit</source> <translation>خروج</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>از &quot;درخواست نامه&quot;/ application خارج شو</translation> </message> <message> <location line="+6"/> <source>Show information about YEScoin</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation>درباره و QT</translation> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation>نمایش اطلاعات درباره QT</translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>و انتخابها</translation> </message> <message> <location line="+4"/> <source>&amp;Encrypt Wallet...</source> <translation>و رمزگذاری wallet</translation> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation>و گرفتن نسخه پیشتیبان از wallet</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>تغییر رمز/پَس فرِیز</translation> </message> <message numerus="yes"> <location line="+259"/> <source>~%n block(s) remaining</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+6"/> <source>Downloaded %1 of %2 blocks of transaction history (%3% done).</source> <translation type="unfinished"/> </message> <message> <location line="-256"/> <source>&amp;Export...</source> <translation type="unfinished"/> </message> <message> <location line="-64"/> <source>Send coins to a YEScoin address</source> <translation type="unfinished"/> </message> <message> <location line="+47"/> <source>Modify configuration options for YEScoin</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>Export the data in the current tab to a file</source> <translation type="unfinished"/> </message> <message> <location line="-14"/> <source>Encrypt or decrypt wallet</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Backup wallet to another location</source> <translation>گرفتن نسخه پیشتیبان در آدرسی دیگر</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>رمز مربوط به رمزگذاریِ wallet را تغییر دهید</translation> </message> <message> <location line="+10"/> <source>&amp;Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>&amp;Verify message...</source> <translation type="unfinished"/> </message> <message> <location line="-202"/> <source>YEScoin</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Wallet</source> <translation>کیف پول</translation> </message> <message> <location line="+180"/> <source>&amp;About YEScoin</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation>&amp;نمایش/ عدم نمایش و</translation> </message> <message> <location line="+9"/> <source>Unlock wallet</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>&amp;Lock Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Lock wallet</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>&amp;File</source> <translation>و فایل</translation> </message> <message> <location line="+8"/> <source>&amp;Settings</source> <translation>و تنظیمات</translation> </message> <message> <location line="+8"/> <source>&amp;Help</source> <translation>و راهنما</translation> </message> <message> <location line="+12"/> <source>Tabs toolbar</source> <translation>نوار ابزار</translation> </message> <message> <location line="+8"/> <source>Actions toolbar</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+9"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> <message> <location line="+0"/> <location line="+60"/> <source>YEScoin client</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+75"/> <source>%n active connection(s) to YEScoin network</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+40"/> <source>Downloaded %1 blocks of transaction history.</source> <translation type="unfinished"/> </message> <message> <location line="+413"/> <source>Staking.&lt;br&gt;Your weight is %1&lt;br&gt;Network weight is %2&lt;br&gt;Expected time to earn reward is %3</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Not staking because wallet is locked</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Not staking because wallet is offline</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Not staking because wallet is syncing</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Not staking because you don&apos;t have mature coins</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-403"/> <source>%n second(s) ago</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="-312"/> <source>About YEScoin card</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show information about YEScoin card</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>&amp;Unlock Wallet...</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+297"/> <source>%n minute(s) ago</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n hour(s) ago</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s) ago</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+6"/> <source>Up to date</source> <translation>روزآمد</translation> </message> <message> <location line="+7"/> <source>Catching up...</source> <translation>در حال روزآمد سازی..</translation> </message> <message> <location line="+10"/> <source>Last received block was generated %1.</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Confirm transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Sent transaction</source> <translation>ارسال تراکنش</translation> </message> <message> <location line="+1"/> <source>Incoming transaction</source> <translation>تراکنش دریافتی</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>تاریخ: %1⏎ میزان وجه : %2⏎ نوع: %3⏎ آدرس: %4⏎ </translation> </message> <message> <location line="+100"/> <location line="+15"/> <source>URI handling</source> <translation type="unfinished"/> </message> <message> <location line="-15"/> <location line="+15"/> <source>URI can not be parsed! This can be caused by an invalid YEScoin address or malformed URI parameters.</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>wallet رمزگذاری شد و در حال حاضر از حالت قفل در آمده است</translation> </message> <message> <location line="+10"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>wallet رمزگذاری شد و در حال حاضر قفل است</translation> </message> <message> <location line="+25"/> <source>Backup Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+76"/> <source>%n second(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n minute(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n hour(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+18"/> <source>Not staking</source> <translation type="unfinished"/> </message> <message> <location filename="../bitcoin.cpp" line="+109"/> <source>A fatal error occurred. YEScoin can no longer continue safely and will quit.</source> <translation type="unfinished"/> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+90"/> <source>Network Alert</source> <translation>هشدار شبکه</translation> </message> </context> <context> <name>CoinControlDialog</name> <message> <location filename="../forms/coincontroldialog.ui" line="+14"/> <source>Coin Control</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Quantity:</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Bytes:</source> <translation type="unfinished"/> </message> <message> <location line="+48"/> <source>Amount:</source> <translation>میزان وجه:</translation> </message> <message> <location line="+32"/> <source>Priority:</source> <translation type="unfinished"/> </message> <message> <location line="+48"/> <source>Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation type="unfinished"/> </message> <message> <location filename="../coincontroldialog.cpp" line="+551"/> <source>no</source> <translation type="unfinished"/> </message> <message> <location filename="../forms/coincontroldialog.ui" line="+51"/> <source>After Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Change:</source> <translation type="unfinished"/> </message> <message> <location line="+69"/> <source>(un)select all</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Tree mode</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>List mode</source> <translation type="unfinished"/> </message> <message> <location line="+45"/> <source>Amount</source> <translation>میزان</translation> </message> <message> <location line="+5"/> <source>Label</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Address</source> <translation>حساب</translation> </message> <message> <location line="+5"/> <source>Date</source> <translation>تاریخ</translation> </message> <message> <location line="+5"/> <source>Confirmations</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Confirmed</source> <translation>تایید شده</translation> </message> <message> <location line="+5"/> <source>Priority</source> <translation type="unfinished"/> </message> <message> <location filename="../coincontroldialog.cpp" line="-515"/> <source>Copy address</source> <translation>آدرس را کپی کنید</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>برچسب را کپی کنید</translation> </message> <message> <location line="+1"/> <location line="+26"/> <source>Copy amount</source> <translation>میزان وجه کپی شود</translation> </message> <message> <location line="-25"/> <source>Copy transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>Copy quantity</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Copy fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy change</source> <translation type="unfinished"/> </message> <message> <location line="+317"/> <source>highest</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>high</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>medium-high</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>medium</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>low-medium</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>low</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>lowest</source> <translation type="unfinished"/> </message> <message> <location line="+155"/> <source>DUST</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>yes</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>This label turns red, if the transaction size is bigger than 10000 bytes. This means a fee of at least %1 per kb is required. Can vary +/- 1 Byte per input.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transactions with higher priority get more likely into a block. This label turns red, if the priority is smaller than &quot;medium&quot;. This means a fee of at least %1 per kb is required.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This label turns red, if any recipient receives an amount smaller than %1. This means a fee of at least %2 is required. Amounts below 0.546 times the minimum relay fee are shown as DUST.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This label turns red, if the change is smaller than %1. This means a fee of at least %2 is required.</source> <translation type="unfinished"/> </message> <message> <location line="+37"/> <location line="+66"/> <source>(no label)</source> <translation>(برچسب ندارد)</translation> </message> <message> <location line="-9"/> <source>change from %1 (%2)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>(change)</source> <translation type="unfinished"/> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>ویرایش حساب</translation> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation>و برچسب</translation> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation>حساب&amp;</translation> </message> <message> <location line="+10"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation type="unfinished"/> </message> <message> <location filename="../editaddressdialog.cpp" line="+20"/> <source>New receiving address</source> <translation>حساب دریافت کننده جدید </translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation>حساب ارسال کننده جدید</translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation>ویرایش حساب دریافت کننده</translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation>ویرایش حساب ارسال کننده</translation> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>حساب وارد شده «1%» از پیش در دفترچه حساب ها موجود است.</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid YEScoin address.</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>عدم توانیی برای قفل گشایی wallet</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>عدم توانیی در ایجاد کلید جدید</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+420"/> <location line="+12"/> <source>YEScoin-Qt</source> <translation type="unfinished"/> </message> <message> <location line="-12"/> <source>version</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Usage:</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>UI options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation type="unfinished"/> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>انتخاب/آپشن</translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. Fee 0.01 recommended.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Reserved amount does not participate in staking and is therefore spendable at any time.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Reserve</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Automatically start YEScoin after logging in to the system.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Start YEScoin on system login</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Detach block and address databases at shutdown. This means they can be moved to another data directory, but it slows down shutdown. The wallet is always detached.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Detach databases at shutdown</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>&amp;Network</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Automatically open the YEScoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Connect to the YEScoin network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation type="unfinished"/> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting YEScoin.</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Whether to show YEScoin addresses in the transaction list or not.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation>و نمایش آدرسها در فهرست تراکنش</translation> </message> <message> <location line="+7"/> <source>Whether to show coin control features or not.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Display coin &amp;control features (experts only!)</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation>و تایید</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>و رد</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation type="unfinished"/> </message> <message> <location filename="../optionsdialog.cpp" line="+55"/> <source>default</source> <translation>پیش فرض</translation> </message> <message> <location line="+149"/> <location line="+9"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting YEScoin.</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation type="unfinished"/> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation>فرم</translation> </message> <message> <location line="+33"/> <location line="+231"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the YEScoin network after a connection is established, but this process has not completed yet.</source> <translation type="unfinished"/> </message> <message> <location line="-160"/> <source>Stake:</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>Unconfirmed:</source> <translation type="unfinished"/> </message> <message> <location line="-107"/> <source>Wallet</source> <translation>کیف پول</translation> </message> <message> <location line="+49"/> <source>Spendable:</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Your current spendable balance</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>Immature:</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>Total:</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Your current total balance</source> <translation type="unfinished"/> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>تراکنشهای اخیر</translation> </message> <message> <location line="-108"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source> <translation type="unfinished"/> </message> <message> <location line="-29"/> <source>Total of coins that was staked, and do not yet count toward the current balance</source> <translation type="unfinished"/> </message> <message> <location filename="../overviewpage.cpp" line="+113"/> <location line="+1"/> <source>out of sync</source> <translation>خارج از روزآمد سازی</translation> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation type="unfinished"/> </message> <message> <location line="+56"/> <source>Amount:</source> <translation type="unfinished"/> </message> <message> <location line="-44"/> <source>Label:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Message:</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation type="unfinished"/> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation type="unfinished"/> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation>نام کنسول RPC</translation> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+348"/> <source>N/A</source> <translation type="unfinished"/> </message> <message> <location line="-217"/> <source>Client version</source> <translation>ویرایش کنسول RPC</translation> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation type="unfinished"/> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation type="unfinished"/> </message> <message> <location line="+49"/> <source>Startup time</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>Network</source> <translation>شبکه</translation> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation>تعداد اتصال</translation> </message> <message> <location line="+23"/> <source>On testnet</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Block chain</source> <translation>زنجیره مجموعه تراکنش ها</translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation>تعداد زنجیره های حاضر</translation> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Last block time</source> <translation type="unfinished"/> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Show the YEScoin-Qt help message to get a list with possible YEScoin command-line options.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation type="unfinished"/> </message> <message> <location line="-260"/> <source>Build date</source> <translation type="unfinished"/> </message> <message> <location line="-104"/> <source>YEScoin - Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>YEScoin Core</source> <translation type="unfinished"/> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Open the YEScoin debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation type="unfinished"/> </message> <message> <location line="+102"/> <source>Clear console</source> <translation type="unfinished"/> </message> <message> <location filename="../rpcconsole.cpp" line="-33"/> <source>Welcome to the YEScoin RPC console.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+182"/> <location line="+5"/> <location line="+5"/> <location line="+5"/> <location line="+6"/> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> <translation>سکه های ارسالی</translation> </message> <message> <location line="+76"/> <source>Coin Control Features</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>Inputs...</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>automatically selected</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Insufficient funds!</source> <translation type="unfinished"/> </message> <message> <location line="+77"/> <source>Quantity:</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <location line="+35"/> <source>0</source> <translation type="unfinished"/> </message> <message> <location line="-19"/> <source>Bytes:</source> <translation type="unfinished"/> </message> <message> <location line="+51"/> <source>Amount:</source> <translation>میزان وجه:</translation> </message> <message> <location line="+22"/> <location line="+86"/> <location line="+86"/> <location line="+32"/> <source>0.00 BTC</source> <translation type="unfinished"/> </message> <message> <location line="-191"/> <source>Priority:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>medium</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>no</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>After Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Change</source> <translation type="unfinished"/> </message> <message> <location line="+50"/> <source>custom change address</source> <translation type="unfinished"/> </message> <message> <location line="+106"/> <source>Send to multiple recipients at once</source> <translation>ارسال همزمان به گیرنده های متعدد</translation> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>Balance:</source> <translation>مانده حساب:</translation> </message> <message> <location line="+16"/> <source>123.456 BTC</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation>تایید عملیات ارسال </translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation>و ارسال</translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-173"/> <source>Enter a YEScoin address (e.g. YEScoinfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Copy quantity</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>میزان وجه کپی شود</translation> </message> <message> <location line="+1"/> <source>Copy fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy change</source> <translation type="unfinished"/> </message> <message> <location line="+86"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation>تایید ارسال بیت کوین ها</translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source> and </source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>The recipient address is not valid, please recheck.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation>میزان پرداخت باید بیشتر از 0 باشد</translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation>مقدار مورد نظر از مانده حساب بیشتر است.</translation> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="+251"/> <source>WARNING: Invalid YEScoin address</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>(no label)</source> <translation>(برچسب ندارد)</translation> </message> <message> <location line="+4"/> <source>WARNING: unknown change address</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>و میزان وجه</translation> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation>پرداخت و به چه کسی</translation> </message> <message> <location line="+24"/> <location filename="../sendcoinsentry.cpp" line="+25"/> <source>Enter a label for this address to add it to your address book</source> <translation>یک برچسب برای این آدرس بنویسید تا به دفترچه آدرسهای شما اضافه شود</translation> </message> <message> <location line="+9"/> <source>&amp;Label:</source> <translation>و برچسب</translation> </message> <message> <location line="+18"/> <source>The address to send the payment to (e.g. YEScoinfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Choose address from address book</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Alt+A</source> <translation>Alt و A</translation> </message> <message> <location line="+7"/> <source>Paste address from clipboard</source> <translation>آدرس را بر کلیپ بورد کپی کنید</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt و P</translation> </message> <message> <location line="+7"/> <source>Remove this recipient</source> <translation type="unfinished"/> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a YEScoin address (e.g. YEScoinfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+124"/> <source>&amp;Sign Message</source> <translation>و امضای پیام </translation> </message> <message> <location line="-118"/> <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. YEScoinfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <location line="+203"/> <source>Choose an address from the address book</source> <translation type="unfinished"/> </message> <message> <location line="-193"/> <location line="+203"/> <source>Alt+A</source> <translation>Alt و A</translation> </message> <message> <location line="-193"/> <source>Paste address from clipboard</source> <translation>آدرس را بر کلیپ بورد کپی کنید</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt و P</translation> </message> <message> <location line="+12"/> <source>Enter the message you want to sign here</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>Copy the current signature to the system clipboard</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this YEScoin address</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Reset all sign message fields</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation type="unfinished"/> </message> <message> <location line="-87"/> <location line="+70"/> <source>&amp;Verify Message</source> <translation type="unfinished"/> </message> <message> <location line="-64"/> <source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. YEScoinfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified YEScoin address</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Reset all verify message fields</source> <translation type="unfinished"/> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a YEScoin address (e.g. YEScoinfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Enter YEScoin signature</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation type="unfinished"/> </message> <message> <location line="-81"/> <location line="+8"/> <location line="+73"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation type="unfinished"/> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation type="unfinished"/> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation type="unfinished"/> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation type="unfinished"/> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+19"/> <source>Open until %1</source> <translation>باز کن تا %1</translation> </message> <message numerus="yes"> <location line="-2"/> <source>Open for %n block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+8"/> <source>conflicted</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1/offline</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1 / تایید نشده</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>%1 تایید</translation> </message> <message> <location line="+18"/> <source>Status</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>تاریخ</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Generated</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation type="unfinished"/> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>label</source> <translation>برچسب</translation> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation type="unfinished"/> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation type="unfinished"/> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Net amount</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Message</source> <translation>پیام</translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Generated coins must mature 510 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Debug information</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Transaction</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Inputs</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Amount</source> <translation>میزان</translation> </message> <message> <location line="+1"/> <source>true</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>false</source> <translation type="unfinished"/> </message> <message> <location line="-211"/> <source>, has not been successfully broadcast yet</source> <translation>، هنوز با موفقیت ارسال نگردیده است</translation> </message> <message> <location line="+35"/> <source>unknown</source> <translation>ناشناس</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation>جزئیات تراکنش</translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation>این بخش جزئیات تراکنش را نشان می دهد</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+226"/> <source>Date</source> <translation>تاریخ</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>گونه</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>آدرس</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>میزان وجه</translation> </message> <message> <location line="+60"/> <source>Open until %1</source> <translation>باز کن تا %1</translation> </message> <message> <location line="+12"/> <source>Confirmed (%1 confirmations)</source> <translation>تایید شده (%1 تاییدها)</translation> </message> <message numerus="yes"> <location line="-15"/> <source>Open for %n more block(s)</source> <translation type="unfinished"><numerusform></numerusform></translation> </message> <message> <location line="+6"/> <source>Offline</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Unconfirmed</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Confirming (%1 of %2 recommended confirmations)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Conflicted</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Immature (%1 confirmations, will be available after %2)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>این block توسط گره های دیگری دریافت نشده است و ممکن است قبول نشود</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>تولید شده اما قبول نشده است</translation> </message> <message> <location line="+42"/> <source>Received with</source> <translation>قبول با </translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>دریافت شده از</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>ارسال به</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>وجه برای شما </translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>استخراج شده</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>خالی</translation> </message> <message> <location line="+190"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>وضعیت تراکنش. با اشاره به این بخش تعداد تاییدها نمایش داده می شود</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>زمان و تاریخی که تراکنش دریافت شده است</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>نوع تراکنش</translation> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation>آدرس مقصد در تراکنش</translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation>میزان وجه کم شده یا اضافه شده به حساب</translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+55"/> <location line="+16"/> <source>All</source> <translation>همه</translation> </message> <message> <location line="-15"/> <source>Today</source> <translation>امروز</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation>این هفته</translation> </message> <message> <location line="+1"/> <source>This month</source> <translation>این ماه</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>ماه گذشته</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>این سال</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>حدود..</translation> </message> <message> <location line="+11"/> <source>Received with</source> <translation>دریافت با</translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation>ارسال به</translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation>به شما</translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation>استخراج شده</translation> </message> <message> <location line="+1"/> <source>Other</source> <translation>دیگر</translation> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation>آدرس یا برچسب را برای جستجو وارد کنید</translation> </message> <message> <location line="+7"/> <source>Min amount</source> <translation>حداقل میزان وجه</translation> </message> <message> <location line="+34"/> <source>Copy address</source> <translation>آدرس را کپی کنید</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>برچسب را کپی کنید</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>میزان وجه کپی شود</translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>برچسب را ویرایش کنید</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation type="unfinished"/> </message> <message> <location line="+144"/> <source>Export Transaction Data</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Comma separated file (*.csv) فایل جداگانه دستوری</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>تایید شده</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>تاریخ</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>نوع</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>برچسب</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>آدرس</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>میزان</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>شناسه کاربری</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation type="unfinished"/> </message> <message> <location line="+100"/> <source>Range:</source> <translation>دامنه:</translation> </message> <message> <location line="+8"/> <source>to</source> <translation>به</translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+206"/> <source>Sending...</source> <translation type="unfinished"/> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+33"/> <source>YEScoin version</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Usage:</source> <translation>میزان استفاده:</translation> </message> <message> <location line="+1"/> <source>Send command to -server or YEScoind</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>List commands</source> <translation>فهرست دستورها</translation> </message> <message> <location line="+1"/> <source>Get help for a command</source> <translation>درخواست کمک برای یک دستور</translation> </message> <message> <location line="+2"/> <source>Options:</source> <translation>انتخابها:</translation> </message> <message> <location line="+2"/> <source>Specify configuration file (default: YEScoin.conf)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Specify pid file (default: YEScoind.pid)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Specify wallet file (within data directory)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>دایرکتوری داده را مشخص کن</translation> </message> <message> <location line="+2"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>حافظه بانک داده را به مگابایت تنظیم کنید (پیش فرض: 25)</translation> </message> <message> <location line="+1"/> <source>Set database disk log size in megabytes (default: 100)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Listen for connections on &lt;port&gt; (default: 15714 or testnet: 25714)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>نگهداری &lt;N&gt; ارتباطات برای قرینه سازی (پیش فرض:125)</translation> </message> <message> <location line="+3"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Specify your own public address</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Bind to given address. Use [host]:port notation for IPv6</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Stake your coins to support network and gain reward (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>آستانه قطع برای قرینه سازی اشتباه (پیش فرض:100)</translation> </message> <message> <location line="+1"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>تعداد ثانیه ها برای اتصال دوباره قرینه های اشتباه (پیش فرض:86400)</translation> </message> <message> <location line="-44"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation type="unfinished"/> </message> <message> <location line="+51"/> <source>Detach block and address databases. Increases shutdown time (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+109"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds </source> <translation type="unfinished"/> </message> <message> <location line="-87"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 15715 or testnet: 25715)</source> <translation type="unfinished"/> </message> <message> <location line="-11"/> <source>Accept command line and JSON-RPC commands</source> <translation>command line و JSON-RPC commands را قبول کنید</translation> </message> <message> <location line="+101"/> <source>Error: Transaction creation failed </source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>Error: Wallet locked, unable to create transaction </source> <translation type="unfinished"/> </message> <message> <location line="-8"/> <source>Importing blockchain data file.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Importing bootstrap blockchain data file.</source> <translation type="unfinished"/> </message> <message> <location line="-88"/> <source>Run in the background as a daemon and accept commands</source> <translation>به عنوان daemon بک گراند را اجرا کنید و دستورات را قبول نمایید</translation> </message> <message> <location line="+1"/> <source>Use the test network</source> <translation>از تستِ شبکه استفاده نمایید</translation> </message> <message> <location line="-24"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation type="unfinished"/> </message> <message> <location line="-38"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation type="unfinished"/> </message> <message> <location line="+117"/> <source>Error initializing database environment %s! To recover, BACKUP THAT DIRECTORY, then remove everything from it except for wallet.dat.</source> <translation type="unfinished"/> </message> <message> <location line="-20"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+61"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong YEScoin will not work properly.</source> <translation type="unfinished"/> </message> <message> <location line="-31"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation type="unfinished"/> </message> <message> <location line="-18"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation type="unfinished"/> </message> <message> <location line="-30"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Block creation options:</source> <translation type="unfinished"/> </message> <message> <location line="-62"/> <source>Connect only to the specified node(s)</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation type="unfinished"/> </message> <message> <location line="+94"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation type="unfinished"/> </message> <message> <location line="-90"/> <source>Find peers using DNS lookup (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Sync checkpoints policy (default: strict)</source> <translation type="unfinished"/> </message> <message> <location line="+83"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Invalid amount for -reservebalance=&lt;amount&gt;</source> <translation type="unfinished"/> </message> <message> <location line="-82"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation type="unfinished"/> </message> <message> <location line="-16"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Prepend debug output with timestamp</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source> <translation type="unfinished"/> </message> <message> <location line="-74"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation type="unfinished"/> </message> <message> <location line="+41"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>ارسال اطلاعات پیگیری/خطایابی به کنسول به جای ارسال به فایل debug.log</translation> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="-29"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation type="unfinished"/> </message> <message> <location line="-42"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation>تعیین مدت زمان وقفه (time out) به هزارم ثانیه</translation> </message> <message> <location line="+109"/> <source>Unable to sign checkpoint, wrong checkpointkey? </source> <translation type="unfinished"/> </message> <message> <location line="-80"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation type="unfinished"/> </message> <message> <location line="-25"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation type="unfinished"/> </message> <message> <location line="+42"/> <source>Username for JSON-RPC connections</source> <translation>شناسه کاربری برای ارتباطاتِ JSON-RPC</translation> </message> <message> <location line="+47"/> <source>Verifying database integrity...</source> <translation type="unfinished"/> </message> <message> <location line="+57"/> <source>WARNING: syncronized checkpoint violation detected, but skipped!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Warning: Disk space is low!</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation type="unfinished"/> </message> <message> <location line="-48"/> <source>wallet.dat corrupt, salvage failed</source> <translation type="unfinished"/> </message> <message> <location line="-54"/> <source>Password for JSON-RPC connections</source> <translation>رمز برای ارتباطاتِ JSON-RPC</translation> </message> <message> <location line="-84"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=YEScoinrpc rpcpassword=%s (you do not need to remember this password) The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; for example: alertnotify=echo %%s | mail -s &quot;YEScoin Alert&quot; admin@foo.com </source> <translation type="unfinished"/> </message> <message> <location line="+51"/> <source>Find peers using internet relay chat (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Sync time with other nodes. Disable if time on your system is precise e.g. syncing with NTP (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>When creating transactions, ignore inputs with value less than this (default: 0.01)</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>ارتباطاتِ JSON-RPC را از آدرس آی.پی. مشخصی برقرار کنید.</translation> </message> <message> <location line="+1"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>دستورات را به گره اجرا شده در&lt;ip&gt; ارسال کنید (پیش فرض:127.0.0.1)</translation> </message> <message> <location line="+1"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>دستور را وقتی بهترین بلاک تغییر کرد اجرا کن (%s در دستور توسط block hash جایگزین شده است)</translation> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Require a confirmations for change (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Enforce transaction scripts to use canonical PUSH operators (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Upgrade wallet to latest format</source> <translation>wallet را به جدیدترین نسخه روزآمد کنید</translation> </message> <message> <location line="+1"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>حجم key pool را به اندازه &lt;n&gt; تنظیم کنید (پیش فرض:100)</translation> </message> <message> <location line="+1"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>زنجیره بلاک را برای تراکنش جا افتاده در WALLET دوباره اسکن کنید</translation> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 2500, 0 = all)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-6, default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Imports blocks from external blk000?.dat file</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>برای ارتباطاتِ JSON-RPC از OpenSSL (https) استفاده کنید</translation> </message> <message> <location line="+1"/> <source>Server certificate file (default: server.cert)</source> <translation>فایل certificate سرور (پیش فرض server.cert)</translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>رمز اختصاصی سرور (پیش فرض: server.pem)</translation> </message> <message> <location line="+1"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation type="unfinished"/> </message> <message> <location line="+53"/> <source>Error: Wallet unlocked for staking only, unable to create transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>WARNING: Invalid checkpoint found! Displayed transactions may not be correct! You may need to upgrade, or notify developers.</source> <translation type="unfinished"/> </message> <message> <location line="-158"/> <source>This help message</source> <translation>این پیام راهنما</translation> </message> <message> <location line="+95"/> <source>Wallet %s resides outside data directory %s.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot obtain a lock on data directory %s. YEScoin is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="-98"/> <source>YEScoin</source> <translation type="unfinished"/> </message> <message> <location line="+140"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation type="unfinished"/> </message> <message> <location line="-130"/> <source>Connect through socks proxy</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation type="unfinished"/> </message> <message> <location line="+122"/> <source>Loading addresses...</source> <translation>لود شدن آدرسها..</translation> </message> <message> <location line="-15"/> <source>Error loading blkindex.dat</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>خطا در هنگام لود شدن wallet.dat: Wallet corrupted</translation> </message> <message> <location line="+4"/> <source>Error loading wallet.dat: Wallet requires newer version of YEScoin</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Wallet needed to be rewritten: restart YEScoin to complete</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error loading wallet.dat</source> <translation>خطا در هنگام لود شدن wallet.dat</translation> </message> <message> <location line="-16"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="-24"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>میزان اشتباه است for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+44"/> <source>Error: could not start node</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Sending...</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Invalid amount</source> <translation>میزان اشتباه است</translation> </message> <message> <location line="+1"/> <source>Insufficient funds</source> <translation>وجوه ناکافی</translation> </message> <message> <location line="-34"/> <source>Loading block index...</source> <translation>لود شدن نمایه بلاکها..</translation> </message> <message> <location line="-103"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>یک گره برای اتصال اضافه کنید و تلاش کنید تا اتصال را باز نگاه دارید</translation> </message> <message> <location line="+122"/> <source>Unable to bind to %s on this computer. YEScoin is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="-97"/> <source>Fee per KB to add to transactions you send</source> <translation type="unfinished"/> </message> <message> <location line="+55"/> <source>Invalid amount for -mininput=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Loading wallet...</source> <translation>wallet در حال لود شدن است...</translation> </message> <message> <location line="+8"/> <source>Cannot downgrade wallet</source> <translation>قابلیت برگشت به نسخه قبلی برای wallet امکان پذیر نیست</translation> </message> <message> <location line="+1"/> <source>Cannot initialize keypool</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot write default address</source> <translation>آدرس پیش فرض قابل ذخیره نیست</translation> </message> <message> <location line="+1"/> <source>Rescanning...</source> <translation>اسکنِ دوباره...</translation> </message> <message> <location line="+5"/> <source>Done loading</source> <translation>اتمام لود شدن</translation> </message> <message> <location line="-167"/> <source>To use the %s option</source> <translation>برای استفاده از %s از اختیارات</translation> </message> <message> <location line="+14"/> <source>Error</source> <translation>خطا</translation> </message> <message> <location line="+6"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation>شما باید یک رمز rpcpassword=&lt;password&gt; را در فایل تنظیمات ایجاد کنید⏎ %s ⏎ اگر فایل ایجاد نشده است، آن را با یک فایل &quot;فقط متنی&quot; ایجاد کنید. </translation> </message> </context> </TS>
{ "content_hash": "8f350e92385436945900a010afa7e2f0", "timestamp": "", "source": "github", "line_count": 3288, "max_line_length": 395, "avg_line_length": 33.795924574209245, "alnum_prop": 0.5917063381359059, "repo_name": "bigman7788/YEScoin", "id": "c362163e04da4c29541f04d4d93ada60c3b8b6c9", "size": "114744", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/qt/locale/bitcoin_fa_IR.ts", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "51312" }, { "name": "C", "bytes": "778236" }, { "name": "C++", "bytes": "2547329" }, { "name": "CSS", "bytes": "1127" }, { "name": "IDL", "bytes": "15553" }, { "name": "Objective-C++", "bytes": "3537" }, { "name": "Python", "bytes": "11646" }, { "name": "Shell", "bytes": "1026" }, { "name": "TypeScript", "bytes": "7746744" } ], "symlink_target": "" }
package apps::php::fpm::web::plugin; use strict; use warnings; use base qw(centreon::plugins::script_simple); sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; $self->{version} = '0.1'; %{$self->{modes}} = ( 'usage' => 'apps::php::fpm::web::mode::usage', ); return $self; } 1; __END__ =head1 PLUGIN DESCRIPTION Check php-fpm module through the webpage. =cut
{ "content_hash": "0e472b45a438b72cd1ee6ed2fcc847de", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 65, "avg_line_length": 16.535714285714285, "alnum_prop": 0.6004319654427646, "repo_name": "Shini31/centreon-plugins", "id": "a1751aed31e470d5e4ebf0302cd34637e62ce5fe", "size": "1223", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "apps/php/fpm/web/plugin.pm", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Perl", "bytes": "7399896" } ], "symlink_target": "" }
class CreateDailyBuildGroupReportResults < ActiveRecord::Migration[6.0] DOWNTIME = false def change create_table :ci_daily_build_group_report_results do |t| t.date :date, null: false t.bigint :project_id, null: false t.bigint :last_pipeline_id, null: false t.text :ref_path, null: false # rubocop:disable Migration/AddLimitToTextColumns t.text :group_name, null: false # rubocop:disable Migration/AddLimitToTextColumns t.jsonb :data, null: false t.index :last_pipeline_id t.index [:project_id, :ref_path, :date, :group_name], name: 'index_daily_build_group_report_results_unique_columns', unique: true t.foreign_key :projects, on_delete: :cascade t.foreign_key :ci_pipelines, column: :last_pipeline_id, on_delete: :cascade end end end
{ "content_hash": "f581cfbe6afa576b57510464743894b5", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 135, "avg_line_length": 42.68421052631579, "alnum_prop": 0.6991368680641183, "repo_name": "mmkassem/gitlabhq", "id": "12d1c7531d560594db88ad934a3e5e9336ef057f", "size": "842", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "db/migrate/20200421111005_create_daily_build_group_report_results.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "113683" }, { "name": "CoffeeScript", "bytes": "139197" }, { "name": "Cucumber", "bytes": "119759" }, { "name": "HTML", "bytes": "447030" }, { "name": "JavaScript", "bytes": "29805" }, { "name": "Ruby", "bytes": "2417833" }, { "name": "Shell", "bytes": "14336" } ], "symlink_target": "" }
import time import basil_common.caching as caching import pytest from tests import * def test_is_available(engine, loader): fact_cache = _cache(engine, loader) cache = fact_cache assert_that(cache.is_available, equal_to(True)) def test_get_miss(engine, loader): cache = caching.FactCache(engine, 'test', loader=loader, preload=True) wait_for(cache) assert_that(cache.get('miss'), none()) def test_get_hit(engine, loader): cache = caching.FactCache(engine, 'test', loader=loader, preload=True) wait_for(cache) assert_that(cache.get('hit'), equal_to(True)) def test_get_list(engine, loader): cache = caching.FactCache(engine, 'test', loader=loader, preload=True) wait_for(cache) assert_that(cache.get('list'), equal_to([1, 2, 3])) def test_get_dict(engine, loader): cache = caching.FactCache(engine, 'test', loader=loader, preload=True) wait_for(cache) assert_that(cache.get('dict'), equal_to({'foo': 'bar'})) def test_without_preload(engine, loader): cache = caching.FactCache(engine, 'test', loader=loader, preload=False) # Check the engine with the compound key, expecting None assert_that(engine.get('testempty'), none()) # On get, the data is loaded in background, key returned immediately assert_that(cache.get('empty'), equal_to(False)) wait_for(cache) assert_that(engine.get('testhit'), not_none()) def test_with_preload(engine, loader): cache = caching.FactCache(engine, 'test', loader=loader, preload=True) wait_for(cache) assert_that(engine.get('testhit'), not_none()) def wait_for(cache): while cache.is_loading: time.sleep(0.01) # 10 ms def _cache(engine, loader, preload=True): return caching.FactCache(engine, 'test', loader=loader, preload=preload) @pytest.fixture(scope="function") def engine(): cache = caching.connect_to_cache() cache.flushdb() return cache @pytest.fixture(scope="module") def loader(): def loads(): return {'hit': True, 'empty': False, 'list': [1, 2, 3], 'dict': {'foo': 'bar'}} return loads
{ "content_hash": "b42b770feec96ba8f817eca02b5d581d", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 76, "avg_line_length": 27.545454545454547, "alnum_prop": 0.6657237152286657, "repo_name": "eve-basil/common", "id": "90f17ed6be9877a5d20851323d84722a7fc0381a", "size": "2121", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/integration/test_caching.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Python", "bytes": "24827" } ], "symlink_target": "" }
import { findAllInstanceNodes } from '../queries/findAllInstanceNodes'; import { findAllNodesWithColor } from '../queries/findAllNodesWithColor'; import { fastFindAll } from '../utils/fastFindAll'; import { getColorsByNode } from '../utils/getColorsByNode'; import { getNameParts } from '../utils/getNameParts'; import { readNodeExportInfo } from '../utils/readNodeExportInfo'; import { writeNodeExportInfo } from '../utils/writeNodeExportInfo'; export async function calculateNodeExportInfo(node: ComponentNode | FrameNode) { const cloneComponent = figma.createComponent(); const cloneComponentRectangle = figma.createRectangle(); cloneComponentRectangle.constraints = { horizontal: 'STRETCH', vertical: 'STRETCH', }; cloneComponent.name = 'Export Helper Component'; cloneComponent.insertChild(0, cloneComponentRectangle); const nodeClone = node.clone(); try { // For the export, clip-path must be set in Figma so that the viewport has the correct height and width. nodeClone.clipsContent = true; for (const instanceNode of findAllInstanceNodes(nodeClone)) { const mainComponent = instanceNode.mainComponent!; const nodeExportInfo = readNodeExportInfo(instanceNode); nodeExportInfo.matrix = { a: instanceNode.relativeTransform[0][0], b: instanceNode.relativeTransform[1][0], c: instanceNode.relativeTransform[0][1], d: instanceNode.relativeTransform[1][1], tx: instanceNode.relativeTransform[0][2], ty: instanceNode.relativeTransform[1][2], }; nodeExportInfo.scale = { x: instanceNode.width / mainComponent.width, y: instanceNode.height / mainComponent.height, }; nodeExportInfo.componentGroup = getNameParts(mainComponent.name).group; const width = instanceNode.width; const height = instanceNode.height; instanceNode.swapComponent(cloneComponent); instanceNode.resize(width, height); writeNodeExportInfo(instanceNode, nodeExportInfo); } // Figma flat boolean nodes when exporting. In doing so, ids and their information will be lost. // That's why we do it ourselves here, so Figma can't delete any information. for (const boNode of fastFindAll(nodeClone.children, (node) => node.type == 'BOOLEAN_OPERATION' && node.visible)) { try { const wasMask = 'isMask' in boNode && boNode.isMask; const newNode = figma.flatten([boNode], boNode.parent!, boNode.parent!.children.indexOf(boNode as SceneNode)); newNode.isMask = wasMask; } catch { // This is fine } } for (const colorNode of findAllNodesWithColor(nodeClone)) { const nodeExportInfo = readNodeExportInfo(colorNode); const nodeColors = getColorsByNode(colorNode); if (nodeColors.has('fill')) { nodeExportInfo.fillColorGroup = getNameParts(nodeColors.get('fill')!.name).group; } if (nodeColors.has('stroke')) { nodeExportInfo.strokeColorGroup = getNameParts(nodeColors.get('stroke')!.name).group; } writeNodeExportInfo(colorNode, nodeExportInfo); } const codes = await nodeClone.exportAsync({ format: 'SVG', contentsOnly: true, svgIdAttribute: true, }); nodeClone.remove(); cloneComponent.remove(); let svg = ''; for (var i = 0; i < codes.byteLength; i++) { svg += String.fromCharCode(codes[i]); } return svg; } catch (e) { nodeClone.remove(); cloneComponent.remove(); if (e && typeof e === 'object' && 'message' in e) { throw new Error(`Error while exporting ${nodeClone.name}: ${(e as any).message}`); } else { throw e; } } }
{ "content_hash": "319dc763c4892ccebd862d781c1a0346", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 119, "avg_line_length": 33.387387387387385, "alnum_prop": 0.6764705882352942, "repo_name": "DiceBear/avatars", "id": "8e493dc989b8f0e464a00ae08974f5279ab7a258", "size": "3706", "binary": false, "copies": "1", "ref": "refs/heads/5.0", "path": "plugins/figma/dicebear-exporter/src/code/export/calculateNodeExportInfo.ts", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "3732" }, { "name": "TypeScript", "bytes": "225669" } ], "symlink_target": "" }
@interface WindowsAzureMobileServicesFunctionalTests : SenTestCase { MSClient *client; BOOL done; BOOL testsEnabled; } @end @implementation WindowsAzureMobileServicesFunctionalTests #pragma mark * Setup and TearDown - (void) setUp { NSLog(@"%@ setUp", self.name); testsEnabled = YES; STAssertTrue(testsEnabled, @"The functional tests are currently disabled."); // These functional tests requires a working Windows Mobile Azure Service // with a table named "todoItem". Simply enter the application URL and // application key for the Windows Mobile Azure Service below and set the // 'testsEnabled' BOOL above to YES. client = [MSClient clientWithApplicationURLString:@"<Windows Azure Mobile Service App URL>" applicationKey:@"<Application Key>"]; done = NO; STAssertNotNil(client, @"Could not create test client."); } - (void) tearDown { NSLog(@"%@ tearDown", self.name); } #pragma mark * End-to-End Positive Insert, Update, Delete and Read Tests -(void) testCreateUpdateAndDeleteTodoItem { MSTable *todoTable = [client tableWithName:@"todoItem"]; // Create the item NSDictionary *item = @{ @"text":@"Write E2E test!", @"complete": @(NO) }; // Insert the item [todoTable insert:item completion:^(NSDictionary *newItem, NSError *error) { // Check for an error if (error) { STAssertTrue(FALSE, @"Insert failed with error: %@", error.localizedDescription); done = YES; } // Verify that the insert succeeded STAssertNotNil(newItem, @"newItem should not be nil."); STAssertNotNil([newItem objectForKey:@"id"], @"newItem should now have an id."); // Update the item NSDictionary *itemToUpdate = @{ @"id" :[newItem objectForKey:@"id"], @"text":@"Write E2E test!", @"complete": @(YES) }; [todoTable update:itemToUpdate completion:^(NSDictionary *updatedItem, NSError *error) { // Check for an error if (error) { STAssertTrue(FALSE, @"Update failed with error: %@", error.localizedDescription); done = YES; } // Verify that the update succeeded STAssertNotNil(updatedItem, @"updatedItem should not be nil."); STAssertTrue([[updatedItem objectForKey:@"complete"] boolValue], @"updatedItem should now be completed."); // Delete the item [todoTable delete:updatedItem completion:^(NSNumber *itemId, NSError *error) { // Check for an error if (error) { STAssertTrue(FALSE, @"Delete failed with error: %@", error.localizedDescription); done = YES; } // Verify that the delete succeeded STAssertTrue([itemId longLongValue] == [[updatedItem objectForKey:@"id"] longLongValue], @"itemId deleted was: %d.", itemId); done = YES; }]; }]; }]; STAssertTrue([self waitForTest:90.0], @"Test timed out."); } -(void) testCreateAndQueryTodoItem { MSTable *todoTable = [client tableWithName:@"todoItem"]; // Create the items NSDictionary *item1 = @{ @"text":@"ItemA", @"complete": @(NO) }; NSDictionary *item2 = @{ @"text":@"ItemB", @"complete": @(YES) }; NSDictionary *item3 = @{ @"text":@"ItemB", @"complete": @(NO) }; NSArray *items = @[item1,item2, item3]; id query7AfterQuery6 = ^(NSArray *items, NSInteger totalCount, NSError *error) { // Check for an error if (error) { STAssertTrue(FALSE, @"Test failed with error: %@", error.localizedDescription); done = YES; } STAssertTrue(items.count == 2, @"items.count was: %d", items.count); STAssertTrue(totalCount == 3, @"totalCount was: %d", totalCount); [todoTable deleteAllItemsWithCompletion:^(NSError *error) { done = YES; }]; }; id query6AfterQuery5 = ^(NSArray *items, NSInteger totalCount, NSError *error) { // Check for an error if (error) { STAssertTrue(FALSE, @"Test failed with error: %@", error.localizedDescription); done = YES; } STAssertTrue(items.count == 2, @"items.count was: %d", items.count); STAssertTrue(totalCount == 3, @"totalCount was: %d", totalCount); MSQuery *query = [todoTable query]; query.fetchOffset = 1; query.includeTotalCount = YES; [query readWithCompletion:query7AfterQuery6]; }; id query5AfterQuery4 = ^(NSArray *items, NSInteger totalCount, NSError *error) { // Check for an error if (error) { STAssertTrue(FALSE, @"Test failed with error: %@", error.localizedDescription); done = YES; } STAssertTrue(items.count == 3, @"items.count was: %d", items.count); STAssertTrue(totalCount == -1, @"totalCount was: %d", totalCount); [todoTable readWithQueryString:@"$top=2&$inlinecount=allpages" completion:query6AfterQuery5]; }; id query4AfterQuery3 = ^(NSDictionary *item, NSError *error) { // Check for an error if (error) { STAssertTrue(FALSE, @"Test failed with error: %@", error.localizedDescription); done = YES; } STAssertNotNil(item, @"item should not have been nil."); [todoTable readWithQueryString:nil completion:query5AfterQuery4]; }; id query3AfterQuery2 = ^(NSArray *items, NSInteger totalCount, NSError *error) { // Check for an error if (error) { STAssertTrue(FALSE, @"Test failed with error: %@", error.localizedDescription); done = YES; } STAssertTrue(items.count == 1, @"items.count was: %d", items.count); STAssertTrue(totalCount == -1, @"totalCount was: %d", totalCount); [todoTable readWithId:[[items objectAtIndex:0] valueForKey:@"id"] completion:query4AfterQuery3]; }; id query2AfterQuery1 = ^(NSArray *items, NSInteger totalCount, NSError *error) { // Check for an error if (error) { STAssertTrue(FALSE, @"Test failed with error: %@", error.localizedDescription); done = YES; } STAssertTrue(items.count == 2, @"items.count was: %d", items.count); STAssertTrue(totalCount == -1, @"totalCount was: %d", totalCount); NSPredicate *predicate = [NSPredicate predicateWithFormat:@"text ENDSWITH 'B' AND complete == TRUE"]; [todoTable readWithPredicate:predicate completion:query3AfterQuery2]; }; id query1AfterInsert = ^(NSError *error) { // Check for an error if (error) { STAssertTrue(FALSE, @"Test failed with error: %@", error.localizedDescription); done = YES; } NSPredicate *predicate = [NSPredicate predicateWithFormat:@"text ENDSWITH 'B'"]; [todoTable readWithPredicate:predicate completion:query2AfterQuery1]; }; id insertAfterDeleteAll = ^(NSError *error){ // Check for an error if (error) { STAssertTrue(FALSE, @"Test failed with error: %@", error.localizedDescription); done = YES; } [todoTable insertItems:items completion:query1AfterInsert]; }; [todoTable deleteAllItemsWithCompletion:insertAfterDeleteAll]; STAssertTrue([self waitForTest:90.0], @"Test timed out."); } #pragma mark * End-to-End Filter Tests -(void) testFilterThatModifiesRequest { // Create a filter that will replace the request with one requesting // a table that doesn't exist. MSTestFilter *testFilter = [[MSTestFilter alloc] init]; NSURL *badURL = [client.applicationURL URLByAppendingPathComponent:@"tables/NoSuchTable"]; NSURLRequest *badRequest = [NSURLRequest requestWithURL:badURL]; testFilter.requestToUse = badRequest; // Create the client and the table MSClient *filterClient = [client clientWithFilter:testFilter]; MSTable *todoTable = [filterClient tableWithName:@"todoItem"]; // Create the item NSDictionary *item = @{ @"text":@"Write E2E test!", @"complete": @(NO) }; // Insert the item [todoTable insert:item completion:^(NSDictionary *item, NSError *error) { STAssertNil(item, @"item should have been nil."); STAssertNotNil(error, @"error should not have been nil."); STAssertTrue(error.domain == MSErrorDomain, @"error domain should have been MSErrorDomain."); STAssertTrue(error.code == MSErrorMessageErrorCode, @"error code should have been MSErrorMessageErrorCode."); NSString *description = [error.userInfo objectForKey:NSLocalizedDescriptionKey]; STAssertTrue([description isEqualToString:@"Error: Table 'NoSuchTable' does not exist."], @"description was: %@", description); done = YES; }]; STAssertTrue([self waitForTest:90.0], @"Test timed out."); } -(void) testFilterThatModifiesResponse { // Create a filter that will replace the response with one that has // a 400 status code and an error message MSTestFilter *testFilter = [[MSTestFilter alloc] init]; NSHTTPURLResponse *response = [[NSHTTPURLResponse alloc] initWithURL:nil statusCode:400 HTTPVersion:nil headerFields:nil]; NSString* stringData = @"This is an Error Message for the testFilterThatModifiesResponse test!"; NSData* data = [stringData dataUsingEncoding:NSUTF8StringEncoding]; testFilter.responseToUse = response; testFilter.dataToUse = data; // Create the client and the table MSClient *filterClient = [client clientWithFilter:testFilter]; MSTable *todoTable = [filterClient tableWithName:@"todoItem"]; // Create the item NSDictionary *item = @{ @"text":@"Write E2E test!", @"complete": @(NO) }; // Insert the item [todoTable insert:item completion:^(NSDictionary *item, NSError *error) { STAssertNil(item, @"item should have been nil."); STAssertNotNil(error, @"error was nil after deserializing item."); STAssertTrue([error domain] == MSErrorDomain, @"error domain was: %@", [error domain]); STAssertTrue([error code] == MSErrorMessageErrorCode, @"error code was: %d",[error code]); STAssertTrue([[error localizedDescription] isEqualToString: @"This is an Error Message for the testFilterThatModifiesResponse test!"], @"error description was: %@", [error localizedDescription]); done = YES; }]; STAssertTrue([self waitForTest:90.0], @"Test timed out."); } -(void) testFilterThatReturnsError { // Create a filter that will replace the error MSTestFilter *testFilter = [[MSTestFilter alloc] init]; NSError *error = [NSError errorWithDomain:@"SomeDomain" code:-102 userInfo:nil]; testFilter.errorToUse = error; // Create the client and the table MSClient *filterClient = [client clientWithFilter:testFilter]; MSTable *todoTable = [filterClient tableWithName:@"todoItem"]; // Create the item NSDictionary *item = @{ @"text":@"Write E2E test!", @"complete": @(NO) }; // Insert the item [todoTable insert:item completion:^(NSDictionary *item, NSError *error) { STAssertNil(item, @"item should have been nil."); STAssertNotNil(error, @"error was nil after deserializing item."); STAssertTrue([error.domain isEqualToString:@"SomeDomain"], @"error domain was: %@", [error domain]); STAssertTrue([error code] == -102, @"error code was: %d",[error code]); done = YES; }]; STAssertTrue([self waitForTest:90.0], @"Test timed out."); } #pragma mark * End-to-End URL Encoding Tests -(void) testFilterConstantsAreURLEncoded { MSTable *todoTable = [client tableWithName:@"todoItem"]; NSString *predicateString = @"text == '#?&$ encode me!'"; NSPredicate *predicate = [NSPredicate predicateWithFormat:predicateString]; // Create the item NSDictionary *item = @{ @"text":@"#?&$ encode me!", @"complete": @(NO) }; // Insert the item [todoTable insert:item completion:^(NSDictionary *item, NSError *error) { STAssertNotNil(item, @"item should not have been nil."); STAssertNil(error, @"error from insert should have been nil."); // Now try to query the item and make sure we don't error [todoTable readWithPredicate:predicate completion:^(NSArray *items, NSInteger totalCount, NSError *error) { STAssertNotNil(items, @"items should not have been nil."); STAssertTrue([items count] > 0, @"items should have matched something."); STAssertNil(error, @"error from query should have been nil."); // Now delete the inserted item so as not to corrupt future tests NSNumber *itemIdToDelete = [item objectForKey:@"id"]; [todoTable deleteWithId:itemIdToDelete completion:^(NSNumber *itemId, NSError *error) { STAssertNil(error, @"error from delete should have been nil."); done = YES; }]; }]; }]; STAssertTrue([self waitForTest:90.0], @"Test timed out."); } -(void) testUserParametersAreURLEncodedWithQuery { MSTable *todoTable = [client tableWithName:@"todoItem"]; MSQuery *query = [todoTable query]; query.parameters = @{@"encodeMe$?": @"No really $#%& encode me!"}; [query readWithCompletion:^(NSArray *items, NSInteger totalCount, NSError *error) { STAssertNotNil(items, @"items should not have been nil."); STAssertNil(error, @"error from query was: %@", [error.userInfo objectForKey:NSLocalizedDescriptionKey]); done = YES; }]; STAssertTrue([self waitForTest:90.0], @"Test timed out."); } -(void) testUserParametersAreURLEncodedWithInsertUpdateAndDelete { MSTable *todoTable = [client tableWithName:@"todoItem"]; // Create the item NSDictionary *item = @{ @"text":@"some text", @"complete": @(NO) }; NSDictionary *parameters = @{@"encodeMe$?": @"No really $#%& encode me!"}; // Insert the item [todoTable insert:item parameters:parameters completion:^(NSDictionary *item, NSError *error) { STAssertNotNil(item, @"item should not have been nil."); STAssertNil(error, @"error from insert should have been nil."); // Now update the inserted item [todoTable update:item parameters:parameters completion:^(NSDictionary *updatedItem, NSError *error) { STAssertNotNil(updatedItem, @"updatedItem should not have been nil."); STAssertNil(error, @"error from update should have been nil."); // Now delete the inserted item so as not to corrupt future tests NSNumber *itemIdToDelete = [updatedItem objectForKey:@"id"]; [todoTable deleteWithId:itemIdToDelete parameters:parameters completion:^(NSNumber *itemId, NSError *error) { STAssertNil(error, @"error from delete should have been nil."); done = YES; }]; }]; }]; STAssertTrue([self waitForTest:90.0], @"Test timed out."); } #pragma mark * Negative Insert Tests -(void) testInsertItemForNonExistentTable { MSTable *todoTable = [client tableWithName:@"NoSuchTable"]; // Create the item NSDictionary *item = @{ @"text":@"Write E2E test!", @"complete": @(NO) }; // Insert the item [todoTable insert:item completion:^(NSDictionary *item, NSError *error) { STAssertNil(item, @"item should have been nil."); STAssertNotNil(error, @"error should not have been nil."); STAssertTrue(error.domain == MSErrorDomain, @"error domain should have been MSErrorDomain."); STAssertTrue(error.code == MSErrorMessageErrorCode, @"error code should have been MSErrorMessageErrorCode."); NSString *description = [error.userInfo objectForKey:NSLocalizedDescriptionKey]; STAssertTrue([description isEqualToString:@"Error: Table 'NoSuchTable' does not exist."], @"description was: %@", description); done = YES; }]; STAssertTrue([self waitForTest:90.0], @"Test timed out."); } #pragma mark * Negative Update Tests -(void) testUpdateItemForNonExistentTable { MSTable *todoTable = [client tableWithName:@"NoSuchTable"]; // Update the item NSDictionary *item = @{ @"text":@"Write E2E test!", @"complete": @(NO), @"id":@100 }; // Insert the item [todoTable update:item completion:^(NSDictionary *item, NSError *error) { STAssertNil(item, @"item should have been nil."); STAssertNotNil(error, @"error should not have been nil."); STAssertTrue(error.domain == MSErrorDomain, @"error domain should have been MSErrorDomain."); STAssertTrue(error.code == MSErrorMessageErrorCode, @"error code should have been MSErrorMessageErrorCode."); NSString *description = [error.userInfo objectForKey:NSLocalizedDescriptionKey]; STAssertTrue([description isEqualToString:@"Error: Table 'NoSuchTable' does not exist."], @"description was: %@", description); done = YES; }]; STAssertTrue([self waitForTest:90.0], @"Test timed out."); } -(void) testUpdateItemForNonExistentItemId { MSTable *todoTable = [client tableWithName:@"todoItem"]; // Create the item NSDictionary *item = @{ @"text":@"Write update E2E test!", @"complete": @(NO), @"id":@-5 }; // Update the item [todoTable update:item completion:^(NSDictionary *item, NSError *error) { STAssertNil(item, @"item should have been nil."); STAssertNotNil(error, @"error should not have been nil."); STAssertTrue(error.domain == MSErrorDomain, @"error domain should have been MSErrorDomain."); STAssertTrue(error.code == MSErrorMessageErrorCode, @"error code should have been MSErrorMessageErrorCode."); NSString *description = [error.userInfo objectForKey:NSLocalizedDescriptionKey]; STAssertTrue([description isEqualToString:@"Error: An item with id '-5' does not exist."], @"description was: %@", description); done = YES; }]; STAssertTrue([self waitForTest:90.0], @"Test timed out."); } #pragma mark * Negative Delete Tests -(void) testDeleteItemForNonExistentTable { MSTable *todoTable = [client tableWithName:@"NoSuchTable"]; // Create the item NSDictionary *item = @{ @"text":@"Write E2E test!", @"complete": @(NO), @"id":@100 }; // Delete the item [todoTable delete:item completion:^(NSNumber *itemId, NSError *error) { STAssertNil(itemId, @"itemId should have been nil."); STAssertNotNil(error, @"error should not have been nil."); STAssertTrue(error.domain == MSErrorDomain, @"error domain should have been MSErrorDomain."); STAssertTrue(error.code == MSErrorMessageErrorCode, @"error code should have been MSErrorMessageErrorCode."); NSString *description = [error.userInfo objectForKey:NSLocalizedDescriptionKey]; STAssertTrue([description isEqualToString:@"Error: Table 'NoSuchTable' does not exist."], @"description was: %@", description); done = YES; }]; STAssertTrue([self waitForTest:90.0], @"Test timed out."); } -(void) testDeleteItemForNonExistentItemId { MSTable *todoTable = [client tableWithName:@"todoItem"]; // Create the item NSDictionary *item = @{ @"text":@"Write update E2E test!", @"complete": @(NO), @"id":@-5 }; // Delete the item [todoTable delete:item completion:^(NSNumber *itemId, NSError *error) { STAssertNil(itemId, @"itemId should have been nil."); STAssertNotNil(error, @"error should not have been nil."); STAssertTrue(error.domain == MSErrorDomain, @"error domain should have been MSErrorDomain."); STAssertTrue(error.code == MSErrorMessageErrorCode, @"error code should have been MSErrorMessageErrorCode."); NSString *description = [error.userInfo objectForKey:NSLocalizedDescriptionKey]; STAssertTrue([description isEqualToString:@"Error: An item with id '-5' does not exist."], @"description was: %@", description); done = YES; }]; STAssertTrue([self waitForTest:90.0], @"Test timed out."); } -(void) testDeleteItemWithIdForNonExistentItemId { MSTable *todoTable = [client tableWithName:@"todoItem"]; // Delete the item [todoTable deleteWithId:@-5 completion:^(NSNumber *itemId, NSError *error) { STAssertNil(itemId, @"itemId should have been nil."); STAssertNotNil(error, @"error should not have been nil."); STAssertTrue(error.domain == MSErrorDomain, @"error domain should have been MSErrorDomain."); STAssertTrue(error.code == MSErrorMessageErrorCode, @"error code should have been MSErrorMessageErrorCode."); NSString *description = [error.userInfo objectForKey:NSLocalizedDescriptionKey]; STAssertTrue([description isEqualToString:@"Error: An item with id '-5' does not exist."], @"description was: %@", description); done = YES; }]; STAssertTrue([self waitForTest:90.0], @"Test timed out."); } #pragma mark * Negative ReadWithId Tests -(void) testReadWithIdForNonExistentTable { MSTable *todoTable = [client tableWithName:@"NoSuchTable"]; // Insert the item [todoTable readWithId:@100 completion:^(NSDictionary *item, NSError *error) { STAssertNil(item, @"item should have been nil."); STAssertNotNil(error, @"error should not have been nil."); STAssertTrue(error.domain == MSErrorDomain, @"error domain should have been MSErrorDomain."); STAssertTrue(error.code == MSErrorMessageErrorCode, @"error code should have been MSErrorMessageErrorCode."); NSString *description = [error.userInfo objectForKey:NSLocalizedDescriptionKey]; STAssertTrue([description isEqualToString:@"Error: Table 'NoSuchTable' does not exist."], @"description was: %@", description); done = YES; }]; STAssertTrue([self waitForTest:90.0], @"Test timed out."); } -(void) testReadWithIdForNonExistentItemId { MSTable *todoTable = [client tableWithName:@"todoItem"]; // Insert the item [todoTable readWithId:@-5 completion:^(NSDictionary *item, NSError *error) { STAssertNil(item, @"item should have been nil."); STAssertNotNil(error, @"error should not have been nil."); STAssertTrue(error.domain == MSErrorDomain, @"error domain should have been MSErrorDomain."); STAssertTrue(error.code == MSErrorMessageErrorCode, @"error code should have been MSErrorMessageErrorCode."); NSString *description = [error.userInfo objectForKey:NSLocalizedDescriptionKey]; STAssertTrue([description isEqualToString:@"Error: An item with id '-5' does not exist."], @"description was: %@", description); done = YES; }]; STAssertTrue([self waitForTest:90.0], @"Test timed out."); } #pragma mark * Async Test Helper Method -(BOOL) waitForTest:(NSTimeInterval)testDuration { NSDate *timeoutAt = [NSDate dateWithTimeIntervalSinceNow:testDuration]; while (!done) { [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:timeoutAt]; if([timeoutAt timeIntervalSinceNow] <= 0.0) { break; } }; return done; } @end
{ "content_hash": "b58b2547bf38845856b20ff498a0359c", "timestamp": "", "source": "github", "line_count": 716, "max_line_length": 109, "avg_line_length": 35.952513966480446, "alnum_prop": 0.5928055318157097, "repo_name": "manimaranm7/azure-mobile-services", "id": "d963693038dd3d259708eea08009f3f1ed80078e", "size": "26110", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "sdk/iOS/test/WindowsAzureMobileServicesFunctionalTests.m", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
namespace StockSharp.Hydra.IQFeed { using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Linq; using System.Windows; using Ecng.Collections; using Ecng.Xaml; using StockSharp.BusinessEntities; using Xceed.Wpf.Toolkit.PropertyGrid.Editors; using CheckComboBox = Xceed.Wpf.Toolkit.CheckComboBox; /// <summary> /// Визуальный редактор для выбора набора типов инструментов. /// </summary> public class SecurityTypesComboBoxEditor : TypeEditor<SecurityTypesComboBox> { /// <summary> /// /// </summary> protected override void SetValueDependencyProperty() { ValueProperty = SecurityTypesComboBox.SelectedTypesProperty; } } /// <summary> /// Выпадающий список для выбора набора таблиц. /// </summary> public class SecurityTypesComboBox : CheckComboBox { static SecurityTypesComboBox() { DefaultStyleKeyProperty.OverrideMetadata(typeof(SecurityTypesComboBox), new FrameworkPropertyMetadata(typeof(SecurityTypesComboBox))); } private readonly UniqueObservableCollection<SecurityTypes> _types = new UniqueObservableCollection<SecurityTypes>(); /// <summary> /// Набор доступных таблиц. /// </summary> public ICollection<SecurityTypes> Types { get { return _types; } } /// <summary> /// Список идентификаторов выбранных таблиц. /// </summary> public static readonly DependencyProperty SelectedTypesProperty = DependencyProperty.Register("SelectedTypes", typeof(UniqueObservableCollection<SecurityTypes>), typeof(SecurityTypesComboBox), new UIPropertyMetadata(SelectedTablesChanged)); private static void SelectedTablesChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { var ctrl = d as SecurityTypesComboBox; if (ctrl == null) return; var oldList = (UniqueObservableCollection<SecurityTypes>)e.OldValue; if (oldList != null) oldList.CollectionChanged -= ctrl.CollectionChanged; var list = (UniqueObservableCollection<SecurityTypes>)e.NewValue; list.CollectionChanged += ctrl.CollectionChanged; ctrl.SelectedItemsOverride = list; ctrl.UpdateText(); } private void CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { UpdateText(); } /// <summary> /// Список выбранных таблиц. /// </summary> public UniqueObservableCollection<SecurityTypes> SelectedTypes { get { return (UniqueObservableCollection<SecurityTypes>)GetValue(SelectedTypesProperty); } set { SetValue(SelectedTypesProperty, value); } } /// <summary> /// Создать <see cref="SecurityTypesComboBox"/>. /// </summary> public SecurityTypesComboBox() { Types.AddRange(Enum.GetValues(typeof(SecurityTypes)).Cast<SecurityTypes>()); ItemsSource = Types; SelectedTypes = new UniqueObservableCollection<SecurityTypes> { SecurityTypes.Stock }; } /// <summary> /// Метод, который вызывается при изменении выбранного значения. /// </summary> /// <param name="oldValue">Старое значение.</param> /// <param name="newValue">Новое значение.</param> protected override void OnSelectedValueChanged(string oldValue, string newValue) { base.OnSelectedValueChanged(oldValue, newValue); UpdateText(); } private void UpdateText() { Text = "Выбрано: " + (SelectedTypes != null ? SelectedTypes.Count : 0); } } }
{ "content_hash": "99e77637c5b55cb19a9de8ac6414c858", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 163, "avg_line_length": 28.905172413793103, "alnum_prop": 0.7342678198628094, "repo_name": "Shadance/StockSharp", "id": "cb8e7011d244ed06a27b4c9f832169c139e9409a", "size": "3612", "binary": false, "copies": "10", "ref": "refs/heads/master", "path": "Connectors/IQFeed/SecurityTypesComboBoxEditor.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "314" }, { "name": "C#", "bytes": "9031806" }, { "name": "Lua", "bytes": "2300" } ], "symlink_target": "" }
[![Build Status](https://travis-ci.org/nikkos/retim.svg?branch=master)](https://travis-ci.org/nikkos/retim) Estimate the reading time of a text or a text file ## Installation You can donwload retim or you can install it as package, to use it in your projects. You can found it at [Hex](https://hex.pm/packages/retim). Also you can add `retim` to your list of dependencies in `mix.exs`: ```elixir def deps do [{:retim, "~> 0.2.3"}] end ``` ## Supported languages: - English: "en" - Greek: "gr" - Italian: "it" - Spanish: "es" - Norwegian: "no" - German: "ge" - Russian: "ru" - Portuguese: "pt" ## How to use it Estimate the reading time of a setence: ```elixir iex> Retim.count("Hello World") "1 minute" ``` You can change the default language: ```elixir iex> Retim.count("Hello World", "it") "1 minuto" ``` The average reading time per minute is 180 words. If you want to change it you can pass a second argument: ```elixir iex> Retim.count("Hello World", "en", 120) "1 minute" ``` If you want to change only the reading time, you need to choose the language or leave the second argument blank: ```elixir iex> Retim.count("Hello World", "", 150) ``` Read words from a file: ```elixir iex> Retim.count_file("hello.md") "4 minutes" ``` Read a file and change the average reading time to 120 words / per minute: ```elixir iex> Retim.count_file("hello.md", "en", 120) "7 minutes" ``` ## Use Retim in Phoenix Add retim on your dependencies: ```elixir defp deps do [{:phoenix, "~> 1.2.1"}, ........ ........ {:cowboy, "~> 1.0"}, {:retim, "~> 0.2.3"}] end ``` Run deps.get on your terminal: ```elixir mix deps.get ``` ### Example Generate a post: ```elixir mix phoenix.gen.html Post posts title:string body:text ``` To count the reading time of the body text, add count(@post.body) on your templates(post/show.html.eex): ```elixir <%= Retim.count(@post.body) %> ``` ### Result ![alt tag](https://github.com/nikkos/retim/blob/master/example1.png) To change the language add: ```elixir <%= Retim.count(@post.body, "es") %> ``` ### Result (with spanish) ![alt tag](https://github.com/nikkos/retim/blob/master/example2.png) ### To-do - [x] Add other languages - [ ] Add new print format (Example: 3 minutes and 10 seconds)
{ "content_hash": "d1b95dd4dd59e5a298ecc44a89695d51", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 112, "avg_line_length": 23.02970297029703, "alnum_prop": 0.6453138435081686, "repo_name": "nikkos/retim", "id": "74447e573796d82307ac3e97c52ad4845225f633", "size": "2335", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "Elixir", "bytes": "5922" } ], "symlink_target": "" }
package ui import ( _ "github.com/mattn/go-gtk/gdkpixbuf" "github.com/mattn/go-gtk/gtk" ) type PaysimUiConsole struct { txtBuf *gtk.TextBuffer txtView *gtk.TextView } var init_ bool = false var PaysimConsole *PaysimUiConsole func Init() { if !init_ { PaysimConsole = newConsole() init_ = true } } func newConsole() *PaysimUiConsole { self := new(PaysimUiConsole) self.txtBuf = gtk.NewTextBuffer(gtk.NewTextTagTable()) self.txtView = gtk.NewTextViewWithBuffer(*self.txtBuf) self.txtView.SetEditable(false) self.txtView.ModifyFontEasy("consolas 8") return self } func (pc *PaysimUiConsole) TextView() *gtk.TextView { return pc.txtView } func (pc *PaysimUiConsole) Log(log string) { var endIter gtk.TextIter pc.txtBuf.GetEndIter(&endIter) pc.txtBuf.Insert(&endIter, log) }
{ "content_hash": "bf1b1e2fdc8c95ad82de35fd0a27cedf", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 55, "avg_line_length": 19.48780487804878, "alnum_prop": 0.7359198998748435, "repo_name": "rkbalgi/go", "id": "6859c2fd6e16fb33ddfb7a8da1a8f26cbd318c62", "size": "799", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "paysim/ui/paysim_ui_log_console.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Go", "bytes": "189718" } ], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in Anales Jard. Bot. Madrid 45:364. 1988 #### Original name Dianthus attenuatus V.Pavlov ### Remarks null
{ "content_hash": "4588577be05f0f51f95312bfe7707142", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 37, "avg_line_length": 14.076923076923077, "alnum_prop": 0.73224043715847, "repo_name": "mdoering/backbone", "id": "e82e1e565ac217f5555fe4e89695632756791b0b", "size": "291", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Caryophyllales/Caryophyllaceae/Dianthus/Dianthus pyrenaicus/Dianthus pyrenaicus attenuatus/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package com.refinedmods.refinedstorage.block; import com.refinedmods.refinedstorage.RSBlocks; import com.refinedmods.refinedstorage.api.network.security.Permission; import com.refinedmods.refinedstorage.container.CrafterContainerMenu; import com.refinedmods.refinedstorage.container.factory.BlockEntityMenuProvider; import com.refinedmods.refinedstorage.blockentity.CrafterBlockEntity; import com.refinedmods.refinedstorage.util.BlockUtils; import com.refinedmods.refinedstorage.util.NetworkUtils; import net.minecraft.core.BlockPos; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.BlockHitResult; import net.minecraftforge.network.NetworkHooks; import javax.annotation.Nullable; public class CrafterBlock extends ColoredNetworkBlock { public CrafterBlock() { super(BlockUtils.DEFAULT_ROCK_PROPERTIES); } @Override public BlockDirection getDirection() { return BlockDirection.ANY_FACE_PLAYER; } @Override public void setPlacedBy(Level level, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack stack) { super.setPlacedBy(level, pos, state, placer, stack); if (!level.isClientSide) { BlockEntity blockEntity = level.getBlockEntity(pos); if (blockEntity instanceof CrafterBlockEntity && stack.hasCustomHoverName()) { ((CrafterBlockEntity) blockEntity).getNode().setDisplayName(stack.getHoverName()); ((CrafterBlockEntity) blockEntity).getNode().markDirty(); } } } @Override @SuppressWarnings("deprecation") public InteractionResult use(BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) { InteractionResult result = RSBlocks.CRAFTER.changeBlockColor(state, player.getItemInHand(hand), level, pos, player); if (result != InteractionResult.PASS) { return result; } if (!level.isClientSide) { return NetworkUtils.attempt(level, pos, player, () -> NetworkHooks.openGui( (ServerPlayer) player, new BlockEntityMenuProvider<CrafterBlockEntity>( ((CrafterBlockEntity) level.getBlockEntity(pos)).getNode().getName(), (blockEntity, windowId, inventory, p) -> new CrafterContainerMenu(blockEntity, player, windowId), pos ), pos ), Permission.MODIFY, Permission.AUTOCRAFTING); } return InteractionResult.SUCCESS; } @Override public boolean hasConnectedState() { return true; } @Override public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { return new CrafterBlockEntity(pos, state); } }
{ "content_hash": "0c6098b5b00a8400909410ba90d08e45", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 136, "avg_line_length": 39.4320987654321, "alnum_prop": 0.7154038822792737, "repo_name": "raoulvdberge/refinedstorage", "id": "618b873630009f4506206f16dc9222407567f020", "size": "3194", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "src/main/java/com/refinedmods/refinedstorage/block/CrafterBlock.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "1665948" }, { "name": "Shell", "bytes": "456" } ], "symlink_target": "" }
<?php /** * The "products" collection of methods. * Typical usage is: * <code> * $adexchangebuyer2Service = new Google_Service_AdExchangeBuyerII(...); * $products = $adexchangebuyer2Service->products; * </code> */ class Google_Service_AdExchangeBuyerII_Resource_AccountsProducts extends Google_Service_Resource { /** * Gets the requested product by ID. (products.get) * * @param string $accountId Account ID of the buyer. * @param string $productId The ID for the product to get the head revision for. * @param array $optParams Optional parameters. * @return Google_Service_AdExchangeBuyerII_Product */ public function get($accountId, $productId, $optParams = array()) { $params = array('accountId' => $accountId, 'productId' => $productId); $params = array_merge($params, $optParams); return $this->call('get', array($params), "Google_Service_AdExchangeBuyerII_Product"); } /** * List all products visible to the buyer (optionally filtered by the specified * PQL query). (products.listAccountsProducts) * * @param string $accountId Account ID of the buyer. * @param array $optParams Optional parameters. * * @opt_param string filter An optional PQL query used to query for products. * See https://developers.google.com/ad-manager/docs/pqlreference for * documentation about PQL and examples. Nested repeated fields, such as * product.targetingCriterion.inclusions, cannot be filtered. * @opt_param int pageSize Requested page size. The server may return fewer * results than requested. If unspecified, the server will pick an appropriate * default. * @opt_param string pageToken The page token as returned from * ListProductsResponse. * @return Google_Service_AdExchangeBuyerII_ListProductsResponse */ public function listAccountsProducts($accountId, $optParams = array()) { $params = array('accountId' => $accountId); $params = array_merge($params, $optParams); return $this->call('list', array($params), "Google_Service_AdExchangeBuyerII_ListProductsResponse"); } }
{ "content_hash": "1c666f17f35891b560c7795b83112b3d", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 104, "avg_line_length": 40.30769230769231, "alnum_prop": 0.7142175572519084, "repo_name": "bshaffer/google-api-php-client-services", "id": "bace60be6faca3221491fdead5d22f4d7a0e19da", "size": "2686", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/Google/Service/AdExchangeBuyerII/Resource/AccountsProducts.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "PHP", "bytes": "9540154" } ], "symlink_target": "" }
//===--- GenClass.cpp - Swift IR Generation For 'class' Types -------------===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // //===----------------------------------------------------------------------===// // // This file implements IR generation for class types. // //===----------------------------------------------------------------------===// #include "GenClass.h" #include "swift/ABI/Class.h" #include "swift/ABI/MetadataValues.h" #include "swift/AST/ASTContext.h" #include "swift/AST/AttrKind.h" #include "swift/AST/Decl.h" #include "swift/AST/IRGenOptions.h" #include "swift/AST/Module.h" #include "swift/AST/Pattern.h" #include "swift/AST/PrettyStackTrace.h" #include "swift/AST/TypeMemberVisitor.h" #include "swift/AST/Types.h" #include "swift/ClangImporter/ClangModule.h" #include "swift/IRGen/Linking.h" #include "swift/SIL/SILModule.h" #include "swift/SIL/SILType.h" #include "swift/SIL/SILVTableVisitor.h" #include "llvm/ADT/SmallString.h" #include "llvm/IR/CallSite.h" #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/Function.h" #include "llvm/IR/GlobalVariable.h" #include "llvm/Support/raw_ostream.h" #include "Callee.h" #include "ClassLayout.h" #include "ConstantBuilder.h" #include "Explosion.h" #include "GenFunc.h" #include "GenMeta.h" #include "GenObjC.h" #include "GenProto.h" #include "GenType.h" #include "IRGenDebugInfo.h" #include "IRGenFunction.h" #include "IRGenModule.h" #include "GenHeap.h" #include "HeapTypeInfo.h" #include "MemberAccessStrategy.h" #include "MetadataLayout.h" #include "MetadataRequest.h" using namespace swift; using namespace irgen; namespace { /// Layout information for class types. class ClassTypeInfo : public HeapTypeInfo<ClassTypeInfo> { ClassDecl *TheClass; // The resilient layout of the class, without making any assumptions // that violate resilience boundaries. This is used to allocate // and deallocate instances of the class, and to access fields. mutable Optional<ClassLayout> ResilientLayout; // A completely fragile layout, used for metadata emission. mutable Optional<ClassLayout> FragileLayout; /// Can we use swift reference-counting, or do we have to use /// objc_retain/release? const ReferenceCounting Refcount; ClassLayout generateLayout(IRGenModule &IGM, SILType classType, bool forBackwardDeployment) const; public: ClassTypeInfo(llvm::PointerType *irType, Size size, SpareBitVector spareBits, Alignment align, ClassDecl *theClass, ReferenceCounting refcount) : HeapTypeInfo(irType, size, std::move(spareBits), align), TheClass(theClass), Refcount(refcount) {} ReferenceCounting getReferenceCounting() const { return Refcount; } ClassDecl *getClass() const { return TheClass; } const ClassLayout &getClassLayout(IRGenModule &IGM, SILType type, bool forBackwardDeployment) const; StructLayout *createLayoutWithTailElems(IRGenModule &IGM, SILType classType, ArrayRef<SILType> tailTypes) const; }; } // end anonymous namespace /// Return the lowered type for the class's 'self' type within its context. static SILType getSelfType(ClassDecl *base) { auto loweredTy = base->getDeclaredTypeInContext()->getCanonicalType(); return SILType::getPrimitiveObjectType(loweredTy); } /// If the superclass came from another module, we may have dropped /// stored properties due to the Swift language version availability of /// their types. In these cases we can't precisely lay out the ivars in /// the class object at compile time so we need to do runtime layout. static bool classHasIncompleteLayout(IRGenModule &IGM, ClassDecl *theClass) { if (theClass->getParentModule() == IGM.getSwiftModule()) return false; for (auto field : theClass->getStoredPropertiesAndMissingMemberPlaceholders()) if (isa<MissingMemberDecl>(field)) return true; return false; } namespace { class ClassLayoutBuilder : public StructLayoutBuilder { SmallVector<ElementLayout, 8> Elements; SmallVector<VarDecl*, 8> AllStoredProperties; SmallVector<FieldAccess, 8> AllFieldAccesses; // If we're building a layout with tail-allocated elements, we do // things slightly differently; all fields from the superclass are // added before the class fields, and the tail elements themselves // come after. We don't make a ClassLayout in this case, only a // StructLayout. Optional<ArrayRef<SILType>> TailTypes; // Normally, Swift only emits static metadata for a class if it has no // generic ancestry and no fields with resilient value types, which // require dynamic layout. // // However, for interop with Objective-C, where the runtime does not // know how to invoke arbitrary code to initialize class metadata, we // ignore resilience and emit a static layout and metadata for classes // that would otherwise have static metadata, were it not for any // resilient fields. // // This enables two things: // // - Objective-C can reference the class symbol by calling a static // method on it, for example +alloc, which requires the InstanceSize // to be known, except for possibly sliding ivars. // // - Objective-C message sends can call methods defined in categories // emitted by Swift, which again require the class metadata symbol // to have a static address. // // Note that we don't do this if the class is generic, has generic // ancestry, or has a superclass that is itself resilient. bool CompletelyFragileLayout; // The below flags indicate various things about the metadata of the // class that might require dynamic initialization or resilient // access patterns: // Does the class or any of its superclasses have stored properties that // where dropped due to the Swift language version availability of // their types? bool ClassHasMissingMembers = false; // Does the class or any of its fragile superclasses have stored // properties of unknown size, which do *not* depend on generic // parameters? // // This is different from the class itself being resilient or // having resilient ancestry, because we still have a fixed layout // for the class metadata in this case. // // In fact, for a class with resilient ancestry, this can still be // false if all of the fields known to us are fixed size. bool ClassHasResilientMembers = false; // Is this class or any of its superclasses generic? bool ClassHasGenericAncestry = false; // Is this class itself generic via the Swift generic system, ie. not a // lightweight Objective-C generic class? bool ClassIsGeneric = false; // Does the class layout depend on the size or alignment of its // generic parameters? // // This can be the case if the class has generic resilient ancestry // that depends on the class's generic parameters, of it it has // fields of generic type that are not fixed size. bool ClassHasGenericLayout = false; // Is this class or any of its superclasses resilient from the viewpoint // of the current module? This means that their metadata can change size // and field offsets, generic arguments and virtual methods must be // accessed relative to a metadata base global variable. bool ClassHasResilientAncestry = false; // Are any of this class's superclasses defined in Objective-C? // This means that field offsets must be loaded from field offset globals // or the field offset vector in the metadata, and the Objective-C runtime // will slide offsets based on the actual superclass size, which is not // known at compile time. bool ClassHasObjCAncestry = false; public: ClassLayoutBuilder(IRGenModule &IGM, SILType classType, ReferenceCounting refcounting, bool completelyFragileLayout, Optional<ArrayRef<SILType>> tailTypes = None) : StructLayoutBuilder(IGM), TailTypes(tailTypes), CompletelyFragileLayout(completelyFragileLayout) { // Start by adding a heap header. switch (refcounting) { case ReferenceCounting::Native: // For native classes, place a full object header. addHeapHeader(); break; case ReferenceCounting::ObjC: // For ObjC-inheriting classes, we don't reliably know the size of the // base class, but NSObject only has an `isa` pointer at most. addNSObjectHeader(); break; case ReferenceCounting::Block: case ReferenceCounting::Unknown: case ReferenceCounting::Bridge: case ReferenceCounting::Error: llvm_unreachable("not a class refcounting kind"); } // Next, add the fields for the given class. auto theClass = classType.getClassOrBoundGenericClass(); assert(theClass); if (theClass->isGenericContext() && !theClass->hasClangNode()) ClassIsGeneric = true; addFieldsForClass(theClass, classType, /*superclass=*/false); if (TailTypes) { // Add the tail elements. for (SILType TailTy : *TailTypes) { const TypeInfo &tailTI = IGM.getTypeInfo(TailTy); addTailElement(ElementLayout::getIncomplete(tailTI)); } } } /// Return the element layouts. ArrayRef<ElementLayout> getElements() const { return Elements; } /// Does the class metadata have a completely known, static layout that /// does not require initialization at runtime beyond registeration of /// the class with the Objective-C runtime? bool isFixedSize() const { return !(ClassHasMissingMembers || ClassHasResilientMembers || ClassHasGenericLayout || ClassHasResilientAncestry || ClassHasObjCAncestry); } bool doesMetadataRequireInitialization() const { return (ClassHasMissingMembers || ClassHasResilientMembers || ClassHasResilientAncestry || ClassHasGenericAncestry); } bool doesMetadataRequireRelocation() const { return (ClassHasResilientAncestry || ClassIsGeneric); } ClassLayout getClassLayout(llvm::Type *classTy) const { assert(!TailTypes); auto allStoredProps = IGM.Context.AllocateCopy(AllStoredProperties); auto allFieldAccesses = IGM.Context.AllocateCopy(AllFieldAccesses); auto allElements = IGM.Context.AllocateCopy(Elements); return ClassLayout(*this, isFixedSize(), doesMetadataRequireInitialization(), doesMetadataRequireRelocation(), classTy, allStoredProps, allFieldAccesses, allElements); } private: /// Adds a layout of a tail-allocated element. void addTailElement(const ElementLayout &Elt) { Elements.push_back(Elt); if (!addField(Elements.back(), LayoutStrategy::Universal)) { // For empty tail allocated elements we still add 1 padding byte. assert(cast<FixedTypeInfo>(Elt.getType()).getFixedStride() == Size(1) && "empty elements should have stride 1"); StructFields.push_back(llvm::ArrayType::get(IGM.Int8Ty, 1)); CurSize += Size(1); } } /// If 'superclass' is true, we're adding fields for one of our /// superclasses, which means they become part of the struct /// layout calculation, but are not actually added to any of /// the vectors like AllStoredProperties, etc. Also, we don't need /// to compute FieldAccesses for them. void addFieldsForClass(ClassDecl *theClass, SILType classType, bool superclass) { if (theClass->hasClangNode()) { ClassHasObjCAncestry = true; return; } if (theClass->hasSuperclass()) { SILType superclassType = classType.getSuperclass(); auto superclassDecl = superclassType.getClassOrBoundGenericClass(); assert(superclassType && superclassDecl); if (IGM.isResilient(superclassDecl, ResilienceExpansion::Maximal)) { // If the class is resilient, don't walk over its fields; we have to // calculate the layout at runtime. ClassHasResilientAncestry = true; // Furthermore, if the superclass is generic, we have to assume // that its layout depends on its generic parameters. But this only // propagates down to subclasses whose superclass type depends on the // subclass's generic context. if (superclassType.hasArchetype()) ClassHasGenericLayout = true; } else { // Otherwise, we have total knowledge of the class and its // fields, so walk them to compute the layout. addFieldsForClass(superclassDecl, superclassType, /*superclass=*/true); } } if (theClass->isGenericContext()) ClassHasGenericAncestry = true; if (classHasIncompleteLayout(IGM, theClass)) ClassHasMissingMembers = true; if (IGM.isResilient(theClass, ResilienceExpansion::Maximal)) { ClassHasResilientAncestry = true; return; } // Collect fields from this class and add them to the layout as a chunk. addDirectFieldsFromClass(theClass, classType, superclass); } void addDirectFieldsFromClass(ClassDecl *theClass, SILType classType, bool superclass) { for (VarDecl *var : theClass->getStoredProperties()) { SILType type = classType.getFieldType(var, IGM.getSILModule()); // Lower the field type. auto *eltType = &IGM.getTypeInfo(type); if (CompletelyFragileLayout && !eltType->isFixedSize()) { // For staging purposes, only do the new thing if the path flag // is provided. auto mode = (IGM.IRGen.Opts.ReadTypeInfoPath.empty() ? TypeConverter::Mode::CompletelyFragile : TypeConverter::Mode::Legacy); LoweringModeScope scope(IGM, mode); eltType = &IGM.getTypeInfo(type); } if (!eltType->isFixedSize()) { if (type.hasArchetype()) ClassHasGenericLayout = true; else ClassHasResilientMembers = true; } auto element = ElementLayout::getIncomplete(*eltType); addField(element, LayoutStrategy::Universal); // The 'Elements' list only contains superclass fields when we're // building a layout for tail allocation. if (!superclass || TailTypes) Elements.push_back(element); if (!superclass) { AllStoredProperties.push_back(var); AllFieldAccesses.push_back(getFieldAccess()); } } if (!superclass) { // If we're calculating the layout of a specialized generic class type, // we cannot use field offset globals for dependently-typed fields, // because they will not exist -- we only emit such globals for fields // which are not dependent in all instantiations. // // So make sure to fall back to the fully unsubstituted 'abstract layout' // for any fields whose offsets are not completely fixed. auto *classTI = &IGM.getTypeInfo(classType).as<ClassTypeInfo>(); SILType selfType = getSelfType(theClass); auto *selfTI = &IGM.getTypeInfo(selfType).as<ClassTypeInfo>(); // Only calculate an abstract layout if its different than the one // being computed now. if (classTI != selfTI) { auto *abstractLayout = &selfTI->getClassLayout(IGM, selfType, CompletelyFragileLayout); for (unsigned index : indices(AllFieldAccesses)) { auto &access = AllFieldAccesses[index]; auto *var = AllStoredProperties[index]; if (access == FieldAccess::NonConstantDirect) access = abstractLayout->getFieldAccessAndElement(var).first; } } // If the class has Objective-C ancestry and we're doing runtime layout // that depends on generic parameters, the Swift runtime will first // layout the fields relative to the static instance start offset, and // then ask the Objective-C runtime to slide them. // // However, this means that if some fields have a generic type, their // alignment will change the instance start offset between generic // instantiations, and we cannot use field offset global variables at // all, even for fields that come before any generically-typed fields. // // For example, the alignment of 'x' and 'y' below might depend on 'T': // // class Foo<T> : NSFoobar { // var x : AKlass = AKlass() // var y : AKlass = AKlass() // var t : T? // } if (ClassHasGenericLayout && ClassHasObjCAncestry) { for (auto &access : AllFieldAccesses) { if (access == FieldAccess::NonConstantDirect) access = FieldAccess::ConstantIndirect; } } } } FieldAccess getFieldAccess() { // If the layout so far has a fixed size, the field offset is known // statically. if (isFixedSize()) return FieldAccess::ConstantDirect; // If layout so far depends on generic parameters, we have to load the // offset from the field offset vector in class metadata. if (ClassHasGenericLayout) return FieldAccess::ConstantIndirect; // If layout so far doesn't depend on any generic parameters, but it's // nonetheless not statically known (because either a superclass // or a member type was resilient), then we can rely on the existence // of a global field offset variable which will be initialized by // either the Objective-C or Swift runtime, depending on the // class's heritage. return FieldAccess::NonConstantDirect; } }; } // end anonymous namespace ClassLayout ClassTypeInfo::generateLayout(IRGenModule &IGM, SILType classType, bool completelyFragileLayout) const { ClassLayoutBuilder builder(IGM, classType, Refcount, completelyFragileLayout); auto *classTy = cast<llvm::StructType>(getStorageType()->getPointerElementType()); if (completelyFragileLayout) { // Create a name for the new llvm type. SmallString<32> typeName = classTy->getName(); typeName += "_fragile"; // Create the llvm type. classTy = llvm::StructType::create(IGM.getLLVMContext(), typeName.str()); } builder.setAsBodyOfStruct(classTy); return builder.getClassLayout(classTy); } StructLayout * ClassTypeInfo::createLayoutWithTailElems(IRGenModule &IGM, SILType classType, ArrayRef<SILType> tailTypes) const { // Add the elements for the class properties. ClassLayoutBuilder builder(IGM, classType, Refcount, /*CompletelyFragileLayout=*/false, tailTypes); // Create a name for the new llvm type. llvm::StructType *classTy = cast<llvm::StructType>(getStorageType()->getPointerElementType()); SmallString<32> typeName; llvm::raw_svector_ostream os(typeName); os << classTy->getName() << "_tailelems" << IGM.TailElemTypeID++; // Create the llvm type. llvm::StructType *ResultTy = llvm::StructType::create(IGM.getLLVMContext(), os.str()); builder.setAsBodyOfStruct(ResultTy); // Create the StructLayout, which is transfered to the caller (the caller is // responsible for deleting it). return new StructLayout(builder, classType.getClassOrBoundGenericClass(), ResultTy, builder.getElements()); } const ClassLayout & ClassTypeInfo::getClassLayout(IRGenModule &IGM, SILType classType, bool forBackwardDeployment) const { // Perform fragile layout only if Objective-C interop is enabled. // // FIXME: EnableClassResilience staging flag will go away once we can do // in-place re-initialization of class metadata. bool completelyFragileLayout = (forBackwardDeployment && IGM.Context.LangOpts.EnableObjCInterop && !IGM.IRGen.Opts.EnableClassResilience); // Return the cached layout if available. auto &Layout = completelyFragileLayout ? FragileLayout : ResilientLayout; if (!Layout) { auto NewLayout = generateLayout(IGM, classType, completelyFragileLayout); assert(!Layout && "generateLayout() should not call itself recursively"); Layout = NewLayout; } return *Layout; } /// Cast the base to i8*, apply the given inbounds offset (in bytes, /// as a size_t), and cast to a pointer to the given type. llvm::Value *IRGenFunction::emitByteOffsetGEP(llvm::Value *base, llvm::Value *offset, llvm::Type *objectType, const llvm::Twine &name) { assert(offset->getType() == IGM.SizeTy || offset->getType() == IGM.Int32Ty); auto addr = Builder.CreateBitCast(base, IGM.Int8PtrTy); addr = Builder.CreateInBoundsGEP(addr, offset); return Builder.CreateBitCast(addr, objectType->getPointerTo(), name); } /// Cast the base to i8*, apply the given inbounds offset (in bytes, /// as a size_t), and create an address in the given type. Address IRGenFunction::emitByteOffsetGEP(llvm::Value *base, llvm::Value *offset, const TypeInfo &type, const llvm::Twine &name) { auto addr = emitByteOffsetGEP(base, offset, type.getStorageType(), name); return type.getAddressForPointer(addr); } /// Emit a field l-value by applying the given offset to the given base. static OwnedAddress emitAddressAtOffset(IRGenFunction &IGF, SILType baseType, llvm::Value *base, llvm::Value *offset, VarDecl *field) { auto &fieldTI = IGF.getTypeInfo(baseType.getFieldType(field, IGF.getSILModule())); auto addr = IGF.emitByteOffsetGEP(base, offset, fieldTI, base->getName() + "." + field->getName().str()); return OwnedAddress(addr, base); } llvm::Constant * irgen::tryEmitConstantClassFragilePhysicalMemberOffset(IRGenModule &IGM, SILType baseType, VarDecl *field) { auto fieldType = baseType.getFieldType(field, IGM.getSILModule()); // If the field is empty, its address doesn't matter. auto &fieldTI = IGM.getTypeInfo(fieldType); if (fieldTI.isKnownEmpty(ResilienceExpansion::Maximal)) { return llvm::ConstantInt::get(IGM.SizeTy, 0); } auto &baseClassTI = IGM.getTypeInfo(baseType).as<ClassTypeInfo>(); auto &classLayout = baseClassTI.getClassLayout(IGM, baseType, /*forBackwardDeployment=*/false); auto fieldInfo = classLayout.getFieldAccessAndElement(field); switch (fieldInfo.first) { case FieldAccess::ConstantDirect: { auto element = fieldInfo.second; return llvm::ConstantInt::get(IGM.SizeTy, element.getByteOffset().getValue()); } case FieldAccess::NonConstantDirect: case FieldAccess::ConstantIndirect: return nullptr; } llvm_unreachable("unhandled access"); } FieldAccess irgen::getClassFieldAccess(IRGenModule &IGM, SILType baseType, VarDecl *field) { auto &baseClassTI = IGM.getTypeInfo(baseType).as<ClassTypeInfo>(); auto &classLayout = baseClassTI.getClassLayout(IGM, baseType, /*forBackwardDeployment=*/false); return classLayout.getFieldAccessAndElement(field).first; } Size irgen::getClassFieldOffset(IRGenModule &IGM, SILType baseType, VarDecl *field) { auto &baseClassTI = IGM.getTypeInfo(baseType).as<ClassTypeInfo>(); // FIXME: For now we just assume fragile layout here, because this is used as // part of emitting class metadata. auto &classLayout = baseClassTI.getClassLayout(IGM, baseType, /*forBackwardDeployment=*/true); auto fieldInfo = classLayout.getFieldAccessAndElement(field); auto element = fieldInfo.second; assert(element.getKind() == ElementLayout::Kind::Fixed || element.getKind() == ElementLayout::Kind::Empty); return element.getByteOffset(); } StructLayout * irgen::getClassLayoutWithTailElems(IRGenModule &IGM, SILType classType, ArrayRef<SILType> tailTypes) { auto &ClassTI = IGM.getTypeInfo(classType).as<ClassTypeInfo>(); return ClassTI.createLayoutWithTailElems(IGM, classType, tailTypes); } OwnedAddress irgen::projectPhysicalClassMemberAddress(IRGenFunction &IGF, llvm::Value *base, SILType baseType, SILType fieldType, VarDecl *field) { // If the field is empty, its address doesn't matter. auto &fieldTI = IGF.getTypeInfo(fieldType); if (fieldTI.isKnownEmpty(ResilienceExpansion::Maximal)) { return OwnedAddress(fieldTI.getUndefAddress(), base); } auto &baseClassTI = IGF.getTypeInfo(baseType).as<ClassTypeInfo>(); ClassDecl *baseClass = baseClassTI.getClass(); auto &classLayout = baseClassTI.getClassLayout(IGF.IGM, baseType, /*forBackwardDeployment=*/false); auto fieldInfo = classLayout.getFieldAccessAndElement(field); switch (fieldInfo.first) { case FieldAccess::ConstantDirect: { Address baseAddr(base, classLayout.getAlignment()); auto element = fieldInfo.second; Address memberAddr = element.project(IGF, baseAddr, None); // We may need to bitcast the address if the field is of a generic type. if (memberAddr.getType()->getElementType() != fieldTI.getStorageType()) memberAddr = IGF.Builder.CreateBitCast(memberAddr, fieldTI.getStorageType()->getPointerTo()); return OwnedAddress(memberAddr, base); } case FieldAccess::NonConstantDirect: { Address offsetA = IGF.IGM.getAddrOfFieldOffset(field, NotForDefinition); auto offset = IGF.Builder.CreateLoad(offsetA, "offset"); return emitAddressAtOffset(IGF, baseType, base, offset, field); } case FieldAccess::ConstantIndirect: { auto metadata = emitHeapMetadataRefForHeapObject(IGF, base, baseType); auto offset = emitClassFieldOffset(IGF, baseClass, field, metadata); return emitAddressAtOffset(IGF, baseType, base, offset, field); } } llvm_unreachable("bad field-access strategy"); } MemberAccessStrategy irgen::getPhysicalClassMemberAccessStrategy(IRGenModule &IGM, SILType baseType, VarDecl *field) { auto &baseClassTI = IGM.getTypeInfo(baseType).as<ClassTypeInfo>(); ClassDecl *baseClass = baseType.getClassOrBoundGenericClass(); auto &classLayout = baseClassTI.getClassLayout(IGM, baseType, /*forBackwardDeployment=*/false); auto fieldInfo = classLayout.getFieldAccessAndElement(field); switch (fieldInfo.first) { case FieldAccess::ConstantDirect: { auto element = fieldInfo.second; return MemberAccessStrategy::getDirectFixed(element.getByteOffset()); } case FieldAccess::NonConstantDirect: { std::string symbol = LinkEntity::forFieldOffset(field).mangleAsString(); return MemberAccessStrategy::getDirectGlobal(std::move(symbol), MemberAccessStrategy::OffsetKind::Bytes_Word); } case FieldAccess::ConstantIndirect: { Size indirectOffset = getClassFieldOffsetOffset(IGM, baseClass, field); return MemberAccessStrategy::getIndirectFixed(indirectOffset, MemberAccessStrategy::OffsetKind::Bytes_Word); } } llvm_unreachable("bad field-access strategy"); } Address irgen::emitTailProjection(IRGenFunction &IGF, llvm::Value *Base, SILType ClassType, SILType TailType) { const ClassTypeInfo &classTI = IGF.getTypeInfo(ClassType).as<ClassTypeInfo>(); llvm::Value *Offset = nullptr; auto &layout = classTI.getClassLayout(IGF.IGM, ClassType, /*forBackwardDeployment=*/false); Alignment HeapObjAlign = IGF.IGM.TargetInfo.HeapObjectAlignment; Alignment Align; // Get the size of the class instance. if (layout.isFixedLayout()) { Size ClassSize = layout.getSize(); Offset = llvm::ConstantInt::get(IGF.IGM.SizeTy, ClassSize.getValue()); Align = HeapObjAlign.alignmentAtOffset(ClassSize); } else { llvm::Value *metadata = emitHeapMetadataRefForHeapObject(IGF, Base, ClassType); Offset = emitClassResilientInstanceSizeAndAlignMask(IGF, ClassType.getClassOrBoundGenericClass(), metadata).first; } // Align up to the TailType. assert(TailType.isObject()); const TypeInfo &TailTI = IGF.getTypeInfo(TailType); llvm::Value *AlignMask = TailTI.getAlignmentMask(IGF, TailType); Offset = IGF.Builder.CreateAdd(Offset, AlignMask); llvm::Value *InvertedMask = IGF.Builder.CreateNot(AlignMask); Offset = IGF.Builder.CreateAnd(Offset, InvertedMask); llvm::Value *Addr = IGF.emitByteOffsetGEP(Base, Offset, TailTI.getStorageType(), "tailaddr"); if (auto *OffsetConst = dyn_cast<llvm::ConstantInt>(Offset)) { // Try to get an accurate alignment (only possible if the Offset is a // constant). Size TotalOffset(OffsetConst->getZExtValue()); Align = HeapObjAlign.alignmentAtOffset(TotalOffset); } return Address(Addr, Align); } /// Try to stack promote a class instance with possible tail allocated arrays. /// /// Returns the alloca if successful, or nullptr otherwise. static llvm::Value *stackPromote(IRGenFunction &IGF, const ClassLayout &FieldLayout, int &StackAllocSize, ArrayRef<std::pair<SILType, llvm::Value *>> TailArrays) { if (StackAllocSize < 0) return nullptr; if (!FieldLayout.isFixedLayout()) return nullptr; // Calculate the total size needed. // The first part is the size of the class itself. Alignment ClassAlign = FieldLayout.getAlignment(); Size TotalSize = FieldLayout.getSize(); // Add size for tail-allocated arrays. for (const auto &TailArray : TailArrays) { SILType ElemTy = TailArray.first; llvm::Value *Count = TailArray.second; // We can only calculate a constant size if the tail-count is constant. auto *CI = dyn_cast<llvm::ConstantInt>(Count); if (!CI) return nullptr; const TypeInfo &ElemTI = IGF.getTypeInfo(ElemTy); if (!ElemTI.isFixedSize()) return nullptr; const FixedTypeInfo &ElemFTI = ElemTI.as<FixedTypeInfo>(); Alignment ElemAlign = ElemFTI.getFixedAlignment(); // This should not happen - just to be save. if (ElemAlign > ClassAlign) return nullptr; TotalSize = TotalSize.roundUpToAlignment(ElemAlign); TotalSize += ElemFTI.getFixedStride() * CI->getValue().getZExtValue(); } if (TotalSize > Size(StackAllocSize)) return nullptr; StackAllocSize = TotalSize.getValue(); if (TotalSize == FieldLayout.getSize()) { // No tail-allocated arrays: we can use the llvm class type for alloca. llvm::Type *ClassTy = FieldLayout.getType(); Address Alloca = IGF.createAlloca(ClassTy, ClassAlign, "reference.raw"); return Alloca.getAddress(); } // Use a byte-array as type for alloca. llvm::Value *SizeVal = llvm::ConstantInt::get(IGF.IGM.Int32Ty, TotalSize.getValue()); Address Alloca = IGF.createAlloca(IGF.IGM.Int8Ty, SizeVal, ClassAlign, "reference.raw"); return Alloca.getAddress(); } std::pair<llvm::Value *, llvm::Value *> irgen::appendSizeForTailAllocatedArrays(IRGenFunction &IGF, llvm::Value *size, llvm::Value *alignMask, TailArraysRef TailArrays) { for (const auto &TailArray : TailArrays) { SILType ElemTy = TailArray.first; llvm::Value *Count = TailArray.second; const TypeInfo &ElemTI = IGF.getTypeInfo(ElemTy); // Align up to the tail-allocated array. llvm::Value *ElemStride = ElemTI.getStride(IGF, ElemTy); llvm::Value *ElemAlignMask = ElemTI.getAlignmentMask(IGF, ElemTy); size = IGF.Builder.CreateAdd(size, ElemAlignMask); llvm::Value *InvertedMask = IGF.Builder.CreateNot(ElemAlignMask); size = IGF.Builder.CreateAnd(size, InvertedMask); // Add the size of the tail allocated array. llvm::Value *AllocSize = IGF.Builder.CreateMul(ElemStride, Count); size = IGF.Builder.CreateAdd(size, AllocSize); alignMask = IGF.Builder.CreateOr(alignMask, ElemAlignMask); } return {size, alignMask}; } /// Emit an allocation of a class. llvm::Value *irgen::emitClassAllocation(IRGenFunction &IGF, SILType selfType, bool objc, int &StackAllocSize, TailArraysRef TailArrays) { auto &classTI = IGF.getTypeInfo(selfType).as<ClassTypeInfo>(); auto classType = selfType.getASTType(); // If we need to use Objective-C allocation, do so. // If the root class isn't known to use the Swift allocator, we need // to call [self alloc]. if (objc) { llvm::Value *metadata = emitClassHeapMetadataRef(IGF, classType, MetadataValueType::ObjCClass, MetadataState::Complete, /*allow uninitialized*/ true); StackAllocSize = -1; return emitObjCAllocObjectCall(IGF, metadata, selfType); } llvm::Value *metadata = emitClassHeapMetadataRef(IGF, classType, MetadataValueType::TypeMetadata, MetadataState::Complete); auto &classLayout = classTI.getClassLayout(IGF.IGM, selfType, /*forBackwardDeployment=*/false); llvm::Value *size, *alignMask; if (classLayout.isFixedSize()) { size = IGF.IGM.getSize(classLayout.getSize()); alignMask = IGF.IGM.getSize(classLayout.getAlignMask()); } else { std::tie(size, alignMask) = emitClassResilientInstanceSizeAndAlignMask(IGF, selfType.getClassOrBoundGenericClass(), metadata); } llvm::Type *destType = classLayout.getType()->getPointerTo(); llvm::Value *val = nullptr; if (llvm::Value *Promoted = stackPromote(IGF, classLayout, StackAllocSize, TailArrays)) { val = IGF.Builder.CreateBitCast(Promoted, IGF.IGM.RefCountedPtrTy); val = IGF.emitInitStackObjectCall(metadata, val, "reference.new"); } else { // Allocate the object on the heap. std::tie(size, alignMask) = appendSizeForTailAllocatedArrays(IGF, size, alignMask, TailArrays); val = IGF.emitAllocObjectCall(metadata, size, alignMask, "reference.new"); StackAllocSize = -1; } return IGF.Builder.CreateBitCast(val, destType); } llvm::Value *irgen::emitClassAllocationDynamic(IRGenFunction &IGF, llvm::Value *metadata, SILType selfType, bool objc, TailArraysRef TailArrays) { // If we need to use Objective-C allocation, do so. if (objc) { return emitObjCAllocObjectCall(IGF, metadata, selfType); } // Otherwise, allocate using Swift's routines. llvm::Value *size, *alignMask; std::tie(size, alignMask) = emitClassResilientInstanceSizeAndAlignMask(IGF, selfType.getClassOrBoundGenericClass(), metadata); std::tie(size, alignMask) = appendSizeForTailAllocatedArrays(IGF, size, alignMask, TailArrays); llvm::Value *val = IGF.emitAllocObjectCall(metadata, size, alignMask, "reference.new"); auto &classTI = IGF.getTypeInfo(selfType).as<ClassTypeInfo>(); auto &layout = classTI.getClassLayout(IGF.IGM, selfType, /*forBackwardDeployment=*/false); llvm::Type *destType = layout.getType()->getPointerTo(); return IGF.Builder.CreateBitCast(val, destType); } /// Get the instance size and alignment mask for the given class /// instance. static void getInstanceSizeAndAlignMask(IRGenFunction &IGF, SILType selfType, ClassDecl *selfClass, llvm::Value *selfValue, llvm::Value *&size, llvm::Value *&alignMask) { // Try to determine the size of the object we're deallocating. auto &info = IGF.IGM.getTypeInfo(selfType).as<ClassTypeInfo>(); auto &layout = info.getClassLayout(IGF.IGM, selfType, /*forBackwardDeployment=*/false); // If it's fixed, emit the constant size and alignment mask. if (layout.isFixedLayout()) { size = IGF.IGM.getSize(layout.getSize()); alignMask = IGF.IGM.getSize(layout.getAlignMask()); return; } // Otherwise, get them from the metadata. llvm::Value *metadata = emitHeapMetadataRefForHeapObject(IGF, selfValue, selfType); std::tie(size, alignMask) = emitClassResilientInstanceSizeAndAlignMask(IGF, selfClass, metadata); } void irgen::emitClassDeallocation(IRGenFunction &IGF, SILType selfType, llvm::Value *selfValue) { auto *theClass = selfType.getClassOrBoundGenericClass(); llvm::Value *size, *alignMask; getInstanceSizeAndAlignMask(IGF, selfType, theClass, selfValue, size, alignMask); selfValue = IGF.Builder.CreateBitCast(selfValue, IGF.IGM.RefCountedPtrTy); emitDeallocateClassInstance(IGF, selfValue, size, alignMask); } void irgen::emitPartialClassDeallocation(IRGenFunction &IGF, SILType selfType, llvm::Value *selfValue, llvm::Value *metadataValue) { auto *theClass = selfType.getClassOrBoundGenericClass(); assert(theClass->getForeignClassKind() == ClassDecl::ForeignKind::Normal); llvm::Value *size, *alignMask; getInstanceSizeAndAlignMask(IGF, selfType, theClass, selfValue, size, alignMask); selfValue = IGF.Builder.CreateBitCast(selfValue, IGF.IGM.RefCountedPtrTy); emitDeallocatePartialClassInstance(IGF, selfValue, metadataValue, size, alignMask); } /// emitClassDecl - Emit all the declarations associated with this class type. void IRGenModule::emitClassDecl(ClassDecl *D) { PrettyStackTraceDecl prettyStackTrace("emitting class metadata for", D); SILType selfType = getSelfType(D); auto &classTI = getTypeInfo(selfType).as<ClassTypeInfo>(); // FIXME: For now, always use the fragile layout when emitting metadata. auto &fragileLayout = classTI.getClassLayout(*this, selfType, /*forBackwardDeployment=*/true); // ... but still compute the resilient layout for better test coverage. auto &resilientLayout = classTI.getClassLayout(*this, selfType, /*forBackwardDeployment=*/false); (void) resilientLayout; // Emit the class metadata. emitClassMetadata(*this, D, fragileLayout); IRGen.addClassForEagerInitialization(D); emitNestedTypeDecls(D->getMembers()); emitFieldMetadataRecord(D); } namespace { using CategoryNameKey = std::pair<ClassDecl*, ModuleDecl*>; /// Used to provide unique names to ObjC categories generated by Swift /// extensions. The first category for a class in a module gets the module's /// name as its key, e.g., NSObject (MySwiftModule). Another extension of the /// same class in the same module gets a category name with a number appended, /// e.g., NSObject (MySwiftModule1). llvm::DenseMap<CategoryNameKey, unsigned> CategoryCounts; /// A class for building ObjC class data (in Objective-C terms, class_ro_t), /// category data (category_t), or protocol data (protocol_t). class ClassDataBuilder : public ClassMemberVisitor<ClassDataBuilder> { IRGenModule &IGM; PointerUnion<ClassDecl *, ProtocolDecl *> TheEntity; ExtensionDecl *TheExtension; const ClassLayout *FieldLayout; ClassDecl *getClass() const { return TheEntity.get<ClassDecl*>(); } ProtocolDecl *getProtocol() const { return TheEntity.get<ProtocolDecl*>(); } bool isBuildingClass() const { return TheEntity.is<ClassDecl*>() && !TheExtension; } bool isBuildingCategory() const { return TheEntity.is<ClassDecl*>() && TheExtension; } bool isBuildingProtocol() const { return TheEntity.is<ProtocolDecl*>(); } bool HasNonTrivialDestructor = false; bool HasNonTrivialConstructor = false; class MethodDescriptor { public: enum class Kind { Method, IVarInitializer, IVarDestroyer, }; private: llvm::PointerIntPair<void*, 2, Kind> Data; static_assert(llvm::PointerLikeTypeTraits<llvm::Function*> ::NumLowBitsAvailable >= 2, "llvm::Function* isn't adequately aligned"); static_assert(llvm::PointerLikeTypeTraits<AbstractFunctionDecl*> ::NumLowBitsAvailable >= 2, "AbstractFuncDecl* isn't adequately aligned"); MethodDescriptor(Kind kind, void *ptr) : Data(ptr, kind) {} public: MethodDescriptor(AbstractFunctionDecl *method) : Data(method, Kind::Method) { assert(method && "null method provided"); } static MethodDescriptor getIVarInitializer(llvm::Function *fn) { assert(fn && "null impl provided"); return MethodDescriptor(Kind::IVarInitializer, fn); } static MethodDescriptor getIVarDestroyer(llvm::Function *fn) { assert(fn && "null impl provided"); return MethodDescriptor(Kind::IVarDestroyer, fn); } Kind getKind() const { return Data.getInt(); } AbstractFunctionDecl *getMethod() { assert(getKind() == Kind::Method); return static_cast<AbstractFunctionDecl*>(Data.getPointer()); } llvm::Function *getImpl() { assert(getKind() != Kind::Method); return static_cast<llvm::Function*>(Data.getPointer()); } }; llvm::SmallString<16> CategoryName; SmallVector<VarDecl*, 8> Ivars; SmallVector<MethodDescriptor, 16> InstanceMethods; SmallVector<MethodDescriptor, 16> ClassMethods; SmallVector<MethodDescriptor, 16> OptInstanceMethods; SmallVector<MethodDescriptor, 16> OptClassMethods; SmallVector<ProtocolDecl*, 4> Protocols; SmallVector<VarDecl*, 8> InstanceProperties; SmallVector<VarDecl*, 8> ClassProperties; llvm::Constant *Name = nullptr; SmallVectorImpl<MethodDescriptor> &getMethodList(ValueDecl *decl) { if (decl->getAttrs().hasAttribute<OptionalAttr>()) { if (decl->isStatic()) { return OptClassMethods; } else { return OptInstanceMethods; } } else { if (decl->isStatic()) { return ClassMethods; } else { return InstanceMethods; } } } public: ClassDataBuilder(IRGenModule &IGM, ClassDecl *theClass, const ClassLayout &fieldLayout) : IGM(IGM), TheEntity(theClass), TheExtension(nullptr), FieldLayout(&fieldLayout) { visitConformances(theClass); visitMembers(theClass); if (Lowering::usesObjCAllocator(theClass)) { addIVarInitializer(); addIVarDestroyer(); } } ClassDataBuilder(IRGenModule &IGM, ClassDecl *theClass, ExtensionDecl *theExtension) : IGM(IGM), TheEntity(theClass), TheExtension(theExtension), FieldLayout(nullptr) { buildCategoryName(CategoryName); visitConformances(theExtension); for (Decl *member : TheExtension->getMembers()) visit(member); } ClassDataBuilder(IRGenModule &IGM, ProtocolDecl *theProtocol) : IGM(IGM), TheEntity(theProtocol), TheExtension(nullptr) { llvm::SmallSetVector<ProtocolDecl *, 2> protocols; // Gather protocol references for all of the directly inherited // Objective-C protocol conformances. for (ProtocolDecl *p : theProtocol->getInheritedProtocols()) { getObjCProtocols(p, protocols); } // Add any restated Objective-C protocol conformances. for (auto *attr : theProtocol ->getAttrs().getAttributes<RestatedObjCConformanceAttr>()) { getObjCProtocols(attr->Proto, protocols); } for (ProtocolDecl *proto : protocols) { Protocols.push_back(proto); } for (Decl *member : theProtocol->getMembers()) visit(member); } /// Gather protocol records for all of the explicitly-specified Objective-C /// protocol conformances. void visitConformances(DeclContext *dc) { llvm::SmallSetVector<ProtocolDecl *, 2> protocols; for (auto conformance : dc->getLocalConformances( ConformanceLookupKind::OnlyExplicit, nullptr, /*sorted=*/true)) { ProtocolDecl *proto = conformance->getProtocol(); getObjCProtocols(proto, protocols); } for (ProtocolDecl *proto : protocols) { Protocols.push_back(proto); } } /// Add the protocol to the vector, if it's Objective-C protocol, /// or search its superprotocols. void getObjCProtocols(ProtocolDecl *proto, llvm::SmallSetVector<ProtocolDecl *, 2> &result) { if (proto->isObjC()) { result.insert(proto); } else { for (ProtocolDecl *inherited : proto->getInheritedProtocols()) { // Recursively check inherited protocol for objc conformance. getObjCProtocols(inherited, result); } } } llvm::Constant *getMetaclassRefOrNull(ClassDecl *theClass) { if (theClass->isGenericContext() && !theClass->hasClangNode()) { return llvm::ConstantPointerNull::get(IGM.ObjCClassPtrTy); } else { return IGM.getAddrOfMetaclassObject(theClass, NotForDefinition); } } void buildMetaclassStub() { assert(FieldLayout && "can't build a metaclass from a category"); // The isa is the metaclass pointer for the root class. auto rootClass = getRootClassForMetaclass(IGM, TheEntity.get<ClassDecl *>()); auto rootPtr = getMetaclassRefOrNull(rootClass); // The superclass of the metaclass is the metaclass of the // superclass. Note that for metaclass stubs, we can always // ignore parent contexts and generic arguments. // // If this class has no formal superclass, then its actual // superclass is SwiftObject, i.e. the root class. llvm::Constant *superPtr; if (getClass()->hasSuperclass()) { auto base = getClass()->getSuperclassDecl(); superPtr = getMetaclassRefOrNull(base); } else { superPtr = getMetaclassRefOrNull( IGM.getObjCRuntimeBaseForSwiftRootClass(getClass())); } auto dataPtr = emitROData(ForMetaClass); dataPtr = llvm::ConstantExpr::getPtrToInt(dataPtr, IGM.IntPtrTy); llvm::Constant *fields[] = { rootPtr, superPtr, IGM.getObjCEmptyCachePtr(), IGM.getObjCEmptyVTablePtr(), dataPtr }; auto init = llvm::ConstantStruct::get(IGM.ObjCClassStructTy, makeArrayRef(fields)); auto metaclass = cast<llvm::GlobalVariable>( IGM.getAddrOfMetaclassObject(getClass(), ForDefinition)); metaclass->setInitializer(init); } private: void buildCategoryName(SmallVectorImpl<char> &s) { llvm::raw_svector_ostream os(s); // Find the module the extension is declared in. ModuleDecl *TheModule = TheExtension->getParentModule(); os << TheModule->getName(); unsigned categoryCount = CategoryCounts[{getClass(), TheModule}]++; if (categoryCount > 0) os << categoryCount; } public: llvm::Constant *emitCategory() { assert(TheExtension && "can't emit category data for a class"); ConstantInitBuilder builder(IGM); auto fields = builder.beginStruct(); // struct category_t { // char const *name; fields.add(IGM.getAddrOfGlobalString(CategoryName)); // const class_t *theClass; if (getClass()->hasClangNode()) fields.add(IGM.getAddrOfObjCClass(getClass(), NotForDefinition)); else { auto type = getSelfType(getClass()).getASTType(); llvm::Constant *metadata = tryEmitConstantHeapMetadataRef(IGM, type, /*allowUninit*/ true); assert(metadata && "extended objc class doesn't have constant metadata?"); fields.add(metadata); } // const method_list_t *instanceMethods; fields.add(buildInstanceMethodList()); // const method_list_t *classMethods; fields.add(buildClassMethodList()); // const protocol_list_t *baseProtocols; fields.add(buildProtocolList()); // const property_list_t *properties; fields.add(buildPropertyList(ForClass)); // const property_list_t *classProperties; fields.add(buildPropertyList(ForMetaClass)); // uint32_t size; // FIXME: Clang does this by using non-ad-hoc types for ObjC runtime // structures. Size size = 7 * IGM.getPointerSize() + Size(4); fields.addInt32(size.getValue()); // }; assert(fields.getNextOffsetFromGlobal() == size); return buildGlobalVariable(fields, "_CATEGORY_"); } llvm::Constant *emitProtocol() { ConstantInitBuilder builder(IGM); auto fields = builder.beginStruct(); llvm::SmallString<64> nameBuffer; assert(isBuildingProtocol() && "not emitting a protocol"); // struct protocol_t { // Class super; fields.addNullPointer(IGM.Int8PtrTy); // char const *name; fields.add(IGM.getAddrOfGlobalString(getEntityName(nameBuffer))); // const protocol_list_t *baseProtocols; fields.add(buildProtocolList()); // const method_list_t *requiredInstanceMethods; fields.add(buildInstanceMethodList()); // const method_list_t *requiredClassMethods; fields.add(buildClassMethodList()); // const method_list_t *optionalInstanceMethods; fields.add(buildOptInstanceMethodList()); // const method_list_t *optionalClassMethods; fields.add(buildOptClassMethodList()); // const property_list_t *properties; fields.add(buildPropertyList(ForClass)); // uint32_t size; // FIXME: Clang does this by using non-ad-hoc types for ObjC runtime // structures. Size size = 11 * IGM.getPointerSize() + 2 * Size(4); fields.addInt32(size.getValue()); // uint32_t flags; auto flags = ProtocolDescriptorFlags() .withSwift(!getProtocol()->hasClangNode()) .withClassConstraint(ProtocolClassConstraint::Class) .withDispatchStrategy(ProtocolDispatchStrategy::ObjC) .withSpecialProtocol(getSpecialProtocolID(getProtocol())); fields.addInt32(flags.getIntValue()); // const char ** extendedMethodTypes; fields.add(buildOptExtendedMethodTypes()); // const char *demangledName; fields.addNullPointer(IGM.Int8PtrTy); // const property_list_t *classProperties; fields.add(buildPropertyList(ForMetaClass)); // }; assert(fields.getNextOffsetFromGlobal() == size); return buildGlobalVariable(fields, "_PROTOCOL_"); } void emitRODataFields(ConstantStructBuilder &b, ForMetaClass_t forMeta) { assert(FieldLayout && "can't emit rodata for a category"); // struct _class_ro_t { // uint32_t flags; b.addInt32(unsigned(buildFlags(forMeta))); // uint32_t instanceStart; // uint32_t instanceSize; // The runtime requires that the ivar offsets be initialized to // a valid layout of the ivars of this class, bounded by these // two values. If the instanceSize of the superclass equals the // stored instanceStart of the subclass, the ivar offsets // will not be changed. Size instanceStart; Size instanceSize; if (forMeta) { // sizeof(struct class_t) instanceSize = Size(5 * IGM.getPointerSize().getValue()); // historical nonsense instanceStart = instanceSize; } else { instanceSize = FieldLayout->getSize(); instanceStart = FieldLayout->getInstanceStart(); } b.addInt32(instanceStart.getValue()); b.addInt32(instanceSize.getValue()); // uint32_t reserved; // only when building for 64bit targets if (IGM.getPointerAlignment().getValue() > 4) { assert(IGM.getPointerAlignment().getValue() == 8); b.addInt32(0); } // const uint8_t *ivarLayout; // GC/ARC layout. TODO. b.addNullPointer(IGM.Int8PtrTy); // const char *name; // It is correct to use the same name for both class and metaclass. b.add(buildName()); // const method_list_t *baseMethods; b.add(forMeta ? buildClassMethodList() : buildInstanceMethodList()); // const protocol_list_t *baseProtocols; // Apparently, this list is the same in the class and the metaclass. b.add(buildProtocolList()); // const ivar_list_t *ivars; if (forMeta) { b.addNullPointer(IGM.Int8PtrTy); } else { b.add(buildIvarList()); } // const uint8_t *weakIvarLayout; // More GC/ARC layout. TODO. b.addNullPointer(IGM.Int8PtrTy); // const property_list_t *baseProperties; b.add(buildPropertyList(forMeta)); // }; } llvm::Constant *emitROData(ForMetaClass_t forMeta) { ConstantInitBuilder builder(IGM); auto fields = builder.beginStruct(); emitRODataFields(fields, forMeta); auto dataSuffix = forMeta ? "_METACLASS_DATA_" : "_DATA_"; return buildGlobalVariable(fields, dataSuffix); } private: ObjCClassFlags buildFlags(ForMetaClass_t forMeta) { ObjCClassFlags flags = ObjCClassFlags::CompiledByARC; // Mark metaclasses as appropriate. if (forMeta) { flags |= ObjCClassFlags::Meta; // Non-metaclasses need us to record things whether primitive // construction/destructor is trivial. } else if (HasNonTrivialDestructor || HasNonTrivialConstructor) { flags |= ObjCClassFlags::HasCXXStructors; if (!HasNonTrivialConstructor) flags |= ObjCClassFlags::HasCXXDestructorOnly; } // FIXME: set ObjCClassFlags::Hidden when appropriate return flags; } llvm::Constant *buildName() { if (Name) return Name; // If the class is generic, we'll instantiate its name at runtime. if (getClass()->isGenericContext()) { Name = llvm::ConstantPointerNull::get(IGM.Int8PtrTy); return Name; } llvm::SmallString<64> buffer; Name = IGM.getAddrOfGlobalString(getClass()->getObjCRuntimeName(buffer)); return Name; } llvm::Constant *null() { return llvm::ConstantPointerNull::get(IGM.Int8PtrTy); } /*** Methods ***********************************************************/ public: /// Methods need to be collected into the appropriate methods list. void visitFuncDecl(FuncDecl *method) { if (!isBuildingProtocol() && !requiresObjCMethodDescriptor(method)) return; // getters and setters funcdecls will be handled by their parent // var/subscript. if (isa<AccessorDecl>(method)) return; // Don't emit getters/setters for @NSManaged methods. if (method->getAttrs().hasAttribute<NSManagedAttr>()) return; getMethodList(method).push_back(method); } /// Constructors need to be collected into the appropriate methods list. void visitConstructorDecl(ConstructorDecl *constructor) { if (!isBuildingProtocol() && !requiresObjCMethodDescriptor(constructor)) return; getMethodList(constructor).push_back(constructor); } /// Determine whether the given destructor has an Objective-C /// definition. bool hasObjCDeallocDefinition(DestructorDecl *destructor) { // If we have the destructor body, we know whether SILGen // generated a -dealloc body. if (auto braceStmt = destructor->getBody()) return braceStmt->getNumElements() != 0; // We don't have a destructor body, so hunt for the SIL function // for it. auto dtorRef = SILDeclRef(destructor, SILDeclRef::Kind::Deallocator) .asForeign(); if (auto silFn = IGM.getSILModule().lookUpFunction(dtorRef)) return silFn->isDefinition(); // The Objective-C thunk was never even declared, so it is not defined. return false; } /// Destructors need to be collected into the instance methods /// list void visitDestructorDecl(DestructorDecl *destructor) { auto classDecl = cast<ClassDecl>(destructor->getDeclContext()); if (Lowering::usesObjCAllocator(classDecl) && hasObjCDeallocDefinition(destructor)) { InstanceMethods.push_back(destructor); } } void visitMissingMemberDecl(MissingMemberDecl *placeholder) { llvm_unreachable("should not IRGen classes with missing members"); } void addIVarInitializer() { if (auto fn = IGM.getAddrOfIVarInitDestroy(getClass(), /*destroy*/ false, /*isForeign=*/ true, NotForDefinition)) { InstanceMethods.push_back(MethodDescriptor::getIVarInitializer(*fn)); HasNonTrivialConstructor = true; } } void addIVarDestroyer() { if (auto fn = IGM.getAddrOfIVarInitDestroy(getClass(), /*destroy*/ true, /*isForeign=*/ true, NotForDefinition)) { InstanceMethods.push_back(MethodDescriptor::getIVarDestroyer(*fn)); HasNonTrivialDestructor = true; } } void buildMethod(ConstantArrayBuilder &descriptors, MethodDescriptor descriptor) { switch (descriptor.getKind()) { case MethodDescriptor::Kind::Method: return buildMethod(descriptors, descriptor.getMethod()); case MethodDescriptor::Kind::IVarInitializer: emitObjCIVarInitDestroyDescriptor(IGM, descriptors, getClass(), descriptor.getImpl(), false); return; case MethodDescriptor::Kind::IVarDestroyer: emitObjCIVarInitDestroyDescriptor(IGM, descriptors, getClass(), descriptor.getImpl(), true); return; } llvm_unreachable("bad method descriptor kind"); } void buildMethod(ConstantArrayBuilder &descriptors, AbstractFunctionDecl *method) { auto accessor = dyn_cast<AccessorDecl>(method); if (!accessor) return emitObjCMethodDescriptor(IGM, descriptors, method); switch (accessor->getAccessorKind()) { case AccessorKind::Get: return emitObjCGetterDescriptor(IGM, descriptors, accessor->getStorage()); case AccessorKind::Set: return emitObjCSetterDescriptor(IGM, descriptors, accessor->getStorage()); #define OBJC_ACCESSOR(ID, KEYWORD) #define ACCESSOR(ID) \ case AccessorKind::ID: #include "swift/AST/AccessorKinds.def" llvm_unreachable("shouldn't be trying to build this accessor"); } llvm_unreachable("bad accessor kind"); } private: StringRef chooseNamePrefix(StringRef forClass, StringRef forCategory, StringRef forProtocol) { if (isBuildingCategory()) return forCategory; if (isBuildingClass()) return forClass; if (isBuildingProtocol()) return forProtocol; llvm_unreachable("not a class, category, or protocol?!"); } llvm::Constant *buildClassMethodList() { return buildMethodList(ClassMethods, chooseNamePrefix("_CLASS_METHODS_", "_CATEGORY_CLASS_METHODS_", "_PROTOCOL_CLASS_METHODS_")); } llvm::Constant *buildInstanceMethodList() { return buildMethodList(InstanceMethods, chooseNamePrefix("_INSTANCE_METHODS_", "_CATEGORY_INSTANCE_METHODS_", "_PROTOCOL_INSTANCE_METHODS_")); } llvm::Constant *buildOptClassMethodList() { return buildMethodList(OptClassMethods, "_PROTOCOL_CLASS_METHODS_OPT_"); } llvm::Constant *buildOptInstanceMethodList() { return buildMethodList(OptInstanceMethods, "_PROTOCOL_INSTANCE_METHODS_OPT_"); } llvm::Constant *buildOptExtendedMethodTypes() { if (!isBuildingProtocol()) return null(); ConstantInitBuilder builder(IGM); auto array = builder.beginArray(); buildExtMethodTypes(array, InstanceMethods); buildExtMethodTypes(array, ClassMethods); buildExtMethodTypes(array, OptInstanceMethods); buildExtMethodTypes(array, OptClassMethods); if (array.empty()) { array.abandon(); return null(); } return buildGlobalVariable(array, "_PROTOCOL_METHOD_TYPES_"); } void buildExtMethodTypes(ConstantArrayBuilder &array, ArrayRef<MethodDescriptor> methods) { for (auto descriptor : methods) { assert(descriptor.getKind() == MethodDescriptor::Kind::Method && "cannot emit descriptor for non-method"); auto method = descriptor.getMethod(); array.add(getMethodTypeExtendedEncoding(IGM, method)); } } /// struct method_list_t { /// uint32_t entsize; // runtime uses low bits for its own purposes /// uint32_t count; /// method_t list[count]; /// }; /// /// This method does not return a value of a predictable type. llvm::Constant *buildMethodList(ArrayRef<MethodDescriptor> methods, StringRef name) { return buildOptionalList(methods, 3 * IGM.getPointerSize(), name, [&](ConstantArrayBuilder &descriptors, MethodDescriptor descriptor) { buildMethod(descriptors, descriptor); }); } /*** Protocols *********************************************************/ /// typedef uintptr_t protocol_ref_t; // protocol_t*, but unremapped llvm::Constant *buildProtocolRef(ProtocolDecl *protocol) { assert(protocol->isObjC()); return IGM.getAddrOfObjCProtocolRecord(protocol, NotForDefinition); } /// struct protocol_list_t { /// uintptr_t count; /// protocol_ref_t[count]; /// }; /// /// This method does not return a value of a predictable type. llvm::Constant *buildProtocolList() { return buildOptionalList(Protocols, Size(0), chooseNamePrefix("_PROTOCOLS_", "_CATEGORY_PROTOCOLS_", "_PROTOCOL_PROTOCOLS_"), [&](ConstantArrayBuilder &descriptors, ProtocolDecl *protocol) { buildProtocol(descriptors, protocol); }); } void buildProtocol(ConstantArrayBuilder &array, ProtocolDecl *protocol) { array.add(buildProtocolRef(protocol)); } /*** Ivars *************************************************************/ public: /// Variables might be stored or computed. void visitVarDecl(VarDecl *var) { if (var->hasStorage() && !var->isStatic()) visitStoredVar(var); else visitProperty(var); } private: /// Ivars need to be collected in the ivars list, and they also /// affect flags. void visitStoredVar(VarDecl *var) { // FIXME: how to handle ivar extensions in categories? if (!FieldLayout) return; Ivars.push_back(var); // Build property accessors for the ivar if necessary. visitProperty(var); } /// struct ivar_t { /// uintptr_t *offset; /// const char *name; /// const char *type; /// uint32_t alignment; // actually the log2 of the alignment /// uint32_t size; /// }; void buildIvar(ConstantArrayBuilder &ivars, VarDecl *ivar) { assert(FieldLayout && "can't build ivar for category"); auto fields = ivars.beginStruct(); // For now, we never try to emit specialized versions of the // metadata statically, so compute the field layout using the // originally-declared type. auto pair = FieldLayout->getFieldAccessAndElement(ivar); llvm::Constant *offsetPtr; switch (pair.first) { case FieldAccess::ConstantDirect: case FieldAccess::NonConstantDirect: { // If the field offset is fixed relative to the start of the superclass, // reference the global from the ivar metadata so that the Objective-C // runtime will slide it down. auto offsetAddr = IGM.getAddrOfFieldOffset(ivar, NotForDefinition); offsetPtr = cast<llvm::Constant>(offsetAddr.getAddress()); break; } case FieldAccess::ConstantIndirect: // Otherwise, swift_initClassMetadata() will point the Objective-C // runtime into the field offset vector of the instantiated metadata. offsetPtr = llvm::ConstantPointerNull::get(IGM.IntPtrTy->getPointerTo()); break; } fields.add(offsetPtr); // TODO: clang puts this in __TEXT,__objc_methname,cstring_literals fields.add(IGM.getAddrOfGlobalString(ivar->getName().str())); // TODO: clang puts this in __TEXT,__objc_methtype,cstring_literals fields.add(IGM.getAddrOfGlobalString("")); Size size; Alignment alignment; if (auto fixedTI = dyn_cast<FixedTypeInfo>(&pair.second.getType())) { size = fixedTI->getFixedSize(); alignment = fixedTI->getFixedAlignment(); } else { size = Size(0); alignment = Alignment(1); } // If the size is larger than we can represent in 32-bits, // complain about the unimplementable ivar. if (uint32_t(size.getValue()) != size.getValue()) { IGM.error(ivar->getLoc(), "ivar size (" + Twine(size.getValue()) + " bytes) overflows Objective-C ivar layout"); size = Size(0); } fields.addInt32(alignment.log2()); fields.addInt32(size.getValue()); fields.finishAndAddTo(ivars); } /// struct ivar_list_t { /// uint32_t entsize; /// uint32_t count; /// ivar_t list[count]; /// }; /// /// This method does not return a value of a predictable type. llvm::Constant *buildIvarList() { Size eltSize = 3 * IGM.getPointerSize() + Size(8); return buildOptionalList(Ivars, eltSize, "_IVARS_", [&](ConstantArrayBuilder &descriptors, VarDecl *ivar) { buildIvar(descriptors, ivar); }); } /*** Properties ********************************************************/ /// Properties need to be collected in the properties list. void visitProperty(VarDecl *var) { if (requiresObjCPropertyDescriptor(IGM, var)) { if (var->isStatic()) { ClassProperties.push_back(var); } else { InstanceProperties.push_back(var); } // Don't emit descriptors for properties without accessors. auto getter = var->getGetter(); if (!getter) return; // Don't emit getter/setter descriptors for @NSManaged properties. if (var->getAttrs().hasAttribute<NSManagedAttr>()) return; auto &methods = getMethodList(var); methods.push_back(getter); if (auto setter = var->getSetter()) methods.push_back(setter); } } /// Build the property attribute string for a property decl. void buildPropertyAttributes(VarDecl *prop, SmallVectorImpl<char> &out) { llvm::raw_svector_ostream outs(out); auto propTy = prop->getValueInterfaceType(); // Emit the type encoding for the property. outs << 'T'; std::string typeEnc; getObjCEncodingForPropertyType(IGM, prop, typeEnc); outs << typeEnc; // Emit other attributes. // All Swift properties are (nonatomic). outs << ",N"; // @NSManaged properties are @dynamic. if (prop->getAttrs().hasAttribute<NSManagedAttr>()) outs << ",D"; auto isObject = prop->getDeclContext()->mapTypeIntoContext(propTy) ->hasRetainablePointerRepresentation(); auto hasObjectEncoding = typeEnc[0] == '@'; // Determine the assignment semantics. // Get-only properties are (readonly). if (!prop->isSettable(prop->getDeclContext())) outs << ",R"; // Weak and Unowned properties are (weak). else if (prop->getAttrs().hasAttribute<ReferenceOwnershipAttr>()) outs << ",W"; // If the property is @NSCopying, or is bridged to a value class, the // property is (copy). else if (prop->getAttrs().hasAttribute<NSCopyingAttr>() || (hasObjectEncoding && !isObject)) outs << ",C"; // If it's of a managed object type, it is (retain). else if (isObject) outs << ",&"; // Otherwise, the property is of a value type, so it is // the default (assign). else (void)0; // If the property has storage, emit the ivar name last. if (prop->hasStorage()) outs << ",V" << prop->getName(); } /// struct property_t { /// const char *name; /// const char *attributes; /// }; void buildProperty(ConstantArrayBuilder &properties, VarDecl *prop) { llvm::SmallString<16> propertyAttributes; buildPropertyAttributes(prop, propertyAttributes); auto fields = properties.beginStruct(); fields.add(IGM.getAddrOfGlobalString(prop->getObjCPropertyName().str())); fields.add(IGM.getAddrOfGlobalString(propertyAttributes)); fields.finishAndAddTo(properties); } /// struct property_list_t { /// uint32_t entsize; /// uint32_t count; /// property_t list[count]; /// }; /// /// This method does not return a value of a predictable type. llvm::Constant *buildPropertyList(ForMetaClass_t classOrMeta) { if (classOrMeta == ForClass) { return buildPropertyList(InstanceProperties, chooseNamePrefix("_PROPERTIES_", "_CATEGORY_PROPERTIES_", "_PROTOCOL_PROPERTIES_")); } // Older OSs' libobjcs can't handle class property data. if ((IGM.Triple.isMacOSX() && IGM.Triple.isMacOSXVersionLT(10, 11)) || (IGM.Triple.isiOS() && IGM.Triple.isOSVersionLT(9))) { return null(); } return buildPropertyList(ClassProperties, chooseNamePrefix("_CLASS_PROPERTIES_", "_CATEGORY_CLASS_PROPERTIES_", "_PROTOCOL_CLASS_PROPERTIES_")); } llvm::Constant *buildPropertyList(ArrayRef<VarDecl*> properties, StringRef namePrefix) { Size eltSize = 2 * IGM.getPointerSize(); return buildOptionalList(properties, eltSize, namePrefix, [&](ConstantArrayBuilder &descriptors, VarDecl *property) { buildProperty(descriptors, property); }); } /*** General ***********************************************************/ /// Build a list structure from the given array of objects. /// If the array is empty, use null. The assumption is that every /// initializer has the same size. /// /// \param optionalEltSize - if non-zero, a size which needs /// to be placed in the list header template <class C, class Fn> llvm::Constant *buildOptionalList(const C &objects, Size optionalEltSize, StringRef nameBase, Fn &&buildElement) { if (objects.empty()) return null(); ConstantInitBuilder builder(IGM); auto fields = builder.beginStruct(); llvm::IntegerType *countType; // In all of the foo_list_t structs, either: // - there's a 32-bit entry size and a 32-bit count or // - there's no entry size and a uintptr_t count. if (!optionalEltSize.isZero()) { fields.addInt32(optionalEltSize.getValue()); countType = IGM.Int32Ty; } else { countType = IGM.IntPtrTy; } auto countPosition = fields.addPlaceholder(); auto array = fields.beginArray(); for (auto &element : objects) { buildElement(array, element); } // If we didn't actually make anything, declare that we're done. if (array.empty()) { array.abandon(); fields.abandon(); return null(); } // Otherwise, remember the size of the array and fill the // placeholder with it. auto count = array.size(); array.finishAndAddTo(fields); fields.fillPlaceholderWithInt(countPosition, countType, count); return buildGlobalVariable(fields, nameBase); } /// Get the name of the class or protocol to mangle into the ObjC symbol /// name. StringRef getEntityName(llvm::SmallVectorImpl<char> &buffer) const { if (auto theClass = TheEntity.dyn_cast<ClassDecl*>()) { return theClass->getObjCRuntimeName(buffer); } if (auto theProtocol = TheEntity.dyn_cast<ProtocolDecl*>()) { return theProtocol->getObjCRuntimeName(buffer); } llvm_unreachable("not a class or protocol?!"); } /// Build a private global variable as a structure containing the /// given fields. template <class B> llvm::Constant *buildGlobalVariable(B &fields, StringRef nameBase) { llvm::SmallString<64> nameBuffer; auto var = fields.finishAndCreateGlobal(Twine(nameBase) + getEntityName(nameBuffer) + (TheExtension ? Twine("_$_") + CategoryName.str() : Twine()), IGM.getPointerAlignment(), /*constant*/ true, llvm::GlobalVariable::PrivateLinkage); switch (IGM.TargetInfo.OutputObjectFormat) { case llvm::Triple::MachO: var->setSection("__DATA, __objc_const"); break; case llvm::Triple::COFF: var->setSection(".data"); break; case llvm::Triple::ELF: var->setSection(".data"); break; default: llvm_unreachable("Don't know how to emit private global constants for " "the selected object format."); } return var; } public: /// Member types don't get any representation. /// Maybe this should change for reflection purposes? void visitTypeDecl(TypeDecl *type) {} /// Pattern-bindings don't require anything special as long as /// these initializations are performed in the constructor, not /// .cxx_construct. void visitPatternBindingDecl(PatternBindingDecl *binding) {} /// Subscripts should probably be collected in extended metadata. void visitSubscriptDecl(SubscriptDecl *subscript) { if (!requiresObjCSubscriptDescriptor(IGM, subscript)) return; auto getter = subscript->getGetter(); if (!getter) return; auto &methods = getMethodList(subscript); methods.push_back(getter); if (auto setter = subscript->getSetter()) methods.push_back(setter); } }; } // end anonymous namespace /// Emit the private data (RO-data) associated with a class. llvm::Constant *irgen::emitClassPrivateData(IRGenModule &IGM, ClassDecl *cls) { assert(IGM.ObjCInterop && "emitting RO-data outside of interop mode"); PrettyStackTraceDecl stackTraceRAII("emitting ObjC metadata for", cls); SILType selfType = getSelfType(cls); auto &classTI = IGM.getTypeInfo(selfType).as<ClassTypeInfo>(); // FIXME: For now, always use the fragile layout when emitting metadata. auto &fieldLayout = classTI.getClassLayout(IGM, selfType, /*forBackwardDeployment=*/true); ClassDataBuilder builder(IGM, cls, fieldLayout); // First, build the metaclass object. builder.buildMetaclassStub(); // Then build the class RO-data. return builder.emitROData(ForClass); } std::pair<Size, Size> irgen::emitClassPrivateDataFields(IRGenModule &IGM, ConstantStructBuilder &init, ClassDecl *cls) { assert(IGM.ObjCInterop && "emitting RO-data outside of interop mode"); PrettyStackTraceDecl stackTraceRAII("emitting ObjC metadata for", cls); SILType selfType = getSelfType(cls); auto &classTI = IGM.getTypeInfo(selfType).as<ClassTypeInfo>(); // FIXME: For now, always use the fragile layout when emitting metadata. auto &fieldLayout = classTI.getClassLayout(IGM, selfType, /*forBackwardDeployment=*/true); ClassDataBuilder builder(IGM, cls, fieldLayout); Size startOfClassRO = init.getNextOffsetFromGlobal(); assert(startOfClassRO.isMultipleOf(IGM.getPointerSize())); { auto classRO = init.beginStruct(); builder.emitRODataFields(classRO, ForClass); classRO.finishAndAddTo(init); } Size startOfMetaclassRO = init.getNextOffsetFromGlobal(); assert(startOfMetaclassRO.isMultipleOf(IGM.getPointerSize())); { auto classRO = init.beginStruct(); builder.emitRODataFields(classRO, ForMetaClass); classRO.finishAndAddTo(init); } return std::make_pair(startOfClassRO, startOfMetaclassRO); } /// Emit the metadata for an ObjC category. llvm::Constant *irgen::emitCategoryData(IRGenModule &IGM, ExtensionDecl *ext) { assert(IGM.ObjCInterop && "emitting RO-data outside of interop mode"); ClassDecl *cls = ext->getSelfClassDecl(); assert(cls && "generating category metadata for a non-class extension"); PrettyStackTraceDecl stackTraceRAII("emitting ObjC metadata for", ext); ClassDataBuilder builder(IGM, cls, ext); return builder.emitCategory(); } /// Emit the metadata for an ObjC protocol. llvm::Constant *irgen::emitObjCProtocolData(IRGenModule &IGM, ProtocolDecl *proto) { assert(proto->isObjC() && "not an objc protocol"); PrettyStackTraceDecl stackTraceRAII("emitting ObjC metadata for", proto); ClassDataBuilder builder(IGM, proto); return builder.emitProtocol(); } const TypeInfo * TypeConverter::convertClassType(CanType type, ClassDecl *D) { llvm::StructType *ST = IGM.createNominalType(type); llvm::PointerType *irType = ST->getPointerTo(); ReferenceCounting refcount = type->getReferenceCounting(); SpareBitVector spareBits; // Classes known to be implemented in Swift can be assumed not to have tagged // pointer representations, so we can use spare bits for enum layout with // them. We can't make that assumption about imported ObjC types. if (D->hasClangNode() && IGM.TargetInfo.hasObjCTaggedPointers()) spareBits.appendClearBits(IGM.getPointerSize().getValueInBits()); else spareBits = IGM.getHeapObjectSpareBits(); return new ClassTypeInfo(irType, IGM.getPointerSize(), std::move(spareBits), IGM.getPointerAlignment(), D, refcount); } /// Lazily declare a fake-looking class to represent an ObjC runtime base class. ClassDecl *IRGenModule::getObjCRuntimeBaseClass(Identifier name, Identifier objcName) { auto found = SwiftRootClasses.find(name); if (found != SwiftRootClasses.end()) return found->second; // Make a really fake-looking class. auto SwiftRootClass = new (Context) ClassDecl(SourceLoc(), name, SourceLoc(), MutableArrayRef<TypeLoc>(), /*generics*/ nullptr, Context.TheBuiltinModule); SwiftRootClass->computeType(); SwiftRootClass->setIsObjC(Context.LangOpts.EnableObjCInterop); SwiftRootClass->getAttrs().add(ObjCAttr::createNullary(Context, objcName, /*isNameImplicit=*/true)); SwiftRootClass->setImplicit(); SwiftRootClass->setAccess(AccessLevel::Open); SwiftRootClasses.insert({name, SwiftRootClass}); return SwiftRootClass; } /// Lazily declare the ObjC runtime base class for a Swift root class. ClassDecl * IRGenModule::getObjCRuntimeBaseForSwiftRootClass(ClassDecl *theClass) { assert(!theClass->hasSuperclass() && "must pass a root class"); Identifier name; // If the class declares its own ObjC runtime base, use it. if (auto baseAttr = theClass->getAttrs() .getAttribute<SwiftNativeObjCRuntimeBaseAttr>()) { name = baseAttr->BaseClassName; } else { // Otherwise, use the standard SwiftObject class. name = Context.Id_SwiftObject; } return getObjCRuntimeBaseClass(name, name); } ClassDecl *irgen::getRootClassForMetaclass(IRGenModule &IGM, ClassDecl *C) { while (auto superclass = C->getSuperclassDecl()) C = superclass; // If the formal root class is imported from Objective-C, then // we should use that. For a class that's really implemented in // Objective-C, this is obviously right. For a class that's // really implemented in Swift, but that we're importing via an // Objective-C interface, this would be wrong --- except such a // class can never be a formal root class, because a Swift class // without a formal superclass will actually be parented by // SwiftObject (or maybe eventually something else like it), // which will be visible in the Objective-C type system. if (C->hasClangNode()) return C; // FIXME: If the root class specifies its own runtime ObjC base class, // assume that that base class ultimately inherits NSObject. if (C->getAttrs().hasAttribute<SwiftNativeObjCRuntimeBaseAttr>()) return IGM.getObjCRuntimeBaseClass( IGM.Context.getSwiftId(KnownFoundationEntity::NSObject), IGM.Context.getIdentifier("NSObject")); return IGM.getObjCRuntimeBaseClass(IGM.Context.Id_SwiftObject, IGM.Context.Id_SwiftObject); } bool irgen::doesClassMetadataRequireRelocation(IRGenModule &IGM, ClassDecl *theClass) { SILType selfType = getSelfType(theClass); auto &selfTI = IGM.getTypeInfo(selfType).as<ClassTypeInfo>(); // A completely fragile layout does not change whether the metadata // requires *relocation*, since that only depends on resilient class // ancestry, or the class itself being generic. auto &layout = selfTI.getClassLayout(IGM, selfType, /*forBackwardDeployment=*/false); return layout.doesMetadataRequireRelocation(); } bool irgen::doesClassMetadataRequireInitialization(IRGenModule &IGM, ClassDecl *theClass) { SILType selfType = getSelfType(theClass); auto &selfTI = IGM.getTypeInfo(selfType).as<ClassTypeInfo>(); // If we have a fragile layout used for backward deployment, we must use // idempotent initialization; swift_initClassMetadata() does not work with // statically registered classes. auto &layout = selfTI.getClassLayout(IGM, selfType, /*forBackwardDeployment=*/true); return layout.doesMetadataRequireInitialization(); } bool irgen::doesClassMetadataRequireUpdate(IRGenModule &IGM, ClassDecl *theClass) { SILType selfType = getSelfType(theClass); auto &selfTI = IGM.getTypeInfo(selfType).as<ClassTypeInfo>(); auto &layout = selfTI.getClassLayout(IGM, selfType, /*forBackwardDeployment=*/false); return layout.doesMetadataRequireInitialization(); } bool irgen::hasKnownSwiftMetadata(IRGenModule &IGM, CanType type) { // This needs to be kept up-to-date with getIsaEncodingForType. if (ClassDecl *theClass = type.getClassOrBoundGenericClass()) { return hasKnownSwiftMetadata(IGM, theClass); } if (auto archetype = dyn_cast<ArchetypeType>(type)) { if (auto superclass = archetype->getSuperclass()) { return hasKnownSwiftMetadata(IGM, superclass->getCanonicalType()); } } // Class existentials, etc. return false; } /// Is the given class known to have Swift-compatible metadata? bool irgen::hasKnownSwiftMetadata(IRGenModule &IGM, ClassDecl *theClass) { // For now, the fact that a declaration was not implemented in Swift // is enough to conclusively force us into a slower path. // Eventually we might have an attribute here or something based on // the deployment target. return theClass->hasKnownSwiftImplementation(); } std::pair<llvm::Value *, llvm::Value *> irgen::emitClassResilientInstanceSizeAndAlignMask(IRGenFunction &IGF, ClassDecl *theClass, llvm::Value *metadata) { auto &layout = IGF.IGM.getClassMetadataLayout(theClass); Address metadataAsBytes(IGF.Builder.CreateBitCast(metadata, IGF.IGM.Int8PtrTy), IGF.IGM.getPointerAlignment()); Address slot = IGF.Builder.CreateConstByteArrayGEP( metadataAsBytes, layout.getInstanceSizeOffset()); slot = IGF.Builder.CreateBitCast(slot, IGF.IGM.Int32Ty->getPointerTo()); llvm::Value *size = IGF.Builder.CreateLoad(slot); if (IGF.IGM.SizeTy != IGF.IGM.Int32Ty) size = IGF.Builder.CreateZExt(size, IGF.IGM.SizeTy); slot = IGF.Builder.CreateConstByteArrayGEP( metadataAsBytes, layout.getInstanceAlignMaskOffset()); slot = IGF.Builder.CreateBitCast(slot, IGF.IGM.Int16Ty->getPointerTo()); llvm::Value *alignMask = IGF.Builder.CreateLoad(slot); alignMask = IGF.Builder.CreateZExt(alignMask, IGF.IGM.SizeTy); return {size, alignMask}; } FunctionPointer irgen::emitVirtualMethodValue(IRGenFunction &IGF, llvm::Value *metadata, SILDeclRef method, CanSILFunctionType methodType) { Signature signature = IGF.IGM.getSignature(methodType); auto classDecl = cast<ClassDecl>(method.getDecl()->getDeclContext()); // Find the vtable entry we're interested in. auto methodInfo = IGF.IGM.getClassMetadataLayout(classDecl).getMethodInfo(IGF, method); auto offset = methodInfo.getOffset(); auto slot = IGF.emitAddressAtOffset(metadata, offset, signature.getType()->getPointerTo(), IGF.IGM.getPointerAlignment()); auto fnPtr = IGF.emitInvariantLoad(slot); return FunctionPointer(fnPtr, signature); } FunctionPointer irgen::emitVirtualMethodValue(IRGenFunction &IGF, llvm::Value *base, SILType baseType, SILDeclRef method, CanSILFunctionType methodType, bool useSuperVTable) { // Find the metadata. llvm::Value *metadata; if (useSuperVTable) { // For a non-resilient 'super' call, emit a reference to the superclass // of the static type of the 'self' value. auto instanceTy = baseType.getASTType()->getMetatypeInstanceType(); auto superTy = instanceTy->getSuperclass(); metadata = emitClassHeapMetadataRef(IGF, superTy->getCanonicalType(), MetadataValueType::TypeMetadata, MetadataState::Complete); } else { if (baseType.is<MetatypeType>()) { // For a static method call, the 'self' value is already a class metadata. metadata = base; } else { // Otherwise, load the class metadata from the 'self' value's isa pointer. metadata = emitHeapMetadataRefForHeapObject(IGF, base, baseType, /*suppress cast*/ true); } } return emitVirtualMethodValue(IGF, metadata, method, methodType); }
{ "content_hash": "3bc35667d00eecbb51a6c81d6ccfde5c", "timestamp": "", "source": "github", "line_count": 2371, "max_line_length": 83, "avg_line_length": 38.74441164065795, "alnum_prop": 0.6271186440677966, "repo_name": "brentdax/swift", "id": "1cb31ad9e745bd72589625c5dfa791f1f5f8b870", "size": "91863", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/IRGen/GenClass.cpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "34" }, { "name": "C", "bytes": "205124" }, { "name": "C++", "bytes": "30580826" }, { "name": "CMake", "bytes": "468248" }, { "name": "D", "bytes": "1107" }, { "name": "DTrace", "bytes": "2438" }, { "name": "Emacs Lisp", "bytes": "57210" }, { "name": "LLVM", "bytes": "70800" }, { "name": "Makefile", "bytes": "1841" }, { "name": "Objective-C", "bytes": "382820" }, { "name": "Objective-C++", "bytes": "243321" }, { "name": "Perl", "bytes": "2211" }, { "name": "Python", "bytes": "1333445" }, { "name": "Ruby", "bytes": "2091" }, { "name": "Shell", "bytes": "212537" }, { "name": "Swift", "bytes": "25158306" }, { "name": "Vim script", "bytes": "16250" } ], "symlink_target": "" }
layout: page title: "William Everett Piper" comments: true description: "blanks" keywords: "William Everett Piper,CU,Boulder" --- <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script src="https://dl.dropboxusercontent.com/s/pc42nxpaw1ea4o9/highcharts.js?dl=0"></script> <!-- <script src="../assets/js/highcharts.js"></script> --> <style type="text/css">@font-face { font-family: "Bebas Neue"; src: url(https://www.filehosting.org/file/details/544349/BebasNeue Regular.otf) format("opentype"); } h1.Bebas { font-family: "Bebas Neue", Verdana, Tahoma; } </style> </head> #### TEACHING INFORMATION **College**: College of Arts and Sciences **Classes taught**: ARSC 1710, ARSC 1720, MATH 1011, MATH 1021, MATH 1150, MATH 1300 #### ARSC 1710: SASC Coseminar: Mathematics **Terms taught**: Fall 2009, Spring 2010, Fall 2010, Spring 2013, Fall 2013, Spring 2014, Fall 2014, Spring 2015 **Instructor rating**: 4.8 **Standard deviation in instructor rating**: 0.85 **Average grade** (4.0 scale): 3.54 **Standard deviation in grades** (4.0 scale): 0.26 **Average workload** (raw): 2.36 **Standard deviation in workload** (raw): 0.25 #### ARSC 1720: SASC Coseminar: Calculus Work Group **Terms taught**: Fall 2011, Spring 2012, Fall 2012 **Instructor rating**: 5.45 **Standard deviation in instructor rating**: 0.18 **Average grade** (4.0 scale): 3.89 **Standard deviation in grades** (4.0 scale): 0.08 **Average workload** (raw): 3.68 **Standard deviation in workload** (raw): 1.09 #### MATH 1011: Fundamentals and Techniques of College Algebra **Terms taught**: Spring 2011 **Instructor rating**: 5.0 **Standard deviation in instructor rating**: 0.0 **Average grade** (4.0 scale): 2.55 **Standard deviation in grades** (4.0 scale): 0.0 **Average workload** (raw): 3.86 **Standard deviation in workload** (raw): 0.0 #### MATH 1021: College Trigonometry **Terms taught**: Spring 2016, Fall 2016 **Instructor rating**: 4.95 **Standard deviation in instructor rating**: 0.05 **Average grade** (4.0 scale): 3.23 **Standard deviation in grades** (4.0 scale): 0.1 **Average workload** (raw): 3.54 **Standard deviation in workload** (raw): 0.04 #### MATH 1150: Precalculus Mathematics **Terms taught**: Spring 2013, Fall 2013, Spring 2014, Fall 2014, Spring 2015 **Instructor rating**: 4.5 **Standard deviation in instructor rating**: 1.2 **Average grade** (4.0 scale): 2.36 **Standard deviation in grades** (4.0 scale): 0.41 **Average workload** (raw): 4.45 **Standard deviation in workload** (raw): 0.46 #### MATH 1300: Calculus 1 **Terms taught**: Fall 2011, Spring 2012, Fall 2012 **Instructor rating**: 5.78 **Standard deviation in instructor rating**: 0.05 **Average grade** (4.0 scale): 2.92 **Standard deviation in grades** (4.0 scale): 0.06 **Average workload** (raw): 4.94 **Standard deviation in workload** (raw): 0.34
{ "content_hash": "5cd7f447155abe1d6d3e015182461a26", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 112, "avg_line_length": 24.008196721311474, "alnum_prop": 0.6876066917036531, "repo_name": "nikhilrajaram/nikhilrajaram.github.io", "id": "8e831901aee5c0ec23da278550527677d57d3865", "size": "2933", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "instructors/William_Everett_Piper.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "15727" }, { "name": "HTML", "bytes": "48339721" }, { "name": "Python", "bytes": "9692" }, { "name": "Ruby", "bytes": "5940" } ], "symlink_target": "" }
require 'test_helper' class RecommnedsControllerTest < ActionController::TestCase test "should get show" do get :show assert_response :success end end
{ "content_hash": "fbd6486bfeb7478fc0388b885c361eb6", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 59, "avg_line_length": 18.333333333333332, "alnum_prop": 0.7454545454545455, "repo_name": "john-smith/jubatus-hackathon", "id": "245d97e0dc8adfdebacaf4a4ff552cc59aa60d5d", "size": "165", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/controllers/recommneds_controller_test.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1041" }, { "name": "CoffeeScript", "bytes": "422" }, { "name": "JavaScript", "bytes": "664" }, { "name": "Ruby", "bytes": "20307" } ], "symlink_target": "" }
<?php namespace Ojs\JournalBundle\Entity; use Doctrine\ORM\EntityRepository; /** * LangRepository * * This class was generated by the Doctrine ORM. Add your own custom * repository methods below. */ class LangRepository extends EntityRepository { }
{ "content_hash": "ae7ee57e58585cfa10768c139fa440b1", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 68, "avg_line_length": 17.133333333333333, "alnum_prop": 0.7587548638132295, "repo_name": "zaferkanbur/ojs", "id": "33e1a2c59ed5f3799356d59841b5b0c4f448a8a0", "size": "257", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/Ojs/JournalBundle/Entity/LangRepository.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "55359" }, { "name": "CoffeeScript", "bytes": "1080" }, { "name": "HTML", "bytes": "986475" }, { "name": "JavaScript", "bytes": "57665" }, { "name": "PHP", "bytes": "1643587" }, { "name": "XSLT", "bytes": "30085" } ], "symlink_target": "" }
var flappy_locale = {lc:{"ar":function(n){ if (n === 0) { return 'zero'; } if (n == 1) { return 'one'; } if (n == 2) { return 'two'; } if ((n % 100) >= 3 && (n % 100) <= 10 && n == Math.floor(n)) { return 'few'; } if ((n % 100) >= 11 && (n % 100) <= 99 && n == Math.floor(n)) { return 'many'; } return 'other'; },"en":function(n){return n===1?"one":"other"},"bg":function(n){return n===1?"one":"other"},"bn":function(n){return n===1?"one":"other"},"ca":function(n){return n===1?"one":"other"},"cs":function(n){ if (n == 1) { return 'one'; } if (n == 2 || n == 3 || n == 4) { return 'few'; } return 'other'; },"da":function(n){return n===1?"one":"other"},"de":function(n){return n===1?"one":"other"},"el":function(n){return n===1?"one":"other"},"es":function(n){return n===1?"one":"other"},"et":function(n){return n===1?"one":"other"},"eu":function(n){return n===1?"one":"other"},"fa":function(n){return "other"},"fi":function(n){return n===1?"one":"other"},"fil":function(n){return n===0||n==1?"one":"other"},"fr":function(n){return Math.floor(n)===0||Math.floor(n)==1?"one":"other"},"ga":function(n){return n==1?"one":(n==2?"two":"other")},"gl":function(n){return n===1?"one":"other"},"he":function(n){return n===1?"one":"other"},"hi":function(n){return n===0||n==1?"one":"other"},"hr":function(n){ if ((n % 10) == 1 && (n % 100) != 11) { return 'one'; } if ((n % 10) >= 2 && (n % 10) <= 4 && ((n % 100) < 12 || (n % 100) > 14) && n == Math.floor(n)) { return 'few'; } if ((n % 10) === 0 || ((n % 10) >= 5 && (n % 10) <= 9) || ((n % 100) >= 11 && (n % 100) <= 14) && n == Math.floor(n)) { return 'many'; } return 'other'; },"hu":function(n){return "other"},"id":function(n){return "other"},"is":function(n){ return ((n%10) === 1 && (n%100) !== 11) ? 'one' : 'other'; },"it":function(n){return n===1?"one":"other"},"ja":function(n){return "other"},"ko":function(n){return "other"},"lt":function(n){ if ((n % 10) == 1 && ((n % 100) < 11 || (n % 100) > 19)) { return 'one'; } if ((n % 10) >= 2 && (n % 10) <= 9 && ((n % 100) < 11 || (n % 100) > 19) && n == Math.floor(n)) { return 'few'; } return 'other'; },"lv":function(n){ if (n === 0) { return 'zero'; } if ((n % 10) == 1 && (n % 100) != 11) { return 'one'; } return 'other'; },"mk":function(n){return (n%10)==1&&n!=11?"one":"other"},"mr":function(n){return n===1?"one":"other"},"ms":function(n){return "other"},"mt":function(n){ if (n == 1) { return 'one'; } if (n === 0 || ((n % 100) >= 2 && (n % 100) <= 4 && n == Math.floor(n))) { return 'few'; } if ((n % 100) >= 11 && (n % 100) <= 19 && n == Math.floor(n)) { return 'many'; } return 'other'; },"nl":function(n){return n===1?"one":"other"},"no":function(n){return n===1?"one":"other"},"pl":function(n){ if (n == 1) { return 'one'; } if ((n % 10) >= 2 && (n % 10) <= 4 && ((n % 100) < 12 || (n % 100) > 14) && n == Math.floor(n)) { return 'few'; } if ((n % 10) === 0 || n != 1 && (n % 10) == 1 || ((n % 10) >= 5 && (n % 10) <= 9 || (n % 100) >= 12 && (n % 100) <= 14) && n == Math.floor(n)) { return 'many'; } return 'other'; },"pt":function(n){return n===1?"one":"other"},"ro":function(n){ if (n == 1) { return 'one'; } if (n === 0 || n != 1 && (n % 100) >= 1 && (n % 100) <= 19 && n == Math.floor(n)) { return 'few'; } return 'other'; },"ru":function(n){ if ((n % 10) == 1 && (n % 100) != 11) { return 'one'; } if ((n % 10) >= 2 && (n % 10) <= 4 && ((n % 100) < 12 || (n % 100) > 14) && n == Math.floor(n)) { return 'few'; } if ((n % 10) === 0 || ((n % 10) >= 5 && (n % 10) <= 9) || ((n % 100) >= 11 && (n % 100) <= 14) && n == Math.floor(n)) { return 'many'; } return 'other'; },"sk":function(n){ if (n == 1) { return 'one'; } if (n == 2 || n == 3 || n == 4) { return 'few'; } return 'other'; },"sl":function(n){ if ((n % 100) == 1) { return 'one'; } if ((n % 100) == 2) { return 'two'; } if ((n % 100) == 3 || (n % 100) == 4) { return 'few'; } return 'other'; },"sq":function(n){return n===1?"one":"other"},"sr":function(n){ if ((n % 10) == 1 && (n % 100) != 11) { return 'one'; } if ((n % 10) >= 2 && (n % 10) <= 4 && ((n % 100) < 12 || (n % 100) > 14) && n == Math.floor(n)) { return 'few'; } if ((n % 10) === 0 || ((n % 10) >= 5 && (n % 10) <= 9) || ((n % 100) >= 11 && (n % 100) <= 14) && n == Math.floor(n)) { return 'many'; } return 'other'; },"sv":function(n){return n===1?"one":"other"},"ta":function(n){return n===1?"one":"other"},"th":function(n){return "other"},"tr":function(n){return n===1?"one":"other"},"uk":function(n){ if ((n % 10) == 1 && (n % 100) != 11) { return 'one'; } if ((n % 10) >= 2 && (n % 10) <= 4 && ((n % 100) < 12 || (n % 100) > 14) && n == Math.floor(n)) { return 'few'; } if ((n % 10) === 0 || ((n % 10) >= 5 && (n % 10) <= 9) || ((n % 100) >= 11 && (n % 100) <= 14) && n == Math.floor(n)) { return 'many'; } return 'other'; },"ur":function(n){return n===1?"one":"other"},"vi":function(n){return "other"},"zh":function(n){return "other"}}, c:function(d,k){if(!d)throw new Error("MessageFormat: Data required for '"+k+"'.")}, n:function(d,k,o){if(isNaN(d[k]))throw new Error("MessageFormat: '"+k+"' isn't a number.");return d[k]-(o||0)}, v:function(d,k){flappy_locale.c(d,k);return d[k]}, p:function(d,k,o,l,p){flappy_locale.c(d,k);return d[k] in p?p[d[k]]:(k=flappy_locale.lc[l](d[k]-o),k in p?p[k]:p.other)}, s:function(d,k,p){flappy_locale.c(d,k);return d[k] in p?p[d[k]]:p.other}}; (window.blockly = window.blockly || {}).flappy_locale = { "continue":function(d){return "Continue"}, "doCode":function(d){return "do"}, "elseCode":function(d){return "else"}, "endGame":function(d){return "یارییەکە تەواو بکە"}, "endGameTooltip":function(d){return "یارییەکە تەواو دەکات."}, "finalLevel":function(d){return "Congratulations! You have solved the final puzzle."}, "flap":function(d){return "بازدان"}, "flapRandom":function(d){return "بازدانی بڕێکی هەرەمەکی"}, "flapVerySmall":function(d){return "بازدانی بڕێکی زۆر کەم"}, "flapSmall":function(d){return "بازدانی بڕێکی کەم"}, "flapNormal":function(d){return "بازدانی بڕێکی ئاسایی"}, "flapLarge":function(d){return "بازدانی بڕێکی گەورە"}, "flapVeryLarge":function(d){return "بازدانی بڕێکی زۆر گەورە"}, "flapTooltip":function(d){return "فڕینی فلاپی بۆ سەرەوە."}, "flappySpecificFail":function(d){return "کۆدەکانت باش دەردەکەون - ئەوە لەگەڵ هەر کرتەیەک بازدەدات. بەڵام تۆ پێویستتە زۆر جار کرتە بکەیت بۆ ئەوەی باز بدات بۆ ئامانجەکە."}, "incrementPlayerScore":function(d){return "خاڵێک وەربگرە"}, "incrementPlayerScoreTooltip":function(d){return "خالێک بۆ خاڵەکانی یاریزانی ئێستا زیاد بکە."}, "nextLevel":function(d){return "Congratulations! You have completed this puzzle."}, "no":function(d){return "No"}, "numBlocksNeeded":function(d){return "This puzzle can be solved with %1 blocks."}, "playSoundRandom":function(d){return "دەنکێکی هەرەمەکی لێبدە"}, "playSoundBounce":function(d){return "دەنگی هەڵبەزینەوە ئیش پێ بکە"}, "playSoundCrunch":function(d){return "play crunch sound"}, "playSoundDie":function(d){return "دەنگی غەمگینی بەکار بهێنە"}, "playSoundHit":function(d){return "دەنگی شکان لێبدە"}, "playSoundPoint":function(d){return "دەنگی خاڵ لێبدە"}, "playSoundSwoosh":function(d){return "دەنگی خشەخش لێبدە"}, "playSoundWing":function(d){return "play wing sound"}, "playSoundJet":function(d){return "play jet sound"}, "playSoundCrash":function(d){return "play crash sound"}, "playSoundJingle":function(d){return "play jingle sound"}, "playSoundSplash":function(d){return "play splash sound"}, "playSoundLaser":function(d){return "play laser sound"}, "playSoundTooltip":function(d){return "Play the chosen sound."}, "reinfFeedbackMsg":function(d){return "You can press the \"Try again\" button to go back to playing your game."}, "scoreText":function(d){return "Score: "+flappy_locale.v(d,"playerScore")}, "setBackground":function(d){return "set scene"}, "setBackgroundRandom":function(d){return "set scene Random"}, "setBackgroundFlappy":function(d){return "set scene City (day)"}, "setBackgroundNight":function(d){return "set scene City (night)"}, "setBackgroundSciFi":function(d){return "set scene Sci-Fi"}, "setBackgroundUnderwater":function(d){return "set scene Underwater"}, "setBackgroundCave":function(d){return "set scene Cave"}, "setBackgroundSanta":function(d){return "set scene Santa"}, "setBackgroundTooltip":function(d){return "Sets the background image"}, "setGapRandom":function(d){return "set a random gap"}, "setGapVerySmall":function(d){return "set a very small gap"}, "setGapSmall":function(d){return "set a small gap"}, "setGapNormal":function(d){return "set a normal gap"}, "setGapLarge":function(d){return "set a large gap"}, "setGapVeryLarge":function(d){return "set a very large gap"}, "setGapHeightTooltip":function(d){return "Sets the vertical gap in an obstacle"}, "setGravityRandom":function(d){return "set gravity random"}, "setGravityVeryLow":function(d){return "set gravity very low"}, "setGravityLow":function(d){return "set gravity low"}, "setGravityNormal":function(d){return "set gravity normal"}, "setGravityHigh":function(d){return "set gravity high"}, "setGravityVeryHigh":function(d){return "set gravity very high"}, "setGravityTooltip":function(d){return "Sets the level's gravity"}, "setGround":function(d){return "set ground"}, "setGroundRandom":function(d){return "set ground Random"}, "setGroundFlappy":function(d){return "set ground Ground"}, "setGroundSciFi":function(d){return "set ground Sci-Fi"}, "setGroundUnderwater":function(d){return "set ground Underwater"}, "setGroundCave":function(d){return "set ground Cave"}, "setGroundSanta":function(d){return "set ground Santa"}, "setGroundLava":function(d){return "set ground Lava"}, "setGroundTooltip":function(d){return "Sets the ground image"}, "setObstacle":function(d){return "set obstacle"}, "setObstacleRandom":function(d){return "set obstacle Random"}, "setObstacleFlappy":function(d){return "set obstacle Pipe"}, "setObstacleSciFi":function(d){return "set obstacle Sci-Fi"}, "setObstacleUnderwater":function(d){return "set obstacle Plant"}, "setObstacleCave":function(d){return "set obstacle Cave"}, "setObstacleSanta":function(d){return "set obstacle Chimney"}, "setObstacleLaser":function(d){return "set obstacle Laser"}, "setObstacleTooltip":function(d){return "Sets the obstacle image"}, "setPlayer":function(d){return "set player"}, "setPlayerRandom":function(d){return "set player Random"}, "setPlayerFlappy":function(d){return "set player Yellow Bird"}, "setPlayerRedBird":function(d){return "set player Red Bird"}, "setPlayerSciFi":function(d){return "set player Spaceship"}, "setPlayerUnderwater":function(d){return "set player Fish"}, "setPlayerCave":function(d){return "set player Bat"}, "setPlayerSanta":function(d){return "set player Santa"}, "setPlayerShark":function(d){return "set player Shark"}, "setPlayerEaster":function(d){return "set player Easter Bunny"}, "setPlayerBatman":function(d){return "set player Bat guy"}, "setPlayerSubmarine":function(d){return "set player Submarine"}, "setPlayerUnicorn":function(d){return "set player Unicorn"}, "setPlayerFairy":function(d){return "set player Fairy"}, "setPlayerSuperman":function(d){return "set player Flappyman"}, "setPlayerTurkey":function(d){return "set player Turkey"}, "setPlayerTooltip":function(d){return "Sets the player image"}, "setScore":function(d){return "set score"}, "setScoreTooltip":function(d){return "Sets the player's score"}, "setSpeed":function(d){return "set speed"}, "setSpeedTooltip":function(d){return "Sets the level's speed"}, "shareFlappyTwitter":function(d){return "Check out the Flappy game I made. I wrote it myself with @codeorg"}, "shareGame":function(d){return "Share your game:"}, "soundRandom":function(d){return "هەڕەمەکی"}, "soundBounce":function(d){return "bounce"}, "soundCrunch":function(d){return "crunch"}, "soundDie":function(d){return "sad"}, "soundHit":function(d){return "smash"}, "soundPoint":function(d){return "point"}, "soundSwoosh":function(d){return "swoosh"}, "soundWing":function(d){return "wing"}, "soundJet":function(d){return "jet"}, "soundCrash":function(d){return "crash"}, "soundJingle":function(d){return "jingle"}, "soundSplash":function(d){return "splash"}, "soundLaser":function(d){return "laser"}, "speedRandom":function(d){return "set speed random"}, "speedVerySlow":function(d){return "set speed very slow"}, "speedSlow":function(d){return "set speed slow"}, "speedNormal":function(d){return "set speed normal"}, "speedFast":function(d){return "set speed fast"}, "speedVeryFast":function(d){return "set speed very fast"}, "whenClick":function(d){return "when click"}, "whenClickTooltip":function(d){return "Execute the actions below when a click event occurs."}, "whenCollideGround":function(d){return "when hit the ground"}, "whenCollideGroundTooltip":function(d){return "Execute the actions below when Flappy hits the ground."}, "whenCollideObstacle":function(d){return "when hit an obstacle"}, "whenCollideObstacleTooltip":function(d){return "Execute the actions below when Flappy hits an obstacle."}, "whenEnterObstacle":function(d){return "when pass obstacle"}, "whenEnterObstacleTooltip":function(d){return "Execute the actions below when Flappy enters an obstacle."}, "whenRunButtonClick":function(d){return "when game starts"}, "whenRunButtonClickTooltip":function(d){return "Execute the actions below when the game starts."}, "yes":function(d){return "Yes"}};
{ "content_hash": "7860e0805116cc856c2b360ee291b5f5", "timestamp": "", "source": "github", "line_count": 286, "max_line_length": 692, "avg_line_length": 47.90909090909091, "alnum_prop": 0.6295431323894322, "repo_name": "ty-po/code-dot-org", "id": "cd42de98179157d02fccd7fd86af3857e686770e", "size": "14133", "binary": false, "copies": "1", "ref": "refs/heads/staging", "path": "dashboard/public/apps-package/js/ku_iq/flappy_locale-57ed65433c757fea3be50ca9d34d1113.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ApacheConf", "bytes": "93" }, { "name": "C++", "bytes": "4844" }, { "name": "CSS", "bytes": "2230244" }, { "name": "Cucumber", "bytes": "69858" }, { "name": "Emacs Lisp", "bytes": "2410" }, { "name": "HTML", "bytes": "9321123" }, { "name": "JavaScript", "bytes": "62536737" }, { "name": "PHP", "bytes": "2303483" }, { "name": "Perl", "bytes": "461" }, { "name": "Processing", "bytes": "11068" }, { "name": "Prolog", "bytes": "679" }, { "name": "Python", "bytes": "124866" }, { "name": "Racket", "bytes": "131852" }, { "name": "Ruby", "bytes": "1356290" }, { "name": "Shell", "bytes": "17795" }, { "name": "SourcePawn", "bytes": "74109" } ], "symlink_target": "" }
package com.airbnb.epoxy; import android.content.Context; import java.util.Arrays; import androidx.annotation.Nullable; import androidx.annotation.PluralsRes; import androidx.annotation.StringRes; public class StringAttributeData { private final boolean hasDefault; @Nullable private final CharSequence defaultString; @StringRes private final int defaultStringRes; @Nullable private CharSequence string; @StringRes private int stringRes; @PluralsRes private int pluralRes; private int quantity; @Nullable private Object[] formatArgs; public StringAttributeData() { hasDefault = false; defaultString = null; defaultStringRes = 0; } public StringAttributeData(@Nullable CharSequence defaultString) { hasDefault = true; this.defaultString = defaultString; string = defaultString; defaultStringRes = 0; } public StringAttributeData(@StringRes int defaultStringRes) { hasDefault = true; this.defaultStringRes = defaultStringRes; stringRes = defaultStringRes; defaultString = null; } public void setValue(@Nullable CharSequence string) { this.string = string; stringRes = 0; pluralRes = 0; } public void setValue(@StringRes int stringRes) { setValue(stringRes, null); } public void setValue(@StringRes int stringRes, @Nullable Object[] formatArgs) { if (stringRes != 0) { this.stringRes = stringRes; this.formatArgs = formatArgs; string = null; pluralRes = 0; } else { handleInvalidStringRes(); } } private void handleInvalidStringRes() { if (hasDefault) { if (defaultStringRes != 0) { setValue(defaultStringRes); } else { setValue(defaultString); } } else { throw new IllegalArgumentException("0 is an invalid value for required strings."); } } public void setValue(@PluralsRes int pluralRes, int quantity, @Nullable Object[] formatArgs) { if (pluralRes != 0) { this.pluralRes = pluralRes; this.quantity = quantity; this.formatArgs = formatArgs; string = null; stringRes = 0; } else { handleInvalidStringRes(); } } public CharSequence toString(Context context) { if (pluralRes != 0) { if (formatArgs != null) { return context.getResources().getQuantityString(pluralRes, quantity, formatArgs); } else { return context.getResources().getQuantityString(pluralRes, quantity); } } else if (stringRes != 0) { if (formatArgs != null) { return context.getResources().getString(stringRes, formatArgs); } else { return context.getResources().getText(stringRes); } } else { return string; } } @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof StringAttributeData)) { return false; } StringAttributeData that = (StringAttributeData) o; if (stringRes != that.stringRes) { return false; } if (pluralRes != that.pluralRes) { return false; } if (quantity != that.quantity) { return false; } if (string != null ? !string.equals(that.string) : that.string != null) { return false; } return Arrays.equals(formatArgs, that.formatArgs); } @Override public int hashCode() { int result = string != null ? string.hashCode() : 0; result = 31 * result + stringRes; result = 31 * result + pluralRes; result = 31 * result + quantity; result = 31 * result + Arrays.hashCode(formatArgs); return result; } }
{ "content_hash": "24d1dad4da4d06218f0353e98fe08368", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 96, "avg_line_length": 25.588652482269502, "alnum_prop": 0.654379157427938, "repo_name": "airbnb/epoxy", "id": "d3c7379f137b495d5f6ae0e207ee54e0d5678ac8", "size": "3608", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "epoxy-adapter/src/main/java/com/airbnb/epoxy/StringAttributeData.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "2695" }, { "name": "HTML", "bytes": "2958" }, { "name": "Java", "bytes": "3068867" }, { "name": "JavaScript", "bytes": "5252" }, { "name": "Kotlin", "bytes": "1111468" } ], "symlink_target": "" }
package com.djs.learn.spring_sample; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import com.djs.learn.spring_sample.greeting.GreetingService; import com.djs.learn.spring_sample.knightI.Knight; public class AppMain { public static void main(String[] args) throws Exception{ // Notes: AOP doesn't work while using XmlBeanFactory! // BeanFactory factory = new XmlBeanFactory( new FileSystemResource( "application-context.xml" ) ); // BeanFactory factory = new XmlBeanFactory( new ClassPathResource( "application-context.xml" ) ); ApplicationContext appContext = new ClassPathXmlApplicationContext( new String[]{"spring_config/sample/greeting.xml", "spring_config/sample/knight.xml", "spring_config/sample/music.xml"}); GreetingService greetingService = (GreetingService)appContext.getBean("greetingService"); greetingService.sayGreeting(); Knight knightA = (Knight)appContext.getBean("knightA"); knightA.embarkOnQuest(); Knight knightB = (Knight)appContext.getBean("knightB"); knightB.embarkOnQuest(); } }
{ "content_hash": "20c62d34d0ae091a881ea44bb557273c", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 130, "avg_line_length": 40.285714285714285, "alnum_prop": 0.7801418439716312, "repo_name": "djsilenceboy/LearnTest", "id": "50c3ce8e400ae450b8abfff8765180e26a9c9f98", "size": "1129", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Java_Test/AppSpringSample1/src/main/java/com/djs/learn/spring_sample/AppMain.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "27588" }, { "name": "C", "bytes": "201487" }, { "name": "C++", "bytes": "9459" }, { "name": "CSS", "bytes": "6049" }, { "name": "Dockerfile", "bytes": "5976" }, { "name": "HTML", "bytes": "89155" }, { "name": "Java", "bytes": "3304194" }, { "name": "JavaScript", "bytes": "73886" }, { "name": "Jinja", "bytes": "1150" }, { "name": "PHP", "bytes": "21180" }, { "name": "PLSQL", "bytes": "2080" }, { "name": "PowerShell", "bytes": "19723" }, { "name": "Python", "bytes": "551890" }, { "name": "Ruby", "bytes": "16460" }, { "name": "Shell", "bytes": "142970" }, { "name": "TypeScript", "bytes": "6986" }, { "name": "XSLT", "bytes": "1860" } ], "symlink_target": "" }
namespace Stripe { using Newtonsoft.Json; public class InvoiceRenderingOptionsOptions : INestedOptions { /// <summary> /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. /// One of <c>exclude_tax</c> or <c>include_inclusive_tax</c>. <c>include_inclusive_tax</c> /// will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. /// <c>exclude_tax</c> will exclude all tax (inclusive and exclusive alike) from invoice PDF /// amounts. /// </summary> [JsonProperty("amount_tax_display")] public string AmountTaxDisplay { get; set; } } }
{ "content_hash": "5bcc8426a64e3776e85317498df3e56e", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 100, "avg_line_length": 40.11764705882353, "alnum_prop": 0.6407624633431085, "repo_name": "stripe/stripe-dotnet", "id": "9e90c91047b983df72ffb8aac50d0faae419a531", "size": "722", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Stripe.net/Services/Invoices/InvoiceRenderingOptionsOptions.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "4098084" }, { "name": "Makefile", "bytes": "261" } ], "symlink_target": "" }
<?php declare(strict_types=1); namespace Soluble\Japha\Bridge\Exception; class UnsupportedDriverException extends \InvalidArgumentException implements ExceptionInterface { }
{ "content_hash": "d6bbbeb1d8b252b217bcc77189cfac9c", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 96, "avg_line_length": 16.272727272727273, "alnum_prop": 0.8268156424581006, "repo_name": "belgattitude/soluble-japha", "id": "d4ccdbc0bfaeb7df4c67a785864aedda73cf8f02", "size": "420", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Soluble/Japha/Bridge/Exception/UnsupportedDriverException.php", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "1295" }, { "name": "PHP", "bytes": "452500" }, { "name": "Shell", "bytes": "2343" } ], "symlink_target": "" }
namespace net { class HttpChunkedDecoder; namespace test_server { // Methods of HTTP requests supported by the test HTTP server. enum HttpMethod { METHOD_UNKNOWN, METHOD_GET, METHOD_HEAD, METHOD_POST, METHOD_PUT, METHOD_DELETE, METHOD_PATCH, METHOD_CONNECT, METHOD_OPTIONS, }; // Represents a HTTP request. Since it can be big, `use std::unique_ptr` to pass // it instead of copying. However, the struct is copyable so tests can save and // examine a HTTP request. struct HttpRequest { struct CaseInsensitiveStringComparator { // Allow using StringPiece instead of string for `find()`. using is_transparent = void; bool operator()(base::StringPiece left, base::StringPiece right) const { return base::CompareCaseInsensitiveASCII(left, right) < 0; } }; using HeaderMap = std::map<std::string, std::string, CaseInsensitiveStringComparator>; HttpRequest(); HttpRequest(const HttpRequest& other); ~HttpRequest(); // Returns a GURL as a convenience to extract the path and query strings. GURL GetURL() const; // The request target. For most methods, this will start with '/', e.g., // "/test?query=foo". If `method` is `METHOD_OPTIONS`, it may also be "*". If // `method` is `METHOD_CONNECT`, it will instead be a string like // "example.com:443". std::string relative_url; GURL base_url; // The HTTP method. If unknown, this will be `METHOD_UNKNOWN` and the actual // method will be in `method_string`. HttpMethod method = METHOD_UNKNOWN; std::string method_string; std::string all_headers; HeaderMap headers; std::string content; bool has_content = false; absl::optional<SSLInfo> ssl_info; }; // Parses the input data and produces a valid HttpRequest object. If there is // more than one request in one chunk, then only the first one will be parsed. // The common use is as below: // HttpRequestParser parser; // (...) // void OnDataChunkReceived(Socket* socket, const char* data, int size) { // parser.ProcessChunk(std::string(data, size)); // if (parser.ParseRequest() == HttpRequestParser::ACCEPTED) { // std::unique_ptr<HttpRequest> request = parser.GetRequest(); // (... process the request ...) // } class HttpRequestParser { public: // Parsing result. enum ParseResult { WAITING, // A request is not completed yet, waiting for more data. ACCEPTED, // A request has been parsed and it is ready to be processed. }; // Parser state. enum State { STATE_HEADERS, // Waiting for a request headers. STATE_CONTENT, // Waiting for content data. STATE_ACCEPTED, // Request has been parsed. }; HttpRequestParser(); HttpRequestParser(const HttpRequestParser&) = delete; HttpRequestParser& operator=(const HttpRequestParser&) = delete; ~HttpRequestParser(); // Adds chunk of data into the internal buffer. void ProcessChunk(base::StringPiece data); // Parses the http request (including data - if provided). // If returns ACCEPTED, then it means that the whole request has been found // in the internal buffer (and parsed). After calling GetRequest(), it will be // ready to parse another request. ParseResult ParseRequest(); // Retrieves parsed request. Can be only called, when the parser is in // STATE_ACCEPTED state. After calling it, the parser is ready to parse // another request. std::unique_ptr<HttpRequest> GetRequest(); // Returns `METHOD_UNKNOWN` if `token` is not a recognized method. Methods are // case-sensitive. static HttpMethod GetMethodType(base::StringPiece token); private: // Parses headers and returns ACCEPTED if whole request was parsed. Otherwise // returns WAITING. ParseResult ParseHeaders(); // Parses request's content data and returns ACCEPTED if all of it have been // processed. Chunked Transfer Encoding is supported. ParseResult ParseContent(); // Fetches the next line from the buffer. Result does not contain \r\n. // Returns an empty string for an empty line. It will assert if there is // no line available. std::string ShiftLine(); std::unique_ptr<HttpRequest> http_request_; std::string buffer_; size_t buffer_position_ = 0; // Current position in the internal buffer. State state_ = STATE_HEADERS; // Content length of the request currently being parsed. size_t declared_content_length_ = 0; std::unique_ptr<HttpChunkedDecoder> chunked_decoder_; }; } // namespace test_server } // namespace net #endif // NET_TEST_EMBEDDED_TEST_SERVER_HTTP_REQUEST_H_
{ "content_hash": "e37ba9deaf0301a0e84d8fcda1bda416", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 80, "avg_line_length": 32.82608695652174, "alnum_prop": 0.7088300220750552, "repo_name": "chromium/chromium", "id": "de142120d5a6dcfbf5506fe24f80169b38f2696d", "size": "5042", "binary": false, "copies": "6", "ref": "refs/heads/main", "path": "net/test/embedded_test_server/http_request.h", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
param([String]$target="release", [String]$crosswalk="true") #Must be the first statement in your script Function LogMessage { param( [string]$message) $now = Get-Date -Format "dd/MM/yyyy hh:mm:ss" Write-Host $now --- $message } # Take start time if ($crosswalk -eq "true") { LogMessage "Building $target with Crosswalk" } else { LogMessage "Building $target without Crosswalk" } $startTime = Get-Date LogMessage "Started" # stop on error $ErrorActionPreference = "Stop" $root = "c:\dev\topteamer2" $androidPlatform = $root + "\platforms\android" $androidPlatformResources = $root + "\platforms\android\res" $androidPlatformBuild = $androidPlatform + "\build\outputs\apk" $appBuildAndroidResources = $root + "\build\android\resources" $appBuildAndroidApks = $root + "\build\android\apks\" + $target $plugins = $root + "\plugins" LogMessage "Deleting previous build files..." # delete * signing.properties from android platform If (Test-Path "$androidPlatform\debug-signing.properties") { Remove-Item "$androidPlatform\debug-signing.properties" } # delete * signing.properties from android platform If (Test-Path "$androidPlatform\release-signing.properties") { Remove-Item "$androidPlatform\release-signing.properties" } # delete apk's If (Test-Path "$androidPlatformBuild\*$target*.apk") { Remove-Item "$androidPlatformBuild\*$target*.apk" } If (Test-Path "$appBuildAndroidApks\*$target*.apk") { Remove-Item "$appBuildAndroidApks\*$target*.apk" } LogMessage "Copying resources..." # copy signing properties Copy-Item "$appBuildAndroidResources\$target-signing.properties" "$androidPlatform\$target-signing.properties" # copy resources Copy-Item -Force "$appBuildAndroidResources\AndroidManifest.xml" "$androidPlatform\AndroidManifest.xml" Copy-Item -Force "$appBuildAndroidResources\lint.xml" "$androidPlatform\lint.xml" Copy-Item -Recurse -Force "$appBuildAndroidResources\values\" "$androidPlatformResources\" Copy-Item -Recurse -Force "$appBuildAndroidResources\values-es\" "$androidPlatformResources\" Copy-Item -Recurse -Force "$appBuildAndroidResources\values-he\" "$androidPlatformResources\" Copy-Item -Recurse -Force "$appBuildAndroidResources\values-iw\" "$androidPlatformResources\" Copy-Item -Recurse -Force "$appBuildAndroidResources\drawable-hdpi\" "$androidPlatformResources\" Copy-Item -Recurse -Force "$appBuildAndroidResources\drawable-ldpi\" "$androidPlatformResources\" Copy-Item -Recurse -Force "$appBuildAndroidResources\drawable-mdpi\" "$androidPlatformResources\" Copy-Item -Recurse -Force "$appBuildAndroidResources\drawable-xhdpi\" "$androidPlatformResources\" Copy-Item -Recurse -Force "$appBuildAndroidResources\drawable-xxhdpi\" "$androidPlatformResources\" Copy-Item -Recurse -Force "$appBuildAndroidResources\drawable-xxxhdpi\" "$androidPlatformResources\" # add crosswalk if needed if ($crosswalk -eq "true") { if (-Not (Test-Path "$plugins\cordova-plugin-crosswalk-webview")) { LogMessage "Installing Crosswalk..." cordova plugin add cordova-plugin-crosswalk-webview } # build android app with crosswalk LogMessage "Starting ionic build for crosswalk..." Invoke-Command -ScriptBlock {ionic build android --$target} # check if apk created if (-Not (Test-Path "$androidPlatformBuild\android-armv7-$target.apk")) { exit } # check if apk created if (-Not (Test-Path "$androidPlatformBuild\android-x86-$target.apk")) { exit } # remove crosswalk -- LogMessage "Removing Crosswalk..." cordova plugin remove cordova-plugin-crosswalk-webview } # build android app without crosswalk LogMessage "Starting standard ionic build (without crosswalk)..." Invoke-Command -ScriptBlock {ionic build android --$target -- --minSdkVersion=21} # check if apk created if (-Not (Test-Path "$androidPlatformBuild\android-$target.apk")) { exit } # copy apk's to our download folder LogMessage "Copying apks to app output folder..." if ($crosswalk -eq "true") { Copy-Item "$androidPlatformBuild\android-armv7-$target.apk" "$appBuildAndroidApks\topteamer-armv7-$target.apk" Copy-Item "$androidPlatformBuild\android-x86-$target.apk" "$appBuildAndroidApks\topteamer-x86-$target.apk" } Copy-Item "$androidPlatformBuild\android-$target.apk" "$appBuildAndroidApks\topteamer-$target.apk" # writing end time and time span $endTime = Get-Date $timeSpan = (New-TimeSpan -Start $startTime -End $endTime).TotalMinutes LogMessage "Finished within $timeSpan minutes" exit
{ "content_hash": "7c42ada4748320b37009b9dbbd4508d1", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 112, "avg_line_length": 37.39495798319328, "alnum_prop": 0.76, "repo_name": "efishman15/topteamer2", "id": "83be6292cf00da4958754cf640ec5b4aba1694bd", "size": "4450", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "build/build.ps1", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "220" }, { "name": "CSS", "bytes": "857988" }, { "name": "HTML", "bytes": "101794" }, { "name": "JavaScript", "bytes": "4604411" }, { "name": "PowerShell", "bytes": "4450" }, { "name": "TypeScript", "bytes": "231795" } ], "symlink_target": "" }
var should = require('should'); var assert = require('assert'); var muk = require('muk'); var path = require('path'); var fs = require('fs'); var EventEmitter = require('events').EventEmitter; var Socket = require('net').Socket; var IncomingMessage = require('http').IncomingMessage; global.APP_PATH = path.normalize(__dirname + '/../../App'); global.RESOURCE_PATH = path.normalize(__dirname + '/../../www') process.execArgv.push('--no-app'); require(path.normalize(__dirname + '/../../../index.js')); var Http = thinkRequire('Http'); describe('Http', function(){ describe('getDefaultHttp', function(){ it('empty data', function(){ var data = Http.getDefaultHttp(); var empty = Http.empty; assert.deepEqual(data, {"req":{"httpVersion":"1.1","method":"GET","url":"/","headers":{"host":"127.0.0.1"},"connection":{"remoteAddress":"127.0.0.1"}},"res":{"end": empty,"write": empty,"setHeader": empty}}) }) it('url data', function(){ var data = Http.getDefaultHttp('index/index'); var empty = Http.empty; assert.deepEqual(data, {"req":{"httpVersion":"1.1","method":"GET","url":"/index/index","headers":{"host":"127.0.0.1"},"connection":{"remoteAddress":"127.0.0.1"}},"res":{"end": empty,"write": empty,"setHeader": empty}}) }) it('url data 1', function(){ var data = Http.getDefaultHttp('/index/index'); var empty = Http.empty; assert.deepEqual(data, {"req":{"httpVersion":"1.1","method":"GET","url":"/index/index","headers":{"host":"127.0.0.1"},"connection":{"remoteAddress":"127.0.0.1"}},"res":{"end": empty,"write": empty,"setHeader": empty}}) }) it('query string', function(){ var data = Http.getDefaultHttp('url=/index/index&method=cmd'); var empty = Http.empty; assert.deepEqual(data, {"req":{"httpVersion":"1.1","method":"CMD","url":"/index/index","headers":{"host":"127.0.0.1"},"connection":{"remoteAddress":"127.0.0.1"}},"res":{"end": empty,"write": empty,"setHeader": empty}}) }) it('query string, host', function(){ var data = Http.getDefaultHttp('url=/index/index&method=cmd&host=www.welefen.com'); var empty = Http.empty; assert.deepEqual(data, {"req":{"httpVersion":"1.1","method":"CMD","url":"/index/index","headers":{"host":"www.welefen.com"},"connection":{"remoteAddress":"127.0.0.1"}},"res":{"end": empty,"write": empty,"setHeader": empty}}) }) it('query string, ip', function(){ var data = Http.getDefaultHttp('url=/index/index&method=cmd&host=www.welefen.com&ip=10.0.0.1'); var empty = Http.empty; assert.deepEqual(data, {"req":{"httpVersion":"1.1","method":"CMD","url":"/index/index","headers":{"host":"www.welefen.com"},"connection":{"remoteAddress":"10.0.0.1"}},"res":{"end": empty,"write": empty,"setHeader": empty}}) }) it('json string', function(){ var data = Http.getDefaultHttp('{"method": "cmd", "url": "index/index"}'); var empty = Http.empty; assert.deepEqual(data, {"req":{"httpVersion":"1.1","method":"CMD","url":"/index/index","headers":{"host":"127.0.0.1"},"connection":{"remoteAddress":"127.0.0.1"}},"res":{"end": empty,"write": empty,"setHeader": empty}}) }) it('json string,headers', function(){ var data = Http.getDefaultHttp('{"method": "cmd", "url": "index/index", "headers": {"user-agent": "chrome"}}'); var empty = Http.empty; assert.deepEqual(data, {"req":{"httpVersion":"1.1","method":"CMD","url":"/index/index","headers":{"host":"127.0.0.1", "user-agent": "chrome"},"connection":{"remoteAddress":"127.0.0.1"}},"res":{"end": empty,"write": empty,"setHeader": empty}}) }) }) describe('empty', function(){ it('empty', function(){ assert.deepEqual(Http.empty("welefen"), "welefen") }) }) describe('HTTP GET', function(){ var defaultHttp = Http.getDefaultHttp('/index/index?name=welefen'); it('is EventEmitter instance', function(done){ Http(defaultHttp.req, defaultHttp.res).run().then(function(http){ assert.equal(http instanceof EventEmitter, true); done(); }) }) it('get, query', function(done){ Http(defaultHttp.req, defaultHttp.res).run().then(function(http){ assert.deepEqual(http.get, { name: 'welefen' }); // assert.deepEqual(http.headers, { host: '127.0.0.1' }); done(); }) }) it('headers', function(done){ Http(defaultHttp.req, defaultHttp.res).run().then(function(http){ //assert.deepEqual(http.get, { name: 'welefen' }); assert.deepEqual(http.headers, { host: '127.0.0.1' }); done(); }) }) it('getHeader', function(done){ Http(defaultHttp.req, defaultHttp.res).run().then(function(http){ //assert.deepEqual(http.get, { name: 'welefen' }); assert.deepEqual(http.getHeader('user-agent'), ''); done(); }) }) it('ip', function(done){ Http(defaultHttp.req, defaultHttp.res).run().then(function(http){ http.host = '127.0.0.1:8360'; C('use_proxy', false); //assert.deepEqual(http.get, { name: 'welefen' }); assert.deepEqual(http.ip(), '127.0.0.1'); done(); }) }) it('ip with socket', function(done){ Http(defaultHttp.req, defaultHttp.res).run().then(function(http){ http.host = '127.0.0.1:8360'; C('use_proxy', false); http.req.socket = {remoteAddress: '10.0.0.1'}; //console.log(http.ip()); assert.deepEqual(http.ip(), '10.0.0.1'); done(); }) }) it('ip with connection', function(done){ Http(defaultHttp.req, defaultHttp.res).run().then(function(http){ http.host = '127.0.0.1:8360'; C('use_proxy', false); http.req.connection = {remoteAddress: '10.0.0.1'}; //console.log(http.ip()); assert.deepEqual(http.ip(), '10.0.0.1'); done(); }) }) it('ip with ::', function(done){ Http(defaultHttp.req, defaultHttp.res).run().then(function(http){ http.req.connection = {remoteAddress: '::ff:10.0.0.1'}; http.host = '127.0.0.1:8360'; C('use_proxy', false); //console.log(http.ip()); assert.deepEqual(http.ip(), '10.0.0.1'); done(); }) }) it('setHeader', function(done){ Http(defaultHttp.req, defaultHttp.res).run().then(function(http){ var fn = http.res.setHeader; http.res.headersSent = false; http.res.setHeader = function(name, value){ assert.equal(name, 'name'); assert.equal(value, 'welefen'); http.res.setHeader = fn; done(); } http.setHeader('name', 'welefen'); }) }) it('setHeader, headersSent', function(done){ Http(defaultHttp.req, defaultHttp.res).run().then(function(http){ http.res.headersSent = true; http.setHeader('name', 'welefen'); done(); }) }) it('setCookie', function(done){ Http(defaultHttp.req, defaultHttp.res).run().then(function(http){ http.setCookie('name', 'welefen'); //console.log(http._cookie) assert.deepEqual(http._cookie, { name: { path: '/', domain: '', name: 'name', value: 'welefen' } }) done(); }) }) it('setCookie with timeout', function(done){ Http(defaultHttp.req, defaultHttp.res).run().then(function(http){ http.setCookie('name', 'welefen', 10000); //console.log(http._cookie) assert.equal(http._cookie.name.expires !== undefined, true); assert.equal(http._cookie.name.expires instanceof Date, true) done(); }) }) it('setCookie with timeout 1', function(done){ Http(defaultHttp.req, defaultHttp.res).run().then(function(http){ var opts = {timeout: 20000}; http.setCookie('name', 'welefen', opts); http.setCookie('name', 'welefen', opts); //console.log(http._cookie) assert.equal(http._cookie.name.expires !== undefined, true); assert.equal(http._cookie.name.timeout, 20000); assert.equal(http._cookie.name.expires instanceof Date, true) done(); }) }) it('setCookie, remove cookie', function(done){ Http(defaultHttp.req, defaultHttp.res).run().then(function(http){ http.setCookie('name', null); //console.log(http._cookie) assert.equal(http._cookie.name.expires !== undefined, true); assert.equal(http._cookie.name.expires instanceof Date, true) done(); }) }) it('setCookie, with options', function(done){ Http(defaultHttp.req, defaultHttp.res).run().then(function(http){ http.setCookie('name', 'welefen', {path: '/xxx/', Domain: 'welefen.com'}); assert.deepEqual(http._cookie, {"name":{"path":"/xxx/","domain":"welefen.com","name":"name","value":"welefen"}}) done(); }) }) it('sendCookie', function(done){ Http(defaultHttp.req, defaultHttp.res).run().then(function(http){ http.setCookie('name', 'welefen', {path: '/xxx/', Domain: 'welefen.com'}); var fn = http.res.setHeader; http.res.headersSent = false; http.res.setHeader = function(name, value){ assert.equal(name, 'Set-Cookie'); assert.deepEqual(value, [ 'name=welefen; Domain=welefen.com; Path=/xxx/' ]) assert.deepEqual(http._cookie, {"name":{"path":"/xxx/","domain":"welefen.com","name":"name","value":"welefen"}}) done(); } http.sendCookie(); }) }) it('sendCookie empty', function(done){ Http(defaultHttp.req, defaultHttp.res).run().then(function(http){ http.sendCookie(); done(); }) }) it('sendCookie multi', function(done){ Http(defaultHttp.req, defaultHttp.res).run().then(function(http){ http.setCookie('name', 'welefen', {path: '/xxx/', Domain: 'welefen.com'}); http.setCookie('value', 'suredy'); var fn = http.res.setHeader; http.res.headersSent = false; http.res.setHeader = function(name, value){ assert.equal(name, 'Set-Cookie'); //console.log(value) assert.deepEqual(value, [ 'name=welefen; Domain=welefen.com; Path=/xxx/', 'value=suredy; Path=/' ]); //console.log(http._cookie) assert.deepEqual(http._cookie, {"name":{"path":"/xxx/","domain":"welefen.com","name":"name","value":"welefen"},"value":{"path":"/","domain":"","name":"value","value":"suredy"}}) done(); } http.sendCookie(); }) }) it('redirect empty', function(done){ Http(defaultHttp.req, defaultHttp.res).run().then(function(http){ var fn = http.res.setHeader; http.res.setHeader = function(name, value){ assert.equal(name, 'Location'); assert.equal(value, '/'); http.res.setHeader = fn; } var fn1 = http.res.end; http.res.end = function(){ http.res.end = fn1; done(); } http.redirect(); assert.equal(http.res.statusCode, 302); }) }) it('redirect url', function(done){ Http(defaultHttp.req, defaultHttp.res).run().then(function(http){ var fn = http.res.setHeader; http.res.setHeader = function(name, value){ assert.equal(name, 'Location'); assert.equal(value, 'http://www.welefen.com'); http.res.setHeader = fn; } var fn1 = http.res.end; http.res.end = function(){ http.res.end = fn1; done(); } http.redirect('http://www.welefen.com', 301); assert.equal(http.res.statusCode, 301); }) }) it('sendTime empty', function(done){ Http(defaultHttp.req, defaultHttp.res).run().then(function(http){ var fn = http.res.setHeader; http.res.setHeader = function(name, value){ assert.equal(name, 'X-EXEC-TIME'); http.res.setHeader = fn; done(); } http.sendTime(); }) }) it('sendTime name', function(done){ Http(defaultHttp.req, defaultHttp.res).run().then(function(http){ var fn = http.res.setHeader; http.res.setHeader = function(name, value){ assert.equal(name, 'X-TEST'); http.res.setHeader = fn; done(); } http.sendTime('TEST'); }) }) it('echo empty', function(done){ Http(defaultHttp.req, defaultHttp.res).run().then(function(http){ assert.equal(http.echo(), undefined); done(); }) }) it('echo array', function(done){ Http(defaultHttp.req, defaultHttp.res).run().then(function(http){ var fn = http.res.write; http.res.write = function(content){ //console.log(content) assert.equal(content, "[1,2,3]") done(); } http.echo([1,2,3]) }) }) it('echo obj', function(done){ Http(defaultHttp.req, defaultHttp.res).run().then(function(http){ var fn = http.res.write; http.res.write = function(content){ //console.log(content) assert.equal(content, '{"name":"welefen"}') done(); } http.echo({name:'welefen'}) }) }) it('echo str', function(done){ Http(defaultHttp.req, defaultHttp.res).run().then(function(http){ var fn = http.res.write; http.res.write = function(content){ //console.log(content) assert.equal(content, 'welefen') done(); } http.echo('welefen') }) }) it('echo str', function(done){ Http(defaultHttp.req, defaultHttp.res).run().then(function(http){ var fn = http.res.write; var buffer = new Buffer(10) http.res.write = function(content){ //console.log(content) assert.equal(content, buffer) done(); } http.echo(buffer) }) }) it('echo true', function(done){ Http(defaultHttp.req, defaultHttp.res).run().then(function(http){ var fn = http.res.write; http.res.write = function(content){ //console.log(content) assert.equal(content, 'true') done(); } http.echo(true) }) }) it('echo no encoding', function(done){ Http(defaultHttp.req, defaultHttp.res).run().then(function(http){ var fn = http.res.write; http.res.write = function(content, encoding){ //console.log(content) assert.equal(content, 'true') done(); } http.echo(true) }) }) }) describe('HTTP POST', function(){ var defaultHttp = Http.getDefaultHttp('url=/index/index&method=post'); it('hasPostData false', function(done){ var instance = Http(defaultHttp.req, defaultHttp.res); //console.log(instance.hasPostData()===false) assert.equal(instance.hasPostData(), false); done(); }) it('hasPostData true', function(done){ var instance = Http(defaultHttp.req, defaultHttp.res); instance._request(); instance._response(); instance.http.req.headers['transfer-encoding'] = 'GZIP'; assert.equal(instance.hasPostData(), true); done(); }) it('hasPostData true', function(done){ var instance = Http(defaultHttp.req, defaultHttp.res); instance._request(); instance._response(); delete instance.http.req.headers['transfer-encoding']; instance.http.req.headers['content-length'] = 100; assert.equal(instance.hasPostData(), true); done(); }) it('common post, no data', function(done){ var instance = Http(defaultHttp.req, defaultHttp.res); instance.req = new (require('http').IncomingMessage); //instance.req.headers = {'transfer-encoding': 'gzip'} instance.req.method = 'POST'; instance.run().then(function(http){ done(); }); }) it('common post with data', function(done){ var instance = Http(defaultHttp.req, defaultHttp.res); instance.req = new IncomingMessage(new Socket()); instance.req.headers = {'transfer-encoding': 'gzip'} instance.req.method = 'POST' process.nextTick(function(){ instance.req.emit('data', new Buffer('name=welefen')) instance.req.emit('end'); }) instance.run().then(function(http){ assert.deepEqual(http.post, { name: 'welefen' }) done(); }); }) it('common post with data1', function(done){ var instance = Http(defaultHttp.req, defaultHttp.res); instance.req = new IncomingMessage(new Socket()); instance.req.headers = {'transfer-encoding': 'gzip'} instance.req.method = 'POST' process.nextTick(function(){ instance.req.emit('data', new Buffer('name=welefen&value=suredy')) instance.req.emit('end'); }) instance.run().then(function(http){ assert.deepEqual(http.post, { name: 'welefen', value: 'suredy' }) done(); }); }) // it('common post with ajax data', function(done){ // var instance = Http(defaultHttp.req, defaultHttp.res); // instance.req = new IncomingMessage(new Socket()); // instance.req.headers = {'transfer-encoding': 'gzip', 'x-filename': '1.js'} // instance.req.method = 'POST'; // process.nextTick(function(){ // instance.req.emit('data', new Buffer('name=welefen&value=suredy')) // instance.req.emit('end'); // }) // instance.run().then(function(http){ // var file = http.file.file; // assert.equal(file.originalFilename, '1.js'); // assert.equal(file.size, 25); // assert.equal(file.path.indexOf('.js') > -1, true); // done(); // }); // }) it('common post_max_fields', function(done){ var instance = Http(defaultHttp.req, defaultHttp.res); instance.req = new IncomingMessage(new Socket()); instance.req.headers = {'transfer-encoding': 'gzip'} instance.req.method = 'POST'; process.nextTick(function(){ var arr = []; for(var i=0;i<100;i++){ arr.push(Math.random() + '=' + Date.now()); } instance.req.emit('data', new Buffer(arr.join('&'))) instance.req.emit('end'); }) C('post_max_fields', 50); var fn = instance.res.end; instance.res.statusCode = 200; instance.res.end = function(){ assert.equal(instance.res.statusCode, 413); instance.res.end = fn; done(); } instance.run(); }) it('common post_max_fields_size', function(done){ var instance = Http(defaultHttp.req, defaultHttp.res); instance.req = new IncomingMessage(new Socket()); instance.req.headers = {'transfer-encoding': 'gzip'} instance.req.method = 'POST'; process.nextTick(function(){ var arr = []; for(var i=0;i<40;i++){ arr.push(Math.random() + '=' + (new Array(1000).join(Math.random() + ''))); } instance.req.emit('data', new Buffer(arr.join('&'))) instance.req.emit('end'); }) C('post_max_fields', 50); C('post_max_fields_size', 1000) var fn = instance.res.end; instance.res.statusCode = 200; instance.res.end = function(){ assert.equal(instance.res.statusCode, 413); instance.res.end = fn; done(); } instance.run(); }) it('file upload', function(done){ var instance = Http(defaultHttp.req, defaultHttp.res); instance.req = new IncomingMessage(new Socket()); instance.req.headers = {'transfer-encoding': 'gzip', 'content-type': 'multipart/form-data; boundary=welefen'} instance.req.method = 'POST'; process.nextTick(function(){ instance.form.emit('file', 'image', 'welefen'); instance.form.emit('close'); }) C('post_max_fields', 150); C('post_max_fields_size', 1000) instance.run().then(function(http){ assert.deepEqual(http.file, { image: 'welefen' }); done(); }) }) it('file upload, filed', function(done){ var instance = Http(defaultHttp.req, defaultHttp.res); instance.req = new IncomingMessage(new Socket()); instance.req.headers = {'transfer-encoding': 'gzip', 'content-type': 'multipart/form-data; boundary=welefen'} instance.req.method = 'POST'; process.nextTick(function(){ instance.form.emit('field', 'image', 'welefen'); instance.form.emit('close'); }) C('post_max_fields', 150); C('post_max_fields_size', 1000) instance.run().then(function(http){ assert.deepEqual(http.post, { image: 'welefen' }); done(); }) }) it('file upload, error', function(done){ var instance = Http(defaultHttp.req, defaultHttp.res); instance.req = new IncomingMessage(new Socket()); instance.req.headers = {'transfer-encoding': 'gzip', 'content-type': 'multipart/form-data; boundary=welefen'} instance.req.method = 'POST'; instance.res.statusCode = 200; process.nextTick(function(){ instance.form.emit('error', new Error('test')); }) C('post_max_fields', 150); C('post_max_fields_size', 1000) instance.run(); instance.res.end = function(){ assert.equal(instance.res.statusCode, 413) done(); } }) }) })
{ "content_hash": "8b699da995effbdbfaf981c328b2d782", "timestamp": "", "source": "github", "line_count": 548, "max_line_length": 248, "avg_line_length": 39.06021897810219, "alnum_prop": 0.5770614342443354, "repo_name": "74sharlock/thinkjs", "id": "2fb8eeeee74d999a62bc675bce4c24b572c8c098", "size": "21407", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "test/Lib/Core/Http.js", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "986" }, { "name": "JavaScript", "bytes": "734559" }, { "name": "Makefile", "bytes": "690" }, { "name": "Nginx", "bytes": "820" } ], "symlink_target": "" }
FROM node:latest MAINTAINER Harold Thetiot <hthetiot@gmail.com> # Upgrade npm RUN npm i npm@latest -g ENV NO_UPDATE_NOTIFIER 1 # Create app directory ENV APPDIR /usr/src/app RUN mkdir -p $APPDIR WORKDIR $APPDIR # Install app dependencies # A wildcard is used to ensure both package.json AND package-lock.json are copied # where available (npm@5+) ADD package*.json $APPDIR/ RUN npm install # Install dependencies in production mode (no dev dependencies). ARG EASYRTC_BRANCH=master RUN npm install priologic/easyrtc#$EASYRTC_BRANCH RUN npm install --production ADD . $APPDIR VOLUME ['certs', 'static'] # Replace 'easyrtc = require("..");' by 'easyrtc = require("easyrtc");'' # To use easyrtc from node_modules instead of parent directory RUN sed -i "s|easyrtc = require(\"../\")|easyrtc = require(\"easyrtc\")|g" $APPDIR/*.js # Define service user RUN chown -R nobody:nogroup $APPDIR && chmod -R a-w $APPDIR && ls -ld USER nobody # Ports > 1024 since we're not root. EXPOSE 8080 8443 ENV SYLAPS_ENV all ENTRYPOINT ["npm"] CMD ["start"]
{ "content_hash": "b24219683e6e70a22239d58cc89af04b", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 87, "avg_line_length": 24.904761904761905, "alnum_prop": 0.7284894837476099, "repo_name": "priologic/easyrtc", "id": "1cd4eb1778ee44846aef255a08b3bf898f64847d", "size": "1065", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "server_example/Dockerfile", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Batchfile", "bytes": "237" }, { "name": "CSS", "bytes": "17802" }, { "name": "Dockerfile", "bytes": "1065" }, { "name": "HTML", "bytes": "2607" }, { "name": "JavaScript", "bytes": "1073771" }, { "name": "Shell", "bytes": "267" }, { "name": "TypeScript", "bytes": "12614" } ], "symlink_target": "" }
package com.cloudray.scalapress.folder.section import javax.persistence.{Column, Table, Entity} import com.cloudray.scalapress.section.Section import scala.beans.BeanProperty import com.cloudray.scalapress.framework.ScalapressRequest import com.cloudray.scalapress.media.ImageResolver /** @author Stephen Samuel */ @Entity @Table(name = "blocks_content") class FolderContentSection extends Section { @Column(name = "content", length = 100000) @BeanProperty var content: String = _ override def desc = "Edit and then display a section of content when viewing this object" override def backoffice = "/backoffice/folder/section/content/" + id def render(req: ScalapressRequest): Option[String] = Option(content).map(new ImageResolver(req.context).resolve) }
{ "content_hash": "28b0b0224e1f97e973f13e9ebff14eba", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 114, "avg_line_length": 35.09090909090909, "alnum_prop": 0.7823834196891192, "repo_name": "vidyacraghav/scalapress", "id": "e1969579f4f9523dea49bfee9be9ea3377fbbbfb", "size": "772", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/scala/com/cloudray/scalapress/folder/section/FolderContentSection.scala", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "227919" }, { "name": "Java", "bytes": "20618" }, { "name": "JavaScript", "bytes": "579834" }, { "name": "Scala", "bytes": "1273044" }, { "name": "Shell", "bytes": "773" } ], "symlink_target": "" }
#ifndef QUATERNION_H_INCLUDED #define QUATERNION_H_INCLUDED #ifdef __cplusplus extern "C" { #endif #include "utility.h" struct kmMat4; struct kmMat3; struct kmVec3; typedef struct kmQuaternion { kmScalar x; kmScalar y; kmScalar z; kmScalar w; } kmQuaternion; int kmQuaternionAreEqual(const kmQuaternion* p1, const kmQuaternion* p2); kmQuaternion* kmQuaternionFill(kmQuaternion* pOut, kmScalar x, kmScalar y, kmScalar z, kmScalar w); /** Returns the dot product of the 2 quaternions */ kmScalar kmQuaternionDot(const kmQuaternion* q1, const kmQuaternion* q2); /** Returns the exponential of the quaternion (not implemented) */ kmQuaternion* kmQuaternionExp(kmQuaternion* pOut, const kmQuaternion* pIn); /** Makes the passed quaternion an identity quaternion */ kmQuaternion* kmQuaternionIdentity(kmQuaternion* pOut); /** Returns the inverse of the passed Quaternion */ kmQuaternion* kmQuaternionInverse(kmQuaternion* pOut, const kmQuaternion* pIn); /** Returns true if the quaternion is an identity quaternion */ int kmQuaternionIsIdentity(const kmQuaternion* pIn); /** Returns the length of the quaternion */ kmScalar kmQuaternionLength(const kmQuaternion* pIn); /** Returns the length of the quaternion squared (prevents a sqrt) */ kmScalar kmQuaternionLengthSq(const kmQuaternion* pIn); /** Returns the natural logarithm */ kmQuaternion* kmQuaternionLn(kmQuaternion* pOut, const kmQuaternion* pIn); /** Multiplies 2 quaternions together */ kmQuaternion* kmQuaternionMultiply(kmQuaternion* pOut, const kmQuaternion* q1, const kmQuaternion* q2); /** Normalizes a quaternion */ kmQuaternion* kmQuaternionNormalize(kmQuaternion* pOut, const kmQuaternion* pIn); /** Rotates a quaternion around an axis */ kmQuaternion* kmQuaternionRotationAxisAngle(kmQuaternion* pOut, const struct kmVec3* pV, kmScalar angle); /** Creates a quaternion from a rotation matrix */ kmQuaternion* kmQuaternionRotationMatrix(kmQuaternion* pOut, const struct kmMat3* pIn); /** Create a quaternion from yaw, pitch and roll */ kmQuaternion* kmQuaternionRotationPitchYawRoll(kmQuaternion* pOut, kmScalar pitch, kmScalar yaw, kmScalar roll); /** Interpolate between 2 quaternions */ kmQuaternion* kmQuaternionSlerp(kmQuaternion* pOut, const kmQuaternion* q1, const kmQuaternion* q2, kmScalar t); /** Get the axis and angle of rotation from a quaternion */ void kmQuaternionToAxisAngle(const kmQuaternion* pIn, struct kmVec3* pVector, kmScalar* pAngle); /** Scale a quaternion */ kmQuaternion* kmQuaternionScale(kmQuaternion* pOut, const kmQuaternion* pIn, kmScalar s); kmQuaternion* kmQuaternionAssign(kmQuaternion* pOut, const kmQuaternion* pIn); kmQuaternion* kmQuaternionAdd(kmQuaternion* pOut, const kmQuaternion* pQ1, const kmQuaternion* pQ2); kmQuaternion* kmQuaternionSubtract(kmQuaternion* pOut, const kmQuaternion* pQ1, const kmQuaternion* pQ2); /* * Gets the shortest arc quaternion to rotate this vector to the * destination vector. * If you call this with a dest vector that is close to the inverse of * this vector, we will rotate 180 degrees around the 'fallbackAxis' * (if specified, or a generated axis if not) since in this case ANY * axis of rotation is valid. */ kmQuaternion* kmQuaternionRotationBetweenVec3(kmQuaternion* pOut, const struct kmVec3* vec1, const struct kmVec3* vec2, const struct kmVec3* fallback); struct kmVec3* kmQuaternionMultiplyVec3(struct kmVec3* pOut, const kmQuaternion* q, const struct kmVec3* v); kmVec3* kmQuaternionGetUpVec3(kmVec3* pOut, const kmQuaternion* pIn); kmVec3* kmQuaternionGetRightVec3(kmVec3* pOut, const kmQuaternion* pIn); kmVec3* kmQuaternionGetForwardVec3RH(kmVec3* pOut, const kmQuaternion* pIn); kmVec3* kmQuaternionGetForwardVec3LH(kmVec3* pOut, const kmQuaternion* pIn); kmScalar kmQuaternionGetPitch(const kmQuaternion* q); kmScalar kmQuaternionGetYaw(const kmQuaternion* q); kmScalar kmQuaternionGetRoll(const kmQuaternion* q); kmQuaternion* kmQuaternionLookRotation(kmQuaternion* pOut, const kmVec3* direction, const kmVec3* up); /* Given a quaternion, and an axis. This extracts the rotation around * the axis into pOut as another quaternion. Uses the swing-twist * decomposition. */ kmQuaternion* kmQuaternionExtractRotationAroundAxis(const kmQuaternion* pIn, const kmVec3* axis, kmQuaternion* pOut); /* * Returns a Quaternion representing the angle between two vectors */ kmQuaternion* kmQuaternionBetweenVec3(kmQuaternion* pOut, const kmVec3* v1, const kmVec3* v2); #ifdef __cplusplus } #endif #endif
{ "content_hash": "f23922d45bc40c2190b3fcc67099b708", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 79, "avg_line_length": 39.268115942028984, "alnum_prop": 0.653995202066802, "repo_name": "Kazade/kazmath", "id": "a094e898ef9fe4fa8dccd2254889e1e955b71b46", "size": "6739", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "kazmath/quaternion.h", "mode": "33261", "license": "bsd-2-clause", "language": [ { "name": "C", "bytes": "919084" }, { "name": "C++", "bytes": "760357" }, { "name": "CMake", "bytes": "8393" }, { "name": "Java", "bytes": "20912" }, { "name": "Lua", "bytes": "3259" }, { "name": "Makefile", "bytes": "241" }, { "name": "Python", "bytes": "4651" } ], "symlink_target": "" }
module('Resolver'); test('.meetsRequirements()', function() { Fixtures.load('Mordor'); GameState = new Game(); GameState.setLairCode('testLair'); GameState.setEventCode('testEvent'); var withFunction = { getRequirements: function() { return ['Game:EventCode==testEvent','Game:LairCode==testLair'] } }; var withArray = { requirements: ['Game:EventCode==testEvent','Game:LairCode==testLair'] }; var asArray = ['Game:EventCode==testEvent','Game:LairCode==testLair'] ok(Resolver.meetsRequirements(null)); ok(Resolver.meetsRequirements(withFunction)); ok(Resolver.meetsRequirements(withArray)); ok(Resolver.meetsRequirements(asArray)); ok(Resolver.meetsRequirements("Whatever it is.")); }); // --- Resolver.isTrue() Tests ------------------------------------------------ test('Truthy is True', function() { ok(Resolver.isTrue(function() { return 'Kinda True'; })); }); test('Falsey is False', function() { ok(Resolver.isFalse(function() { return 0; })); }); test('An Exception is False', function() { supplant(Logger,'error',function() {}); ok(Resolver.isFalse(function() { throw 'Dagger!' })); }); test('Eval is True', function() { ok(Resolver.isTrue("(!)5 > 1")) }); test('Flag is True', function() { Fixtures.load('Mordor'); GameState = new Game(); GameState.setFlag('test','flag') ok(Resolver.isTrue("(?)test:flag")) }); test('No Flag is True', function() { Fixtures.load('Mordor'); GameState = new Game(); ok(Resolver.isTrue("(~?)test:noflag")) }); test('Equal Things', function() { Fixtures.load('Mordor'); GameState = new Game(); GameState.setLairCode('Basement'); ok(Resolver.isTrue("Game:LairCode==Basement")); ok(Resolver.isFalse("Game:LairCode==Curch")); }); test('Unequal Things', function() { Fixtures.load('Mordor'); GameState = new Game(); GameState.setLairCode('Basement'); ok(Resolver.isTrue("Game:LairCode!=Curch")); ok(Resolver.isFalse("Game:LairCode!=Basement")); }); test('Greater', function() { Fixtures.load('Mordor'); GameState = new Game(); GameState.setVar('test',20); ok(Resolver.isTrue("Var.test>19")); }); test('Less', function() { Fixtures.load('Mordor'); GameState = new Game(); GameState.setVar('test',20); ok(Resolver.isTrue("Var.test<21")); }); test('Is', function() { Fixtures.load('Mordor'); GameState = new Game(); ok(Resolver.isTrue("Game:IsDay")); ok(Resolver.isFalse("Game:IsNight")); }); test('Component Exists', function() { Fixtures.load('Mordor'); GameState = new Game(); GameState.setCharacter({ getComponent: function() { return "Not Null" }}); ok(Resolver.isTrue('|C|[test]?')) }); test('Parsing Failure', function() { raises(function() { Resolver.isTrue('Foo==Fail'); }); }); // --- Resolver.lookupValue() Tests ------------------------------------------- test('Lookup Eval', function() { equal(Resolver.lookupValue('(!)5*10'), '50'); }); test('Lookup Variable', function() { Fixtures.load('Mordor'); GameState = new Game(); GameState.setVar('test',20); equal(Resolver.lookupValue("Var.test"), 20); }); test('Lookup Random', function() { supplant(Util,'getRandom',function() { return 68; }); equal(Resolver.lookupValue("Random[100]"), 69) }) test('Lookup from Interface Data', function() { InterfaceData['magic'] = 'More Magic' equal(Resolver.lookupValue('Interface:magic'), 'More Magic'); }); test('Lookup from Game State', function() { Fixtures.load('Mordor'); GameState = new Game(); GameState.setLairCode('Basement'); equal(Resolver.lookupValue("Game:LairCode"), 'Basement'); }); test('Lookup Visits', function() { Fixtures.load('Mordor'); GameState = new Game(); GameState.locationVisits['shop'] = 10; equal(Resolver.lookupValue("Visits:shop"), 10); }); test('Lookup Page Property', function() { PageState = { test:5 } equal(Resolver.lookupValue('Page.test'), 5); }); test('Lookup Event Property', function() { EventState = { test:7 } equal(Resolver.lookupValue('Event.test'), 7); }); test('Lookup Character Property', function() { Fixtures.load('Mordor'); GameState = new Game(); GameState.setCharacter({ getGender: function() { return 'male'; }, getRace: function() { return 'fish'; }, }); equal(Resolver.lookupValue('|C|Gender'), 'male'); equal(Resolver.lookupValue('|C|Race'), 'fish'); }); test('Lookup Attacking Actor', function() { BattleState = { getAttacker: function() { return { getFish: function() { return 'tuna'; }} } }; equal(Resolver.lookupValue('|A|Fish'),'tuna'); }); test('Lookup Defending Actor', function() { BattleState = { getDefender: function() { return { getFruit: function() { return 'orange'; }} } }; equal(Resolver.lookupValue('|D|Fruit'), 'orange'); }); test('Lookup Subject Actor', function() { PageState = { subject: { getSound: function() { return 'boom'; } } }; equal(Resolver.lookupValue('|X|Sound'), 'boom'); }); test('Lookup Component Property', function() { PageState = { subject:{ getComponent: function() { return { part: 10 } }}}; equal(Resolver.lookupValue('|X|[slot].part'), 10); }); test('Lookup Component Description', function() { PageState = { subject:{ getComponent: function() { return ''; }, describeComponent: function() { return 'awesome'; }, }}; equal(Resolver.lookupValue('|X|[slot]:desc'), 'awesome'); }); test('Lookup Actor Items', function() { PageState = { subject:{ getItemQuantity: function(code) { return 12; } }}; equal(Resolver.lookupValue('|X|Inventory.code'), 12); }); test('Lookup Actor Skill', function() { PageState = { subject:{ getSkillLevel: function(code) { return 'fish'; } }}; equal(Resolver.lookupValue('|X|Skill.code'), 'fish'); }); test('Lookup Actor Weapon', function() { Fixtures.load('Asgard') PageState = { subject:{ getEquipped: function(code) { return 'axe' } }}; equal(Resolver.lookupValue('|X|Weapon.Name'), "Axe") });
{ "content_hash": "cf3662d7d68afce31fce995a7f81f45c", "timestamp": "", "source": "github", "line_count": 302, "max_line_length": 79, "avg_line_length": 20.158940397350992, "alnum_prop": 0.6263140604467805, "repo_name": "maldrasen/archive", "id": "f1e852e4d3f0dd899d7b347c304445d65d0cabfe", "size": "6088", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Mephidross/old/reliquary/test/ResolverTest.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "230920" }, { "name": "HTML", "bytes": "1056213" }, { "name": "JavaScript", "bytes": "2161778" }, { "name": "Ruby", "bytes": "722167" }, { "name": "Shell", "bytes": "442" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <!-- Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable 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. --> <!DOCTYPE Test SYSTEM "test.dtd"> <!-- Author: Ilia A. Leviev Version: $Revision: 1.3 $ --> <Test ID="lstore0502" date-of-creation="2005-03-31" timeout="1" > <Author value="Ilia A. Leviev"/> <Description> The test is against the lstore java virtual machine instruction. It performs the following check on the instruction. The instruction returns expected value if index is 255(boundary index). Covered assertions assert_instr28a230 assert_instr28a231 </Description> <Source name="lstore0502p.j"/> <Runner ID="Runtime"> <Param name="toRun" value="org.apache.harmony.vts.test.vm.jvms.instructions.loadStore.lstore.lstore05.lstore0502.lstore0502p"/> </Runner> </Test>
{ "content_hash": "d7401107d88c8c71a8c19dbf2f66f0f7", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 131, "avg_line_length": 35.35, "alnum_prop": 0.7185289957567186, "repo_name": "freeVM/freeVM", "id": "d4c606a28a479d2cb05e75ba19a7aa47792feb04", "size": "1414", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "enhanced/buildtest/tests/vts/vm/src/test/vm/jvms/instructions/loadStore/lstore/lstore05/lstore0502/lstore0502.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "116828" }, { "name": "C", "bytes": "17860389" }, { "name": "C++", "bytes": "19007206" }, { "name": "CSS", "bytes": "217777" }, { "name": "Java", "bytes": "152108632" }, { "name": "Objective-C", "bytes": "106412" }, { "name": "Objective-J", "bytes": "11029421" }, { "name": "Perl", "bytes": "305690" }, { "name": "Scilab", "bytes": "34" }, { "name": "Shell", "bytes": "153821" }, { "name": "XSLT", "bytes": "152859" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <title>East Way Driving School</title> <!-- Bootstrap Core CSS - Uses Bootswatch Flatly Theme: http://bootswatch.com/flatly/ --> <link href="css/bootstrap.css" rel="stylesheet"> <!-- Custom CSS --> <link href="css/freelancer.css" rel="stylesheet"> <!-- Custom Fonts --> <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"> <link href="http://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css"> <link href="http://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" rel="stylesheet" type="text/css"> <!-- 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/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> <![endif]--> </head> <body id="page-top" class="index"> <script> window.fbAsyncInit = function() { FB.init({ appId : '509002976234706', autoLogAppEvents : true, xfbml : true, version : 'v3.1' }); }; (function(d, s, id){ var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; js.src = "https://connect.facebook.net/en_US/sdk.js"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); </script> <!-- Navigation --> <nav class="navbar navbar-default navbar-fixed-top"> <div class="container"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header page-scroll"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#page-top">Eastway Driving School</a> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav navbar-right"> <li class="hidden"> <a href="#page-top"></a> </li> <li class="page-scroll"> <a href="#portfolio">About Us</a> </li> <li class="page-scroll"> <a href="#lessons">Lessons</a> </li> <li class="page-scroll"> <a target="black" href="https://www.facebook.com/pages/Eastway-school-of-Motoring/127711267277297?fref=ts">Facebook</a> </li> <li class="page-scroll"> <a href="#footer">Contact</a> </li> </ul> </div> <!-- /.navbar-collapse --> </div> <!-- /.container-fluid --> </nav> <!-- Header --> <header> <div class="container"> <div class="row"> <div class="col-lg-12"> <div class="intro-text"> <span class="name">Greasby and Wallasey Driving School</span> <span class="skills">Learning to drive with Eastway driving school</span> </div> <img class="img-responsive" src="img/car.png" alt=""> </div> </div> </div> </header> <!-- Portfolio Grid Section --> <section id="portfolio"> <div class="container"> <div class="row"> <div class="col-lg-8 text-center col-lg-offset-2 color-grey"> <h2>About Us</h2> <h4>Eastway is a well established local Wirral driving school operating since 1989.</h4> <p>Our business is built on reputation, with many satisfied pupils in our area.<br>At Eastway driving school we believe that learning to drive should be an enjoyable experience, taught in a professional environment, where you can learn all the skills needed to be a confident and safe driver.<br>We are a small family run business led by two lady driving instructors Wendy and Heather. We have over twenty two years of experience and are both asessed by the DSA and CRB checked.<br>We enjoy teaching drivers of any age, from learners all the way through to pass plus courses. We also offer motorway lessons, refresher driving lessons and theory test training.</p> </div> </div> <div class="row color-grey"> <div class="col-lg-4 col-lg-offset-2"> <h3>Lessons in Wallasey</h3> <p>Heather: <a class="color-grey" href="tel:+441516386276">638 6276</a> <a class="color-grey" href="tel:+447952739402">07952 739 402</a></p> </div> <div class="col-lg-4"> <h3>Lessons in Greasby</h3> <p>Wendy:<a class="color-grey" href="tel:+447970842992">07970 842 992</a></p> </div> </div> </div> </section> <!-- About Section --> <section class="success color-grey" id="lessons"> <div class="container"> <div class="row"> <div class="col-lg-12 text-center color-grey"> <h2>Manual and Automatic lessons</h2> <p><br>Contact us for lessons prices. We offer reduced pricing for booking 10 or more lessons.</p> </div> </div> <div class="row color-grey"> <div class="col-lg-4 col-lg-offset-2"> <h3>Lessons in Wallasey</h3> <p>Contact Heather: <a class="color-grey" href="tel:+441516386276">638 6276</a> <br><a class="color-grey" href="tel:+447952739402">07952 739 402</a></p> </div> <div class="col-lg-4"> <h3> Lessons in Greasby</h3> <p>Contact Wendy:<a class="color-grey" href="tel:+447970842992"> 07970 842 992</a></p> </div> </div> </div> </section> <!-- Contact Section --> <!-- <section id="contact"> <div class="container"> <div class="row"> <div class="col-lg-12 text-center"> <h2>Contact Me</h2> <hr class="star-primary"> </div> </div> <div class="row"> <div class="col-lg-8 col-lg-offset-2"> <form name="sentMessage" id="contactForm" novalidate> <div class="row control-group"> <div class="form-group col-xs-12 floating-label-form-group controls"> <label>Name</label> <input type="text" class="form-control" placeholder="Name" id="name" required data-validation-required-message="Please enter your name."> <p class="help-block text-danger"></p> </div> </div> <div class="row control-group"> <div class="form-group col-xs-12 floating-label-form-group controls"> <label>Email Address</label> <input type="email" class="form-control" placeholder="Email Address" id="email" required data-validation-required-message="Please enter your email address."> <p class="help-block text-danger"></p> </div> </div> <div class="row control-group"> <div class="form-group col-xs-12 floating-label-form-group controls"> <label>Phone Number</label> <input type="tel" class="form-control" placeholder="Phone Number" id="phone" required data-validation-required-message="Please enter your phone number."> <p class="help-block text-danger"></p> </div> </div> <div class="row control-group"> <div class="form-group col-xs-12 floating-label-form-group controls"> <label>Message</label> <textarea rows="5" class="form-control" placeholder="Message" id="message" required data-validation-required-message="Please enter a message."></textarea> <p class="help-block text-danger"></p> </div> </div> <br> <div id="success"></div> <div class="row"> <div class="form-group col-xs-12"> <button type="submit" class="btn btn-success btn-lg">Send</button> </div> </div> </form> </div> </div> </div> </section> --> <!-- Footer --> <footer id="footer" class="text-center"> <div class="footer-above"> <div class="container"> <div class="row"> <div class="footer-col col-md-4"> <h3>Contact</h3> <p>Wendy: <a class="color-grey" href="tel:+447970842992">07970 842 992</a></p> <p>Heather: <a class="color-grey" href="tel:+441516386276">638 6276</a> <a class="color-grey" href="tel:+447952739402">07952 739 402</a></p> </div> <div class="footer-col col-md-4"> <h3>Our Facebook</h3> <ul class="list-inline"> <li> <a href="https://www.facebook.com/pages/Eastway-school-of-Motoring/127711267277297?fref=ts" class="btn-social btn-outline"><i class="fa fa-fw fa-facebook"></i></a> </li> </ul> </div> <div class="footer-col col-md-4"> <h3>Where in Wirral can you learn to drive?</h3> <p>Bebington Birkenhead, Caldy, Greasby, Heswall, Hoylake, Irby, Leasowe, Liscard, Meols, Moreton, New Brighton, Oxton, Prenton, Tranmere, Upton, Wallasey, West-Kirby, Woodchurch</p> </div> </div> </div> </div> <!-- <div class="footer-below"> <div class="container"> <div class="row"> <div class="col-lg-12"> Copyright &copy; Your Website 2014 </div> </div> </div> </div> --> </footer> <!-- Scroll to Top Button (Only visible on small and extra-small screen sizes) --> <div class="scroll-top page-scroll visible-xs visble-sm"> <a class="btn btn-primary" href="#page-top"> <i class="fa fa-chevron-up"></i> </a> </div> <!-- jQuery --> <script src="js/jquery.js"></script> <!-- Bootstrap Core JavaScript --> <script src="js/bootstrap.min.js"></script> <!-- Plugin JavaScript --> <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script> <script src="js/classie.js"></script> <script src="js/cbpAnimatedHeader.js"></script> <!-- Contact Form JavaScript --> <script src="js/jqBootstrapValidation.js"></script> <script src="js/contact_me.js"></script> <!-- Custom Theme JavaScript --> <script src="js/freelancer.js"></script> </body> </html>
{ "content_hash": "d4ec80f29ab2af140ac5d55261521012", "timestamp": "", "source": "github", "line_count": 280, "max_line_length": 683, "avg_line_length": 44.975, "alnum_prop": 0.5026602080520924, "repo_name": "stevejwikeley/eastway-driving", "id": "8e6dff62cbece3bfc017b2752dce4fd0a6c7e2d3", "size": "12593", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "index.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "16145" }, { "name": "HTML", "bytes": "38727" }, { "name": "JavaScript", "bytes": "43054" }, { "name": "PHP", "bytes": "1108" } ], "symlink_target": "" }
package io.advantageous.qbit.eventbus; import io.advantageous.qbit.events.EventManager; import io.advantageous.qbit.events.EventManagerBuilder; import io.advantageous.qbit.events.spi.EventConnector; import io.advantageous.qbit.service.ServiceBundle; import io.advantageous.qbit.service.ServiceProxyUtils; import io.advantageous.qbit.test.TimedTesting; import org.junit.Test; import java.util.concurrent.atomic.AtomicReference; import static io.advantageous.qbit.service.ServiceBundleBuilder.serviceBundleBuilder; import static org.junit.Assert.assertEquals; /** * created by rhightower on 3/1/15. */ public class EventManagerReplicationIntegrationTest extends TimedTesting { EventConnector replicatorClient; EventRemoteReplicatorService replicatorService; ServiceBundle serviceBundle; @Test public void fakeTest() { } @Test public void test() { /** Two event managers A and B. Event on A gets replicated to B. */ EventManager eventManagerA; EventManager eventManagerB; EventManagerBuilder eventManagerBuilderA = new EventManagerBuilder(); EventManagerBuilder eventManagerBuilderB = new EventManagerBuilder(); /** Build B. */ EventManager eventManagerBImpl = eventManagerBuilderB.build("eventBusB"); /** replicated to B. */ serviceBundle = serviceBundleBuilder().build(); //build service bundle serviceBundle.addServiceObject("eventManagerB", eventManagerBImpl); eventManagerB = serviceBundle.createLocalProxy(EventManager.class, "eventManagerB"); //wire B to Service Bundle replicatorService = new EventRemoteReplicatorService(eventManagerB); //Create replicator passing B proxy serviceBundle.addServiceObject("eventReplicator", replicatorService); //wire replicator to service bundle replicatorClient = serviceBundle.createLocalProxy(EventConnector.class, "eventReplicator"); //Create a client proxy to replicator /* Create A that connects to the replicator client. */ EventManager eventManagerAImpl = eventManagerBuilderA.setEventConnector(replicatorClient).build("eventBusA"); serviceBundle.addServiceObject("eventManagerA", eventManagerAImpl); eventManagerA = serviceBundle.createLocalProxy(EventManager.class, "eventManagerA"); //wire A to Service Bundle serviceBundle.startUpCallQueue(); final AtomicReference<Object> body = new AtomicReference<>(); eventManagerB.register("foo.bar", event -> body.set(event.body())); eventManagerA.send("foo.bar", "hello"); ServiceProxyUtils.flushServiceProxy(eventManagerA); waitForTrigger(20, o -> body.get() != null); assertEquals("hello", body.get()); } }
{ "content_hash": "b31c4e9d2fc78de34ef688d2ad556076", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 126, "avg_line_length": 32.8, "alnum_prop": 0.7352941176470589, "repo_name": "jarrad/qbit", "id": "375ad63049abe8e5e4a8a3b313f0ed20c6d9c4bd", "size": "2788", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "qbit/eventbus-replicator/src/test/java/io/advantageous/qbit/eventbus/EventManagerReplicationIntegrationTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "1066" }, { "name": "Java", "bytes": "2030088" }, { "name": "Shell", "bytes": "371" } ], "symlink_target": "" }
package pl.edu.icm.sedno.common.util; import java.io.InputStream; import java.io.OutputStream; /** * Useful in construction of message digest friendly {@link InputStream}s and * {@link OutputStream}s (handles the ugly write(int) case * * @author Marcin Jaskolski * */ public interface MessageDigestComputer { /** * Returns true iff computation of digest is finished * * @return */ boolean finished(); /** * Updates the digest with single integer (will be cast to byte). It is * required to be compatible with Input/Output Streams, which do have * operations reading/writing an integer. * * @param result */ void update(int result); /** * Updates the digest with a byte array * * @param b * @param off * @param len */ void update(byte[] b, int off, int len); /** * Finishes the digest computation and returns message digest as an array of * bytes. After this call it's not possible to update digest. * * @return */ byte[] getDigest(); /** * Finishes the digest computation and returns message digest as a String. * After this call it's not possible to update digest. * * @return */ String getStringDigest(); }
{ "content_hash": "7703f3ce973f8fc1eef5ed25cc6a4fc3", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 80, "avg_line_length": 21.616666666666667, "alnum_prop": 0.6229760986892829, "repo_name": "pcierpiatka/javers", "id": "aa3d4670044c33302eaab83b95e550156ab8d0de", "size": "1297", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "legacy/src/main/java/pl/edu/icm/sedno/common/util/MessageDigestComputer.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "469250" } ], "symlink_target": "" }
<!-- Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. --> <material-input class="searchbox-input" leadingGlyph="search" [displayBottomPanel]="false" (focus)="handleFocus($event)" (keypress)="stopSpaceKeyPropagation($event)" [(ngModel)]="inputText" [label]="label"> </material-input>
{ "content_hash": "322f119b8c98379b45b3f6b6ca714eb1", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 75, "avg_line_length": 33.714285714285715, "alnum_prop": 0.701271186440678, "repo_name": "shockbytes/shockbytes.github.io", "id": "52b5f9b45f0b27668e95128ead5b147ecc374710", "size": "472", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "packages/angular_components/material_select/material_select_searchbox.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "601753" }, { "name": "HTML", "bytes": "80632" }, { "name": "JavaScript", "bytes": "1120376" } ], "symlink_target": "" }
Create View [CustomerCode].[CustomerInfo] As Select C.[CustomerId] As [Id], Cast(C.[CustomerKey] As uniqueidentifier) As [Key], C.[FirstName], C.[MiddleName], C.[LastName], C.[BirthDate], C.[GenderId], C.CustomerTypeId, -1 As ActivityContextId, C.[ActivityContextKey], C.[CreatedDate], C.[ModifiedDate] From [Customer].[Customer] C Join [Customer].[CustomerType] CT On C.CustomerTypeId = CT.CustomerTypeId
{ "content_hash": "acfe36e885a7b6c285376ac416645555", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 73, "avg_line_length": 27.5, "alnum_prop": 0.6909090909090909, "repo_name": "GenesysSource/Framework-for-Universal", "id": "ac221ee3776262e5d05a2fe395e56788a4f90c6f", "size": "442", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/Framework.Database/CustomerCode/Views/CustomerInfo.sql", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ASP", "bytes": "115" }, { "name": "Batchfile", "bytes": "41230" }, { "name": "C#", "bytes": "997003" }, { "name": "CSS", "bytes": "60272" }, { "name": "HTML", "bytes": "82003" }, { "name": "JavaScript", "bytes": "461839" }, { "name": "PLpgSQL", "bytes": "21434" } ], "symlink_target": "" }
APP_ROOT="$(dirname "$(dirname "$(readlink -fm "$0")")")" TEST_CONTAINER=bonitoo_e2e INFLUX2_CONTAINER=influx2_solo E2E_MAP_DIR=/tmp/e2e INFLUX2_HOST=$(sudo docker inspect -f "{{ .NetworkSettings.IPAddress }}" ${INFLUX2_CONTAINER}) INFLUX2_URL="http://${INFLUX2_HOST}:9999" #TAGS="@influx-influx" ACTIVE_CONF=development POSITIONAL=() while [[ $# -gt 0 ]] do key="$1" case $key in -t| --tags) TAGS="$2" shift; # past argument shift; # past val ;; -c| --config) ACTIVE_CONF="$2" shift; shift; ;; -b| --base) BASE_DIR="$2" shift; shift; esac done echo E2E_CLOUD_DEFAULT_USER_USERNAME = ${E2E_CLOUD_DEFAULT_USER_USERNAME} echo Working from ${APP_ROOT} DOCKER_TEST_CMD="npm test -- activeConf=${ACTIVE_CONF}" if [[ -n "${TAGS}" ]]; then DOCKER_TEST_CMD="${DOCKER_TEST_CMD} --tags ${TAGS}" fi if [[ -n "${BASE_DIR+x}" ]]; then DOCKER_TEST_CMD="${DOCKER_TEST_CMD} ${BASE_DIR}" fi echo DOCKER_TEST_CMD = ${DOCKER_TEST_CMD} if [ ${ACTIVE_CONF} = 'cloud' ]; then echo configuring for cloud if [ -z ${E2E_CLOUD_INFLUX_URL+x} ]; then echo echo E2E_CLOUD_INFLUX_URL is unset echo But cloud configuration chosen echo echo Please set E2E_CLOUD_INFLUX_URL to use cloud configuration exit 1 else echo E2E_CLOUD_INFLUX_URL ${E2E_CLOUD_INFLUX_URL} INFLUX2_URL=${E2E_CLOUD_INFLUX_URL} fi if [ -z ${E2E_CLOUD_DEFAULT_USER_PASSWORD} ]; then echo echo E2E_CLOUD_DEFAULT_USER_PASSWORD is unset echo But cloud configuration chosen echo echo Please set E2E_CLOUD_DEFAULT_USER_PASSWORD to use cloud configuration exit 1 fi fi echo "------ Targeting influx at ${INFLUX2_URL} ------" # Tear down running test container echo "----- Tearing down test container ${TEST_CONTAINER} ------" if docker container inspect ${TEST_CONTAINER} > /dev/null 2>&1 then if [ "$( docker container inspect -f '{{.State.Running}}' ${TEST_CONTAINER} )" == "true" ]; then echo stopping ${TEST_CONTAINER} sudo docker stop ${TEST_CONTAINER} fi echo removing ${TEST_CONTAINER} sudo docker rm ${TEST_CONTAINER} fi # Ensure mapped dirs are current echo "----- Ensuring linked dir for volumes is current ------" if [ -L ${E2E_MAP_DIR}/etc ]; then echo ${E2E_MAP_DIR}/etc is linked echo removing ${E2E_MAP_DIR} sudo rm -r ${E2E_MAP_DIR} fi sudo mkdir -p ${E2E_MAP_DIR} echo linking ${APP_ROOT}/etc sudo ln -s ${APP_ROOT}/etc ${E2E_MAP_DIR}/etc echo "------ (Re)start Selenoid ------" source ${APP_ROOT}/scripts/selenoid.sh echo SELENOID_HOST is ${SELENOID_HOST} # Rebuild and start test container echo "----- Rebuilding test container ${TEST_CONTAINER} ------" if [[ -d "$APP_ROOT/report" ]]; then echo cleaning "$APP_ROOT/report" sudo npm run clean rm -rdf report fi DOCKER_ENVARS="-e SELENIUM_REMOTE_URL=http://${SELENOID_HOST}:4444/wd/hub -e E2E_${ACTIVE_CONF^^}_INFLUX_URL=${INFLUX2_URL}" if [ -n ${E2E_CLOUD_DEFAULT_USER_PASSWORD} ]; then DOCKER_ENVARS="${DOCKER_ENVARS} -e E2E_CLOUD_DEFAULT_USER_PASSWORD=${E2E_CLOUD_DEFAULT_USER_PASSWORD}" fi sudo docker build -t e2e-${TEST_CONTAINER} -f scripts/Dockerfile.tests . sudo docker run -it -v `pwd`/report:/home/e2e/report -v `pwd`/screenshots:/home/e2e/screenshots \ -v /tmp/e2e/etc:/home/e2e/etc -v /tmp/e2e/downloads:/home/e2e/downloads \ ${DOCKER_ENVARS} --detach \ --name ${TEST_CONTAINER} e2e-${TEST_CONTAINER}:latest echo ACTIVE_CONF ${ACTIVE_CONF} BASE_DIR ${BASE_DIR} TAGS ${TAGS} sudo docker exec ${TEST_CONTAINER} ${DOCKER_TEST_CMD} sudo docker exec ${TEST_CONTAINER} npm run report:html sudo docker exec ${TEST_CONTAINER} npm run report:junit sudo docker stop ${TEST_CONTAINER} sudo docker stop selenoid
{ "content_hash": "6d70ac41c27a76a929e781e4f8a8eaf7", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 124, "avg_line_length": 27.22463768115942, "alnum_prop": 0.6571732765504392, "repo_name": "nooproblem/influxdb", "id": "b4da33ea38418e1bd0cf5fbae7af76176a3f5565", "size": "3778", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "e2e/scripts/containerTests.sh", "mode": "33261", "license": "mit", "language": [ { "name": "CSS", "bytes": "9692" }, { "name": "Go", "bytes": "2692594" }, { "name": "HTML", "bytes": "9436" }, { "name": "JavaScript", "bytes": "13653" }, { "name": "Protocol Buffer", "bytes": "8668" }, { "name": "Ruby", "bytes": "4064" }, { "name": "Shell", "bytes": "46962" } ], "symlink_target": "" }
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8"> <title>pageUrl</title> <link href="../../../images/logo-icon.svg" rel="icon" type="image/svg"><script>var pathToRoot = "../../../";</script> <script>const storage = localStorage.getItem("dokka-dark-mode") const savedDarkMode = storage ? JSON.parse(storage) : false if(savedDarkMode === true){ document.getElementsByTagName("html")[0].classList.add("theme-dark") }</script> <script type="text/javascript" src="../../../scripts/sourceset_dependencies.js" async="async"></script><link href="../../../styles/style.css" rel="Stylesheet"><link href="../../../styles/jetbrains-mono.css" rel="Stylesheet"><link href="../../../styles/main.css" rel="Stylesheet"><link href="../../../styles/prism.css" rel="Stylesheet"><link href="../../../styles/logo-styles.css" rel="Stylesheet"><script type="text/javascript" src="../../../scripts/clipboard.js" async="async"></script><script type="text/javascript" src="../../../scripts/navigation-loader.js" async="async"></script><script type="text/javascript" src="../../../scripts/platform-content-handler.js" async="async"></script><script type="text/javascript" src="../../../scripts/main.js" defer="defer"></script><script type="text/javascript" src="../../../scripts/prism.js" async="async"></script> </head> <body> <div class="navigation-wrapper" id="navigation-wrapper"> <div id="leftToggler"><span class="icon-toggler"></span></div> <div class="library-name"><a href="../../../index.html">haishinkit</a></div> <div>0.5.1</div> <div class="pull-right d-flex"><button id="theme-toggle-button"><span id="theme-toggle"></span></button> <div id="searchBar"></div> </div> </div> <div id="container"> <div id="leftColumn"> <div id="sideMenu"></div> </div> <div id="main"> <div class="main-content" id="content" pageIds="haishinkit::com.haishinkit.rtmp/RtmpConnection/pageUrl/#/PointingToDeclaration//-473192002"> <div class="breadcrumbs"><a href="../../../index.html">haishinkit</a>/<a href="../index.html">com.haishinkit.rtmp</a>/<a href="index.html">RtmpConnection</a>/<a href="page-url.html">pageUrl</a></div> <div class="cover "> <h1 class="cover"><span>page</span><wbr></wbr><span><span>Url</span></span></h1> </div> <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":haishinkit:dokkaHtml/release"><div class="symbol monospace"><span class="token keyword"></span><span class="token keyword">var </span><a href="page-url.html">pageUrl</a><span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="token operator">?</span><span class="token operator"> = </span>null<span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><p class="paragraph">The URL of an HTTP referer.</p></div></div> </div> <div class="footer"><span class="go-to-top-icon"><a href="#content" id="go-to-top-link"></a></span><span>© 2022 Copyright</span><span class="pull-right"><span>Generated by </span><a href="https://github.com/Kotlin/dokka"><span>dokka</span><span class="padded-icon"></span></a></span></div> </div> </div> </body> </html>
{ "content_hash": "0376e62a1e5ae03e5db9d74ad5294c54", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 870, "avg_line_length": 96.37837837837837, "alnum_prop": 0.6525518788558609, "repo_name": "shogo4405/HaishinKit.java", "id": "dfdde60eb1e95f6c893348ea93b1ea900d81c34a", "size": "3567", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "docs/haishinkit/com.haishinkit.rtmp/-rtmp-connection/page-url.html", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Java", "bytes": "137573" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <resources> <color name="grey_9">@color/text</color> <!--12/13/2015 action bar button select color--> <color name="grey_8">#30ffffff</color> <color name="grey_7">@color/text</color> <color name="grey_6">@color/text</color> <color name="grey_5">@color/texttt</color> <color name="grey_4">@color/texttt</color> <color name="grey_3">@color/textt</color> <color name="grey_2">@color/text</color> <color name="grey_1_5">@color/texttt</color> <color name="grey_1">@color/texttt</color> <color name="grey_0_5">@color/text</color> <color name="blue_9">@color/text</color> <color name="blue_8">@color/text</color> <color name="blue_7">@color/text</color> <!--12/12/2015 selected button action bar color--> <color name="blue_6">#33ffffff</color> <color name="blue_5">@color/text</color> <color name="blue_4">@color/text</color> <color name="blue_3">@color/text</color> <color name="blue_2">@color/text</color> <color name="blue_1">@color/background</color> <color name="accent_blue_9">@color/text</color> <color name="accent_blue_8">@color/text</color> <color name="accent_blue_7">@color/text</color> <color name="accent_blue_6">@color/text</color> <color name="accent_blue_5">@color/text</color> <color name="accent_blue_4">@color/text</color> <color name="accent_blue_3">@color/text</color> <color name="accent_blue_2">@color/text</color> <color name="accent_blue_1">@color/text</color> <!--<color name="grey_dark">@color/grey_7</color>--> <!--<color name="grey_medium">@color/grey_5</color>--> <!--<color name="grey_light">@color/grey_3</color>--> <color name="white">#89ABC4</color> <color name="white_transparent">#80ffffff</color> <color name="black">@color/text</color> <color name="black_transparent">#80000000</color> <color name="black_40_transparent">#66000000</color> <color name="dialog_background">#55000000</color> <color name="image_placeholder">@color/background</color> <color name="action_bar_top_highlight">#a0111111</color> <color name="dark_action_bar_top_highlight">#a0111111</color> <color name="action_bar_transparent_background">@color/background_tint</color> <color name="action_bar_transparent_background_pressed_state">#a0111111</color> <color name="action_bar_semi_transparent_white">#bf000000</color> <color name="status_bar_blue_background">@color/background_tint</color> <color name="nux_dayone_email_enabled">#20ffffff</color> <color name="nux_dayone_email_pressed">#30ffffff</color> <color name="nux_dayone_log_in_enabled">#10ffffff</color> <color name="nux_dayone_log_in_pressed">#18ffffff</color> <color name="multi_reg_token_fill">#fffbfbfb</color> <color name="multi_reg_token_border">#22ffffff</color> <color name="multi_reg_token_text">@color/text</color> <color name="null_state_color">#33ffffff</color> <color name="seek_bar_inactive_color">@color/texttt</color> <color name="seek_bar_active_color">@color/text</color> <color name="pill_background">#d9000000</color> <color name="pill_background_pressed">#d9111111</color> <color name="pill_background_outline">#26ffffff</color> <color name="pill_background_outline_pressed">#4dffffff</color> <color name="video_camcorder_dialog_text_color">@color/text</color> <color name="camcorder_shutter_outer_ring_disabled">@color/backgroundd</color> <color name="filmstrip_dimmer">#cd000000</color> <color name="camera_shutter_outer_ring">#ff3383ce</color> <color name="camera_shutter_outer_ring_pressed">#ff20588c</color> <color name="light_gray">@color/textt</color> <color name="gray">@color/background</color> <color name="iosblue">#ff0044e2</color> <color name="alt_list_bg_color">@color/background</color> <color name="photo_map_disabled_text">#ff98d281</color> <color name="default_slideout_icon_text_color">@color/text</color> <color name="default_slideout_icon_background">#b3000000</color> <color name="default_tab_indicator_color">@color/text</color> <color name="default_circle_indicator_fill_color">#ffffffff</color> <color name="default_circle_indicator_page_color">#00000000</color> <color name="default_circle_indicator_stroke_color">#ffdddddd</color> <color name="people_tagging_search_background_default">@color/background</color> <color name="starred_hide_shoutout_color">@color/backgroundd</color> <color name="results_text_color">@color/text</color> <color name="result_bar_active_color">#ff4999da</color> <color name="disabled_text_off_white">#50ffffff</color> <color name="white_30_alpha">#4dffffff</color> <!--10/27/2015--> <!--<color name="green_9">#ff0a1304</color>--> <!--<color name="green_8">#ff1e380d</color>--> <!--<color name="green_7">#ff335e15</color>--> <color name="green_6">@color/backgroundd</color> <color name="green_5">@color/background</color> <color name="green_4">@color/background</color> <!--<color name="green_3">#ffb3de95</color>--> <!--<color name="green_2">#ffb3de95</color>--> <!--<color name="green_1">#fff0f9ea</color>--> <!--12/13/2015--> <color name="grey_0_7">#80000000</color> <color name="bugreporter_takescreenshot_capture_background">#99e5ffe5</color> <color name="bugreporter_takescreenshot_cancel_background">#99ffe6cc</color> <color name="bugreporter_takescreenshot_capture_background_border">#995bc25b</color> <color name="bugreporter_takescreenshot_cancel_background_border">#99ffa736</color> </resources>
{ "content_hash": "61bdf7adb193c9de34b0102ae5c908cc", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 88, "avg_line_length": 47.43333333333333, "alnum_prop": 0.676563598032326, "repo_name": "PitchedApps/Material-Glass", "id": "f563311b5423ddb88d64efbddf57d5c37f26651c", "size": "5692", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Material-Glass/src/main/assets/overlays/com.oginstagm.android/res/values/colors.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "597650" } ], "symlink_target": "" }
from .network_utils import * from .network_bodies import * class VanillaNet(nn.Module, BaseNet): def __init__(self, output_dim, body): super(VanillaNet, self).__init__() self.fc_head = layer_init(nn.Linear(body.feature_dim, output_dim)) self.body = body self.to(Config.DEVICE) def forward(self, x): phi = self.body(tensor(x)) q = self.fc_head(phi) return dict(q=q) class DuelingNet(nn.Module, BaseNet): def __init__(self, action_dim, body): super(DuelingNet, self).__init__() self.fc_value = layer_init(nn.Linear(body.feature_dim, 1)) self.fc_advantage = layer_init(nn.Linear(body.feature_dim, action_dim)) self.body = body self.to(Config.DEVICE) def forward(self, x, to_numpy=False): phi = self.body(tensor(x)) value = self.fc_value(phi) advantange = self.fc_advantage(phi) q = value.expand_as(advantange) + (advantange - advantange.mean(1, keepdim=True).expand_as(advantange)) return dict(q=q) class CategoricalNet(nn.Module, BaseNet): def __init__(self, action_dim, num_atoms, body): super(CategoricalNet, self).__init__() self.fc_categorical = layer_init(nn.Linear(body.feature_dim, action_dim * num_atoms)) self.action_dim = action_dim self.num_atoms = num_atoms self.body = body self.to(Config.DEVICE) def forward(self, x): phi = self.body(tensor(x)) pre_prob = self.fc_categorical(phi).view((-1, self.action_dim, self.num_atoms)) prob = F.softmax(pre_prob, dim=-1) log_prob = F.log_softmax(pre_prob, dim=-1) return dict(prob=prob, log_prob=log_prob) class RainbowNet(nn.Module, BaseNet): def __init__(self, action_dim, num_atoms, body, noisy_linear): super(RainbowNet, self).__init__() if noisy_linear: self.fc_value = NoisyLinear(body.feature_dim, num_atoms) self.fc_advantage = NoisyLinear(body.feature_dim, action_dim * num_atoms) else: self.fc_value = layer_init(nn.Linear(body.feature_dim, num_atoms)) self.fc_advantage = layer_init(nn.Linear(body.feature_dim, action_dim * num_atoms)) self.action_dim = action_dim self.num_atoms = num_atoms self.body = body self.noisy_linear = noisy_linear self.to(Config.DEVICE) def reset_noise(self): if self.noisy_linear: self.fc_value.reset_noise() self.fc_advantage.reset_noise() self.body.reset_noise() def forward(self, x): phi = self.body(tensor(x)) value = self.fc_value(phi).view((-1, 1, self.num_atoms)) advantage = self.fc_advantage(phi).view(-1, self.action_dim, self.num_atoms) q = value + (advantage - advantage.mean(1, keepdim=True)) prob = F.softmax(q, dim=-1) log_prob = F.log_softmax(q, dim=-1) return dict(prob=prob, log_prob=log_prob) class QuantileNet(nn.Module, BaseNet): def __init__(self, action_dim, num_quantiles, body): super(QuantileNet, self).__init__() self.fc_quantiles = layer_init(nn.Linear(body.feature_dim, action_dim * num_quantiles)) self.action_dim = action_dim self.num_quantiles = num_quantiles self.body = body self.to(Config.DEVICE) def forward(self, x): phi = self.body(tensor(x)) quantiles = self.fc_quantiles(phi) quantiles = quantiles.view((-1, self.action_dim, self.num_quantiles)) return dict(quantile=quantiles) class OptionCriticNet(nn.Module, BaseNet): def __init__(self, body, action_dim, num_options): super(OptionCriticNet, self).__init__() self.fc_q = layer_init(nn.Linear(body.feature_dim, num_options)) self.fc_pi = layer_init(nn.Linear(body.feature_dim, num_options * action_dim)) self.fc_beta = layer_init(nn.Linear(body.feature_dim, num_options)) self.num_options = num_options self.action_dim = action_dim self.body = body self.to(Config.DEVICE) def forward(self, x): phi = self.body(tensor(x)) q = self.fc_q(phi) beta = F.sigmoid(self.fc_beta(phi)) pi = self.fc_pi(phi) pi = pi.view(-1, self.num_options, self.action_dim) log_pi = F.log_softmax(pi, dim=-1) pi = F.softmax(pi, dim=-1) return {'q': q, 'beta': beta, 'log_pi': log_pi, 'pi': pi} class DeterministicActorCriticNet(nn.Module, BaseNet): def __init__(self, state_dim, action_dim, actor_opt_fn, critic_opt_fn, phi_body=None, actor_body=None, critic_body=None): super(DeterministicActorCriticNet, self).__init__() if phi_body is None: phi_body = DummyBody(state_dim) if actor_body is None: actor_body = DummyBody(phi_body.feature_dim) if critic_body is None: critic_body = DummyBody(phi_body.feature_dim) self.phi_body = phi_body self.actor_body = actor_body self.critic_body = critic_body self.fc_action = layer_init(nn.Linear(actor_body.feature_dim, action_dim), 1e-3) self.fc_critic = layer_init(nn.Linear(critic_body.feature_dim, 1), 1e-3) self.actor_params = list(self.actor_body.parameters()) + list(self.fc_action.parameters()) self.critic_params = list(self.critic_body.parameters()) + list(self.fc_critic.parameters()) self.phi_params = list(self.phi_body.parameters()) self.actor_opt = actor_opt_fn(self.actor_params + self.phi_params) self.critic_opt = critic_opt_fn(self.critic_params + self.phi_params) self.to(Config.DEVICE) def forward(self, obs): phi = self.feature(obs) action = self.actor(phi) return action def feature(self, obs): obs = tensor(obs) return self.phi_body(obs) def actor(self, phi): return torch.tanh(self.fc_action(self.actor_body(phi))) def critic(self, phi, a): return self.fc_critic(self.critic_body(torch.cat([phi, a], dim=1))) class GaussianActorCriticNet(nn.Module, BaseNet): def __init__(self, state_dim, action_dim, phi_body=None, actor_body=None, critic_body=None): super(GaussianActorCriticNet, self).__init__() if phi_body is None: phi_body = DummyBody(state_dim) if actor_body is None: actor_body = DummyBody(phi_body.feature_dim) if critic_body is None: critic_body = DummyBody(phi_body.feature_dim) self.phi_body = phi_body self.actor_body = actor_body self.critic_body = critic_body self.fc_action = layer_init(nn.Linear(actor_body.feature_dim, action_dim), 1e-3) self.fc_critic = layer_init(nn.Linear(critic_body.feature_dim, 1), 1e-3) self.std = nn.Parameter(torch.zeros(action_dim)) self.phi_params = list(self.phi_body.parameters()) self.actor_params = list(self.actor_body.parameters()) + list(self.fc_action.parameters()) + self.phi_params self.actor_params.append(self.std) self.critic_params = list(self.critic_body.parameters()) + list(self.fc_critic.parameters()) + self.phi_params self.to(Config.DEVICE) def forward(self, obs, action=None): obs = tensor(obs) phi = self.phi_body(obs) phi_a = self.actor_body(phi) phi_v = self.critic_body(phi) mean = torch.tanh(self.fc_action(phi_a)) v = self.fc_critic(phi_v) dist = torch.distributions.Normal(mean, F.softplus(self.std)) if action is None: action = dist.sample() log_prob = dist.log_prob(action).sum(-1).unsqueeze(-1) entropy = dist.entropy().sum(-1).unsqueeze(-1) return {'action': action, 'log_pi_a': log_prob, 'entropy': entropy, 'mean': mean, 'v': v} class CategoricalActorCriticNet(nn.Module, BaseNet): def __init__(self, state_dim, action_dim, phi_body=None, actor_body=None, critic_body=None): super(CategoricalActorCriticNet, self).__init__() if phi_body is None: phi_body = DummyBody(state_dim) if actor_body is None: actor_body = DummyBody(phi_body.feature_dim) if critic_body is None: critic_body = DummyBody(phi_body.feature_dim) self.phi_body = phi_body self.actor_body = actor_body self.critic_body = critic_body self.fc_action = layer_init(nn.Linear(actor_body.feature_dim, action_dim), 1e-3) self.fc_critic = layer_init(nn.Linear(critic_body.feature_dim, 1), 1e-3) self.actor_params = list(self.actor_body.parameters()) + list(self.fc_action.parameters()) self.critic_params = list(self.critic_body.parameters()) + list(self.fc_critic.parameters()) self.phi_params = list(self.phi_body.parameters()) self.to(Config.DEVICE) def forward(self, obs, action=None): obs = tensor(obs) phi = self.phi_body(obs) phi_a = self.actor_body(phi) phi_v = self.critic_body(phi) logits = self.fc_action(phi_a) v = self.fc_critic(phi_v) dist = torch.distributions.Categorical(logits=logits) if action is None: action = dist.sample() log_prob = dist.log_prob(action).unsqueeze(-1) entropy = dist.entropy().unsqueeze(-1) return {'action': action, 'log_pi_a': log_prob, 'entropy': entropy, 'v': v} class TD3Net(nn.Module, BaseNet): def __init__(self, action_dim, actor_body_fn, critic_body_fn, actor_opt_fn, critic_opt_fn, ): super(TD3Net, self).__init__() self.actor_body = actor_body_fn() self.critic_body_1 = critic_body_fn() self.critic_body_2 = critic_body_fn() self.fc_action = layer_init(nn.Linear(self.actor_body.feature_dim, action_dim), 1e-3) self.fc_critic_1 = layer_init(nn.Linear(self.critic_body_1.feature_dim, 1), 1e-3) self.fc_critic_2 = layer_init(nn.Linear(self.critic_body_2.feature_dim, 1), 1e-3) self.actor_params = list(self.actor_body.parameters()) + list(self.fc_action.parameters()) self.critic_params = list(self.critic_body_1.parameters()) + list(self.fc_critic_1.parameters()) +\ list(self.critic_body_2.parameters()) + list(self.fc_critic_2.parameters()) self.actor_opt = actor_opt_fn(self.actor_params) self.critic_opt = critic_opt_fn(self.critic_params) self.to(Config.DEVICE) def forward(self, obs): obs = tensor(obs) return torch.tanh(self.fc_action(self.actor_body(obs))) def q(self, obs, a): obs = tensor(obs) a = tensor(a) x = torch.cat([obs, a], dim=1) q_1 = self.fc_critic_1(self.critic_body_1(x)) q_2 = self.fc_critic_2(self.critic_body_2(x)) return q_1, q_2
{ "content_hash": "41e02228db58d99db5f49f193f4f191c", "timestamp": "", "source": "github", "line_count": 287, "max_line_length": 118, "avg_line_length": 39.42857142857143, "alnum_prop": 0.5894308943089431, "repo_name": "ShangtongZhang/DeepRL", "id": "a0de388eb2b5f669faa115c9288bd6e6d8b29755", "size": "11677", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "deep_rl/network/network_heads.py", "mode": "33188", "license": "mit", "language": [ { "name": "Dockerfile", "bytes": "2007" }, { "name": "Python", "bytes": "136922" }, { "name": "Shell", "bytes": "1453" } ], "symlink_target": "" }
class AuthorsScreen { public: static void printAuthorsScreen(); }; #endif //WPS_PIN_GENERATOR_AUTHORSSCREEN_H
{ "content_hash": "6fdb12909c3b495dffab04ae21674398", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 42, "avg_line_length": 18.666666666666668, "alnum_prop": 0.7678571428571429, "repo_name": "bertof/WPS-pin-generator", "id": "b8ca725cae5739070184a2a4a88e4ba2ada6c0fc", "size": "236", "binary": false, "copies": "1", "ref": "refs/heads/ReleaseCandidate", "path": "Graphics/AuthorsScreen/AuthorsScreen.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C++", "bytes": "3913" }, { "name": "CMake", "bytes": "344" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>search-trees: 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.14.1 / search-trees - 8.6.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> search-trees <small> 8.6.0 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-05-12 13:34:30 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-05-12 13:34:30 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.14.1 Formal proof management system dune 3.1.1 Fast, portable, and opinionated build system ocaml 4.07.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.07.1 Official release 4.07.1 ocaml-config 1 OCaml Switch Configuration ocaml-secondary-compiler 4.08.1-1 OCaml 4.08.1 Secondary Switch Compiler ocamlfind 1.9.1 A library manager for OCaml ocamlfind-secondary 1.9.1 Adds support for ocaml-secondary-compiler to ocamlfind zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;Hugo.Herbelin@inria.fr&quot; homepage: &quot;https://github.com/coq-contribs/search-trees&quot; license: &quot;LGPL 2.1&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/SearchTrees&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.6&quot; &amp; &lt; &quot;8.7~&quot;} ] tags: [ &quot;keyword: binary search trees&quot; &quot;category: Computer Science/Data Types and Data Structures&quot; &quot;category: Miscellaneous/Extracted Programs/Data structures&quot; ] authors: [ &quot;Pierre Castéran&quot; ] bug-reports: &quot;https://github.com/coq-contribs/search-trees/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/search-trees.git&quot; synopsis: &quot;Binary Search Trees&quot; description: &quot;Algorithms for collecting, searching, inserting and deleting elements in binary search trees on nat&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/search-trees/archive/v8.6.0.tar.gz&quot; checksum: &quot;md5=efa221306fe35f9800479f05a770bf8d&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-search-trees.8.6.0 coq.8.14.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.14.1). The following dependencies couldn&#39;t be met: - coq-search-trees -&gt; coq &lt; 8.7~ -&gt; ocaml &lt; 4.06.0 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-search-trees.8.6.0</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": "7c2fecc5c1346ea0c7d9e6aeb0bf833e", "timestamp": "", "source": "github", "line_count": 165, "max_line_length": 191, "avg_line_length": 43.17575757575757, "alnum_prop": 0.5425322852330151, "repo_name": "coq-bench/coq-bench.github.io", "id": "35fae6459517162f2b64062733855f75ccac5dac", "size": "7150", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.07.1-2.0.6/released/8.14.1/search-trees/8.6.0.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
package AutoLoader; use Carp; $DB::sub = $DB::sub; # Avoid warning =head1 NAME AutoLoader - load functions only on demand =head1 SYNOPSIS package FOOBAR; use Exporter; use AutoLoader; @ISA = qw(Exporter AutoLoader); =head1 DESCRIPTION This module tells its users that functions in the FOOBAR package are to be autoloaded from F<auto/$AUTOLOAD.al>. See L<perlsub/"Autoloading"> and L<AutoSplit>. =head2 __END__ The module using the autoloader should have the special marker C<__END__> prior to the actual subroutine declarations. All code that is before the marker will be loaded and compiled when the module is used. At the marker, perl will cease reading and parsing. See also the B<AutoSplit> module, a utility that automatically splits a module into a collection of files for autoloading. When a subroutine not yet in memory is called, the C<AUTOLOAD> function attempts to locate it in a directory relative to the location of the module file itself. As an example, assume F<POSIX.pm> is located in F</usr/local/lib/perl5/POSIX.pm>. The autoloader will look for perl subroutines for this package in F</usr/local/lib/perl5/auto/POSIX/*.al>. The C<.al> file is named using the subroutine name, sans package. =head2 Loading Stubs The B<AutoLoader> module provide a special import() method that will load the stubs (from F<autosplit.ix> file) of the calling module. These stubs are needed to make inheritance work correctly for class modules. Modules that inherit from B<AutoLoader> should always ensure that they override the AutoLoader->import() method. If the module inherit from B<Exporter> like shown in the I<synopis> section this is already taken care of. For class methods an empty import() would do nicely: package MyClass; use AutoLoader; # load stubs @ISA=qw(AutoLoader); sub import {} # hide AutoLoader::import You can also set up autoloading by importing the AUTOLOAD function instead of inheriting from B<AutoLoader>: package MyClass; use AutoLoader; # load stubs *AUTOLOAD = \&AutoLoader::AUTOLOAD; =head2 Package Lexicals Package lexicals declared with C<my> in the main block of a package using the B<AutoLoader> will not be visible to auto-loaded functions, due to the fact that the given scope ends at the C<__END__> marker. A module using such variables as package globals will not work properly under the B<AutoLoader>. The C<vars> pragma (see L<perlmod/"vars">) may be used in such situations as an alternative to explicitly qualifying all globals with the package namespace. Variables pre-declared with this pragma will be visible to any autoloaded routines (but will not be invisible outside the package, unfortunately). =head2 AutoLoader vs. SelfLoader The B<AutoLoader> is a counterpart to the B<SelfLoader> module. Both delay the loading of subroutines, but the B<SelfLoader> accomplishes the goal via the C<__DATA__> marker rather than C<__END__>. While this avoids the use of a hierarchy of disk files and the associated open/close for each routine loaded, the B<SelfLoader> suffers a disadvantage in the one-time parsing of the lines after C<__DATA__>, after which routines are cached. B<SelfLoader> can also handle multiple packages in a file. B<AutoLoader> only reads code as it is requested, and in many cases should be faster, but requires a machanism like B<AutoSplit> be used to create the individual files. The B<ExtUtils::MakeMaker> will invoke B<AutoSplit> automatically if the B<AutoLoader> is used in a module source file. =head1 CAVEAT On systems with restrictions on file name length, the file corresponding to a subroutine may have a shorter name that the routine itself. This can lead to conflicting file names. The I<AutoSplit> package warns of these potential conflicts when used to split a module. Calling foo($1) for the autoloaded function foo() might not work as expected, because the AUTOLOAD function of B<AutoLoader> clobbers the regexp variables. Invoking it as foo("$1") avoids this problem. =cut AUTOLOAD { my $name = "auto/$AUTOLOAD.al"; # Braces used on the s/// below to preserve $1 et al. {$name =~ s#::#/#g} my $save = $@; eval {require $name}; if ($@) { if (substr($AUTOLOAD,-9) eq '::DESTROY') { *$AUTOLOAD = sub {}; } else { # The load might just have failed because the filename was too # long for some old SVR3 systems which treat long names as errors. # If we can succesfully truncate a long name then it's worth a go. # There is a slight risk that we could pick up the wrong file here # but autosplit should have warned about that when splitting. if ($name =~ s/(\w{12,})\.al$/substr($1,0,11).".al"/e){ eval {require $name}; } if ($@){ $@ =~ s/ at .*\n//; croak $@; } } } $@ = $save; $DB::sub = $AUTOLOAD; # Now debugger know where we are. goto &$AUTOLOAD; } sub import { my ($callclass, $callfile, $callline,$path,$callpack) = caller(0); ($callpack = $callclass) =~ s#::#/#; # Try to find the autosplit index file. Eg., if the call package # is POSIX, then $INC{POSIX.pm} is something like # '/usr/local/lib/perl5/POSIX.pm', and the autosplit index file is in # '/usr/local/lib/perl5/auto/POSIX/autosplit.ix', so we require that. # # However, if @INC is a relative path, this might not work. If, # for example, @INC = ('lib'), then # $INC{POSIX.pm} is 'lib/POSIX.pm', and we want to require # 'auto/POSIX/autosplit.ix' (without the leading 'lib'). # if (defined($path = $INC{$callpack . '.pm'})) { # Try absolute path name. $path =~ s#^(.*)$callpack\.pm$#$1auto/$callpack/autosplit.ix#; eval { require $path; }; # If that failed, try relative path with normal @INC searching. if ($@) { $path ="auto/$callpack/autosplit.ix"; eval { require $path; }; } carp $@ if ($@); } } 1;
{ "content_hash": "ec5eeb490b85cd247b6001b962928617", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 77, "avg_line_length": 37.333333333333336, "alnum_prop": 0.7080525606469003, "repo_name": "pitpitman/GraduateWork", "id": "7d781d13c07776170d13eaa620ca2ea75afa87af", "size": "5936", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "EE590/Perl_Scripts/autoloader.pm", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "66281" }, { "name": "C", "bytes": "143599" }, { "name": "C++", "bytes": "86459" }, { "name": "CSS", "bytes": "26409" }, { "name": "Common Lisp", "bytes": "2491" }, { "name": "Groff", "bytes": "50553" }, { "name": "HTML", "bytes": "9543552" }, { "name": "Java", "bytes": "4712599" }, { "name": "JavaScript", "bytes": "4227" }, { "name": "Makefile", "bytes": "6748" }, { "name": "Perl", "bytes": "379818" }, { "name": "Perl6", "bytes": "2424" }, { "name": "PostScript", "bytes": "628801" }, { "name": "Prolog", "bytes": "22274" }, { "name": "Shell", "bytes": "178966" }, { "name": "XSLT", "bytes": "10526" } ], "symlink_target": "" }
#ifndef PARTBOUNDS_H #define PARTBOUNDS_H #include "fmgr.h" #include "nodes/parsenodes.h" #include "nodes/pg_list.h" #include "partitioning/partdefs.h" #include "utils/relcache.h" /* * PartitionBoundInfoData encapsulates a set of partition bounds. It is * usually associated with partitioned tables as part of its partition * descriptor, but may also be used to represent a virtual partitioned * table such as a partitioned joinrel within the planner. * * A list partition datum that is known to be NULL is never put into the * datums array. Instead, it is tracked using the null_index field. * * In the case of range partitioning, ndatums will typically be far less than * 2 * nparts, because a partition's upper bound and the next partition's lower * bound are the same in most common cases, and we only store one of them (the * upper bound). In case of hash partitioning, ndatums will be same as the * number of partitions. * * For range and list partitioned tables, datums is an array of datum-tuples * with key->partnatts datums each. For hash partitioned tables, it is an array * of datum-tuples with 2 datums, modulus and remainder, corresponding to a * given partition. * * The datums in datums array are arranged in increasing order as defined by * functions qsort_partition_rbound_cmp(), qsort_partition_list_value_cmp() and * qsort_partition_hbound_cmp() for range, list and hash partitioned tables * respectively. For range and list partitions this simply means that the * datums in the datums array are arranged in increasing order as defined by * the partition key's operator classes and collations. * * In the case of list partitioning, the indexes array stores one entry for * every datum, which is the index of the partition that accepts a given datum. * In case of range partitioning, it stores one entry per distinct range * datum, which is the index of the partition for which a given datum * is an upper bound. In the case of hash partitioning, the number of the * entries in the indexes array is same as the greatest modulus amongst all * partitions. For a given partition key datum-tuple, the index of the * partition which would accept that datum-tuple would be given by the entry * pointed by remainder produced when hash value of the datum-tuple is divided * by the greatest modulus. */ typedef struct PartitionBoundInfoData { char strategy; /* hash, list or range? */ int ndatums; /* Length of the datums following array */ Datum **datums; PartitionRangeDatumKind **kind; /* The kind of each range bound datum; * NULL for hash and list partitioned * tables */ int *indexes; /* Partition indexes */ int null_index; /* Index of the null-accepting partition; -1 * if there isn't one */ int default_index; /* Index of the default partition; -1 if there * isn't one */ } PartitionBoundInfoData; #define partition_bound_accepts_nulls(bi) ((bi)->null_index != -1) #define partition_bound_has_default(bi) ((bi)->default_index != -1) extern int get_hash_partition_greatest_modulus(PartitionBoundInfo b); extern uint64 compute_partition_hash_value(int partnatts, FmgrInfo *partsupfunc, Oid *partcollation, Datum *values, bool *isnull); extern List *get_qual_from_partbound(Relation rel, Relation parent, PartitionBoundSpec *spec); extern PartitionBoundInfo partition_bounds_create(PartitionBoundSpec **boundspecs, int nparts, PartitionKey key, int **mapping); extern bool partition_bounds_equal(int partnatts, int16 *parttyplen, bool *parttypbyval, PartitionBoundInfo b1, PartitionBoundInfo b2); extern PartitionBoundInfo partition_bounds_copy(PartitionBoundInfo src, PartitionKey key); extern bool partitions_are_ordered(PartitionBoundInfo boundinfo, int nparts); extern void check_new_partition_bound(char *relname, Relation parent, PartitionBoundSpec *spec); extern void check_default_partition_contents(Relation parent, Relation defaultRel, PartitionBoundSpec *new_spec); extern int32 partition_rbound_datum_cmp(FmgrInfo *partsupfunc, Oid *partcollation, Datum *rb_datums, PartitionRangeDatumKind *rb_kind, Datum *tuple_datums, int n_tuple_datums); extern int partition_list_bsearch(FmgrInfo *partsupfunc, Oid *partcollation, PartitionBoundInfo boundinfo, Datum value, bool *is_equal); extern int partition_range_datum_bsearch(FmgrInfo *partsupfunc, Oid *partcollation, PartitionBoundInfo boundinfo, int nvalues, Datum *values, bool *is_equal); extern int partition_hash_bsearch(PartitionBoundInfo boundinfo, int modulus, int remainder); #endif /* PARTBOUNDS_H */
{ "content_hash": "f7e52d0ce27a0c19e5a1cfeea0e4fce9", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 82, "avg_line_length": 46.46153846153846, "alnum_prop": 0.7274420529801324, "repo_name": "50wu/gpdb", "id": "8585c29c92f5f13ea4d5c7d54da311bc58d19a83", "size": "5120", "binary": false, "copies": "10", "ref": "refs/heads/main", "path": "src/include/partitioning/partbounds.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "3266" }, { "name": "Awk", "bytes": "836" }, { "name": "Batchfile", "bytes": "15613" }, { "name": "C", "bytes": "48333944" }, { "name": "C++", "bytes": "12669653" }, { "name": "CMake", "bytes": "41361" }, { "name": "DTrace", "bytes": "3833" }, { "name": "Emacs Lisp", "bytes": "4164" }, { "name": "Fortran", "bytes": "14873" }, { "name": "GDB", "bytes": "576" }, { "name": "Gherkin", "bytes": "497627" }, { "name": "HTML", "bytes": "215381" }, { "name": "JavaScript", "bytes": "23969" }, { "name": "Lex", "bytes": "254578" }, { "name": "M4", "bytes": "133878" }, { "name": "Makefile", "bytes": "510880" }, { "name": "PLpgSQL", "bytes": "9268834" }, { "name": "Perl", "bytes": "1161283" }, { "name": "PowerShell", "bytes": "422" }, { "name": "Python", "bytes": "3396833" }, { "name": "Roff", "bytes": "30385" }, { "name": "Ruby", "bytes": "299639" }, { "name": "SCSS", "bytes": "339" }, { "name": "Shell", "bytes": "404604" }, { "name": "XS", "bytes": "7098" }, { "name": "XSLT", "bytes": "448" }, { "name": "Yacc", "bytes": "747692" }, { "name": "sed", "bytes": "1231" } ], "symlink_target": "" }
ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "e0e7d63215b3a1d93d1f630fa4fe1237", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.307692307692308, "alnum_prop": 0.6940298507462687, "repo_name": "mdoering/backbone", "id": "b50aaea49cff70daa2f54d743cdf4f4f87c71e2c", "size": "185", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Fabales/Fabaceae/Eriosema/Eriosema pentaphyllum/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
dep "cocoapods.gem" do installs "cocoapods" provides "pod" end dep "xcpretty.gem" do installs "xcpretty" provides "xcpretty" end dep "Alcatraz Package Manager" do met? { "~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin".p.exists? } meet { log_shell "Installing Alcatraz Package Manager", "curl -fsSL https://raw.github.com/supermarin/Alcatraz/master/Scripts/install.sh | sh" } end dep "ios" do requires "cocoapods.gem" requires "xcpretty.gem" requires "Alcatraz Package Manager" end
{ "content_hash": "4109a5807dcd48dbee7f8cd6da61f0d2", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 139, "avg_line_length": 22, "alnum_prop": 0.7236363636363636, "repo_name": "vpalivela/babushka-deps", "id": "fdc1a59d89b150ed39fe7dc9acd647037c09666c", "size": "550", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ios.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "2743" } ], "symlink_target": "" }
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <title>Iteration Limits Policies</title> <link rel="stylesheet" href="../../math.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> <link rel="home" href="../../index.html" title="Math Toolkit 2.5.1"> <link rel="up" href="../pol_ref.html" title="Policy Reference"> <link rel="prev" href="precision_pol.html" title="Precision Policies"> <link rel="next" href="policy_defaults.html" title="Using Macros to Change the Policy Defaults"> </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="precision_pol.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../pol_ref.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="policy_defaults.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="math_toolkit.pol_ref.iteration_pol"></a><a class="link" href="iteration_pol.html" title="Iteration Limits Policies">Iteration Limits Policies</a> </h3></div></div></div> <p> There are two policies that effect the iterative algorithms used to implement the special functions in this library: </p> <pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">unsigned</span> <span class="keyword">long</span> <span class="identifier">limit</span> <span class="special">=</span> <span class="identifier">BOOST_MATH_MAX_SERIES_ITERATION_POLICY</span><span class="special">&gt;</span> <span class="keyword">class</span> <span class="identifier">max_series_iterations</span><span class="special">;</span> <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">unsigned</span> <span class="keyword">long</span> <span class="identifier">limit</span> <span class="special">=</span> <span class="identifier">BOOST_MATH_MAX_ROOT_ITERATION_POLICY</span><span class="special">&gt;</span> <span class="keyword">class</span> <span class="identifier">max_root_iterations</span><span class="special">;</span> </pre> <p> The class <code class="computeroutput"><span class="identifier">max_series_iterations</span></code> determines the maximum number of iterations permitted in a series evaluation, before the special function gives up and returns the result of <a class="link" href="../error_handling.html#math_toolkit.error_handling.evaluation_error">evaluation_error</a>. </p> <p> The class <code class="computeroutput"><span class="identifier">max_root_iterations</span></code> determines the maximum number of iterations permitted in a root-finding algorithm before the special function gives up and returns the result of <a class="link" href="../error_handling.html#math_toolkit.error_handling.evaluation_error">evaluation_error</a>. </p> </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; 2006-2010, 2012-2014 Nikhar Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam Sewani, Benjamin Sobotta, Thijs van den Berg, Daryle Walker and Xiaogang Zhang<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="precision_pol.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../pol_ref.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="policy_defaults.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> </div> </body> </html>
{ "content_hash": "2fe61a74faa76db80fd268cdcacc1191", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 437, "avg_line_length": 74.83582089552239, "alnum_prop": 0.6621459912245712, "repo_name": "keichan100yen/ode-ext", "id": "c37b4924989287b80d2cc66d264a7c47b3f00462", "size": "5014", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "boost/libs/math/doc/html/math_toolkit/pol_ref/iteration_pol.html", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "309067" }, { "name": "Batchfile", "bytes": "37875" }, { "name": "C", "bytes": "2967570" }, { "name": "C#", "bytes": "40804" }, { "name": "C++", "bytes": "189322982" }, { "name": "CMake", "bytes": "119251" }, { "name": "CSS", "bytes": "456744" }, { "name": "Cuda", "bytes": "52444" }, { "name": "DIGITAL Command Language", "bytes": "6246" }, { "name": "Fortran", "bytes": "1856" }, { "name": "Groff", "bytes": "5189" }, { "name": "HTML", "bytes": "181460055" }, { "name": "IDL", "bytes": "28" }, { "name": "JavaScript", "bytes": "419776" }, { "name": "Lex", "bytes": "1231" }, { "name": "M4", "bytes": "29689" }, { "name": "Makefile", "bytes": "1088024" }, { "name": "Max", "bytes": "36857" }, { "name": "Objective-C", "bytes": "11406" }, { "name": "Objective-C++", "bytes": "630" }, { "name": "PHP", "bytes": "68641" }, { "name": "Perl", "bytes": "36491" }, { "name": "Perl6", "bytes": "2053" }, { "name": "Python", "bytes": "1612978" }, { "name": "QML", "bytes": "593" }, { "name": "QMake", "bytes": "16692" }, { "name": "Rebol", "bytes": "354" }, { "name": "Ruby", "bytes": "5532" }, { "name": "Shell", "bytes": "354720" }, { "name": "Tcl", "bytes": "1172" }, { "name": "TeX", "bytes": "32117" }, { "name": "XSLT", "bytes": "553585" }, { "name": "Yacc", "bytes": "19623" } ], "symlink_target": "" }
module Azure::Web::Mgmt::V2020_09_01 module Models # # Custom action to be executed # when an auto heal rule is triggered. # class AutoHealCustomAction include MsRestAzure # @return [String] Executable to be run. attr_accessor :exe # @return [String] Parameters for the executable. attr_accessor :parameters # # Mapper for AutoHealCustomAction class as Ruby Hash. # This will be used for serialization/deserialization. # def self.mapper() { client_side_validation: true, required: false, serialized_name: 'AutoHealCustomAction', type: { name: 'Composite', class_name: 'AutoHealCustomAction', model_properties: { exe: { client_side_validation: true, required: false, serialized_name: 'exe', type: { name: 'String' } }, parameters: { client_side_validation: true, required: false, serialized_name: 'parameters', type: { name: 'String' } } } } } end end end end
{ "content_hash": "9471af33ebf2ac7379eff038f7804edd", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 60, "avg_line_length": 24.9811320754717, "alnum_prop": 0.48413897280966767, "repo_name": "Azure/azure-sdk-for-ruby", "id": "db747975cb22796d6bf658d583054091c085bc4b", "size": "1488", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "management/azure_mgmt_web/lib/2020-09-01/generated/azure_mgmt_web/models/auto_heal_custom_action.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "345216400" }, { "name": "Shell", "bytes": "305" } ], "symlink_target": "" }
package ProjectBackendTestProjectStructureInvalidNoPOM.src.main.java; public class Bean { private final int value; public Bean( int value ) { this.value = value; } public int getValue() { return value*7; } }
{ "content_hash": "f5d61c0cc6302207aa66d2ab5c8cc842", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 69, "avg_line_length": 15.625, "alnum_prop": 0.64, "repo_name": "cristianonicolai/kie-wb-common", "id": "d07129fa0234ce84fe3e44483679a17a5d57f7a4", "size": "800", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "kie-wb-common-services/kie-wb-common-services-backend/src/test/resources/ProjectBackendTestProjectStructureInvalidNoPOM/src/main/java/Bean.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "22894" }, { "name": "GAP", "bytes": "86221" }, { "name": "HTML", "bytes": "2645" }, { "name": "Java", "bytes": "7060792" } ], "symlink_target": "" }
AWS_REGION ?= us-west-2 # Cloudformation stack name to create, e.g. test1 STACK ?= # Stack parameters, e.g ParameterKey=KeyName,ParameterValue=KeyName ParameterKey=DomainName,ParameterValue=teleport.example.com ParameterKey=DomainAdminEmail,ParameterValue=admin@example.com ParameterKey=HostedZoneID,ParameterValue=AWSZONEID STACK_PARAMS ?= # YAML filename CF_YAML_FILENAME ?= ./oss.yaml export .PHONY: validate-template validate-template: aws cloudformation validate-template --template-body file://$(CF_YAML_FILENAME) # Stack functionality # Create .PHONY: create-stack create-stack: $(MAKE) validate-template aws --region=$(AWS_REGION) cloudformation create-stack --capabilities CAPABILITY_IAM --stack-name $(STACK) --template-body file://$(CF_YAML_FILENAME) --parameters $(STACK_PARAMS) .PHONY: create-stack-vpc create-stack-vpc: CF_YAML_FILENAME=./vpc.yaml create-stack-vpc: $(MAKE) create-stack # Update .PHONY: update-stack update-stack: $(MAKE) validate-template aws --region=$(AWS_REGION) cloudformation update-stack --capabilities CAPABILITY_IAM --stack-name $(STACK) --template-body file://$(CF_YAML_FILENAME) --parameters $(STACK_PARAMS) .PHONY: update-stack-vpc update-stack-vpc: CF_YAML_FILENAME=./vpc.yaml update-stack-vpc: $(MAKE) update-stack # Describe .PHONY: describe-stack describe-stack: @aws --region=$(AWS_REGION) cloudformation describe-stacks --stack-name $(STACK) .PHONY: describe-stack-outputs describe-stack-outputs: @aws --region=$(AWS_REGION) cloudformation describe-stacks --stack-name $(STACK) --query 'Stacks[].Outputs[]' # Delete .PHONY: delete-stack delete-stack: aws --region=$(AWS_REGION) cloudformation delete-stack --stack-name $(STACK)
{ "content_hash": "56742e729a58a39b4c574cfd36b986ef", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 241, "avg_line_length": 30.375, "alnum_prop": 0.7595532039976485, "repo_name": "gravitational/teleport", "id": "71c6ca37a6246b1f19130162a8f3b5a55c59dca1", "size": "1718", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "examples/aws/cloudformation/Makefile", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "2555707" }, { "name": "CMake", "bytes": "345" }, { "name": "Dockerfile", "bytes": "15224" }, { "name": "Go", "bytes": "15697818" }, { "name": "Groovy", "bytes": "2085" }, { "name": "HCL", "bytes": "3165" }, { "name": "HTML", "bytes": "5575" }, { "name": "Io", "bytes": "1675" }, { "name": "Jinja", "bytes": "68" }, { "name": "Makefile", "bytes": "100588" }, { "name": "Objective-C", "bytes": "21649" }, { "name": "PowerShell", "bytes": "18179" }, { "name": "Python", "bytes": "1126" }, { "name": "Rust", "bytes": "445869" }, { "name": "Shell", "bytes": "223489" } ], "symlink_target": "" }
// ---------------------------------------------------- // AIMP DotNet SDK // // Copyright (c) 2014 - 2022 Evgeniy Bogdan // https://github.com/martin211/aimp_dotnet // // Mail: mail4evgeniy@gmail.com // ---------------------------------------------------- using System.IO; using System.Text; namespace Aimp.TestRunner.Engine; /// <summary> /// ExtendedTextWrapper wraps a TextWriter and makes it /// look like an ExtendedTextWriter. All style indications /// are ignored. It's used when text is being written /// to a file. /// </summary> public class ExtendedTextWrapper : ExtendedTextWriter { private readonly TextWriter _writer; public ExtendedTextWrapper(TextWriter writer) { _writer = writer; } /// <summary> /// Gets the encoding for this ExtendedTextWriter /// </summary> public override Encoding Encoding => _writer.Encoding; /// <summary> /// Write a single char value /// </summary> public override void Write(char value) { _writer.Write(value); } /// <summary> /// Write a string value /// </summary> public override void Write(string value) { _writer.Write(value); } /// <summary> /// Write a string value followed by a NewLine /// </summary> public override void WriteLine(string value) { _writer.WriteLine(value); } /// <summary> /// Dispose the Extended TextWriter /// </summary> protected override void Dispose(bool disposing) { _writer.Dispose(); } /// <summary> /// Writes the value with the specified style. /// </summary> /// <param name="style">The style.</param> /// <param name="value">The value.</param> public override void Write(ColorStyle style, string value) { Write(value); } /// <summary> /// Writes the value with the specified style /// </summary> /// <param name="style">The style.</param> /// <param name="value">The value.</param> public override void WriteLine(ColorStyle style, string value) { WriteLine(value); } /// <summary> /// Writes the label and the option that goes with it. /// </summary> /// <param name="label">The label.</param> /// <param name="option">The option.</param> public override void WriteLabel(string label, object option) { Write(label); Write(option.ToString()); } /// <summary> /// Writes the label and the option that goes with it. /// </summary> /// <param name="label">The label.</param> /// <param name="option">The option.</param> /// <param name="valueStyle">The color to display the value with</param> public override void WriteLabel(string label, object option, ColorStyle valueStyle) { WriteLabel(label, option); } /// <summary> /// Writes the label and the option that goes with it followed by a new line. /// </summary> /// <param name="label">The label.</param> /// <param name="option">The option.</param> public override void WriteLabelLine(string label, object option) { WriteLabel(label, option); WriteLine(); } /// <summary> /// Writes the label and the option that goes with it followed by a new line. /// </summary> /// <param name="label">The label.</param> /// <param name="option">The option.</param> /// <param name="valueStyle">The color to display the value with</param> public override void WriteLabelLine(string label, object option, ColorStyle valueStyle) { WriteLabelLine(label, option); } }
{ "content_hash": "3d740b471a61207e56347839c90fc8d8", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 91, "avg_line_length": 29.476923076923075, "alnum_prop": 0.5683716075156576, "repo_name": "martin211/aimp_dotnet", "id": "d8fafdb117046e187c949ce41a80b4a47b3f1954", "size": "3834", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Tests/IntegrationTests/Engine/ExtendedTextWrapper.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "214" }, { "name": "C", "bytes": "21484" }, { "name": "C#", "bytes": "904968" }, { "name": "C++", "bytes": "1245187" }, { "name": "CSS", "bytes": "18676" }, { "name": "JavaScript", "bytes": "42990" }, { "name": "Liquid", "bytes": "2760" }, { "name": "PowerShell", "bytes": "5649" }, { "name": "Shell", "bytes": "2342" }, { "name": "XSLT", "bytes": "2166" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_45) on Thu Nov 13 21:22:01 UTC 2014 --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE> Uses of Interface org.apache.hadoop.yarn.event.Event (Apache Hadoop Main 2.6.0 API) </TITLE> <META NAME="date" CONTENT="2014-11-13"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Interface org.apache.hadoop.yarn.event.Event (Apache Hadoop Main 2.6.0 API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../org/apache/hadoop/yarn/event/Event.html" title="interface in org.apache.hadoop.yarn.event"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../index.html?org/apache/hadoop/yarn/event//class-useEvent.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="Event.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Interface<br>org.apache.hadoop.yarn.event.Event</B></H2> </CENTER> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Packages that use <A HREF="../../../../../../org/apache/hadoop/yarn/event/Event.html" title="interface in org.apache.hadoop.yarn.event">Event</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><A HREF="#org.apache.hadoop.yarn.event"><B>org.apache.hadoop.yarn.event</B></A></TD> <TD>&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <A NAME="org.apache.hadoop.yarn.event"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> Uses of <A HREF="../../../../../../org/apache/hadoop/yarn/event/Event.html" title="interface in org.apache.hadoop.yarn.event">Event</A> in <A HREF="../../../../../../org/apache/hadoop/yarn/event/package-summary.html">org.apache.hadoop.yarn.event</A></FONT></TH> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Classes in <A HREF="../../../../../../org/apache/hadoop/yarn/event/package-summary.html">org.apache.hadoop.yarn.event</A> with type parameters of type <A HREF="../../../../../../org/apache/hadoop/yarn/event/Event.html" title="interface in org.apache.hadoop.yarn.event">Event</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;interface</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/apache/hadoop/yarn/event/EventHandler.html" title="interface in org.apache.hadoop.yarn.event">EventHandler&lt;T extends Event&gt;</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Interface for handling events of type T</TD> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Classes in <A HREF="../../../../../../org/apache/hadoop/yarn/event/package-summary.html">org.apache.hadoop.yarn.event</A> that implement <A HREF="../../../../../../org/apache/hadoop/yarn/event/Event.html" title="interface in org.apache.hadoop.yarn.event">Event</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;class</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../../org/apache/hadoop/yarn/event/AbstractEvent.html" title="class in org.apache.hadoop.yarn.event">AbstractEvent&lt;TYPE extends Enum&lt;TYPE&gt;&gt;</A></B></CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Parent class of all the events.</TD> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../../org/apache/hadoop/yarn/event/package-summary.html">org.apache.hadoop.yarn.event</A> with parameters of type <A HREF="../../../../../../org/apache/hadoop/yarn/event/Event.html" title="interface in org.apache.hadoop.yarn.event">Event</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected &nbsp;void</CODE></FONT></TD> <TD><CODE><B>AsyncDispatcher.</B><B><A HREF="../../../../../../org/apache/hadoop/yarn/event/AsyncDispatcher.html#dispatch(org.apache.hadoop.yarn.event.Event)">dispatch</A></B>(<A HREF="../../../../../../org/apache/hadoop/yarn/event/Event.html" title="interface in org.apache.hadoop.yarn.event">Event</A>&nbsp;event)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left" COLSPAN="2">Constructor parameters in <A HREF="../../../../../../org/apache/hadoop/yarn/event/package-summary.html">org.apache.hadoop.yarn.event</A> with type arguments of type <A HREF="../../../../../../org/apache/hadoop/yarn/event/Event.html" title="interface in org.apache.hadoop.yarn.event">Event</A></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../../../org/apache/hadoop/yarn/event/AsyncDispatcher.html#AsyncDispatcher(java.util.concurrent.BlockingQueue)">AsyncDispatcher</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/BlockingQueue.html?is-external=true" title="class or interface in java.util.concurrent">BlockingQueue</A>&lt;<A HREF="../../../../../../org/apache/hadoop/yarn/event/Event.html" title="interface in org.apache.hadoop.yarn.event">Event</A>&gt;&nbsp;eventQueue)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../org/apache/hadoop/yarn/event/Event.html" title="interface in org.apache.hadoop.yarn.event"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../index.html?org/apache/hadoop/yarn/event//class-useEvent.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="Event.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> Copyright &#169; 2014 <a href="http://www.apache.org">Apache Software Foundation</a>. All Rights Reserved. </BODY> </HTML>
{ "content_hash": "3cb23a517214de0962fd947c9afe328d", "timestamp": "", "source": "github", "line_count": 227, "max_line_length": 506, "avg_line_length": 49, "alnum_prop": 0.6362492133417244, "repo_name": "SAT-Hadoop/hadoop-2.6.0", "id": "1243db704749128bedea9220f479761990882dfc", "size": "11123", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "share/doc/hadoop/api/org/apache/hadoop/yarn/event/class-use/Event.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "119024" }, { "name": "C", "bytes": "29572" }, { "name": "C++", "bytes": "16604" }, { "name": "CSS", "bytes": "452213" }, { "name": "HTML", "bytes": "72854691" }, { "name": "JavaScript", "bytes": "18210" }, { "name": "Shell", "bytes": "203634" }, { "name": "XSLT", "bytes": "20437" } ], "symlink_target": "" }
# Airbnb JavaScript Style Guide() { *A mostly reasonable approach to JavaScript* *Forked from [Airbnb's JavaScript Styleguide](https://github.com/airbnb/javascript) ## Table of Contents 1. [Types](#types) 1. [Objects](#objects) 1. [Arrays](#arrays) 1. [Strings](#strings) 1. [Functions](#functions) 1. [Properties](#properties) 1. [Variables](#variables) 1. [Hoisting](#hoisting) 1. [Conditional Expressions & Equality](#conditional-expressions--equality) 1. [Blocks](#blocks) 1. [Comments](#comments) 1. [Whitespace](#whitespace) 1. [Commas](#commas) 1. [Semicolons](#semicolons) 1. [Type Casting & Coercion](#type-casting--coercion) 1. [Naming Conventions](#naming-conventions) 1. [Accessors](#accessors) 1. [Constructors](#constructors) 1. [Events](#events) 1. [Modules](#modules) 1. [jQuery](#jquery) 1. [ECMAScript 5 Compatibility](#ecmascript-5-compatibility) 1. [Testing](#testing) 1. [Performance](#performance) 1. [Resources](#resources) 1. [In the Wild](#in-the-wild) 1. [Translation](#translation) 1. [The JavaScript Style Guide Guide](#the-javascript-style-guide-guide) 1. [Chat With Us About Javascript](#chat-with-us-about-javascript) 1. [Contributors](#contributors) 1. [License](#license) ## Types - **Primitives**: When you access a primitive type you work directly on its value. + `string` + `number` + `boolean` + `null` + `undefined` ```javascript var foo = 1; var bar = foo; bar = 9; console.log(foo, bar); // => 1, 9 ``` - **Complex**: When you access a complex type you work on a reference to its value. + `object` + `array` + `function` ```javascript var foo = [1, 2]; var bar = foo; bar[0] = 9; console.log(foo[0], bar[0]); // => 9, 9 ``` **[⬆ back to top](#table-of-contents)** ## Objects - Use the literal syntax for object creation. ```javascript // bad var item = new Object(); // good var item = {}; ``` - Don't use [reserved words](http://es5.github.io/#x7.6.1) as keys. It won't work in IE8. [More info](https://github.com/airbnb/javascript/issues/61). ```javascript // bad var superman = { default: { clark: 'kent' }, private: true }; // good var superman = { defaults: { clark: 'kent' }, hidden: true }; ``` - Use readable synonyms in place of reserved words. ```javascript // bad var superman = { class: 'alien' }; // bad var superman = { klass: 'alien' }; // good var superman = { type: 'alien' }; ``` **[⬆ back to top](#table-of-contents)** ## Arrays - Use the literal syntax for array creation. ```javascript // bad var items = new Array(); // good var items = []; ``` - If you don't know array length use Array#push. ```javascript var someStack = []; // bad someStack[someStack.length] = 'abracadabra'; // good someStack.push('abracadabra'); ``` - When you need to copy an array use Array#slice. [jsPerf](http://jsperf.com/converting-arguments-to-an-array/7) ```javascript var len = items.length; var itemsCopy = []; var i; // bad for (i = 0; i < len; i++) { itemsCopy[i] = items[i]; } // good itemsCopy = items.slice(); ``` - To convert an array-like object to an array, use Array#slice. ```javascript function trigger() { var args = Array.prototype.slice.call(arguments); ... } ``` **[⬆ back to top](#table-of-contents)** ## Strings - Use single quotes `''` for strings. ```javascript // bad var name = "Bob Parr"; // good var name = 'Bob Parr'; // bad var fullName = "Bob " + this.lastName; // good var fullName = 'Bob ' + this.lastName; ``` - Strings longer than 80 characters should be written across multiple lines using string concatenation. - Note: If overused, long strings with concatenation could impact performance. [jsPerf](http://jsperf.com/ya-string-concat) & [Discussion](https://github.com/airbnb/javascript/issues/40). ```javascript // bad var errorMessage = 'This is a super long error that was thrown because of Batman. When you stop to think about how Batman had anything to do with this, you would get nowhere fast.'; // bad var errorMessage = 'This is a super long error that was thrown because \ of Batman. When you stop to think about how Batman had anything to do \ with this, you would get nowhere \ fast.'; // good var errorMessage = 'This is a super long error that was thrown because ' + 'of Batman. When you stop to think about how Batman had anything to do ' + 'with this, you would get nowhere fast.'; ``` - When programmatically building up a string, use Array#join instead of string concatenation. Mostly for IE: [jsPerf](http://jsperf.com/string-vs-array-concat/2). ```javascript var items; var messages; var length; var i; messages = [{ state: 'success', message: 'This one worked.' }, { state: 'success', message: 'This one worked as well.' }, { state: 'error', message: 'This one did not work.' }]; length = messages.length; // bad function inbox(messages) { items = '<ul>'; for (i = 0; i < length; i++) { items += '<li>' + messages[i].message + '</li>'; } return items + '</ul>'; } // good function inbox(messages) { items = []; for (i = 0; i < length; i++) { items[i] = messages[i].message; } return '<ul><li>' + items.join('</li><li>') + '</li></ul>'; } ``` **[⬆ back to top](#table-of-contents)** ## Functions - Function expressions: ```javascript // anonymous function expression var anonymous = function() { return true; }; // named function expression var named = function named() { return true; }; // immediately-invoked function expression (IIFE) (function() { console.log('Welcome to the Internet. Please follow me.'); })(); ``` - Never declare a function in a non-function block (if, while, etc). Assign the function to a variable instead. Browsers will allow you to do it, but they all interpret it differently, which is bad news bears. - **Note:** ECMA-262 defines a `block` as a list of statements. A function declaration is not a statement. [Read ECMA-262's note on this issue](http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf#page=97). ```javascript // bad if (currentUser) { function test() { console.log('Nope.'); } } // good var test; if (currentUser) { test = function test() { console.log('Yup.'); }; } ``` - Never name a parameter `arguments`, this will take precedence over the `arguments` object that is given to every function scope. ```javascript // bad function nope(name, options, arguments) { // ...stuff... } // good function yup(name, options, args) { // ...stuff... } ``` **[⬆ back to top](#table-of-contents)** ## Properties - Use dot notation when accessing properties. ```javascript var luke = { jedi: true, age: 28 }; // bad var isJedi = luke['jedi']; // good var isJedi = luke.jedi; ``` - Use subscript notation `[]` when accessing properties with a variable. ```javascript var luke = { jedi: true, age: 28 }; function getProp(prop) { return luke[prop]; } var isJedi = getProp('jedi'); ``` **[⬆ back to top](#table-of-contents)** ## Variables - Always use `var` to declare variables. Not doing so will result in global variables. We want to avoid polluting the global namespace. Captain Planet warned us of that. ```javascript // bad superPower = new SuperPower(); // good var superPower = new SuperPower(); ``` - Use one `var` declaration per variable. It's easier to add new variable declarations this way, and you never have to worry about swapping out a `;` for a `,` or introducing punctuation-only diffs. ```javascript // bad var items = getItems(), goSportsTeam = true, dragonball = 'z'; // bad // (compare to above, and try to spot the mistake) var items = getItems(), goSportsTeam = true; dragonball = 'z'; // good var items = getItems(); var goSportsTeam = true; var dragonball = 'z'; ``` - Declare unassigned variables last. This is helpful when later on you might need to assign a variable depending on one of the previous assigned variables. ```javascript // bad var i, len, dragonball, items = getItems(), goSportsTeam = true; // bad var i; var items = getItems(); var dragonball; var goSportsTeam = true; var len; // good var items = getItems(); var goSportsTeam = true; var dragonball; var length; var i; ``` - Assign variables at the top of their scope. This helps avoid issues with variable declaration and assignment hoisting related issues. ```javascript // bad function() { test(); console.log('doing stuff..'); //..other stuff.. var name = getName(); if (name === 'test') { return false; } return name; } // good function() { var name = getName(); test(); console.log('doing stuff..'); //..other stuff.. if (name === 'test') { return false; } return name; } // bad function() { var name = getName(); if (!arguments.length) { return false; } return true; } // good function() { if (!arguments.length) { return false; } var name = getName(); return true; } ``` **[⬆ back to top](#table-of-contents)** ## Hoisting - Variable declarations get hoisted to the top of their scope, their assignment does not. ```javascript // we know this wouldn't work (assuming there // is no notDefined global variable) function example() { console.log(notDefined); // => throws a ReferenceError } // creating a variable declaration after you // reference the variable will work due to // variable hoisting. Note: the assignment // value of `true` is not hoisted. function example() { console.log(declaredButNotAssigned); // => undefined var declaredButNotAssigned = true; } // The interpreter is hoisting the variable // declaration to the top of the scope, // which means our example could be rewritten as: function example() { var declaredButNotAssigned; console.log(declaredButNotAssigned); // => undefined declaredButNotAssigned = true; } ``` - Anonymous function expressions hoist their variable name, but not the function assignment. ```javascript function example() { console.log(anonymous); // => undefined anonymous(); // => TypeError anonymous is not a function var anonymous = function() { console.log('anonymous function expression'); }; } ``` - Named function expressions hoist the variable name, not the function name or the function body. ```javascript function example() { console.log(named); // => undefined named(); // => TypeError named is not a function superPower(); // => ReferenceError superPower is not defined var named = function superPower() { console.log('Flying'); }; } // the same is true when the function name // is the same as the variable name. function example() { console.log(named); // => undefined named(); // => TypeError named is not a function var named = function named() { console.log('named'); } } ``` - Function declarations hoist their name and the function body. ```javascript function example() { superPower(); // => Flying function superPower() { console.log('Flying'); } } ``` - For more information refer to [JavaScript Scoping & Hoisting](http://www.adequatelygood.com/2010/2/JavaScript-Scoping-and-Hoisting) by [Ben Cherry](http://www.adequatelygood.com/). **[⬆ back to top](#table-of-contents)** ## Conditional Expressions & Equality - Use `===` and `!==` over `==` and `!=`. - Conditional expressions are evaluated using coercion with the `ToBoolean` method and always follow these simple rules: + **Objects** evaluate to **true** + **Undefined** evaluates to **false** + **Null** evaluates to **false** + **Booleans** evaluate to **the value of the boolean** + **Numbers** evaluate to **false** if **+0, -0, or NaN**, otherwise **true** + **Strings** evaluate to **false** if an empty string `''`, otherwise **true** ```javascript if ([0]) { // true // An array is an object, objects evaluate to true } ``` - Use shortcuts. ```javascript // bad if (name !== '') { // ...stuff... } // good if (name) { // ...stuff... } // bad if (collection.length > 0) { // ...stuff... } // good if (collection.length) { // ...stuff... } ``` - For more information see [Truth Equality and JavaScript](http://javascriptweblog.wordpress.com/2011/02/07/truth-equality-and-javascript/#more-2108) by Angus Croll. **[⬆ back to top](#table-of-contents)** ## Blocks - Use braces with all multi-line blocks. ```javascript // bad if (test) return false; // good if (test) return false; // good if (test) { return false; } // bad function() { return false; } // good function() { return false; } ``` **[⬆ back to top](#table-of-contents)** ## Comments - Use `/** ... */` for multiline comments. Include a description, specify types and values for all parameters and return values. ```javascript // bad // make() returns a new element // based on the passed in tag name // // @param {String} tag // @return {Element} element function make(tag) { // ...stuff... return element; } // good /** * make() returns a new element * based on the passed in tag name * * @param {String} tag * @return {Element} element */ function make(tag) { // ...stuff... return element; } ``` - Use `//` for single line comments. Place single line comments on a newline above the subject of the comment. Put an empty line before the comment. ```javascript // bad var active = true; // is current tab // good // is current tab var active = true; // bad function getType() { console.log('fetching type...'); // set the default type to 'no type' var type = this._type || 'no type'; return type; } // good function getType() { console.log('fetching type...'); // set the default type to 'no type' var type = this._type || 'no type'; return type; } ``` - Prefixing your comments with `FIXME` or `TODO` helps other developers quickly understand if you're pointing out a problem that needs to be revisited, or if you're suggesting a solution to the problem that needs to be implemented. These are different than regular comments because they are actionable. The actions are `FIXME -- need to figure this out` or `TODO -- need to implement`. - Use `// FIXME:` to annotate problems. ```javascript function Calculator() { // FIXME: shouldn't use a global here total = 0; return this; } ``` - Use `// TODO:` to annotate solutions to problems. ```javascript function Calculator() { // TODO: total should be configurable by an options param this.total = 0; return this; } ``` **[⬆ back to top](#table-of-contents)** ## Whitespace - Use soft tabs set to 2 spaces. ```javascript // bad function() { ∙∙∙∙var name; } // bad function() { ∙var name; } // good function() { ∙∙var name; } ``` - Place 1 space before the leading brace. ```javascript // bad function test(){ console.log('test'); } // good function test() { console.log('test'); } // bad dog.set('attr',{ age: '1 year', breed: 'Bernese Mountain Dog' }); // good dog.set('attr', { age: '1 year', breed: 'Bernese Mountain Dog' }); ``` - Set off operators with spaces. ```javascript // bad var x=y+5; // good var x = y + 5; ``` - End files with a single newline character. ```javascript // bad (function(global) { // ...stuff... })(this); ``` ```javascript // bad (function(global) { // ...stuff... })(this);↵ ↵ ``` ```javascript // good (function(global) { // ...stuff... })(this);↵ ``` - Use indentation when making long method chains. Use a leading dot, which emphasizes that the line is a method call, not a new statement. ```javascript // bad $('#items').find('.selected').highlight().end().find('.open').updateCount(); // bad $('#items'). find('selected'). highlight(). end(). find('.open'). updateCount(); // good $('#items') .find('.selected') .highlight() .end() .find('.open') .updateCount(); // bad var leds = stage.selectAll('.led').data(data).enter().append('svg:svg').class('led', true) .attr('width', (radius + margin) * 2).append('svg:g') .attr('transform', 'translate(' + (radius + margin) + ',' + (radius + margin) + ')') .call(tron.led); // good var leds = stage.selectAll('.led') .data(data) .enter().append('svg:svg') .class('led', true) .attr('width', (radius + margin) * 2) .append('svg:g') .attr('transform', 'translate(' + (radius + margin) + ',' + (radius + margin) + ')') .call(tron.led); ``` - Leave a blank line after blocks and before the next statement ```javascript // bad if (foo) { return bar; } return baz; // good if (foo) { return bar; } return baz // bad var obj = { foo: function() { }, bar: function() { } }; return obj; // good var obj = { foo: function() { }, bar: function() { } }; return obj; ``` **[⬆ back to top](#table-of-contents)** ## Commas - Leading commas: **Nope.** ```javascript // bad var story = [ once , upon , aTime ]; // good var story = [ once, upon, aTime ]; // bad var hero = { firstName: 'Bob' , lastName: 'Parr' , heroName: 'Mr. Incredible' , superPower: 'strength' }; // good var hero = { firstName: 'Bob', lastName: 'Parr', heroName: 'Mr. Incredible', superPower: 'strength' }; ``` - Additional trailing comma: **Nope.** This can cause problems with IE6/7 and IE9 if it's in quirksmode. Also, in some implementations of ES3 would add length to an array if it had an additional trailing comma. This was clarified in ES5 ([source](http://es5.github.io/#D)): > Edition 5 clarifies the fact that a trailing comma at the end of an ArrayInitialiser does not add to the length of the array. This is not a semantic change from Edition 3 but some implementations may have previously misinterpreted this. ```javascript // bad var hero = { firstName: 'Kevin', lastName: 'Flynn', }; var heroes = [ 'Batman', 'Superman', ]; // good var hero = { firstName: 'Kevin', lastName: 'Flynn' }; var heroes = [ 'Batman', 'Superman' ]; ``` **[⬆ back to top](#table-of-contents)** ## Semicolons - **Yup.** ```javascript // bad (function() { var name = 'Skywalker' return name })() // good (function() { var name = 'Skywalker'; return name; })(); // good (guards against the function becoming an argument when two files with IIFEs are concatenated) ;(function() { var name = 'Skywalker'; return name; })(); ``` [Read more](http://stackoverflow.com/a/7365214/1712802). **[⬆ back to top](#table-of-contents)** ## Type Casting & Coercion - Perform type coercion at the beginning of the statement. - Strings: ```javascript // => this.reviewScore = 9; // bad var totalScore = this.reviewScore + ''; // good var totalScore = '' + this.reviewScore; // bad var totalScore = '' + this.reviewScore + ' total score'; // good var totalScore = this.reviewScore + ' total score'; ``` - Use `parseInt` for Numbers and always with a radix for type casting. ```javascript var inputValue = '4'; // bad var val = new Number(inputValue); // bad var val = +inputValue; // bad var val = inputValue >> 0; // bad var val = parseInt(inputValue); // good var val = Number(inputValue); // good var val = parseInt(inputValue, 10); ``` - If for whatever reason you are doing something wild and `parseInt` is your bottleneck and need to use Bitshift for [performance reasons](http://jsperf.com/coercion-vs-casting/3), leave a comment explaining why and what you're doing. ```javascript // good /** * parseInt was the reason my code was slow. * Bitshifting the String to coerce it to a * Number made it a lot faster. */ var val = inputValue >> 0; ``` - **Note:** Be careful when using bitshift operations. Numbers are represented as [64-bit values](http://es5.github.io/#x4.3.19), but Bitshift operations always return a 32-bit integer ([source](http://es5.github.io/#x11.7)). Bitshift can lead to unexpected behavior for integer values larger than 32 bits. [Discussion](https://github.com/airbnb/javascript/issues/109). Largest signed 32-bit Int is 2,147,483,647: ```javascript 2147483647 >> 0 //=> 2147483647 2147483648 >> 0 //=> -2147483648 2147483649 >> 0 //=> -2147483647 ``` - Booleans: ```javascript var age = 0; // bad var hasAge = new Boolean(age); // good var hasAge = Boolean(age); // good var hasAge = !!age; ``` **[⬆ back to top](#table-of-contents)** ## Naming Conventions - Avoid single letter names. Be descriptive with your naming. ```javascript // bad function q() { // ...stuff... } // good function query() { // ..stuff.. } ``` - Use camelCase when naming objects, functions, and instances. ```javascript // bad var OBJEcttsssss = {}; var this_is_my_object = {}; function c() {} var u = new user({ name: 'Bob Parr' }); // good var thisIsMyObject = {}; function thisIsMyFunction() {} var user = new User({ name: 'Bob Parr' }); ``` - Use PascalCase when naming constructors or classes. ```javascript // bad function user(options) { this.name = options.name; } var bad = new user({ name: 'nope' }); // good function User(options) { this.name = options.name; } var good = new User({ name: 'yup' }); ``` - Use a leading underscore `_` when naming private properties. ```javascript // bad this.__firstName__ = 'Panda'; this.firstName_ = 'Panda'; // good this._firstName = 'Panda'; ``` - When saving a reference to `this` use `_this`. ```javascript // bad function() { var self = this; return function() { console.log(self); }; } // bad function() { var that = this; return function() { console.log(that); }; } // good function() { var _this = this; return function() { console.log(_this); }; } ``` - Name your functions. This is helpful for stack traces. ```javascript // bad var log = function(msg) { console.log(msg); }; // good var log = function log(msg) { console.log(msg); }; ``` - **Note:** IE8 and below exhibit some quirks with named function expressions. See [http://kangax.github.io/nfe/](http://kangax.github.io/nfe/) for more info. **[⬆ back to top](#table-of-contents)** ## Accessors - Accessor functions for properties are not required. - If you do make accessor functions use getVal() and setVal('hello'). ```javascript // bad dragon.age(); // good dragon.getAge(); // bad dragon.age(25); // good dragon.setAge(25); ``` - If the property is a boolean, use isVal() or hasVal(). ```javascript // bad if (!dragon.age()) { return false; } // good if (!dragon.hasAge()) { return false; } ``` - It's okay to create get() and set() functions, but be consistent. ```javascript function Jedi(options) { options || (options = {}); var lightsaber = options.lightsaber || 'blue'; this.set('lightsaber', lightsaber); } Jedi.prototype.set = function(key, val) { this[key] = val; }; Jedi.prototype.get = function(key) { return this[key]; }; ``` **[⬆ back to top](#table-of-contents)** ## Constructors - Assign methods to the prototype object, instead of overwriting the prototype with a new object. Overwriting the prototype makes inheritance impossible: by resetting the prototype you'll overwrite the base! ```javascript function Jedi() { console.log('new jedi'); } // bad Jedi.prototype = { fight: function fight() { console.log('fighting'); }, block: function block() { console.log('blocking'); } }; // good Jedi.prototype.fight = function fight() { console.log('fighting'); }; Jedi.prototype.block = function block() { console.log('blocking'); }; ``` - Methods can return `this` to help with method chaining. ```javascript // bad Jedi.prototype.jump = function() { this.jumping = true; return true; }; Jedi.prototype.setHeight = function(height) { this.height = height; }; var luke = new Jedi(); luke.jump(); // => true luke.setHeight(20); // => undefined // good Jedi.prototype.jump = function() { this.jumping = true; return this; }; Jedi.prototype.setHeight = function(height) { this.height = height; return this; }; var luke = new Jedi(); luke.jump() .setHeight(20); ``` - It's okay to write a custom toString() method, just make sure it works successfully and causes no side effects. ```javascript function Jedi(options) { options || (options = {}); this.name = options.name || 'no name'; } Jedi.prototype.getName = function getName() { return this.name; }; Jedi.prototype.toString = function toString() { return 'Jedi - ' + this.getName(); }; ``` **[⬆ back to top](#table-of-contents)** ## Events - When attaching data payloads to events (whether DOM events or something more proprietary like Backbone events), pass a hash instead of a raw value. This allows a subsequent contributor to add more data to the event payload without finding and updating every handler for the event. For example, instead of: ```js // bad $(this).trigger('listingUpdated', listing.id); ... $(this).on('listingUpdated', function(e, listingId) { // do something with listingId }); ``` prefer: ```js // good $(this).trigger('listingUpdated', { listingId : listing.id }); ... $(this).on('listingUpdated', function(e, data) { // do something with data.listingId }); ``` **[⬆ back to top](#table-of-contents)** ## Modules - The module should start with a `!`. This ensures that if a malformed module forgets to include a final semicolon there aren't errors in production when the scripts get concatenated. [Explanation](https://github.com/airbnb/javascript/issues/44#issuecomment-13063933) - The file should be named with camelCase, live in a folder with the same name, and match the name of the single export. - Add a method called `noConflict()` that sets the exported module to the previous version and returns this one. - Always declare `'use strict';` at the top of the module. ```javascript // fancyInput/fancyInput.js !function(global) { 'use strict'; var previousFancyInput = global.FancyInput; function FancyInput(options) { this.options = options || {}; } FancyInput.noConflict = function noConflict() { global.FancyInput = previousFancyInput; return FancyInput; }; global.FancyInput = FancyInput; }(this); ``` **[⬆ back to top](#table-of-contents)** ## jQuery - Prefix jQuery object variables with a `$`. ```javascript // bad var sidebar = $('.sidebar'); // good var $sidebar = $('.sidebar'); ``` - Cache jQuery lookups. ```javascript // bad function setSidebar() { $('.sidebar').hide(); // ...stuff... $('.sidebar').css({ 'background-color': 'pink' }); } // good function setSidebar() { var $sidebar = $('.sidebar'); $sidebar.hide(); // ...stuff... $sidebar.css({ 'background-color': 'pink' }); } ``` - For DOM queries use Cascading `$('.sidebar ul')` or parent > child `$('.sidebar > ul')`. [jsPerf](http://jsperf.com/jquery-find-vs-context-sel/16) - Use `find` with scoped jQuery object queries. ```javascript // bad $('ul', '.sidebar').hide(); // bad $('.sidebar').find('ul').hide(); // good $('.sidebar ul').hide(); // good $('.sidebar > ul').hide(); // good $sidebar.find('ul').hide(); ``` **[⬆ back to top](#table-of-contents)** ## ECMAScript 5 Compatibility - Refer to [Kangax](https://twitter.com/kangax/)'s ES5 [compatibility table](http://kangax.github.com/es5-compat-table/). **[⬆ back to top](#table-of-contents)** ## Testing - **Yup.** ```javascript function() { return true; } ``` **[⬆ back to top](#table-of-contents)** ## Performance - [On Layout & Web Performance](http://kellegous.com/j/2013/01/26/layout-performance/) - [String vs Array Concat](http://jsperf.com/string-vs-array-concat/2) - [Try/Catch Cost In a Loop](http://jsperf.com/try-catch-in-loop-cost) - [Bang Function](http://jsperf.com/bang-function) - [jQuery Find vs Context, Selector](http://jsperf.com/jquery-find-vs-context-sel/13) - [innerHTML vs textContent for script text](http://jsperf.com/innerhtml-vs-textcontent-for-script-text) - [Long String Concatenation](http://jsperf.com/ya-string-concat) - Loading... **[⬆ back to top](#table-of-contents)** ## Resources **Read This** - [Annotated ECMAScript 5.1](http://es5.github.com/) **Tools** - Code Style Linters + [JSHint](http://www.jshint.com/) - [Airbnb Style .jshintrc](https://github.com/airbnb/javascript/blob/master/linters/jshintrc) + [JSCS](https://github.com/jscs-dev/node-jscs) - [Airbnb Style Preset](https://github.com/jscs-dev/node-jscs/blob/master/presets/airbnb.json) **Other Styleguides** - [Google JavaScript Style Guide](http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml) - [jQuery Core Style Guidelines](http://docs.jquery.com/JQuery_Core_Style_Guidelines) - [Principles of Writing Consistent, Idiomatic JavaScript](https://github.com/rwldrn/idiomatic.js/) **Other Styles** - [Naming this in nested functions](https://gist.github.com/4135065) - Christian Johansen - [Conditional Callbacks](https://github.com/airbnb/javascript/issues/52) - Ross Allen - [Popular JavaScript Coding Conventions on Github](http://sideeffect.kr/popularconvention/#javascript) - JeongHoon Byun - [Multiple var statements in JavaScript, not superfluous](http://benalman.com/news/2012/05/multiple-var-statements-javascript/) - Ben Alman **Further Reading** - [Understanding JavaScript Closures](http://javascriptweblog.wordpress.com/2010/10/25/understanding-javascript-closures/) - Angus Croll - [Basic JavaScript for the impatient programmer](http://www.2ality.com/2013/06/basic-javascript.html) - Dr. Axel Rauschmayer - [You Might Not Need jQuery](http://youmightnotneedjquery.com/) - Zack Bloom & Adam Schwartz - [ES6 Features](https://github.com/lukehoban/es6features) - Luke Hoban **Books** - [JavaScript: The Good Parts](http://www.amazon.com/JavaScript-Good-Parts-Douglas-Crockford/dp/0596517742) - Douglas Crockford - [JavaScript Patterns](http://www.amazon.com/JavaScript-Patterns-Stoyan-Stefanov/dp/0596806752) - Stoyan Stefanov - [Pro JavaScript Design Patterns](http://www.amazon.com/JavaScript-Design-Patterns-Recipes-Problem-Solution/dp/159059908X) - Ross Harmes and Dustin Diaz - [High Performance Web Sites: Essential Knowledge for Front-End Engineers](http://www.amazon.com/High-Performance-Web-Sites-Essential/dp/0596529309) - Steve Souders - [Maintainable JavaScript](http://www.amazon.com/Maintainable-JavaScript-Nicholas-C-Zakas/dp/1449327680) - Nicholas C. Zakas - [JavaScript Web Applications](http://www.amazon.com/JavaScript-Web-Applications-Alex-MacCaw/dp/144930351X) - Alex MacCaw - [Pro JavaScript Techniques](http://www.amazon.com/Pro-JavaScript-Techniques-John-Resig/dp/1590597273) - John Resig - [Smashing Node.js: JavaScript Everywhere](http://www.amazon.com/Smashing-Node-js-JavaScript-Everywhere-Magazine/dp/1119962595) - Guillermo Rauch - [Secrets of the JavaScript Ninja](http://www.amazon.com/Secrets-JavaScript-Ninja-John-Resig/dp/193398869X) - John Resig and Bear Bibeault - [Human JavaScript](http://humanjavascript.com/) - Henrik Joreteg - [Superhero.js](http://superherojs.com/) - Kim Joar Bekkelund, Mads Mobæk, & Olav Bjorkoy - [JSBooks](http://jsbooks.revolunet.com/) - Julien Bouquillon - [Third Party JavaScript](http://manning.com/vinegar/) - Ben Vinegar and Anton Kovalyov **Blogs** - [DailyJS](http://dailyjs.com/) - [JavaScript Weekly](http://javascriptweekly.com/) - [JavaScript, JavaScript...](http://javascriptweblog.wordpress.com/) - [Bocoup Weblog](http://weblog.bocoup.com/) - [Adequately Good](http://www.adequatelygood.com/) - [NCZOnline](http://www.nczonline.net/) - [Perfection Kills](http://perfectionkills.com/) - [Ben Alman](http://benalman.com/) - [Dmitry Baranovskiy](http://dmitry.baranovskiy.com/) - [Dustin Diaz](http://dustindiaz.com/) - [nettuts](http://net.tutsplus.com/?s=javascript) **[⬆ back to top](#table-of-contents)** ## Translation This style guide is also available in other languages: - ![de](https://raw.githubusercontent.com/gosquared/flags/master/flags/flags/shiny/24/Germany.png) **German**: [timofurrer/javascript-style-guide](https://github.com/timofurrer/javascript-style-guide) - ![jp](https://raw.githubusercontent.com/gosquared/flags/master/flags/flags/shiny/24/Japan.png) **Japanese**: [mitsuruog/javacript-style-guide](https://github.com/mitsuruog/javacript-style-guide) - ![br](https://raw.githubusercontent.com/gosquared/flags/master/flags/flags/shiny/24/Brazil.png) **Brazilian Portuguese**: [armoucar/javascript-style-guide](https://github.com/armoucar/javascript-style-guide) - ![cn](https://raw.githubusercontent.com/gosquared/flags/master/flags/flags/shiny/24/China.png) **Chinese**: [adamlu/javascript-style-guide](https://github.com/adamlu/javascript-style-guide) - ![es](https://raw.githubusercontent.com/gosquared/flags/master/flags/flags/shiny/24/Spain.png) **Spanish**: [paolocarrasco/javascript-style-guide](https://github.com/paolocarrasco/javascript-style-guide) - ![kr](https://raw.githubusercontent.com/gosquared/flags/master/flags/flags/shiny/24/South-Korea.png) **Korean**: [tipjs/javascript-style-guide](https://github.com/tipjs/javascript-style-guide) - ![fr](https://raw.githubusercontent.com/gosquared/flags/master/flags/flags/shiny/24/France.png) **French**: [nmussy/javascript-style-guide](https://github.com/nmussy/javascript-style-guide) - ![ru](https://raw.githubusercontent.com/gosquared/flags/master/flags/flags/shiny/24/Russia.png) **Russian**: [uprock/javascript](https://github.com/uprock/javascript) - ![bg](https://raw.githubusercontent.com/gosquared/flags/master/flags/flags/shiny/24/Bulgaria.png) **Bulgarian**: [borislavvv/javascript](https://github.com/borislavvv/javascript) - ![ca](https://raw.githubusercontent.com/fpmweb/javascript-style-guide/master/img/catala.png) **Catalan**: [fpmweb/javascript-style-guide](https://github.com/fpmweb/javascript-style-guide) - ![pl](https://raw.githubusercontent.com/gosquared/flags/master/flags/flags/shiny/24/Poland.png) **Polish**: [mjurczyk/javascript](https://github.com/mjurczyk/javascript) ## The JavaScript Style Guide Guide - [Reference](https://github.com/airbnb/javascript/wiki/The-JavaScript-Style-Guide-Guide) ## Chat With Us About JavaScript - Find us on [gitter](https://gitter.im/airbnb/javascript). ## Contributors - [View Contributors](https://github.com/airbnb/javascript/graphs/contributors) ## License (The MIT License) Copyright (c) 2014 Airbnb Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **[⬆ back to top](#table-of-contents)** # };
{ "content_hash": "c090745bd902a4db81b3cbada2878fa8", "timestamp": "", "source": "github", "line_count": 1608, "max_line_length": 415, "avg_line_length": 24.430348258706466, "alnum_prop": 0.6089502087363812, "repo_name": "troops2devs/minutes", "id": "651de4245cc24a2651a51afc91b3da362f136f76", "size": "39357", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "STYLEGUIDE.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "313" }, { "name": "Handlebars", "bytes": "4202" }, { "name": "JavaScript", "bytes": "25527" } ], "symlink_target": "" }
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "01903c250119d8debead9998da6c2019", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.6917293233082706, "repo_name": "mdoering/backbone", "id": "5134c2aec00af69892bad52004c0ba71e05c3362", "size": "179", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Fagales/Betulaceae/Alnus/Alnus serrulatoides/ Syn. Alnus katoana/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
Improvements and fixes - ~~Implement React.~~ - Decide on svg width handling. - Fix double home tap. - Implement Mustache templating. - Add article component to chapters. Upcoming figures - Cellular Automata - IN PROGRESS - ~~2 start configs~~ - Add more controls ( what to reset when starting over ) - Charts from csv datasets - ~~make line charts~~ - ~~Mark on hover (remove irrelevant data)~~ - ~~Fancy transitions~~ - Show all when not hovering - Color blend blob - Force Layouts - AI - Genetic algorithms - IN PROGRESS
{ "content_hash": "55797159fdcfc87f12b47b689edae0ca", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 58, "avg_line_length": 26.95, "alnum_prop": 0.7142857142857143, "repo_name": "kgolid/D3licious", "id": "21e8028cdf10de199607c572d8d2c2a9d0c9b030", "size": "539", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "TODO.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "2960" }, { "name": "HTML", "bytes": "1128" }, { "name": "JavaScript", "bytes": "408823" } ], "symlink_target": "" }
@interface BQCollectionViewCell : UICollectionViewCell @property (nonatomic, strong) UIImageView *imageView; @end
{ "content_hash": "1e1267169a071ef3a9d0c02fb6b40318", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 54, "avg_line_length": 38, "alnum_prop": 0.8333333333333334, "repo_name": "PurpleSweetPotatoes/Layer_learn", "id": "1ee9742e459f9bbd3f05d5edeee76fecd9680559", "size": "291", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Layer学习整理Demo/Layer学习整理Demo/RowsVc/性能提升/BQCollectionViewCell.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Objective-C", "bytes": "95890" } ], "symlink_target": "" }
// Copyright 2007-2016 Chris Patterson, Dru Sellers, Travis Smith, et. al. // // 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. namespace MassTransit.Tests.Courier { using System; using System.Threading.Tasks; using MassTransit.Courier; using MassTransit.Courier.Contracts; using MassTransit.Testing; using NUnit.Framework; using TestFramework; using TestFramework.Courier; [TestFixture] public class A_routing_slip_event_subscription : InMemoryTestFixture { [Test] public void Should_serialize_properly() { var builder = new RoutingSlipBuilder(Guid.NewGuid()); builder.AddActivity("a", new Uri("loopback://locahost/execute_a")); builder.AddSubscription(new Uri("loopback://localhost/events"), RoutingSlipEvents.Completed | RoutingSlipEvents.Faulted); var routingSlip = builder.Build(); var jsonString = routingSlip.ToJsonString(); var loaded = RoutingSlipExtensions.GetRoutingSlip(jsonString); Assert.AreEqual(RoutingSlipEvents.Completed | RoutingSlipEvents.Faulted, loaded.Subscriptions[0].Events); } } [TestFixture] public class Subscription_without_variables : InMemoryActivityTestFixture { [Test] public async Task Should_not_receive_the_routing_slip_activity_log() { ConsumeContext<RoutingSlipActivityCompleted> context = await _activityCompleted; Assert.IsFalse(context.Message.Data.ContainsKey("OriginalValue")); } [Test] public async Task Should_not_receive_the_routing_slip_activity_variable() { ConsumeContext<RoutingSlipActivityCompleted> context = await _activityCompleted; Assert.IsFalse(context.Message.Variables.ContainsKey("Variable")); } [Test] public async Task Should_receive_the_routing_slip_activity_completed_event() { ConsumeContext<RoutingSlipActivityCompleted> context = await _activityCompleted; Assert.AreEqual(_trackingNumber, context.Message.TrackingNumber); } [Test] public void Should_serialize_and_deserialize_properly() { var builder = new RoutingSlipBuilder(Guid.NewGuid()); builder.AddActivity("a", new Uri("loopback://locahost/execute_a")); builder.AddSubscription(new Uri("loopback://localhost/events"), RoutingSlipEvents.Completed | RoutingSlipEvents.Faulted); var routingSlip = builder.Build(); var jsonString = routingSlip.ToJsonString(); var loaded = RoutingSlipExtensions.GetRoutingSlip(jsonString); Assert.AreEqual(RoutingSlipEvents.Completed | RoutingSlipEvents.Faulted, loaded.Subscriptions[0].Events); } Task<ConsumeContext<RoutingSlipCompleted>> _completed; Task<ConsumeContext<RoutingSlipActivityCompleted>> _activityCompleted; Guid _trackingNumber; [OneTimeSetUp] public async Task Should_publish_the_completed_event() { _completed = SubscribeHandler<RoutingSlipCompleted>(); _activityCompleted = SubscribeHandler<RoutingSlipActivityCompleted>(); _trackingNumber = NewId.NextGuid(); var builder = new RoutingSlipBuilder(_trackingNumber); builder.AddSubscription(Bus.Address, RoutingSlipEvents.ActivityCompleted, RoutingSlipEventContents.None); var testActivity = GetActivityContext<TestActivity>(); builder.AddActivity(testActivity.Name, testActivity.ExecuteUri, new { Value = "Hello" }); builder.AddVariable("Variable", "Knife"); await Bus.Execute(builder.Build()); } protected override void SetupActivities(BusTestHarness testHarness) { AddActivityContext<TestActivity, TestArguments, TestLog>(() => new TestActivity()); } } }
{ "content_hash": "c151690264dcb61fc61098c075e2b070", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 133, "avg_line_length": 37.8780487804878, "alnum_prop": 0.652071259927023, "repo_name": "jacobpovar/MassTransit", "id": "a27003c6a335aad95cdd9c5337a4a59d25bc192a", "size": "4661", "binary": false, "copies": "2", "ref": "refs/heads/develop", "path": "src/MassTransit.Tests/Courier/Subscription_Specs.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "506" }, { "name": "C#", "bytes": "6856642" }, { "name": "F#", "bytes": "3272" }, { "name": "HTML", "bytes": "15611" }, { "name": "PowerShell", "bytes": "5322" } ], "symlink_target": "" }
function vdm = Fieldmap_Run(job) % Auxillary file for running FieldMap jobs % % FORMAT vdm = Fieldmap_Run(job) % % job - FieldMap job structure containing following elements % common to all jobs and specific to the type of job % Common to all jobs: % defaults - cell array containing name string of the defaults file % options - structure containing the following: % epi - cell array containing name string of epi image to unwarp % matchvdm - match vdm to epi or not (1/0) % writeunwarped - write unwarped EPI or not (1/0) % anat - cell array containing name string of anatomical image % matchanat - match anatomical image to EPI or not (1/0) % % Elements specific to job type: % precalcfieldmap - name of precalculated fieldmap % % phase - name of phase image for presubtracted phase/mag job % magnitude - name of magnitude image for presubtracted phase/mag job % % shortphase - name of short phase image for phase/mag pair job % longphase - name of short phase image for phase/mag pair job % shortmag - name of short magnitude image for phase/mag pair job % longmag - name of short magnitude image for phase/mag pair job % % shortreal - name of short real image for real/imaginary job % longreal - name of long real image for real/imaginary job % shortimag - name of short imaginary image for real/imaginary job % longimag - name of long imaginary image for real/imaginary job % %_______________________________________________________________________ % Copyright (C) 2007 Wellcome Department of Imaging Neuroscience % Chloe Hutton & Jesper Andersson % $Id: FieldMap_Run.m 4571 2011-11-23 17:34:12Z chloe $ %_________________________________________________________________ % %---------------------------------------------------------------------- % Set up default parameters and structures %---------------------------------------------------------------------- % Open the FieldMap control window with visibility off. This allows the % graphics display to work. FieldMap('Welcome','Off'); %IP = FieldMap('Initialise'); % Gets default params from pm_defaults % Here load the selected defaults file if selected if isfield(job.defaults,'defaultsfile') m_file = job.defaults.defaultsfile; m_file = m_file{1}(1:end-2); %m_file = spm_str_manip(m_file,'t'); pm_defs = FieldMap('SetParams',m_file); % Gets default params from pm_defaults elseif isfield(job.defaults,'defaultsval') pm_defs = job.defaults.defaultsval; echotimes=pm_defs.et; pm_defs.et=[]; pm_defs.et{1}=echotimes(1); pm_defs.et{2}=echotimes(2); pm_defs.uflags.etd=pm_defs.et{2}-pm_defs.et{1}; tmptemplate=pm_defs.mflags.template{1}; pm_defs.mflags.template=tmptemplate; end %---------------------------------------------------------------------- % Load measured field map data - phase and magnitude, real and imaginary or % precalculated fieldmap %---------------------------------------------------------------------- if isfield(job,'precalcfieldmap') fm_imgs=spm_vol(job.precalcfieldmap{1}); if isfield(job,'magfieldmap') & iscell(job.magfieldmap) if ~isempty(job.magfieldmap{1})~isempty(job.magfieldmap{1}) pm_defs.magfieldmap=spm_vol(job.magfieldmap{1}); end else job.matchvdm=0; job.matchanat=0; pm_defs.maskbrain=0; end pm_defs.uflags.iformat=''; elseif isfield(job,'phase') & isfield(job,'magnitude')% && using presub tmp=FieldMap('Scale',spm_vol(job.phase{1})); fm_imgs=[spm_vol(tmp.fname) spm_vol(job.magnitude{1})]; pm_defs.uflags.iformat='PM'; elseif isfield(job,'shortphase') & isfield(job,'shortmag')% && using double phase and magnitude tmp1=FieldMap('Scale',spm_vol(job.shortphase{1})); tmp2=FieldMap('Scale',spm_vol(job.longphase{1})); fm_imgs=[spm_vol(tmp1.fname) spm_vol(job.shortmag{1}) spm_vol(tmp2.fname) spm_vol(job.longmag{1})]; pm_defs.uflags.iformat='PM'; elseif isfield(job,'shortreal') & isfield(job,'shortimag')% && using real & imag fm_imgs=[spm_vol(job.shortreal{1}) spm_vol(job.shortimag{1}) spm_vol(job.longreal{1}) spm_vol(job.longimag{1})]; pm_defs.uflags.iformat='RI'; else error('Do not know what to do with this data. Please check your job'); end %---------------------------------------------------------------------- % Load epi session data %---------------------------------------------------------------------- nsessions=0; if ~isempty(job.session) nsessions=size(job.session,2); for sessnum=1:nsessions epi_img{sessnum}=job.session(sessnum).epi{1}; end else epi_img=[]; end %---------------------------------------------------------------------- % Load matching, unwarping and session name options %---------------------------------------------------------------------- if ~isempty(job.matchvdm) pm_defs.match_vdm=job.matchvdm; else pm_defs.match_vdm=0; end if ~isempty(job.writeunwarped) pm_defs.write_unwarped=job.writeunwarped; else pm_defs.write_unwarped=0; end if ~isempty(job.sessname) pm_defs.sessname=job.sessname; else pm_defs.sessname='session'; end %---------------------------------------------------------------------- % Call FieldMap_create %---------------------------------------------------------------------- [VDM IPcell] = FieldMap_create(fm_imgs,epi_img,pm_defs); for sessnum=1:max([1 nsessions]); IP=IPcell{sessnum}; %---------------------------------------------------------------------- % Display and print results %---------------------------------------------------------------------- fg=spm_figure('FindWin','Graphics'); if ~isempty(fg) spm_figure('Clear','Graphics'); end FieldMap('DisplayImage',FieldMap('MakedP'),[.05 .75 .95 .2],1); if ~isempty(IP.epiP) FieldMap('DisplayImage',IP.epiP,[.05 .5 .95 .2],2); end if ~isempty(IP.uepiP) FieldMap('DisplayImage',IP.uepiP,[.05 .25 .95 .2],3); end %---------------------------------------------------------------------- % Coregister structural with the unwarped image and display if required %---------------------------------------------------------------------- do_matchanat = 0; if iscell(job.anat) if ~isempty(job.anat{1}) IP.nwarp = spm_vol(job.anat{1}); do_matchanat = job.matchanat; end end if ~isempty(IP.nwarp)==1 & ~isempty(IP.epiP) if do_matchanat == 1 msg=sprintf('\nMatching anatomical to unwarped EPI in session %d...\n',sessnum); disp(msg); FieldMap('MatchStructural',IP); end end if ~isempty(IP.nwarp) & ~isempty(IP.epiP) FieldMap('DisplayImage',IP.nwarp,[.05 0.0 .95 .2],4); % Now need to redisplay other images to make it all look correct FieldMap('DisplayImage',FieldMap('MakedP'),[.05 .75 .95 .2],1); if ~isempty(IP.epiP) FieldMap('DisplayImage',IP.epiP,[.05 .5 .95 .2],2); end if ~isempty(IP.uepiP) FieldMap('DisplayImage',IP.uepiP,[.05 .25 .95 .2],3); end end spm_print vdm.vdmfile{sessnum}={VDM{sessnum}.fname}; end %______________________________________________________________________
{ "content_hash": "08c05fc4df50a4436cb1affe5ef31b16", "timestamp": "", "source": "github", "line_count": 188, "max_line_length": 116, "avg_line_length": 39.234042553191486, "alnum_prop": 0.5489425162689805, "repo_name": "jimmyshen007/NeMo", "id": "0169215d6294f921fc47ed2b5df59b2fd24f360d", "size": "7376", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "mymfiles/spm8/toolbox/FieldMap/FieldMap_Run.m", "mode": "33261", "license": "bsd-2-clause", "language": [ { "name": "C", "bytes": "1151672" }, { "name": "C++", "bytes": "3310" }, { "name": "M", "bytes": "995814" }, { "name": "Mathematica", "bytes": "122494" }, { "name": "Matlab", "bytes": "5692710" }, { "name": "Mercury", "bytes": "2633349" }, { "name": "Objective-C", "bytes": "245514" }, { "name": "Perl", "bytes": "7850" }, { "name": "R", "bytes": "12651" }, { "name": "Ruby", "bytes": "15824" }, { "name": "TeX", "bytes": "1035980" } ], "symlink_target": "" }
title: Winter Jasmine date: 2010-02-22 00:00:00 -06:00 categories: - whats-blooming layout: post blog-banner: whats-blooming-now-winter.jpg post-date: February 22, 2010 post-time: 12:37 PM blog-image: wbn-default.jpg --- <div class="text-center"> Today the Winter Jasmine in the Medicinal Garden has officially started to flower. Below is the first open flower of the season. There will be many more to follow. </div> <br> <div class="text-center"> <img src="/images/blogs/old-posts/Jasminum nudiflorum.jpg" width="450" height="384" alt="" title="" /> <p>Winter Jasmine <i>Jasminum nudiflorum</i></p> </div> <br> <div class="text-center"> <p>When you're looking at our new Cyclamen on the Floral Walk, don't overlook the Snowdrops.</p> <img src="/images/blogs/old-posts/Snowdrops1.jpg" width="450" height="425" alt="" title="" /> <p>Snowdrops <i>Galanthus nivalis</i></p> </div> <br> <div class="text-center"> <img src="/images/blogs/old-posts/Narcissus leaves.jpg" width="450" height="439" alt="" title="" /> <p>Daffodil <i>Narcissus</i> sp.</p> <p>As you walk along the paths in the garden you should be able to see the daffodils poking their leaves through the soil. It is going to be an amazing display of color this spring.....keep visiting often so you don't miss a single blossom.</p> </div> <br>
{ "content_hash": "43a71fee16224334ee1fa83af1e24641", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 247, "avg_line_length": 36.027027027027025, "alnum_prop": 0.7051762940735183, "repo_name": "redbuttegarden/redbuttegarden.github.io", "id": "58838b90d30e4227c9218eb91e6e9e246c6c46d8", "size": "1337", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "whats-blooming/_posts/2010-02-22-winter_jasmine.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "61814" }, { "name": "HTML", "bytes": "3602951" }, { "name": "JavaScript", "bytes": "34082" }, { "name": "Ruby", "bytes": "1273" }, { "name": "Shell", "bytes": "190" } ], "symlink_target": "" }
module Tak class Game def initialize(size) @tak_board = Tak::Board.new(size) @turn = :white @first_move = true end end end
{ "content_hash": "bfda52a4c5006c92cb8fc667b06a1154", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 40, "avg_line_length": 17.77777777777778, "alnum_prop": 0.55625, "repo_name": "baweaver/tak", "id": "e836e1a4cb351241bfd7e34069ece760c16427e3", "size": "160", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/tak/game.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "22979" }, { "name": "Shell", "bytes": "131" } ], "symlink_target": "" }
<?php namespace User\Service\InputFilter; use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\ServiceLocatorInterface; class RegisterInputFilterService implements FactoryInterface { public function createService(ServiceLocatorInterface $oServiceLocator) { $oInputFilter = new \User\Model\InputFilter\Register(); return $oInputFilter; } }
{ "content_hash": "33a3c806bbc71b5d4dc09eb95318d9fc", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 73, "avg_line_length": 26.285714285714285, "alnum_prop": 0.8097826086956522, "repo_name": "lstaszak/zf2main", "id": "70762512339925651b5b3b3131ed30b7892fc17d", "size": "368", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "module/User/src/User/Service/InputFilter/RegisterInputFilterService.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ApacheConf", "bytes": "742" }, { "name": "Batchfile", "bytes": "490" }, { "name": "CSS", "bytes": "58356" }, { "name": "HTML", "bytes": "259766" }, { "name": "JavaScript", "bytes": "130950" }, { "name": "PHP", "bytes": "509654" }, { "name": "PLpgSQL", "bytes": "35896" }, { "name": "Shell", "bytes": "815" } ], "symlink_target": "" }
abort %(Usage: ruby gistory.rb repo_path file_path [branch_other_than_master] ) unless ARGV.size.between?(2, 3) repo_path = File.expand_path(ARGV.first) abort "Error: #{repo_path} does not exist" unless File.exist?(repo_path) require 'grit' Grit::Git.git_timeout = 60 class Grit::Actor def name_email "#{name} <#{email}>" end def ==(other) name_email == other.name_email end end repo = begin Grit::Repo.new(repo_path) rescue Grit::InvalidGitRepositoryError abort "Error: #{repo_path} is not a git repo" end $stderr.puts "Loading commits ..." file = ARGV[1] branch = ARGV[2] || 'master' require 'lib/gistory' commits = Gistory::CommitParser.parse(repo, file, branch) Gistory::CommitParser.index_and_generate!(commits) abort %(Error: Couldn't find any commits. Are you sure this is a git repo and the file exists?) if commits.empty? $stderr.puts "Loaded commits" require 'sinatra' require 'json' require 'erb' set :logging, false set :host, 'localhost' set :port, 6568 get '/' do @delay = 1 @lps_change = 5 @lps_scroll = 20 @commits = commits erb :index end get '/commits' do @commits = commits content_type 'text/javascript' erb :commits, :layout => false end get /^\/commit\/(\d+)$/ do @commit_index = params['captures'][0].to_i @commits = commits @commit_diff = commits[@commit_index] content_type 'text/javascript' erb :commit, :layout => false end #Given a commit number, returns the blob as of that commit get '/blob/*' do @commit_index = params[:splat].first.to_i diff = commits[@commit_index][:diff] # puts diff.inspect blob = diff.deleted_file ? diff.a_blob : diff.b_blob puts blob.data body blob.data end helpers do def j(str) str.to_s.gsub('\\', '\\\\\\\\').gsub(/[&"><\n\r]/) { |special| { '&' => '\u0026', '>' => '\u003E', '<' => '\u003C', '"' => '\"', "\n" => "\\n", "\r" => "\\r" }[special] } end end $stderr.puts "Waiting to launch gistory..." Thread.new do sleep(1) #if RUBY_PLATFORM =~ /(win|w)32$/ # `start http://localhost:6568/` if RUBY_PLATFORM =~ /darwin/ `open http://localhost:6568/` $stderr.puts "Launched gistory" else puts "Please open your web browser and visit http://localhost:6568/" end end
{ "content_hash": "a1c93fca18ee148f5e981ea2cadc0bea", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 174, "avg_line_length": 20.953271028037385, "alnum_prop": 0.647636039250669, "repo_name": "bloopletech/gistory", "id": "ecf90696f4c805dbf8ca0ea09fb2d3fd89e562d6", "size": "2242", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "gistory.rb", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "47945" }, { "name": "Ruby", "bytes": "10133" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_22) on Sun Aug 26 15:15:33 EDT 2012 --> <TITLE> Uses of Class org.newdawn.slick.tests.CachedRenderTest (Slick Util - LWJGL Utilities extracted from Slick) </TITLE> <META NAME="date" CONTENT="2012-08-26"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.newdawn.slick.tests.CachedRenderTest (Slick Util - LWJGL Utilities extracted from Slick)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../org/newdawn/slick/tests/CachedRenderTest.html" title="class in org.newdawn.slick.tests"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/newdawn/slick/tests//class-useCachedRenderTest.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="CachedRenderTest.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Class<br>org.newdawn.slick.tests.CachedRenderTest</B></H2> </CENTER> No usage of org.newdawn.slick.tests.CachedRenderTest <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../org/newdawn/slick/tests/CachedRenderTest.html" title="class in org.newdawn.slick.tests"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/newdawn/slick/tests//class-useCachedRenderTest.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="CachedRenderTest.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> <i>Copyright &#169; 2006 New Dawn Software. All Rights Reserved.</i> </BODY> </HTML>
{ "content_hash": "79550f39912d9f8440680b2736def52c", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 220, "avg_line_length": 42.333333333333336, "alnum_prop": 0.6199146981627297, "repo_name": "SenshiSentou/SourceFight", "id": "39f8f037925e8636400873619f821aa1ab855b18", "size": "6096", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "slick_dev/trunk/Slick/javadoc-util/org/newdawn/slick/tests/class-use/CachedRenderTest.html", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "C", "bytes": "2377" }, { "name": "C++", "bytes": "1" }, { "name": "CSS", "bytes": "2782" }, { "name": "GAP", "bytes": "24471" }, { "name": "Java", "bytes": "11819037" }, { "name": "JavaScript", "bytes": "22036" }, { "name": "Scala", "bytes": "76" } ], "symlink_target": "" }
package github.gmjabs.grapevine; /** * <p>Bootstrap is an interface that gives a new GossipAgent a way to insert * itself into a network none of whose members it knows about, and none of whom * know about it .</p> * * <p>When a GossipAgent wants to gossip, if it doesn't know of any peers, it * will invoke its Bootstrap's getEndpoint() method to get an endpoint to * introduce itself to. This is always the case when the agent first starts up, * but may also happen if all of the peers the agent knows about disappear.</p> * * <p>Implementations could point to a CNAME, a load balancer (hahaha, boo), * read from some static configuration or config service, or whatever. See * StaticBootstrap for a trivial implementation which returns a fixed * endpoint.</p> * * <p>It is safe for getEndpoint() to return the agent's own endpoint (or an * endpoint which resolves to the agent), but an trying to bootstrap from itself * is a noop.</p> * * <p>Bootstrap implementations may return different endpoints for different * agents in the same network, but realize that doing so without being careful * runs the risk of creating a partitioned network (multiple logical networks * with the same name), which is probably undesirable.</p> */ public interface Bootstrap { /** * <p>Return an endpoint for the given agent to introduce itself * to when no peers are known, e.g. at startup.</p> * * @param agent <p>The agent requesting an endpoint to bootstrap * against. Implementations may offer different bootstrap * endpoints to different agents, though doing so * introduces a risk of creating multiple partitioned * networks.</p> * * @return <p>An endpoint address (to be interpreted by the * agent's messaging Protocol) for the agent to introduce * itself to.</p> */ public String getEndpoint(AgentInfo agent); }
{ "content_hash": "306cf201a4bc3f7467bfd86c56851134", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 80, "avg_line_length": 43.81818181818182, "alnum_prop": 0.7074688796680498, "repo_name": "gmjabs/grapevine", "id": "1debee9952a5749d0ed1c933979e579413c93354", "size": "1928", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/grapevine/Bootstrap.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "165839" } ], "symlink_target": "" }
<!DOCTYPE frameset SYSTEM "frameset.dtd"> <frameset> <predicate lemma="count"> <note> Frames file for 'count' based on sentences in financial subcorpus. Verbnet classes 29.2, 29.6. </note> <roleset id="count.01" name="enumerate" vncls="29.6"> <roles> <role descr="counter" n="0"> <vnrole vncls="29.6" vntheta="Agent"/> </role> <role descr="thing counted" n="1"> <vnrole vncls="29.6" vntheta="Predicate"/> </role> </roles> <example name="Count von Count"> <text> But this is a production designed and directed by Franco Zeffirelli and paid for by Sybil Harrington, who *trace*-1 has no need *trace*-1 to count her pennies, unlike Violetta, down to 20 louis at the opera's end. </text> <arg n="0">*trace*</arg> <arg n="M" f="RCL">who -&gt; Sybil Harrington</arg> <rel>count</rel> <arg n="1">her pennies</arg> </example> <note> </note> </roleset> <roleset id="count.02" name="include" vncls="-"> <roles> <role descr="agent, entity causing some grouping" n="0"/> <role descr="theme, thing being included in some group" n="1"/> <role descr="group" n="2"/> </roles> <example name="with group"> <text> Mr. Achenbaum has counted among his clients some of the most visible blue-chip advertisers in the country, including Nissan, Toyota, Seagram and Backer Spielvogel clients Hyundai and J.P. Morgan. </text> <rel>counted</rel> <arg n="2">among his clients</arg> <arg n="1">some of the most visible blue-chip advertisers in the country, including Nissan, Toyota, Seagram and Backer Spielvogel clients Hyundai and J.P. Morgan </arg> </example> <example name="no group"> <text> *trace*-1 Not counting the extraordinary charge, [the company]-1 said it would have had a net loss of $3.1 million, or seven cents a share. </text> <arg n="0">*trace*</arg> <rel>counting</rel> <arg n="1">the extraordinary charge</arg> </example> <note> </note> </roleset> <roleset id="count.03" name="rely, depend" vncls="70"> <roles> <role descr="depender" n="0"> <vnrole vncls="70" vntheta="Agent"/> </role> <role descr="depended on" n="1"> <vnrole vncls="70" vntheta="Theme"/> </role> <role descr="secondary predication on arg1" n="2"/> </roles> <example name="no secondary predication"> <text> Before the union rejected the company's offer and the strike was launched with the graveyard shift of Oct. 4, Boeing had been counting on turning 96 aircraft out the door in the present period. </text> <arg n="0">Boeing</arg> <rel>counting</rel> <arg n="1">on turning 96 aircraft out the door in the present period </arg> </example> <example name="with secondary predication"> <text> Commodore had been counting on its consumer business to stay sufficiently healthy to support its efforts in other areas -- mainly in getting schools and businesses to use its Amiga, which has slick graphics yet has been slow to catch on because it isn't compatible with Apple Computer Inc. or International Business Machines Corp. hardware. </text> <arg n="0">Commodore</arg> <rel>counting</rel> <arg n="1">on its consumer business</arg> <arg n="2">to stay sufficiently healthy to support its efforts in other areas -- mainly in getting schools and businesses to use its Amiga, which has slick graphics yet has been slow to catch on because it isn't compatible with Apple Computer Inc. or International Business Machines Corp. hardware </arg> </example> <note> There's as least one example where treebank misparses &quot;count on&quot; as a phrasal verb rather than verb+preposition. Use [count] [on] as the predicate in that/those example(s). </note> </roleset> <roleset id="count.04" name="matter" vncls="91"> <roles> <role descr="thing" n="1"> <vnrole vncls="91" vntheta="Cause"/> </role> </roles> <example name="positive"> <text> `` What *trace* counts is the bottom line . '' </text> <arg n="1">*trace*</arg> <arg n="M" f="RCL">What</arg> <rel>counts</rel> </example> <example name="negative"> <text> That doesn't count. </text> <arg n="1">That</arg> <arg f="NEG" n="m">n't</arg> <rel>count</rel> </example> <note> </note> </roleset> </predicate> </frameset>
{ "content_hash": "497c312ba780e05e5b970a441847dd40", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 98, "avg_line_length": 40.48076923076923, "alnum_prop": 0.45447347585114806, "repo_name": "keenon/jamr", "id": "716aa9b829a865ea92db4fc4a2c21cd70900164f", "size": "6315", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "data/frames/count.xml", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Java", "bytes": "640454" }, { "name": "Perl", "bytes": "8697" }, { "name": "Python", "bytes": "76079" }, { "name": "Scala", "bytes": "353885" }, { "name": "Shell", "bytes": "41192" } ], "symlink_target": "" }
package com.sksamuel.elastic4s.requests.searches.aggs import com.sksamuel.elastic4s.requests.script.Script import com.sksamuel.exts.OptionImplicits._ case class PercentilesAggregation(name: String, field: Option[String] = None, missing: Option[AnyRef] = None, format: Option[String] = None, script: Option[Script] = None, numberOfSignificantValueDigits: Option[Int] = None, percents: Seq[Double] = Nil, compression: Option[Double] = None, keyed: Option[Boolean] = None, subaggs: Seq[AbstractAggregation] = Nil, metadata: Map[String, AnyRef] = Map.empty) extends Aggregation { type T = PercentilesAggregation def percents(first: Double, rest: Double*): T = percents(first +: rest) def percents(percents: Iterable[Double]): T = copy(percents = percents.toSeq) def compression(compression: Double): T = copy(compression = compression.some) def keyed(keyed: Boolean): T = copy(keyed = keyed.some) def format(format: String): T = copy(format = format.some) def field(field: String): T = copy(field = field.some) def missing(missing: AnyRef): T = copy(missing = missing.some) def script(script: Script): T = copy(script = script.some) def numberOfSignificantValueDigits(numberOfSignificantValueDigits: Int): T = copy(numberOfSignificantValueDigits = numberOfSignificantValueDigits.some) def hdr(numberOfSignificantValueDigits: Int): T = copy(numberOfSignificantValueDigits = numberOfSignificantValueDigits.some) override def subAggregations(aggs: Iterable[AbstractAggregation]): T = copy(subaggs = aggs.toSeq) override def metadata(map: Map[String, AnyRef]): PercentilesAggregation = copy(metadata = metadata) }
{ "content_hash": "13cf7698435674378dece02ab082239b", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 102, "avg_line_length": 51.48717948717949, "alnum_prop": 0.6254980079681275, "repo_name": "stringbean/elastic4s", "id": "d85dc3756356a4b21965f8aa5d96d835eab7cad2", "size": "2008", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "elastic4s-core/src/main/scala/com/sksamuel/elastic4s/requests/searches/aggs/PercentilesAggregation.scala", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "93" }, { "name": "Scala", "bytes": "1370458" } ], "symlink_target": "" }
import socket class EchoServer(object): """a simple EchoServer""" def __init__(self, ip=u'127.0.0.1', port=50000, backlog=5): self.ip = ip self.port = port self.backlog = backlog self.socket = socket.socket( socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_IP) self.socket.bind((self.ip, self.port)) self.socket.listen(self.backlog) def start_listening(self): while True: request = [] self.connection, self.addr = self.socket.accept() while True: buffer_ = self.connection.recv(32) if buffer_: request.append(buffer_) else: break self.connection.sendall(" ".join(request)) self.connection.close() if __name__ == "__main__": server = EchoServer() server.start_listening()
{ "content_hash": "5de3248afeeb06da96faafee06a059c2", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 63, "avg_line_length": 27.61764705882353, "alnum_prop": 0.5197018104366348, "repo_name": "jefrailey/network_tools", "id": "65ab9c631ff6e3256e712255c552fdc037f26d17", "size": "939", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "echo_server.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "15600" } ], "symlink_target": "" }
This is the slide deck for presenting [Dist::Zilla](https://metacpan.org/release/Dist-Zilla). To view the presentation, clone the git repository and open the ```index.html``` file in your browser. The presentation is built on the [reveal.js](https://github.com/hakimel/reveal.js) framework.
{ "content_hash": "58a6763678c96b293dd4b5636b23bdb6", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 102, "avg_line_length": 58.6, "alnum_prop": 0.7610921501706485, "repo_name": "thaljef/Dzil-Deck", "id": "b6ce196877b7257705ffcb14c9afe937ff52b49e", "size": "326", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "130222" }, { "name": "JavaScript", "bytes": "213646" } ], "symlink_target": "" }
namespace smart { class RedisProxy { public: using RedisCallback = std::function<void(redisReply*)>; RedisProxy(); ~RedisProxy(); static bool init(const std::string& ip, int port); void connect(); bool connected() { return _connected; } template<typename T> bool send_request(const std::vector<std::string>& commands, T&& fn) { if (nullptr == _context || commands.empty()) { return false; } _callbacks.emplace(std::forward<T>(fn)); auto cmd_data = new const char*[commands.size()]; auto cmd_sizes = new size_t[commands.size()]; for (auto i = 0; i <commands.size(); ++i) { cmd_data[i] = commands[i].c_str(); cmd_sizes[i] = commands[i].length(); } redisAsyncCommandArgv(_context, redis_callback, this, commands.size(), cmd_data, cmd_sizes); delete [] cmd_data; delete [] cmd_sizes; return true; } template<typename T> bool send_request(const std::string& command, T&& fn) { if (nullptr == _context || command.empty()) { return false; } _callbacks.emplace(std::forward<T>(fn)); redisAsyncCommand(_context, redis_callback, this, command.c_str()); return true; } bool send_request(const std::string& command) { if (nullptr == _context || command.empty()) { return false; } _callbacks.emplace([](redisReply*) {}); redisAsyncCommand(_context, redis_callback, this, command.c_str()); return true; } private: static void redis_callback(struct redisAsyncContext*, void*, void*); static void redis_add_read(void *privdata); static void redis_del_read(void *privdata); static void redis_add_write(void *privdata); static void redis_del_write(void *privdata); static void redis_cleanup(void *privdata); static void handle_connect(const redisAsyncContext *c, int status); static void handle_disconnect(const redisAsyncContext *c, int status); static std::string _ip; static int _port; redisAsyncContext* _context; std::shared_ptr<IO> _read_io; std::shared_ptr<IO> _write_io; bool _connected; bool _reading; bool _writting; std::queue<RedisCallback> _callbacks; }; std::shared_ptr<RedisProxy> get_local_redis(); } #endif
{ "content_hash": "e4676a5375ce1fa99660af158f4e778a", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 75, "avg_line_length": 29.788235294117648, "alnum_prop": 0.5722748815165877, "repo_name": "tonyhawkwen/smart", "id": "63b77d34e93420bf3a215fc00ff8097cb858ce68", "size": "2738", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "redis/redis_proxy.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "204400" }, { "name": "C++", "bytes": "1379114" }, { "name": "CMake", "bytes": "1266" } ], "symlink_target": "" }
namespace mojo { template <> struct BLINK_COMMON_EXPORT StructTraits<blink::mojom::UntrustworthyContextMenuParamsDataView, blink::UntrustworthyContextMenuParams> { static blink::mojom::ContextMenuDataMediaType media_type( const blink::UntrustworthyContextMenuParams& r) { return r.media_type; } static int x(const blink::UntrustworthyContextMenuParams& r) { return r.x; } static int y(const blink::UntrustworthyContextMenuParams& r) { return r.y; } static const GURL& link_url(const blink::UntrustworthyContextMenuParams& r) { return r.link_url; } static const std::u16string& link_text( const blink::UntrustworthyContextMenuParams& r) { return r.link_text; } static const absl::optional<blink::Impression>& impression( const blink::UntrustworthyContextMenuParams& r) { return r.impression; } static const GURL& unfiltered_link_url( const blink::UntrustworthyContextMenuParams& r) { return r.unfiltered_link_url; } static const GURL& src_url(const blink::UntrustworthyContextMenuParams& r) { return r.src_url; } static bool has_image_contents( const blink::UntrustworthyContextMenuParams& r) { return r.has_image_contents; } static int media_flags(const blink::UntrustworthyContextMenuParams& r) { return r.media_flags; } static const std::u16string& selection_text( const blink::UntrustworthyContextMenuParams& r) { return r.selection_text; } static const std::u16string& title_text( const blink::UntrustworthyContextMenuParams& r) { return r.title_text; } static const std::u16string& alt_text( const blink::UntrustworthyContextMenuParams& r) { return r.alt_text; } static const std::u16string& suggested_filename( const blink::UntrustworthyContextMenuParams& r) { return r.suggested_filename; } static const std::u16string& misspelled_word( const blink::UntrustworthyContextMenuParams& r) { return r.misspelled_word; } static const std::vector<std::u16string>& dictionary_suggestions( const blink::UntrustworthyContextMenuParams& r) { return r.dictionary_suggestions; } static bool spellcheck_enabled( const blink::UntrustworthyContextMenuParams& r) { return r.spellcheck_enabled; } static bool is_editable(const blink::UntrustworthyContextMenuParams& r) { return r.is_editable; } static int writing_direction_default( const blink::UntrustworthyContextMenuParams& r) { return r.writing_direction_default; } static int writing_direction_left_to_right( const blink::UntrustworthyContextMenuParams& r) { return r.writing_direction_left_to_right; } static int writing_direction_right_to_left( const blink::UntrustworthyContextMenuParams& r) { return r.writing_direction_right_to_left; } static int edit_flags(const blink::UntrustworthyContextMenuParams& r) { return r.edit_flags; } static const std::string& frame_charset( const blink::UntrustworthyContextMenuParams& r) { return r.frame_charset; } static network::mojom::ReferrerPolicy referrer_policy( const blink::UntrustworthyContextMenuParams& r) { return r.referrer_policy; } static const GURL& link_followed( const blink::UntrustworthyContextMenuParams& r) { return r.link_followed; } static const std::vector<blink::mojom::CustomContextMenuItemPtr>& custom_items(const blink::UntrustworthyContextMenuParams& r) { return r.custom_items; } static ui::MenuSourceType source_type( const blink::UntrustworthyContextMenuParams& r) { return r.source_type; } static blink::mojom::ContextMenuDataInputFieldType input_field_type( const blink::UntrustworthyContextMenuParams& r) { return r.input_field_type; } static const gfx::Rect& selection_rect( const blink::UntrustworthyContextMenuParams& r) { return r.selection_rect; } static int selection_start_offset( const blink::UntrustworthyContextMenuParams& r) { return r.selection_start_offset; } static bool opened_from_highlight( const blink::UntrustworthyContextMenuParams& r) { return r.opened_from_highlight; } static bool Read(blink::mojom::UntrustworthyContextMenuParamsDataView r, blink::UntrustworthyContextMenuParams* out); }; } // namespace mojo #endif // THIRD_PARTY_BLINK_PUBLIC_COMMON_CONTEXT_MENU_DATA_CONTEXT_MENU_MOJOM_TRAITS_H_
{ "content_hash": "6cbf91d40110bae05678aa224d3ae113", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 89, "avg_line_length": 28.636942675159236, "alnum_prop": 0.7184163701067615, "repo_name": "scheib/chromium", "id": "0677a651a39776c93f36a2b600df389e14584c0b", "size": "5255", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "third_party/blink/public/common/context_menu_data/context_menu_mojom_traits.h", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
require 'test_helper' class CommentsControllerTest < ActionController::TestCase fixtures :comments, :users test 'REST create' do payload = { :commentable_type => 'Bill', :commentable_id => 1, :body => 'testing 123' } post(:create, payload, {:user => 123}) end test 'fetch last comments and summary for list of bill IDs' do get(:last_comments, {:commentable_type => 'Bill', :commentable_ids => [1,2,3,4,5]}) comments = JSON.parse(@response.body) assert_equal 2, comments.length, 'Expected only two messages' assert_equal [2,5], comments.collect{|c| c['id']} end end
{ "content_hash": "b53130672bc95342376ca37558d1eb68", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 87, "avg_line_length": 21.79310344827586, "alnum_prop": 0.6392405063291139, "repo_name": "nazar/parlmnt", "id": "04829c883277d718fa87b628d825dd6d93313d70", "size": "632", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/functional/comments_controller_test.rb", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "127696" }, { "name": "Ruby", "bytes": "124891" } ], "symlink_target": "" }
<?php /** * @link http://superdweebie.com * @package Sds * @license MIT */ namespace Sds\Common\AccessControl; /** * Defines methods an identity needs to interact with AccessControl * * @since 1.0 * @author Tim Roediger <superdweebie@gmail.com> */ interface AccessControlIdentityInterface { /** * Get the complete roles array * * @return array */ public function getRoles(); /** * Check if an identity has the supplied role * * @param string $role * @return boolean */ public function hasRole($role); }
{ "content_hash": "3cf5d2b35cb29126bce5ff1400a97918", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 67, "avg_line_length": 19.06451612903226, "alnum_prop": 0.61082910321489, "repo_name": "superdweebie/common", "id": "cd8a8f9a7a72d33eb86e497be672992a20f5cf2d", "size": "591", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/Sds/Common/AccessControl/AccessControlIdentityInterface.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "13705" } ], "symlink_target": "" }
#include "sdm/ball_model.h" #include <cmath> #include <cstdio> #include <limits> #include <set> #include <vector> #include "noir/ball.h" #include "noir/noir_space.h" #include "noir/ball.h" #include "rng/random.h" namespace sdm { using std::numeric_limits; using std::set; using std::vector; using noir::Ball; using noir::ClosedSpace; using noir::NoirSpace; using noir::Orthotope; using rng::Random; void BallModel::expand( const Orthotope &region, CoveredPoint *nexus, CoveredPoint *nn, Random *rand, const double &lp, const double &up ){ const NoirSpace *noirSpace = nexus->get_noir_space(); // Determine the radius of the Ball double diameter = static_cast<double>(noirSpace->nominal + noirSpace->ordinal + noirSpace->interval + noirSpace->real); double nn_dist = noirSpace->norm(nexus->get_data_point(), nn->get_data_point() ); double radius = diameter*(lp + (up-lp)*rand->next()); radius = radius < nn_dist ? nn_dist : radius; //fprintf(stderr,"radius: %10.3e %10.3e\n",radius,nn_dist); Ball *ball = new Ball( noirSpace, radius ); // Select the Real Dimensions const double* reals = nexus->get_real_coordinates(); const double* nn_reals = 0; if ( nn != 0 ) nn_reals = nn->get_real_coordinates(); for ( int r = 0; r < noirSpace->real; r++ ){ double coordinate = reals[r]; double between = coordinate; if ( !isnan( coordinate ) && !isnan( nn_reals[r] ) ) { double diff = nn_reals[r] - coordinate; between += diff*rand->next(); //between = (nn_reals[r] + coordinate)*0.5; } else { between = numeric_limits<double>::quiet_NaN(); } ball->set_real_coordinate( r, between ); } // Select the Interval Dimensions const double* intervals = nexus->get_interval_coordinates(); const double* nn_intervals = 0; if ( nn != 0 ) nn_intervals = nn->get_interval_coordinates(); for ( int i = 0; i < noirSpace->interval; i++ ){ double coordinate = intervals[i]; double between = coordinate; if ( !isnan( coordinate ) && !isnan( nn_intervals[i] ) ) { double diff = nn_intervals[i] - coordinate; between += diff*rand->next(); } else { between = numeric_limits<double>::quiet_NaN(); } ball->set_interval_coordinate( i, between ); } // Select the Ordinal Dimensions const double* ordinals = nexus->get_ordinal_coordinates(); const double* nn_ordinals = 0; if ( nn != 0 ) nn_ordinals = nn->get_ordinal_coordinates(); for ( int o = 0; o < noirSpace->ordinal; o++ ){ double coordinate = ordinals[o]; double between = coordinate; if ( !isnan( coordinate ) && !isnan( nn_ordinals[o] ) ){ double diff = nn_ordinals[o] - coordinate; between += diff*rand->next(); } else { between = numeric_limits<double>::quiet_NaN(); } ball->set_ordinal_coordinate( o, between ); } // Select the Nominal Dimensions const int* nominals = nexus->get_nominal_coordinates(); const int* nn_nominals = 0; if ( nn != 0 ) nn_nominals = nn->get_nominal_coordinates(); for ( int n = 0; n < noirSpace->nominal; ++n ){ int coordinate = nominals[n]; const set<int> allowed = region.get_nominals(n); int max_allowable = static_cast<int>(allowed.size()) - 2; if ( coordinate != -1 && nn_nominals[n] != -1 ){ ball->add_nominal( n, coordinate ); ball->add_nominal( n, nn_nominals[n] ); } for ( int nn = 0; nn < max_allowable; ++nn) { if ( rand->next() > up ) continue; ball->add_nominal( n, nn ); } } // Store the resulting space /* double nn_ball_dist = noirSpace->norm(ball, nn->get_data_point() ); double nexus_ball_dist = noirSpace->norm(ball, nexus->get_data_point() ); fprintf(stderr,"c: %d radius: %10.3e %10.3e %10.3e %10.3e\n", get_principal_color(), radius,nn_dist, nexus_ball_dist, nn_ball_dist); */ spaces.push_back( ball ); } void BallModel::thicken(const Orthotope &region, Random *rand, const double &frac){ Ball *ball = dynamic_cast<Ball*>(spaces.back()); double radius = ball->get_radius()/frac; ball->set_radius(radius); } } // namespace sdm
{ "content_hash": "499dba28f6ca8756449f783b1e9dd3fa", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 70, "avg_line_length": 28.732142857142858, "alnum_prop": 0.5388440024860162, "repo_name": "gkohri/stochastico", "id": "6049f694afb38d25ee9f1afc85d71ff08e2731db", "size": "5443", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/c++/sdm/ball_model.cc", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C++", "bytes": "190570" }, { "name": "Python", "bytes": "1995" } ], "symlink_target": "" }
#include <winapifamily.h> /*++ BUILD Version: 0001 // Increment this if a change has global effects --*/ /*****************************************************************************\ * * * ddeml.h - DDEML API header file * * * * Version 3.10 * * * * Copyright (c) Microsoft Corporation. All rights reserved. * * * \*****************************************************************************/ #ifndef _INC_DDEMLH #define _INC_DDEMLH #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #pragma region Desktop Family #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) /******** public types ********/ DECLARE_HANDLE(HCONVLIST); DECLARE_HANDLE(HCONV); DECLARE_HANDLE(HSZ); DECLARE_HANDLE(HDDEDATA); #define EXPENTRY CALLBACK /* the following structure is for use with XTYP_WILDCONNECT processing. */ typedef struct tagHSZPAIR { HSZ hszSvc; HSZ hszTopic; } HSZPAIR, FAR *PHSZPAIR; /* The following structure is used by DdeConnect() and DdeConnectList() and by XTYP_CONNECT and XTYP_WILDCONNECT callbacks. */ typedef struct tagCONVCONTEXT { UINT cb; /* set to sizeof(CONVCONTEXT) */ UINT wFlags; /* none currently defined. */ UINT w----ID; /* ----/region code for topic/item strings used. */ int iCodePage; /* codepage used for topic/item strings. */ DWORD dwLangID; /* language ID for topic/item strings. */ DWORD dwSecurity; /* Private security code. */ SECURITY_QUALITY_OF_SERVICE qos; /* client side's quality of service */ } CONVCONTEXT, FAR *PCONVCONTEXT; /* The following structure is used by DdeQueryConvInfo(): */ typedef struct tagCONVINFO { DWORD cb; /* sizeof(CONVINFO) */ DWORD_PTR hUser; /* user specified field */ HCONV hConvPartner; /* hConv on other end or 0 if non-ddemgr partner */ HSZ hszSvcPartner; /* app name of partner if obtainable */ HSZ hszServiceReq; /* AppName requested for connection */ HSZ hszTopic; /* Topic name for conversation */ HSZ hszItem; /* transaction item name or NULL if quiescent */ UINT wFmt; /* transaction format or NULL if quiescent */ UINT wType; /* XTYP_ for current transaction */ UINT wStatus; /* ST_ constant for current conversation */ UINT wConvst; /* XST_ constant for current transaction */ UINT wLastError; /* last transaction error. */ HCONVLIST hConvList; /* parent hConvList if this conversation is in a list */ CONVCONTEXT ConvCtxt; /* conversation context */ HWND hwnd; /* window handle for this conversation */ HWND hwndPartner; /* partner window handle for this conversation */ } CONVINFO, FAR *PCONVINFO; /***** conversation states (usState) *****/ #define XST_NULL 0 /* quiescent states */ #define XST_INCOMPLETE 1 #define XST_CONNECTED 2 #define XST_INIT1 3 /* mid-initiation states */ #define XST_INIT2 4 #define XST_REQSENT 5 /* active conversation states */ #define XST_DATARCVD 6 #define XST_POKESENT 7 #define XST_POKEACKRCVD 8 #define XST_EXECSENT 9 #define XST_EXECACKRCVD 10 #define XST_ADVSENT 11 #define XST_UNADVSENT 12 #define XST_ADVACKRCVD 13 #define XST_UNADVACKRCVD 14 #define XST_ADVDATASENT 15 #define XST_ADVDATAACKRCVD 16 /* used in LOWORD(dwData1) of XTYP_ADVREQ callbacks... */ #define CADV_LATEACK 0xFFFF /***** conversation status bits (fsStatus) *****/ #define ST_CONNECTED 0x0001 #define ST_ADVISE 0x0002 #define ST_ISLOCAL 0x0004 #define ST_BLOCKED 0x0008 #define ST_CLIENT 0x0010 #define ST_TERMINATED 0x0020 #define ST_INLIST 0x0040 #define ST_BLOCKNEXT 0x0080 #define ST_ISSELF 0x0100 /* DDE constants for wStatus field */ #define DDE_FACK 0x8000 #define DDE_FBUSY 0x4000 #define DDE_FDEFERUPD 0x4000 #define DDE_FACKREQ 0x8000 #define DDE_FRELEASE 0x2000 #define DDE_FREQUESTED 0x1000 #define DDE_FAPPSTATUS 0x00ff #define DDE_FNOTPROCESSED 0x0000 #define DDE_FACKRESERVED (~(DDE_FACK | DDE_FBUSY | DDE_FAPPSTATUS)) #define DDE_FADVRESERVED (~(DDE_FACKREQ | DDE_FDEFERUPD)) #define DDE_FDATRESERVED (~(DDE_FACKREQ | DDE_FRELEASE | DDE_FREQUESTED)) #define DDE_FPOKRESERVED (~(DDE_FRELEASE)) /***** message filter hook types *****/ #define MSGF_DDEMGR 0x8001 /***** codepage constants ****/ #define CP_WINANSI 1004 /* default codepage for windows & old DDE convs. */ #define CP_WINUNICODE 1200 #ifdef UNICODE #define CP_WINNEUTRAL CP_WINUNICODE #else // !UNICODE #define CP_WINNEUTRAL CP_WINANSI #endif // !UNICODE /***** transaction types *****/ #define XTYPF_NOBLOCK 0x0002 /* CBR_BLOCK will not work */ #define XTYPF_NODATA 0x0004 /* DDE_FDEFERUPD */ #define XTYPF_ACKREQ 0x0008 /* DDE_FACKREQ */ #define XCLASS_MASK 0xFC00 #define XCLASS_BOOL 0x1000 #define XCLASS_DATA 0x2000 #define XCLASS_FLAGS 0x4000 #define XCLASS_NOTIFICATION 0x8000 #define XTYP_ERROR (0x0000 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK ) #define XTYP_ADVDATA (0x0010 | XCLASS_FLAGS ) #define XTYP_ADVREQ (0x0020 | XCLASS_DATA | XTYPF_NOBLOCK ) #define XTYP_ADVSTART (0x0030 | XCLASS_BOOL ) #define XTYP_ADVSTOP (0x0040 | XCLASS_NOTIFICATION) #define XTYP_EXECUTE (0x0050 | XCLASS_FLAGS ) #define XTYP_CONNECT (0x0060 | XCLASS_BOOL | XTYPF_NOBLOCK) #define XTYP_CONNECT_CONFIRM (0x0070 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK) #define XTYP_XACT_COMPLETE (0x0080 | XCLASS_NOTIFICATION ) #define XTYP_POKE (0x0090 | XCLASS_FLAGS ) #define XTYP_REGISTER (0x00A0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK) #define XTYP_REQUEST (0x00B0 | XCLASS_DATA ) #define XTYP_DISCONNECT (0x00C0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK) #define XTYP_UNREGISTER (0x00D0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK) #define XTYP_WILDCONNECT (0x00E0 | XCLASS_DATA | XTYPF_NOBLOCK) #define XTYP_MASK 0x00F0 #define XTYP_SHIFT 4 /* shift to turn XTYP_ into an index */ /***** Timeout constants *****/ #define TIMEOUT_ASYNC 0xFFFFFFFF /***** Transaction ID constants *****/ #define QID_[....] 0xFFFFFFFF /****** public strings used in DDE ******/ #ifdef UNICODE #define SZDDESYS_TOPIC L"System" #define SZDDESYS_ITEM_TOPICS L"Topics" #define SZDDESYS_ITEM_SYSITEMS L"SysItems" #define SZDDESYS_ITEM_RTNMSG L"ReturnMessage" #define SZDDESYS_ITEM_STATUS L"Status" #define SZDDESYS_ITEM_FORMATS L"Formats" #define SZDDESYS_ITEM_HELP L"Help" #define SZDDE_ITEM_ITEMLIST L"TopicItemList" #else #define SZDDESYS_TOPIC "System" #define SZDDESYS_ITEM_TOPICS "Topics" #define SZDDESYS_ITEM_SYSITEMS "SysItems" #define SZDDESYS_ITEM_RTNMSG "ReturnMessage" #define SZDDESYS_ITEM_STATUS "Status" #define SZDDESYS_ITEM_FORMATS "Formats" #define SZDDESYS_ITEM_HELP "Help" #define SZDDE_ITEM_ITEMLIST "TopicItemList" #endif /****** API entry points ******/ typedef HDDEDATA CALLBACK FNCALLBACK(UINT wType, UINT wFmt, HCONV hConv, HSZ hsz1, HSZ hsz2, HDDEDATA hData, ULONG_PTR dwData1, ULONG_PTR dwData2); typedef HDDEDATA (CALLBACK *PFNCALLBACK)(UINT wType, UINT wFmt, HCONV hConv, HSZ hsz1, HSZ hsz2, HDDEDATA hData, ULONG_PTR dwData1, ULONG_PTR dwData2); #define CBR_BLOCK ((HDDEDATA)-1) /* DLL registration functions */ UINT WINAPI DdeInitializeA( _Inout_ LPDWORD pidInst, _In_ PFNCALLBACK pfnCallback, _In_ DWORD afCmd, _Reserved_ DWORD ulRes); UINT WINAPI DdeInitializeW( _Inout_ LPDWORD pidInst, _In_ PFNCALLBACK pfnCallback, _In_ DWORD afCmd, _Reserved_ DWORD ulRes); #ifdef UNICODE #define DdeInitialize DdeInitializeW #else #define DdeInitialize DdeInitializeA #endif // !UNICODE /* * Callback filter flags for use with standard apps. */ #define CBF_FAIL_SELFCONNECTIONS 0x00001000 #define CBF_FAIL_CONNECTIONS 0x00002000 #define CBF_FAIL_ADVISES 0x00004000 #define CBF_FAIL_EXECUTES 0x00008000 #define CBF_FAIL_POKES 0x00010000 #define CBF_FAIL_REQUESTS 0x00020000 #define CBF_FAIL_ALLSVRXACTIONS 0x0003f000 #define CBF_SKIP_CONNECT_CONFIRMS 0x00040000 #define CBF_SKIP_REGISTRATIONS 0x00080000 #define CBF_SKIP_UNREGISTRATIONS 0x00100000 #define CBF_SKIP_DISCONNECTS 0x00200000 #define CBF_SKIP_ALLNOTIFICATIONS 0x003c0000 /* * Application command flags */ #define APPCMD_CLIENTONLY 0x00000010L #define APPCMD_FILTERINITS 0x00000020L #define APPCMD_MASK 0x00000FF0L /* * Application classification flags */ #define APPCLASS_STANDARD 0x00000000L #define APPCLASS_MASK 0x0000000FL BOOL WINAPI DdeUninitialize( _In_ DWORD idInst); /* * conversation enumeration functions */ HCONVLIST WINAPI DdeConnectList( _In_ DWORD idInst, _In_ HSZ hszService, _In_ HSZ hszTopic, _In_ HCONVLIST hConvList, _In_opt_ PCONVCONTEXT pCC); HCONV WINAPI DdeQueryNextServer( _In_ HCONVLIST hConvList, _In_ HCONV hConvPrev); BOOL WINAPI DdeDisconnectList( _In_ HCONVLIST hConvList); /* * conversation control functions */ HCONV WINAPI DdeConnect( _In_ DWORD idInst, _In_ HSZ hszService, _In_ HSZ hszTopic, _In_opt_ PCONVCONTEXT pCC); BOOL WINAPI DdeDisconnect( _In_ HCONV hConv); HCONV WINAPI DdeReconnect( _In_ HCONV hConv); UINT WINAPI DdeQueryConvInfo( _In_ HCONV hConv, _In_ DWORD idTransaction, _Inout_ PCONVINFO pConvInfo); BOOL WINAPI DdeSetUserHandle( _In_ HCONV hConv, _In_ DWORD id, _In_ DWORD_PTR hUser); BOOL WINAPI DdeAbandonTransaction( _In_ DWORD idInst, _In_ HCONV hConv, _In_ DWORD idTransaction); /* * app server interface functions */ BOOL WINAPI DdePostAdvise( _In_ DWORD idInst, _In_ HSZ hszTopic, _In_ HSZ hszItem); BOOL WINAPI DdeEnableCallback( _In_ DWORD idInst, _In_ HCONV hConv, _In_ UINT wCmd); BOOL WINAPI DdeImpersonateClient( _In_ HCONV hConv); #define EC_ENABLEALL 0 #define EC_ENABLEONE ST_BLOCKNEXT #define EC_DISABLE ST_BLOCKED #define EC_QUERYWAITING 2 HDDEDATA WINAPI DdeNameService( _In_ DWORD idInst, _In_opt_ HSZ hsz1, _In_opt_ HSZ hsz2, _In_ UINT afCmd); #define DNS_REGISTER 0x0001 #define DNS_UNREGISTER 0x0002 #define DNS_FILTERON 0x0004 #define DNS_FILTEROFF 0x0008 /* * app client interface functions */ HDDEDATA WINAPI DdeClientTransaction( _In_opt_ LPBYTE pData, _In_ DWORD cbData, _In_ HCONV hConv, _In_opt_ HSZ hszItem, _In_ UINT wFmt, _In_ UINT wType, _In_ DWORD dwTimeout, _Out_opt_ LPDWORD pdwResult); /* *data transfer functions */ HDDEDATA WINAPI DdeCreateDataHandle( _In_ DWORD idInst, _In_reads_bytes_opt_(cb) LPBYTE pSrc, _In_ DWORD cb, _In_ DWORD cbOff, _In_opt_ HSZ hszItem, _In_ UINT wFmt, _In_ UINT afCmd); HDDEDATA WINAPI DdeAddData( _In_ HDDEDATA hData, _In_reads_bytes_(cb) LPBYTE pSrc, _In_ DWORD cb, _In_ DWORD cbOff); DWORD WINAPI DdeGetData( _In_ HDDEDATA hData, _Out_writes_bytes_opt_(cbMax) LPBYTE pDst, _In_ DWORD cbMax, _In_ DWORD cbOff); LPBYTE WINAPI DdeAccessData( _In_ HDDEDATA hData, _Out_opt_ LPDWORD pcbDataSize); BOOL WINAPI DdeUnaccessData( _In_ HDDEDATA hData); BOOL WINAPI DdeFreeDataHandle( _In_ HDDEDATA hData); #define HDATA_APPOWNED 0x0001 UINT WINAPI DdeGetLastError( _In_ DWORD idInst); #define DMLERR_NO_ERROR 0 /* must be 0 */ #define DMLERR_FIRST 0x4000 #define DMLERR_ADVACKTIMEOUT 0x4000 #define DMLERR_BUSY 0x4001 #define DMLERR_DATAACKTIMEOUT 0x4002 #define DMLERR_DLL_NOT_INITIALIZED 0x4003 #define DMLERR_DLL_USAGE 0x4004 #define DMLERR_EXECACKTIMEOUT 0x4005 #define DMLERR_INVALIDPARAMETER 0x4006 #define DMLERR_LOW_MEMORY 0x4007 #define DMLERR_MEMORY_ERROR 0x4008 #define DMLERR_NOTPROCESSED 0x4009 #define DMLERR_NO_CONV_ESTABLISHED 0x400a #define DMLERR_POKEACKTIMEOUT 0x400b #define DMLERR_POSTMSG_FAILED 0x400c #define DMLERR_REENTRANCY 0x400d #define DMLERR_SERVER_DIED 0x400e #define DMLERR_SYS_ERROR 0x400f #define DMLERR_UNADVACKTIMEOUT 0x4010 #define DMLERR_UNFOUND_QUEUE_ID 0x4011 #define DMLERR_LAST 0x4011 HSZ WINAPI DdeCreateStringHandleA( _In_ DWORD idInst, _In_ LPCSTR psz, _In_ int iCodePage); HSZ WINAPI DdeCreateStringHandleW( _In_ DWORD idInst, _In_ LPCWSTR psz, _In_ int iCodePage); #ifdef UNICODE #define DdeCreateStringHandle DdeCreateStringHandleW #else #define DdeCreateStringHandle DdeCreateStringHandleA #endif // !UNICODE DWORD WINAPI DdeQueryStringA( _In_ DWORD idInst, _In_ HSZ hsz, _Out_writes_opt_(cchMax) LPSTR psz, _In_ DWORD cchMax, _In_ int iCodePage); DWORD WINAPI DdeQueryStringW( _In_ DWORD idInst, _In_ HSZ hsz, _Out_writes_opt_(cchMax) LPWSTR psz, _In_ DWORD cchMax, _In_ int iCodePage); #ifdef UNICODE #define DdeQueryString DdeQueryStringW #else #define DdeQueryString DdeQueryStringA #endif // !UNICODE BOOL WINAPI DdeFreeStringHandle( _In_ DWORD idInst, _In_ HSZ hsz); BOOL WINAPI DdeKeepStringHandle( _In_ DWORD idInst, _In_ HSZ hsz); int WINAPI DdeCmpStringHandles( _In_ HSZ hsz1, _In_ HSZ hsz2); #ifndef NODDEMLSPY /* * DDEML public debugging header file info */ typedef struct tagDDEML_MSG_HOOK_DATA { // new for NT UINT_PTR uiLo; // unpacked lo and hi parts of lParam UINT_PTR uiHi; DWORD cbData; // amount of data in message, if any. May be > than 32 bytes. DWORD Data[8]; // data peeking by DDESPY is limited to 32 bytes. } DDEML_MSG_HOOK_DATA, *PDDEML_MSG_HOOK_DATA; typedef struct tagMONMSGSTRUCT { UINT cb; HWND hwndTo; DWORD dwTime; HANDLE hTask; UINT wMsg; WPARAM wParam; LPARAM lParam; DDEML_MSG_HOOK_DATA dmhd; // new for NT } MONMSGSTRUCT, *PMONMSGSTRUCT; typedef struct tagMONCBSTRUCT { UINT cb; DWORD dwTime; HANDLE hTask; DWORD dwRet; UINT wType; UINT wFmt; HCONV hConv; HSZ hsz1; HSZ hsz2; HDDEDATA hData; ULONG_PTR dwData1; ULONG_PTR dwData2; CONVCONTEXT cc; // new for NT for XTYP_CONNECT callbacks DWORD cbData; // new for NT for data peeking DWORD Data[8]; // new for NT for data peeking } MONCBSTRUCT, *PMONCBSTRUCT; typedef struct tagMONHSZSTRUCTA { UINT cb; BOOL fsAction; /* MH_ value */ DWORD dwTime; HSZ hsz; HANDLE hTask; CHAR str[1]; } MONHSZSTRUCTA, *PMONHSZSTRUCTA; typedef struct tagMONHSZSTRUCTW { UINT cb; BOOL fsAction; /* MH_ value */ DWORD dwTime; HSZ hsz; HANDLE hTask; WCHAR str[1]; } MONHSZSTRUCTW, *PMONHSZSTRUCTW; #ifdef UNICODE typedef MONHSZSTRUCTW MONHSZSTRUCT; typedef PMONHSZSTRUCTW PMONHSZSTRUCT; #else typedef MONHSZSTRUCTA MONHSZSTRUCT; typedef PMONHSZSTRUCTA PMONHSZSTRUCT; #endif // UNICODE #define MH_CREATE 1 #define MH_KEEP 2 #define MH_DELETE 3 #define MH_CLEANUP 4 typedef struct tagMONERRSTRUCT { UINT cb; UINT wLastError; DWORD dwTime; HANDLE hTask; } MONERRSTRUCT, *PMONERRSTRUCT; typedef struct tagMONLINKSTRUCT { UINT cb; DWORD dwTime; HANDLE hTask; BOOL fEstablished; BOOL fNoData; HSZ hszSvc; HSZ hszTopic; HSZ hszItem; UINT wFmt; BOOL fServer; HCONV hConvServer; HCONV hConvClient; } MONLINKSTRUCT, *PMONLINKSTRUCT; typedef struct tagMONCONVSTRUCT { UINT cb; BOOL fConnect; DWORD dwTime; HANDLE hTask; HSZ hszSvc; HSZ hszTopic; HCONV hConvClient; // Globally unique value != apps local hConv HCONV hConvServer; // Globally unique value != apps local hConv } MONCONVSTRUCT, *PMONCONVSTRUCT; #define MAX_MONITORS 4 #define APPCLASS_MONITOR 0x00000001L #define XTYP_MONITOR (0x00F0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK) /* * Callback filter flags for use with MONITOR apps - 0 implies no monitor * callbacks. */ #define MF_HSZ_INFO 0x01000000 #define MF_SENDMSGS 0x02000000 #define MF_POSTMSGS 0x04000000 #define MF_CALLBACKS 0x08000000 #define MF_ERRORS 0x10000000 #define MF_LINKS 0x20000000 #define MF_CONV 0x40000000 #define MF_MASK 0xFF000000 #endif /* NODDEMLSPY */ #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */ #pragma endregion #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* _INC_DDEMLH */
{ "content_hash": "4e4b7640a73fd2d42badcf0dffea9659", "timestamp": "", "source": "github", "line_count": 661, "max_line_length": 83, "avg_line_length": 28.013615733736764, "alnum_prop": 0.6045255710968299, "repo_name": "mind0n/hive", "id": "d2037f4d520d52971084e7fa404bc1c5d297c031", "size": "18517", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "Cache/Libs/net46/externalapis/windows/8.1/sdk/inc/ddeml.h", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "670329" }, { "name": "ActionScript", "bytes": "7830" }, { "name": "ApacheConf", "bytes": "47" }, { "name": "Batchfile", "bytes": "18096" }, { "name": "C", "bytes": "19746409" }, { "name": "C#", "bytes": "258148996" }, { "name": "C++", "bytes": "48534520" }, { "name": "CSS", "bytes": "933736" }, { "name": "ColdFusion", "bytes": "10780" }, { "name": "GLSL", "bytes": "3935" }, { "name": "HTML", "bytes": "4631854" }, { "name": "Java", "bytes": "10881" }, { "name": "JavaScript", "bytes": "10250558" }, { "name": "Logos", "bytes": "1526844" }, { "name": "MAXScript", "bytes": "18182" }, { "name": "Mathematica", "bytes": "1166912" }, { "name": "Objective-C", "bytes": "2937200" }, { "name": "PHP", "bytes": "81898" }, { "name": "Perl", "bytes": "9496" }, { "name": "PowerShell", "bytes": "44339" }, { "name": "Python", "bytes": "188058" }, { "name": "Shell", "bytes": "758" }, { "name": "Smalltalk", "bytes": "5818" }, { "name": "TypeScript", "bytes": "50090" } ], "symlink_target": "" }
@interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
{ "content_hash": "0bdcc996da458ec89e96dc12434dd6b0", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 60, "avg_line_length": 23.2, "alnum_prop": 0.7931034482758621, "repo_name": "mattglover/MoreColors_Demo", "id": "67d8d58dbc9d1c2e2f138dbdf862a8b8f2345982", "size": "290", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "MoreColorsDemo/AppDelegate.h", "mode": "33188", "license": "mit", "language": [ { "name": "Objective-C", "bytes": "38179" } ], "symlink_target": "" }
import { assert } from 'chai'; import { AbstractRule } from '../../src/rules/abstract-rule'; import { VideoUrl } from '../../src/rules/video-url'; describe('VideoUrl', () => { let videoUrl: VideoUrl; beforeEach(() => { videoUrl = new VideoUrl(); }); it('is rule', () => { assert.instanceOf(videoUrl, AbstractRule); }); it('values is valid', () => { assert.isTrue(new VideoUrl('Vimeo').validate('https://player.vimeo.com/video/71787467')); assert.isTrue(new VideoUrl('Vimeo').validate('https://vimeo.com/71787467')); assert.isTrue(new VideoUrl('YouTube').validate('https://www.youtube.com/embed/netHLn9TScY')); assert.isTrue(new VideoUrl('YouTube').validate('https://www.youtube.com/watch?v=netHLn9TScY')); assert.isTrue(new VideoUrl('YouTube').validate('https://youtu.be/netHLn9TScY')); assert.isTrue(new VideoUrl('Vimeo', 'YouTube').validate('https://youtu.be/netHLn9TScY')); assert.isTrue(videoUrl.validate('https://player.vimeo.com/video/71787467')); // Vimeo assert.isTrue(videoUrl.validate('https://vimeo.com/71787467')); // Vimeo assert.isTrue(videoUrl.validate('https://www.youtube.com/embed/netHLn9TScY')); // Youtube assert.isTrue(videoUrl.validate('https://www.youtube.com/watch?v=netHLn9TScY')); // Youtube assert.isTrue(videoUrl.validate('https://youtu.be/netHLn9TScY')); // Youtube }); it('values is not valid', () => { assert.isFalse(new VideoUrl('Vimeo').validate('https://www.youtube.com/watch?v=netHLn9TScY')); // YouTube assert.isFalse(new VideoUrl('YouTube').validate('https://vimeo.com/71787467')); // Vimeo assert.isFalse(new VideoUrl('Vimeo', 'YouTube').validate('https:/example.com')); assert.isFalse(videoUrl.validate('example.com')); assert.isFalse(videoUrl.validate('ftp://youtu.be/netHLn9TScY')); assert.isFalse(videoUrl.validate('https:/example.com/')); assert.isFalse(videoUrl.validate('https:/youtube.com/')); assert.isFalse(videoUrl.validate('https://vimeo')); assert.isFalse(videoUrl.validate('https://vimeo.com71787467')); assert.isFalse(videoUrl.validate('https://www.google.com')); assert.isFalse(videoUrl.validate('tel:+1-816-555-1212')); assert.isFalse(videoUrl.validate('text')); assert.isFalse(videoUrl.validate('')); assert.isFalse(videoUrl.validate('foo')); assert.isFalse(videoUrl.validate(1.0)); assert.isFalse(videoUrl.validate('wrongtld')); assert.isFalse(videoUrl.validate(null)); assert.isFalse(videoUrl.validate(undefined)); assert.isFalse(videoUrl.validate(true)); assert.isFalse(videoUrl.validate(false)); assert.isFalse(videoUrl.validate([])); assert.isFalse(videoUrl.validate({})); assert.isFalse(videoUrl.validate(new Array('foo'))); assert.isFalse(videoUrl.validate(new Object({foo: 'bar'}))); class Foo {} assert.isFalse(videoUrl.validate(new Foo())); }); });
{ "content_hash": "2e798aee1f447493c6619a6ef33f0582", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 113, "avg_line_length": 48.03125, "alnum_prop": 0.6483409238776838, "repo_name": "cknow/awesome-validator", "id": "d3ef12b058141ac1186f6b7a00809e5d676b5af7", "size": "3074", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/rules/video-url.ts", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "879" }, { "name": "TypeScript", "bytes": "809399" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>User agent detail - MessageMe/1.0.12-56 (HTC-htc_vision; Android 2.3.3; Scale/480x800-240dpi)</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/css/materialize.min.css"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <link href="../circle.css" rel="stylesheet"> </head> <body> <div class="container"> <div class="section"> <h1 class="header center orange-text">User agent detail</h1> <div class="row center"> <h5 class="header light"> MessageMe/1.0.12-56 (HTC-htc_vision; Android 2.3.3; Scale/480x800-240dpi) </h5> </div> </div> <div class="section"> <table class="striped"><tr><th></th><th colspan="3">General</th><th colspan="5">Device</th><th colspan="3">Bot</th><th colspan="2"></th></tr><tr><th>Provider</th><th>Browser</th><th>Engine</th><th>OS</th><th>Brand</th><th>Model</th><th>Type</th><th>Is mobile</th><th>Is touch</th><th>Is bot</th><th>Name</th><th>Type</th><th>Parse time</th><th>Actions</th></tr><tr><th colspan="14" class="green lighten-3">Test suite</th></tr><tr><td>UAParser<br /><small>v0.5.0.2</small><br /><small>vendor/thadafinser/uap-core/tests/test_device.yaml</small></td><td> </td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555">HTC</td><td>htc_vision</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-cfed3005-df48-4fa8-bf03-4f6ef8988f59">Detail</a> <!-- Modal Structure --> <div id="modal-cfed3005-df48-4fa8-bf03-4f6ef8988f59" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>UAParser result detail</h4> <p><pre><code class="php">Array ( [user_agent_string] => MessageMe/1.0.12-56 (HTC-htc_vision; Android 2.3.3; Scale/480x800-240dpi) [family] => HTC htc_vision [brand] => HTC [model] => htc_vision ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><th colspan="14" class="green lighten-3">Providers</th></tr><tr><td>BrowscapFull<br /><small>6014</small><br /></td> <td colspan="12" class="center-align red lighten-1"> <strong>No result found</strong> </td> </tr><tr><td>BrowscapLite<br /><small>6014</small><br /></td> <td colspan="12" class="center-align red lighten-1"> <strong>No result found</strong> </td> </tr><tr><td>BrowscapPhp<br /><small>6014</small><br /></td> <td colspan="12" class="center-align red lighten-1"> <strong>No result found</strong> </td> </tr><tr><td>DonatjUAParser<br /><small>v0.5.1</small><br /></td><td>MessageMe 1.0.12</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-15fbc1f0-2615-4d42-b5d9-a30dd647b050">Detail</a> <!-- Modal Structure --> <div id="modal-15fbc1f0-2615-4d42-b5d9-a30dd647b050" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>DonatjUAParser result detail</h4> <p><pre><code class="php">Array ( [platform] => Android [browser] => MessageMe [version] => 1.0.12 ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>JenssegersAgent<br /><small>v2.3.3</small><br /></td><td> </td><td><i class="material-icons">close</i></td><td>AndroidOS 2.3.3</td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-b85a2b91-6a55-4436-a82c-1ea0d46e2e51">Detail</a> <!-- Modal Structure --> <div id="modal-b85a2b91-6a55-4436-a82c-1ea0d46e2e51" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>JenssegersAgent result detail</h4> <p><pre><code class="php">Array ( [browserName] => [browserVersion] => [osName] => AndroidOS [osVersion] => 2.3.3 [deviceModel] => HTC [isMobile] => 1 [isRobot] => [botName] => ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>NeutrinoApiCom<br /><small></small><br /></td><td>Android Browser </td><td><i class="material-icons">close</i></td><td>Android 2.3.3</td><td style="border-left: 1px solid #555">HTC</td><td>Desire Z</td><td>mobile-browser</td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.28502</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-8c2a7a4e-3fbf-4df2-8d61-5e730422f67b">Detail</a> <!-- Modal Structure --> <div id="modal-8c2a7a4e-3fbf-4df2-8d61-5e730422f67b" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>NeutrinoApiCom result detail</h4> <p><pre><code class="php">stdClass Object ( [mobile_screen_height] => 0 [is_mobile] => 1 [type] => mobile-browser [mobile_brand] => HTC [mobile_model] => Desire Z [version] => [is_android] => 1 [browser_name] => Android Browser [operating_system_family] => Android [operating_system_version] => 2.3.3 [is_ios] => [producer] => HTC [operating_system] => Android 2.3.3 [mobile_screen_width] => 0 [mobile_browser] => ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>PiwikDeviceDetector<br /><small>3.6.1</small><br /></td><td>Android Browser </td><td>WebKit </td><td>Android 2.3</td><td style="border-left: 1px solid #555">HTC</td><td>htc vision</td><td>smartphone</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.003</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-4a941d34-a8d3-4914-9724-346f60ad7046">Detail</a> <!-- Modal Structure --> <div id="modal-4a941d34-a8d3-4914-9724-346f60ad7046" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>PiwikDeviceDetector result detail</h4> <p><pre><code class="php">Array ( [client] => Array ( [type] => browser [name] => Android Browser [short_name] => AN [version] => [engine] => WebKit ) [operatingSystem] => Array ( [name] => Android [short_name] => AND [version] => 2.3 [platform] => ) [device] => Array ( [brand] => HT [brandName] => HTC [model] => htc vision [device] => 1 [deviceName] => smartphone ) [bot] => [extra] => Array ( [isBot] => [isBrowser] => 1 [isFeedReader] => [isMobileApp] => [isPIM] => [isLibrary] => [isMediaPlayer] => [isCamera] => [isCarBrowser] => [isConsole] => [isFeaturePhone] => [isPhablet] => [isPortableMediaPlayer] => [isSmartDisplay] => [isSmartphone] => 1 [isTablet] => [isTV] => [isDesktop] => [isMobile] => 1 [isTouchEnabled] => ) ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>SinergiBrowserDetector<br /><small>6.0.1</small><br /></td><td>Navigator </td><td><i class="material-icons">close</i></td><td>Android 2.3.3</td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td></td><td><i class="material-icons">close</i></td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-ec1cd248-02b0-457e-8a9d-35bb99af008c">Detail</a> <!-- Modal Structure --> <div id="modal-ec1cd248-02b0-457e-8a9d-35bb99af008c" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>SinergiBrowserDetector result detail</h4> <p><pre><code class="php">Array ( [browser] => Sinergi\BrowserDetector\Browser Object ( [userAgent:Sinergi\BrowserDetector\Browser:private] => Sinergi\BrowserDetector\UserAgent Object ( [userAgentString:Sinergi\BrowserDetector\UserAgent:private] => MessageMe/1.0.12-56 (HTC-htc_vision; Android 2.3.3; Scale/480x800-240dpi) ) [name:Sinergi\BrowserDetector\Browser:private] => Navigator [version:Sinergi\BrowserDetector\Browser:private] => unknown [isRobot:Sinergi\BrowserDetector\Browser:private] => [isChromeFrame:Sinergi\BrowserDetector\Browser:private] => [isFacebookWebView:Sinergi\BrowserDetector\Browser:private] => [isCompatibilityMode:Sinergi\BrowserDetector\Browser:private] => ) [operatingSystem] => Sinergi\BrowserDetector\Os Object ( [name:Sinergi\BrowserDetector\Os:private] => Android [version:Sinergi\BrowserDetector\Os:private] => 2.3.3 [isMobile:Sinergi\BrowserDetector\Os:private] => 1 [userAgent:Sinergi\BrowserDetector\Os:private] => Sinergi\BrowserDetector\UserAgent Object ( [userAgentString:Sinergi\BrowserDetector\UserAgent:private] => MessageMe/1.0.12-56 (HTC-htc_vision; Android 2.3.3; Scale/480x800-240dpi) ) ) [device] => Sinergi\BrowserDetector\Device Object ( [name:Sinergi\BrowserDetector\Device:private] => unknown [userAgent:Sinergi\BrowserDetector\Device:private] => Sinergi\BrowserDetector\UserAgent Object ( [userAgentString:Sinergi\BrowserDetector\UserAgent:private] => MessageMe/1.0.12-56 (HTC-htc_vision; Android 2.3.3; Scale/480x800-240dpi) ) ) ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>UAParser<br /><small>v3.4.5</small><br /></td><td>Android 2.3.3</td><td><i class="material-icons">close</i></td><td>Android 2.3.3</td><td style="border-left: 1px solid #555">HTC</td><td>htc_vision</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.001</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-3160e405-8a8f-46dd-8f47-5115f06462d2">Detail</a> <!-- Modal Structure --> <div id="modal-3160e405-8a8f-46dd-8f47-5115f06462d2" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>UAParser result detail</h4> <p><pre><code class="php">UAParser\Result\Client Object ( [ua] => UAParser\Result\UserAgent Object ( [major] => 2 [minor] => 3 [patch] => 3 [family] => Android ) [os] => UAParser\Result\OperatingSystem Object ( [major] => 2 [minor] => 3 [patch] => 3 [patchMinor] => [family] => Android ) [device] => UAParser\Result\Device Object ( [brand] => HTC [model] => htc_vision [family] => HTC htc_vision ) [originalUserAgent] => MessageMe/1.0.12-56 (HTC-htc_vision; Android 2.3.3; Scale/480x800-240dpi) ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>UserAgentApiCom<br /><small></small><br /></td><td> </td><td> </td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>Mobile</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.15201</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-afeb05fb-26b9-4509-b8ac-0c604a9e97d6">Detail</a> <!-- Modal Structure --> <div id="modal-afeb05fb-26b9-4509-b8ac-0c604a9e97d6" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>UserAgentApiCom result detail</h4> <p><pre><code class="php">stdClass Object ( [platform_name] => HTC [platform_version] => 2.3.3 [platform_type] => Mobile ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>UserAgentStringCom<br /><small></small><br /></td> <td colspan="12" class="center-align red lighten-1"> <strong>No result found</strong> </td> </tr><tr><td>WhatIsMyBrowserCom<br /><small></small><br /></td><td>Stock Android Browser </td><td> </td><td>Android 2.3.3</td><td style="border-left: 1px solid #555"></td><td>HTC htc</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.25002</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-5fc1ff22-a74d-481b-9ad1-fcfde73ded9c">Detail</a> <!-- Modal Structure --> <div id="modal-5fc1ff22-a74d-481b-9ad1-fcfde73ded9c" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>WhatIsMyBrowserCom result detail</h4> <p><pre><code class="php">stdClass Object ( [operating_system_name] => Android [simple_sub_description_string] => [simple_browser_string] => Stock Android Browser on Android (Gingerbread) [browser_version] => [extra_info] => Array ( ) [operating_platform] => HTC htc [extra_info_table] => stdClass Object ( [Hardware Version] => ) [layout_engine_name] => [detected_addons] => Array ( ) [operating_system_flavour_code] => [hardware_architecture] => [operating_system_flavour] => [operating_system_frameworks] => Array ( ) [browser_name_code] => stock-android-browser [operating_system_version] => Gingerbread [simple_operating_platform_string] => HTC htc [is_abusive] => [layout_engine_version] => [browser_capabilities] => Array ( ) [operating_platform_vendor_name] => [operating_system] => Android (Gingerbread) [operating_system_version_full] => 2.3.3 [operating_platform_code] => [browser_name] => Stock Android Browser [operating_system_name_code] => android [user_agent] => MessageMe/1.0.12-56 (HTC-htc_vision; Android 2.3.3; Scale/480x800-240dpi) [browser_version_full] => [browser] => Stock Android Browser ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>WhichBrowser<br /><small>v2.0.18</small><br /></td><td>Android Browser </td><td> </td><td>Android 2.3.3</td><td style="border-left: 1px solid #555">T-Mobile</td><td>G2</td><td>mobile:smart</td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.004</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-083a336f-5d73-4505-84f3-c5fc9bb78652">Detail</a> <!-- Modal Structure --> <div id="modal-083a336f-5d73-4505-84f3-c5fc9bb78652" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>WhichBrowser result detail</h4> <p><pre><code class="php">Array ( [browser] => Array ( [name] => Android Browser ) [os] => Array ( [name] => Android [version] => 2.3.3 ) [device] => Array ( [type] => mobile [subtype] => smart [manufacturer] => T-Mobile [model] => G2 ) ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>Woothee<br /><small>v1.2.0</small><br /></td><td> </td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>smartphone</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-f00e7198-0e22-49fe-bad0-dbb3a9cde9b9">Detail</a> <!-- Modal Structure --> <div id="modal-f00e7198-0e22-49fe-bad0-dbb3a9cde9b9" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>Woothee result detail</h4> <p><pre><code class="php">Array ( [category] => smartphone [os] => Android [name] => UNKNOWN [version] => UNKNOWN [vendor] => UNKNOWN [os_version] => UNKNOWN ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>Wurfl<br /><small>1.7.1.0</small><br /></td><td>Android 2.3.3</td><td><i class="material-icons">close</i></td><td>Android 2.3.3</td><td style="border-left: 1px solid #555"></td><td></td><td>Smartphone</td><td>yes</td><td>yes</td><td style="border-left: 1px solid #555"></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.018</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-a2bedf8c-4a95-42a7-96c5-aaf233b2ac50">Detail</a> <!-- Modal Structure --> <div id="modal-a2bedf8c-4a95-42a7-96c5-aaf233b2ac50" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>Wurfl result detail</h4> <p><pre><code class="php">Array ( [virtual] => Array ( [is_android] => true [is_ios] => false [is_windows_phone] => false [is_app] => false [is_full_desktop] => false [is_largescreen] => false [is_mobile] => true [is_robot] => false [is_smartphone] => true [is_touchscreen] => true [is_wml_preferred] => false [is_xhtmlmp_preferred] => false [is_html_preferred] => true [advertised_device_os] => Android [advertised_device_os_version] => 2.3.3 [advertised_browser] => Android [advertised_browser_version] => 2.3.3 [complete_device_name] => Generic Android 2.3 [device_name] => Generic Android 2.3 [form_factor] => Smartphone [is_phone] => true [is_app_webview] => false ) [all] => Array ( [brand_name] => Generic [model_name] => Android 2.3 [unique] => true [ununiqueness_handler] => [is_wireless_device] => true [device_claims_web_support] => true [has_qwerty_keyboard] => true [can_skip_aligned_link_row] => true [uaprof] => [uaprof2] => [uaprof3] => [nokia_series] => 0 [nokia_edition] => 0 [device_os] => Android [mobile_browser] => Android Webkit [mobile_browser_version] => [device_os_version] => 2.3 [pointing_method] => touchscreen [release_date] => 2010_november [marketing_name] => [model_extra_info] => [nokia_feature_pack] => 0 [can_assign_phone_number] => true [is_tablet] => false [manufacturer_name] => [is_bot] => false [is_google_glass] => false [proportional_font] => false [built_in_back_button_support] => false [card_title_support] => true [softkey_support] => false [table_support] => true [numbered_menus] => false [menu_with_select_element_recommended] => false [menu_with_list_of_links_recommended] => true [icons_on_menu_items_support] => false [break_list_of_links_with_br_element_recommended] => true [access_key_support] => false [wrap_mode_support] => false [times_square_mode_support] => false [deck_prefetch_support] => false [elective_forms_recommended] => true [wizards_recommended] => false [image_as_link_support] => false [insert_br_element_after_widget_recommended] => false [wml_can_display_images_and_text_on_same_line] => false [wml_displays_image_in_center] => false [opwv_wml_extensions_support] => false [wml_make_phone_call_string] => wtai://wp/mc; [chtml_display_accesskey] => false [emoji] => false [chtml_can_display_images_and_text_on_same_line] => false [chtml_displays_image_in_center] => false [imode_region] => none [chtml_make_phone_call_string] => tel: [chtml_table_support] => false [xhtml_honors_bgcolor] => true [xhtml_supports_forms_in_table] => true [xhtml_support_wml2_namespace] => false [xhtml_autoexpand_select] => false [xhtml_select_as_dropdown] => false [xhtml_select_as_radiobutton] => false [xhtml_select_as_popup] => false [xhtml_display_accesskey] => false [xhtml_supports_invisible_text] => false [xhtml_supports_inline_input] => false [xhtml_supports_monospace_font] => false [xhtml_supports_table_for_layout] => true [xhtml_supports_css_cell_table_coloring] => true [xhtml_format_as_css_property] => false [xhtml_format_as_attribute] => false [xhtml_nowrap_mode] => false [xhtml_marquee_as_css_property] => false [xhtml_readable_background_color1] => #FFFFFF [xhtml_readable_background_color2] => #FFFFFF [xhtml_allows_disabled_form_elements] => true [xhtml_document_title_support] => true [xhtml_preferred_charset] => iso-8859-1 [opwv_xhtml_extensions_support] => false [xhtml_make_phone_call_string] => tel: [xhtmlmp_preferred_mime_type] => text/html [xhtml_table_support] => true [xhtml_send_sms_string] => sms: [xhtml_send_mms_string] => mms: [xhtml_file_upload] => supported [cookie_support] => true [accept_third_party_cookie] => true [xhtml_supports_iframe] => full [xhtml_avoid_accesskeys] => true [xhtml_can_embed_video] => none [ajax_support_javascript] => true [ajax_manipulate_css] => true [ajax_support_getelementbyid] => true [ajax_support_inner_html] => true [ajax_xhr_type] => standard [ajax_manipulate_dom] => true [ajax_support_events] => true [ajax_support_event_listener] => true [ajax_preferred_geoloc_api] => w3c_api [xhtml_support_level] => 4 [preferred_markup] => html_web_4_0 [wml_1_1] => false [wml_1_2] => false [wml_1_3] => false [html_wi_w3_xhtmlbasic] => true [html_wi_oma_xhtmlmp_1_0] => true [html_wi_imode_html_1] => false [html_wi_imode_html_2] => false [html_wi_imode_html_3] => false [html_wi_imode_html_4] => false [html_wi_imode_html_5] => false [html_wi_imode_htmlx_1] => false [html_wi_imode_htmlx_1_1] => false [html_wi_imode_compact_generic] => false [html_web_3_2] => true [html_web_4_0] => true [voicexml] => false [multipart_support] => false [total_cache_disable_support] => false [time_to_live_support] => false [resolution_width] => 320 [resolution_height] => 480 [columns] => 60 [max_image_width] => 320 [max_image_height] => 400 [rows] => 40 [physical_screen_width] => 34 [physical_screen_height] => 50 [dual_orientation] => true [density_class] => 1.0 [wbmp] => true [bmp] => false [epoc_bmp] => false [gif_animated] => false [jpg] => true [png] => true [tiff] => false [transparent_png_alpha] => true [transparent_png_index] => true [svgt_1_1] => false [svgt_1_1_plus] => false [greyscale] => false [gif] => true [colors] => 65536 [webp_lossy_support] => false [webp_lossless_support] => false [post_method_support] => true [basic_authentication_support] => true [empty_option_value_support] => true [emptyok] => false [nokia_voice_call] => false [wta_voice_call] => false [wta_phonebook] => false [wta_misc] => false [wta_pdc] => false [https_support] => true [phone_id_provided] => false [max_data_rate] => 384 [wifi] => true [sdio] => false [vpn] => false [has_cellular_radio] => true [max_deck_size] => 2000000 [max_url_length_in_requests] => 256 [max_url_length_homepage] => 0 [max_url_length_bookmark] => 0 [max_url_length_cached_page] => 0 [max_no_of_connection_settings] => 0 [max_no_of_bookmarks] => 0 [max_length_of_username] => 0 [max_length_of_password] => 0 [max_object_size] => 0 [downloadfun_support] => false [directdownload_support] => true [inline_support] => false [oma_support] => true [ringtone] => false [ringtone_3gpp] => false [ringtone_midi_monophonic] => false [ringtone_midi_polyphonic] => false [ringtone_imelody] => false [ringtone_digiplug] => false [ringtone_compactmidi] => false [ringtone_mmf] => false [ringtone_rmf] => false [ringtone_xmf] => false [ringtone_amr] => false [ringtone_awb] => false [ringtone_aac] => false [ringtone_wav] => false [ringtone_mp3] => false [ringtone_spmidi] => false [ringtone_qcelp] => false [ringtone_voices] => 1 [ringtone_df_size_limit] => 0 [ringtone_directdownload_size_limit] => 0 [ringtone_inline_size_limit] => 0 [ringtone_oma_size_limit] => 0 [wallpaper] => false [wallpaper_max_width] => 0 [wallpaper_max_height] => 0 [wallpaper_preferred_width] => 0 [wallpaper_preferred_height] => 0 [wallpaper_resize] => none [wallpaper_wbmp] => false [wallpaper_bmp] => false [wallpaper_gif] => false [wallpaper_jpg] => false [wallpaper_png] => false [wallpaper_tiff] => false [wallpaper_greyscale] => false [wallpaper_colors] => 2 [wallpaper_df_size_limit] => 0 [wallpaper_directdownload_size_limit] => 0 [wallpaper_inline_size_limit] => 0 [wallpaper_oma_size_limit] => 0 [screensaver] => false [screensaver_max_width] => 0 [screensaver_max_height] => 0 [screensaver_preferred_width] => 0 [screensaver_preferred_height] => 0 [screensaver_resize] => none [screensaver_wbmp] => false [screensaver_bmp] => false [screensaver_gif] => false [screensaver_jpg] => false [screensaver_png] => false [screensaver_greyscale] => false [screensaver_colors] => 2 [screensaver_df_size_limit] => 0 [screensaver_directdownload_size_limit] => 0 [screensaver_inline_size_limit] => 0 [screensaver_oma_size_limit] => 0 [picture] => false [picture_max_width] => 0 [picture_max_height] => 0 [picture_preferred_width] => 0 [picture_preferred_height] => 0 [picture_resize] => none [picture_wbmp] => false [picture_bmp] => false [picture_gif] => false [picture_jpg] => false [picture_png] => false [picture_greyscale] => false [picture_colors] => 2 [picture_df_size_limit] => 0 [picture_directdownload_size_limit] => 0 [picture_inline_size_limit] => 0 [picture_oma_size_limit] => 0 [video] => false [oma_v_1_0_forwardlock] => false [oma_v_1_0_combined_delivery] => false [oma_v_1_0_separate_delivery] => false [streaming_video] => true [streaming_3gpp] => true [streaming_mp4] => true [streaming_mov] => false [streaming_video_size_limit] => 0 [streaming_real_media] => none [streaming_flv] => false [streaming_3g2] => false [streaming_vcodec_h263_0] => 10 [streaming_vcodec_h263_3] => -1 [streaming_vcodec_mpeg4_sp] => 2 [streaming_vcodec_mpeg4_asp] => -1 [streaming_vcodec_h264_bp] => 3.0 [streaming_acodec_amr] => nb [streaming_acodec_aac] => lc [streaming_wmv] => none [streaming_preferred_protocol] => rtsp [streaming_preferred_http_protocol] => progressive_download [wap_push_support] => false [connectionless_service_indication] => false [connectionless_service_load] => false [connectionless_cache_operation] => false [connectionoriented_unconfirmed_service_indication] => false [connectionoriented_unconfirmed_service_load] => false [connectionoriented_unconfirmed_cache_operation] => false [connectionoriented_confirmed_service_indication] => false [connectionoriented_confirmed_service_load] => false [connectionoriented_confirmed_cache_operation] => false [utf8_support] => true [ascii_support] => false [iso8859_support] => false [expiration_date] => false [j2me_cldc_1_0] => false [j2me_cldc_1_1] => false [j2me_midp_1_0] => false [j2me_midp_2_0] => false [doja_1_0] => false [doja_1_5] => false [doja_2_0] => false [doja_2_1] => false [doja_2_2] => false [doja_3_0] => false [doja_3_5] => false [doja_4_0] => false [j2me_jtwi] => false [j2me_mmapi_1_0] => false [j2me_mmapi_1_1] => false [j2me_wmapi_1_0] => false [j2me_wmapi_1_1] => false [j2me_wmapi_2_0] => false [j2me_btapi] => false [j2me_3dapi] => false [j2me_locapi] => false [j2me_nokia_ui] => false [j2me_motorola_lwt] => false [j2me_siemens_color_game] => false [j2me_siemens_extension] => false [j2me_heap_size] => 0 [j2me_max_jar_size] => 0 [j2me_storage_size] => 0 [j2me_max_record_store_size] => 0 [j2me_screen_width] => 0 [j2me_screen_height] => 0 [j2me_canvas_width] => 0 [j2me_canvas_height] => 0 [j2me_bits_per_pixel] => 0 [j2me_audio_capture_enabled] => false [j2me_video_capture_enabled] => false [j2me_photo_capture_enabled] => false [j2me_capture_image_formats] => none [j2me_http] => false [j2me_https] => false [j2me_socket] => false [j2me_udp] => false [j2me_serial] => false [j2me_gif] => false [j2me_gif89a] => false [j2me_jpg] => false [j2me_png] => false [j2me_bmp] => false [j2me_bmp3] => false [j2me_wbmp] => false [j2me_midi] => false [j2me_wav] => false [j2me_amr] => false [j2me_mp3] => false [j2me_mp4] => false [j2me_imelody] => false [j2me_rmf] => false [j2me_au] => false [j2me_aac] => false [j2me_realaudio] => false [j2me_xmf] => false [j2me_wma] => false [j2me_3gpp] => false [j2me_h263] => false [j2me_svgt] => false [j2me_mpeg4] => false [j2me_realvideo] => false [j2me_real8] => false [j2me_realmedia] => false [j2me_left_softkey_code] => 0 [j2me_right_softkey_code] => 0 [j2me_middle_softkey_code] => 0 [j2me_select_key_code] => 0 [j2me_return_key_code] => 0 [j2me_clear_key_code] => 0 [j2me_datefield_no_accepts_null_date] => false [j2me_datefield_broken] => false [receiver] => false [sender] => false [mms_max_size] => 0 [mms_max_height] => 0 [mms_max_width] => 0 [built_in_recorder] => false [built_in_camera] => true [mms_jpeg_baseline] => false [mms_jpeg_progressive] => false [mms_gif_static] => false [mms_gif_animated] => false [mms_png] => false [mms_bmp] => false [mms_wbmp] => false [mms_amr] => false [mms_wav] => false [mms_midi_monophonic] => false [mms_midi_polyphonic] => false [mms_midi_polyphonic_voices] => 0 [mms_spmidi] => false [mms_mmf] => false [mms_mp3] => false [mms_evrc] => false [mms_qcelp] => false [mms_ota_bitmap] => false [mms_nokia_wallpaper] => false [mms_nokia_operatorlogo] => false [mms_nokia_3dscreensaver] => false [mms_nokia_ringingtone] => false [mms_rmf] => false [mms_xmf] => false [mms_symbian_install] => false [mms_jar] => false [mms_jad] => false [mms_vcard] => false [mms_vcalendar] => false [mms_wml] => false [mms_wbxml] => false [mms_wmlc] => false [mms_video] => false [mms_mp4] => false [mms_3gpp] => false [mms_3gpp2] => false [mms_max_frame_rate] => 0 [nokiaring] => false [picturemessage] => false [operatorlogo] => false [largeoperatorlogo] => false [callericon] => false [nokiavcard] => false [nokiavcal] => false [sckl_ringtone] => false [sckl_operatorlogo] => false [sckl_groupgraphic] => false [sckl_vcard] => false [sckl_vcalendar] => false [text_imelody] => false [ems] => false [ems_variablesizedpictures] => false [ems_imelody] => false [ems_odi] => false [ems_upi] => false [ems_version] => 0 [siemens_ota] => false [siemens_logo_width] => 101 [siemens_logo_height] => 29 [siemens_screensaver_width] => 101 [siemens_screensaver_height] => 50 [gprtf] => false [sagem_v1] => false [sagem_v2] => false [panasonic] => false [sms_enabled] => true [wav] => false [mmf] => false [smf] => false [mld] => false [midi_monophonic] => false [midi_polyphonic] => false [sp_midi] => false [rmf] => false [xmf] => false [compactmidi] => false [digiplug] => false [nokia_ringtone] => false [imelody] => false [au] => false [amr] => false [awb] => false [aac] => true [mp3] => true [voices] => 1 [qcelp] => false [evrc] => false [flash_lite_version] => [fl_wallpaper] => false [fl_screensaver] => false [fl_standalone] => false [fl_browser] => false [fl_sub_lcd] => false [full_flash_support] => true [css_supports_width_as_percentage] => true [css_border_image] => webkit [css_rounded_corners] => webkit [css_gradient] => none [css_spriting] => true [css_gradient_linear] => none [is_transcoder] => false [transcoder_ua_header] => user-agent [rss_support] => false [pdf_support] => true [progressive_download] => true [playback_vcodec_h263_0] => 10 [playback_vcodec_h263_3] => -1 [playback_vcodec_mpeg4_sp] => 0 [playback_vcodec_mpeg4_asp] => -1 [playback_vcodec_h264_bp] => 3.0 [playback_real_media] => none [playback_3gpp] => true [playback_3g2] => false [playback_mp4] => true [playback_mov] => false [playback_acodec_amr] => nb [playback_acodec_aac] => none [playback_df_size_limit] => 0 [playback_directdownload_size_limit] => 0 [playback_inline_size_limit] => 0 [playback_oma_size_limit] => 0 [playback_acodec_qcelp] => false [playback_wmv] => none [hinted_progressive_download] => true [html_preferred_dtd] => html4 [viewport_supported] => true [viewport_width] => device_width_token [viewport_userscalable] => no [viewport_initial_scale] => [viewport_maximum_scale] => [viewport_minimum_scale] => [mobileoptimized] => false [handheldfriendly] => false [canvas_support] => full [image_inlining] => true [is_smarttv] => false [is_console] => false [nfc_support] => false [ux_full_desktop] => false [jqm_grade] => A [is_sencha_touch_ok] => false ) ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>Zsxsoft<br /><small>1.3</small><br /></td><td> </td><td><i class="material-icons">close</i></td><td>Android 2.3.3</td><td style="border-left: 1px solid #555">HTC</td><td>htc</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.001</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-5d43e024-b46c-44f6-8914-529b05569bc2">Detail</a> <!-- Modal Structure --> <div id="modal-5d43e024-b46c-44f6-8914-529b05569bc2" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>Zsxsoft result detail</h4> <p><pre><code class="php">Array ( [browser] => Array ( [link] => # [title] => Unknown [name] => Unknown [version] => [code] => null [image] => img/16/browser/null.png ) [os] => Array ( [link] => http://www.android.com/ [name] => Android [version] => 2.3.3 [code] => android [x64] => [title] => Android 2.3.3 [type] => os [dir] => os [image] => img/16/os/android.png ) [device] => Array ( [link] => http://en.wikipedia.org/wiki/High_Tech_Computer_Corporation [title] => HTC htc [model] => htc [brand] => HTC [code] => htc [dir] => device [type] => device [image] => img/16/device/htc.png ) [platform] => Array ( [link] => http://en.wikipedia.org/wiki/High_Tech_Computer_Corporation [title] => HTC htc [model] => htc [brand] => HTC [code] => htc [dir] => device [type] => device [image] => img/16/device/htc.png ) ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr></table> </div> <div class="section"> <h1 class="header center orange-text">About this comparison</h1> <div class="row center"> <h5 class="header light"> The primary goal of this project is simple<br /> I wanted to know which user agent parser is the most accurate in each part - device detection, bot detection and so on...<br /> <br /> The secondary goal is to provide a source for all user agent parsers to improve their detection based on this results.<br /> <br /> You can also improve this further, by suggesting ideas at <a href="https://github.com/ThaDafinser/UserAgentParserComparison">ThaDafinser/UserAgentParserComparison</a><br /> <br /> The comparison is based on the abstraction by <a href="https://github.com/ThaDafinser/UserAgentParser">ThaDafinser/UserAgentParser</a> </h5> </div> </div> <div class="card"> <div class="card-content"> Comparison created <i>2016-05-10 08:07:56</i> | by <a href="https://github.com/ThaDafinser">ThaDafinser</a> </div> </div> </div> <script src="https://code.jquery.com/jquery-2.1.4.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/js/materialize.min.js"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/list.js/1.2.0/list.min.js"></script> <script> $(document).ready(function(){ // the "href" attribute of .modal-trigger must specify the modal ID that wants to be triggered $('.modal-trigger').leanModal(); }); </script> </body> </html>
{ "content_hash": "cbbb898f82d1daa6ec9b431bc447782f", "timestamp": "", "source": "github", "line_count": 1138, "max_line_length": 961, "avg_line_length": 41.27328646748682, "alnum_prop": 0.5310736868998701, "repo_name": "ThaDafinser/UserAgentParserComparison", "id": "d5e5c272998965c01ab6769a8f1041ade0685f99", "size": "46970", "binary": false, "copies": "1", "ref": "refs/heads/gh-pages", "path": "v5/user-agent-detail/ce/32/ce3247e9-9b77-42ad-9851-5aa92a1f2194.html", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "2060859160" } ], "symlink_target": "" }
/* * This file is part of mmkcmd. * * © 2014 Fernando Tarlá Cardoso Lemos * * Refer to the LICENSE file for licensing information. * */ @import AppKit; #import <IOKit/hidsystem/ev_keymap.h> #import <paths.h> #import "MKCKeyListener.h" @interface MKCKeyListener () @property (nonatomic, assign) CFMachPortRef eventTap; @property (nonatomic, assign) CFRunLoopSourceRef eventSource; - (CGEventRef)_handleEvent:(CGEventRef)event withType:(CGEventType)type; @end static CGEventRef eventTapCallback(CGEventTapProxy proxy, CGEventType type, CGEventRef event, void *refcon) { MKCKeyListener *listener = (__bridge MKCKeyListener *)refcon; return [listener _handleEvent:event withType:type]; } @implementation MKCKeyListener - (id)init { self = [super init]; if (self != nil) { self.eventTap = CGEventTapCreate(kCGSessionEventTap, kCGHeadInsertEventTap, kCGEventTapOptionDefault, CGEventMaskBit(NX_SYSDEFINED), eventTapCallback, (__bridge void *)self); self.eventSource = CFMachPortCreateRunLoopSource(kCFAllocatorSystemDefault, self.eventTap, 0); } return self; } - (void)dealloc { if (self.eventSource != NULL) { CFRelease(self.eventSource); self.eventSource = NULL; } if (self.eventTap != NULL) { CFMachPortInvalidate(self.eventTap); CFRelease(self.eventTap); self.eventTap = NULL; } } - (void)startListening { CFRunLoopAddSource(CFRunLoopGetCurrent(), self.eventSource, kCFRunLoopCommonModes); } - (void)stopListening { CFRunLoopRemoveSource(CFRunLoopGetCurrent(), self.eventSource, kCFRunLoopCommonModes); } - (CGEventRef)_handleEvent:(CGEventRef)event withType:(CGEventType)type { NSEvent *nsEvent = [NSEvent eventWithCGEvent:event]; if (type != NX_SYSDEFINED || nsEvent.subtype != 8) { return event; } CGKeyCode keyCode = (nsEvent.data1 & 0xffff0000) >> 16; BOOL keyUp = !((nsEvent.data1 & 0x0000ff00) == 0x00000a00); switch (keyCode) { case NX_KEYTYPE_PLAY: if (keyUp) { [self _executeCommand:self.playPauseCommand]; } return NULL; case NX_KEYTYPE_FAST: if (keyUp) { [self _executeCommand:self.fastForwardCommand]; } return NULL; case NX_KEYTYPE_REWIND: if (keyUp) { [self _executeCommand:self.rewindCommand]; } return NULL; default: return event; } } - (void)_executeCommand:(NSString *)command { if (command == nil) return; NSTask *task = [NSTask new]; task.launchPath = [NSString stringWithCString:_PATH_BSHELL encoding:NSUTF8StringEncoding]; task.arguments = @[@"-c", command]; NSFileHandle *devnull = [NSFileHandle fileHandleWithNullDevice]; task.standardInput = devnull; task.standardOutput = devnull; task.standardError = devnull; [task launch]; [task waitUntilExit]; } @end
{ "content_hash": "3b010fd814b35eecba5f6b2509629af1", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 90, "avg_line_length": 25.78030303030303, "alnum_prop": 0.5797825448134, "repo_name": "fernandotcl/mmkcmd", "id": "f0277e06c4cfb56e6d6305e8908ef3caabd5e805", "size": "3405", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/MKCKeyListener.m", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Objective-C", "bytes": "5926" } ], "symlink_target": "" }
package org.apache.hadoop.yarn.client; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.io.retry.FailoverProxyProvider; import org.apache.hadoop.yarn.api.ApplicationClientProtocol; import org.apache.hadoop.yarn.api.records.NodeReport; import org.apache.hadoop.yarn.client.api.YarnClient; import org.apache.hadoop.yarn.conf.YarnConfiguration; import org.apache.hadoop.yarn.exceptions.YarnException; import org.apache.hadoop.yarn.server.MiniYARNCluster; import org.junit.Before; import org.junit.Test; import java.io.Closeable; import java.io.IOException; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Proxy; import java.net.InetSocketAddress; import java.util.List; import static org.junit.Assert.*; import static org.mockito.Mockito.any; import static org.mockito.Mockito.eq; import static org.mockito.Mockito.times; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; /** * Unit tests for {@link DefaultNoHARMFailoverProxyProvider} and * {@link AutoRefreshNoHARMFailoverProxyProvider}. */ public class TestNoHaRMFailoverProxyProvider { // Default port of yarn RM private static final int RM1_PORT = 8032; private static final int RM2_PORT = 8031; private static final int NUMNODEMANAGERS = 1; private Configuration conf; private class TestProxy extends Proxy implements Closeable { protected TestProxy(InvocationHandler h) { super(h); } @Override public void close() throws IOException { } } @Before public void setUp() throws IOException, YarnException { conf = new YarnConfiguration(); } /** * Tests the proxy generated by {@link DefaultNoHAFailoverProxyProvider} * will connect to RM. */ @Test public void testRestartedRM() throws Exception { MiniYARNCluster cluster = new MiniYARNCluster("testRestartedRMNegative", NUMNODEMANAGERS, 1, 1); YarnClient rmClient = YarnClient.createYarnClient(); try { cluster.init(conf); cluster.start(); final Configuration yarnConf = cluster.getConfig(); rmClient = YarnClient.createYarnClient(); rmClient.init(yarnConf); rmClient.start(); List <NodeReport> nodeReports = rmClient.getNodeReports(); assertEquals( "The proxy didn't get expected number of node reports", NUMNODEMANAGERS, nodeReports.size()); } finally { if (rmClient != null) { rmClient.stop(); } cluster.stop(); } } /** * Tests the proxy generated by * {@link AutoRefreshNoHARMFailoverProxyProvider} will connect to RM. */ @Test public void testConnectingToRM() throws Exception { conf.setClass(YarnConfiguration.CLIENT_FAILOVER_NO_HA_PROXY_PROVIDER, AutoRefreshNoHARMFailoverProxyProvider.class, RMFailoverProxyProvider.class); MiniYARNCluster cluster = new MiniYARNCluster("testRestartedRMNegative", NUMNODEMANAGERS, 1, 1); YarnClient rmClient = null; try { cluster.init(conf); cluster.start(); final Configuration yarnConf = cluster.getConfig(); rmClient = YarnClient.createYarnClient(); rmClient.init(yarnConf); rmClient.start(); List <NodeReport> nodeReports = rmClient.getNodeReports(); assertEquals( "The proxy didn't get expected number of node reports", NUMNODEMANAGERS, nodeReports.size()); } finally { if (rmClient != null) { rmClient.stop(); } cluster.stop(); } } /** * Test that the {@link DefaultNoHARMFailoverProxyProvider} * will generate different proxies after RM IP changed * and {@link DefaultNoHARMFailoverProxyProvider#performFailover(Object)} * get called. */ @Test public void testDefaultFPPGetOneProxy() throws Exception { // Create a proxy and mock a RMProxy Proxy mockProxy1 = new TestProxy((proxy, method, args) -> null); Class protocol = ApplicationClientProtocol.class; RMProxy mockRMProxy = mock(RMProxy.class); DefaultNoHARMFailoverProxyProvider <RMProxy> fpp = new DefaultNoHARMFailoverProxyProvider<RMProxy>(); InetSocketAddress mockAdd1 = new InetSocketAddress(RM1_PORT); // Mock RMProxy methods when(mockRMProxy.getRMAddress(any(YarnConfiguration.class), any(Class.class))).thenReturn(mockAdd1); when(mockRMProxy.getProxy(any(YarnConfiguration.class), any(Class.class), eq(mockAdd1))).thenReturn(mockProxy1); // Initialize failover proxy provider and get proxy from it. fpp.init(conf, mockRMProxy, protocol); FailoverProxyProvider.ProxyInfo<RMProxy> actualProxy1 = fpp.getProxy(); assertEquals( "AutoRefreshRMFailoverProxyProvider doesn't generate " + "expected proxy", mockProxy1, actualProxy1.proxy); // Invoke fpp.getProxy() multiple times and // validate the returned proxy is always mockProxy1 actualProxy1 = fpp.getProxy(); assertEquals( "AutoRefreshRMFailoverProxyProvider doesn't generate " + "expected proxy", mockProxy1, actualProxy1.proxy); actualProxy1 = fpp.getProxy(); assertEquals( "AutoRefreshRMFailoverProxyProvider doesn't generate " + "expected proxy", mockProxy1, actualProxy1.proxy); // verify that mockRMProxy.getProxy() is invoked once only. verify(mockRMProxy, times(1)) .getProxy(any(YarnConfiguration.class), any(Class.class), eq(mockAdd1)); // Perform Failover and get proxy again from failover proxy provider fpp.performFailover(actualProxy1.proxy); FailoverProxyProvider.ProxyInfo<RMProxy> actualProxy2 = fpp.getProxy(); assertEquals("AutoRefreshRMFailoverProxyProvider " + "doesn't generate expected proxy after failover", mockProxy1, actualProxy2.proxy); // verify that mockRMProxy.getProxy() didn't get invoked again after // performFailover() verify(mockRMProxy, times(1)) .getProxy(any(YarnConfiguration.class), any(Class.class), eq(mockAdd1)); } /** * Test that the {@link AutoRefreshNoHARMFailoverProxyProvider} * will generate different proxies after RM IP changed * and {@link AutoRefreshNoHARMFailoverProxyProvider#performFailover(Object)} * get called. */ @Test public void testAutoRefreshIPChange() throws Exception { conf.setClass(YarnConfiguration.CLIENT_FAILOVER_NO_HA_PROXY_PROVIDER, AutoRefreshNoHARMFailoverProxyProvider.class, RMFailoverProxyProvider.class); // Create two proxies and mock a RMProxy Proxy mockProxy1 = new TestProxy((proxy, method, args) -> null); Proxy mockProxy2 = new TestProxy((proxy, method, args) -> null); Class protocol = ApplicationClientProtocol.class; RMProxy mockRMProxy = mock(RMProxy.class); AutoRefreshNoHARMFailoverProxyProvider<RMProxy> fpp = new AutoRefreshNoHARMFailoverProxyProvider<RMProxy>(); // generate two address with different ports. InetSocketAddress mockAdd1 = new InetSocketAddress(RM1_PORT); InetSocketAddress mockAdd2 = new InetSocketAddress(RM2_PORT); // Mock RMProxy methods when(mockRMProxy.getRMAddress(any(YarnConfiguration.class), any(Class.class))).thenReturn(mockAdd1); when(mockRMProxy.getProxy(any(YarnConfiguration.class), any(Class.class), eq(mockAdd1))).thenReturn(mockProxy1); // Initialize proxy provider and get proxy from it. fpp.init(conf, mockRMProxy, protocol); FailoverProxyProvider.ProxyInfo <RMProxy> actualProxy1 = fpp.getProxy(); assertEquals( "AutoRefreshRMFailoverProxyProvider doesn't generate " + "expected proxy", mockProxy1, actualProxy1.proxy); // Invoke fpp.getProxy() multiple times and // validate the returned proxy is always mockProxy1 actualProxy1 = fpp.getProxy(); assertEquals( "AutoRefreshRMFailoverProxyProvider doesn't generate " + "expected proxy", mockProxy1, actualProxy1.proxy); actualProxy1 = fpp.getProxy(); assertEquals( "AutoRefreshRMFailoverProxyProvider doesn't generate " + "expected proxy", mockProxy1, actualProxy1.proxy); // verify that mockRMProxy.getProxy() is invoked once only. verify(mockRMProxy, times(1)) .getProxy(any(YarnConfiguration.class), any(Class.class), eq(mockAdd1)); // Mock RMProxy methods to generate different proxy // based on different IP address. when(mockRMProxy.getRMAddress( any(YarnConfiguration.class), any(Class.class))).thenReturn(mockAdd2); when(mockRMProxy.getProxy( any(YarnConfiguration.class), any(Class.class), eq(mockAdd2))).thenReturn(mockProxy2); // Perform Failover and get proxy again from failover proxy provider fpp.performFailover(actualProxy1.proxy); FailoverProxyProvider.ProxyInfo <RMProxy> actualProxy2 = fpp.getProxy(); assertEquals("AutoRefreshNoHARMFailoverProxyProvider " + "doesn't generate expected proxy after failover", mockProxy2, actualProxy2.proxy); // check the proxy is different with the one we created before. assertNotEquals("AutoRefreshNoHARMFailoverProxyProvider " + "shouldn't generate same proxy after failover", actualProxy1.proxy, actualProxy2.proxy); } }
{ "content_hash": "7799c4db423d8489729fe25874698688", "timestamp": "", "source": "github", "line_count": 257, "max_line_length": 79, "avg_line_length": 36.36186770428016, "alnum_prop": 0.7149277688603531, "repo_name": "steveloughran/hadoop", "id": "e7223b73eacc2242a6a3a63c2ab347cee21868c1", "size": "10151", "binary": false, "copies": "2", "ref": "refs/heads/trunk", "path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestNoHaRMFailoverProxyProvider.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "78591" }, { "name": "C", "bytes": "1974547" }, { "name": "C++", "bytes": "2861923" }, { "name": "CMake", "bytes": "115553" }, { "name": "CSS", "bytes": "117128" }, { "name": "Dockerfile", "bytes": "7311" }, { "name": "HTML", "bytes": "420629" }, { "name": "Java", "bytes": "93884754" }, { "name": "JavaScript", "bytes": "1245137" }, { "name": "Python", "bytes": "23553" }, { "name": "Shell", "bytes": "480813" }, { "name": "TLA", "bytes": "14997" }, { "name": "TSQL", "bytes": "30600" }, { "name": "TeX", "bytes": "19322" }, { "name": "XSLT", "bytes": "18026" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <!-- We must place ALL the dependencies scripts' tags BEFORE the calling script tags, otherwise it will not show on the webpage. 1. ALL: that means all the scripts, like the common.js below 2. BEFORE: that means the sequence of the browser loading the page is serial --> <script src="c5_String.js"></script> <script src="../../../common/common.js"></script> <script> lengthDemo(); containsDemo("Hello World", "w"); containsDemo("Hello World", "Hello"); lastIndexOfDemo(); </script> <!-- We should not place the dependencies scripts after the calling scripts, like below. --> <!--<script src="./c5_String.js"></script>--> </body> </html>
{ "content_hash": "692cb0af415e6d7fa67a17ae88b628d7", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 99, "avg_line_length": 34.75, "alnum_prop": 0.6151079136690647, "repo_name": "clevergump/FrontendNote", "id": "bef3f16215478286dbefe4bf350a6ca78a1bfb42", "size": "834", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "demo/Beginning_Js_demo/chapter5/String/c5_String.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
<!DOCTYPE html > <html> <head> <title>FoBoPaRes - net.liftmodules.FoBoPaRes</title> <meta name="description" content="FoBoPaRes - net.liftmodules.FoBoPaRes" /> <meta name="keywords" content="FoBoPaRes net.liftmodules.FoBoPaRes" /> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <link href="../../../lib/template.css" media="screen" type="text/css" rel="stylesheet" /> <link href="../../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" /> <script type="text/javascript" src="../../../lib/jquery.js" id="jquery-js"></script> <script type="text/javascript" src="../../../lib/jquery-ui.js"></script> <script type="text/javascript" src="../../../lib/template.js"></script> <script type="text/javascript" src="../../../lib/tools.tooltip.js"></script> <script type="text/javascript"> if(top === self) { var url = '../../../index.html'; var hash = 'net.liftmodules.FoBoPaRes.package'; var anchor = window.location.hash; var anchor_opt = ''; if (anchor.length >= 1) anchor_opt = '@' + anchor.substring(1); window.location.href = url + '#' + hash + anchor_opt; } </script> </head> <body class="value"> <div id="definition"> <img src="../../../lib/package_big.png" /> <p id="owner"><a href="../../package.html" class="extype" name="net">net</a>.<a href="../package.html" class="extype" name="net.liftmodules">liftmodules</a></p> <h1>FoBoPaRes</h1> <span class="permalink"> <a href="../../../index.html#net.liftmodules.FoBoPaRes.package" title="Permalink" target="_top"> <img src="../../../lib/permalink.png" /> </a> </span> </div> <h4 id="signature" class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">package</span> </span> <span class="symbol"> <span class="name">FoBoPaRes</span> </span> </h4> <div id="comment" class="fullcommenttop"><div class="comment cmt"><h4>FoBo Pace Resource Module</h4><p>This resource module provides JQuery resource components to the FoBo Pace Toolkit module, but can also be used as-is, see below for setup information.</p><p>If you are using this module via the FoBo/FoBo module see also <a href="../FoBo/package.html" class="extype" name="net.liftmodules.FoBo">net.liftmodules.FoBo</a> for setup information. </p></div><div class="toggleContainer block"> <span class="toggle">Linear Supertypes</span> <div class="superTypes hiddenContent"><span class="extype" name="scala.AnyRef">AnyRef</span>, <span class="extype" name="scala.Any">Any</span></div> </div></div> <div id="mbrsel"> <div id="textfilter"><span class="pre"></span><span class="input"><input id="mbrsel-input" type="text" accesskey="/" /></span><span class="post"></span></div> <div id="order"> <span class="filtertype">Ordering</span> <ol> <li class="alpha in"><span>Alphabetic</span></li> <li class="inherit out"><span>By inheritance</span></li> </ol> </div> <div id="ancestors"> <span class="filtertype">Inherited<br /> </span> <ol id="linearization"> <li class="in" name="net.liftmodules.FoBoPaRes"><span>FoBoPaRes</span></li><li class="in" name="scala.AnyRef"><span>AnyRef</span></li><li class="in" name="scala.Any"><span>Any</span></li> </ol> </div><div id="ancestors"> <span class="filtertype"></span> <ol> <li class="hideall out"><span>Hide All</span></li> <li class="showall in"><span>Show all</span></li> </ol> <a href="http://docs.scala-lang.org/overviews/scaladoc/usage.html#members" target="_blank">Learn more about member selection</a> </div> <div id="visbl"> <span class="filtertype">Visibility</span> <ol><li class="public in"><span>Public</span></li><li class="all out"><span>All</span></li></ol> </div> </div> <div id="template"> <div id="allMembers"> <div id="types" class="types members"> <h3>Type Members</h3> <ol><li name="net.liftmodules.FoBoPaRes.Resource" visbl="pub" data-isabs="true" fullComment="yes" group="Ungrouped"> <a id="ResourceextendsAnyRef"></a> <a id="Resource:Resource"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">sealed </span> <span class="kind">trait</span> </span> <span class="symbol"> <a href="package$$Resource.html"><span class="name">Resource</span></a><span class="result"> extends <span class="extype" name="scala.AnyRef">AnyRef</span></span> </span> </h4><span class="permalink"> <a href="../../../index.html#net.liftmodules.FoBoPaRes.package@ResourceextendsAnyRef" title="Permalink" target="_top"> <img src="../../../lib/permalink.png" /> </a> </span> <p class="shortcomment cmt">Initiate FoBo's Pace Resource(s) in you bootstrap liftweb Boot.</p><div class="fullcomment"><div class="comment cmt"><p>Initiate FoBo's Pace Resource(s) in you bootstrap liftweb Boot.</p><p> <b>Example:</b></p><pre><span class="kw">import</span> net.liftmodules.{FoBoPaRes <span class="kw">=&gt;</span> FoBo} : FoBo.Resource.Init=FoBo.Resource.[Resource <span class="std">Object</span>]</pre><p><b>Note:</b> To see available objects click on the round trait icon in the header of this page. </p></div></div> </li></ol> </div> <div id="values" class="values members"> <h3>Value Members</h3> <ol><li name="net.liftmodules.FoBoPaRes.Resource" visbl="pub" data-isabs="false" fullComment="no" group="Ungrouped"> <a id="Resource"></a> <a id="Resource:Resource"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">object</span> </span> <span class="symbol"> <a href="package$$Resource$.html"><span class="name">Resource</span></a><span class="result"> extends <a href="package$$Resource.html" class="extype" name="net.liftmodules.FoBoPaRes.Resource">Resource</a></span> </span> </h4><span class="permalink"> <a href="../../../index.html#net.liftmodules.FoBoPaRes.package@Resource" title="Permalink" target="_top"> <img src="../../../lib/permalink.png" /> </a> </span> </li><li name="net.liftmodules.FoBoPaRes#toString" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="toString():String"></a> <a id="toString():String"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">toString</span><span class="params">()</span><span class="result">: <span class="extype" name="java.lang.String">String</span></span> </span> </h4><span class="permalink"> <a href="../../../index.html#net.liftmodules.FoBoPaRes.package@toString():String" title="Permalink" target="_top"> <img src="../../../lib/permalink.png" /> </a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="" class="extype" name="net.liftmodules.FoBoPaRes">FoBoPaRes</a> → AnyRef → Any</dd></dl></div> </li></ol> </div> </div> <div id="inheritedMembers"> <div class="parent" name="scala.AnyRef"> <h3>Inherited from <span class="extype" name="scala.AnyRef">AnyRef</span></h3> </div><div class="parent" name="scala.Any"> <h3>Inherited from <span class="extype" name="scala.Any">Any</span></h3> </div> </div> <div id="groupedMembers"> <div class="group" name="Ungrouped"> <h3>Ungrouped</h3> </div> </div> </div> <div id="tooltip"></div> <div id="footer"> </div> </body> </html>
{ "content_hash": "ba7b97ec21f64bcb5e8c39bd3c1b6a2b", "timestamp": "", "source": "github", "line_count": 187, "max_line_length": 342, "avg_line_length": 45.80213903743316, "alnum_prop": 0.566958552247519, "repo_name": "karma4u101/FoBo-Demo", "id": "95ef5c605cf79d93393c5afe57075d3f7fbe02c0", "size": "8569", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "fobo-lift-template-demo/src/main/webapp/foboapi/older/v1.6/net/liftmodules/FoBoPaRes/package.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "375444" }, { "name": "HTML", "bytes": "168959696" }, { "name": "JavaScript", "bytes": "747776" }, { "name": "Scala", "bytes": "79384" } ], "symlink_target": "" }
set -euo pipefail root="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../../ && pwd )" . "$root/submodules/docker/lib/volumes.sh" # Associative array mapping Docker Volume names to paths. Extends array defined in Submodules Docker volumes script. VOLUMES["flexible_mink_project"]="$root" export VOLUMES # Associative array mapping Docker Volume targets to types. Extends array defined in Submodules Docker volumes script. VOLUME_TYPES["flexible_mink_project"]=$DIRECTORY export VOLUME_TYPES export PROJECT_VOLUME="flexible_mink_project"
{ "content_hash": "71358051e20d92964f9332ee6d5849b9", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 118, "avg_line_length": 35.8, "alnum_prop": 0.7560521415270018, "repo_name": "Medology/FlexibleMink", "id": "ada2646506fcb08a691446ba358132123d59de4e", "size": "558", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docker/lib/volumes.sh", "mode": "33188", "license": "mit", "language": [ { "name": "Gherkin", "bytes": "51571" }, { "name": "HTML", "bytes": "29416" }, { "name": "PHP", "bytes": "266452" }, { "name": "Shell", "bytes": "2977" } ], "symlink_target": "" }
import { Component, OnInit } from '@angular/core'; @Component({ selector: 'app-comp-4914', templateUrl: './comp-4914.component.html', styleUrls: ['./comp-4914.component.css'] }) export class Comp4914Component implements OnInit { constructor() { } ngOnInit() { } }
{ "content_hash": "a64eea122cb5b0989b2721b78d29778c", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 50, "avg_line_length": 16.58823529411765, "alnum_prop": 0.6666666666666666, "repo_name": "angular/angular-cli-stress-test", "id": "12ea09fdbaa297c871b09ec8014594b826b15282", "size": "484", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/app/components/comp-4914/comp-4914.component.ts", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1040888" }, { "name": "HTML", "bytes": "300322" }, { "name": "JavaScript", "bytes": "2404" }, { "name": "TypeScript", "bytes": "8535506" } ], "symlink_target": "" }
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /** * File Name: dowhile-006 * ECMA Section: * Description: do...while statements * * A general do...while test. * * Author: christine@netscape.com * Date: 26 August 1998 */ var SECTION = "dowhile-006"; var VERSION = "ECMA_2"; var TITLE = "do...while"; startTest(); writeHeaderToLog( SECTION + " "+ TITLE); DoWhile( new DoWhileObject( false, false, 10 ) ); DoWhile( new DoWhileObject( true, false, 2 ) ); DoWhile( new DoWhileObject( false, true, 3 ) ); DoWhile( new DoWhileObject( true, true, 4 ) ); test(); function looping( object ) { object.iterations--; if ( object.iterations <= 0 ) { return false; } else { return true; } } function DoWhileObject( breakOut, breakIn, iterations, loops ) { this.iterations = iterations; this.loops = loops; this.breakOut = breakOut; this.breakIn = breakIn; this.looping = looping; } function DoWhile( object ) { var result1 = false; var result2 = false; outie: { innie: { do { if ( object.breakOut ) break outie; if ( object.breakIn ) break innie; } while ( looping(object) ); // statements should be executed if: // do...while exits normally // do...while exits abruptly with no label result1 = true; } // statements should be executed if: // do...while breaks out with label "innie" // do...while exits normally // do...while does not break out with "outie" result2 = true; } new TestCase( SECTION, "hit code after loop in inner loop", ( object.breakIn || object.breakOut ) ? false : true , result1 ); new TestCase( SECTION, "hit code after loop in outer loop", ( object.breakOut ) ? false : true, result2 ); }
{ "content_hash": "3d1027bbaa41319efb1de8d63b26722d", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 79, "avg_line_length": 22.95505617977528, "alnum_prop": 0.6177190406265296, "repo_name": "sergecodd/FireFox-OS", "id": "0bb45ff1ad7ecd763d6672904ba88a9ec5aa213d", "size": "2043", "binary": false, "copies": "8", "ref": "refs/heads/master", "path": "B2G/gecko/js/src/tests/ecma_2/Statements/dowhile-006.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Ada", "bytes": "443" }, { "name": "ApacheConf", "bytes": "85" }, { "name": "Assembly", "bytes": "5123438" }, { "name": "Awk", "bytes": "46481" }, { "name": "Batchfile", "bytes": "56250" }, { "name": "C", "bytes": "101720951" }, { "name": "C#", "bytes": "38531" }, { "name": "C++", "bytes": "148896543" }, { "name": "CMake", "bytes": "23541" }, { "name": "CSS", "bytes": "2758664" }, { "name": "DIGITAL Command Language", "bytes": "56757" }, { "name": "Emacs Lisp", "bytes": "12694" }, { "name": "Erlang", "bytes": "889" }, { "name": "FLUX", "bytes": "34449" }, { "name": "GLSL", "bytes": "26344" }, { "name": "Gnuplot", "bytes": "710" }, { "name": "Groff", "bytes": "447012" }, { "name": "HTML", "bytes": "43343468" }, { "name": "IDL", "bytes": "1455122" }, { "name": "Java", "bytes": "43261012" }, { "name": "JavaScript", "bytes": "46646658" }, { "name": "Lex", "bytes": "38358" }, { "name": "Logos", "bytes": "21054" }, { "name": "Makefile", "bytes": "2733844" }, { "name": "Matlab", "bytes": "67316" }, { "name": "Max", "bytes": "3698" }, { "name": "NSIS", "bytes": "421625" }, { "name": "Objective-C", "bytes": "877657" }, { "name": "Objective-C++", "bytes": "737713" }, { "name": "PHP", "bytes": "17415" }, { "name": "Pascal", "bytes": "6780" }, { "name": "Perl", "bytes": "1153180" }, { "name": "Perl6", "bytes": "1255" }, { "name": "PostScript", "bytes": "1139" }, { "name": "PowerShell", "bytes": "8252" }, { "name": "Protocol Buffer", "bytes": "26553" }, { "name": "Python", "bytes": "8453201" }, { "name": "Ragel in Ruby Host", "bytes": "3481" }, { "name": "Ruby", "bytes": "5116" }, { "name": "Scilab", "bytes": "7" }, { "name": "Shell", "bytes": "3383832" }, { "name": "SourcePawn", "bytes": "23661" }, { "name": "TeX", "bytes": "879606" }, { "name": "WebIDL", "bytes": "1902" }, { "name": "XSLT", "bytes": "13134" }, { "name": "Yacc", "bytes": "112744" } ], "symlink_target": "" }
package org.sails.security.rest; import org.springframework.security.core.AuthenticationException; import org.springframework.security.web.AuthenticationEntryPoint; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; /** * Created by Nodirbek on 18.09.2015. */ public class RestAuthenticationEntryPoint implements AuthenticationEntryPoint { @Override public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException { response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Unauthorized"); } }
{ "content_hash": "610a8e30bdf02e148202cddf0b428166", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 102, "avg_line_length": 35.42857142857143, "alnum_prop": 0.7956989247311828, "repo_name": "NodirbekDeveloper/JWT_Authentication", "id": "15effe42831981ec52b1c15ed512b18d42160a5e", "size": "744", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/org/sails/security/rest/RestAuthenticationEntryPoint.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "25658" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <!-- ~ Copyright 2015-present Open Networking Laboratory ~ ~ 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.onosproject</groupId> <artifactId>onos-archetypes</artifactId> <version>1.9.0-SNAPSHOT</version> </parent> <artifactId>onos-rest-archetype</artifactId> <packaging>maven-archetype</packaging> <name>onos-rest-archetype</name> <description>ONOS REST API bundle archetype</description> </project>
{ "content_hash": "4fba97eb5f7660f40ed131955669f282", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 204, "avg_line_length": 39.34375, "alnum_prop": 0.7220015885623511, "repo_name": "y-higuchi/onos", "id": "5f7e8dc4dae0157d2c4664a426381a1c451d4ba2", "size": "1259", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tools/package/archetypes/rest/pom.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "200975" }, { "name": "HTML", "bytes": "110139" }, { "name": "Java", "bytes": "28623718" }, { "name": "JavaScript", "bytes": "3404316" }, { "name": "Protocol Buffer", "bytes": "8451" }, { "name": "Python", "bytes": "141941" }, { "name": "Shell", "bytes": "843" } ], "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_45) on Fri Dec 06 06:56:42 CET 2013 --> <meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> <title>Uses of Class eu.digitisation.io.WordScanner (ocrevalUAtion 1.2.4 API)</title> <meta name="date" content="2013-12-06"> <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 eu.digitisation.io.WordScanner (ocrevalUAtion 1.2.4 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="../../../../eu/digitisation/io/WordScanner.html" title="class in eu.digitisation.io">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?eu/digitisation/io/class-use/WordScanner.html" target="_top">Frames</a></li> <li><a href="WordScanner.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 eu.digitisation.io.WordScanner" class="title">Uses of Class<br>eu.digitisation.io.WordScanner</h2> </div> <div class="classUseContainer">No usage of eu.digitisation.io.WordScanner</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="../../../../eu/digitisation/io/WordScanner.html" title="class in eu.digitisation.io">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?eu/digitisation/io/class-use/WordScanner.html" target="_top">Frames</a></li> <li><a href="WordScanner.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; 2009&#x2013;2013 <a href="http://www.digitisation.eu/">IMPACT Centre of Competence</a>. All rights reserved.</small></p> </body> </html>
{ "content_hash": "82b7fef3194ee3ec0ef4995d702fbc32", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 165, "avg_line_length": 36.72649572649573, "alnum_prop": 0.6211310216430067, "repo_name": "impactcentre/ocrevalUAtion", "id": "f8d0c3ef55874dda3e2a328fd44a92a72011d8a5", "size": "4297", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "api/eu/digitisation/io/class-use/WordScanner.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "11139" }, { "name": "HTML", "bytes": "2001290" }, { "name": "Java", "bytes": "420322" }, { "name": "Makefile", "bytes": "370" } ], "symlink_target": "" }
{{ define "main" }} <!-- Hero --> {{ partial "hero.html" . }} <!-- Podcast --> {{ $podcast := ($.Site.Taxonomies.categories.podcast).Pages }} <!-- Date --> {{ $publishedEpisodes := where $podcast "Date.Local" "le" now }} {{ $upcomingEpisodes:= where $podcast "Date.Local" "gt" now }} <div class="section"> <div class="content"> <!-- Content --> {{ partialCached "content.html" . }} </div> </div> <div class="section"> <div class="content"> <h2>🎧 Available on</h2> <div class="section-banners u-flex--center .u-margin-top--2 v--podcast"> <!-- Anchor --> <a href="https://anchor.fm/tech-queens" rel="noopener" target="_blank"><img alt="Tech Queens on Anchor" class="lozad" data-src="/assets/img/podcast/listen/anchor.svg" loading="lazy" src="/assets/img/podcast/listen/anchor.svg" title="Tech Queens on Anchor"></a> <!-- Apple Podcasts --> <a href="https://itunes.apple.com/us/podcast/tech-queens/id1456016938" rel="noopener" target="_blank"><img alt="Tech Queens on Apple Podcasts" class="lozad" data-src="/assets/img/podcast/listen/apple-podcasts.svg" loading="lazy" src="/assets/img/podcast/listen/apple-podcasts.svg" title="Tech Queens on Apple Podcasts"></a> <!-- Google Podcasts --> <a href="https://www.google.com/podcasts?feed=aHR0cHM6Ly9hbmNob3IuZm0vcy8yOGZhMmY4L3BvZGNhc3QvcnNz" rel="noopener" target="_blank"><img alt="Tech Queens on Google Podcasts" class="lozad" data-src="/assets/img/podcast/listen/google-podcasts.svg" loading="lazy" src="/assets/img/podcast/listen/google-podcasts.svg" title="Tech Queens on Google Podcasts"></a> <a href="https://open.spotify.com/show/7l8cX4bI4aLvWqIr4lqzXh" rel="noopener" target="_blank"><img alt="Tech Queens on Spotify" class="lozad" data-src="/assets/img/podcast/listen/spotify.svg" loading="lazy" src="/assets/img/podcast/listen/spotify.svg" title="Tech Queens on Spotify"></a> <!-- Overcast --> <a href="https://overcast.fm/itunes1456016938/tech-queens" rel="noopener" target="_blank"><img alt="Tech Queens on Overcast" class="lozad" data-src="/assets/img/podcast/listen/overcast.svg" loading="lazy" src="/assets/img/podcast/listen/overcast.svg" title="Tech Queens on Overcast"></a> <!-- Pocket Casts --> <a href="https://pca.st/v7OE" rel="noopener" target="_blank"><img alt="Tech Queens on Pocket Casts" class="lozad" data-src="/assets/img/podcast/listen/pocket-casts.svg" loading="lazy" src="/assets/img/podcast/listen/pocket-casts.svg" title="Tech Queens on Pocket Casts"></a> <!-- RadioPublic --> <a href="https://radiopublic.com/tech-queens-GqkNJp" rel="noopener" target="_blank"><img alt="Tech Queens on RadioPublic" class="lozad" data-src="/assets/img/podcast/listen/radiopublic.svg" loading="lazy" src="/assets/img/podcast/listen/radiopublic.svg" title="Tech Queens on RadioPublic"></a> <!-- Breaker --> <a href="https://www.breaker.audio/tech-queens" rel="noopener" target="_blank"><img alt="Tech Queens on Breaker" class="lozad" data-src="/assets/img/podcast/listen/breaker.svg" loading="lazy" src="/assets/img/podcast/listen/breaker.svg" title="Tech Queens on Breaker"></a> <!-- RSS --> <a href="https://anchor.fm/s/28fa2f8/podcast/rss" rel="noopener" target="_blank"><img alt="Tech Queens - RSS Feed" class="lozad" data-src="/assets/img/podcast/listen/rss.svg" loading="lazy" src="/assets/img/podcast/listen/rss.svg" title="Tech Queens - RSS Feed"></a> </div> <!-- Published Episodes --> <h2>🎙️{{ len $publishedEpisodes }} Episodes</h2> <div class="columns is-multiline podcast-episodes"> {{ range $publishedEpisodes.ByDate.Reverse }} <div class="column is-half-tablet is-one-third-desktop is-one-third-widescreen is-one-third-fullhd"> {{ partial "card.html" . }} </div> {{ end }} </div> </div> </div> <!-- Footer --> {{ partialCached "footer/_index.html" . }} {{ end }}
{ "content_hash": "d1e2f035bc30df4bf7d1a157fa5558ef", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 120, "avg_line_length": 59.46376811594203, "alnum_prop": 0.6456251523275652, "repo_name": "fvcproductions/fvcproductions.github.io", "id": "e175e8ffe72a885fe24742d230d0f89653864772", "size": "4111", "binary": false, "copies": "1", "ref": "refs/heads/production", "path": "layouts/_default/podcast.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "25819" }, { "name": "HTML", "bytes": "114390" }, { "name": "JavaScript", "bytes": "11717" } ], "symlink_target": "" }
/************************************************************************************************************************/ /* common */ .dhxform_obj_dhx_web { font-family: Tahoma; float: left; line-height: normal; /*border: 1px solid yellow; /* debug */ } .dhxform_obj_dhx_web div.dhxform_base { position: relative; float: left; margin: 4px 6px; } .dhxform_obj_dhx_web div.dhxform_base_nested { padding: 0px 0px 0px 20px; clear: both; } /************************************************************************************************************************/ /* label-link, inner container, checkbox/radio */ .dhxform_obj_dhx_web div.dhxform_label div.dhxform_label_nav_link, .dhxform_obj_dhx_web div.dhxform_label div.dhxform_label_nav_link:visited, .dhxform_obj_dhx_web div.dhxform_label div.dhxform_label_nav_link:active, .dhxform_obj_dhx_web div.dhxform_label div.dhxform_label_nav_link:hover { outline: none; text-decoration: none; color: inherit; cursor: default; overflow: hidden; white-space: nowrap; } .dhxform_obj_dhx_web div.dhxform_label div.dhxform_label_nav_link:focus { color: #a7a7a7; } .dhxform_obj_dhx_web div.disabled span.nav_link { color: inherit; } /************************************************************************************************************************/ /* image, checkbox/radio */ .dhxform_obj_dhx_web div.dhxform_img { width: 18px; height: 18px; font-size: 1px; /*-moz-user-select: -moz-none;*/ } .dhxform_obj_dhx_web div.dhxform_img.chbx0, .dhxform_obj_dhx_web div.dhxform_img.chbx1, .dhxform_obj_dhx_web div.disabled div.dhxform_img.chbx0, .dhxform_obj_dhx_web div.disabled div.dhxform_img.chbx1, .dhxform_obj_dhx_web div.dhxform_img.rdbt0, .dhxform_obj_dhx_web div.dhxform_img.rdbt1, .dhxform_obj_dhx_web div.disabled div.dhxform_img.rdbt0, .dhxform_obj_dhx_web div.disabled div.dhxform_img.rdbt1 { background-image: url("../../../images/dform/dhxform_chbxrd.gif"); background-repeat: no-repeat; } .dhxform_obj_dhx_web div.dhxform_img.chbx0 { background-position: -18px 0px; } .dhxform_obj_dhx_web div.dhxform_img.chbx1 { background-position: 0px 0px; } .dhxform_obj_dhx_web div.disabled div.dhxform_img.chbx0 { background-position: -54px 0px; } .dhxform_obj_dhx_web div.disabled div.dhxform_img.chbx1 { background-position: -36px 0px; } .dhxform_obj_dhx_web div.dhxform_img.rdbt0 { background-position: -90px 0px; } .dhxform_obj_dhx_web div.dhxform_img.rdbt1 { background-position: -72px 0px; } .dhxform_obj_dhx_web div.disabled div.dhxform_img.rdbt0 { background-position: -126px 0px; } .dhxform_obj_dhx_web div.disabled div.dhxform_img.rdbt1 { background-position: -108px 0px; } /************************************************************************************************************************/ /* label, parent container */ .dhxform_obj_dhx_web div.dhxform_label { font-family: inherit; font-size: inherit; color: #000000; overflow-x: hidden; /*-moz-user-select: none;*/ overflow: hidden; white-space: nowrap; } .dhxform_obj_dhx_web div.dhxform_label.dhxform_label_align_left { text-align: left; } .dhxform_obj_dhx_web div.dhxform_label.dhxform_label_align_center { text-align: center; } .dhxform_obj_dhx_web div.dhxform_label.dhxform_label_align_right { text-align: right; } .dhxform_obj_dhx_web div.disabled div.dhxform_label, .dhxform_obj_dhx_web div.disabled div.dhxform_label div.dhxform_label_nav_link, .dhxform_obj_dhx_web div.disabled div.dhxform_label span.dhxform_item_required { color: #b1b1b1; } .dhxform_obj_dhx_web div.dhxform_label span.dhxform_item_required { margin-left: 5px; color: red; } /************************************************************************************************************************/ /* input */ .dhxform_obj_dhx_web input.dhxform_textarea { padding: 1px 0px !important; margin: 0px; font-size: 1em; } .dhxform_obj_dhx_web .dhxform_textarea { border: #8b8b8b 1px solid; font-family: Tahoma; font-size: inherit; color: #000000; /*-moz-user-select: text;*/ font-size: 1em; resize: none; } .dhxform_obj_dhx_web div.disabled .dhxform_textarea { color: #b1b1b1; background-color: #ffffff; border: #d1d1d1 1px solid; } /************************************************************************************************************************/ /* hidden input for checkbox/radio */ .dhxform_obj_dhx_web div.dhxform_control.dhxform_img_node { position: relative; } .dhxform_obj_dhx_web div.dhxform_control.dhxform_img_node .dhxform_textarea { border: 1px solid white; background-color: white; color: white; visibility: hidden; } .dhxform_obj_dhx_web div.dhxform_control.dhxform_img_node div.dhxform_img { float: none; top: 3px; left: 0px; position: absolute; margin: 0px; } /************************************************************************************************************************/ /* select */ .dhxform_obj_dhx_web .dhxform_select { border: #8b8b8b 1px solid; background-color: #ffffff; font-family: Tahoma; font-size: inherit; color: #000000; margin: 0px; font-size: 1em; } .dhxform_obj_dhx_web div.disabled .dhxform_select { color: #b1b1b1; background-color: #ffffff; border: #d1d1d1 1px solid; } /************************************************************************************************************************/ /* fieldset */ .dhxform_obj_dhx_web fieldset.dhxform_fs { border: #8b8b8b 1px solid; margin-top: 5px; padding: 5px; adisplay: inline; clear: left; width: 100%; } .dhxform_obj_dhx_web div.disabled fieldset.dhxform_fs { border: #d1d1d1 1px solid; } .dhxform_obj_dhx_web fieldset.dhxform_fs legend.fs_legend { font-family: Tahoma; color: #646464; font-size: inherit; font-weight: normal; padding: 0px 4px 1px 4px; text-align: left; } .dhxform_obj_dhx_web div.disabled fieldset.dhxform_fs legend.fs_legend { color: #b1b1b1; } /************************************************************************************************************************/ /* item node, label right */ .dhxform_obj_dhx_web div.dhxform_item_label_right { clear: both; padding-top: 4px; cursor: default; } .dhxform_obj_dhx_web div.dhxform_item_label_right div.dhxform_img { float: left; margin: 3px 5px 0px 1px; } .dhxform_obj_dhx_web div.dhxform_item_label_right div.dhxform_label { float: left; padding: 1px 0px 1px 0px; margin: 2px 0 2px 0px; } .dhxform_obj_dhx_web div.dhxform_item_label_right div.dhxform_control { float: left; margin-right: 6px; } /************************************************************************************************************************/ /* item node, label left */ .dhxform_obj_dhx_web div.dhxform_item_label_left { clear: both; padding-top: 4px; cursor: default; } .dhxform_obj_dhx_web div.dhxform_item_label_left div.dhxform_img { float: right; margin: 3px 1px 0px 5px; } .dhxform_obj_dhx_web div.dhxform_item_label_left div.dhxform_label { float: left; padding: 1px 0px 1px 0px; margin: 2px 0px 2px 0px; } .dhxform_obj_dhx_web div.dhxform_item_label_left div.dhxform_control { float: left; margin-left: 4px; } /************************************************************************************************************************/ /* item node, label top */ .dhxform_obj_dhx_web div.dhxform_item_label_top { clear: both; } .dhxform_obj_dhx_web div.dhxform_item_label_top div.dhxform_label { float: none; padding: 1px 0px 1px 0px; margin: 2px 0px 2px 0px; } .dhxform_obj_dhx_web div.dhxform_item_label_top div.dhxform_control { float: none; margin-left: 0px; } /************************************************************************************************************************/ /* item node, absolute position */ .dhxform_obj_dhx_web div.dhxform_item_absolute { position: absolute; left: 0px; top: 0px; cursor: default; } .dhxform_obj_dhx_web div.item_absolute div.dhxform_img { position: absolute; } .dhxform_obj_dhx_web div.dhxform_item_absolute div.dhxform_control, .dhxform_obj_dhx_web div.dhxform_item_absolute div.dhxform_label, .dhxform_obj_dhx_web div.dhxform_item_absolute div.dhxform_control.dhxform_img_node, .dhxform_obj_dhx_web div.dhxform_item_absolute div.dhxform_txt_label2, .dhxform_obj_dhx_web div.dhxform_item_absolute div.dhxform_btn, .dhxform_obj_dhx_web div.block_item_absolute div.dhxform_block { position: absolute; } /************************************************************************************************************************/ /* label, level 2 */ .dhxform_obj_dhx_web div.dhxform_txt_label2 { color: #646464; font-family: Tahoma; font-size: inherit; font-weight: bold; margin: 0px 3px; padding: 5px 0px; cursor: default; } .dhxform_obj_dhx_web div.disabled div.dhxform_txt_label2 { color: #B2B8BC; } /************************************************************************************************************************/ /* button */ .dhxform_obj_dhx_web div.dhxform_btn { font-size: inherit; font-family: Tahoma; height: 21px; margin: 1px 2px; float: left; cursor: default; clear: both; -moz-user-select: none; } .dhxform_obj_dhx_web div.dhxform_btn table { height: 21px; font-size: 1em; } .dhxform_obj_dhx_web div.dhxform_btn td { text-align: center; vertical-align: middle; font-size: inherit; } .dhxform_obj_dhx_web div.dhxform_btn td.btn_l, .dhxform_obj_dhx_web div.dhxform_btn td.btn_r { background-image: url("../../../images/form/dhxform_btns.gif"); background-repeat: no-repeat; width: 5px; height: 21px; font-size: 1px; } .dhxform_obj_dhx_web div.dhxform_btn td.btn_l { background-position: 0px 0px; } .dhxform_obj_dhx_web div.dhxform_btn td.btn_r { background-position: -5px 0px; } .dhxform_obj_dhx_web div.dhxform_btn td.btn_m { background-image: url("../../../images/form/dhxform_btns.gif"); background-repeat: repeat-x; background-position: 0px -21px; height: 21px; } .dhxform_obj_dhx_web div.dhxform_btn td.btn_l div.btn_l, .dhxform_obj_dhx_web div.dhxform_btn td.btn_r div.btn_r { width: 5px; height: 21px;} /* dis, over, pressed */ .dhxform_obj_dhx_web div.disabled div.dhxform_btn td.btn_l { background-position: 0px -42px !important; } .dhxform_obj_dhx_web div.disabled div.dhxform_btn td.btn_m { background-position: 0px -63px !important; } .dhxform_obj_dhx_web div.disabled div.dhxform_btn td.btn_r { background-position: -5px -42px !important; } .dhxform_obj_dhx_web div.dhxform_btn table.dhxform_btn_over td.btn_l { background-position: 0px -84px !important; } .dhxform_obj_dhx_web div.dhxform_btn table.dhxform_btn_over td.btn_m { background-position: 0px -105px !important; } .dhxform_obj_dhx_web div.dhxform_btn table.dhxform_btn_over td.btn_r { background-position: -5px -84px !important; } .dhxform_obj_dhx_web div.dhxform_btn table.dhxform_btn_pressed td.btn_l { background-position: 0px -126px !important; } .dhxform_obj_dhx_web div.dhxform_btn table.dhxform_btn_pressed td.btn_m { background-position: 0px -147px !important; } .dhxform_obj_dhx_web div.dhxform_btn table.dhxform_btn_pressed td.btn_r { background-position: -5px -126px !important; } /* label */ .dhxform_obj_dhx_web div.dhxform_btn td.btn_m div.btn_txt { font-size: inherit; font-family: Tahoma; color: #000000; padding: 0px 20px; height: 21px; line-height: 21px; vertical-align: middle; overflow: hidden; white-space: nowrap; } .dhxform_obj_dhx_web div.dhxform_btn td.btn_m div.btn_txt.btn_txt_fixed_size { padding: 0px; width: 100%; } .dhxform_obj_dhx_web div.disabled div.dhxform_btn td.btn_m div.btn_txt { color: #b1b1b1 !important; } .dhxform_obj_dhx_web div.dhxform_btn table.dhxform_btn_pressed td.btn_m div.btn_txt { top: 2px; height: 19px; } /************************************************************************************************************************/ /* note/info */ .dhxform_obj_dhx_web div.dhxform_control div.dhxform_note { font-size: 0.8em; color: gray; padding-bottom: 3px; } .dhxform_obj_dhx_web div.disabled div.dhxform_control div.dhxform_note { color: #b1b1b1; } .dhxform_obj_dhx_web div.dhxform_label span.dhxform_info { font-size: 0.6em; color: gray; margin-left: 3px; padding-bottom: 2px; line-height: 100%; vertical-align: middle; cursor: pointer; } /************************************************************************************************************************/ /* validate */ .dhxform_obj_dhx_web .validate_error .dhxform_label, .dhxform_obj_dhx_web .validate_error .dhxform_textarea, .dhxform_obj_dhx_web .validate_error .dhxform_select, .dhxform_obj_dhx_web .validate_error div.dhxform_label_nav_link, .dhxform_obj_dhx_web .validate_error div.dhxform_label div.dhxform_label_nav_link:focus { color: red; } /************************************************************************************************************************/ /* disabled combo */ .dhxform_obj_dhx_web div.disabled .dhx_combo_box.dhx_web { border: 1px solid #d1d1d1; } .dhxform_obj_dhx_web div.disabled .dhx_combo_box.dhx_web .dhx_combo_input { color: #b1b1b1; background-color: #ffffff; } /************************************************************************************************************************/ /* dhtmlxeditor */ .dhxform_obj_dhx_web div.dhxform_item_template.dhxeditor_inside { border: 1px solid #8b8b8b; } .dhxform_obj_dhx_web div.disabled div.dhxform_item_template.dhxeditor_inside { border: 1px solid #d1d1d1; } .dhxform_obj_dhx_web div.dhxform_item_template.dhxeditor_inside div.dhxcont_content_blocker { display: none; } .dhxform_obj_dhx_web div.disabled div.dhxform_item_template.dhxeditor_inside div.dhxcont_content_blocker { display: inline; position: absolute; width: 100%; height: 100%; top: 0px; left: 0px; background-color: #fefefe; filter: alpha(opacity=70); -moz-opacity: 0.7; opacity: 0.7; } /************************************************************************************************************************/ /* in window */ .dhtmlx_skin_dhx_web div.dhtmlx_wins_body_inner .dhxform_obj_dhx_web { background-color: white; } /* combo font-size */ .dhxform_obj_dhx_web div.dhxform_control .dhx_combo_box.dhx_web .dhx_combo_input, .dhx_combo_list.dhx_web_list div { font-size: 1em !important; } /************************************************************************************************************************/ /* uploader */ /* main cont */ .dhxform_obj_dhx_web .dhx_file_uploader { position: relative; width: 100%; margin-bottom: 4px; } /* buttons area */ .dhxform_obj_dhx_web .dhx_file_uploader div.dhx_upload_controls { position: relative; width: 100%; height: 35px; font-size: 2px; overflow: hidden; -moz-user-select: none; } /* buttons */ .dhxform_obj_dhx_web .dhx_file_uploader div.dhx_upload_controls div.dhx_file_uploader_button { position: absolute; width: 19px; height: 19px; top: 8px; background-image: url("../../../images/form/dhxform_upload_buttons.gif"); background-repeat: no-repeat; font-size: 2px; cursor: pointer; overflow: hidden; -moz-user-select: none; } .dhxform_obj_dhx_web .dhx_file_uploader div.dhx_upload_controls div.dhx_file_uploader_button.button_info { display: none; } .dhxform_obj_dhx_web .dhx_file_uploader div.dhx_upload_controls div.dhx_file_uploader_button.button_browse { background-position: 0px 0px; right: 108px; } .dhxform_obj_dhx_web .dhx_file_uploader div.dhx_upload_controls div.dhx_file_uploader_button.button_upload { background-position: -19px 0px; right: 79px; } .dhxform_obj_dhx_web .dhx_file_uploader div.dhx_upload_controls div.dhx_file_uploader_button.button_cancel { background-position: -57px 0px; right: 79px; } .dhxform_obj_dhx_web .dhx_file_uploader div.dhx_upload_controls div.dhx_file_uploader_button.button_clear { background-position: -38px 0px; right: 50px; } /* upload input, html5 */ .dhxform_obj_dhx_web .dhx_file_uploader div.dhx_upload_controls .dhx_uploader_input { position: absolute; left: -1000px; top: 0px; visibility: hidden; } /* upload input/form, html4 */ .dhxform_obj_dhx_web .dhx_file_uploader div.dhx_upload_controls div.dhx_file_form_cont { position: absolute; width: 19px; height: 19px; left: 0px; top: 0px; cursor: pointer; overflow: hidden; } .dhxform_obj_dhx_web .dhx_file_uploader div.dhx_upload_controls div.dhx_file_form_cont form.dhx_file_form { position: absolute; top: 0px; right: 0px; cursor: pointer; } .dhxform_obj_dhx_web .dhx_file_uploader div.dhx_upload_controls div.dhx_file_form_cont form.dhx_file_form .dhx_file_input { opacity: 0; filter: alpha(opacity=0); cursor: pointer; outline: none; height: 19px; } /* file list */ .dhxform_obj_dhx_web .dhx_file_uploader div.dhx_upload_files { position: relative; width: 100%; left: 0px; top: 0px; overflow: auto; } /* single file entry in list */ .dhxform_obj_dhx_web .dhx_file_uploader div.dhx_upload_files div.dhx_file { position: relative; width: 100%; height: 25px; overflow: hidden; } .dhxform_obj_dhx_web .dhx_file_uploader div.dhx_upload_files div.dhx_file.dhx_file_added, .dhxform_obj_dhx_web .dhx_file_uploader div.dhx_upload_files div.dhx_file.dhx_file_uploading { color: black; } .dhxform_obj_dhx_web .dhx_file_uploader div.dhx_upload_files div.dhx_file.dhx_file_uploaded { color: #646464; } .dhxform_obj_dhx_web .dhx_file_uploader div.dhx_upload_files div.dhx_file.dhx_file_fail { color: #e94a4a; } .dhxform_obj_dhx_web .dhx_file_uploader div.dhx_upload_files div.dhx_file_param { position: absolute; font-family: inherit; font-size: inherit; color: inherit; top: 0px; height: 25px; line-height: 25px; vertical-align: middle; overflow: hidden; } /* single file labels (name/size, progress, remove icon) */ .dhxform_obj_dhx_web .dhx_file_uploader div.dhx_upload_files div.dhx_file_param.dhx_file_name { left: 20px; } .dhxform_obj_dhx_web .dhx_file_uploader div.dhx_upload_files div.dhx_file_param.dhx_file_progress { right: 50px; width: 38px; text-align: right; } .dhxform_obj_dhx_web .dhx_file_uploader div.dhx_upload_files div.dhx_file_param.dhx_file_delete { right: 30px; width: 11px; background-image: url("../../../images/form/dhxform_upload_buttons.gif"); background-position: -76px 0px; background-repeat: no-repeat; cursor: pointer; -moz-user-select: none; } .dhxform_obj_dhx_web .dhx_file_uploader div.dhx_upload_files div.dhx_file_param.dhx_file_uploading { right: 50px; width: 38px; text-align: right; background-image: url("../../../images/form/dhxform_upload_uploading.gif"); background-position: center center; background-repeat: no-repeat; -moz-user-select: none; } /* title screen/button, label */ .dhxform_obj_dhx_web .dhx_file_uploader.dhx_file_uploader_title div.dhx_upload_controls { height: 60px; } .dhxform_obj_dhx_web .dhx_file_uploader.dhx_file_uploader_title div.dhx_upload_files { display: none; } .dhxform_obj_dhx_web .dhx_file_uploader.dhx_file_uploader_title div.dhx_upload_controls div.dhx_file_uploader_button.button_info { display: inline; background-image: none; font-size: 13px; height: auto; top: 0px; left: 35px; color: #a0a0a0; vertical-align: top; padding-top: 6px; line-height: 20px; cursor: default; } .dhxform_obj_dhx_web .dhx_file_uploader.dhx_file_uploader_title div.dhx_upload_controls div.dhx_file_uploader_button.button_browse { top: 0px; width: 54px; height: 54px; right: 35px; background-image: url("../../../images/form/dhxform_upload_buttons.gif"); background-position: 0px -38px; background-repeat: no-repeat; } .dhxform_obj_dhx_web .dhx_file_uploader.dhx_file_uploader_title div.dhx_upload_controls div.dhx_file_uploader_button.button_upload, .dhxform_obj_dhx_web .dhx_file_uploader.dhx_file_uploader_title div.dhx_upload_controls div.dhx_file_uploader_button.button_cancel, .dhxform_obj_dhx_web .dhx_file_uploader.dhx_file_uploader_title div.dhx_upload_controls div.dhx_file_uploader_button.button_clear { display: none; } /* title screen/html4 form */ .dhxform_obj_dhx_web .dhx_file_uploader.dhx_file_uploader_title div.dhx_upload_controls div.dhx_file_form_cont { width: 54px; height: 54px; } .dhxform_obj_dhx_web .dhx_file_uploader.dhx_file_uploader_title div.dhx_upload_controls div.dhx_file_form_cont form.dhx_file_form .dhx_file_input { height: 54px; } /* disabled */ .dhxform_obj_dhx_web .dhx_file_uploader.dhx_file_uploader_title div.dhx_upload_controls.dhx_uploader_dis div.dhx_file_uploader_button.button_info, .dhxform_obj_dhx_web .dhx_file_uploader div.dhx_upload_files.dhx_uploader_dis div.dhx_file.dhx_file_added, .dhxform_obj_dhx_web .dhx_file_uploader div.dhx_upload_files.dhx_uploader_dis div.dhx_file.dhx_file_uploading, .dhxform_obj_dhx_web .dhx_file_uploader div.dhx_upload_files.dhx_uploader_dis div.dhx_file.dhx_file_uploaded, .dhxform_obj_dhx_web .dhx_file_uploader div.dhx_upload_files.dhx_uploader_dis div.dhx_file.dhx_file_fail { color: #b2b2b2; } .dhxform_obj_dhx_web .dhx_file_uploader.dhx_file_uploader_title div.dhx_upload_controls.dhx_uploader_dis div.dhx_file_uploader_button.button_browse { background-position: -54px -38px; cursor: default; } .dhxform_obj_dhx_web .dhx_file_uploader div.dhx_upload_controls.dhx_uploader_dis div.dhx_file_form_cont { display: none; } .dhxform_obj_dhx_web .dhx_file_uploader div.dhx_upload_controls.dhx_uploader_dis div.dhx_file_uploader_button { cursor: default; } .dhxform_obj_dhx_web .dhx_file_uploader div.dhx_upload_controls.dhx_uploader_dis div.dhx_file_uploader_button.button_browse { background-position: 0px -19px; } .dhxform_obj_dhx_web .dhx_file_uploader div.dhx_upload_controls.dhx_uploader_dis div.dhx_file_uploader_button.button_upload { background-position: -19px -19px; } .dhxform_obj_dhx_web .dhx_file_uploader div.dhx_upload_controls.dhx_uploader_dis div.dhx_file_uploader_button.button_cancel { background-position: -57px -19px; } .dhxform_obj_dhx_web .dhx_file_uploader div.dhx_upload_controls.dhx_uploader_dis div.dhx_file_uploader_button.button_clear { background-position: -38px -19px; } .dhxform_obj_dhx_web .dhx_file_uploader div.dhx_upload_files.dhx_uploader_dis div.dhx_file_param.dhx_file_delete { background-position: -87px 0px; cursor: default; }
{ "content_hash": "ca3327b98d8af00fe202412713351425", "timestamp": "", "source": "github", "line_count": 691, "max_line_length": 149, "avg_line_length": 32.31837916063676, "alnum_prop": 0.6440533763209744, "repo_name": "caiyisam/jobboard", "id": "bad91bb3360da10a3924f9d3eb77d0e85867172e", "size": "22332", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/webapp/style/css/dhtmlx/dhtmlxform_dhx_web.css", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "44513" }, { "name": "Java", "bytes": "44773" }, { "name": "JavaScript", "bytes": "1870864" } ], "symlink_target": "" }
from __future__ import print_function import optparse import os import re import sys import shutil import bz2 parser = optparse.OptionParser() parser.add_option('--icudst', action='store', dest='icudst', default='deps/icu-small', help='path to target ICU directory. Will be deleted.') parser.add_option('--icu-src', action='store', dest='icusrc', default='deps/icu', help='path to source ICU directory.') parser.add_option('--icutmp', action='store', dest='icutmp', default='out/Release/obj/gen/icutmp', help='path to icutmp dir.') (options, args) = parser.parse_args() if os.path.isdir(options.icudst): print('Deleting existing icudst %s' % (options.icudst)) shutil.rmtree(options.icudst) if not os.path.isdir(options.icusrc): print('Missing source ICU dir --icusrc=%s' % (options.icusrc)) sys.exit(1) # compression stuff. Keep the suffix and the compression function in sync. compression_suffix = '.bz2' def compress_data(infp, outfp): with open(infp, 'rb') as inf: with bz2.BZ2File(outfp, 'wb') as outf: shutil.copyfileobj(inf, outf) def print_size(fn): size = (os.stat(fn).st_size) / 1024000 print('%dM\t%s' % (size, fn)) ignore_regex = re.compile('^.*\.(vcxproj|filters|nrm|icu|dat|xml|txt|ac|guess|m4|in|sub|py|mak)$') def icu_ignore(dir, files): subdir = dir[len(options.icusrc)+1::] ign = [] if len(subdir) == 0: # remove all files at root level ign = ign + files # except... ign.remove('source') if 'LICENSE' in ign: ign.remove('LICENSE') # license.html will be removed (it's obviated by LICENSE) elif 'license.html' in ign: ign.remove('license.html') elif subdir == 'source': ign = ign + ['layout','samples','test','extra','config','layoutex','allinone','data'] ign = ign + ['runConfigureICU','install-sh','mkinstalldirs','configure'] ign = ign + ['io'] elif subdir == 'source/tools': ign = ign + ['tzcode','ctestfw','gensprep','gennorm2','gendict','icuswap', 'genbrk','gencfu','gencolusb','genren','memcheck','makeconv','gencnval','icuinfo','gentest'] ign = ign + ['.DS_Store', 'Makefile', 'Makefile.in'] for file in files: if ignore_regex.match(file): ign = ign + [file] # print '>%s< [%s]' % (subdir, ign) return ign # copied from configure def icu_info(icu_full_path): uvernum_h = os.path.join(icu_full_path, 'source/common/unicode/uvernum.h') if not os.path.isfile(uvernum_h): print(' Error: could not load %s - is ICU installed?' % uvernum_h) sys.exit(1) icu_ver_major = None matchVerExp = r'^\s*#define\s+U_ICU_VERSION_SHORT\s+"([^"]*)".*' match_version = re.compile(matchVerExp) for line in open(uvernum_h).readlines(): m = match_version.match(line) if m: icu_ver_major = m.group(1) if not icu_ver_major: print(' Could not read U_ICU_VERSION_SHORT version from %s' % uvernum_h) sys.exit(1) icu_endianness = sys.byteorder[0] # TODO(srl295): EBCDIC should be 'e' return (icu_ver_major, icu_endianness) (icu_ver_major, icu_endianness) = icu_info(options.icusrc) print("Data file root: icudt%s%s" % (icu_ver_major, icu_endianness)) dst_datafile = os.path.join(options.icudst, "source","data","in", "icudt%s%s.dat" % (icu_ver_major, icu_endianness)) src_datafile = os.path.join(options.icusrc, "source/data/in/icudt%sl.dat" % (icu_ver_major)) dst_cmp_datafile = "%s%s" % (dst_datafile, compression_suffix) if not os.path.isfile(src_datafile): print("Error: icu data file not found: %s" % src_datafile) exit(1) print("will use datafile %s" % (src_datafile)) print('%s --> %s' % (options.icusrc, options.icudst)) shutil.copytree(options.icusrc, options.icudst, ignore=icu_ignore) # now, make the data dir (since we ignored it) icudst_data = os.path.join(options.icudst, "source", "data") icudst_in = os.path.join(icudst_data, "in") os.mkdir(icudst_data) os.mkdir(icudst_in) print_size(src_datafile) print('%s --compress-> %s' % (src_datafile, dst_cmp_datafile)) compress_data(src_datafile, dst_cmp_datafile) print_size(dst_cmp_datafile) readme_name = os.path.join(options.icudst, "README-FULL-ICU.txt" ) # Now, print a short notice msg_fmt = """\ ICU sources - auto generated by shrink-icu-src.py\n This directory contains the ICU subset used by --with-intl=full-icu It is a strict subset of ICU {} source files with the following exception(s): * {} : compressed data file\n\n To rebuild this directory, see ../../tools/icu/README.md\n""" with open(readme_name, 'w') as out_file: print(msg_fmt.format(icu_ver_major, dst_cmp_datafile), file=out_file)
{ "content_hash": "e33551c85815589891609c7e1ee07393", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 116, "avg_line_length": 34.56521739130435, "alnum_prop": 0.6457023060796646, "repo_name": "enclose-io/compiler", "id": "3a9ba2fbfbf11833cae361bb9c3a4a4be808c9aa", "size": "4792", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "current/tools/icu/shrink-icu-src.py", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "11474" }, { "name": "Shell", "bytes": "131" } ], "symlink_target": "" }
<?php namespace Enneite\SwaggerBundle\Security; use Symfony\Component\HttpFoundation\Request; class SecurityDefinition { /** * @var string */ protected $type; /** * @var string */ protected $description; /** * @var string */ protected $name; /** * @var string */ protected $in; /** * @var string */ protected $flow; /** * @var string */ protected $authorizationUrl; /** * @var string */ protected $tokenUrl; /** * @var array */ protected $scopes = array(); /** * @param string $authorizationUrl */ public function setAuthorizationUrl($authorizationUrl) { $this->authorizationUrl = $authorizationUrl; return $this; } /** * @return string */ public function getAuthorizationUrl() { return $this->authorizationUrl; } /** * @param string $description */ public function setDescription($description) { $this->description = $description; return $this; } /** * @return string */ public function getDescription() { return $this->description; } /** * @param string $flow */ public function setFlow($flow) { $this->flow = $flow; return $this; } /** * @return string */ public function getFlow() { return $this->flow; } /** * @param string $in */ public function setIn($in) { $this->in = $in; return $this; } /** * @return string */ public function getIn() { return $this->in; } /** * @param string $name */ public function setName($name) { $this->name = $name; return $this; } /** * @return string */ public function getName() { return $this->name; } /** * @param array $scopes */ public function setScopes($scopes) { $this->scopes = $scopes; return $this; } /** * @return array */ public function getScopes() { return $this->scopes; } /** * @param string $tokenUrl */ public function setTokenUrl($tokenUrl) { $this->tokenUrl = $tokenUrl; return $this; } /** * @return string */ public function getTokenUrl() { return $this->tokenUrl; } /** * @param string $type */ public function setType($type) { $this->type = $type; return $this; } /** * @return string */ public function getType() { return $this->type; } /** * extract access token from the current http request * * @param Request $request * @return array|mixed|null|string */ public function extractAccessToken(Request $request) { $accessToken = null; if($this->getIn() == 'query') { $obj = $request->query; } else { $obj = $request->headers; } if($obj->has($this->getName())) { $accessToken = $obj->get($this->getName()); } return $accessToken; } }
{ "content_hash": "347457123ea7c9afe6a063f421f46ace", "timestamp": "", "source": "github", "line_count": 219, "max_line_length": 58, "avg_line_length": 15.205479452054794, "alnum_prop": 0.4810810810810811, "repo_name": "enneite/swagger-bundle", "id": "63901e6581c54cbafe87a6555d33e304dac3aa14", "size": "3330", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Security/SecurityDefinition.php", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "5581" }, { "name": "PHP", "bytes": "167415" } ], "symlink_target": "" }
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>jQueryMobile - Using Grids</title> <meta name="viewport" content="width=device-width, initial-scale=1" /> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" /> <script src="//code.jquery.com/jquery-1.11.2.min.js"></script> <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script> <link href="style/Style.css" rel="stylesheet" /> </head> <body> <div data-role="page" id="page1"> <div data-role="header" data-position="fixed"> <h1>jQueryMobile</h1> <a href="#" class="ui-btn ui-icon-grid ui-btn-icon-left ui-shadow ui-corner-all">Options</a> <div data-role="navbar"> <ul> <li><a href="#" data-icon="home" class="ui-shadow ui-corner-all">Home</a></li> <li><a href="#" data-icon="lock" class="ui-shadow ui-corner-all">lock</a></li> <li><a href="#" data-icon="search" class="ui-shadow ui-corner-all">Search</a></li> </ul> </div> </div> <div data-role="main" class="ui-content"> <h1>Grids</h1> <p><b>This is a small App to exemplify Using Grids on jQueryMobile.</b></p> <p>jQuery Mobile has a set of built in CSS3 column layouts, meant to position buttons , navigation tabs, etc , as if it was in a table. </p> <p>This is accomplished by using the <b>ui-grid-solo|a|b|c|d</b> classes for the parent div, and <b>ui-block-a|b|c|d|e</b> for the elements</p> <div class="ui-grid-solo"> <h4>One-column Layout</h4> <div class="ui-block-a"> <a href="#message" data-rel="dialog" data-transition="pop" class="ui-btn ui-icon-grid ui-btn-icon-left ui-shadow ui-corner-all">Options</a> </div> </div> <div class="ui-grid-a"> <h4>Two-columns Layout</h4> <div class="ui-block-a"> <a href="#message" data-rel="dialog" data-transition="pop" class="ui-btn ui-icon-grid ui-btn-icon-left ui-shadow ui-corner-all">Options</a> </div> <div class="ui-block-b"> <a href="#message" data-rel="dialog" data-transition="pop" class="ui-btn ui-icon-info ui-btn-icon-right ui-shadow ui-corner-all">Info</a> </div> </div> <div class="ui-grid-b"> <h4>Three-columns Layout</h4> <div class="ui-block-a"> <a href="#message" data-rel="dialog" data-transition="pop" class="ui-btn ui-icon-grid ui-btn-icon-left ui-btn-icon-notext ui-shadow ui-corner-all"></a> </div> <div class="ui-block-b"> <a href="#message" data-rel="dialog" data-transition="pop" class="ui-btn ui-icon-info ui-btn-icon-right ui-btn-icon-notext ui-shadow ui-corner-all"></a> </div> <div class="ui-block-b"> <a href="#message" data-rel="dialog" data-transition="pop" class="ui-btn ui-icon-info ui-btn-icon-right ui-btn-icon-notext ui-shadow ui-corner-all"></a> </div> </div>
{ "content_hash": "e2b3cad738d0257b40ec2b2561ded4f8", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 155, "avg_line_length": 47.726027397260275, "alnum_prop": 0.5232491389207807, "repo_name": "CarmelSchvartzman/jQueryMobile_Grids", "id": "e698efe6f3accb599c931ad05d811622a3e348c9", "size": "3484", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "jQueryMobileGrids.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "229" }, { "name": "HTML", "bytes": "3484" } ], "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_05) on Mon Jul 09 21:14:46 EDT 2012 --> <title>tutorials.clustering (Java Machine Learning Library 0.1.7)</title> <meta name="date" content="2012-07-09"> <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="tutorials.clustering (Java Machine Learning Library 0.1.7)"; } //--> </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 class="navBarCell1Rev">Package</li> <li>Class</li> <li><a href="package-use.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../deprecated-list.html">Deprecated</a></li> <li><a href="../../index-all.html">Index</a></li> <li><a href="../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../tutorials/classification/package-summary.html">Prev Package</a></li> <li><a href="../../tutorials/core/package-summary.html">Next Package</a></li> </ul> <ul class="navList"> <li><a href="../../index.html?tutorials/clustering/package-summary.html" target="_top">Frames</a></li> <li><a href="package-summary.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"> <h1 title="Package" class="title">Package&nbsp;tutorials.clustering</h1> <div class="docSummary"> <div class="block"> Provides tutorials for the Clustering interface.</div> </div> <p>See:&nbsp;<a href="#package_description">Description</a></p> </div> <div class="contentContainer"> <ul class="blockList"> <li class="blockList"> <table class="packageSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation"> <caption><span>Class Summary</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Class</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="../../tutorials/clustering/TutorialClusterEvaluation.html" title="class in tutorials.clustering">TutorialClusterEvaluation</a></td> <td class="colLast"> <div class="block">Shows how to use the different cluster evaluation measure that are implemented in Java-ML.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="../../tutorials/clustering/TutorialKMeans.html" title="class in tutorials.clustering">TutorialKMeans</a></td> <td class="colLast"> <div class="block">This tutorial shows how to use a clustering algorithm to cluster a data set.</div> </td> </tr> </tbody> </table> </li> </ul> <a name="package_description"> <!-- --> </a> <h2 title="Package tutorials.clustering Description">Package tutorials.clustering Description</h2> <div class="block"><p> Provides tutorials for the Clustering interface. These tutorials show how you can construct objects from classes that implement the Clustering interface. </p> <!-- Put @see and @since tags down here. --></div> </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 class="navBarCell1Rev">Package</li> <li>Class</li> <li><a href="package-use.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../deprecated-list.html">Deprecated</a></li> <li><a href="../../index-all.html">Index</a></li> <li><a href="../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../tutorials/classification/package-summary.html">Prev Package</a></li> <li><a href="../../tutorials/core/package-summary.html">Next Package</a></li> </ul> <ul class="navList"> <li><a href="../../index.html?tutorials/clustering/package-summary.html" target="_top">Frames</a></li> <li><a href="package-summary.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small> <i>Copyright &#169; 2006-2012 - <a target=_blank href=http://www.abeel.be/>Thomas Abeel</a> - All Rights Reserved.</i> <a href=http://sourceforge.net><img src=http://sflogo.sourceforge.net/sflogo.php?group_id=179204&amp;type=1 width=88 height=31 border=0 alt=SourceForge.netLogo /></a> </small></p> </body> </html>
{ "content_hash": "e24c1fc974c0c366613f6db790080d18", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 169, "avg_line_length": 35.71951219512195, "alnum_prop": 0.6582451348583134, "repo_name": "diyerland/saveAll", "id": "6a6812653bff1356b219f642ac7e0c3c523880d5", "size": "5858", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "algorithm/java-ml/javaml-0.1.7/doc/tutorials/clustering/package-summary.html", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "75749" }, { "name": "C++", "bytes": "11982" }, { "name": "CSS", "bytes": "18660" }, { "name": "Common Lisp", "bytes": "1055371" }, { "name": "HTML", "bytes": "6248394" }, { "name": "Java", "bytes": "2587506" }, { "name": "JavaScript", "bytes": "13851" }, { "name": "NewLisp", "bytes": "63514" }, { "name": "Prolog", "bytes": "154747" }, { "name": "Scilab", "bytes": "621002" }, { "name": "Shell", "bytes": "33" } ], "symlink_target": "" }
<?php # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/ads/googleads/v12/services/customer_customizer_service.proto namespace Google\Ads\GoogleAds\V12\Services; use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\GPBUtil; /** * A single operation (create, remove) on an customizer attribute. * * Generated from protobuf message <code>google.ads.googleads.v12.services.CustomerCustomizerOperation</code> */ class CustomerCustomizerOperation extends \Google\Protobuf\Internal\Message { protected $operation; /** * Constructor. * * @param array $data { * Optional. Data for populating the Message object. * * @type \Google\Ads\GoogleAds\V12\Resources\CustomerCustomizer $create * Create operation: No resource name is expected for the new customer * customizer * @type string $remove * Remove operation: A resource name for the removed customer customizer is * expected, in this format: * `customers/{customer_id}/customerCustomizers/{customizer_attribute_id}` * } */ public function __construct($data = NULL) { \GPBMetadata\Google\Ads\GoogleAds\V12\Services\CustomerCustomizerService::initOnce(); parent::__construct($data); } /** * Create operation: No resource name is expected for the new customer * customizer * * Generated from protobuf field <code>.google.ads.googleads.v12.resources.CustomerCustomizer create = 1;</code> * @return \Google\Ads\GoogleAds\V12\Resources\CustomerCustomizer|null */ public function getCreate() { return $this->readOneof(1); } public function hasCreate() { return $this->hasOneof(1); } /** * Create operation: No resource name is expected for the new customer * customizer * * Generated from protobuf field <code>.google.ads.googleads.v12.resources.CustomerCustomizer create = 1;</code> * @param \Google\Ads\GoogleAds\V12\Resources\CustomerCustomizer $var * @return $this */ public function setCreate($var) { GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V12\Resources\CustomerCustomizer::class); $this->writeOneof(1, $var); return $this; } /** * Remove operation: A resource name for the removed customer customizer is * expected, in this format: * `customers/{customer_id}/customerCustomizers/{customizer_attribute_id}` * * Generated from protobuf field <code>string remove = 2 [(.google.api.resource_reference) = {</code> * @return string */ public function getRemove() { return $this->readOneof(2); } public function hasRemove() { return $this->hasOneof(2); } /** * Remove operation: A resource name for the removed customer customizer is * expected, in this format: * `customers/{customer_id}/customerCustomizers/{customizer_attribute_id}` * * Generated from protobuf field <code>string remove = 2 [(.google.api.resource_reference) = {</code> * @param string $var * @return $this */ public function setRemove($var) { GPBUtil::checkString($var, True); $this->writeOneof(2, $var); return $this; } /** * @return string */ public function getOperation() { return $this->whichOneof("operation"); } }
{ "content_hash": "307f5d6b9afa885030bb9affcbb82171", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 116, "avg_line_length": 30.316239316239315, "alnum_prop": 0.6461798703129406, "repo_name": "googleads/google-ads-php", "id": "2f1aae0cf6f153277e0bb8d7b84fbda61a334e39", "size": "3547", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "src/Google/Ads/GoogleAds/V12/Services/CustomerCustomizerOperation.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "899" }, { "name": "PHP", "bytes": "9952711" }, { "name": "Shell", "bytes": "338" } ], "symlink_target": "" }
import { Command } from "./Command"; import { CommandResult } from "./CommandResult"; import { LineResults } from "./LineResults"; /** * A command for the end of a foreach loop. */ export class ForEachEndCommand extends Command { /** * Renders the command for a language with the given parameters. * * @param parameters The command's name, followed by any parameters. * @returns Line(s) of code in the language. */ public render(parameters: string[]): LineResults { let ender: string = this.language.properties.loops.forEachEnd; return new LineResults([new CommandResult(ender, -1)], false); } }
{ "content_hash": "c1116ac0bd55eb897f618c729e81453e", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 74, "avg_line_length": 32.8, "alnum_prop": 0.6661585365853658, "repo_name": "chris-j-tang/GLS", "id": "13ce5785eafd5ce34f6c4c6b9d3db2bfe0debcfa", "size": "656", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Commands/ForEachEndCommand.ts", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "7821" }, { "name": "Java", "bytes": "8752" }, { "name": "JavaScript", "bytes": "11928" }, { "name": "Python", "bytes": "6233" }, { "name": "Ruby", "bytes": "6104" }, { "name": "Smalltalk", "bytes": "1122" }, { "name": "TypeScript", "bytes": "388906" } ], "symlink_target": "" }
package com.scalaAsm.x86 package Instructions package General // Description: Load Far Pointer // Category: general/datamovsegreg trait LFS extends InstructionDefinition { val mnemonic = "LFS" } object LFS extends TwoOperands[LFS] with LFSImpl trait LFSImpl extends LFS { implicit object _0 extends TwoOp[r16, m] { val opcode: TwoOpcodes = (0x0F, 0xB4) /r val format = RegRmFormat override def hasImplicitOperand = true } implicit object _1 extends TwoOp[r32, m] { val opcode: TwoOpcodes = (0x0F, 0xB4) /r val format = RegRmFormat override def hasImplicitOperand = true } implicit object _2 extends TwoOp[r64, m] { val opcode: TwoOpcodes = (0x0F, 0xB4) /r override def prefix = REX.W(true) val format = RegRmFormat override def hasImplicitOperand = true } }
{ "content_hash": "a283f669933f55f937802ff19aaee65d", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 48, "avg_line_length": 24.78787878787879, "alnum_prop": 0.7102689486552567, "repo_name": "bdwashbu/scala-x86-inst", "id": "5f2ac131b853306de059b5c9b9c9c0675c9cba27", "size": "818", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/scala/com/scalaAsm/x86/Instructions/General/LFS.scala", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Scala", "bytes": "237246" } ], "symlink_target": "" }